PHP Class WC_Addons_Gateway_Simplify_Commerce

Since: 2.2.0
Author: WooThemes
Inheritance: extends WC_Gateway_Simplify_Commerce
显示文件 Open project: woocommerce/woocommerce Class Usage Examples

Public Methods

Method Description
__construct ( ) Constructor.
add_subscription_payment_meta ( array $payment_meta, WC_Subscription $subscription ) : array Include the payment meta data required to process automatic recurring payments so that store managers can.
delete_resubscribe_meta ( integer $resubscribe_order ) : void Don't transfer customer meta to resubscribe orders.
hosted_payment_args ( array $args, integer $order_id ) : array Hosted payment args.
process_payment ( integer $order_id ) : array Process the payment.
process_pre_order_release_payment ( WC_Order $order ) : WP_Error | null Process a pre-order payment when the pre-order is released.
process_subscription_payment ( WC_order $order, integer $amount ) : boolean | WP_Error process_subscription_payment function.
return_handler ( ) Return handler for Hosted Payments.
scheduled_subscription_payment ( float $amount_to_charge, WC_Order $renewal_order ) scheduled_subscription_payment function.
update_failing_payment_method ( WC_Subscription $subscription, WC_Order $renewal_order ) Update the customer_id for a subscription after using Simplify to complete a payment to make up for.
validate_subscription_payment_meta ( string $payment_method_id, array $payment_meta ) : array Validate the payment meta data required to process automatic recurring payments so that store managers can.

Protected Methods

Method Description
order_contains_pre_order ( integer $order_id ) : boolean Check if order contains pre-orders.
order_contains_subscription ( integer $order_id ) : boolean Check if order contains subscriptions.
process_pre_order ( WC_Order $order, string $cart_token = '' ) : array Process the pre-order.
process_subscription ( WC_Order $order, string $cart_token = '' ) : array Process the subscription.
save_subscription_meta ( integer $order_id, string $customer_id ) Store the customer and card IDs on the order and subscriptions in the order.

Method Details

__construct() public method

Constructor.
public __construct ( )

add_subscription_payment_meta() public method

manually set up automatic recurring payments for a customer via the Edit Subscription screen in Subscriptions v2.0+.
Since: 2.4
public add_subscription_payment_meta ( array $payment_meta, WC_Subscription $subscription ) : array
$payment_meta array associative array of meta data required for automatic payments
$subscription WC_Subscription An instance of a subscription object
return array

delete_resubscribe_meta() public method

Don't transfer customer meta to resubscribe orders.
public delete_resubscribe_meta ( integer $resubscribe_order ) : void
$resubscribe_order integer The order created for the customer to resubscribe to the old expired/cancelled subscription
return void

hosted_payment_args() public method

Hosted payment args.
public hosted_payment_args ( array $args, integer $order_id ) : array
$args array
$order_id integer
return array

order_contains_pre_order() protected method

Check if order contains pre-orders.
protected order_contains_pre_order ( integer $order_id ) : boolean
$order_id integer
return boolean

order_contains_subscription() protected method

Check if order contains subscriptions.
protected order_contains_subscription ( integer $order_id ) : boolean
$order_id integer
return boolean

process_payment() public method

Process the payment.
public process_payment ( integer $order_id ) : array
$order_id integer
return array

process_pre_order() protected method

Process the pre-order.
protected process_pre_order ( WC_Order $order, string $cart_token = '' ) : array
$order WC_Order
$cart_token string
return array

process_pre_order_release_payment() public method

Process a pre-order payment when the pre-order is released.
public process_pre_order_release_payment ( WC_Order $order ) : WP_Error | null
$order WC_Order
return WP_Error | null

process_subscription() protected method

Process the subscription.
protected process_subscription ( WC_Order $order, string $cart_token = '' ) : array
$order WC_Order
$cart_token string
return array

process_subscription_payment() public method

process_subscription_payment function.
public process_subscription_payment ( WC_order $order, integer $amount ) : boolean | WP_Error
$order WC_order
$amount integer (default: 0)
return boolean | WP_Error

return_handler() public method

Return handler for Hosted Payments.
public return_handler ( )

save_subscription_meta() protected method

Store the customer and card IDs on the order and subscriptions in the order.
protected save_subscription_meta ( integer $order_id, string $customer_id )
$order_id integer
$customer_id string

scheduled_subscription_payment() public method

scheduled_subscription_payment function.
public scheduled_subscription_payment ( float $amount_to_charge, WC_Order $renewal_order )
$amount_to_charge float The amount to charge.
$renewal_order WC_Order A WC_Order object created to record the renewal payment.

update_failing_payment_method() public method

an automatic renewal payment which previously failed.
public update_failing_payment_method ( WC_Subscription $subscription, WC_Order $renewal_order )
$subscription WC_Subscription The subscription for which the failing payment method relates.
$renewal_order WC_Order The order which recorded the successful payment (to make up for the failed automatic payment).

validate_subscription_payment_meta() public method

manually set up automatic recurring payments for a customer via the Edit Subscription screen in Subscriptions 2.0+.
Since: 2.4
public validate_subscription_payment_meta ( string $payment_method_id, array $payment_meta ) : array
$payment_method_id string The ID of the payment method to validate
$payment_meta array associative array of meta data required for automatic payments
return array