mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
Allow credit card gateway to use saved credit cards
This commit is contained in:
parent
38d1b1ad9d
commit
fd7dfaf13b
10 changed files with 229 additions and 16 deletions
|
@ -15,6 +15,20 @@ class CheckoutBootstap {
|
|||
|
||||
jQuery(document.body).on('updated_checkout', () => {
|
||||
this.render();
|
||||
|
||||
jQuery('#saved-credit-card').on('change', () => {
|
||||
if(jQuery('#saved-credit-card').val() !== '') {
|
||||
this.renderer.hideButtons(this.gateway.button.wrapper);
|
||||
this.renderer.hideButtons(this.gateway.messages.wrapper);
|
||||
this.renderer.hideButtons(this.gateway.hosted_fields.wrapper);
|
||||
jQuery('#place_order').show();
|
||||
} else {
|
||||
jQuery('#place_order').hide();
|
||||
this.renderer.hideButtons(this.gateway.button.wrapper);
|
||||
this.renderer.hideButtons(this.gateway.messages.wrapper);
|
||||
this.renderer.showButtons(this.gateway.hosted_fields.wrapper);
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
jQuery(document.body).
|
||||
|
@ -79,4 +93,4 @@ class CheckoutBootstap {
|
|||
}
|
||||
}
|
||||
|
||||
export default CheckoutBootstap;
|
||||
export default CheckoutBootstap;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue