mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Extract saved card selection check
This commit is contained in:
parent
9624c85a6c
commit
2e59248bf9
1 changed files with 6 additions and 1 deletions
|
@ -97,7 +97,7 @@ class CheckoutBootstap {
|
|||
return;
|
||||
}
|
||||
|
||||
if (jQuery('#saved-credit-card').length && jQuery('#saved-credit-card').val() !== '') {
|
||||
if (this.isSavedCardSelected()) {
|
||||
this.renderer.hideButtons(this.gateway.button.wrapper)
|
||||
this.renderer.hideButtons(this.gateway.messages.wrapper)
|
||||
this.renderer.hideButtons(this.gateway.hosted_fields.wrapper)
|
||||
|
@ -141,6 +141,11 @@ class CheckoutBootstap {
|
|||
currentPaymentMethod() {
|
||||
return jQuery('input[name="payment_method"]:checked').val();
|
||||
}
|
||||
|
||||
isSavedCardSelected() {
|
||||
const savedCardList = jQuery('#saved-credit-card');
|
||||
return savedCardList.length && savedCardList.val() !== '';
|
||||
}
|
||||
}
|
||||
|
||||
export default CheckoutBootstap
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue