Skip to content

Commit

Permalink
smell: move id to variable
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiano-mallmann committed Sep 25, 2024
1 parent 0d7f316 commit b927095
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions assets/javascripts/front/checkout/model/payment/googlepay.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ let pagarmeGooglePay = {
woocommercePaymentMethods: 'input[name="payment_method"]',
googlePayAllowedBrands: ["AMEX", "ELO", "MASTERCARD", "VISA"],
pagarmeAllowedBrands: wc_pagarme_googlepay.allowedCcFlags,
woocommercePaymentId: "payment_method_woo-pagarme-payments-credit_card",
woocommercePaymentId: "#payment_method_woo-pagarme-payments-credit_card",

getGooglePaymentsClient: function () {
let environment = "TEST";
Expand Down Expand Up @@ -117,7 +117,7 @@ let pagarmeGooglePay = {
pagarmeGooglePay.processPayment(paymentData, self);
})
.catch(function (err) {
jQuery("#". pagarmeGooglePay.woocommercePaymentId ).val("woo-pagarme-payments-credit_card");
jQuery(pagarmeGooglePay.woocommercePaymentId ).val("woo-pagarme-payments-credit_card");
if (err.statusCode === "CANCELED") {
return;
}
Expand Down Expand Up @@ -157,10 +157,10 @@ let pagarmeGooglePay = {
.attr('id', "googlepaytoken")
.attr('value', paymentData.paymentMethodData.tokenizationData.token);
checkoutPaymentElement.append(input);
jQuery("#" . pagarmeGooglePay.woocommercePaymentId ).val("woo-pagarme-payments-googlepay");
jQuery(pagarmeGooglePay.woocommercePaymentId ).val("woo-pagarme-payments-googlepay");
checkoutPaymentElement.submit();
jQuery('form#order_review').submit();
jQuery("#" . pagarmeGooglePay.woocommercePaymentId ).val("woo-pagarme-payments-credit_card");
jQuery(pagarmeGooglePay.woocommercePaymentId ).val("woo-pagarme-payments-credit_card");
},

getCheckoutPaymentElement: function () {
Expand Down

0 comments on commit b927095

Please sign in to comment.