• Namespace
  • Class
  • Tree
  • Deprecated
  • Hook Reference

Namespaces

  • None
  • PaymentPlugins

Classes

  • Braintree_Gateway_Manager
  • WC_Braintree_3ds_Validation
  • WC_Braintree_Admin_Assets
  • WC_Braintree_Admin_List_Table_Subscriptions
  • WC_Braintree_Admin_Menus
  • WC_Braintree_Admin_Order_Metaboxes
  • WC_Braintree_Admin_Settings
  • WC_Braintree_Admin_User_Edit
  • WC_Braintree_Advanced_Fraud_Settings
  • WC_Braintree_Advanced_Settings_API
  • WC_Braintree_Alipay_Payment_Gateway
  • WC_Braintree_API_Settings
  • WC_Braintree_ApplePay_Payment_Gateway
  • WC_Braintree_Bancontact_Payment_Gateway
  • WC_Braintree_CC_Payment_Gateway
  • WC_Braintree_Condition_Evaluator
  • WC_Braintree_Context_Stack
  • WC_Braintree_Controller_3ds
  • WC_Braintree_Controller_ApplePay
  • WC_Braintree_Controller_Cart
  • WC_Braintree_Controller_Checkout
  • WC_Braintree_Controller_Client_Token
  • WC_Braintree_Controller_Data_Migration
  • WC_Braintree_Controller_Frontend
  • WC_Braintree_Controller_GooglePay
  • WC_Braintree_Controller_Kount
  • WC_Braintree_Controller_Local_Payment
  • WC_Braintree_Controller_Merchant_Accounts
  • WC_Braintree_Controller_Order_Actions
  • WC_Braintree_Controller_Payment_Tokens
  • WC_Braintree_Controller_PayPal
  • WC_Braintree_Controller_Plan
  • WC_Braintree_Controller_Product
  • WC_Braintree_Controller_Settings
  • WC_Braintree_Controller_Webhook
  • WC_Braintree_Customer_Manager
  • WC_Braintree_Deprecated_Filter_Hooks
  • WC_Braintree_Descriptor_Settings
  • WC_Braintree_EPS_Payment_Gateway
  • WC_Braintree_Fee_Settings
  • WC_Braintree_Field_Manager
  • WC_Braintree_Form_Handler
  • WC_Braintree_Frontend_Scripts
  • WC_Braintree_Giropay_Payment_Gateway
  • WC_Braintree_GooglePay_Payment_Gateway
  • WC_Braintree_IDEAL_Payment_Gateway
  • WC_Braintree_Install
  • WC_Braintree_Local_Payment_Gateway
  • WC_Braintree_Manager
  • WC_Braintree_Merchant_Account_Settings
  • WC_Braintree_Meta_Box_Coupons
  • WC_Braintree_Meta_Box_Subscription_Order_Data
  • WC_Braintree_MyBank_Payment_Gateway
  • WC_Braintree_P24_Payment_Gateway
  • WC_Braintree_Payment_Gateway
  • WC_Braintree_Payment_Method_Conversion
  • WC_Braintree_PayPal_Payment_Gateway
  • WC_Braintree_Post_Types
  • WC_Braintree_Product_Gateway_Option
  • WC_Braintree_Query
  • WC_Braintree_Rest_API
  • WC_Braintree_Rest_Controller
  • WC_Braintree_Rest_Webook_Authentication
  • WC_Braintree_Sepa_Payment_Gateway
  • WC_Braintree_Settings_API
  • WC_Braintree_Shortcode_Payment_Buttons
  • WC_Braintree_Shortcodes
  • WC_Braintree_Sofort_Payment_Gateway
  • WC_Braintree_Subscription
  • WC_Braintree_Subscription_Data_Store_CPT
  • WC_Braintree_Subscription_Settings
  • WC_Braintree_Subscriptions_Cart
  • WC_Braintree_Subscriptions_Checkout
  • WC_Braintree_Update
  • WC_Braintree_Venmo_Payment_Gateway
  • WC_Braintree_WeChat_Payment_Gateway
  • WC_Meta_Box_Braintree_Subscription_Data
  • WC_Payment_Token_Braintree
  • WC_Payment_Token_Braintree_ApplePay
  • WC_Payment_Token_Braintree_CC
  • WC_Payment_Token_Braintree_GooglePay
  • WC_Payment_Token_Braintree_Local_Payment
  • WC_Payment_Token_Braintree_PayPal
  • WC_Payment_Token_Braintree_Venmo
  • WC_Product_Braintree_Subscription
  • WC_Product_Braintree_Subscription_Variation
  • WC_Product_Braintree_Variable_Subscription
  • WCS_Braintree_Subscription_Controller

Traits

  • WC_Braintree_Controller_Cart_Trait
  • WC_Braintree_Settings_Trait

Functions

  • bfwc_add_body_class
  • bfwc_billing_periods_string
  • bfwc_can_delete_payment_method
  • bfwc_copy_address_from_order
  • bfwc_error_code_type_nicename
  • bfwc_get_combined_error_messages
  • bfwc_get_error_message
  • bfwc_get_error_messages
  • bfwc_get_gateway_timezone
  • bfwc_get_product_descriptors
  • bfwc_get_subscription_status_name
  • bfwc_get_subscription_statuses
  • bfwc_get_template
  • bfwc_get_timezones
  • bfwc_register_subscription_status
  • bfwc_subscription_length_string
  • bfwc_subscription_user_actions
  • bfwcs_billing_interval_string
  • bfwcs_billing_intervals
  • bfwcs_calculate_end_date
  • bfwcs_calculate_first_payment_date
  • bfwcs_calculate_next_payment_date
  • bfwcs_calculate_order_total
  • bfwcs_calculate_start_date
  • bfwcs_can_combine_subscriptions
  • bfwcs_cart_contains_subscriptions
  • bfwcs_cart_formatted_date
  • bfwcs_cart_recurring_total_html
  • bfwcs_cart_shipping_total
  • bfwcs_cart_subtotal_string
  • bfwcs_cart_tax_total_html
  • bfwcs_copy_order_meta
  • bfwcs_create_order_from_subscription
  • bfwcs_create_renewal_order
  • bfwcs_create_subscription
  • bfwcs_frontend_interval_string
  • bfwcs_get_currency_symbol
  • bfwcs_get_interval_string
  • bfwcs_get_length_string
  • bfwcs_get_period_string
  • bfwcs_get_plan_from_product
  • bfwcs_get_price_string
  • bfwcs_get_product_price_html
  • bfwcs_get_related_orders
  • bfwcs_get_subscription
  • bfwcs_get_subscription_actions
  • bfwcs_get_subscription_statuses
  • bfwcs_get_subscriptions_for_order
  • bfwcs_get_subscriptions_for_user
  • bfwcs_is_change_payment_method
  • bfwcs_is_pay_for_subscription_request
  • bfwcs_order_contains_subscription
  • bfwcs_order_is_subscription
  • bfwcs_product_is_subscription
  • bfwcs_subscription_link_active
  • braintree
  • braintree_delete_user_payment_method
  • braintree_delete_user_payment_methods
  • braintree_device_data_field
  • braintree_get_customer_id
  • braintree_get_default_method
  • braintree_get_method_uris
  • braintree_get_method_url
  • braintree_get_payment_method_formats
  • braintree_get_payment_method_from_token
  • braintree_get_payment_method_title_from_array
  • braintree_get_payment_method_title_from_method
  • braintree_get_payment_method_title_from_method_details
  • braintree_get_payment_method_title_from_transaction
  • braintree_get_payment_title_from_token
  • braintree_get_payment_token_from_transaction
  • braintree_get_user_payment_methods
  • braintree_hidden_field
  • braintree_nonce_field
  • braintree_payment_method_to_array
  • braintree_payment_token_field
  • braintree_save_payment_method_from_transaction
  • braintree_save_user_payment_method
  • braintree_save_user_payment_methods
  • bt_manager
  • bwc_3ds_no_action_needed
  • bwc_3ds_verify_vaulted_methods
  • bwc_add_allowed_html
  • bwc_add_notice
  • bwc_applepay_cart_checkout_enabled
  • bwc_applepay_checkout_banner_enabled
  • bwc_applepay_get_line_items
  • bwc_applepay_product_checkout_enabled
  • bwc_calculate_fee
  • bwc_can_refund_order
  • bwc_card_payments_enabled
  • bwc_custom_form_text
  • bwc_cvv_field_enabled
  • bwc_display_icons_on_payment_methods_page
  • bwc_display_save_payment_method
  • bwc_dropin_v2_enabled
  • bwc_dropin_v3_enabled
  • bwc_enable_signup_from_checkout
  • bwc_execute_conditional_statement
  • bwc_fail_on_duplicate
  • bwc_fee_enabled_for_gateway
  • bwc_fees_enabled
  • bwc_get_3_0_0_deprecated_order_prop
  • bwc_get_3_0_0_updated_props
  • bwc_get_3ds_modal_html
  • bwc_get_billing_agreement_desc
  • bwc_get_comma_separated_product_names
  • bwc_get_conditional_values
  • bwc_get_custom_form
  • bwc_get_custom_form_fields
  • bwc_get_custom_forms
  • bwc_get_default_method
  • bwc_get_enclosed_icon_url
  • bwc_get_fees_for_gateway
  • bwc_get_gateway_fees
  • bwc_get_gateway_id
  • bwc_get_googlepay_methods
  • bwc_get_loader_file
  • bwc_get_merchant_account
  • bwc_get_merchant_accounts
  • bwc_get_option_text
  • bwc_get_order_property
  • bwc_get_payment_gateways
  • bwc_get_paypal_button
  • bwc_get_paypal_credit_button
  • bwc_get_paypal_credit_html
  • bwc_get_paypal_html
  • bwc_get_product_property
  • bwc_get_save_method_template
  • bwc_get_smartbutton_style
  • bwc_get_template
  • bwc_get_template_html
  • bwc_get_user_applepay_payment_methods
  • bwc_get_user_payment_methods
  • bwc_get_user_paypal_payment_methods
  • bwc_googlepay_enabled
  • bwc_is_3ds_active
  • bwc_is_3ds_enabled
  • bwc_is_admin_webhook_request
  • bwc_is_advanced_fraud_tools
  • bwc_is_applepay_enabled
  • bwc_is_checkout
  • bwc_is_custom_form
  • bwc_is_descriptors_enabled
  • bwc_is_dynamic_card_display
  • bwc_is_paypal_enabled
  • bwc_is_wc_3_0_0_or_more
  • bwc_kount_enabled
  • bwc_kount_send_processing_email
  • bwc_locate_template
  • bwc_output_checkout_error
  • bwc_payment_icons_enclosed_type
  • bwc_payment_icons_outside
  • bwc_payment_icons_type
  • bwc_payment_loader_enabled
  • bwc_payment_method_token_field
  • bwc_payment_token_field
  • bwc_paypal_cart_checkout_enabled
  • bwc_paypal_checkout_banner_enabled
  • bwc_paypal_checkout_flow
  • bwc_paypal_credit_active
  • bwc_paypal_credit_conditions
  • bwc_paypal_credit_enabled
  • bwc_paypal_credit_send_shipping
  • bwc_paypal_send_shipping
  • bwc_postal_code_enabled
  • bwc_refresh_payment_fragments
  • bwc_saved_payment_method_style
  • bwc_saved_payment_methods_list
  • bwc_set_checkout_error
  • bwc_smart_buttons_enabled
  • bwc_use_admin_text_for_custom_form
  • bwcs_braintree_subscriptions_active
  • bwcs_calculate_order_total
  • bwcs_can_combine_subscriptions
  • bwcs_can_delete_payment_method
  • bwcs_cart_item_contains_subscription
  • bwcs_get_cart_item_key
  • bwcs_get_current_date_time
  • bwcs_get_num_of_billing_cycles
  • bwcs_get_plan_from_product
  • bwcs_get_product_from_subscription
  • bwcs_get_start_date_in_utc
  • bwcs_get_subscription_date
  • bwcs_is_braintree_subscription
  • bwcs_is_change_payment_method
  • bwcs_is_paid_for_failed_renewal_request
  • bwcs_is_woocommerce_change_payment
  • bwcs_order_contains_subscription
  • bwcs_order_has_coupon
  • bwcs_order_is_subscription
  • bwcs_product_is_subscription
  • bwcs_retry_after_exception
  • bwcs_start_date_in_site_timezone
  • bwcs_subscription_has_trial
  • bwcs_subscription_is_synched
  • bwcs_subscriptions_active
  • wc_braintree_add_allowed_html
  • wc_braintree_add_body_class
  • wc_braintree_banner_checkout_template
  • wc_braintree_card_loader_options
  • wc_braintree_cart_checkout_template
  • wc_braintree_connection_settings
  • wc_braintree_create_payment_token
  • wc_braintree_create_payment_token_from_transaction
  • wc_braintree_custom_form_active
  • wc_braintree_custom_form_options
  • wc_braintree_delete_customer
  • wc_braintree_deprecated_template_check
  • wc_braintree_device_data_field
  • wc_braintree_display_prices_including_tax
  • wc_braintree_enqueue_local_payments
  • wc_braintree_environment
  • wc_braintree_errors_from_object
  • wc_braintree_evaluate_condition
  • wc_braintree_filter_customer_payment_tokens
  • wc_braintree_filter_payment_tokens
  • wc_braintree_generate_client_token
  • wc_braintree_get_3ds_actions
  • wc_braintree_get_card_type_icons
  • wc_braintree_get_checkout_fields
  • wc_braintree_get_conditional_values
  • wc_braintree_get_currency
  • wc_braintree_get_custom_form
  • wc_braintree_get_customer_id
  • wc_braintree_get_error_messages
  • wc_braintree_get_fee_gateways
  • wc_braintree_get_file_data
  • wc_braintree_get_local_gateways
  • wc_braintree_get_merchant_account
  • wc_braintree_get_merchant_accounts
  • wc_braintree_get_order_environment
  • wc_braintree_get_order_for_payment_id
  • wc_braintree_get_payment_method_format
  • wc_braintree_get_payment_tokens
  • wc_braintree_get_products_for_conditions
  • wc_braintree_get_response_code_message
  • wc_braintree_get_template
  • wc_braintree_get_template_html
  • wc_braintree_hidden_field
  • wc_braintree_local_payment_completed
  • wc_braintree_local_payment_params
  • wc_braintree_log
  • wc_braintree_log_error
  • wc_braintree_log_info
  • wc_braintree_merchant_id
  • wc_braintree_merge_order_statuses
  • wc_braintree_move_translations
  • wc_braintree_nonce_field
  • wc_braintree_order_statuses
  • wc_braintree_order_statuses_for_registration
  • wc_braintree_output_checkout_error
  • wc_braintree_parse_xml_contents
  • wc_braintree_payment_complete_order_status
  • wc_braintree_payment_gateways
  • wc_braintree_payment_method_formats
  • wc_braintree_payment_method_title
  • wc_braintree_payment_token_field
  • wc_braintree_pre_orders_active
  • wc_braintree_private_key
  • wc_braintree_process_scheduled_local_payment
  • wc_braintree_production_active
  • wc_braintree_public_key
  • wc_braintree_save_cc_enabled
  • wc_braintree_save_customer
  • wc_braintree_set_checkout_error
  • wc_braintree_show_product_checkout_gateways
  • wc_braintree_spam_bot_field
  • wc_braintree_subscriptions_active
  • wc_braintree_update_customer_location
  • wc_braintree_webhook_check
  • wc_braintree_woocommerce_payment_token_deleted
  • wcs_braintree_account_menu_items
  • wcs_braintree_active
  • wcs_braintree_before_delete_order_item
  • wcs_braintree_billing_interval_string
  • wcs_braintree_billing_intervals
  • wcs_braintree_billing_periods
  • wcs_braintree_billing_periods_string
  • wcs_braintree_calculate_end_date
  • wcs_braintree_calculate_first_payment_date
  • wcs_braintree_calculate_next_payment_date
  • wcs_braintree_calculate_start_date
  • wcs_braintree_cart_contains_subscription
  • wcs_braintree_cart_formatted_date
  • wcs_braintree_cart_recurring_tax_html
  • wcs_braintree_cart_recurring_total_html
  • wcs_braintree_cart_shipping_total
  • wcs_braintree_cart_subtotal_string
  • wcs_braintree_cart_tax_total_html
  • wcs_braintree_cart_totals_coupon_html
  • wcs_braintree_change_payment_method_template
  • wcs_braintree_copy_address_from_order
  • wcs_braintree_copy_order_meta
  • wcs_braintree_create_order_from_subscription
  • wcs_braintree_create_renewal_order
  • wcs_braintree_create_subscription
  • wcs_braintree_frontend_interval_string
  • wcs_braintree_get_billing_schedule_string
  • wcs_braintree_get_interval_string
  • wcs_braintree_get_length_string
  • wcs_braintree_get_period_string
  • wcs_braintree_get_plan_from_product
  • wcs_braintree_get_plan_options
  • wcs_braintree_get_plans
  • wcs_braintree_get_price_string
  • wcs_braintree_get_product_price_html
  • wcs_braintree_get_recurring_cart_key
  • wcs_braintree_get_recurring_total_text
  • wcs_braintree_get_related_orders
  • wcs_braintree_get_subscription
  • wcs_braintree_get_subscription_actions
  • wcs_braintree_get_subscription_from_recurring_cart_key
  • wcs_braintree_get_subscription_status_name
  • wcs_braintree_get_subscription_statuses
  • wcs_braintree_get_subscription_statuses_for_registration
  • wcs_braintree_get_subscriptions_for_order
  • wcs_braintree_get_subscriptions_for_user
  • wcs_braintree_is_change_payment_method_request
  • wcs_braintree_localize_scripts
  • wcs_braintree_order_contains_subscription
  • wcs_braintree_order_details
  • wcs_braintree_product_is_subscription
  • wcs_braintree_subscription_cancelled
  • wcs_braintree_subscription_length_string
  • wcs_braintree_subscription_user_actions
  • wcs_braintree_subscriptions_template
  • wcs_braintree_sync_subscription_with_gateway
  • wcs_braintree_view_subscription_template
  • wcs_braintree_webhook_subscription_cancelled
  • wcs_braintree_webhook_subscription_charged_successfully
  • wcs_braintree_webhook_subscription_expired
  • wcs_braintree_webhook_subscription_past_due

Class WC_Braintree_Payment_Gateway

Abstract class that is meant to be extended by Braintree payment methods.

WC_Payment_Gateway
Extended by WC_Braintree_Payment_Gateway uses WC_Braintree_Settings_Trait

Direct known subclasses

WC_Braintree_ApplePay_Payment_Gateway, WC_Braintree_CC_Payment_Gateway, WC_Braintree_GooglePay_Payment_Gateway, WC_Braintree_Local_Payment_Gateway, WC_Braintree_PayPal_Payment_Gateway, WC_Braintree_Venmo_Payment_Gateway

Indirect known subclasses

WC_Braintree_Alipay_Payment_Gateway, WC_Braintree_Bancontact_Payment_Gateway, WC_Braintree_EPS_Payment_Gateway, WC_Braintree_Giropay_Payment_Gateway, WC_Braintree_IDEAL_Payment_Gateway, WC_Braintree_MyBank_Payment_Gateway, WC_Braintree_P24_Payment_Gateway, WC_Braintree_Sepa_Payment_Gateway, WC_Braintree_Sofort_Payment_Gateway, WC_Braintree_WeChat_Payment_Gateway

Abstract
Package: Braintree\Abstracts
Version: 3.0.0
Located at abstract/abstract-class-wc-braintree-payment-gateway.php

Methods summary

public static
# init( )

Initialize static functions

Initialize static functions

public
# __construct( )

WC_Braintree_Payment_Gateway constructor.

WC_Braintree_Payment_Gateway constructor.

public
# add_hooks( )

Add all standard filters

Add all standard filters

public
# set_supports( )
public boolean|mixed|
# is_available( )

Wrapper for the WC_Payment_Gateway::is_available function. A filter is added so merchants can add custom logic for determining when the gateway should be available.

Wrapper for the WC_Payment_Gateway::is_available function. A filter is added so merchants can add custom logic for determining when the gateway should be available.

Returns

boolean|mixed|
public
# connect( string $env = '' )

Parameters

$env
public
# payment_fields( )
public
# delete_payment_method( integer $token_id, WC_Payment_Token $token )

Delete a payment method in the Braintree gateway.

Delete a payment method in the Braintree gateway.

Parameters

$token_id
$token
public
# pre_update_payment_method( WC_Subscription $subscription, string $new_payment_method )

Parameters

$subscription
$new_payment_method
public
# subscription_payment_meta( array $payment_meta, WC_Subscription $subscription )

Parameters

$payment_meta
$subscription
public
# generate_button_demo_html( $key, $data )
public
# admin_options( )
public
# enqueue_admin_scripts( )
public
# enqueue_frontend_scripts( WC_Braintree_Frontend_Scripts $scripts )

Parameters

$scripts
public
# enqueue_checkout_scripts( WC_Braintree_Frontend_Scripts $scripts )

Parameters

$scripts
public
# enqueue_add_payment_method_scripts( WC_Braintree_Frontend_Scripts $scripts )

Parameters

$scripts
public
# enqueue_cart_scripts( WC_Braintree_Frontend_Scripts $scripts )

Parameters

$scripts
public
# enqueue_product_scripts( WC_Braintree_Frontend_Scripts $scripts )

Parameters

$scripts
public
# enqueue_mini_cart_scripts( WC_Braintree_Frontend_Scripts $scripts )

Parameters

$scripts

Since

3.2.5
public
# init_form_fields( )
public string
# generate_client_token( )

Generate a client token

Generate a client token

Returns

string
public
# process_payment( $order_id )
public
# payment_complete_actions( WC_Order $order, Braintree\Transaction $transaction, array $args )

Handles order status once payment has been captured or authorized.

Handles order status once payment has been captured or authorized.

Parameters

$order
$transaction
$args

Since

3.0.8
public
# get_payment_method_token( )

If the payment_method_token has been set then return it. If not look for the token in the $_POST.

If the payment_method_token has been set then return it. If not look for the token in the $_POST.

public
# get_payment_method_nonce( )

If the payment_method_nonce has been set, then return it. If not look for the nonce in the $_POST.

If the payment_method_nonce has been set, then return it. If not look for the nonce in the $_POST.

public
# set_payment_method_nonce( string $value )

Parameters

$value
public
# set_payment_method_token( string $value )

Parameters

$value
public
# get_customer_attributes( WC_Order $order )

Parameters

$order
public
# get_order_id( WC_Order $order )

Parameters

$order
public
# get_descriptors( )

Deprecated

public
# add_order_descriptors( array & $args, WC_Order $order )

Parameters

$args
$order

Since

3.2.1
public
# get_order_options( WC_Order $order )

Parameters

$order
public
# add_order_options( & $args, $order )
public
# get_device_data( )
public
# add_order_device_data( & $args, $order )

Parameters

$args
$order

Returns


$this

Since

3.2.1
public
# should_save_payment_method( )

Return true if the payment method used on the checkout page should be saved. Payment methods should only be saved if the customer's wants to save the method or a new method is being used and there are subscriptions associated with the order.

Return true if the payment method used on the checkout page should be saved. Payment methods should only be saved if the customer's wants to save the method or a new method is being used and there are subscriptions associated with the order.

public
# use_saved_method( )

Return true if a saved payment method should be used.

Return true if a saved payment method should be used.

public
# order_error_result( $msg = '' )
public
# order_success_result( WC_Order $order )

Parameters

$order
public
# save_order_meta( Braintree\Transaction $transaction, WC_Order $order )

Save transaction data as meta data of the order.

Save transaction data as meta data of the order.

Parameters

$transaction
$order
abstract public
# get_payment_method_from_transaction( Braintree\Transaction $transaction )

Return the payment method details from the tranaction.

Return the payment method details from the tranaction.

Parameters

$transaction
public WC_Payment_Token_Braintree
# get_payment_token( mixed $method )

Parameters

$method

Returns

WC_Payment_Token_Braintree
public
# get_token_type( )
public
# save_zero_total_order_meta( WC_Order $order )

Parameters

$order
public
# process_refund( $order_id, $amount = null, $reason = '' )
public boolean|WP_Error
# capture_charge( float $amount, WC_Order $order )

Capture the provided amount.

Capture the provided amount.

Parameters

$amount
$order

Returns

boolean|WP_Error
public boolean|WP_Error
# void_charge( WC_Order $order )

Parameters

$order

Returns

boolean|WP_Error
public array|string[]
# add_payment_method( array $args = array(), WC_Order|flse $order = false )

Parameters

$args
$order

Returns

array|string[]
public WP_Error|Braintree\Transaction
# fetch_transaction( string $id, $env = '' )

Parameters

$id
$env

Returns

WP_Error|Braintree\Transaction
public static
# capture_transaction_from_status( integer $order_id, WC_Order $order )

Parameters

$order_id
$order
public static
# void_transaction_from_status( integer $order_id, WC_Order $order )

Parameters

$order_id
$order
public
# get_localized_standard_params( )
public static
# available_payment_gateways( $gateways )
public
# wcs_before_process_order( WC_Order $order )

Parameters

$order
public
# wcs_braintree_before_process_order( WC_Order $order )

If the plugin's subscription functionality is being used and there is a subscription in the cart and a new payment method is being used save the payment method.

If the plugin's subscription functionality is being used and there is a subscription in the cart and a new payment method is being used save the payment method.

Create the Braintree Subscription.

Parameters

$order
public
# create_braintree_subscription( WC_Braintree_Subscription $subscription, WC_Order $order )

Creates a subscription in the Braintree Gateway using data from the WC_Braintree_Subscription

Creates a subscription in the Braintree Gateway using data from the WC_Braintree_Subscription

Parameters

$subscription
$order
public WC_Payment_Token_Braintree
# get_token( string $token, $user_id = 0 )

Parameters

$token
$user_id

Returns

WC_Payment_Token_Braintree
public
# token_exists( string $token, integer $user_id = 0 )

Return true if the token exists in the woocommerce_payment_tokens table.

Return true if the token exists in the woocommerce_payment_tokens table.

Parameters

$token
$user_id

Since

3.0.7
public
# subscription_payment_method_updated( WC_Subscription $subscription )

Parameters

$subscription
public
# process_subscription_payment( float $amount, WC_Order $order )

Parameters

$amount
$order
private
# get_subscription_options( $order )
private
# add_subscription_options( array & $args, WC_Order $order )

Parameters

$args
$order

See

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

Parameters

$subscription
$order
public static
# process_shop_subscription_meta( integer $post_id, WP_Post $post )

Save WCS meta data when it's changed in the admin section. By default WCS saves the payment method title as the gateway title. This method saves the payment method title in a human readable format suitable for the frontend.

Save WCS meta data when it's changed in the admin section. By default WCS saves the payment method title as the gateway title. This method saves the payment method title in a human readable format suitable for the frontend.

Parameters

$post_id
$post
public
# cancel_braintree_subscription( WC_Braintree_Subscription $subscription )

Parameters

$subscription
public
# is_change_payment_request( )
public
# change_subscription_payment_method( WC_Braintree_Subscription $subscription )

Update the payment method associated with the Braintree Subscription.

Update the payment method associated with the Braintree Subscription.

Parameters

$subscription
public array
# get_config_data( )

Return Braintree config data included in the $_POST

Return Braintree config data included in the $_POST

Returns

array
public
# is_cart_checkout_enabled( )

Return true if the payment gateway has been enabled for cart checkout.

Return true if the payment gateway has been enabled for cart checkout.

public
# banner_fields( )

Output fields required for banner checkout.

Output fields required for banner checkout.

public
# cart_fields( )

Output fields required for cart checkout.

Output fields required for cart checkout.

public
# product_fields( )

Output fields required for product page checkout.

Output fields required for product page checkout.

public
# mini_cart_fields( )

Since

3.2.5
public
# remove_session_checkout_vars( )

Method that is called during successful checkout. It's purpose is to remove any gateway specific variables that are stored in the WC session.

Method that is called during successful checkout. It's purpose is to remove any gateway specific variables that are stored in the WC session.

public
# banner_checkout_enabled( )

Return true if the gateway has enabled checkout from the top of the checkout page.

Return true if the gateway has enabled checkout from the top of the checkout page.

public
# cart_checkout_enabled( )

Return true if the gateway has enabled cart checkout.

Return true if the gateway has enabled cart checkout.

public
# product_checkout_enabled( )

Return true if the gateway has enabled product checkout.

Return true if the gateway has enabled product checkout.

public boolean
# mini_cart_enabled( )

Returns

boolean

Since

3.2.5
public static
# deprecated_subscription_check( integer $subscription_id )

Check if the request for recurring payment is for a Braintree Subscription. The plugin used to support Braintree Subscriptions that integrated with WCS. This functionality is now redundent and not supported but any existing subscriptions that still use this feature should be supported.

Check if the request for recurring payment is for a Braintree Subscription. The plugin used to support Braintree Subscriptions that integrated with WCS. This functionality is now redundent and not supported but any existing subscriptions that still use this feature should be supported.

Parameters

$subscription_id
public
# get_payment_method_formats( )
private
# record_transaction( )
protected
# get_locale( )

Returns the locale of the shop. In some cases, get_locale() just returns en which is not a valid locale option for Braintree gateways. The country code suffix is required. Example: en_US

Returns the locale of the shop. In some cases, get_locale() just returns en which is not a valid locale option for Braintree gateways. The country code suffix is required. Example: en_US

protected
# add_order_line_items( array & $args, WC_Order $order, array & $items = array() )

Adds the WC_Order line items to the transaction args. For PayPal transactions, the totals must equal the amount property. Totals are calculated by PayPal as follows: taxAmount + shippingAmount + (item['unitAmount'] * item['quantity']). If those values do not equal the amount property, then validation will fail.

Adds the WC_Order line items to the transaction args. For PayPal transactions, the totals must equal the amount property. Totals are calculated by PayPal as follows: taxAmount + shippingAmount + (item['unitAmount'] * item['quantity']). If those values do not equal the amount property, then validation will fail.

Parameters

$args
$order
$items
public array
# add_to_cart_response( array $data )

Decorate the add to cart response with data relevant to the gateway.

Decorate the add to cart response with data relevant to the gateway.

Parameters

$data

Returns

array
public
# update_shipping_address_response( array $data )

Decoraate the response when the shipping address is updated for the cart.

Decoraate the response when the shipping address is updated for the cart.

Parameters

$data
public
# update_shipping_method_response( array $data )

Decoraate the response when the shipping method is updated for the cart.

Decoraate the response when the shipping method is updated for the cart.

Parameters

$data
public boolean
# needs_shipping( )

Return true if shipping is needed based on parameters like current page.

Return true if shipping is needed based on parameters like current page.

Returns

boolean
public
# get_shipping_packages( )
public boolean
# cart_contains_trial_period_subscription( )

Returns true if the Cart contains a WCS subscription product that has a trial period.

Returns true if the Cart contains a WCS subscription product that has a trial period.

Returns

boolean
public
# get_new_method_label( )
public
# get_saved_method_label( )
public the
# get_checkout_currency( )

Returns

the
currency that should be used for checkout.

Since

3.0.2
protected WP_Error|string
# create_customer( WC_Customer|null $customer = null )

Create a Braintree vault ID for the WC customer. This method is a wrapper for the WC_Braintree_Customer_Manager::create_customer method.

Create a Braintree vault ID for the WC customer. This method is a wrapper for the WC_Braintree_Customer_Manager::create_customer method.

Parameters

$customer

Returns

WP_Error|string

Since

3.0.4
public
# pre_order_before_process_order( WC_Order $order )

Check if the order contains a pre-order product. If so, may need to save the payment method.

Check if the order contains a pre-order product. If so, may need to save the payment method.

Parameters

$order

Since

3.0.6
protected
# pre_order_with_payment_later( WC_Order $order )

Parameters

$order

Since

3.0.6
public
# process_pre_order_payment( WC_Order $order )

Process the payment for the pre order. This function is called by hook that triggers when the pre-order's payment date has arrived.

Process the payment for the pre order. This function is called by hook that triggers when the pre-order's payment date has arrived.

Parameters

$order

Since

3.0.6
protected
# perform_kount_actions( WC_Order $order, Braintree\Transaction $transaction, array $args )

Parameters

$order
$transaction
$args

Since

3.0.8
protected
# get_order_meta_data( string $key, WC_Order $order, string $context = 'view' )

Returns the metadata value for the order. This function is used to find common metadata between this plugin and other Braintree plugins which use different naming conventions.

Returns the metadata value for the order. This function is used to find common metadata between this plugin and other Braintree plugins which use different naming conventions.

Parameters

$key
$order
$context

Since

3.1.4
public
# maybe_enqueue_checkout_scripts( )

Enqueue scripts if the payment fields are not displayed. Payment fields might not be displayed if the order total is zero due to a coupon. Scripts are still needed because customer might make a selection that makes the order total > 0

Enqueue scripts if the payment fields are not displayed. Payment fields might not be displayed if the order total is zero due to a coupon. Scripts are still needed because customer might make a selection that makes the order total > 0

Deprecated

3.2.10

Since

3.1.5
public
# output_checkout_fields( )

Output any fields required by the gateway

Output any fields required by the gateway

Since

3.1.5
public
# validate_fields( )

See

WC_Payment_Gateway::validate_fields()
private
# get_payment_section_description( )

Since

3.1.10
public
# update_shipping_response( array $data, WP_REST_Request $request )

Parameters

$data
$request

Throws

Exception

Since

3.1.11
public
# add_order_shipping_address( array & $args, WC_Order $order )

Parameters

$args
$order

Since

3.2.1
public
# add_order_billing_address( array & $args, WC_Order $order )

Parameters

$args
$order

Since

3.2.1
public
# add_order_shipping_amount( & $args, $order )
public
# add_order_general_args( array & $args, WC_Order $order )

Parameters

$args
$order

Since

3.2.1
public
# add_order_customer_id( array & $args, WC_Order $order )

Parameters

$args
$order

Returns


$this

Since

3.2.1
private
# format_order_line_item( array & $item, string $key, integer $len, boolean $unset = false )

Given a line item, trim or unset the specified property if it exceeds the max length.

Given a line item, trim or unset the specified property if it exceeds the max length.

Parameters

$item
$key
$len
$unset

Since

3.2.4
public array
# get_formatted_shipping_methods( )

Returns an array of shipping methods formatted for the gateway.

Returns an array of shipping methods formatted for the gateway.

Returns

array

Since

3.2.4
public array
# get_formatted_shipping_method( WC_Shipping_Rate $method, integer $index, boolean $selected, float $amount, integer $decimals )

Return a shipping method formatted for the gateway.

Return a shipping method formatted for the gateway.

Parameters

$method
$rate
$index
package index
$selected
is the shipping method selected
$amount
the amount for the rate
$decimals
number of decimals to format

Returns

array

Since

3.2.4
public
# get_shipping_method_id( WC_Shipping_Rate|string $method, integer $index )

Returns an ID that represents a shipping method.

Returns an ID that represents a shipping method.

Parameters

$method
$index
shipping package index

Since

3.2.4
public array
# update_shipping_error( Exception $e, array $data )

Parameters

$e
$data

Returns

array

Since

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

Parameters

$page
$data

Since

3.2.5
public
# get_display_items( string $page = 'checkout', WC_Order $order = null )

Returns an array of items for display in the Gateway' wallet.

Returns an array of items for display in the Gateway' wallet.

Parameters

$page
$order

Since

3.2.5
public
# get_display_items_for_cart( WC_Cart $cart, integer $decimals )

Parameters

$cart
$decimals
public array
# get_display_item_for_product( WC_Product $product, integer $decimals = 2 )

Parameters

$product
$decimals

Returns

array

Since

3.2.5
public
# get_display_items_for_order( WC_Order $order, integer $decimals = 2 )

Return an array of order items formatted for the gateway wallet display.

Return an array of order items formatted for the gateway wallet display.

Parameters

$order
$decimals

Since

3.2.5
public
# get_display_item_for_order( string $total, string $label, string $type, WC_Order $order, array $args )

Parameters

$total
the item total
$label
the label for the item
$type
the item type
$order
$args

Since

3.2.5
public
# get_display_item_for_cart( $total, $label, $type, $cart, $args, array $args,… )

Parameters

$total
$label
$type
$cart
$args
$args,…
public array
# get_display_items_for_subscription( $order, integer $decimals = 2 )

Parameters

$order
$decimals

Returns

array

Since

3.2.5
public
# get_display_items_for_recurring_cart( array $items, WC_Cart $cart, integer $decimals, boolean $incl_tax )

Parameters

$items
$cart
$decimals
$incl_tax
protected
# get_order_total( )
public mixed
# filter_address_state( string $state, string $country )

Parameters

$state
$country

Returns

mixed

Since

3.2.5
public array
# get_product_admin_options( )

Returns

array

Since

3.2.7
public
# set_product_gateway_option( $option )

Parameters

$option

Since

3.2.7
public
# has_enqueued_scripts( WC_Braintree_Frontend_Scripts $scripts, string $context = 'checkout' )

Parameters

$scripts
$context

Since

3.2.10
public
# get_transaction_url( $order )
protected
# do_post_payment_processing( WC_Order $order, string|null $type = null )

Perform processes that are dependent on a successful payment.

Perform processes that are dependent on a successful payment.

Parameters

$order
$type

Since

3.2.17
public
# process_change_payment_request( WC_Subscription $subscription )

Parameters

$subscription

Methods used from WC_Braintree_Settings_Trait

admin_settings_tabs(), generate_button_html(), generate_description_html(), generate_multi_select_countries_html(), generate_multiselect_html(), generate_paragraph_html(), generate_slider_html(), get_admin_localized_params(), get_braintree_documentation_url(), get_custom_attribute_html(), get_localized_params(), get_prefix(), get_tab_title(), is_active(), output_settings_nav(), process_admin_options(), validate_multi_select_countries_field()

Properties summary

public $nonce_key
#
public $token_key
#
public $device_data_key
#
public $save_method_key
#
public $payment_type_key
#
public string $config_key
# ''
protected string $token_type

The token type used to create WC_Payment_Token objects.

The token type used to create WC_Payment_Token objects.

#
protected string $deprecated_id
# ''
protected array $client_token
# ''
protected string $payment_method_token

Token that represents a vaulted payment method in Braintree. Example: cby23j

Token that represents a vaulted payment method in Braintree. Example: cby23j

# null
protected string $payment_method_nonce

Nonce that represents a once time use payment method.

Nonce that represents a once time use payment method.

# null
protected boolean $update_payment_method_request
# false
protected string $tab_title
# ''
public string $template

Template that points to where the gateway's html is rendered.

Template that points to where the gateway's html is rendered.

# ''
public boolean $processing_payment

Indicator for when payment is being processed.

Indicator for when payment is being processed.

#
protected array $order_totals

Since

3.2.3
# array( 'item' => array( 'subtotal' => 0, 'tax_total' => 0 ), 'discount' => array( 'subtotal' => 0, 'tax_total' => 0 ), 'fee' => array( 'subtotal' => 0, 'tax_total' => 0 ), 'shipping' => array( 'subtotal' => 0, 'tax_total' => 0 ), 'tax' => array( 'subtotal' => 0, 'tax_total' => 0 ) )
protected int[] $line_item_validations

Since

3.2.4
# array( 'commodityCode' => 12, 'description' => 127, 'discountAmount' => 2, 'name' => 35, 'productCode' => 12, 'taxAmount' => 2, 'totalAmount' => 2, 'unitAmount' => 4, 'unitOfMeasure' => 12, 'unitTaxAmount' => 2 )
protected boolean $has_digital_wallet

Since

3.2.5
# false
public WC_Braintree_Product_Gateway_Option $product_gateway_option

Since

3.2.7
#
public Braintree\Gateway $gateway
#
Braintree API documentation generated by ApiGen