WC_Stripe_Customer_Manager
in package
Class that manages customer creation and custom updates.
Tags
Table of Contents
Properties
- $_instance : mixed
Methods
- __construct() : mixed
- checkout_update_customer() : mixed
- create_customer() : Customer|WP_Error
- handle_before_process_payment() : void
- instance() : mixed
- should_create_when_account_exists() : bool
- Returns true if the plugin should create a Stripe customer if the user has an account with the store
- should_create_when_payment() : bool
- Returns true if the plugin should create a Stripe customer when the payment is being processed.
- sync_payment_methods() : mixed
- Syncs the WC database payment methods with the payment methods stored in Stripe.
- update_customer() : mixed
- wp_loaded() : mixed
- Check if the Stripe customer has been created for the WC user.
- get_attribute_keys() : array<string|int, mixed>
- Returns an array of user attributes.
- get_customer_args() : array<string|int, mixed>
- Return an array of args used to create or update a customer.
- get_customer_args_from_order() : mixed
- get_customer_id_from_user_id() : mixed
- should_update_customer() : bool
- Returns true if the customer should be updated in Stripe.
- user_has_id() : mixed
Properties
$_instance
private
static mixed
$_instance
Methods
__construct()
public
__construct() : mixed
checkout_update_customer()
public
checkout_update_customer(WC_Customer $customer, array<string|int, mixed> $data) : mixed
Parameters
- $customer : WC_Customer
- $data : array<string|int, mixed>
create_customer()
public
create_customer(WC_Customer $customer[, mixed $mode = null ]) : Customer|WP_Error
Parameters
- $customer : WC_Customer
- $mode : mixed = null
Return values
Customer|WP_Errorhandle_before_process_payment()
public
handle_before_process_payment(WC_Order $order, string $gateway_id) : void
Parameters
- $order : WC_Order
- $gateway_id : string
instance()
public
static instance() : mixed
should_create_when_account_exists()
Returns true if the plugin should create a Stripe customer if the user has an account with the store
public
should_create_when_account_exists() : bool
Tags
Return values
boolshould_create_when_payment()
Returns true if the plugin should create a Stripe customer when the payment is being processed.
public
should_create_when_payment() : bool
Tags
Return values
boolsync_payment_methods()
Syncs the WC database payment methods with the payment methods stored in Stripe.
public
static sync_payment_methods(string $customer_id, int $user_id[, mixed $mode = '' ]) : mixed
Parameters
- $customer_id : string
- $user_id : int
- $mode : mixed = ''
Tags
update_customer()
public
update_customer(WC_Customer $customer) : mixed
Parameters
- $customer : WC_Customer
wp_loaded()
Check if the Stripe customer has been created for the WC user.
public
wp_loaded() : mixed
If there is no Stripe customer then create one and save it to the WC user.
get_attribute_keys()
Returns an array of user attributes.
private
get_attribute_keys() : array<string|int, mixed>
Return values
array<string|int, mixed>get_customer_args()
Return an array of args used to create or update a customer.
private
get_customer_args(WC_Customer $customer[, string $context = 'create' ]) : array<string|int, mixed>
Parameters
- $customer : WC_Customer
- $context : string = 'create'
Tags
Return values
array<string|int, mixed>get_customer_args_from_order()
private
get_customer_args_from_order(WC_Order $order) : mixed
Parameters
- $order : WC_Order
get_customer_id_from_user_id()
private
get_customer_id_from_user_id(mixed $user_id) : mixed
Parameters
- $user_id : mixed
should_update_customer()
Returns true if the customer should be updated in Stripe.
private
should_update_customer(WC_Customer $customer) : bool
Parameters
- $customer : WC_Customer
Return values
booluser_has_id()
private
user_has_id(mixed $customer) : mixed
Parameters
- $customer : mixed