mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 09:08:09 +08:00
Merge trunk
This commit is contained in:
commit
aa1942b604
30 changed files with 589 additions and 48 deletions
|
@ -143,7 +143,7 @@ class SingleProductActionHandler {
|
|||
{
|
||||
this.cartHelper = null;
|
||||
|
||||
return (data, actions) => {
|
||||
return (data, actions, options = {}) => {
|
||||
this.errorHandler.clear();
|
||||
|
||||
const onResolve = (purchase_units) => {
|
||||
|
@ -178,7 +178,7 @@ class SingleProductActionHandler {
|
|||
});
|
||||
};
|
||||
|
||||
return this.updateCart.update(onResolve, this.getProducts());
|
||||
return this.updateCart.update(onResolve, this.getProducts(), options.updateCartOptions || {});
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -11,9 +11,10 @@ class UpdateCart {
|
|||
*
|
||||
* @param onResolve
|
||||
* @param {Product[]} products
|
||||
* @param {Object} options
|
||||
* @returns {Promise<unknown>}
|
||||
*/
|
||||
update(onResolve, products)
|
||||
update(onResolve, products, options = {})
|
||||
{
|
||||
return new Promise((resolve, reject) => {
|
||||
fetch(
|
||||
|
@ -27,6 +28,7 @@ class UpdateCart {
|
|||
body: JSON.stringify({
|
||||
nonce: this.nonce,
|
||||
products,
|
||||
...options
|
||||
})
|
||||
}
|
||||
).then(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue