mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-08 21:52:55 +08:00
phpcs
This commit is contained in:
parent
7fd57b9393
commit
005a55c213
62 changed files with 905 additions and 751 deletions
|
@ -1,12 +1,14 @@
|
|||
class UpdateCart {
|
||||
|
||||
constructor(endpoint, nonce) {
|
||||
constructor(endpoint, nonce)
|
||||
{
|
||||
this.endpoint = endpoint;
|
||||
this.nonce = nonce;
|
||||
}
|
||||
|
||||
update(onResolve, product, qty, variations) {
|
||||
return new Promise( (resolve, reject) => {
|
||||
update(onResolve, product, qty, variations)
|
||||
{
|
||||
return new Promise((resolve, reject) => {
|
||||
fetch(
|
||||
this.endpoint,
|
||||
{
|
||||
|
@ -20,18 +22,17 @@ class UpdateCart {
|
|||
}
|
||||
).then(
|
||||
(result) => {
|
||||
return result.json();
|
||||
return result.json();
|
||||
}
|
||||
).then((result) => {
|
||||
if (! result.success) {
|
||||
reject(result.data);
|
||||
return;
|
||||
}
|
||||
).then( (result) => {
|
||||
if (! result.success) {
|
||||
reject(result.data);
|
||||
return;
|
||||
}
|
||||
|
||||
const resolved = onResolve(result.data);
|
||||
resolve(resolved);
|
||||
}
|
||||
)
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue