mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
Merge branch 'trunk' into PCP-2157-apple-pay-add-support-for-pay-now-page
# Conflicts: # modules/ppcp-applepay/resources/js/Context/SingleProductHandler.js
This commit is contained in:
commit
cb753cf47c
23 changed files with 762 additions and 413 deletions
|
@ -23,18 +23,17 @@ class ApplepayButton {
|
|||
this.ppcpConfig
|
||||
);
|
||||
|
||||
//PRODUCT DETAIL PAGE
|
||||
this.refreshContextData();
|
||||
|
||||
this.updated_contact_info = []
|
||||
this.selectedShippingMethod = []
|
||||
this.nonce = document.getElementById('woocommerce-process-checkout-nonce').value
|
||||
this.nonce = document.getElementById('woocommerce-process-checkout-nonce')?.value
|
||||
|
||||
this.log = function() {
|
||||
if ( this.buttonConfig.is_debug ) {
|
||||
console.log('[ApplePayButton]', ...arguments);
|
||||
}
|
||||
}
|
||||
|
||||
this.refreshContextData();
|
||||
}
|
||||
|
||||
init(config) {
|
||||
|
@ -265,6 +264,8 @@ class ApplepayButton {
|
|||
case 'product':
|
||||
// Refresh product data that makes the price change.
|
||||
this.productQuantity = document.querySelector('input.qty').value;
|
||||
this.products = this.contextHandler.products();
|
||||
this.log('Products updated', this.products);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -394,6 +395,7 @@ class ApplepayButton {
|
|||
return {
|
||||
action: 'ppcp_update_shipping_contact',
|
||||
product_id: product_id,
|
||||
products: JSON.stringify(this.products),
|
||||
caller_page: 'productDetail',
|
||||
product_quantity: this.productQuantity,
|
||||
simplified_contact: event.shippingContact,
|
||||
|
@ -424,6 +426,7 @@ class ApplepayButton {
|
|||
action: 'ppcp_update_shipping_method',
|
||||
shipping_method: event.shippingMethod,
|
||||
product_id: product_id,
|
||||
products: JSON.stringify(this.products),
|
||||
caller_page: 'productDetail',
|
||||
product_quantity: this.productQuantity,
|
||||
simplified_contact: this.updated_contact_info,
|
||||
|
@ -461,6 +464,7 @@ class ApplepayButton {
|
|||
action: 'ppcp_create_order',
|
||||
'caller_page': this.context,
|
||||
'product_id': this.buttonConfig.product.id ?? null,
|
||||
'products': JSON.stringify(this.products),
|
||||
'product_quantity': this.productQuantity ?? null,
|
||||
'shipping_contact': shippingContact,
|
||||
'billing_contact': billingContact,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue