InstallmentController
in package
Table of Contents
Properties
- $account_settings : WC_Stripe_Account_Settings
- $advanced_settings : WC_Stripe_Advanced_Settings
- $client : StripeClient
- $formatter : InstallmentFormatter
Methods
- __construct() : mixed
- add_confirmation_args() : mixed
- add_installment_data() : array<string|int, mixed>
- Decorates the credit card gateway's script data with a payment intent client secret when installments are available. This allows the Stripe Payment Element to render installment options natively.
- add_order_item_total() : mixed
- add_order_meta() : mixed
- can_update_payment_intent() : mixed
- get_or_create_installment_intent() : PaymentIntent|WP_Error|null
- Retrieves an existing payment intent from the session or creates a new one with installments enabled.
- get_supported_countries() : mixed
- get_supported_currencies() : mixed
- initialize() : mixed
- is_available() : mixed
- maybe_update_installment_intent() : mixed
- Updates the installment payment intent if the cart total or currency has changed.
- on_update_order_review() : mixed
- Schedules a payment intent update after cart totals are calculated.
- cart_filters_factory() : array<string|int, CurrencyFilter>
- get_installment_intent_params() : array<string|int, mixed>
- Builds the parameters for creating a payment intent with installments enabled.
- intent_needs_update() : bool
- Determines if an existing payment intent needs to be updated by comparing a hash of the current parameters against the intent's values.
- is_active() : mixed
- order_filters_factory() : mixed
- process_advanced_settings_options() : mixed
Properties
$account_settings
private
WC_Stripe_Account_Settings
$account_settings
$advanced_settings
private
WC_Stripe_Advanced_Settings
$advanced_settings
$client
private
StripeClient
$client
$formatter
private
InstallmentFormatter
$formatter
Methods
__construct()
public
__construct(StripeClient $client, WC_Stripe_Advanced_Settings $advanced_settings, WC_Stripe_Account_Settings $account_settings) : mixed
Parameters
- $client : StripeClient
- $advanced_settings : WC_Stripe_Advanced_Settings
- $account_settings : WC_Stripe_Account_Settings
add_confirmation_args()
public
add_confirmation_args(mixed $args, PaymentIntent $intent) : mixed
Parameters
- $args : mixed
- $intent : PaymentIntent
add_installment_data()
Decorates the credit card gateway's script data with a payment intent client secret when installments are available. This allows the Stripe Payment Element to render installment options natively.
public
add_installment_data(array<string|int, mixed> $data, PaymentGatewayRegistry $registry, ContextHandler $context) : array<string|int, mixed>
Parameters
- $data : array<string|int, mixed>
- $registry : PaymentGatewayRegistry
- $context : ContextHandler
Tags
Return values
array<string|int, mixed>add_order_item_total()
public
add_order_item_total(mixed $rows, WC_Order $order) : mixed
Parameters
- $rows : mixed
- $order : WC_Order
add_order_meta()
public
add_order_meta(WC_Order $order, WC_Payment_Gateway_Stripe $payment_method, Charge $charge) : mixed
Parameters
- $order : WC_Order
- $payment_method : WC_Payment_Gateway_Stripe
- $charge : Charge
can_update_payment_intent()
public
can_update_payment_intent(mixed $can_update, mixed $intent) : mixed
Parameters
- $can_update : mixed
- $intent : mixed
get_or_create_installment_intent()
Retrieves an existing payment intent from the session or creates a new one with installments enabled.
public
get_or_create_installment_intent([WC_Order|null $order = null ]) : PaymentIntent|WP_Error|null
Parameters
- $order : WC_Order|null = null
Tags
Return values
PaymentIntent|WP_Error|nullget_supported_countries()
public
static get_supported_countries() : mixed
get_supported_currencies()
public
static get_supported_currencies() : mixed
initialize()
public
initialize() : mixed
is_available()
public
is_available([mixed $order = null ]) : mixed
Parameters
- $order : mixed = null
maybe_update_installment_intent()
Updates the installment payment intent if the cart total or currency has changed.
public
maybe_update_installment_intent() : mixed
Called after cart totals are calculated during the update_order_review AJAX flow.
Tags
on_update_order_review()
Schedules a payment intent update after cart totals are calculated.
public
on_update_order_review(string $posted_data) : mixed
Triggered by the update_order_review AJAX call (billing country change, coupon, etc.). Adds a one-time callback to woocommerce_after_calculate_totals since cart totals aren't ready when woocommerce_checkout_update_order_review fires.
Parameters
- $posted_data : string
Tags
cart_filters_factory()
private
cart_filters_factory() : array<string|int, CurrencyFilter>
Return values
array<string|int, CurrencyFilter>get_installment_intent_params()
Builds the parameters for creating a payment intent with installments enabled.
private
get_installment_intent_params([WC_Order|null $order = null ]) : array<string|int, mixed>
Parameters
- $order : WC_Order|null = null
Tags
Return values
array<string|int, mixed>intent_needs_update()
Determines if an existing payment intent needs to be updated by comparing a hash of the current parameters against the intent's values.
private
intent_needs_update(PaymentIntent|stdClass $intent, array<string|int, mixed> $params) : bool
Parameters
- $intent : PaymentIntent|stdClass
- $params : array<string|int, mixed>
Tags
Return values
boolis_active()
private
is_active() : mixed
order_filters_factory()
private
order_filters_factory(WC_Order $order) : mixed
Parameters
- $order : WC_Order
process_advanced_settings_options()
private
process_advanced_settings_options() : mixed