mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 09:08:09 +08:00
Check if hosted fields instance exist before setting attribute
This commit is contained in:
parent
0781fb31d3
commit
909699886c
1 changed files with 28 additions and 24 deletions
|
@ -143,33 +143,37 @@ class CreditCardRenderer {
|
||||||
}
|
}
|
||||||
|
|
||||||
disableFields() {
|
disableFields() {
|
||||||
this.currentHostedFieldsInstance.setAttribute({
|
if( this.currentHostedFieldsInstance) {
|
||||||
field: 'number',
|
this.currentHostedFieldsInstance.setAttribute({
|
||||||
attribute: 'disabled'
|
field: 'number',
|
||||||
})
|
attribute: 'disabled'
|
||||||
this.currentHostedFieldsInstance.setAttribute({
|
})
|
||||||
field: 'cvv',
|
this.currentHostedFieldsInstance.setAttribute({
|
||||||
attribute: 'disabled'
|
field: 'cvv',
|
||||||
})
|
attribute: 'disabled'
|
||||||
this.currentHostedFieldsInstance.setAttribute({
|
})
|
||||||
field: 'expirationDate',
|
this.currentHostedFieldsInstance.setAttribute({
|
||||||
attribute: 'disabled'
|
field: 'expirationDate',
|
||||||
})
|
attribute: 'disabled'
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enableFields() {
|
enableFields() {
|
||||||
this.currentHostedFieldsInstance.removeAttribute({
|
if( this.currentHostedFieldsInstance) {
|
||||||
field: 'number',
|
this.currentHostedFieldsInstance.removeAttribute({
|
||||||
attribute: 'disabled'
|
field: 'number',
|
||||||
})
|
attribute: 'disabled'
|
||||||
this.currentHostedFieldsInstance.removeAttribute({
|
})
|
||||||
field: 'cvv',
|
this.currentHostedFieldsInstance.removeAttribute({
|
||||||
attribute: 'disabled'
|
field: 'cvv',
|
||||||
})
|
attribute: 'disabled'
|
||||||
this.currentHostedFieldsInstance.removeAttribute({
|
})
|
||||||
field: 'expirationDate',
|
this.currentHostedFieldsInstance.removeAttribute({
|
||||||
attribute: 'disabled'
|
field: 'expirationDate',
|
||||||
})
|
attribute: 'disabled'
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_submit(contextConfig) {
|
_submit(contextConfig) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue