mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
✨ New TransactionInfo DTO
This commit is contained in:
parent
7946150f5b
commit
611ab4c5a7
3 changed files with 21 additions and 22 deletions
|
@ -35,15 +35,14 @@ class BaseHandler {
|
|||
|
||||
// handle script reload
|
||||
const data = result.data;
|
||||
|
||||
resolve(
|
||||
new TransactionInfo(
|
||||
data.total,
|
||||
data.currency_code,
|
||||
data.country_code,
|
||||
true
|
||||
)
|
||||
const transaction = new TransactionInfo(
|
||||
data.total,
|
||||
data.currency_code,
|
||||
data.country_code,
|
||||
true
|
||||
);
|
||||
|
||||
resolve( transaction );
|
||||
} );
|
||||
} );
|
||||
}
|
||||
|
|
|
@ -15,14 +15,14 @@ class PayNowHandler extends BaseHandler {
|
|||
return new Promise( async ( resolve, reject ) => {
|
||||
const data = this.ppcpConfig.pay_now;
|
||||
|
||||
resolve(
|
||||
new TransactionInfo(
|
||||
data.total,
|
||||
data.currency_code,
|
||||
data.country_code,
|
||||
true
|
||||
)
|
||||
const transaction = new TransactionInfo(
|
||||
data.total,
|
||||
data.currency_code,
|
||||
data.country_code,
|
||||
true
|
||||
);
|
||||
|
||||
resolve( transaction );
|
||||
} );
|
||||
}
|
||||
|
||||
|
|
|
@ -43,14 +43,14 @@ class SingleProductHandler extends BaseHandler {
|
|||
this.ppcpConfig.ajax.simulate_cart.endpoint,
|
||||
this.ppcpConfig.ajax.simulate_cart.nonce
|
||||
).simulate( ( data ) => {
|
||||
resolve(
|
||||
new TransactionInfo(
|
||||
data.total,
|
||||
data.currency_code,
|
||||
data.country_code,
|
||||
true
|
||||
)
|
||||
const transaction = new TransactionInfo(
|
||||
data.total,
|
||||
data.currency_code,
|
||||
data.country_code,
|
||||
true
|
||||
);
|
||||
|
||||
resolve( transaction );
|
||||
}, products );
|
||||
} );
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue