mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
🔀 Merge branch 'trunk'
# Conflicts: # modules/ppcp-applepay/resources/js/ApplepayButton.js # modules/ppcp-button/resources/js/modules/ContextBootstrap/CheckoutBootstap.js
This commit is contained in:
commit
6c54377a6e
53 changed files with 2415 additions and 2100 deletions
|
@ -930,10 +930,12 @@ class ApplePayButton {
|
|||
return {
|
||||
action: 'ppcp_update_shipping_method',
|
||||
shipping_method: event.shippingMethod,
|
||||
simplified_contact:
|
||||
this.updatedContactInfo ||
|
||||
this.initialPaymentRequest.shippingContact ||
|
||||
this.initialPaymentRequest.billingContact,
|
||||
simplified_contact: this.hasValidContactInfo(
|
||||
this.updatedContactInfo
|
||||
)
|
||||
? this.updatedContactInfo
|
||||
: this.initialPaymentRequest?.shippingContact ??
|
||||
this.initialPaymentRequest?.billingContact,
|
||||
product_id: productId,
|
||||
products: JSON.stringify( this.products ),
|
||||
caller_page: 'productDetail',
|
||||
|
@ -949,10 +951,12 @@ class ApplePayButton {
|
|||
return {
|
||||
action: 'ppcp_update_shipping_method',
|
||||
shipping_method: event.shippingMethod,
|
||||
simplified_contact:
|
||||
this.updatedContactInfo ||
|
||||
this.initialPaymentRequest.shippingContact ||
|
||||
this.initialPaymentRequest.billingContact,
|
||||
simplified_contact: this.hasValidContactInfo(
|
||||
this.updatedContactInfo
|
||||
)
|
||||
? this.updatedContactInfo
|
||||
: this.initialPaymentRequest?.shippingContact ??
|
||||
this.initialPaymentRequest?.billingContact,
|
||||
caller_page: 'cart',
|
||||
'woocommerce-process-checkout-nonce': this.nonce,
|
||||
};
|
||||
|
@ -1233,6 +1237,12 @@ class ApplePayButton {
|
|||
|
||||
return btoa( utf8Str );
|
||||
}
|
||||
|
||||
hasValidContactInfo( value ) {
|
||||
return Array.isArray( value )
|
||||
? value.length > 0
|
||||
: Object.keys( value || {} ).length > 0;
|
||||
}
|
||||
}
|
||||
|
||||
export default ApplePayButton;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue