WC_Payment_Gateway_Stripe_ApplePay extends WC_Payment_Gateway_Stripe uses WC_Stripe_Payment_Intent_Trait, TokenizationTrait, ExpressCheckoutTrait, PreOrdersTrait, WooCommerceSubscriptionsTrait

Legacy and deprecated methods are kept here to keep the new AbstractGateway clean. This class ensures compatability with 3rd party code that uses these methods.

Tags
author

PaymentPlugins

Table of Contents

Properties

$client  : StripeClient
$has_parent_gateway  : mixed
$id  : mixed
$is_voucher_payment  : bool
$last_payment_error  : WP_Error
$payment_controller  : WC_Stripe_Payment_Intent
$payment_intent_key  : string
$payment_method_token  : string
$payment_token_object  : WC_Payment_Token_Stripe
$payment_type_key  : string
This property is used to determine if a customer is using a saved payment method or a new payment method.
$PreOrdersTraitFeatures  : array<string|int, mixed>
$processing_payment  : bool
$synchronous  : bool
Is the payment method synchronous or asynchronous
$template_name  : string
$token_type  : string
Used to create an instance of a WC_Payment_Token
$WooCommerceSubscriptionsTraitFeatures  : array<string|int, mixed>
$assets  : AssetsApi
$checkout_error  : bool
$ExpressCheckoutTraitFeatures  : array<string|int, mixed>
$has_digital_wallet  : bool
$new_payment_method_label  : mixed
$payment_method_id  : string
$payment_method_type  : mixed
$post_payment_processes  : array<string|int, mixed>
$request_context  : RequestContext
$saved_payment_methods_label  : mixed
$setup_intent  : SetupIntent
$supports_save_payment_method  : mixed
$tab_title  : mixed
$wp_error  : WP_Error
$admin_output  : mixed

Methods

__construct()  : mixed
__get()  : mixed
Used to retrieve deprecated properties.
add_payment_intent_mandate_args()  : mixed
add_payment_method()  : mixed
{@inheritDoc}
add_stripe_order_args()  : mixed
Gateways can override this method to add attributes to the Stripe object before it's sent to Stripe.
add_to_cart_response()  : mixed
Decorate the response with data specific to the gateway.
admin_nav_tab()  : mixed
admin_options()  : mixed
banner_checkout_enabled()  : bool
Return true if checkout page banner is enabled for this gateway
capture_charge()  : mixed
Captures the charge for the Stripe order.
cart_checkout_enabled()  : bool
Return true if cart page checkout is enabled for this gateway
cart_fields()  : mixed
create_customer()  : mixed
Create a customer in the stripe gateway.
create_payment_method()  : WC_Payment_Token_Stripe|WP_Error
Creates a payment method in Stripe.
display_errors()  : mixed
Display admin error messages.
enqueue_add_payment_method_scripts()  : mixed
Enqueue scripts needed by the gateway on the add payment method page.
enqueue_admin_scripts()  : mixed
enqueue_cart_scripts()  : mixed
Enqueue scripts needed by the gateway on the cart page.
enqueue_checkout_scripts()  : mixed
Enqueue scripts needed by the gateway on the checkout page.
enqueue_frontend_scripts()  : mixed
Enqueue scripts needed by the gateway on the frontend of the WC shop.
enqueue_mini_cart_scripts()  : mixed
enqueue_payment_method_styles()  : void
enqueue_product_scripts()  : mixed
Enqueue scripts needed by the gateway on the product page.
generate_button_demo_html()  : mixed
generate_description_html()  : mixed
generate_multi_select_countries_html()  : mixed
generate_multiselect_html()  : mixed
generate_paragraph_html()  : mixed
generate_stripe_button_html()  : mixed
get_add_payment_method_script_handles()  : mixed
get_cart_script_handles()  : array<string|int, mixed>
get_checkout_script_handles()  : array<string|int, mixed>
get_complete_payment_return_url()  : mixed
get_confirmation_method()  : mixed
get_custom_attribute_html()  : mixed
get_display_items()  : mixed
Returns a formatted array of items for display in the payment gateway's payment sheet.
get_display_items_for_cart()  : array<string|int, mixed>
get_element_options()  : mixed|void
get_express_checkout_script_handles()  : array<string|int, mixed>
get_formatted_shipping_method()  : array<string|int, mixed>
get_formatted_shipping_methods()  : array<string|int, mixed>
get_generic_error()  : mixed
get_localized_params()  : array<string|int, mixed>
get_method_formats()  : mixed
get_mini_cart_dependencies()  : mixed
get_minicart_script_handles()  : array<string|int, mixed>
get_needs_shipping()  : bool
Return true if shipping is needed.
get_new_method_label()  : mixed
get_new_payment_method_option_html()  : mixed
get_new_source_id()  : mixed
get_new_source_token()  : array<string|int, mixed>|string|WC_Stripe_Gateway|WC_Stripe_Payment_Intent|null
get_order_description()  : mixed
get_order_error()  : array<string|int, mixed>
Return a failed order response.
get_order_meta_data()  : mixed
Given a meta key, see if there is a value for that key in another plugin.
get_order_status_option()  : mixed
get_payment_element_options()  : mixed
get_payment_intent_checkout_url()  : mixed
get_payment_intent_confirmation_args()  : mixed
get_payment_intent_id()  : mixed
get_payment_method_charge_type()  : mixed
get_payment_method_data()  : array<string|int, mixed>
get_payment_method_formats()  : mixed
get_payment_method_from_charge()  : mixed
Given a charge object, return the ID of the payment method used for the charge.
get_payment_method_from_request()  : mixed
Returns the payment method the customer wants to use.
get_payment_method_type()  : string
Returns the payment method type for the payment method.
get_payment_source()  : mixed
Return the payment source the customer has chosen to use.
get_payment_token()  : mixed
get_payment_token_type()  : string
get_prefix()  : mixed
get_product_script_handles()  : array<string|int, mixed>
get_request_context()  : RequestContext
get_save_payment_method_label()  : string
get_saved_methods_label()  : mixed
get_saved_payment_method_option_html()  : string
get_saved_source_id()  : array<string|int, mixed>|string|WC_Stripe_Gateway|WC_Stripe_Payment_Intent|null
get_setup_intent()  : mixed
get_setup_intent_checkout_params()  : mixed
get_shipping_methods()  : array<string|int, mixed>
Returns a formatted array of shipping methods for display in the payment gateway's payment sheet.
get_shipping_packages()  : array<string|int, mixed>
get_stripe_documentation_url()  : mixed
get_token()  : null|WC_Payment_Token_Stripe
get_tokens()  : mixed
get_transaction_url()  : mixed
get_update_shipping_address_response()  : mixed
Decorate the update shipping address respond with data.
get_update_shipping_method_response()  : mixed
Decorate the update shipping method reponse with data.
handle_setup_intent_for_order()  : array<string|int, mixed>|void
has_enqueued_scripts()  : bool
has_order_lock()  : mixed
Returns true of the order has been locked.
init_form_fields()  : mixed
init_supports()  : mixed
initialize()  : mixed
is_active()  : mixed
is_cart_section_enabled()  : mixed
is_change_payment_method_request()  : bool
Return true if this request is to change the payment method of a WC Subscription.
is_deferred_intent_creation()  : false
is_express_checkout_enabled()  : mixed
is_installment_available()  : mixed
is_mandate_required()  : mixed
is_minicart_section_enabled()  : mixed
is_product_section_enabled()  : bool
mini_cart_enabled()  : bool
Return true if mini-cart checkout is enabled for this gateway
mini_cart_fields()  : mixed
output_display_items()  : mixed
Outputs fields required by Google Pay to render the payment wallet.
output_settings_nav()  : mixed
payment_fields()  : mixed
process_admin_options()  : mixed
Added override to provide more control on which fields are saved and which are skipped.
process_payment()  : mixed
{@inheritDoc}
process_pre_order()  : mixed
process_pre_order_payment()  : mixed
process_refund()  : mixed
{@inheritDoc}
process_subscription_payment_method_updated()  : array<string|int, mixed>|array<string|int, string>
process_zero_total_order()  : array<string|int, mixed>
product_checkout_enabled()  : bool
Return true if product page checkout is enabled for this gateway
product_fields()  : mixed
Output the product payment fields.
release_order_lock()  : mixed
Removes the lock on the order
retrieve_charge()  : WP_Error|Charge
Return the \Stripe\Charge object
save_order_meta()  : mixed
Save the Stripe data to the order.
save_payment_method()  : WP_Error|bool
Save the customer's payment method.
save_zero_total_meta()  : mixed
saved_payment_methods()  : mixed
scheduled_subscription_payment()  : mixed
set_new_source_token()  : mixed
set_order_lock()  : mixed
Sets a lock on the order.
set_payment_method_id()  : void
set_payment_method_token()  : mixed
Sets the ID of a payment token.
set_payment_save_error()  : mixed
Set an error on the order.
set_post_payment_process()  : mixed
set_request_context()  : mixed
set_setup_intent()  : mixed
should_save_payment_method()  : bool
Return true if the payment method should be saved.
should_use_saved_payment_method()  : bool
Returns true if the customer is using a saved payment method in the request.
show_save_payment_method_html()  : bool|mixed|void|null
show_save_source()  : bool
Returns true if the save payment method checkbox can be displayed.
subscription_payment_meta()  : mixed
trigger_post_payment_processes()  : mixed
update_failing_payment_method()  : mixed
use_saved_source()  : mixed
Return true of the customer is using a saved payment method.
validate_multi_select_countries_field()  : mixed
validate_payment_sections_field()  : mixed
void_charge()  : mixed
Void the Stripe charge.
get_button_type()  : string
Returns the Apple Pay button type based on the current page.
get_display_item_for_cart()  : array<string|int, mixed>
get_display_item_for_order()  : mixed
get_display_item_for_product()  : array<string|int, mixed>
get_display_items_for_order()  : array<string|int, mixed>
get_formatted_shipping_label()  : mixed
get_payment_intent_checkout_params()  : array<string|int, mixed>
get_shipping_method_id()  : mixed
hooks()  : mixed
is_processing_scheduled_payment()  : bool
Returns true if a scheduled subscription payment is being processed.
order_contains_pre_order()  : mixed
Pre orders can't be mixed with regular products.
pre_order_requires_tokenization()  : bool
process_change_payment_method_request()  : array<string|int, mixed>
requires_confirmation_mandate()  : mixed

Properties

$WooCommerceSubscriptionsTraitFeatures

public static array<string|int, mixed> $WooCommerceSubscriptionsTraitFeatures = ['subscriptions', 'subscription_cancellation', 'multiple_subscriptions', 'subscription_amount_changes', 'subscription_date_changes', 'subscription_payment_method_change_admin', 'subscription_reactivation', 'subscription_suspension', 'subscription_payment_method_change_customer']

$ExpressCheckoutTraitFeatures

protected static array<string|int, mixed> $ExpressCheckoutTraitFeatures = ['wc_stripe_product_checkout', 'wc_stripe_cart_checkout', 'wc_stripe_banner_checkout', 'wc_stripe_mini_cart_checkout']

Methods

add_stripe_order_args()

Gateways can override this method to add attributes to the Stripe object before it's sent to Stripe.

public add_stripe_order_args(array<string|int, mixed> &$args, WC_Order $order[, mixed $intent = null ]) : mixed
Parameters
$args : array<string|int, mixed>
$order : WC_Order
$intent : mixed = null

banner_checkout_enabled()

Return true if checkout page banner is enabled for this gateway

public banner_checkout_enabled() : bool
Return values
bool

enqueue_frontend_scripts()

Enqueue scripts needed by the gateway on the frontend of the WC shop.

public enqueue_frontend_scripts([string $page = '' ]) : mixed
Parameters
$page : string = ''

get_display_items()

Returns a formatted array of items for display in the payment gateway's payment sheet.

public get_display_items([stirng $page = 'checkout' ][, mixed $order = null ]) : mixed
Parameters
$page : stirng = 'checkout'
$order : mixed = null
Tags
@return

[]

get_display_items_for_cart()

public get_display_items_for_cart(WC_Cart $cart[, array<string|int, mixed> $items = array() ]) : array<string|int, mixed>
Parameters
$cart : WC_Cart
$items : array<string|int, mixed> = array()
Tags
since
3.2.1
Return values
array<string|int, mixed>

get_formatted_shipping_method()

public get_formatted_shipping_method(float $price, WC_Shipping_Rate $rate, string $i, array<string|int, mixed> $package, bool $incl_tax) : array<string|int, mixed>
Parameters
$price : float
$rate : WC_Shipping_Rate
$i : string
$package : array<string|int, mixed>
$incl_tax : bool
Tags
since
3.2.1
Return values
array<string|int, mixed>

get_formatted_shipping_methods()

public get_formatted_shipping_methods([array<string|int, mixed> $methods = array() ]) : array<string|int, mixed>
Parameters
$methods : array<string|int, mixed> = array()
Tags
since
3.2.1
Return values
array<string|int, mixed>

get_mini_cart_dependencies()

public get_mini_cart_dependencies(array<string|int, mixed> $deps, mixed $scripts) : mixed
Parameters
$deps : array<string|int, mixed>
$scripts : mixed
Tags
since
3.1.8

get_order_meta_data()

Given a meta key, see if there is a value for that key in another plugin.

public get_order_meta_data(string $meta_key, WC_Order $order[, string $context = 'view' ]) : mixed

This acts as a lazy conversion method for merchants that have switched to our plugin from other plugins.

Parameters
$meta_key : string
$order : WC_Order
$context : string = 'view'
Tags
since
3.1.0

get_payment_intent_checkout_url()

public get_payment_intent_checkout_url(PaymentIntent $intent, WC_Order $order[, mixed $type = 'payment_intent' ]) : mixed
Parameters
$intent : PaymentIntent
$order : WC_Order
$type : mixed = 'payment_intent'

get_payment_intent_confirmation_args()

public get_payment_intent_confirmation_args(PaymentIntent $intent, WC_Order $order) : mixed
Parameters
$intent : PaymentIntent
$order : WC_Order

get_payment_source()

Return the payment source the customer has chosen to use.

public get_payment_source() : mixed

This can be a saved source or a one time use source.

handle_setup_intent_for_order()

public handle_setup_intent_for_order(WC_Order $order) : array<string|int, mixed>|void
Parameters
$order : WC_Order
Return values
array<string|int, mixed>|void

mini_cart_enabled()

Return true if mini-cart checkout is enabled for this gateway

public mini_cart_enabled() : bool
Tags
since
3.1.8
Return values
bool

output_display_items()

Outputs fields required by Google Pay to render the payment wallet.

public output_display_items([string $page = 'checkout' ][, array<string|int, mixed> $data = array() ]) : mixed
Parameters
$page : string = 'checkout'
$data : array<string|int, mixed> = array()

process_admin_options()

Added override to provide more control on which fields are saved and which are skipped.

public process_admin_options() : mixed

This plugin has custom setting fields like "paragraph" that are for info display only and not for saving.

Tags
see
WC_Settings_API::process_admin_options()

process_refund()

{@inheritDoc}

public process_refund(mixed $order_id[, mixed $amount = null ][, mixed $reason = '' ]) : mixed
Parameters
$order_id : mixed
$amount : mixed = null
$reason : mixed = ''
Tags
see
WC_Payment_Gateway::process_refund()

process_subscription_payment_method_updated()

public process_subscription_payment_method_updated(WC_Subscription $subscription) : array<string|int, mixed>|array<string|int, string>
Parameters
$subscription : WC_Subscription
Return values
array<string|int, mixed>|array<string|int, string>

process_zero_total_order()

public process_zero_total_order(WC_Order $order) : array<string|int, mixed>
Parameters
$order : WC_Order
Return values
array<string|int, mixed>

product_checkout_enabled()

Return true if product page checkout is enabled for this gateway

public product_checkout_enabled() : bool
Return values
bool

save_payment_method()

Save the customer's payment method.

public save_payment_method(string $id, WC_Order $order[, mixed $payment_details = null ]) : WP_Error|bool

If the payment method has already been saved to the customer then simply return true.

Parameters
$id : string
$order : WC_Order
$payment_details : mixed = null
Return values
WP_Error|bool

scheduled_subscription_payment()

public scheduled_subscription_payment(float $amount, WC_Order $order) : mixed
Parameters
$amount : float
$order : WC_Order

set_payment_save_error()

Set an error on the order.

public set_payment_save_error(WC_Order $order, WP_Error $error) : mixed

This error is used on the frontend to alert customer's to a failed payment method save.

Parameters
$order : WC_Order
$error : WP_Error

should_use_saved_payment_method()

Returns true if the customer is using a saved payment method in the request.

public should_use_saved_payment_method() : bool
Return values
bool

subscription_payment_meta()

public subscription_payment_meta(array<string|int, mixed> $payment_meta, WC_Subscription $subscription) : mixed
Parameters
$payment_meta : array<string|int, mixed>
$subscription : WC_Subscription

update_failing_payment_method()

public update_failing_payment_method(WC_Subscription $subscription, WC_Order $order) : mixed
Parameters
$subscription : WC_Subscription
$order : WC_Order

get_display_item_for_cart()

protected get_display_item_for_cart(float $price, string $label, string $type, mixed ...$args) : array<string|int, mixed>
Parameters
$price : float
$label : string
$type : string
$args : mixed
Tags
since
3.2.1
Return values
array<string|int, mixed>

get_display_item_for_order()

protected get_display_item_for_order(float $price, string $label, WC_Order $order, string $type, mixed ...$args) : mixed
Parameters
$price : float
$label : string
$order : WC_Order
$type : string
$args : mixed

get_display_items_for_order()

protected get_display_items_for_order(WC_Order $order[, array<string|int, mixed> $items = array() ]) : array<string|int, mixed>
Parameters
$order : WC_Order
$items : array<string|int, mixed> = array()
Tags
since
3.2.1
Return values
array<string|int, mixed>

get_payment_intent_checkout_params()

protected get_payment_intent_checkout_params(mixed $intent, WC_Order $order, mixed $type) : array<string|int, mixed>
Parameters
$intent : mixed
$order : WC_Order
$type : mixed
Return values
array<string|int, mixed>

order_contains_pre_order()

Pre orders can't be mixed with regular products.

protected order_contains_pre_order(WC_Order $order) : mixed
Parameters
$order : WC_Order

pre_order_requires_tokenization()

protected pre_order_requires_tokenization(WC_Order $order) : bool
Parameters
$order : WC_Order
Return values
bool

process_change_payment_method_request()

protected process_change_payment_method_request(WC_Subscription $subscription) : array<string|int, mixed>
Parameters
$subscription : WC_Subscription
Tags
since
3.2.13
Return values
array<string|int, mixed>

        
On this page

Search results