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

Methods

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
since
4.0.0
Return values
array<string|int, 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
since
4.0.0
Return values
PaymentIntent|WP_Error|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
since
4.0.0

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
since
4.0.0

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
since
4.0.0
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
since
4.0.0
Return values
bool

        
On this page

Search results