WC_Stripe_Controller_GooglePay
extends WC_Stripe_Rest_Controller
in package
uses
WC_Stripe_Controller_Cart_Trait, WC_Stripe_Controller_Frontend_Trait
Tags
Table of Contents
Properties
- $error : WP_Error
- $namespace : mixed
- $gateway : WC_Payment_Gateway_Stripe_GooglePay
- $reason_code : string
- $request : WP_REST_Request
- $shipping_method_id : string
Methods
- add_ready_to_calc_shipping() : mixed
- Method that hooks in to the woocommerce_cart_ready_to_calc_shipping filter.
- admin_permission_check() : mixed
- get_payment_response_data() : mixed
- Return a formatted array of response data required by the Google payment sheet.
- register_routes() : mixed
- Register all routes that the controller uses.
- rest_uri() : mixed
- rest_url() : mixed
- update_shipping_data() : mixed
- Update the WC shipping data from the Google payment sheet.
- validate_rest_nonce() : bool|WP_Error
- validate_shipping_address() : mixed
- add_validation_error() : mixed
- Allows a status code of 200 to be returned even if there is a validation error.
- cart_includes() : mixed
- empty_cart() : void
- frontend_includes() : mixed
- get_add_to_cart_args() : array<string|int, mixed>
- Return an array of arguments used to add a product to the cart.
- get_error_messages() : mixed
- get_messages() : mixed
- get_supported_gateways() : mixed
- register_authenticated_route() : mixed
- get_default_shipping_method() : string
- Returns a default shipping method based on the chosen shipping methods.
- get_shipping_method_from_request() : array<string|int, mixed>
- get_shipping_methods() : mixed
Properties
$error
protected
WP_Error
$error
= \null
$namespace
protected
mixed
$namespace
= 'googlepay'
$gateway
private
WC_Payment_Gateway_Stripe_GooglePay
$gateway
$reason_code
private
string
$reason_code
$request
private
WP_REST_Request
$request
Tags
$shipping_method_id
private
string
$shipping_method_id
Methods
add_ready_to_calc_shipping()
Method that hooks in to the woocommerce_cart_ready_to_calc_shipping filter.
public
add_ready_to_calc_shipping() : mixed
Purpose is to ensure true is returned so shipping packages are calculated. Some 3rd party plugins and themes return false if the current page is the cart because they don't want to display the shipping calculator.
Tags
admin_permission_check()
public
admin_permission_check(WP_REST_Request $request) : mixed
Parameters
- $request : WP_REST_Request
get_payment_response_data()
Return a formatted array of response data required by the Google payment sheet.
public
get_payment_response_data() : mixed
register_routes()
Register all routes that the controller uses.
public
register_routes() : mixed
rest_uri()
public
rest_uri([mixed $uri = '' ]) : mixed
Parameters
- $uri : mixed = ''
rest_url()
public
rest_url([mixed $uri = '' ]) : mixed
Parameters
- $uri : mixed = ''
update_shipping_data()
Update the WC shipping data from the Google payment sheet.
public
update_shipping_data(WP_REST_Request $request) : mixed
Parameters
- $request : WP_REST_Request
validate_rest_nonce()
public
validate_rest_nonce(mixed $request) : bool|WP_Error
Parameters
- $request : mixed
Tags
Return values
bool|WP_Errorvalidate_shipping_address()
public
validate_shipping_address(array<string|int, mixed> $address, WP_REST_Request $request) : mixed
Parameters
- $address : array<string|int, mixed>
- $request : WP_REST_Request
add_validation_error()
Allows a status code of 200 to be returned even if there is a validation error.
protected
add_validation_error(WP_Error $error) : mixed
Parameters
- $error : WP_Error
cart_includes()
protected
cart_includes() : mixed
empty_cart()
protected
empty_cart(WC_Cart $cart) : void
Parameters
- $cart : WC_Cart
frontend_includes()
protected
frontend_includes() : mixed
get_add_to_cart_args()
Return an array of arguments used to add a product to the cart.
protected
get_add_to_cart_args(WP_REST_Request $request) : array<string|int, mixed>
Parameters
- $request : WP_REST_Request
Tags
Return values
array<string|int, mixed>get_error_messages()
protected
get_error_messages() : mixed
get_messages()
protected
get_messages([mixed $types = 'all' ]) : mixed
Parameters
- $types : mixed = 'all'
get_supported_gateways()
protected
get_supported_gateways([mixed $context = 'product' ]) : mixed
Parameters
- $context : mixed = 'product'
register_authenticated_route()
protected
register_authenticated_route(string $route) : mixed
Parameters
- $route : string
get_default_shipping_method()
Returns a default shipping method based on the chosen shipping methods.
private
get_default_shipping_method(array<string|int, mixed> $methods) : string
Parameters
- $methods : array<string|int, mixed>
Return values
stringget_shipping_method_from_request()
private
get_shipping_method_from_request(WP_Rest_Request $request) : array<string|int, mixed>
Parameters
- $request : WP_Rest_Request
Tags
Return values
array<string|int, mixed>get_shipping_methods()
private
get_shipping_methods() : mixed