mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 10:55:00 +08:00
Merge branch 'trunk' into PCP-3320-separate-google-pay-button-for-classic-checkout
This commit is contained in:
commit
74f319dd82
4 changed files with 14 additions and 5 deletions
|
@ -606,9 +606,11 @@ const PayPalComponent = ( {
|
|||
}
|
||||
|
||||
return ( data, actions ) => {
|
||||
shouldHandleShippingInPayPal()
|
||||
let shippingAddressChange = shouldHandleShippingInPayPal()
|
||||
? handleShippingAddressChange( data, actions )
|
||||
: null;
|
||||
|
||||
return shippingAddressChange;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -22,7 +22,8 @@ use WooCommerce\PayPalCommerce\Button\Endpoint\RequestData;
|
|||
* Class UpdateShippingEndpoint
|
||||
*/
|
||||
class UpdateShippingEndpoint implements EndpointInterface {
|
||||
const ENDPOINT = 'ppc-update-shipping';
|
||||
const ENDPOINT = 'ppc-update-shipping';
|
||||
const WC_STORE_API_ENDPOINT = '/wp-json/wc/store/cart/';
|
||||
|
||||
/**
|
||||
* The Request Data Helper.
|
||||
|
|
|
@ -141,6 +141,7 @@ class Renderer {
|
|||
// Check the condition and add the handler if needed
|
||||
if ( this.defaultSettings.should_handle_shipping_in_paypal ) {
|
||||
options.onShippingOptionsChange = ( data, actions ) => {
|
||||
let shippingOptionsChange =
|
||||
! this.isVenmoButtonClickedWhenVaultingIsEnabled(
|
||||
venmoButtonClicked
|
||||
)
|
||||
|
@ -150,8 +151,11 @@ class Renderer {
|
|||
this.defaultSettings
|
||||
)
|
||||
: null;
|
||||
|
||||
return shippingOptionsChange
|
||||
};
|
||||
options.onShippingAddressChange = ( data, actions ) => {
|
||||
let shippingAddressChange =
|
||||
! this.isVenmoButtonClickedWhenVaultingIsEnabled(
|
||||
venmoButtonClicked
|
||||
)
|
||||
|
@ -161,6 +165,8 @@ class Renderer {
|
|||
this.defaultSettings
|
||||
)
|
||||
: null;
|
||||
|
||||
return shippingAddressChange
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -1166,11 +1166,11 @@ document.querySelector("#payment").before(document.querySelector(".ppcp-messages
|
|||
),
|
||||
'update_customer_shipping' => array(
|
||||
'shipping_options' => array(
|
||||
'endpoint' => '/wp-json/wc/store/cart/select-shipping-rate',
|
||||
'endpoint' => home_url( UpdateShippingEndpoint::WC_STORE_API_ENDPOINT . 'select-shipping-rate' ),
|
||||
),
|
||||
'shipping_address' => array(
|
||||
'cart_endpoint' => '/wp-json/wc/store/cart/',
|
||||
'update_customer_endpoint' => '/wp-json/wc/store/v1/cart/update-customer/',
|
||||
'cart_endpoint' => home_url( UpdateShippingEndpoint::WC_STORE_API_ENDPOINT ),
|
||||
'update_customer_endpoint' => home_url( UpdateShippingEndpoint::WC_STORE_API_ENDPOINT . 'update-customer' ),
|
||||
),
|
||||
'wp_rest_nonce' => wp_create_nonce( 'wc_store_api' ),
|
||||
'update_shipping_method' => \WC_AJAX::get_endpoint( 'update_shipping_method' ),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue