New TransactionInfo DTO

This commit is contained in:
Philipp Stracker 2024-08-13 18:53:39 +02:00
parent 7946150f5b
commit 611ab4c5a7
No known key found for this signature in database
3 changed files with 21 additions and 22 deletions

View file

@ -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 );
} );
} );
}

View file

@ -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 );
} );
}

View file

@ -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 );
} );
}