mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
Add save card to hosted fields
This commit is contained in:
parent
a280a19ec1
commit
b9c2550f3b
3 changed files with 20 additions and 27 deletions
|
@ -103,14 +103,11 @@ class CreditCardRenderer {
|
|||
});
|
||||
|
||||
if (formValid && this.cardValid) {
|
||||
|
||||
let vault = document.querySelector(wrapper + ' .ppcp-credit-card-vault') ?
|
||||
document.querySelector(wrapper + ' .ppcp-credit-card-vault').checked : false;
|
||||
vault = this.defaultConfig.enforce_vault || vault;
|
||||
|
||||
const vault = document.getElementById('ppcp-credit-card-vault') ?
|
||||
document.getElementById('ppcp-credit-card-vault').checked : false;
|
||||
hostedFields.submit({
|
||||
contingencies: ['3D_SECURE'],
|
||||
vault
|
||||
vault: vault
|
||||
}).then((payload) => {
|
||||
payload.orderID = payload.orderId;
|
||||
this.spinner.unblock();
|
||||
|
@ -147,4 +144,4 @@ class CreditCardRenderer {
|
|||
)
|
||||
}
|
||||
}
|
||||
export default CreditCardRenderer;
|
||||
export default CreditCardRenderer;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue