• Namespace
  • Class
  • Tree
  • Deprecated
  • Hook Reference

Namespaces

  • None
  • PaymentPlugins

Classes

  • WC_Payment_Gateway_Stripe
  • WC_Payment_Gateway_Stripe_ACH
  • WC_Payment_Gateway_Stripe_Afterpay
  • WC_Payment_Gateway_Stripe_Alipay
  • WC_Payment_Gateway_Stripe_ApplePay
  • WC_Payment_Gateway_Stripe_Bancontact
  • WC_Payment_Gateway_Stripe_BECS
  • WC_Payment_Gateway_Stripe_Boleto
  • WC_Payment_Gateway_Stripe_CC
  • WC_Payment_Gateway_Stripe_EPS
  • WC_Payment_Gateway_Stripe_FPX
  • WC_Payment_Gateway_Stripe_Giropay
  • WC_Payment_Gateway_Stripe_GooglePay
  • WC_Payment_Gateway_Stripe_GrabPay
  • WC_Payment_Gateway_Stripe_Ideal
  • WC_Payment_Gateway_Stripe_Klarna
  • WC_Payment_Gateway_Stripe_Local_Payment
  • WC_Payment_Gateway_Stripe_Multibanco
  • WC_Payment_Gateway_Stripe_OXXO
  • WC_Payment_Gateway_Stripe_P24
  • WC_Payment_Gateway_Stripe_Payment_Request
  • WC_Payment_Gateway_Stripe_Sepa
  • WC_Payment_Gateway_Stripe_Sofort
  • WC_Payment_Gateway_Stripe_WeChat
  • WC_Payment_Token_Stripe
  • WC_Payment_Token_Stripe_ACH
  • WC_Payment_Token_Stripe_ApplePay
  • WC_Payment_Token_Stripe_CC
  • WC_Payment_Token_Stripe_GooglePay
  • WC_Payment_Token_Stripe_Local
  • WC_Payment_Token_Stripe_Sepa
  • WC_Stripe_Account_Settings
  • WC_Stripe_Admin_Assets
  • WC_Stripe_Admin_Menus
  • WC_Stripe_Admin_Order_Metaboxes
  • WC_Stripe_Admin_Settings
  • WC_Stripe_Admin_User_Edit
  • WC_Stripe_Advanced_Settings
  • WC_Stripe_API_Operation
  • WC_Stripe_API_Request_Filter
  • WC_Stripe_API_Settings
  • WC_Stripe_Constants
  • WC_Stripe_Controller_Cart
  • WC_Stripe_Controller_Checkout
  • WC_Stripe_Controller_Gateway_Settings
  • WC_Stripe_Controller_GooglePay
  • WC_Stripe_Controller_Order_Actions
  • WC_Stripe_Controller_Payment_Intent
  • WC_Stripe_Controller_Payment_Method
  • WC_Stripe_Controller_Plaid
  • WC_Stripe_Controller_Product_Data
  • WC_Stripe_Controller_Source
  • WC_Stripe_Controller_Webhook
  • WC_Stripe_Customer_Manager
  • WC_Stripe_Field_Manager
  • WC_Stripe_Frontend_Scripts
  • WC_Stripe_Gateway
  • WC_Stripe_Gateway_Conversion
  • WC_Stripe_Install
  • WC_Stripe_Manager
  • WC_Stripe_Payment
  • WC_Stripe_Payment_Balance
  • WC_Stripe_Payment_Charge
  • WC_Stripe_Payment_Charge_Local
  • WC_Stripe_Payment_Factory
  • WC_Stripe_Payment_Intent
  • WC_Stripe_Product_Gateway_Option
  • WC_Stripe_Product_Option
  • WC_Stripe_Redirect_Handler
  • WC_Stripe_Rest_API
  • WC_Stripe_Rest_Controller
  • WC_Stripe_Settings_API
  • WC_Stripe_Shortcode_Payment_Buttons
  • WC_Stripe_Shortcodes
  • WC_Stripe_Update
  • WC_Stripe_Utils

Traits

  • WC_Payment_Token_Payment_Method_Trait
  • WC_Payment_Token_Source_Trait
  • WC_Stripe_Controller_Cart_Trait
  • WC_Stripe_Controller_Frontend_Trait
  • WC_Stripe_Local_Payment_Charge_Trait
  • WC_Stripe_Local_Payment_Intent_Trait
  • WC_Stripe_Payment_Charge_Trait
  • WC_Stripe_Payment_Intent_Trait
  • WC_Stripe_Settings_Trait

Functions

  • stripe_wc
  • wc_stripe_add_allowed_html
  • wc_stripe_add_number_precision
  • wc_stripe_api_options
  • wc_stripe_available_payment_gateways
  • wc_stripe_charge_dispute_closed
  • wc_stripe_charge_dispute_created
  • wc_stripe_credit_card_labels
  • wc_stripe_delete_customer
  • wc_stripe_display_prices_including_tax
  • wc_stripe_filter_address_state
  • wc_stripe_filter_order_id
  • wc_stripe_get_account_id
  • wc_stripe_get_available_local_gateways
  • wc_stripe_get_checkout_fields
  • wc_stripe_get_currencies
  • wc_stripe_get_current_page
  • wc_stripe_get_custom_forms
  • wc_stripe_get_customer_id
  • wc_stripe_get_customer_payment_tokens
  • wc_stripe_get_display_items
  • wc_stripe_get_error_messages
  • wc_stripe_get_idempotency_key
  • wc_stripe_get_local_payment_params
  • wc_stripe_get_order_from_source_id
  • wc_stripe_get_order_from_transaction
  • wc_stripe_get_publishable_key
  • wc_stripe_get_secret_key
  • wc_stripe_get_shipping_options
  • wc_stripe_get_site_locale
  • wc_stripe_get_template
  • wc_stripe_get_template_html
  • wc_stripe_hidden_field
  • wc_stripe_log
  • wc_stripe_log_error
  • wc_stripe_log_info
  • wc_stripe_mode
  • wc_stripe_order_cancelled
  • wc_stripe_order_has_shipping_address
  • wc_stripe_order_mode
  • wc_stripe_order_status_completed
  • wc_stripe_output_checkout_error
  • wc_stripe_payment_complete_order_status
  • wc_stripe_payment_gateways
  • wc_stripe_payment_intent_field
  • wc_stripe_pre_orders_active
  • wc_stripe_process_charge_failed
  • wc_stripe_process_charge_succeeded
  • wc_stripe_process_create_refund
  • wc_stripe_process_payment_intent_succeeded
  • wc_stripe_process_shop_subscription_meta
  • wc_stripe_process_source_chargeable
  • wc_stripe_remove_number_precision
  • wc_stripe_remove_order_locks
  • wc_stripe_restore_cart
  • wc_stripe_restore_cart_after_product_checkout
  • wc_stripe_retry_source_chargeable
  • wc_stripe_review_closed
  • wc_stripe_review_opened
  • wc_stripe_save_customer
  • wc_stripe_set_checkout_error
  • wc_stripe_set_idempotency_key
  • wc_stripe_shipping_address_serviceable
  • wc_stripe_stash_cart
  • wc_stripe_stash_product_cart
  • wc_stripe_token_field
  • wc_stripe_update_customer_location
  • wc_stripe_update_option_3_3_13
  • wc_stripe_update_shipping_methods
  • wc_stripe_woocommerce_payment_token_deleted
  • wcs_stripe_active

Class WC_Payment_Gateway_Stripe

WC_Payment_Gateway
Extended by WC_Payment_Gateway_Stripe uses WC_Stripe_Settings_Trait

Direct known subclasses

WC_Payment_Gateway_Stripe_ACH, WC_Payment_Gateway_Stripe_ApplePay, WC_Payment_Gateway_Stripe_CC, WC_Payment_Gateway_Stripe_GooglePay, WC_Payment_Gateway_Stripe_Local_Payment, WC_Payment_Gateway_Stripe_Payment_Request

Indirect known subclasses

WC_Payment_Gateway_Stripe_Afterpay, WC_Payment_Gateway_Stripe_Alipay, WC_Payment_Gateway_Stripe_Klarna, WC_Payment_Gateway_Stripe_Multibanco, WC_Payment_Gateway_Stripe_OXXO, WC_Payment_Gateway_Stripe_P24, WC_Payment_Gateway_Stripe_Sepa, WC_Payment_Gateway_Stripe_Sofort, WC_Payment_Gateway_Stripe_WeChat, WC_Payment_Gateway_Stripe_Bancontact, WC_Payment_Gateway_Stripe_BECS, WC_Payment_Gateway_Stripe_Boleto, WC_Payment_Gateway_Stripe_EPS, WC_Payment_Gateway_Stripe_FPX, WC_Payment_Gateway_Stripe_Giropay, WC_Payment_Gateway_Stripe_GrabPay, WC_Payment_Gateway_Stripe_Ideal

Abstract
Package: Stripe\Abstract
Author: PaymentPlugins
Since: 3.0.0
Located at abstract/abstract-wc-payment-gateway-stripe.php

Methods summary

public
# __construct( )
public
# hooks( )
public
# init_supports( )
public
# init_form_fields( )
public
# get_method_formats( )
public
# enqueue_admin_scripts( )
public
# payment_fields( )
public
# product_fields( )

Output the product payment fields.

Output the product payment fields.

public
# cart_fields( )
public
# mini_cart_fields( )
public
# enqueue_frontend_scripts( WC_Stripe_Frontend_Scripts $page = '' )

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

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

Parameters

$page
$scripts
public
# enqueue_checkout_scripts( WC_Stripe_Frontend_Scripts $scripts )

Enqueue scripts needed by the gateway on the checkout page.

Enqueue scripts needed by the gateway on the checkout page.

Parameters

$scripts
public
# enqueue_add_payment_method_scripts( WC_Stripe_Frontend_Scripts $scripts )

Enqueue scripts needed by the gateway on the add payment method page.

Enqueue scripts needed by the gateway on the add payment method page.

Parameters

$scripts
public
# enqueue_cart_scripts( WC_Stripe_Frontend_Scripts $scripts )

Enqueue scripts needed by the gateway on the cart page.

Enqueue scripts needed by the gateway on the cart page.

Parameters

$scripts
public
# enqueue_product_scripts( WC_Stripe_Frontend_Scripts $scripts )

Enqueue scripts needed by the gateway on the product page.

Enqueue scripts needed by the gateway on the product page.

Parameters

$scripts
public
# enqueue_mini_cart_scripts( WC_Stripe_Frontend_Scripts $scripts )

Parameters

$scripts

Since

3.1.8
public
# process_payment( $order_id )

See

WC_Payment_Gateway::process_payment()
public array
# get_localized_params( )

Returns

array
public
# save_order_meta( WC_Order $order, Stripe\Charge $charge )

Save the Stripe data to the order.

Save the Stripe data to the order.

Parameters

$order
$charge
public
# get_payment_method_from_charge( Stripe\Charge $charge )

Given a charge object, return the ID of the payment method used for the charge.

Given a charge object, return the ID of the payment method used for the charge.

Parameters

$charge

Since

3.0.6
public
# add_payment_method( )

See

WC_Payment_Gateway::add_payment_method()
public
# process_refund( $order_id, $amount = null, $reason = '' )

See

WC_Payment_Gateway::process_refund()
public
# capture_charge( float $amount, WC_Order $order )

Captures the charge for the Stripe order.

Captures the charge for the Stripe order.

Parameters

$amount
$order
public
# void_charge( WC_Order $order )

Void the Stripe charge.

Void the Stripe charge.

Parameters

$order
public WP_Error|Stripe\Charge
# retrieve_charge( String $charge_id, String $mode = '' )

Return the \Stripe\Charge object

Return the \Stripe\Charge object

Parameters

$charge_id
$mode

Returns

WP_Error|Stripe\Charge
public
# get_payment_token( string $method_id, Stripe\Card|array $method_details = null )

Parameters

$method_id
$method_details
public array
# get_order_error( WP_Error $error = null )

Return a failed order response.

Return a failed order response.

Parameters

$error

Returns

array
public
# get_payment_source( )

Return the payment source the customer has chosen to use. This can be a saved source or a one time use source.

Return the payment source the customer has chosen to use. This can be a saved source or a one time use source.

public
# get_payment_method_from_request( )

Returns the payment method the customer wants to use. This can be a saved payment method or a new payment method.

Returns the payment method the customer wants to use. This can be a saved payment method or a new payment method.

public
# get_payment_intent_id( )
public
# use_saved_source( )

Return true of the customer is using a saved payment method.

Return true of the customer is using a saved payment method.

public
# get_new_source_id( )

Deprecated

public
# get_new_source_token( )
public
# get_saved_source_id( )
public
# create_customer( integer $user_id )

Create a customer in the stripe gateway.

Create a customer in the stripe gateway.

Parameters

$user_id

Throws

Exception
public WC_Payment_Token_Stripe|WP_Error
# create_payment_method( string $id, string $customer_id )

Creates a payment method in Stripe.

Creates a payment method in Stripe.

Parameters

$id
payment method id
$customer_id
WC Stripe customer ID

Returns

WC_Payment_Token_Stripe|WP_Error
public
# payment_methods_list_item( array $item, WC_Payment_Token_Stripe_CC $payment_token )

Parameters

$item
$payment_token
public
# delete_payment_method( string $token_id, WC_Payment_Token_Stripe $token )

Parameters

$token_id
$token
public
# saved_payment_methods( $tokens = array() )
public
# get_new_method_label( )
public
# get_saved_methods_label( )
public boolean
# get_needs_shipping( )

Return true if shipping is needed. Shipping is based on things like if the cart or product needs shipping.

Return true if shipping is needed. Shipping is based on things like if the cart or product needs shipping.

Returns

boolean
public boolean
# should_save_payment_method( WC_Order $order )

Return true of the payment method should be saved.

Return true of the payment method should be saved.

Parameters

$order

Returns

boolean
public boolean
# show_save_source( )

Returns true if the save payment method checkbox can be displayed.

Returns true if the save payment method checkbox can be displayed.

Returns

boolean
public []
# get_display_items( stirng $page = 'checkout', $order = null )

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

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

Parameters

$page
$order

Returns

[]
public array
# get_shipping_methods( boolean $encode,… )

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

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

Deprecated

Parameters

$encode,…

Returns

array
public boolean
# product_checkout_enabled( )

Return true if product page checkout is enabled for this gateway

Return true if product page checkout is enabled for this gateway

Returns

boolean
public boolean
# cart_checkout_enabled( )

Return true if cart page checkout is enabled for this gateway

Return true if cart page checkout is enabled for this gateway

Returns

boolean
public boolean
# mini_cart_enabled( )

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

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

Returns

boolean

Since

3.1.8
public boolean
# banner_checkout_enabled( )

Return true if checkout page banner is enabled for this gateway

Return true if checkout page banner is enabled for this gateway

Returns

boolean
public
# add_to_cart_response( [] $data )

Decorate the response with data specific to the gateway.

Decorate the response with data specific to the gateway.

Parameters

$data
public
# get_update_shipping_method_response( [] $data )

Decorate the update shipping method reponse with data.

Decorate the update shipping method reponse with data.

Parameters

$data
public
# get_update_shipping_address_response( [] $data )

Decorate the update shipping address respond with data.

Decorate the update shipping address respond with data.

Parameters

$data
public WP_Error|boolean
# save_payment_method( string $id, WC_Order $order, $payment_details = null )

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

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

Parameters

$id
$order
$payment_details

Returns

WP_Error|boolean
public
# set_payment_save_error( WC_Order $order, WP_Error $error )

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

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

Deprecated

Parameters

$order
$error
public null|WC_Payment_Token_Stripe_CC
# get_token( string $token_id, integer $user_id )

Parameters

$token_id
$user_id

Returns

null|WC_Payment_Token_Stripe_CC
public
# subscription_payment_meta( array $payment_meta, WC_Subscription $subscription )

Parameters

$payment_meta
$subscription
public
# scheduled_subscription_payment( float $amount, WC_Order $order )

Parameters

$amount
$order
public boolean
# is_change_payment_method_request( )

Return true if this request is to change the payment method of a WC Subscription.

Return true if this request is to change the payment method of a WC Subscription.

Returns

boolean
public
# set_payment_method_token( string $id )

Sets the ID of a payment token.

Sets the ID of a payment token.

Parameters

$id
public
# set_new_source_token( $token )
public
# get_order_description( WC_Order $order )

Deprecated

Parameters

$order
public
# process_zero_total_order( WC_Order $order )

Parameters

$order
public array
# process_pre_order( WC_Order $order )

Parameters

$order

Returns

array
public
# save_zero_total_meta( WC_Order $order, $token = null )

Parameters

$order
$token
protected
# order_contains_pre_order( WC_Order $order )

Pre orders can't be mixed with regular products.

Pre orders can't be mixed with regular products.

Parameters

$order
protected boolean
# pre_order_requires_tokenization( WC_Order $order )

Parameters

$order

Returns

boolean
public
# set_order_lock( WC_Order|integer $order )

Sets a lock on the order. Default behavior is a 2 minute lock.

Sets a lock on the order. Default behavior is a 2 minute lock.

Parameters

$order
public
# release_order_lock( WC_Order|integer $order )

Removes the lock on the order

Removes the lock on the order

Parameters

$order
public
# has_order_lock( WC_Order|integer $order )

Returns true of the order has been locked. If the lock exists and is greater than current time method returns true;

Returns true of the order has been locked. If the lock exists and is greater than current time method returns true;

Parameters

$order
public
# set_post_payment_process( $callback )
public
# trigger_post_payment_processes( WC_Order $order, WC_Payment_Gateway_Stripe $gateway )

Parameters

$order
$gateway
public
# validate_payment_sections_field( $key, $value )
public
# process_pre_order_payment( WC_Order $order )

Parameters

$order
public
# get_order_meta_data( string $meta_key, WC_Order $order, string $context = 'view' )

Given a meta key, see if there is a value for that key in another plugin. This acts as a lazy conversion method for merchants that have switched to our plugin from other plugins.

Given a meta key, see if there is a value for that key in another plugin. This acts as a lazy conversion method for merchants that have switched to our plugin from other plugins.

Parameters

$meta_key
$order
$context

Since

3.1.0
public
# add_stripe_order_args( array & $args, WC_Order $order )

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

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

Parameters

$args
$order
public
# get_generic_error( WP_Error $result = null )

Parameters

$result

Since

3.1.1
private
# get_payment_section_description( )

Since

3.1.2
public
# output_display_items( string $page = 'checkout', array $data = array() )

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

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

Parameters

$page
$data
public
# get_mini_cart_dependencies( array $deps, $scripts )

Parameters

$deps
$scripts

Since

3.1.8
public array
# get_shipping_packages( )

Returns

array

Since

3.2.0
protected array
# get_display_items_for_cart( WC_Cart $cart, array $items = array() )

Parameters

$cart
$items

Returns

array

Since

3.2.1
protected array
# get_display_items_for_order( WC_Order $order, array $items = array() )

Parameters

$order
$items

Returns

array

Since

3.2.1
protected array
# get_display_item_for_cart( float $price, string $label, string $type, mixed $args )

Parameters

$price
$label
$type
$args
$args

Returns

array

Since

3.2.1
protected
# get_display_item_for_order( float $price, string $label, WC_Order $order, string $type, mixed $args )

Parameters

$price
$label
$order
$type
$args
$args
protected array
# get_display_item_for_product( WC_Product $product )

Parameters

$product

Returns

array

Since

3.2.1
public array
# get_formatted_shipping_methods( array $methods = array() , $sort,… )

Parameters

$methods
$sort,…

Returns

array

Since

3.2.1
public array
# get_formatted_shipping_method( float $price, WC_Shipping_Rate $rate, string $i, array $package, boolean $incl_tax )

Parameters

$price
$rate
$i
$package
$incl_tax

Returns

array

Since

3.2.1
protected mixed
# get_shipping_method_id( string $id, string $index )

Parameters

$id
$index

Returns

mixed
protected
# get_formatted_shipping_label( float $price, WC_Shipping_Rate $rate, boolean $incl_tax )

Parameters

$price
$rate
$incl_tax

Since

3.2.1
protected boolean
# is_processing_scheduled_payment( )

Returns true if a scheduled subscription payment is being processed.

Returns true if a scheduled subscription payment is being processed.

Returns

boolean

Since

3.2.3
public boolean
# has_enqueued_scripts( WC_Stripe_Frontend_Scripts $scripts )

Parameters

$scripts

Returns

boolean

Since

3.2.5
public
# get_transaction_url( $order )
protected array
# process_change_payment_method_request( WC_Subscription $subscription )

Parameters

$subscription

Returns

array

Since

3.2.13
public
# update_failing_payment_method( WC_Subscription $subscription, WC_Order $order )

Parameters

$subscription
$order
public mixed|
# get_element_options( array $options = array() )

Parameters

$options

Returns

mixed|

Since

3.3.10

Methods used from WC_Stripe_Settings_Trait

admin_nav_tab(), admin_options(), display_errors(), generate_button_demo_html(), generate_description_html(), generate_multi_select_countries_html(), generate_multiselect_html(), generate_paragraph_html(), generate_stripe_button_html(), get_custom_attribute_html(), get_prefix(), get_stripe_documentation_url(), is_active(), output_settings_nav(), process_admin_options(), validate_multi_select_countries_field()

Properties summary

public WC_Stripe_Payment $payment_object
#
protected boolean $has_digital_wallet

Since

3.1.8
# false
public string $token_key
#
public string $saved_method_key
#
public string $payment_type_key
#
public string $payment_intent_key
#
public string $save_source_key
#
public string $template_name
#
protected boolean $checkout_error
# false
protected string $token_type

Used to create an instance of a WC_Payment_Token

Used to create an instance of a WC_Payment_Token

#
protected WC_Stripe_Gateway $gateway
#
protected WP_Error $wp_error
#
public string $payment_method_token
# null
protected string $new_source_token
# null
public boolean $synchronous

Is the payment method synchronous or asynchronous

Is the payment method synchronous or asynchronous

# true
protected array $post_payment_processes
# array()
public boolean $processing_payment
# false
public WP_Error $last_payment_error
#

Properties used from WC_Stripe_Settings_Trait

$admin_output, $tab_title

Stripe API documentation generated by ApiGen