mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Fix GooglePay mini-cart button loading
Fix GooglePay shipping callback Fix GooglePay button on cart updates
This commit is contained in:
parent
9ab11b40e4
commit
84e4c2c40a
4 changed files with 59 additions and 21 deletions
|
@ -168,7 +168,7 @@ class UpdatePaymentDataEndpoint {
|
|||
* @return void
|
||||
*/
|
||||
private function update_addresses( array $payment_data ): void {
|
||||
if ( ( $payment_data['callbackTrigger'] ?? '' ) !== 'SHIPPING_ADDRESS' ) {
|
||||
if ( ! in_array( $payment_data['callbackTrigger'] ?? '', array( 'SHIPPING_ADDRESS', 'INITIALIZE' ), true ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -185,11 +185,13 @@ class UpdatePaymentDataEndpoint {
|
|||
|
||||
$customer->set_billing_postcode( $payment_data['shippingAddress']['postalCode'] ?? '' );
|
||||
$customer->set_billing_country( $payment_data['shippingAddress']['countryCode'] ?? '' );
|
||||
$customer->set_billing_state( $payment_data['shippingAddress']['locality'] ?? '' );
|
||||
$customer->set_billing_state( '' );
|
||||
$customer->set_billing_city( $payment_data['shippingAddress']['locality'] ?? '' );
|
||||
|
||||
$customer->set_shipping_postcode( $payment_data['shippingAddress']['postalCode'] ?? '' );
|
||||
$customer->set_shipping_country( $payment_data['shippingAddress']['countryCode'] ?? '' );
|
||||
$customer->set_shipping_state( $payment_data['shippingAddress']['locality'] ?? '' );
|
||||
$customer->set_shipping_state( '' );
|
||||
$customer->set_shipping_city( $payment_data['shippingAddress']['locality'] ?? '' );
|
||||
|
||||
// Save the data.
|
||||
$customer->save();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue