Payment Plugins for Stripe WooCommerce - Version 3.3.33

Version Description

  • 11/23/22 =
  • Fixed - Afterpay payment method title not showing in order received emails and on order details page
  • Updated - Removed "beta" from Payment form label in settings
  • Added - Link support for FunnelKit/WooFunnels Upsells
Download this release

Release Info

Developer mr.clayton
Plugin Icon wp plugin Payment Plugins for Stripe WooCommerce
Version 3.3.33
Comparing to
See all releases

Code changes from version 3.3.32 to 3.3.33

assets/js/frontend/credit-card.js CHANGED
@@ -614,15 +614,22 @@
614
 
615
  CC.prototype.get_element_options = function () {
616
  if (this.is_payment_element_enabled()) {
617
- var params = this.params.elementOptions.mode === 'payment' ? {
618
- amount: this.get_total_price_cents(),
619
- currency: this.get_currency().toLowerCase()
620
- } : {};
621
  return $.extend({}, this.params.elementOptions, params);
622
  }
623
  return this.params.elementOptions;
624
  }
625
 
 
 
 
 
 
 
 
 
 
 
626
  CC.prototype.get_create_payment_method_params = function () {
627
  if (this.is_payment_element_enabled()) {
628
  return {
614
 
615
  CC.prototype.get_element_options = function () {
616
  if (this.is_payment_element_enabled()) {
617
+ var params = this.params.elementOptions.mode === 'payment' ? this.get_payment_element_params() : {};
 
 
 
618
  return $.extend({}, this.params.elementOptions, params);
619
  }
620
  return this.params.elementOptions;
621
  }
622
 
623
+ CC.prototype.get_payment_element_params = function () {
624
+ if (this.has_gateway_data()) {
625
+ return {
626
+ amount: this.get_total_price_cents(),
627
+ currency: this.get_currency().toLowerCase()
628
+ };
629
+ }
630
+ return {amount: 100, currency: this.params.currency.toLowerCase()};
631
+ }
632
+
633
  CC.prototype.get_create_payment_method_params = function () {
634
  if (this.is_payment_element_enabled()) {
635
  return {
assets/js/frontend/credit-card.min.js CHANGED
@@ -1 +1 @@
1
- !function(a,e){function t(){this.elementStatus={},e.BaseGateway.call(this,wc_stripe_credit_card_params),e.CheckoutGateway.call(this),this.message_container=this.params.notice_selector,window.addEventListener("hashchange",this.hashchange.bind(this)),(e.credit_card=this).confirmedSetupIntent=!1,this.has3DSecureParams(),this.handle_create_account_change(),a(document.body).on("change",'[name="stripe_cc_saved_method_key"]',this.maybe_initialize_installments.bind(this)),a(document.body).on("wc_stripe_saved_method_"+this.gateway_id,this.maybe_initialize_installments.bind(this))}var i={focus:"focused",empty:"empty",invalid:"invalid"};(t.prototype=a.extend({},e.BaseGateway.prototype,e.CheckoutGateway.prototype)).mappings={cardNumber:"#stripe-card-number",cardExpiry:"#stripe-exp",cardCvc:"#stripe-cvv"},t.prototype.handleActionMethod="handleCardAction",t.prototype.setupActionMethod="confirmCardSetup",t.prototype.initialize=function(){a(document.body).on("click","#place_order",this.place_order.bind(this)),a(document.body).on("change","#createaccount",this.handle_create_account_change.bind(this)),this.setup_card(),this.can_create_setup_intent()&&this.create_setup_intent(),this.maybe_initialize_installments()},t.prototype.setup_card=function(){var e;this.is_custom_form()?(e=a.extend(!0,{classes:i},this.params.cardOptions),["cardNumber","cardExpiry","cardCvc"].forEach(function(t){this[t]=this.elements.create(t,a.extend(!0,{},e,this.params.customFieldOptions[t])),this.elementStatus[t]={},this[t].on("change",this.on_card_element_change.bind(this))}.bind(this)),this.cardNumber.on("change",this.card_number_change.bind(this)),this.cardNumber.on("change",this.on_input_change.bind(this)),this.cardExpiry.on("change",this.on_input_change.bind(this)),this.cardCvc.on("change",this.on_input_change.bind(this)),this.fields.required("billing_postcode")&&""!==this.fields.get("billing_postcode")&&0<a("#stripe-postal-code").length&&(a("#stripe-postal-code").val(this.fields.get("billing_postcode")),this.validate_postal_field()),a(document.body).on("change","#billing_postcode",function(t){var e=a("#billing_postcode").val();a("#stripe-postal-code").val(e).trigger("keyup")}.bind(this))):(this.is_payment_element_enabled()?(this.card=this.elements.create("payment",{fields:{billingDetails:this.is_current_page("checkout")?{address:"never"}:"auto"},wallets:{applePay:"never",googlePay:"never"}}),this.elementStatus.payment={}):(this.card=this.elements.create("card",a.extend(!0,{},{value:{postalCode:this.fields.get("billing_postcode","")},hidePostalCode:this.fields.required("billing_postcode"),iconStyle:"default"},this.params.cardOptions)),a(document.body).on("change","#billing_postcode",function(t){this.card&&this.card.update({value:a("#billing_postcode").val()})}.bind(this)),this.elementStatus.card={}),this.card.on("change",this.on_card_element_change.bind(this))),setInterval(this.create_card_element.bind(this),2e3)},t.prototype.validate_postal_field=function(){var t,e;a("#billing_postcode").length&&a("#stripe-postal-code").length?this.params.postal_regex[this.fields.get("billing_country")]?(e=this.params.postal_regex[this.fields.get("billing_country")],t=a("#stripe-postal-code").val(),e=new RegExp(e,"i"),""!==t?null!==e.exec(t)?a("#stripe-postal-code").addClass("StripeElement--complete").removeClass("invalid"):a("#stripe-postal-code").removeClass("StripeElement--complete").addClass("invalid"):a("#stripe-postal-code").removeClass("StripeElement--complete").removeClass("invalid")):0!=a("#stripe-postal-code").val()?a("#stripe-postal-code").addClass("StripeElement--complete"):a("#stripe-postal-code").removeClass("StripeElement--complete"):a("#stripe-postal-code").length&&(""!=a("#stripe-postal-code").val()?a("#stripe-postal-code").addClass("StripeElement--complete"):a("#stripe-postal-code").removeClass("StripeElement--complete"))},t.prototype.create_card_element=function(){this.is_custom_form()?a("#wc-stripe-cc-custom-form").length&&0==a("#wc-stripe-cc-custom-form").find("iframe").length&&(a(this.mappings.cardNumber).length&&(this.cardNumber.mount(this.mappings.cardNumber),a(this.mappings.cardNumber).prepend(this.params.html.card_brand)),a(this.mappings.cardExpiry).length&&this.cardExpiry.mount(this.mappings.cardExpiry),a(this.mappings.cardCvc).length&&this.cardCvc.mount(this.mappings.cardCvc),a("#stripe-postal-code").length&&(a("#stripe-postal-code, .postalCode").on("focus",function(t){a("#stripe-postal-code").addClass("focused")}.bind(this)),a("#stripe-postal-code, .postalCode").on("blur",function(t){a("#stripe-postal-code").removeClass("focused").trigger("keyup")}.bind(this)),a("#stripe-postal-code").on("keyup",function(t){0==a("#stripe-postal-code").val()?a("#stripe-postal-code").addClass("empty"):a("#stripe-postal-code").removeClass("empty")}.bind(this)),a("#stripe-postal-code").on("change",this.validate_postal_field.bind(this)),a("#stripe-postal-code").trigger("change"))):a("#wc-stripe-card-element").length&&0==a("#wc-stripe-card-element").find("iframe").length&&(this.card.unmount(),this.card.mount("#wc-stripe-card-element"),this.is_payment_element_enabled()||this.card.update({value:{postalCode:this.fields.get("billing_postcode","")},hidePostalCode:this.fields.required("billing_postcode")})),a(this.container).outerWidth(!0)<450?a(this.container).addClass("stripe-small-container"):a(this.container).removeClass("stripe-small-container")},t.prototype.place_order=function(t){if(this.is_gateway_selected())if(this.fields.syncCheckoutFieldsWithDOM(),this.can_create_setup_intent()&&!this.is_saved_method_selected()&&this.checkout_fields_valid()){if(t.preventDefault(),this.confirmedSetupIntent)return this.on_setup_intent_received(this.confirmedSetupIntent);this.is_payment_element_enabled()?this.stripe.confirmSetup({elements:this.elements,clientSecret:this.client_secret,confirmParams:function(){var t={return_url:""};return this.is_current_page("checkout")&&(t.payment_method_data={billing_details:this.get_billing_details()}),t}.bind(this)(),redirect:"if_required"}).then(function(t){if(t.error)return this.submit_card_error(t.error);this.confirmedSetupIntent=t.setupIntent,this.on_setup_intent_received(t.setupIntent)}.bind(this)):this.stripe.confirmCardSetup(this.client_secret,{payment_method:{card:this.is_custom_form()?this.cardNumber:this.card,billing_details:function(){return this.is_current_page("checkout")?this.get_billing_details():a.extend({},this.is_custom_form()?{address:{postal_code:a("#stripe-postal-code").val()}}:{})}.bind(this)()}}).then(function(t){t.error?this.submit_card_error(t.error):(this.confirmedSetupIntent=t.setupIntent,this.on_setup_intent_received(t.setupIntent))}.bind(this))}else this.payment_token_received||this.is_saved_method_selected()||(t.preventDefault(),this.checkout_fields_valid()&&this.stripe.createPaymentMethod(this.get_create_payment_method_params()).then(function(t){if(t.error)return this.submit_card_error(t.error);this.is_current_page("order_pay")?(this.set_nonce(t.paymentMethod.id),this.process_order_pay()):this.on_token_received(t.paymentMethod)}.bind(this)))},t.prototype.checkout_place_order=function(){return this.is_saved_method_selected()||this.payment_token_received?e.CheckoutGateway.prototype.checkout_place_order.apply(this,arguments):(this.place_order.apply(this,arguments),!1)},t.prototype.on_token_received=function(t){this.payment_token_received=!0,t.hasOwnProperty("id")?this.set_nonce(t.id):this.set_nonce(t),this.get_form().trigger("submit")},t.prototype.on_setup_intent_received=function(t){this.payment_token_received=!0,this.set_nonce(t.payment_method),this.set_intent(t.id),this.get_form().trigger("submit")},t.prototype.updated_checkout=function(t,e){if(void 0!==e&&e.fragments&&e.fragments.hasOwnProperty(".wc-stripe-element-options")&&this.is_payment_element_enabled())try{var i=JSON.parse(window.atob(decodeURIComponent(e.fragments[".wc-stripe-element-options"])));this.params.elementOptions.mode!==i.mode&&(this.params.elementOptions.mode=i.mode,this.params.cardFormType="payment",this.elements=this.create_stripe_elements(),this.setup_card())}catch(s){}this.create_card_element(),this.handle_create_account_change(),!this.can_create_setup_intent()||this.client_secret||this.is_payment_element_enabled()||this.create_setup_intent()},t.prototype.update_checkout=function(){this.clear_card_elements()},t.prototype.show_payment_button=function(){e.CheckoutGateway.prototype.show_place_order.apply(this,arguments)},t.prototype.hide_place_order=function(){},t.prototype.is_custom_form=function(){return"1"===this.params.custom_form},t.prototype.get_postal_code=function(){return this.is_custom_form()&&0<a("#stripe-postal-code").length?a("#stripe-postal-code").val():this.fields.get(this.get_billing_prefix()+"_postcode",null)},t.prototype.card_number_change=function(t){"unknown"===t.brand?a("#wc-stripe-card").removeClass("active"):a("#wc-stripe-card").addClass("active"),a("#wc-stripe-card").attr("src",this.params.cards[t.brand])},t.prototype.on_input_change=function(t){if(t.complete){var e=a("#wc-stripe-cc-custom-form").find(".StripeElement, #stripe-postal-code"),i=[];e.each(function(t,e){i.push("#"+a(e).attr("id"))}.bind(this));var t=this.mappings[t.elementType],s=i.indexOf(t);if("undefined"!=typeof i[s+1])if("#stripe-postal-code"===i[s+1])document.getElementById("stripe-postal-code").focus();else for(var n in this.mappings)this.mappings[n]===i[s+1]&&this[n].focus()}},t.prototype.clear_card_elements=function(){for(var t=["cardNumber","cardExpiry","cardCvc"],e=0;e<t.length;e++)this[t[e]]&&this[t[e]].clear()},t.prototype.checkout_error=function(){this.is_gateway_selected()&&(this.payment_token_received=!1),e.CheckoutGateway.prototype.checkout_error.call(this)},t.prototype.get_billing_details=function(){var t=e.BaseGateway.prototype.get_billing_details.call(this);return t.address.postal_code=this.get_postal_code(),t},t.prototype.can_create_setup_intent=function(){return this.is_add_payment_method_page()||this.is_change_payment_method()||this.is_current_page("checkout")&&this.cart_contains_subscription()&&this.get_gateway_data()&&0==this.get_total_price_cents()||this.is_current_page(["checkout","product"])&&"undefined"!=typeof wc_stripe_preorder_exists||this.is_current_page("order_pay")&&"pre_order"in this.get_gateway_data()&&!0===this.get_gateway_data().pre_order||this.is_current_page("product")&&0==this.get_total_price_cents()},t.prototype.handle_create_account_change=function(){a("#createaccount").length&&(a("#createaccount").is(":checked")&&!this.linkPaymentEnabled?this.show_save_card():this.hide_save_card())},t.prototype.hide_save_card=function(){a(".wc-stripe-save-source").hide()},t.prototype.show_save_card=function(){a(".wc-stripe-save-source").show()},t.prototype.submit_card_error=function(t){"bcf"===this.params.notice_location&&(a(".wc-stripe-card-notice").remove(),a(".wc-stripe_cc-new-method-container").append('<div class="wc-stripe-card-notice"></div>')),e.BaseGateway.prototype.submit_error.call(this,t,!0)},t.prototype.container_styles=function(){e.CheckoutGateway.prototype.container_styles.apply(this,arguments),this.is_custom_form()&&a(this.container).find(".payment_box").addClass("custom-form__"+this.params.custom_form_name)},t.prototype.checkout_fields_valid=function(){var t=this.is_valid_checkout();return t||this.submit_error(this.params.messages.terms),t},t.prototype.is_installments_available=function(){var t=this.get_gateway_data();return!!t&&!!t.installments.enabled},t.prototype.update_element_status=function(t){this.elementStatus[t.elementType]=t},t.prototype.is_card_form_complete=function(){return Object.keys(this.elementStatus).filter(function(t){return!!this.elementStatus[t].complete}.bind(this)).length==Object.keys(this.elementStatus).length},t.prototype.on_card_element_change=function(t){this.update_element_status(t),this.is_current_page(["checkout","order_pay"])&&this.is_card_form_complete()&&this.is_installments_available()&&this.initialize_installments()},t.prototype.initialize_installments=function(t){this.installmentTimeoutId&&clearTimeout(this.installmentTimeoutId),this.installmentTimeoutId=setTimeout(function(t){t?(this.show_installment_loader(),this.fetch_installment_plans(t)["finally"](function(){this.hide_installment_loader()}.bind(this))):(this.is_payment_element_enabled()?this.stripe.updatePaymentIntent({elements:this.elements,params:{payment_method_data:{billing_details:this.get_billing_details()}}}).then(function(t){t.error?this.hide_installment_loader():(this.show_installment_loader(),this.fetch_installment_plans(t.paymentIntent.payment_method)["finally"](function(){this.hide_installment_loader()}.bind(this)))}.bind(this)):this.stripe.createPaymentMethod({type:"card",card:this.is_custom_form()?this.cardNumber:this.card,billing_details:this.get_billing_details()}).then(function(t){t.error?this.hide_installment_loader():(this.show_installment_loader(),this.fetch_installment_plans(t.paymentMethod.id)["finally"](function(){this.hide_installment_loader()}.bind(this)))}.bind(this)))["catch"](this.hide_installment_loader.bind(this))}.bind(this,t),250)},t.prototype.fetch_installment_plans=function(t){return this.fetch_payment_intent(t).then(function(t){t.installments_html&&a(".wc-stripe-installment-container").replaceWith(t.installments_html)}.bind(this))["catch"](function(t){return this.submit_card_error(t)}.bind(this))["finally"](function(){}.bind(this))},t.prototype.fetch_payment_intent=function(n){return new Promise(function(e,i){var t=this.params.routes.create_payment_intent,s=!1;this.is_current_page("order_pay")&&(t=this.params.routes.order_create_payment_intent,s=!0),a.ajax({url:t,method:"POST",dataType:"json",data:s?{payment_method_id:n,payment_method:this.gateway_id,order_id:this.get_gateway_data().order.id,order_key:this.get_gateway_data().order.key}:a.extend({},this.serialize_fields(),{payment_method_id:n,payment_method:this.gateway_id,page_id:this.get_page()}),beforeSend:this.ajax_before_send.bind(this)}).done(function(t){(t.code?i:e)(t)}.bind(this)).fail(function(t){i()}.bind(this))}.bind(this))},t.prototype.show_installment_loader=function(){a(".wc-stripe-installment-options").addClass("loading-installments"),a('[name="_stripe_installment_plan"] option:selected').eq(0).text(this.params.installments.loading),a(".wc-stripe-installment-loader").show()},t.prototype.hide_installment_loader=function(t){a(".wc-stripe-installment-options").removeClass("loading-installments"),a(".wc-stripe-installment-loader").hide()},t.prototype.maybe_initialize_installments=function(){this.is_installments_available()&&this.is_saved_method_selected()&&this.initialize_installments(this.get_selected_payment_method())},t.prototype.is_payment_element_enabled=function(){return"payment"===this.params.cardFormType},t.prototype.get_element_options=function(){if(this.is_payment_element_enabled()){var t="payment"===this.params.elementOptions.mode?{amount:this.get_total_price_cents(),currency:this.get_currency().toLowerCase()}:{};return a.extend({},this.params.elementOptions,t)}return this.params.elementOptions},t.prototype.get_create_payment_method_params=function(){return this.is_payment_element_enabled()?{elements:this.elements,params:{billing_details:this.get_billing_details()}}:{type:"card",card:this.is_custom_form()?this.cardNumber:this.card,billing_details:this.get_billing_details()}},new t}(jQuery,window.wc_stripe);
1
+ !function(a,e){function t(){this.elementStatus={},e.BaseGateway.call(this,wc_stripe_credit_card_params),e.CheckoutGateway.call(this),this.message_container=this.params.notice_selector,window.addEventListener("hashchange",this.hashchange.bind(this)),(e.credit_card=this).confirmedSetupIntent=!1,this.has3DSecureParams(),this.handle_create_account_change(),a(document.body).on("change",'[name="stripe_cc_saved_method_key"]',this.maybe_initialize_installments.bind(this)),a(document.body).on("wc_stripe_saved_method_"+this.gateway_id,this.maybe_initialize_installments.bind(this))}var i={focus:"focused",empty:"empty",invalid:"invalid"};(t.prototype=a.extend({},e.BaseGateway.prototype,e.CheckoutGateway.prototype)).mappings={cardNumber:"#stripe-card-number",cardExpiry:"#stripe-exp",cardCvc:"#stripe-cvv"},t.prototype.handleActionMethod="handleCardAction",t.prototype.setupActionMethod="confirmCardSetup",t.prototype.initialize=function(){a(document.body).on("click","#place_order",this.place_order.bind(this)),a(document.body).on("change","#createaccount",this.handle_create_account_change.bind(this)),this.setup_card(),this.can_create_setup_intent()&&this.create_setup_intent(),this.maybe_initialize_installments()},t.prototype.setup_card=function(){var e;this.is_custom_form()?(e=a.extend(!0,{classes:i},this.params.cardOptions),["cardNumber","cardExpiry","cardCvc"].forEach(function(t){this[t]=this.elements.create(t,a.extend(!0,{},e,this.params.customFieldOptions[t])),this.elementStatus[t]={},this[t].on("change",this.on_card_element_change.bind(this))}.bind(this)),this.cardNumber.on("change",this.card_number_change.bind(this)),this.cardNumber.on("change",this.on_input_change.bind(this)),this.cardExpiry.on("change",this.on_input_change.bind(this)),this.cardCvc.on("change",this.on_input_change.bind(this)),this.fields.required("billing_postcode")&&""!==this.fields.get("billing_postcode")&&0<a("#stripe-postal-code").length&&(a("#stripe-postal-code").val(this.fields.get("billing_postcode")),this.validate_postal_field()),a(document.body).on("change","#billing_postcode",function(t){var e=a("#billing_postcode").val();a("#stripe-postal-code").val(e).trigger("keyup")}.bind(this))):(this.is_payment_element_enabled()?(this.card=this.elements.create("payment",{fields:{billingDetails:this.is_current_page("checkout")?{address:"never"}:"auto"},wallets:{applePay:"never",googlePay:"never"}}),this.elementStatus.payment={}):(this.card=this.elements.create("card",a.extend(!0,{},{value:{postalCode:this.fields.get("billing_postcode","")},hidePostalCode:this.fields.required("billing_postcode"),iconStyle:"default"},this.params.cardOptions)),a(document.body).on("change","#billing_postcode",function(t){this.card&&this.card.update({value:a("#billing_postcode").val()})}.bind(this)),this.elementStatus.card={}),this.card.on("change",this.on_card_element_change.bind(this))),setInterval(this.create_card_element.bind(this),2e3)},t.prototype.validate_postal_field=function(){var t,e;a("#billing_postcode").length&&a("#stripe-postal-code").length?this.params.postal_regex[this.fields.get("billing_country")]?(e=this.params.postal_regex[this.fields.get("billing_country")],t=a("#stripe-postal-code").val(),e=new RegExp(e,"i"),""!==t?null!==e.exec(t)?a("#stripe-postal-code").addClass("StripeElement--complete").removeClass("invalid"):a("#stripe-postal-code").removeClass("StripeElement--complete").addClass("invalid"):a("#stripe-postal-code").removeClass("StripeElement--complete").removeClass("invalid")):0!=a("#stripe-postal-code").val()?a("#stripe-postal-code").addClass("StripeElement--complete"):a("#stripe-postal-code").removeClass("StripeElement--complete"):a("#stripe-postal-code").length&&(""!=a("#stripe-postal-code").val()?a("#stripe-postal-code").addClass("StripeElement--complete"):a("#stripe-postal-code").removeClass("StripeElement--complete"))},t.prototype.create_card_element=function(){this.is_custom_form()?a("#wc-stripe-cc-custom-form").length&&0==a("#wc-stripe-cc-custom-form").find("iframe").length&&(a(this.mappings.cardNumber).length&&(this.cardNumber.mount(this.mappings.cardNumber),a(this.mappings.cardNumber).prepend(this.params.html.card_brand)),a(this.mappings.cardExpiry).length&&this.cardExpiry.mount(this.mappings.cardExpiry),a(this.mappings.cardCvc).length&&this.cardCvc.mount(this.mappings.cardCvc),a("#stripe-postal-code").length&&(a("#stripe-postal-code, .postalCode").on("focus",function(t){a("#stripe-postal-code").addClass("focused")}.bind(this)),a("#stripe-postal-code, .postalCode").on("blur",function(t){a("#stripe-postal-code").removeClass("focused").trigger("keyup")}.bind(this)),a("#stripe-postal-code").on("keyup",function(t){0==a("#stripe-postal-code").val()?a("#stripe-postal-code").addClass("empty"):a("#stripe-postal-code").removeClass("empty")}.bind(this)),a("#stripe-postal-code").on("change",this.validate_postal_field.bind(this)),a("#stripe-postal-code").trigger("change"))):a("#wc-stripe-card-element").length&&0==a("#wc-stripe-card-element").find("iframe").length&&(this.card.unmount(),this.card.mount("#wc-stripe-card-element"),this.is_payment_element_enabled()||this.card.update({value:{postalCode:this.fields.get("billing_postcode","")},hidePostalCode:this.fields.required("billing_postcode")})),a(this.container).outerWidth(!0)<450?a(this.container).addClass("stripe-small-container"):a(this.container).removeClass("stripe-small-container")},t.prototype.place_order=function(t){if(this.is_gateway_selected())if(this.fields.syncCheckoutFieldsWithDOM(),this.can_create_setup_intent()&&!this.is_saved_method_selected()&&this.checkout_fields_valid()){if(t.preventDefault(),this.confirmedSetupIntent)return this.on_setup_intent_received(this.confirmedSetupIntent);this.is_payment_element_enabled()?this.stripe.confirmSetup({elements:this.elements,clientSecret:this.client_secret,confirmParams:function(){var t={return_url:""};return this.is_current_page("checkout")&&(t.payment_method_data={billing_details:this.get_billing_details()}),t}.bind(this)(),redirect:"if_required"}).then(function(t){if(t.error)return this.submit_card_error(t.error);this.confirmedSetupIntent=t.setupIntent,this.on_setup_intent_received(t.setupIntent)}.bind(this)):this.stripe.confirmCardSetup(this.client_secret,{payment_method:{card:this.is_custom_form()?this.cardNumber:this.card,billing_details:function(){return this.is_current_page("checkout")?this.get_billing_details():a.extend({},this.is_custom_form()?{address:{postal_code:a("#stripe-postal-code").val()}}:{})}.bind(this)()}}).then(function(t){t.error?this.submit_card_error(t.error):(this.confirmedSetupIntent=t.setupIntent,this.on_setup_intent_received(t.setupIntent))}.bind(this))}else this.payment_token_received||this.is_saved_method_selected()||(t.preventDefault(),this.checkout_fields_valid()&&this.stripe.createPaymentMethod(this.get_create_payment_method_params()).then(function(t){if(t.error)return this.submit_card_error(t.error);this.is_current_page("order_pay")?(this.set_nonce(t.paymentMethod.id),this.process_order_pay()):this.on_token_received(t.paymentMethod)}.bind(this)))},t.prototype.checkout_place_order=function(){return this.is_saved_method_selected()||this.payment_token_received?e.CheckoutGateway.prototype.checkout_place_order.apply(this,arguments):(this.place_order.apply(this,arguments),!1)},t.prototype.on_token_received=function(t){this.payment_token_received=!0,t.hasOwnProperty("id")?this.set_nonce(t.id):this.set_nonce(t),this.get_form().trigger("submit")},t.prototype.on_setup_intent_received=function(t){this.payment_token_received=!0,this.set_nonce(t.payment_method),this.set_intent(t.id),this.get_form().trigger("submit")},t.prototype.updated_checkout=function(t,e){if(void 0!==e&&e.fragments&&e.fragments.hasOwnProperty(".wc-stripe-element-options")&&this.is_payment_element_enabled())try{var i=JSON.parse(window.atob(decodeURIComponent(e.fragments[".wc-stripe-element-options"])));this.params.elementOptions.mode!==i.mode&&(this.params.elementOptions.mode=i.mode,this.params.cardFormType="payment",this.elements=this.create_stripe_elements(),this.setup_card())}catch(s){}this.create_card_element(),this.handle_create_account_change(),!this.can_create_setup_intent()||this.client_secret||this.is_payment_element_enabled()||this.create_setup_intent()},t.prototype.update_checkout=function(){this.clear_card_elements()},t.prototype.show_payment_button=function(){e.CheckoutGateway.prototype.show_place_order.apply(this,arguments)},t.prototype.hide_place_order=function(){},t.prototype.is_custom_form=function(){return"1"===this.params.custom_form},t.prototype.get_postal_code=function(){return this.is_custom_form()&&0<a("#stripe-postal-code").length?a("#stripe-postal-code").val():this.fields.get(this.get_billing_prefix()+"_postcode",null)},t.prototype.card_number_change=function(t){"unknown"===t.brand?a("#wc-stripe-card").removeClass("active"):a("#wc-stripe-card").addClass("active"),a("#wc-stripe-card").attr("src",this.params.cards[t.brand])},t.prototype.on_input_change=function(t){if(t.complete){var e=a("#wc-stripe-cc-custom-form").find(".StripeElement, #stripe-postal-code"),i=[];e.each(function(t,e){i.push("#"+a(e).attr("id"))}.bind(this));var t=this.mappings[t.elementType],s=i.indexOf(t);if("undefined"!=typeof i[s+1])if("#stripe-postal-code"===i[s+1])document.getElementById("stripe-postal-code").focus();else for(var n in this.mappings)this.mappings[n]===i[s+1]&&this[n].focus()}},t.prototype.clear_card_elements=function(){for(var t=["cardNumber","cardExpiry","cardCvc"],e=0;e<t.length;e++)this[t[e]]&&this[t[e]].clear()},t.prototype.checkout_error=function(){this.is_gateway_selected()&&(this.payment_token_received=!1),e.CheckoutGateway.prototype.checkout_error.call(this)},t.prototype.get_billing_details=function(){var t=e.BaseGateway.prototype.get_billing_details.call(this);return t.address.postal_code=this.get_postal_code(),t},t.prototype.can_create_setup_intent=function(){return this.is_add_payment_method_page()||this.is_change_payment_method()||this.is_current_page("checkout")&&this.cart_contains_subscription()&&this.get_gateway_data()&&0==this.get_total_price_cents()||this.is_current_page(["checkout","product"])&&"undefined"!=typeof wc_stripe_preorder_exists||this.is_current_page("order_pay")&&"pre_order"in this.get_gateway_data()&&!0===this.get_gateway_data().pre_order||this.is_current_page("product")&&0==this.get_total_price_cents()},t.prototype.handle_create_account_change=function(){a("#createaccount").length&&(a("#createaccount").is(":checked")&&!this.linkPaymentEnabled?this.show_save_card():this.hide_save_card())},t.prototype.hide_save_card=function(){a(".wc-stripe-save-source").hide()},t.prototype.show_save_card=function(){a(".wc-stripe-save-source").show()},t.prototype.submit_card_error=function(t){"bcf"===this.params.notice_location&&(a(".wc-stripe-card-notice").remove(),a(".wc-stripe_cc-new-method-container").append('<div class="wc-stripe-card-notice"></div>')),e.BaseGateway.prototype.submit_error.call(this,t,!0)},t.prototype.container_styles=function(){e.CheckoutGateway.prototype.container_styles.apply(this,arguments),this.is_custom_form()&&a(this.container).find(".payment_box").addClass("custom-form__"+this.params.custom_form_name)},t.prototype.checkout_fields_valid=function(){var t=this.is_valid_checkout();return t||this.submit_error(this.params.messages.terms),t},t.prototype.is_installments_available=function(){var t=this.get_gateway_data();return!!t&&!!t.installments.enabled},t.prototype.update_element_status=function(t){this.elementStatus[t.elementType]=t},t.prototype.is_card_form_complete=function(){return Object.keys(this.elementStatus).filter(function(t){return!!this.elementStatus[t].complete}.bind(this)).length==Object.keys(this.elementStatus).length},t.prototype.on_card_element_change=function(t){this.update_element_status(t),this.is_current_page(["checkout","order_pay"])&&this.is_card_form_complete()&&this.is_installments_available()&&this.initialize_installments()},t.prototype.initialize_installments=function(t){this.installmentTimeoutId&&clearTimeout(this.installmentTimeoutId),this.installmentTimeoutId=setTimeout(function(t){t?(this.show_installment_loader(),this.fetch_installment_plans(t)["finally"](function(){this.hide_installment_loader()}.bind(this))):(this.is_payment_element_enabled()?this.stripe.updatePaymentIntent({elements:this.elements,params:{payment_method_data:{billing_details:this.get_billing_details()}}}).then(function(t){t.error?this.hide_installment_loader():(this.show_installment_loader(),this.fetch_installment_plans(t.paymentIntent.payment_method)["finally"](function(){this.hide_installment_loader()}.bind(this)))}.bind(this)):this.stripe.createPaymentMethod({type:"card",card:this.is_custom_form()?this.cardNumber:this.card,billing_details:this.get_billing_details()}).then(function(t){t.error?this.hide_installment_loader():(this.show_installment_loader(),this.fetch_installment_plans(t.paymentMethod.id)["finally"](function(){this.hide_installment_loader()}.bind(this)))}.bind(this)))["catch"](this.hide_installment_loader.bind(this))}.bind(this,t),250)},t.prototype.fetch_installment_plans=function(t){return this.fetch_payment_intent(t).then(function(t){t.installments_html&&a(".wc-stripe-installment-container").replaceWith(t.installments_html)}.bind(this))["catch"](function(t){return this.submit_card_error(t)}.bind(this))["finally"](function(){}.bind(this))},t.prototype.fetch_payment_intent=function(n){return new Promise(function(e,i){var t=this.params.routes.create_payment_intent,s=!1;this.is_current_page("order_pay")&&(t=this.params.routes.order_create_payment_intent,s=!0),a.ajax({url:t,method:"POST",dataType:"json",data:s?{payment_method_id:n,payment_method:this.gateway_id,order_id:this.get_gateway_data().order.id,order_key:this.get_gateway_data().order.key}:a.extend({},this.serialize_fields(),{payment_method_id:n,payment_method:this.gateway_id,page_id:this.get_page()}),beforeSend:this.ajax_before_send.bind(this)}).done(function(t){(t.code?i:e)(t)}.bind(this)).fail(function(t){i()}.bind(this))}.bind(this))},t.prototype.show_installment_loader=function(){a(".wc-stripe-installment-options").addClass("loading-installments"),a('[name="_stripe_installment_plan"] option:selected').eq(0).text(this.params.installments.loading),a(".wc-stripe-installment-loader").show()},t.prototype.hide_installment_loader=function(t){a(".wc-stripe-installment-options").removeClass("loading-installments"),a(".wc-stripe-installment-loader").hide()},t.prototype.maybe_initialize_installments=function(){this.is_installments_available()&&this.is_saved_method_selected()&&this.initialize_installments(this.get_selected_payment_method())},t.prototype.is_payment_element_enabled=function(){return"payment"===this.params.cardFormType},t.prototype.get_element_options=function(){if(this.is_payment_element_enabled()){var t="payment"===this.params.elementOptions.mode?this.get_payment_element_params():{};return a.extend({},this.params.elementOptions,t)}return this.params.elementOptions},t.prototype.get_payment_element_params=function(){return this.has_gateway_data()?{amount:this.get_total_price_cents(),currency:this.get_currency().toLowerCase()}:{amount:100,currency:this.params.currency.toLowerCase()}},t.prototype.get_create_payment_method_params=function(){return this.is_payment_element_enabled()?{elements:this.elements,params:{billing_details:this.get_billing_details()}}:{type:"card",card:this.is_custom_form()?this.cardNumber:this.card,billing_details:this.get_billing_details()}},new t}(jQuery,window.wc_stripe);
assets/js/frontend/wc-stripe.js CHANGED
@@ -1670,7 +1670,7 @@
1670
  return new Promise(function (resolve) {
1671
  var paymentRequest = this.paymentRequest;
1672
  this.paymentRequest.canMakePayment().then(function (result) {
1673
- if (result && !result.applePay && paymentRequest === this.paymentRequest) {
1674
  this.can_pay = true;
1675
  this.create_button();
1676
  $(this.container).show();
1670
  return new Promise(function (resolve) {
1671
  var paymentRequest = this.paymentRequest;
1672
  this.paymentRequest.canMakePayment().then(function (result) {
1673
+ if (result && !result.applePay && !result.link && paymentRequest === this.paymentRequest) {
1674
  this.can_pay = true;
1675
  this.create_button();
1676
  $(this.container).show();
assets/js/frontend/wc-stripe.min.js CHANGED
@@ -1 +1 @@
1
- !function(a,o){a.wc_stripe={};var i=null;"undefined"==typeof wc_stripe_checkout_fields&&(a.wc_stripe_checkout_fields=[]),wc_stripe.BaseGateway=function(t,e){this.params=t,this.gateway_id=this.params.gateway_id,this.container=void 0===e?"li.payment_method_".concat(this.gateway_id):e,o(this.container).length||(this.container=".payment_method_".concat(this.gateway_id)),this.token_selector=this.params.token_selector,this.saved_method_selector=this.params.saved_method_selector,this.payment_token_received=!1,this.stripe=i,this.fields=r,this.elements=this.create_stripe_elements(),this.initialize()},wc_stripe.BaseGateway.prototype.create_stripe_elements=function(){return i.elements(o.extend({},{locale:"auto"},this.get_element_options()))},wc_stripe.BaseGateway.prototype.is_user_logged_in=function(){return 0<this.params.user_id},wc_stripe.BaseGateway.prototype.get_page=function(){var t=wc_stripe_params_v3.page;return"cart"===t&&o(document.body).is(".woocommerce-checkout")&&(t="checkout"),t},wc_stripe.BaseGateway.prototype.set_nonce=function(t){this.fields.set(this.gateway_id+"_token_key",t),o(this.token_selector).val(t)},wc_stripe.BaseGateway.prototype.set_intent=function(t){this.fields.set(this.gateway_id+"_payment_intent_key",t),o("#"+this.gateway_id+"_payment_intent_key").val(t)},wc_stripe.BaseGateway.prototype.get_element_options=function(){return this.params.elementOptions},wc_stripe.BaseGateway.prototype.initialize=function(){},wc_stripe.BaseGateway.prototype.create_button=function(){},wc_stripe.BaseGateway.prototype.is_gateway_selected=function(){return o('[name="payment_method"]:checked').val()===this.gateway_id},wc_stripe.BaseGateway.prototype.is_saved_method_selected=function(){return this.is_gateway_selected()&&"saved"===o('[name="'+this.gateway_id+'_payment_type_key"]:checked').val()},wc_stripe.BaseGateway.prototype.has_checkout_error=function(){return 0<o("#wc_stripe_checkout_error").length&&this.is_gateway_selected()},wc_stripe.BaseGateway.prototype.submit_error=function(t,e){var i=this.get_error_message(t);i.indexOf("</ul>")<0&&(i='<div class="'+function(){var t="woocommerce-NoticeGroup";return this.is_current_page("checkout")&&(t+=" woocommerce-NoticeGroup-checkout"),t}.bind(this)()+'"><ul class="woocommerce-error"><li>'+i+"</li></ul></div>");t=o(document.body).triggerHandler("wc_stripe_submit_error",[i,t,this]);i=void 0===t?i:t,this.submit_message(i,e)},wc_stripe.BaseGateway.prototype.submit_error_code=function(t){console.log(t)},wc_stripe.BaseGateway.prototype.get_error_message=function(t){return"object"==typeof t&&(t.hasOwnProperty("message")&&(-1<t.message.indexOf("server_side_confirmation_beta=v1")?t.code="server_side_confirmation_beta":-1<t.message.indexOf("params.payment_method_data.billing_details.phone")&&(t.code="phone_required")),t=t.code&&wc_stripe_messages[t.code]?wc_stripe_messages[t.code]:t.message),t},wc_stripe.BaseGateway.prototype.submit_message=function(t,e){o(".woocommerce-NoticeGroup-checkout, .woocommerce-error, .woocommerce-message").remove();var i=o(this.message_container);i.length&&(e||!i.closest("form").length)||(i.length||(i=o(this.container)),i=i.closest("form")),i.prepend(t),i.removeClass("processing"),o().unblock&&i.unblock(),i.find(".input-text, select, input:checkbox").trigger("blur"),o.scroll_to_notices?o.scroll_to_notices(i):o("html, body").animate({scrollTop:i.offset().top-100},1e3)},wc_stripe.BaseGateway.prototype.get_billing_details=function(){var t=this.get_billing_prefix(),t={name:this.get_customer_name(t),address:{city:this.fields.get(t+"_city",null),country:this.fields.get(t+"_country",null),line1:this.fields.get(t+"_address_1",null),line2:this.fields.get(t+"_address_2",null),postal_code:this.fields.get(t+"_postcode",null),state:this.fields.get(t+"_state",null)}};return t.name&&" "!==t.name||delete t.name,""!=this.fields.get("billing_email")&&(t.email=this.fields.get("billing_email")),""!=this.fields.get("billing_phone")&&(t.phone=this.fields.get("billing_phone")),t},wc_stripe.BaseGateway.prototype.get_first_name=function(t){return o("#"+t+"_first_name").val()},wc_stripe.BaseGateway.prototype.get_last_name=function(t){return o("#"+t+"_last_name").val()},wc_stripe.BaseGateway.prototype.get_shipping_prefix=function(){return this.needs_shipping()&&0<o('[name="ship_to_different_address"]').length&&o('[name="ship_to_different_address"]').is(":checked")?"shipping":"billing"},wc_stripe.BaseGateway.prototype.get_billing_prefix=function(){var t="billing";o('[name="billing_same_as_shipping"]').length&&o('[name="billing_same_as_shipping"]').is(":checked")&&(t="shipping"),o('[name="bill_to_different_address"]').length&&(1<o('[name="bill_to_different_address"]').length?"same_as_shipping"===o('[name="bill_to_different_address"]:checked').val()&&(t="shipping"):o('[name="bill_to_different_address"]').is(":checked")||(t="shipping"));var e=o(document.body).triggerHandler("wc_stripe_get_billing_prefix",[t]);return void 0===e?t:e},wc_stripe.BaseGateway.prototype.should_save_method=function(){return o("#"+this.gateway_id+"_save_source_key").is(":checked")},wc_stripe.BaseGateway.prototype.is_add_payment_method_page=function(){return"add_payment_method"===this.get_page()||o(document.body).hasClass("woocommerce-add-payment-method")},wc_stripe.BaseGateway.prototype.is_change_payment_method=function(){return"change_payment_method"===this.get_page()},wc_stripe.BaseGateway.prototype.get_selected_payment_method=function(){return o(this.saved_method_selector).val()},wc_stripe.BaseGateway.prototype.needs_shipping=function(){return this.get_gateway_data().needs_shipping},wc_stripe.BaseGateway.prototype.get_currency=function(){return this.get_gateway_data().currency},wc_stripe.BaseGateway.prototype.get_gateway_data=function(){var t=o(this.container).find(".woocommerce_".concat(this.gateway_id,"_gateway_data")).data("gateway");return void 0===t&&this.is_current_page("checkout")&&void 0===(t=o("form.checkout").find(".woocommerce_".concat(this.gateway_id,"_gateway_data")).data("gateway"))&&(t=o(".woocommerce_"+this.gateway_id+"_gateway_data").data("gateway")),t},wc_stripe.BaseGateway.prototype.set_gateway_data=function(t){o(this.container).find(".woocommerce_".concat(this.gateway_id,"_gateway_data")).data("gateway",t)},wc_stripe.BaseGateway.prototype.has_gateway_data=function(){return void 0!==this.get_gateway_data()},wc_stripe.BaseGateway.prototype.get_customer_name=function(t){return this.fields.get(t+"_first_name")+" "+this.fields.get(t+"_last_name")},wc_stripe.BaseGateway.prototype.get_customer_email=function(){return this.fields.get("billing_email")},wc_stripe.BaseGateway.prototype.get_address_field_hash=function(t){for(var e=["_first_name","_last_name","_address_1","_address_2","_postcode","_city","_state","_country"],i="",s=0;s<e.length;s++)i+=this.fields.get(t+e[s])+"_";return i},wc_stripe.BaseGateway.prototype.block=function(){o().block&&o.blockUI({message:null,overlayCSS:{background:"#fff",opacity:.6}})},wc_stripe.BaseGateway.prototype.unblock=function(){o().block&&o.unblockUI()},wc_stripe.BaseGateway.prototype.get_form=function(){return o(this.token_selector).closest("form")},wc_stripe.BaseGateway.prototype.get_total_price=function(){return this.get_gateway_data().total},wc_stripe.BaseGateway.prototype.get_total_price_cents=function(){return this.get_gateway_data().total_cents},wc_stripe.BaseGateway.prototype.set_total_price=function(t){var e=this.get_gateway_data();e.total=t,this.set_gateway_data(e)},wc_stripe.BaseGateway.prototype.set_total_price_cents=function(t){var e=this.get_gateway_data();e.total_cents=t,this.set_gateway_data(e)},wc_stripe.BaseGateway.prototype.set_payment_method=function(t){o('[name="payment_method"][value="'+t+'"]').prop("checked",!0).trigger("click")},wc_stripe.BaseGateway.prototype.set_selected_shipping_methods=function(t){if(this.fields.set("shipping_method",t),t&&o('[name^="shipping_method"]').length)for(var e in t){var i=t[e];o('[name="shipping_method['+e+']"][value="'+i+'"]').prop("checked",!0).trigger("change")}},wc_stripe.BaseGateway.prototype.on_token_received=function(t){this.payment_token_received=!0,this.set_nonce(t.id),this.process_checkout()},wc_stripe.BaseGateway.prototype.createPaymentRequest=function(){try{this.payment_request_options=this.get_payment_request_options(),this.paymentRequest=i.paymentRequest(this.payment_request_options),this.payment_request_options.requestShipping&&(this.paymentRequest.on("shippingaddresschange",this.update_shipping_address.bind(this)),this.paymentRequest.on("shippingoptionchange",this.update_shipping_method.bind(this))),this.paymentRequest.on("paymentmethod",this.on_payment_method_received.bind(this))}catch(t){return void this.submit_error(t.message)}},wc_stripe.BaseGateway.prototype.get_payment_request_options=function(){var t={country:this.params.country_code,currency:this.get_currency().toLowerCase(),total:{amount:this.get_total_price_cents(),label:this.params.total_label,pending:!0},requestPayerName:function(){return!this.is_current_page("checkout")||!this.is_valid_address(this.get_address_object("billing"),"billing",["email","phone"])}.bind(this)(),requestPayerEmail:this.fields.requestFieldInWallet("billing_email"),requestPayerPhone:this.fields.requestFieldInWallet("billing_phone"),requestShipping:function(){if(this.needs_shipping()){var t=this.get_shipping_prefix();if(this.is_current_page("checkout")&&!this.is_valid_address(this.get_address_object(t),t,["email","phone"])||!this.is_current_page("checkout"))return!0}return!1}.bind(this)()},e=this.get_display_items(),i=this.get_shipping_options();return e&&(t.displayItems=e),t.requestShipping&&i&&(t.shippingOptions=i),t},wc_stripe.BaseGateway.prototype.get_payment_request_update=function(t){var e={currency:this.get_currency().toLowerCase(),total:{amount:parseInt(this.get_total_price_cents()),label:this.params.total_label,pending:!0}},i=this.get_display_items(),s=this.get_shipping_options();return i&&(e.displayItems=i),this.payment_request_options.requestShipping&&s&&(e.shippingOptions=s),t&&(e=o.extend(!0,{},e,t)),e},wc_stripe.BaseGateway.prototype.get_display_items=function(){return this.get_gateway_data().items},wc_stripe.BaseGateway.prototype.set_display_items=function(t){var e=this.get_gateway_data();e.items=t,this.set_gateway_data(e)},wc_stripe.BaseGateway.prototype.get_shipping_options=function(){return this.get_gateway_data().shipping_options},wc_stripe.BaseGateway.prototype.set_shipping_options=function(t){var e=this.get_gateway_data();e.shipping_options=t,this.set_gateway_data(e)},wc_stripe.BaseGateway.prototype.map_address=function(t){return{city:t.city,postcode:t.postalCode,state:t.region,country:t.country}},wc_stripe.BaseGateway.prototype.on_payment_method_received=function(t){try{this.payment_response=t,this.populate_checkout_fields(t),t.complete("success"),this.on_token_received(t.paymentMethod)}catch(e){a.alert(e)}},wc_stripe.BaseGateway.prototype.populate_checkout_fields=function(t){this.set_nonce(t.paymentMethod.id),this.update_addresses(t)},wc_stripe.BaseGateway.prototype.update_addresses=function(t){t.payerName&&this.fields.set("name",t.payerName,"billing"),t.payerEmail&&this.fields.set("email",t.payerEmail,"billing"),t.payerPhone&&(this.fields.set("phone",t.payerPhone,"billing"),this.fields.exists("shipping_phone")&&this.fields.isEmpty("shipping_phone")&&this.fields.set("shipping_phone",t.payerPhone)),t.shippingAddress&&this.populate_shipping_fields(t.shippingAddress),t.paymentMethod.billing_details.address&&this.populate_billing_fields(t.paymentMethod.billing_details.address)},wc_stripe.BaseGateway.prototype.populate_address_fields=function(t,e){for(var i in t)null!==t[i]&&this.fields.set(i,t[i],e)},wc_stripe.BaseGateway.prototype.populate_billing_fields=function(t){this.populate_address_fields(t,"billing")},wc_stripe.BaseGateway.prototype.populate_shipping_fields=function(t){this.populate_address_fields(t,"shipping")},wc_stripe.BaseGateway.prototype.get_address_fields=function(){return["first_name","last_name","country","address_1","address_2","city","state","postcode","phone","email"]},wc_stripe.BaseGateway.prototype.get_address_object=function(e){var i={};return this.get_address_fields().forEach(function(t){i[t]=this.fields.get(t,e)}.bind(this)),i},wc_stripe.BaseGateway.prototype.is_current_page=function(t){return Array.isArray(t)?-1<t.indexOf(this.get_page()):this.get_page()===t},wc_stripe.BaseGateway.prototype.is_valid_address=function(t,e,i){if(o.isEmptyObject(t))return!1;var s=this.get_address_fields();void 0!==i&&i.forEach(function(t){-1<s.indexOf(t)&&s.splice(s.indexOf(t),1)});for(var a=0;a<s.length;a++){var n=s[a];if(this.fields.required(e+"_"+n)&&(!t[n]||"undefined"==typeof t[n]||!this.fields.isValid(n,t[n],t)))return!1}return!0},wc_stripe.BaseGateway.prototype.ajax_before_send=function(t){this.is_user_logged_in()&&t.setRequestHeader("X-WP-Nonce",this.params.rest_nonce)},wc_stripe.BaseGateway.prototype.process_checkout=function(){return new Promise(function(){this.block(),o.ajax({url:this.params.routes.checkout,method:"POST",dataType:"json",data:o.extend({},this.serialize_fields(),{payment_method:this.gateway_id,page_id:this.get_page(),currency:this.get_currency()}),beforeSend:this.ajax_before_send.bind(this)}).done(function(t){t.reload?a.location.reload():"success"===t.result?a.location=t.redirect:(t.messages&&this.submit_error(t.messages),this.unblock())}.bind(this)).fail(function(t,e,i){this.unblock(),this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.BaseGateway.prototype.process_payment=function(t,e){o.ajax({method:"POST",url:this.params.routes.checkout_payment,dataType:"json",data:o.extend({},this.fields.toJson(),{order_id:t,order_key:e}),beforeSend:this.ajax_before_send.bind(this)}).done(function(t){if(t.result&&"success"===t.result)a.location=t.redirect;else{if(t.reload)return a.location.reload();t.messages?(this.payment_token_received=!1,this.submit_error(t.messages)):this.submit_error(wc_checkout_params.i18n_checkout_error)}}.bind(this)).fail(function(){}.bind(this))},wc_stripe.BaseGateway.prototype.handle_next_action=function(e){try{return this.stripe[this.handleActionMethod](e.client_secret).then(function(t){if(t.error)return this.unblock(),this.payment_token_received=!1,this.submit_error(t.error);this.is_current_page("order_pay")?this.get_form().trigger("submit"):this.process_payment(e.order_id,e.order_key)}.bind(this))["catch"](function(t){this.submit_error(t.message)}.bind(this)),!1}catch(t){}},wc_stripe.BaseGateway.prototype.handle_payment_method_setup=function(e){try{return this.stripe[this.setupActionMethod](e.client_secret).then(function(t){if(t.error)return this.payment_token_received=!1,this.submit_error(t.error);this.is_current_page("order_pay")?this.get_form().trigger("submit"):this.process_payment(e.order_id,e.order_key)}.bind(this))["catch"](function(t){this.submit_error(t.message)}.bind(this)),!1}catch(t){}},wc_stripe.BaseGateway.prototype.hashchange=function(t){var e=a.location.hash.match(/response=(.*)/);if(e)try{var i=JSON.parse(a.atob(decodeURIComponent(e[1])));i&&i.hasOwnProperty("client_secret")&&i.gateway_id===this.gateway_id&&(history.pushState({},"",a.location.pathname),"intent"===i.type?this.handle_next_action(i):this.handle_payment_method_setup(i))}catch(s){}return!0},wc_stripe.BaseGateway.prototype.sync_payment_intent=function(t,s){return new Promise(function(e,i){o.ajax({method:"POST",dataType:"json",url:this.params.routes.sync_intent,data:{order_id:t,client_secret:s},beforeSend:this.ajax_before_send.bind(this)}).done(function(t){(t.code?i:e)(t)}).fail(function(t,e,i){this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.BaseGateway.prototype.create_setup_intent=function(){return new Promise(function(e,i){o.ajax({method:"POST",dataType:"json",data:{payment_method:this.gateway_id},url:this.params.routes.setup_intent,beforeSend:this.ajax_before_send.bind(this)}).done(function(t){t.code?i(t.message):(this.client_secret=t.intent.client_secret,e(t))}.bind(this)).fail(function(t,e,i){this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.BaseGateway.prototype.serialize_form=function(t){var e,i=t.find("input").filter(function(t,e){return!o(e).is('[name^="add-to-cart"]')}.bind(this)).serializeArray(),s={};for(e in i){var a=i[e];s[a.name]=a.value}return s.payment_method=this.gateway_id,s},wc_stripe.BaseGateway.prototype.serialize_fields=function(){return o.extend({},this.fields.toJson(),o(document.body).triggerHandler("wc_stripe_process_checkout_data",[this,this.fields]))},wc_stripe.BaseGateway.prototype.map_shipping_methods=function(t){var e={};return"default"===t||1<(t=t.match(/^([\w+]):(.+)$/)).length&&(e[t[1]]=t[2]),e},wc_stripe.BaseGateway.prototype.maybe_set_ship_to_different=function(){o('[name="ship_to_different_address"]').length&&o('[name="ship_to_different_address"]').prop("checked",this.get_address_field_hash("billing")!==this.get_address_field_hash("shipping")).trigger("change")},wc_stripe.BaseGateway.prototype.update_shipping_address=function(s){return new Promise(function(e,i){o.ajax({url:this.params.routes.shipping_address,method:"POST",dataType:"json",data:{address:this.map_address(s.shippingAddress),payment_method:this.gateway_id,page_id:this.get_page(),currency:this.get_currency()},beforeSend:this.ajax_before_send.bind(this)}).done(function(t){t.code?(s.updateWith(t.data.newData),i(t.data)):(s.updateWith(t.data.newData),this.fields.set("shipping_method",t.data.shipping_method),e(t.data))}.bind(this)).fail(function(){}.bind(this))}.bind(this))},wc_stripe.BaseGateway.prototype.update_shipping_method=function(s){return new Promise(function(e,i){o.ajax({url:this.params.routes.shipping_method,method:"POST",dataType:"json",data:{shipping_method:s.shippingOption.id,payment_method:this.gateway_id,currency:this.get_currency(),page_id:this.get_page()},beforeSend:this.ajax_before_send.bind(this)}).done(function(t){t.code?(s.updateWith(t.data.newData),i(t.data)):(this.set_selected_shipping_methods(t.data.shipping_methods),s.updateWith(t.data.newData),e(t.data))}.bind(this)).fail(function(t,e,i){this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.CheckoutGateway=function(){this.message_container="li.payment_method_"+this.gateway_id,this.banner_container="li.banner_payment_method_"+this.gateway_id,o(document.body).on("update_checkout",this.update_checkout.bind(this)),o(document.body).on("updated_checkout",this.updated_checkout.bind(this)),o(document.body).on("updated_checkout",this.container_styles.bind(this)),o(document.body).on("checkout_error",this.checkout_error.bind(this)),o(this.token_selector).closest("form").on("checkout_place_order_"+this.gateway_id,this.checkout_place_order.bind(this)),o(document.body).on("wc_stripe_new_method_"+this.gateway_id,this.on_show_new_methods.bind(this)),o(document.body).on("wc_stripe_saved_method_"+this.gateway_id,this.on_show_saved_methods.bind(this)),o(document.body).on("wc_stripe_payment_method_selected",this.on_payment_method_selected.bind(this)),this.banner_enabled()&&o(".woocommerce-billing-fields").length&&o(".wc-stripe-banner-checkout").css("max-width",o(".woocommerce-billing-fields").outerWidth(!0)),this.container_styles(),this.hasOrderReviewParams()},wc_stripe.CheckoutGateway.prototype.container_styles=function(){this.params.description||o(this.container).addClass("wc-stripe-no-desc"),o(this.container).find(".wc-stripe-saved-methods").length||o(this.container).find(".payment_box").addClass("wc-stripe-no-methods")},wc_stripe.CheckoutGateway.prototype.hasOrderReviewParams=function(){var t=a.location.search.match(/_stripe_order_review=(.+)/);if(t&&1<t.length)try{var e=JSON.parse(a.atob(decodeURIComponent(t[1])));this.gateway_id===e.payment_method&&(o(function(){this.payment_token_received=!0,this.set_nonce(e.payment_nonce),this.set_use_new_option(!0)}.bind(this)),history.pushState({},"",a.location.pathname))}catch(i){}},wc_stripe.CheckoutGateway.prototype.has3DSecureParams=function(){if((this.is_current_page("order_pay")||this.is_current_page("checkout")||this.is_change_payment_method())&&a.location.hash&&"string"==typeof a.location.hash){var t=a.location.hash.match(/response=(.*)/);if(t)try{var e=JSON.parse(a.atob(decodeURIComponent(t[1])));e&&e.hasOwnProperty("client_secret")&&e.gateway_id===this.gateway_id&&(o(function(){this.set_payment_method(this.gateway_id),this.set_use_new_option(!0),this.set_nonce(e.pm),!0===e.save_method&&this.set_save_payment_method(!0),o('[name="terms"]').prop("checked",!0)}.bind(this)),history.pushState({},"",a.location.pathname+a.location.search),this.handle_next_action(e))}catch(i){}}},wc_stripe.CheckoutGateway.prototype.update_shipping_address=function(){return wc_stripe.BaseGateway.prototype.update_shipping_address.apply(this,arguments).then(function(t){this.populate_address_fields(t.address,this.get_shipping_prefix()),this.fields.toFormFields({update_shipping_method:!1})}.bind(this))},wc_stripe.CheckoutGateway.prototype.updated_checkout=function(){},wc_stripe.CheckoutGateway.prototype.update_checkout=function(){},wc_stripe.CheckoutGateway.prototype.checkout_error=function(){this.has_checkout_error()&&(this.payment_token_received=!1,this.payment_response=null,this.show_payment_button(),this.hide_place_order())},wc_stripe.CheckoutGateway.prototype.is_valid_checkout=function(){return!(o('[name="terms"]').length&&o('[name="terms"]').is(":visible")&&!o('[name="terms"]').is(":checked"))},wc_stripe.CheckoutGateway.prototype.get_payment_method=function(){return o('[name="payment_method"]:checked').val()},wc_stripe.CheckoutGateway.prototype.set_use_new_option=function(t){o("#"+this.gateway_id+"_use_new").prop("checked",t).trigger("change")},wc_stripe.CheckoutGateway.prototype.checkout_place_order=function(){return this.is_valid_checkout()?!!this.is_saved_method_selected()||this.payment_token_received:(this.submit_error(this.params.messages.terms),!1)},wc_stripe.CheckoutGateway.prototype.on_token_received=function(t){this.payment_token_received=!0,this.set_nonce(t.id),this.hide_payment_button(),this.show_place_order()},wc_stripe.CheckoutGateway.prototype.block=function(){o().block&&this.get_form().block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},wc_stripe.CheckoutGateway.prototype.unblock=function(){o().block&&this.get_form().unblock()},wc_stripe.CheckoutGateway.prototype.hide_place_order=function(){o("#place_order").addClass("wc-stripe-hide")},wc_stripe.CheckoutGateway.prototype.show_place_order=function(){o("#place_order").removeClass("wc-stripe-hide")},wc_stripe.CheckoutGateway.prototype.on_show_new_methods=function(){this.payment_token_received?(this.show_place_order(),this.hide_payment_button()):(this.hide_place_order(),this.show_payment_button())},wc_stripe.CheckoutGateway.prototype.on_show_saved_methods=function(){this.hide_payment_button(),this.show_place_order()},wc_stripe.CheckoutGateway.prototype.show_payment_button=function(){this.$button&&this.$button.show()},wc_stripe.CheckoutGateway.prototype.hide_payment_button=function(){this.$button&&this.$button.hide()},wc_stripe.CheckoutGateway.prototype.trigger_payment_method_selected=function(){this.on_payment_method_selected(null,o('[name="payment_method"]:checked').val())},wc_stripe.CheckoutGateway.prototype.show_new_payment_method=function(){o('[name="'+this.gateway_id+'_payment_type_key"][value="new"').trigger("click")},wc_stripe.CheckoutGateway.prototype.on_payment_method_selected=function(t,e){e===this.gateway_id?this.payment_token_received||this.is_saved_method_selected()?(this.hide_payment_button(),this.show_place_order()):(this.show_payment_button(),this.hide_place_order()):(this.hide_payment_button(),e&&e.indexOf("stripe_")<0&&this.show_place_order())},wc_stripe.CheckoutGateway.prototype.banner_enabled=function(){return"1"===this.params.banner_enabled},wc_stripe.CheckoutGateway.prototype.checkout_fields_valid=function(){if(["checkout","order_pay"].indexOf(this.get_page())<0)return!0;var t=!0;return(t=this.fields.validateFields("billing"))?this.needs_shipping()&&o("#ship-to-different-address-checkbox").is(":checked")?(t=this.fields.validateFields("shipping"))||this.submit_error(this.params.messages.required_field):(t=this.is_valid_checkout())||this.submit_error(this.params.messages.terms):this.submit_error(this.params.messages.required_field),t},wc_stripe.CheckoutGateway.prototype.cart_contains_subscription=function(){return"undefined"!=typeof wc_stripe_cart_contains_subscription&&!0===wc_stripe_cart_contains_subscription},wc_stripe.CheckoutGateway.prototype.set_save_payment_method=function(t){o('[name="'+this.gateway_id+'_save_source_key"]').prop("checked",t)},wc_stripe.CheckoutGateway.prototype.process_order_pay=function(){var t=this.get_form().serializeArray();t.push({name:"_wpnonce",value:this.params.rest_nonce}),t.push({name:"order_id",value:this.params.order_id}),t.push({name:"order_key",value:this.params.order_key}),this.block(),o.ajax({url:this.params.routes.order_pay,method:"POST",dataType:"json",data:o.param(t)}).done(function(t){t.success?t.needs_confirmation?t.data?this.handle_next_action(t.data):a.location.href=t.redirect:this.get_form().trigger("submit"):this.submit_error(t.message)}.bind(this)).fail(function(t,e,i){this.unblock(),this.submit_error(i)}.bind(this))},wc_stripe.ProductGateway=function(){this.message_container="div.product",o("form.cart").on("found_variation",this.found_variation.bind(this)),o("form.cart").on("reset_data",this.reset_variation_data.bind(this)),this.buttonWidth=o("form.cart div.quantity").outerWidth(!0)+o(".single_add_to_cart_button").outerWidth();var t=o(".single_add_to_cart_button").css("marginLeft");t&&(this.buttonWidth+=parseInt(t.replace("px",""))),o(this.container).css("max-width",this.buttonWidth+"px")},wc_stripe.ProductGateway.prototype.get_quantity=function(){return parseInt(o('[name="quantity"]').val())},wc_stripe.ProductGateway.prototype.set_rest_nonce=function(t,e){this.params.rest_nonce=e},wc_stripe.ProductGateway.prototype.found_variation=function(t,e){var i=this.get_gateway_data();i.product.price=e.display_price,i.needs_shipping=!e.is_virtual,i.product.variation=e,this.set_gateway_data(i)},wc_stripe.ProductGateway.prototype.reset_variation_data=function(){var t=this.get_product_data();t.variation=!1,this.set_product_data(t),this.disable_payment_button()},wc_stripe.ProductGateway.prototype.disable_payment_button=function(){this.$button&&this.get_button().prop("disabled",!0).addClass("disabled")},wc_stripe.ProductGateway.prototype.enable_payment_button=function(){this.$button&&this.get_button().prop("disabled",!1).removeClass("disabled")},wc_stripe.ProductGateway.prototype.get_button=function(){return this.$button},wc_stripe.ProductGateway.prototype.is_variable_product=function(){return!!this.get_product_data().variation||0<o('[name="variation_id"]').length},wc_stripe.ProductGateway.prototype.variable_product_selected=function(){var t=this.get_product_data().variation,e=o('input[name="variation_id"]').val();return!!t||!!e&&"0"!=e},wc_stripe.ProductGateway.prototype.get_product_data=function(){return this.get_gateway_data().product},wc_stripe.ProductGateway.prototype.set_product_data=function(t){var e=this.get_gateway_data();e.product=t,this.set_gateway_data(e)},wc_stripe.ProductGateway.prototype.get_form=function(){return o(this.container).closest("form")},wc_stripe.ProductGateway.prototype.add_to_cart=function(){return new Promise(function(e,i){this.block();var t={product_id:this.get_product_data().id,variation_id:this.is_variable_product()?o('[name="variation_id"]').val():0,qty:o('[name="quantity"]').val(),payment_method:this.gateway_id,currency:this.get_currency(),page_id:this.get_page()},s=this.get_form().find(':not([name="add-to-cart"],[name="quantity"],[name^="attribute_"],[name="variation_id"])').serializeArray();if(s)for(var a in s)t[s[a].name]=s[a].value;o.ajax({url:this.params.routes.add_to_cart,method:"POST",dataType:"json",data:o.extend({},t,this.get_product_variations()),beforeSend:this.ajax_before_send.bind(this)}).done(function(t){this.unblock(),t.code?(this.submit_error(t.message),i(t)):(this.set_total_price(t.data.total),this.set_total_price_cents(t.data.totalCents),this.set_display_items(t.data.displayItems),e(t.data))}.bind(this)).fail(function(t,e,i){this.unblock(),this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.ProductGateway.prototype.cart_calculation=function(t){return new Promise(function(e,i){this.processing_calculation=!0,o.ajax({url:this.params.routes.cart_calculation,method:"POST",dataType:"json",data:o.extend({},{product_id:this.get_product_data().id,variation_id:this.is_variable_product()&&t?t:0,qty:o('[name="quantity"]').val(),currency:this.get_currency(),payment_method:this.gateway_id},this.get_product_variations()),beforeSend:this.ajax_before_send.bind(this)}).done(function(t){this.processing_calculation=!1,t.code?(this.cart_calculation_error=!0,i(t)):(this.set_total_price(t.data.total),this.set_total_price_cents(t.data.totalCents),this.set_display_items(t.data.displayItems),e(t.data))}.bind(this)).fail(function(){this.processing_calculation=!1}.bind(this))}.bind(this))},wc_stripe.ProductGateway.prototype.get_product_variations=function(){var s={};return this.is_variable_product()&&o('.variations [name^="attribute_"]').each(function(t,e){var i=o(e),e=i.data("attribute_name")||i.attr("name");s[e]=i.val()}),s},wc_stripe.CartGateway=function(){this.message_container="div.woocommerce",o(document.body).on("updated_wc_div",this.updated_html.bind(this)),o(document.body).on("updated_cart_totals",this.updated_html.bind(this)),o(document.body).on("wc_cart_emptied",this.cart_emptied.bind(this))},wc_stripe.CartGateway.prototype.submit_error=function(t){this.submit_message(this.get_error_message(t))},wc_stripe.CartGateway.prototype.updated_html=function(t){},wc_stripe.CartGateway.prototype.cart_emptied=function(t){},wc_stripe.CartGateway.prototype.add_cart_totals_class=function(){o(".cart_totals").addClass("stripe_cart_gateway_active")},wc_stripe.GooglePay=function(){},wc_stripe.GooglePay.prototype.handleActionMethod="handleCardAction",wc_stripe.GooglePay.prototype.setupActionMethod="confirmCardSetup";var s={apiVersion:2,apiVersionMinor:0},n={type:"CARD",parameters:{allowedAuthMethods:["PAN_ONLY"],allowedCardNetworks:["AMEX","DISCOVER","INTERAC","JCB","MASTERCARD","VISA"],assuranceDetailsRequired:!0}};wc_stripe.GooglePay.prototype.update_addresses=function(t){var e;t.paymentMethodData.info.billingAddress&&(e=t.paymentMethodData.info.billingAddress,this.is_current_page("checkout")&&this.is_valid_address(this.billing_address_object,"billing",["phone","email"])&&(e={phoneNumber:e.phoneNumber}),this.populate_billing_fields(e),e.phoneNumber&&this.fields.exists("shipping_phone")&&this.fields.isEmpty("shipping_phone")&&this.fields.set("shipping_phone",e.phoneNumber)),t.shippingAddress&&this.populate_shipping_fields(t.shippingAddress),t.email&&this.fields.set("email",t.email,"billing")},wc_stripe.GooglePay.prototype.map_address=function(t){return{city:t.locality,postcode:t.postalCode,state:t.administrativeArea,country:t.countryCode}},wc_stripe.GooglePay.prototype.update_payment_data=function(s){return new Promise(function(e,i){var t="default"==s.shippingOptionData.id?null:s.shippingOptionData.id;o.when(o.ajax({url:this.params.routes.payment_data,dataType:"json",method:"POST",data:{address:this.map_address(s.shippingAddress),shipping_method:t,page_id:this.get_page(),currency:this.get_currency()},beforeSend:this.ajax_before_send.bind(this)})).done(function(t){t.code?i(t.data.data):e(t.data)}.bind(this)).fail(function(){i()}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.on_payment_data_changed=function(i){return new Promise(function(e){this.update_payment_data(i).then(function(t){e(t.paymentRequestUpdate),this.set_selected_shipping_methods(t.shipping_methods),this.payment_data_updated(t,i)}.bind(this))["catch"](function(t){e(t)}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.payment_data_updated=function(t){},wc_stripe.GooglePay.prototype.get_merchant_info=function(){var t={merchantId:this.params.merchant_id,merchantName:this.params.merchant_name};return"TEST"===this.params.environment&&delete t.merchantId,t},wc_stripe.GooglePay.prototype.get_payment_options=function(){var t,e={environment:this.params.environment,merchantInfo:this.get_merchant_info(),paymentDataCallbacks:{onPaymentAuthorized:function(){return new Promise(function(t){t({transactionState:"SUCCESS"})}.bind(this))}}};return this.needs_shipping()&&(t=this.get_shipping_prefix(),(!this.is_current_page("checkout")||this.is_valid_address(this.get_address_object(t),t,["email","phone"]))&&this.is_current_page("checkout")||(e.paymentDataCallbacks.onPaymentDataChanged=this.on_payment_data_changed.bind(this))),e},wc_stripe.GooglePay.prototype.build_payment_request=function(){var t=o.extend({},s,{emailRequired:this.fields.requestFieldInWallet("billing_email"),merchantInfo:this.get_merchant_info(),allowedPaymentMethods:[o.extend({type:"CARD",tokenizationSpecification:{type:"PAYMENT_GATEWAY",parameters:{gateway:"stripe","stripe:version":"2018-10-31","stripe:publishableKey":this.params.api_key}}},n)],shippingAddressRequired:function(){if(this.needs_shipping()){var t=this.get_shipping_prefix();if(this.is_current_page("checkout")&&!this.is_valid_address(this.get_address_object(t),t,["email","phone"])||!this.is_current_page("checkout"))return!0}return!1}.bind(this)(),transactionInfo:{countryCode:this.params.processing_country,currencyCode:this.get_currency(),totalPriceStatus:"ESTIMATED",totalPrice:this.get_total_price().toString(),displayItems:this.get_display_items(),totalPriceLabel:this.params.total_price_label}});return t.allowedPaymentMethods[0].parameters.billingAddressRequired=function(){if(this.is_current_page("checkout")){var t=this.billing_address_object=this.get_address_object("billing");return this.fields.requestFieldInWallet("billing_phone")||!this.is_valid_address(t,"billing",["email"])?!0:!1}return!0}.bind(this)(),t.allowedPaymentMethods[0].parameters.billingAddressRequired&&(t.allowedPaymentMethods[0].parameters.billingAddressParameters={format:"FULL",phoneNumberRequired:this.fields.requestFieldInWallet("billing_phone")}),t.shippingAddressRequired?(t.shippingAddressParameters={},t.shippingOptionRequired=!0,t.shippingOptionParameters={shippingOptions:this.get_shipping_options()},t.callbackIntents=["SHIPPING_ADDRESS","SHIPPING_OPTION","PAYMENT_AUTHORIZATION"]):t.callbackIntents=["PAYMENT_AUTHORIZATION"],this.payment_request_options=t},wc_stripe.GooglePay.prototype.createPaymentsClient=function(){this.paymentsClient=new google.payments.api.PaymentsClient(this.get_payment_options())},wc_stripe.GooglePay.prototype.isReadyToPay=function(){return new Promise(function(t){var e=o.extend({},s);e.allowedPaymentMethods=[n],this.paymentsClient.isReadyToPay(e).then(function(){this.can_pay=!0,this.create_button(),t()}.bind(this))["catch"](function(t){t&&t.message&&-1<t.message.indexOf("ShadowRoot")?console.log("GPay is not supported on this browser."):this.submit_error(t)}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.create_button=function(){this.$button&&this.$button.remove(),this.$button=o(this.paymentsClient.createButton(this.get_button_options())),this.$button.addClass("gpay-button-container")},wc_stripe.GooglePay.prototype.get_button_options=function(){var t={onClick:this.start.bind(this),buttonColor:this.params.button_color,buttonType:this.params.button_style,buttonSizeMode:this.params.button_size_mode};return null!==this.params.button_locale&&(t.buttonLocale=this.params.button_locale),t},wc_stripe.GooglePay.prototype.start=function(){this.createPaymentsClient(),this.paymentsClient.loadPaymentData(this.build_payment_request()).then(function(t){var e=JSON.parse(t.paymentMethodData.tokenizationData.token);this.update_addresses(t),this.stripe.createPaymentMethod({type:"card",card:{token:e.id},billing_details:this.get_billing_details()}).then(function(t){if(t.error)return this.submit_error(t.error);this.on_token_received(t.paymentMethod)}.bind(this))}.bind(this))["catch"](function(t){"CANCELED"!==t.statusCode&&(t.statusMessage&&-1<t.statusMessage.indexOf("paymentDataRequest.callbackIntent")?this.submit_error_code("DEVELOPER_ERROR_WHITELIST"):this.submit_error(t.statusMessage))}.bind(this))},wc_stripe.ApplePay=function(){},wc_stripe.ApplePay.prototype.handleActionMethod="handleCardAction",wc_stripe.ApplePay.prototype.setupActionMethod="confirmCardSetup",wc_stripe.ApplePay.prototype.initialize=function(){this.createPaymentRequest(),this.canMakePayment()},wc_stripe.ApplePay.prototype.get_payment_request_options=function(){return o.extend({},wc_stripe.BaseGateway.prototype.get_payment_request_options.apply(this,arguments),{disableWallets:["googlePay"]})},wc_stripe.ApplePay.prototype.create_button=function(){this.$button&&this.$button.remove(),this.$button=o(this.params.button),this.$button.on("click",this.start.bind(this)),this.append_button()},wc_stripe.ApplePay.prototype.canMakePayment=function(){return new Promise(function(e){this.paymentRequest.canMakePayment().then(function(t){t&&t.applePay&&(this.can_pay=!0,this.create_button(),o(this.container).show(),e(t))}.bind(this))}.bind(this))},wc_stripe.ApplePay.prototype.start=function(t){t.preventDefault(),this.paymentRequest.update(this.get_payment_request_update({total:{pending:!1}})),this.paymentRequest.show()},wc_stripe.PaymentRequest=function(){},wc_stripe.PaymentRequest.prototype.handleActionMethod="handleCardAction",wc_stripe.PaymentRequest.prototype.setupActionMethod="confirmCardSetup",wc_stripe.PaymentRequest.prototype.initialize=function(){this.createPaymentRequest(),this.createPaymentRequestButton(),this.canMakePayment(),this.paymentRequestButton.on("click",this.button_click.bind(this))},wc_stripe.PaymentRequest.prototype.button_click=function(t){},wc_stripe.PaymentRequest.prototype.createPaymentRequestButton=function(){this.paymentRequestButton&&this.paymentRequestButton.destroy(),this.paymentRequestButton=this.elements.create("paymentRequestButton",{paymentRequest:this.paymentRequest,style:{paymentRequestButton:{type:this.params.button.type,theme:this.params.button.theme,height:this.params.button.height}}})},wc_stripe.PaymentRequest.prototype.canMakePayment=function(){return new Promise(function(e){var i=this.paymentRequest;this.paymentRequest.canMakePayment().then(function(t){t&&!t.applePay&&i===this.paymentRequest&&(this.can_pay=!0,this.create_button(),o(this.container).show(),e(t))}.bind(this))}.bind(this))},wc_stripe.PaymentRequest.prototype.create_button=function(){this.paymentRequestButton.mount("#wc-stripe-payment-request-container")},wc_stripe.Afterpay=function(){},wc_stripe.Afterpay.prototype.is_eligible=function(t){return t>=this.get_min()&&t<=this.get_max()},wc_stripe.Afterpay.prototype.get_min=function(){var t=this.get_currency(),t=this.params.requirements[t];return t?t[1]:0},wc_stripe.Afterpay.prototype.get_max=function(){var t=this.get_currency(),t=this.params.requirements[t];return t?t[2]:0},wc_stripe.Afterpay.prototype.add_eligibility=function(t,e){o(t).length&&(this.is_eligible(e)?o(t).removeClass("afterpay-ineligible"):this.hide_ineligible_active()&&o(t).addClass("afterpay-ineligible"))},wc_stripe.Afterpay.prototype.hide_ineligible_active=function(){return"yes"===this.params.hide_ineligible},wc_stripe.CheckoutFields=function(t,e){this.params=t,this.page=e,this.session_values=this.supportsSessionStorage()&&sessionStorage.getItem("wc_stripe_checkout_fields")?JSON.parse(sessionStorage.getItem("wc_stripe_checkout_fields")):{},this.fields=new Map(Object.keys(this.params).map(function(t){return null===this.params[t].value&&(t in this.session_values&&null!==this.session_values[t]?this.params[t].value=this.session_values[t]:this.params[t].value=""),[t,this.params[t].value]}.bind(this))),("checkout"===e||"cart"===e&&o(document.body).is(".woocommerce-checkout")||0<o("form.woocommerce-checkout").length)&&(o(document.body).on("updated_checkout",this.updated_checkout.bind(this)),o(document.body).on("change",'[name^="billing_"], [name^="shipping_"]',this.onChange.bind(this)),o("form.checkout").on("change",'.input-text:not([name^="billing_"], [name^="shipping_"], [name="account_password"]), select:not([name^="billing_"], [name^="shipping_"])',this.onChange.bind(this)),o("form.checkout").on("change",'[name="ship_to_different_address"]',this.on_ship_to_address_change.bind(this)),this.init_i18n(),o('[name="ship_to_different_address"]').is(":checked")?this.update_required_fields(o("#shipping_country").val(),"shipping_country"):this.update_required_fields(o("#billing_country").val(),"billing_country"))},wc_stripe.CheckoutFields.prototype.supportsSessionStorage=function(){return"sessionStorage"in a&&null!==a.sessionStorage&&["getItem","setItem"].reduce(function(t,e){return t&&e in sessionStorage}.bind(this),!0)},wc_stripe.CheckoutFields.prototype.init_i18n=function(){"undefined"!=typeof wc_address_i18n_params?this.locales=JSON.parse(wc_address_i18n_params.locale.replace(/&quot;/g,'"')):this.locales=null},wc_stripe.CheckoutFields.prototype.updated_checkout=function(){this.syncCheckoutFieldsWithDOM()},wc_stripe.CheckoutFields.prototype.syncCheckoutFieldsWithDOM=function(){for(var t in this.params)o("#"+t).length&&this.fields.set(t,o("#"+t).val())},wc_stripe.CheckoutFields.prototype.onChange=function(t){try{var e=t.currentTarget.name,i=t.currentTarget.value;this.fields.set(e,i),"billing_country"!==e&&"shipping_country"!==e||this.update_required_fields(i,e),this.supportsSessionStorage()&&sessionStorage.setItem("wc_stripe_checkout_fields",JSON.stringify(this.toJson()))}catch(s){console.log(s)}},wc_stripe.CheckoutFields.prototype.update_required_fields=function(t,e){if(this.locales){var i,s=-1<e.indexOf("billing_")?"billing_":"shipping_",t="undefined"!=typeof this.locales[t]?this.locales[t]:this.locales["default"],a=o.extend(!0,{},this.locales["default"],t);for(i in a){var n=s+i;this.params[n]&&(this.params[n]=o.extend(!0,{},this.params[n],a[i]))}}},wc_stripe.CheckoutFields.prototype.on_ship_to_address_change=function(t){o(t.currentTarget).is(":checked")&&this.update_required_fields(o("#shipping_country").val(),"shipping_country")},wc_stripe.CheckoutFields.prototype.requestFieldInWallet=function(t){return"checkout"===this.page?this.required(t)&&this.isEmpty(t):"order_pay"!==this.page&&this.required(t)},wc_stripe.CheckoutFields.prototype.set=function(t,e,i){this[t]&&"function"==typeof this[t]?this[t]().set.call(this,e,i):this.fields.set(t,e)},wc_stripe.CheckoutFields.prototype.get=function(t,e){var i;return this[t]&&"function"==typeof this[t]?i=this[t]().get.call(this,e):null!=(i=this.fields.get(t))&&""!==i||void 0!==e&&(i=e),void 0===i?"":i},wc_stripe.CheckoutFields.prototype.required=function(t){return!(!this.params[t]||"undefined"==typeof this.params[t].required)&&this.params[t].required},wc_stripe.CheckoutFields.prototype.exists=function(t){return t in this.params},wc_stripe.CheckoutFields.prototype.isEmpty=function(t){if(this.fields.has(t)){t=this.fields.get(t);return null==t||"string"==typeof t&&0===t.trim().length}return!0},wc_stripe.CheckoutFields.prototype.isValid=function(t){if(this[t]&&"function"==typeof this[t])return this[t]().isValid.apply(this,Array.prototype.slice.call(arguments,1))},wc_stripe.CheckoutFields.prototype.first_name=function(){return{set:function(t,e){this.fields.set(e+"_first_name",t)},get:function(t){return this.fields.get(t+"_first_name")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.last_name=function(){return{set:function(t,e){this.fields.set(e+"_last_name",t)},get:function(t){return this.fields.get(t+"_last_name")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.address_1=function(){return{set:function(t,e){this.fields.set(e+"_address_1",t)},get:function(t){return this.fields.get(t+"_address_1")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.address_2=function(){return{set:function(t,e){this.fields.set(e+"_address_2",t)},get:function(t){return this.fields.get(t+"_address_2")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.name=function(){return{set:function(t,e){this.fields.set(e+"_full_name",t);var i=t.split(" ");1<i.length?(t=i.pop(),this.fields.set(e+"_first_name",i.join(" ")),this.fields.set(e+"_last_name",t)):1==i.length&&this.fields.set(e+"_first_name",i[0])},get:function(t){return this.fields.get(t+"_first_name")+" "+this.fields.get(t+"_last_name")}}},wc_stripe.CheckoutFields.prototype.email=function(){return{set:function(t,e){this.fields.set(e+"_email",t)},get:function(t){return this.fields.get(t+"_email")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.phone=function(){return{set:function(t,e){this.fields.set(e+"_phone",t)},get:function(t){return this.fields.get(t+"_phone")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.country=function(){return{set:function(t,e){this.fields.set(e+"_country",t)},get:function(t){return this.fields.get(t+"_country")},isValid:function(t){return"string"==typeof t&&2===t.length}}},wc_stripe.CheckoutFields.prototype.state=function(){return{set:function(i,t){2<(i=i.toUpperCase()).length&&"checkout"===this.page&&o("#"+t+"_state option").each(function(){var t=o(this),e=t.text().toUpperCase();i===e&&(i=t.val())}),this.fields.set(t+"_state",i)},get:function(t){return this.fields.get(t+"_state")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.city=function(){return{set:function(t,e){this.fields.set(e+"_city",t)},get:function(t){return this.fields.get(t+"_city")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.postcode=function(){return{set:function(t,e){this.fields.set(e+"_postcode",t)},get:function(t){return this.fields.get(t+"_postcode")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.recipient=function(){return wc_stripe.CheckoutFields.prototype.name.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.payerName=function(){return wc_stripe.CheckoutFields.prototype.name.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.payerEmail=function(){return wc_stripe.CheckoutFields.prototype.email.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.payerPhone=function(){return wc_stripe.CheckoutFields.prototype.phone.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.phoneNumber=function(){return wc_stripe.CheckoutFields.prototype.phone.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.countryCode=function(){return wc_stripe.CheckoutFields.prototype.country.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.address1=function(){return wc_stripe.CheckoutFields.prototype.address_1.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.address2=function(){return wc_stripe.CheckoutFields.prototype.address_2.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.line1=function(){return wc_stripe.CheckoutFields.prototype.address_1.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.line2=function(){return wc_stripe.CheckoutFields.prototype.address_2.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.addressLine=function(){return{set:function(t,e){0<t.length&&this.fields.set(e+"_address_1",t[0]),1<t.length&&this.fields.set(e+"_address_2",t[1])},get:function(t){return[this.fields.get(t+"_address_1"),this.fields.get(t+"_address_2")]},isValid:function(t){return 0<t.length&&("string"==typeof t[0]&&0<t[0].length)}}},wc_stripe.CheckoutFields.prototype.region=function(){return wc_stripe.CheckoutFields.prototype.state.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.administrativeArea=function(){return wc_stripe.CheckoutFields.prototype.state.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.locality=function(){return wc_stripe.CheckoutFields.prototype.city.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.postal_code=function(){return wc_stripe.CheckoutFields.prototype.postcode.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.postalCode=function(){return wc_stripe.CheckoutFields.prototype.postcode.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.toJson=function(){var i={};return this.fields.forEach(function(t,e){i[e]=t}),i},wc_stripe.CheckoutFields.prototype.toFormFields=function(t){var i=[];this.fields.forEach(function(t,e){e='[name="'+e+'"]';o(e).length&&""!==t&&(o(e).val()!==t&&o(e).is("select")&&i.push(e),o(e).val(t))}),0<i.length&&o(i.join(",")).trigger("change"),void 0!==t&&o(document.body).trigger("update_checkout",t)},wc_stripe.CheckoutFields.prototype.validateFields=function(t){for(var e in this.params){var i=this.params[e];if(-1<e.indexOf(t)&&i.required&&o("#"+e).length&&o("#"+e).is(":visible")){i=o("#"+e).val();if(null==i||0===i.length)return!1}}return!0};try{i=Stripe(wc_stripe_params_v3.api_key,wc_stripe_params_v3.stripeParams)}catch(t){return a.alert(t),console.log(t)}var r=new wc_stripe.CheckoutFields(wc_stripe_checkout_fields,wc_stripe_params_v3.page)}(window,jQuery);
1
+ !function(a,o){a.wc_stripe={};var i=null;"undefined"==typeof wc_stripe_checkout_fields&&(a.wc_stripe_checkout_fields=[]),wc_stripe.BaseGateway=function(t,e){this.params=t,this.gateway_id=this.params.gateway_id,this.container=void 0===e?"li.payment_method_".concat(this.gateway_id):e,o(this.container).length||(this.container=".payment_method_".concat(this.gateway_id)),this.token_selector=this.params.token_selector,this.saved_method_selector=this.params.saved_method_selector,this.payment_token_received=!1,this.stripe=i,this.fields=r,this.elements=this.create_stripe_elements(),this.initialize()},wc_stripe.BaseGateway.prototype.create_stripe_elements=function(){return i.elements(o.extend({},{locale:"auto"},this.get_element_options()))},wc_stripe.BaseGateway.prototype.is_user_logged_in=function(){return 0<this.params.user_id},wc_stripe.BaseGateway.prototype.get_page=function(){var t=wc_stripe_params_v3.page;return"cart"===t&&o(document.body).is(".woocommerce-checkout")&&(t="checkout"),t},wc_stripe.BaseGateway.prototype.set_nonce=function(t){this.fields.set(this.gateway_id+"_token_key",t),o(this.token_selector).val(t)},wc_stripe.BaseGateway.prototype.set_intent=function(t){this.fields.set(this.gateway_id+"_payment_intent_key",t),o("#"+this.gateway_id+"_payment_intent_key").val(t)},wc_stripe.BaseGateway.prototype.get_element_options=function(){return this.params.elementOptions},wc_stripe.BaseGateway.prototype.initialize=function(){},wc_stripe.BaseGateway.prototype.create_button=function(){},wc_stripe.BaseGateway.prototype.is_gateway_selected=function(){return o('[name="payment_method"]:checked').val()===this.gateway_id},wc_stripe.BaseGateway.prototype.is_saved_method_selected=function(){return this.is_gateway_selected()&&"saved"===o('[name="'+this.gateway_id+'_payment_type_key"]:checked').val()},wc_stripe.BaseGateway.prototype.has_checkout_error=function(){return 0<o("#wc_stripe_checkout_error").length&&this.is_gateway_selected()},wc_stripe.BaseGateway.prototype.submit_error=function(t,e){var i=this.get_error_message(t);i.indexOf("</ul>")<0&&(i='<div class="'+function(){var t="woocommerce-NoticeGroup";return this.is_current_page("checkout")&&(t+=" woocommerce-NoticeGroup-checkout"),t}.bind(this)()+'"><ul class="woocommerce-error"><li>'+i+"</li></ul></div>");t=o(document.body).triggerHandler("wc_stripe_submit_error",[i,t,this]);i=void 0===t?i:t,this.submit_message(i,e)},wc_stripe.BaseGateway.prototype.submit_error_code=function(t){console.log(t)},wc_stripe.BaseGateway.prototype.get_error_message=function(t){return"object"==typeof t&&(t.hasOwnProperty("message")&&(-1<t.message.indexOf("server_side_confirmation_beta=v1")?t.code="server_side_confirmation_beta":-1<t.message.indexOf("params.payment_method_data.billing_details.phone")&&(t.code="phone_required")),t=t.code&&wc_stripe_messages[t.code]?wc_stripe_messages[t.code]:t.message),t},wc_stripe.BaseGateway.prototype.submit_message=function(t,e){o(".woocommerce-NoticeGroup-checkout, .woocommerce-error, .woocommerce-message").remove();var i=o(this.message_container);i.length&&(e||!i.closest("form").length)||(i.length||(i=o(this.container)),i=i.closest("form")),i.prepend(t),i.removeClass("processing"),o().unblock&&i.unblock(),i.find(".input-text, select, input:checkbox").trigger("blur"),o.scroll_to_notices?o.scroll_to_notices(i):o("html, body").animate({scrollTop:i.offset().top-100},1e3)},wc_stripe.BaseGateway.prototype.get_billing_details=function(){var t=this.get_billing_prefix(),t={name:this.get_customer_name(t),address:{city:this.fields.get(t+"_city",null),country:this.fields.get(t+"_country",null),line1:this.fields.get(t+"_address_1",null),line2:this.fields.get(t+"_address_2",null),postal_code:this.fields.get(t+"_postcode",null),state:this.fields.get(t+"_state",null)}};return t.name&&" "!==t.name||delete t.name,""!=this.fields.get("billing_email")&&(t.email=this.fields.get("billing_email")),""!=this.fields.get("billing_phone")&&(t.phone=this.fields.get("billing_phone")),t},wc_stripe.BaseGateway.prototype.get_first_name=function(t){return o("#"+t+"_first_name").val()},wc_stripe.BaseGateway.prototype.get_last_name=function(t){return o("#"+t+"_last_name").val()},wc_stripe.BaseGateway.prototype.get_shipping_prefix=function(){return this.needs_shipping()&&0<o('[name="ship_to_different_address"]').length&&o('[name="ship_to_different_address"]').is(":checked")?"shipping":"billing"},wc_stripe.BaseGateway.prototype.get_billing_prefix=function(){var t="billing";o('[name="billing_same_as_shipping"]').length&&o('[name="billing_same_as_shipping"]').is(":checked")&&(t="shipping"),o('[name="bill_to_different_address"]').length&&(1<o('[name="bill_to_different_address"]').length?"same_as_shipping"===o('[name="bill_to_different_address"]:checked').val()&&(t="shipping"):o('[name="bill_to_different_address"]').is(":checked")||(t="shipping"));var e=o(document.body).triggerHandler("wc_stripe_get_billing_prefix",[t]);return void 0===e?t:e},wc_stripe.BaseGateway.prototype.should_save_method=function(){return o("#"+this.gateway_id+"_save_source_key").is(":checked")},wc_stripe.BaseGateway.prototype.is_add_payment_method_page=function(){return"add_payment_method"===this.get_page()||o(document.body).hasClass("woocommerce-add-payment-method")},wc_stripe.BaseGateway.prototype.is_change_payment_method=function(){return"change_payment_method"===this.get_page()},wc_stripe.BaseGateway.prototype.get_selected_payment_method=function(){return o(this.saved_method_selector).val()},wc_stripe.BaseGateway.prototype.needs_shipping=function(){return this.get_gateway_data().needs_shipping},wc_stripe.BaseGateway.prototype.get_currency=function(){return this.get_gateway_data().currency},wc_stripe.BaseGateway.prototype.get_gateway_data=function(){var t=o(this.container).find(".woocommerce_".concat(this.gateway_id,"_gateway_data")).data("gateway");return void 0===t&&this.is_current_page("checkout")&&void 0===(t=o("form.checkout").find(".woocommerce_".concat(this.gateway_id,"_gateway_data")).data("gateway"))&&(t=o(".woocommerce_"+this.gateway_id+"_gateway_data").data("gateway")),t},wc_stripe.BaseGateway.prototype.set_gateway_data=function(t){o(this.container).find(".woocommerce_".concat(this.gateway_id,"_gateway_data")).data("gateway",t)},wc_stripe.BaseGateway.prototype.has_gateway_data=function(){return void 0!==this.get_gateway_data()},wc_stripe.BaseGateway.prototype.get_customer_name=function(t){return this.fields.get(t+"_first_name")+" "+this.fields.get(t+"_last_name")},wc_stripe.BaseGateway.prototype.get_customer_email=function(){return this.fields.get("billing_email")},wc_stripe.BaseGateway.prototype.get_address_field_hash=function(t){for(var e=["_first_name","_last_name","_address_1","_address_2","_postcode","_city","_state","_country"],i="",s=0;s<e.length;s++)i+=this.fields.get(t+e[s])+"_";return i},wc_stripe.BaseGateway.prototype.block=function(){o().block&&o.blockUI({message:null,overlayCSS:{background:"#fff",opacity:.6}})},wc_stripe.BaseGateway.prototype.unblock=function(){o().block&&o.unblockUI()},wc_stripe.BaseGateway.prototype.get_form=function(){return o(this.token_selector).closest("form")},wc_stripe.BaseGateway.prototype.get_total_price=function(){return this.get_gateway_data().total},wc_stripe.BaseGateway.prototype.get_total_price_cents=function(){return this.get_gateway_data().total_cents},wc_stripe.BaseGateway.prototype.set_total_price=function(t){var e=this.get_gateway_data();e.total=t,this.set_gateway_data(e)},wc_stripe.BaseGateway.prototype.set_total_price_cents=function(t){var e=this.get_gateway_data();e.total_cents=t,this.set_gateway_data(e)},wc_stripe.BaseGateway.prototype.set_payment_method=function(t){o('[name="payment_method"][value="'+t+'"]').prop("checked",!0).trigger("click")},wc_stripe.BaseGateway.prototype.set_selected_shipping_methods=function(t){if(this.fields.set("shipping_method",t),t&&o('[name^="shipping_method"]').length)for(var e in t){var i=t[e];o('[name="shipping_method['+e+']"][value="'+i+'"]').prop("checked",!0).trigger("change")}},wc_stripe.BaseGateway.prototype.on_token_received=function(t){this.payment_token_received=!0,this.set_nonce(t.id),this.process_checkout()},wc_stripe.BaseGateway.prototype.createPaymentRequest=function(){try{this.payment_request_options=this.get_payment_request_options(),this.paymentRequest=i.paymentRequest(this.payment_request_options),this.payment_request_options.requestShipping&&(this.paymentRequest.on("shippingaddresschange",this.update_shipping_address.bind(this)),this.paymentRequest.on("shippingoptionchange",this.update_shipping_method.bind(this))),this.paymentRequest.on("paymentmethod",this.on_payment_method_received.bind(this))}catch(t){return void this.submit_error(t.message)}},wc_stripe.BaseGateway.prototype.get_payment_request_options=function(){var t={country:this.params.country_code,currency:this.get_currency().toLowerCase(),total:{amount:this.get_total_price_cents(),label:this.params.total_label,pending:!0},requestPayerName:function(){return!this.is_current_page("checkout")||!this.is_valid_address(this.get_address_object("billing"),"billing",["email","phone"])}.bind(this)(),requestPayerEmail:this.fields.requestFieldInWallet("billing_email"),requestPayerPhone:this.fields.requestFieldInWallet("billing_phone"),requestShipping:function(){if(this.needs_shipping()){var t=this.get_shipping_prefix();if(this.is_current_page("checkout")&&!this.is_valid_address(this.get_address_object(t),t,["email","phone"])||!this.is_current_page("checkout"))return!0}return!1}.bind(this)()},e=this.get_display_items(),i=this.get_shipping_options();return e&&(t.displayItems=e),t.requestShipping&&i&&(t.shippingOptions=i),t},wc_stripe.BaseGateway.prototype.get_payment_request_update=function(t){var e={currency:this.get_currency().toLowerCase(),total:{amount:parseInt(this.get_total_price_cents()),label:this.params.total_label,pending:!0}},i=this.get_display_items(),s=this.get_shipping_options();return i&&(e.displayItems=i),this.payment_request_options.requestShipping&&s&&(e.shippingOptions=s),t&&(e=o.extend(!0,{},e,t)),e},wc_stripe.BaseGateway.prototype.get_display_items=function(){return this.get_gateway_data().items},wc_stripe.BaseGateway.prototype.set_display_items=function(t){var e=this.get_gateway_data();e.items=t,this.set_gateway_data(e)},wc_stripe.BaseGateway.prototype.get_shipping_options=function(){return this.get_gateway_data().shipping_options},wc_stripe.BaseGateway.prototype.set_shipping_options=function(t){var e=this.get_gateway_data();e.shipping_options=t,this.set_gateway_data(e)},wc_stripe.BaseGateway.prototype.map_address=function(t){return{city:t.city,postcode:t.postalCode,state:t.region,country:t.country}},wc_stripe.BaseGateway.prototype.on_payment_method_received=function(t){try{this.payment_response=t,this.populate_checkout_fields(t),t.complete("success"),this.on_token_received(t.paymentMethod)}catch(e){a.alert(e)}},wc_stripe.BaseGateway.prototype.populate_checkout_fields=function(t){this.set_nonce(t.paymentMethod.id),this.update_addresses(t)},wc_stripe.BaseGateway.prototype.update_addresses=function(t){t.payerName&&this.fields.set("name",t.payerName,"billing"),t.payerEmail&&this.fields.set("email",t.payerEmail,"billing"),t.payerPhone&&(this.fields.set("phone",t.payerPhone,"billing"),this.fields.exists("shipping_phone")&&this.fields.isEmpty("shipping_phone")&&this.fields.set("shipping_phone",t.payerPhone)),t.shippingAddress&&this.populate_shipping_fields(t.shippingAddress),t.paymentMethod.billing_details.address&&this.populate_billing_fields(t.paymentMethod.billing_details.address)},wc_stripe.BaseGateway.prototype.populate_address_fields=function(t,e){for(var i in t)null!==t[i]&&this.fields.set(i,t[i],e)},wc_stripe.BaseGateway.prototype.populate_billing_fields=function(t){this.populate_address_fields(t,"billing")},wc_stripe.BaseGateway.prototype.populate_shipping_fields=function(t){this.populate_address_fields(t,"shipping")},wc_stripe.BaseGateway.prototype.get_address_fields=function(){return["first_name","last_name","country","address_1","address_2","city","state","postcode","phone","email"]},wc_stripe.BaseGateway.prototype.get_address_object=function(e){var i={};return this.get_address_fields().forEach(function(t){i[t]=this.fields.get(t,e)}.bind(this)),i},wc_stripe.BaseGateway.prototype.is_current_page=function(t){return Array.isArray(t)?-1<t.indexOf(this.get_page()):this.get_page()===t},wc_stripe.BaseGateway.prototype.is_valid_address=function(t,e,i){if(o.isEmptyObject(t))return!1;var s=this.get_address_fields();void 0!==i&&i.forEach(function(t){-1<s.indexOf(t)&&s.splice(s.indexOf(t),1)});for(var a=0;a<s.length;a++){var n=s[a];if(this.fields.required(e+"_"+n)&&(!t[n]||"undefined"==typeof t[n]||!this.fields.isValid(n,t[n],t)))return!1}return!0},wc_stripe.BaseGateway.prototype.ajax_before_send=function(t){this.is_user_logged_in()&&t.setRequestHeader("X-WP-Nonce",this.params.rest_nonce)},wc_stripe.BaseGateway.prototype.process_checkout=function(){return new Promise(function(){this.block(),o.ajax({url:this.params.routes.checkout,method:"POST",dataType:"json",data:o.extend({},this.serialize_fields(),{payment_method:this.gateway_id,page_id:this.get_page(),currency:this.get_currency()}),beforeSend:this.ajax_before_send.bind(this)}).done(function(t){t.reload?a.location.reload():"success"===t.result?a.location=t.redirect:(t.messages&&this.submit_error(t.messages),this.unblock())}.bind(this)).fail(function(t,e,i){this.unblock(),this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.BaseGateway.prototype.process_payment=function(t,e){o.ajax({method:"POST",url:this.params.routes.checkout_payment,dataType:"json",data:o.extend({},this.fields.toJson(),{order_id:t,order_key:e}),beforeSend:this.ajax_before_send.bind(this)}).done(function(t){if(t.result&&"success"===t.result)a.location=t.redirect;else{if(t.reload)return a.location.reload();t.messages?(this.payment_token_received=!1,this.submit_error(t.messages)):this.submit_error(wc_checkout_params.i18n_checkout_error)}}.bind(this)).fail(function(){}.bind(this))},wc_stripe.BaseGateway.prototype.handle_next_action=function(e){try{return this.stripe[this.handleActionMethod](e.client_secret).then(function(t){if(t.error)return this.unblock(),this.payment_token_received=!1,this.submit_error(t.error);this.is_current_page("order_pay")?this.get_form().trigger("submit"):this.process_payment(e.order_id,e.order_key)}.bind(this))["catch"](function(t){this.submit_error(t.message)}.bind(this)),!1}catch(t){}},wc_stripe.BaseGateway.prototype.handle_payment_method_setup=function(e){try{return this.stripe[this.setupActionMethod](e.client_secret).then(function(t){if(t.error)return this.payment_token_received=!1,this.submit_error(t.error);this.is_current_page("order_pay")?this.get_form().trigger("submit"):this.process_payment(e.order_id,e.order_key)}.bind(this))["catch"](function(t){this.submit_error(t.message)}.bind(this)),!1}catch(t){}},wc_stripe.BaseGateway.prototype.hashchange=function(t){var e=a.location.hash.match(/response=(.*)/);if(e)try{var i=JSON.parse(a.atob(decodeURIComponent(e[1])));i&&i.hasOwnProperty("client_secret")&&i.gateway_id===this.gateway_id&&(history.pushState({},"",a.location.pathname),"intent"===i.type?this.handle_next_action(i):this.handle_payment_method_setup(i))}catch(s){}return!0},wc_stripe.BaseGateway.prototype.sync_payment_intent=function(t,s){return new Promise(function(e,i){o.ajax({method:"POST",dataType:"json",url:this.params.routes.sync_intent,data:{order_id:t,client_secret:s},beforeSend:this.ajax_before_send.bind(this)}).done(function(t){(t.code?i:e)(t)}).fail(function(t,e,i){this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.BaseGateway.prototype.create_setup_intent=function(){return new Promise(function(e,i){o.ajax({method:"POST",dataType:"json",data:{payment_method:this.gateway_id},url:this.params.routes.setup_intent,beforeSend:this.ajax_before_send.bind(this)}).done(function(t){t.code?i(t.message):(this.client_secret=t.intent.client_secret,e(t))}.bind(this)).fail(function(t,e,i){this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.BaseGateway.prototype.serialize_form=function(t){var e,i=t.find("input").filter(function(t,e){return!o(e).is('[name^="add-to-cart"]')}.bind(this)).serializeArray(),s={};for(e in i){var a=i[e];s[a.name]=a.value}return s.payment_method=this.gateway_id,s},wc_stripe.BaseGateway.prototype.serialize_fields=function(){return o.extend({},this.fields.toJson(),o(document.body).triggerHandler("wc_stripe_process_checkout_data",[this,this.fields]))},wc_stripe.BaseGateway.prototype.map_shipping_methods=function(t){var e={};return"default"===t||1<(t=t.match(/^([\w+]):(.+)$/)).length&&(e[t[1]]=t[2]),e},wc_stripe.BaseGateway.prototype.maybe_set_ship_to_different=function(){o('[name="ship_to_different_address"]').length&&o('[name="ship_to_different_address"]').prop("checked",this.get_address_field_hash("billing")!==this.get_address_field_hash("shipping")).trigger("change")},wc_stripe.BaseGateway.prototype.update_shipping_address=function(s){return new Promise(function(e,i){o.ajax({url:this.params.routes.shipping_address,method:"POST",dataType:"json",data:{address:this.map_address(s.shippingAddress),payment_method:this.gateway_id,page_id:this.get_page(),currency:this.get_currency()},beforeSend:this.ajax_before_send.bind(this)}).done(function(t){t.code?(s.updateWith(t.data.newData),i(t.data)):(s.updateWith(t.data.newData),this.fields.set("shipping_method",t.data.shipping_method),e(t.data))}.bind(this)).fail(function(){}.bind(this))}.bind(this))},wc_stripe.BaseGateway.prototype.update_shipping_method=function(s){return new Promise(function(e,i){o.ajax({url:this.params.routes.shipping_method,method:"POST",dataType:"json",data:{shipping_method:s.shippingOption.id,payment_method:this.gateway_id,currency:this.get_currency(),page_id:this.get_page()},beforeSend:this.ajax_before_send.bind(this)}).done(function(t){t.code?(s.updateWith(t.data.newData),i(t.data)):(this.set_selected_shipping_methods(t.data.shipping_methods),s.updateWith(t.data.newData),e(t.data))}.bind(this)).fail(function(t,e,i){this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.CheckoutGateway=function(){this.message_container="li.payment_method_"+this.gateway_id,this.banner_container="li.banner_payment_method_"+this.gateway_id,o(document.body).on("update_checkout",this.update_checkout.bind(this)),o(document.body).on("updated_checkout",this.updated_checkout.bind(this)),o(document.body).on("updated_checkout",this.container_styles.bind(this)),o(document.body).on("checkout_error",this.checkout_error.bind(this)),o(this.token_selector).closest("form").on("checkout_place_order_"+this.gateway_id,this.checkout_place_order.bind(this)),o(document.body).on("wc_stripe_new_method_"+this.gateway_id,this.on_show_new_methods.bind(this)),o(document.body).on("wc_stripe_saved_method_"+this.gateway_id,this.on_show_saved_methods.bind(this)),o(document.body).on("wc_stripe_payment_method_selected",this.on_payment_method_selected.bind(this)),this.banner_enabled()&&o(".woocommerce-billing-fields").length&&o(".wc-stripe-banner-checkout").css("max-width",o(".woocommerce-billing-fields").outerWidth(!0)),this.container_styles(),this.hasOrderReviewParams()},wc_stripe.CheckoutGateway.prototype.container_styles=function(){this.params.description||o(this.container).addClass("wc-stripe-no-desc"),o(this.container).find(".wc-stripe-saved-methods").length||o(this.container).find(".payment_box").addClass("wc-stripe-no-methods")},wc_stripe.CheckoutGateway.prototype.hasOrderReviewParams=function(){var t=a.location.search.match(/_stripe_order_review=(.+)/);if(t&&1<t.length)try{var e=JSON.parse(a.atob(decodeURIComponent(t[1])));this.gateway_id===e.payment_method&&(o(function(){this.payment_token_received=!0,this.set_nonce(e.payment_nonce),this.set_use_new_option(!0)}.bind(this)),history.pushState({},"",a.location.pathname))}catch(i){}},wc_stripe.CheckoutGateway.prototype.has3DSecureParams=function(){if((this.is_current_page("order_pay")||this.is_current_page("checkout")||this.is_change_payment_method())&&a.location.hash&&"string"==typeof a.location.hash){var t=a.location.hash.match(/response=(.*)/);if(t)try{var e=JSON.parse(a.atob(decodeURIComponent(t[1])));e&&e.hasOwnProperty("client_secret")&&e.gateway_id===this.gateway_id&&(o(function(){this.set_payment_method(this.gateway_id),this.set_use_new_option(!0),this.set_nonce(e.pm),!0===e.save_method&&this.set_save_payment_method(!0),o('[name="terms"]').prop("checked",!0)}.bind(this)),history.pushState({},"",a.location.pathname+a.location.search),this.handle_next_action(e))}catch(i){}}},wc_stripe.CheckoutGateway.prototype.update_shipping_address=function(){return wc_stripe.BaseGateway.prototype.update_shipping_address.apply(this,arguments).then(function(t){this.populate_address_fields(t.address,this.get_shipping_prefix()),this.fields.toFormFields({update_shipping_method:!1})}.bind(this))},wc_stripe.CheckoutGateway.prototype.updated_checkout=function(){},wc_stripe.CheckoutGateway.prototype.update_checkout=function(){},wc_stripe.CheckoutGateway.prototype.checkout_error=function(){this.has_checkout_error()&&(this.payment_token_received=!1,this.payment_response=null,this.show_payment_button(),this.hide_place_order())},wc_stripe.CheckoutGateway.prototype.is_valid_checkout=function(){return!(o('[name="terms"]').length&&o('[name="terms"]').is(":visible")&&!o('[name="terms"]').is(":checked"))},wc_stripe.CheckoutGateway.prototype.get_payment_method=function(){return o('[name="payment_method"]:checked').val()},wc_stripe.CheckoutGateway.prototype.set_use_new_option=function(t){o("#"+this.gateway_id+"_use_new").prop("checked",t).trigger("change")},wc_stripe.CheckoutGateway.prototype.checkout_place_order=function(){return this.is_valid_checkout()?!!this.is_saved_method_selected()||this.payment_token_received:(this.submit_error(this.params.messages.terms),!1)},wc_stripe.CheckoutGateway.prototype.on_token_received=function(t){this.payment_token_received=!0,this.set_nonce(t.id),this.hide_payment_button(),this.show_place_order()},wc_stripe.CheckoutGateway.prototype.block=function(){o().block&&this.get_form().block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},wc_stripe.CheckoutGateway.prototype.unblock=function(){o().block&&this.get_form().unblock()},wc_stripe.CheckoutGateway.prototype.hide_place_order=function(){o("#place_order").addClass("wc-stripe-hide")},wc_stripe.CheckoutGateway.prototype.show_place_order=function(){o("#place_order").removeClass("wc-stripe-hide")},wc_stripe.CheckoutGateway.prototype.on_show_new_methods=function(){this.payment_token_received?(this.show_place_order(),this.hide_payment_button()):(this.hide_place_order(),this.show_payment_button())},wc_stripe.CheckoutGateway.prototype.on_show_saved_methods=function(){this.hide_payment_button(),this.show_place_order()},wc_stripe.CheckoutGateway.prototype.show_payment_button=function(){this.$button&&this.$button.show()},wc_stripe.CheckoutGateway.prototype.hide_payment_button=function(){this.$button&&this.$button.hide()},wc_stripe.CheckoutGateway.prototype.trigger_payment_method_selected=function(){this.on_payment_method_selected(null,o('[name="payment_method"]:checked').val())},wc_stripe.CheckoutGateway.prototype.show_new_payment_method=function(){o('[name="'+this.gateway_id+'_payment_type_key"][value="new"').trigger("click")},wc_stripe.CheckoutGateway.prototype.on_payment_method_selected=function(t,e){e===this.gateway_id?this.payment_token_received||this.is_saved_method_selected()?(this.hide_payment_button(),this.show_place_order()):(this.show_payment_button(),this.hide_place_order()):(this.hide_payment_button(),e&&e.indexOf("stripe_")<0&&this.show_place_order())},wc_stripe.CheckoutGateway.prototype.banner_enabled=function(){return"1"===this.params.banner_enabled},wc_stripe.CheckoutGateway.prototype.checkout_fields_valid=function(){if(["checkout","order_pay"].indexOf(this.get_page())<0)return!0;var t=!0;return(t=this.fields.validateFields("billing"))?this.needs_shipping()&&o("#ship-to-different-address-checkbox").is(":checked")?(t=this.fields.validateFields("shipping"))||this.submit_error(this.params.messages.required_field):(t=this.is_valid_checkout())||this.submit_error(this.params.messages.terms):this.submit_error(this.params.messages.required_field),t},wc_stripe.CheckoutGateway.prototype.cart_contains_subscription=function(){return"undefined"!=typeof wc_stripe_cart_contains_subscription&&!0===wc_stripe_cart_contains_subscription},wc_stripe.CheckoutGateway.prototype.set_save_payment_method=function(t){o('[name="'+this.gateway_id+'_save_source_key"]').prop("checked",t)},wc_stripe.CheckoutGateway.prototype.process_order_pay=function(){var t=this.get_form().serializeArray();t.push({name:"_wpnonce",value:this.params.rest_nonce}),t.push({name:"order_id",value:this.params.order_id}),t.push({name:"order_key",value:this.params.order_key}),this.block(),o.ajax({url:this.params.routes.order_pay,method:"POST",dataType:"json",data:o.param(t)}).done(function(t){t.success?t.needs_confirmation?t.data?this.handle_next_action(t.data):a.location.href=t.redirect:this.get_form().trigger("submit"):this.submit_error(t.message)}.bind(this)).fail(function(t,e,i){this.unblock(),this.submit_error(i)}.bind(this))},wc_stripe.ProductGateway=function(){this.message_container="div.product",o("form.cart").on("found_variation",this.found_variation.bind(this)),o("form.cart").on("reset_data",this.reset_variation_data.bind(this)),this.buttonWidth=o("form.cart div.quantity").outerWidth(!0)+o(".single_add_to_cart_button").outerWidth();var t=o(".single_add_to_cart_button").css("marginLeft");t&&(this.buttonWidth+=parseInt(t.replace("px",""))),o(this.container).css("max-width",this.buttonWidth+"px")},wc_stripe.ProductGateway.prototype.get_quantity=function(){return parseInt(o('[name="quantity"]').val())},wc_stripe.ProductGateway.prototype.set_rest_nonce=function(t,e){this.params.rest_nonce=e},wc_stripe.ProductGateway.prototype.found_variation=function(t,e){var i=this.get_gateway_data();i.product.price=e.display_price,i.needs_shipping=!e.is_virtual,i.product.variation=e,this.set_gateway_data(i)},wc_stripe.ProductGateway.prototype.reset_variation_data=function(){var t=this.get_product_data();t.variation=!1,this.set_product_data(t),this.disable_payment_button()},wc_stripe.ProductGateway.prototype.disable_payment_button=function(){this.$button&&this.get_button().prop("disabled",!0).addClass("disabled")},wc_stripe.ProductGateway.prototype.enable_payment_button=function(){this.$button&&this.get_button().prop("disabled",!1).removeClass("disabled")},wc_stripe.ProductGateway.prototype.get_button=function(){return this.$button},wc_stripe.ProductGateway.prototype.is_variable_product=function(){return!!this.get_product_data().variation||0<o('[name="variation_id"]').length},wc_stripe.ProductGateway.prototype.variable_product_selected=function(){var t=this.get_product_data().variation,e=o('input[name="variation_id"]').val();return!!t||!!e&&"0"!=e},wc_stripe.ProductGateway.prototype.get_product_data=function(){return this.get_gateway_data().product},wc_stripe.ProductGateway.prototype.set_product_data=function(t){var e=this.get_gateway_data();e.product=t,this.set_gateway_data(e)},wc_stripe.ProductGateway.prototype.get_form=function(){return o(this.container).closest("form")},wc_stripe.ProductGateway.prototype.add_to_cart=function(){return new Promise(function(e,i){this.block();var t={product_id:this.get_product_data().id,variation_id:this.is_variable_product()?o('[name="variation_id"]').val():0,qty:o('[name="quantity"]').val(),payment_method:this.gateway_id,currency:this.get_currency(),page_id:this.get_page()},s=this.get_form().find(':not([name="add-to-cart"],[name="quantity"],[name^="attribute_"],[name="variation_id"])').serializeArray();if(s)for(var a in s)t[s[a].name]=s[a].value;o.ajax({url:this.params.routes.add_to_cart,method:"POST",dataType:"json",data:o.extend({},t,this.get_product_variations()),beforeSend:this.ajax_before_send.bind(this)}).done(function(t){this.unblock(),t.code?(this.submit_error(t.message),i(t)):(this.set_total_price(t.data.total),this.set_total_price_cents(t.data.totalCents),this.set_display_items(t.data.displayItems),e(t.data))}.bind(this)).fail(function(t,e,i){this.unblock(),this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.ProductGateway.prototype.cart_calculation=function(t){return new Promise(function(e,i){this.processing_calculation=!0,o.ajax({url:this.params.routes.cart_calculation,method:"POST",dataType:"json",data:o.extend({},{product_id:this.get_product_data().id,variation_id:this.is_variable_product()&&t?t:0,qty:o('[name="quantity"]').val(),currency:this.get_currency(),payment_method:this.gateway_id},this.get_product_variations()),beforeSend:this.ajax_before_send.bind(this)}).done(function(t){this.processing_calculation=!1,t.code?(this.cart_calculation_error=!0,i(t)):(this.set_total_price(t.data.total),this.set_total_price_cents(t.data.totalCents),this.set_display_items(t.data.displayItems),e(t.data))}.bind(this)).fail(function(){this.processing_calculation=!1}.bind(this))}.bind(this))},wc_stripe.ProductGateway.prototype.get_product_variations=function(){var s={};return this.is_variable_product()&&o('.variations [name^="attribute_"]').each(function(t,e){var i=o(e),e=i.data("attribute_name")||i.attr("name");s[e]=i.val()}),s},wc_stripe.CartGateway=function(){this.message_container="div.woocommerce",o(document.body).on("updated_wc_div",this.updated_html.bind(this)),o(document.body).on("updated_cart_totals",this.updated_html.bind(this)),o(document.body).on("wc_cart_emptied",this.cart_emptied.bind(this))},wc_stripe.CartGateway.prototype.submit_error=function(t){this.submit_message(this.get_error_message(t))},wc_stripe.CartGateway.prototype.updated_html=function(t){},wc_stripe.CartGateway.prototype.cart_emptied=function(t){},wc_stripe.CartGateway.prototype.add_cart_totals_class=function(){o(".cart_totals").addClass("stripe_cart_gateway_active")},wc_stripe.GooglePay=function(){},wc_stripe.GooglePay.prototype.handleActionMethod="handleCardAction",wc_stripe.GooglePay.prototype.setupActionMethod="confirmCardSetup";var s={apiVersion:2,apiVersionMinor:0},n={type:"CARD",parameters:{allowedAuthMethods:["PAN_ONLY"],allowedCardNetworks:["AMEX","DISCOVER","INTERAC","JCB","MASTERCARD","VISA"],assuranceDetailsRequired:!0}};wc_stripe.GooglePay.prototype.update_addresses=function(t){var e;t.paymentMethodData.info.billingAddress&&(e=t.paymentMethodData.info.billingAddress,this.is_current_page("checkout")&&this.is_valid_address(this.billing_address_object,"billing",["phone","email"])&&(e={phoneNumber:e.phoneNumber}),this.populate_billing_fields(e),e.phoneNumber&&this.fields.exists("shipping_phone")&&this.fields.isEmpty("shipping_phone")&&this.fields.set("shipping_phone",e.phoneNumber)),t.shippingAddress&&this.populate_shipping_fields(t.shippingAddress),t.email&&this.fields.set("email",t.email,"billing")},wc_stripe.GooglePay.prototype.map_address=function(t){return{city:t.locality,postcode:t.postalCode,state:t.administrativeArea,country:t.countryCode}},wc_stripe.GooglePay.prototype.update_payment_data=function(s){return new Promise(function(e,i){var t="default"==s.shippingOptionData.id?null:s.shippingOptionData.id;o.when(o.ajax({url:this.params.routes.payment_data,dataType:"json",method:"POST",data:{address:this.map_address(s.shippingAddress),shipping_method:t,page_id:this.get_page(),currency:this.get_currency()},beforeSend:this.ajax_before_send.bind(this)})).done(function(t){t.code?i(t.data.data):e(t.data)}.bind(this)).fail(function(){i()}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.on_payment_data_changed=function(i){return new Promise(function(e){this.update_payment_data(i).then(function(t){e(t.paymentRequestUpdate),this.set_selected_shipping_methods(t.shipping_methods),this.payment_data_updated(t,i)}.bind(this))["catch"](function(t){e(t)}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.payment_data_updated=function(t){},wc_stripe.GooglePay.prototype.get_merchant_info=function(){var t={merchantId:this.params.merchant_id,merchantName:this.params.merchant_name};return"TEST"===this.params.environment&&delete t.merchantId,t},wc_stripe.GooglePay.prototype.get_payment_options=function(){var t,e={environment:this.params.environment,merchantInfo:this.get_merchant_info(),paymentDataCallbacks:{onPaymentAuthorized:function(){return new Promise(function(t){t({transactionState:"SUCCESS"})}.bind(this))}}};return this.needs_shipping()&&(t=this.get_shipping_prefix(),(!this.is_current_page("checkout")||this.is_valid_address(this.get_address_object(t),t,["email","phone"]))&&this.is_current_page("checkout")||(e.paymentDataCallbacks.onPaymentDataChanged=this.on_payment_data_changed.bind(this))),e},wc_stripe.GooglePay.prototype.build_payment_request=function(){var t=o.extend({},s,{emailRequired:this.fields.requestFieldInWallet("billing_email"),merchantInfo:this.get_merchant_info(),allowedPaymentMethods:[o.extend({type:"CARD",tokenizationSpecification:{type:"PAYMENT_GATEWAY",parameters:{gateway:"stripe","stripe:version":"2018-10-31","stripe:publishableKey":this.params.api_key}}},n)],shippingAddressRequired:function(){if(this.needs_shipping()){var t=this.get_shipping_prefix();if(this.is_current_page("checkout")&&!this.is_valid_address(this.get_address_object(t),t,["email","phone"])||!this.is_current_page("checkout"))return!0}return!1}.bind(this)(),transactionInfo:{countryCode:this.params.processing_country,currencyCode:this.get_currency(),totalPriceStatus:"ESTIMATED",totalPrice:this.get_total_price().toString(),displayItems:this.get_display_items(),totalPriceLabel:this.params.total_price_label}});return t.allowedPaymentMethods[0].parameters.billingAddressRequired=function(){if(this.is_current_page("checkout")){var t=this.billing_address_object=this.get_address_object("billing");return this.fields.requestFieldInWallet("billing_phone")||!this.is_valid_address(t,"billing",["email"])?!0:!1}return!0}.bind(this)(),t.allowedPaymentMethods[0].parameters.billingAddressRequired&&(t.allowedPaymentMethods[0].parameters.billingAddressParameters={format:"FULL",phoneNumberRequired:this.fields.requestFieldInWallet("billing_phone")}),t.shippingAddressRequired?(t.shippingAddressParameters={},t.shippingOptionRequired=!0,t.shippingOptionParameters={shippingOptions:this.get_shipping_options()},t.callbackIntents=["SHIPPING_ADDRESS","SHIPPING_OPTION","PAYMENT_AUTHORIZATION"]):t.callbackIntents=["PAYMENT_AUTHORIZATION"],this.payment_request_options=t},wc_stripe.GooglePay.prototype.createPaymentsClient=function(){this.paymentsClient=new google.payments.api.PaymentsClient(this.get_payment_options())},wc_stripe.GooglePay.prototype.isReadyToPay=function(){return new Promise(function(t){var e=o.extend({},s);e.allowedPaymentMethods=[n],this.paymentsClient.isReadyToPay(e).then(function(){this.can_pay=!0,this.create_button(),t()}.bind(this))["catch"](function(t){t&&t.message&&-1<t.message.indexOf("ShadowRoot")?console.log("GPay is not supported on this browser."):this.submit_error(t)}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.create_button=function(){this.$button&&this.$button.remove(),this.$button=o(this.paymentsClient.createButton(this.get_button_options())),this.$button.addClass("gpay-button-container")},wc_stripe.GooglePay.prototype.get_button_options=function(){var t={onClick:this.start.bind(this),buttonColor:this.params.button_color,buttonType:this.params.button_style,buttonSizeMode:this.params.button_size_mode};return null!==this.params.button_locale&&(t.buttonLocale=this.params.button_locale),t},wc_stripe.GooglePay.prototype.start=function(){this.createPaymentsClient(),this.paymentsClient.loadPaymentData(this.build_payment_request()).then(function(t){var e=JSON.parse(t.paymentMethodData.tokenizationData.token);this.update_addresses(t),this.stripe.createPaymentMethod({type:"card",card:{token:e.id},billing_details:this.get_billing_details()}).then(function(t){if(t.error)return this.submit_error(t.error);this.on_token_received(t.paymentMethod)}.bind(this))}.bind(this))["catch"](function(t){"CANCELED"!==t.statusCode&&(t.statusMessage&&-1<t.statusMessage.indexOf("paymentDataRequest.callbackIntent")?this.submit_error_code("DEVELOPER_ERROR_WHITELIST"):this.submit_error(t.statusMessage))}.bind(this))},wc_stripe.ApplePay=function(){},wc_stripe.ApplePay.prototype.handleActionMethod="handleCardAction",wc_stripe.ApplePay.prototype.setupActionMethod="confirmCardSetup",wc_stripe.ApplePay.prototype.initialize=function(){this.createPaymentRequest(),this.canMakePayment()},wc_stripe.ApplePay.prototype.get_payment_request_options=function(){return o.extend({},wc_stripe.BaseGateway.prototype.get_payment_request_options.apply(this,arguments),{disableWallets:["googlePay"]})},wc_stripe.ApplePay.prototype.create_button=function(){this.$button&&this.$button.remove(),this.$button=o(this.params.button),this.$button.on("click",this.start.bind(this)),this.append_button()},wc_stripe.ApplePay.prototype.canMakePayment=function(){return new Promise(function(e){this.paymentRequest.canMakePayment().then(function(t){t&&t.applePay&&(this.can_pay=!0,this.create_button(),o(this.container).show(),e(t))}.bind(this))}.bind(this))},wc_stripe.ApplePay.prototype.start=function(t){t.preventDefault(),this.paymentRequest.update(this.get_payment_request_update({total:{pending:!1}})),this.paymentRequest.show()},wc_stripe.PaymentRequest=function(){},wc_stripe.PaymentRequest.prototype.handleActionMethod="handleCardAction",wc_stripe.PaymentRequest.prototype.setupActionMethod="confirmCardSetup",wc_stripe.PaymentRequest.prototype.initialize=function(){this.createPaymentRequest(),this.createPaymentRequestButton(),this.canMakePayment(),this.paymentRequestButton.on("click",this.button_click.bind(this))},wc_stripe.PaymentRequest.prototype.button_click=function(t){},wc_stripe.PaymentRequest.prototype.createPaymentRequestButton=function(){this.paymentRequestButton&&this.paymentRequestButton.destroy(),this.paymentRequestButton=this.elements.create("paymentRequestButton",{paymentRequest:this.paymentRequest,style:{paymentRequestButton:{type:this.params.button.type,theme:this.params.button.theme,height:this.params.button.height}}})},wc_stripe.PaymentRequest.prototype.canMakePayment=function(){return new Promise(function(e){var i=this.paymentRequest;this.paymentRequest.canMakePayment().then(function(t){!t||t.applePay||t.link||i!==this.paymentRequest||(this.can_pay=!0,this.create_button(),o(this.container).show(),e(t))}.bind(this))}.bind(this))},wc_stripe.PaymentRequest.prototype.create_button=function(){this.paymentRequestButton.mount("#wc-stripe-payment-request-container")},wc_stripe.Afterpay=function(){},wc_stripe.Afterpay.prototype.is_eligible=function(t){return t>=this.get_min()&&t<=this.get_max()},wc_stripe.Afterpay.prototype.get_min=function(){var t=this.get_currency(),t=this.params.requirements[t];return t?t[1]:0},wc_stripe.Afterpay.prototype.get_max=function(){var t=this.get_currency(),t=this.params.requirements[t];return t?t[2]:0},wc_stripe.Afterpay.prototype.add_eligibility=function(t,e){o(t).length&&(this.is_eligible(e)?o(t).removeClass("afterpay-ineligible"):this.hide_ineligible_active()&&o(t).addClass("afterpay-ineligible"))},wc_stripe.Afterpay.prototype.hide_ineligible_active=function(){return"yes"===this.params.hide_ineligible},wc_stripe.CheckoutFields=function(t,e){this.params=t,this.page=e,this.session_values=this.supportsSessionStorage()&&sessionStorage.getItem("wc_stripe_checkout_fields")?JSON.parse(sessionStorage.getItem("wc_stripe_checkout_fields")):{},this.fields=new Map(Object.keys(this.params).map(function(t){return null===this.params[t].value&&(t in this.session_values&&null!==this.session_values[t]?this.params[t].value=this.session_values[t]:this.params[t].value=""),[t,this.params[t].value]}.bind(this))),("checkout"===e||"cart"===e&&o(document.body).is(".woocommerce-checkout")||0<o("form.woocommerce-checkout").length)&&(o(document.body).on("updated_checkout",this.updated_checkout.bind(this)),o(document.body).on("change",'[name^="billing_"], [name^="shipping_"]',this.onChange.bind(this)),o("form.checkout").on("change",'.input-text:not([name^="billing_"], [name^="shipping_"], [name="account_password"]), select:not([name^="billing_"], [name^="shipping_"])',this.onChange.bind(this)),o("form.checkout").on("change",'[name="ship_to_different_address"]',this.on_ship_to_address_change.bind(this)),this.init_i18n(),o('[name="ship_to_different_address"]').is(":checked")?this.update_required_fields(o("#shipping_country").val(),"shipping_country"):this.update_required_fields(o("#billing_country").val(),"billing_country"))},wc_stripe.CheckoutFields.prototype.supportsSessionStorage=function(){return"sessionStorage"in a&&null!==a.sessionStorage&&["getItem","setItem"].reduce(function(t,e){return t&&e in sessionStorage}.bind(this),!0)},wc_stripe.CheckoutFields.prototype.init_i18n=function(){"undefined"!=typeof wc_address_i18n_params?this.locales=JSON.parse(wc_address_i18n_params.locale.replace(/&quot;/g,'"')):this.locales=null},wc_stripe.CheckoutFields.prototype.updated_checkout=function(){this.syncCheckoutFieldsWithDOM()},wc_stripe.CheckoutFields.prototype.syncCheckoutFieldsWithDOM=function(){for(var t in this.params)o("#"+t).length&&this.fields.set(t,o("#"+t).val())},wc_stripe.CheckoutFields.prototype.onChange=function(t){try{var e=t.currentTarget.name,i=t.currentTarget.value;this.fields.set(e,i),"billing_country"!==e&&"shipping_country"!==e||this.update_required_fields(i,e),this.supportsSessionStorage()&&sessionStorage.setItem("wc_stripe_checkout_fields",JSON.stringify(this.toJson()))}catch(s){console.log(s)}},wc_stripe.CheckoutFields.prototype.update_required_fields=function(t,e){if(this.locales){var i,s=-1<e.indexOf("billing_")?"billing_":"shipping_",t="undefined"!=typeof this.locales[t]?this.locales[t]:this.locales["default"],a=o.extend(!0,{},this.locales["default"],t);for(i in a){var n=s+i;this.params[n]&&(this.params[n]=o.extend(!0,{},this.params[n],a[i]))}}},wc_stripe.CheckoutFields.prototype.on_ship_to_address_change=function(t){o(t.currentTarget).is(":checked")&&this.update_required_fields(o("#shipping_country").val(),"shipping_country")},wc_stripe.CheckoutFields.prototype.requestFieldInWallet=function(t){return"checkout"===this.page?this.required(t)&&this.isEmpty(t):"order_pay"!==this.page&&this.required(t)},wc_stripe.CheckoutFields.prototype.set=function(t,e,i){this[t]&&"function"==typeof this[t]?this[t]().set.call(this,e,i):this.fields.set(t,e)},wc_stripe.CheckoutFields.prototype.get=function(t,e){var i;return this[t]&&"function"==typeof this[t]?i=this[t]().get.call(this,e):null!=(i=this.fields.get(t))&&""!==i||void 0!==e&&(i=e),void 0===i?"":i},wc_stripe.CheckoutFields.prototype.required=function(t){return!(!this.params[t]||"undefined"==typeof this.params[t].required)&&this.params[t].required},wc_stripe.CheckoutFields.prototype.exists=function(t){return t in this.params},wc_stripe.CheckoutFields.prototype.isEmpty=function(t){if(this.fields.has(t)){t=this.fields.get(t);return null==t||"string"==typeof t&&0===t.trim().length}return!0},wc_stripe.CheckoutFields.prototype.isValid=function(t){if(this[t]&&"function"==typeof this[t])return this[t]().isValid.apply(this,Array.prototype.slice.call(arguments,1))},wc_stripe.CheckoutFields.prototype.first_name=function(){return{set:function(t,e){this.fields.set(e+"_first_name",t)},get:function(t){return this.fields.get(t+"_first_name")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.last_name=function(){return{set:function(t,e){this.fields.set(e+"_last_name",t)},get:function(t){return this.fields.get(t+"_last_name")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.address_1=function(){return{set:function(t,e){this.fields.set(e+"_address_1",t)},get:function(t){return this.fields.get(t+"_address_1")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.address_2=function(){return{set:function(t,e){this.fields.set(e+"_address_2",t)},get:function(t){return this.fields.get(t+"_address_2")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.name=function(){return{set:function(t,e){this.fields.set(e+"_full_name",t);var i=t.split(" ");1<i.length?(t=i.pop(),this.fields.set(e+"_first_name",i.join(" ")),this.fields.set(e+"_last_name",t)):1==i.length&&this.fields.set(e+"_first_name",i[0])},get:function(t){return this.fields.get(t+"_first_name")+" "+this.fields.get(t+"_last_name")}}},wc_stripe.CheckoutFields.prototype.email=function(){return{set:function(t,e){this.fields.set(e+"_email",t)},get:function(t){return this.fields.get(t+"_email")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.phone=function(){return{set:function(t,e){this.fields.set(e+"_phone",t)},get:function(t){return this.fields.get(t+"_phone")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.country=function(){return{set:function(t,e){this.fields.set(e+"_country",t)},get:function(t){return this.fields.get(t+"_country")},isValid:function(t){return"string"==typeof t&&2===t.length}}},wc_stripe.CheckoutFields.prototype.state=function(){return{set:function(i,t){2<(i=i.toUpperCase()).length&&"checkout"===this.page&&o("#"+t+"_state option").each(function(){var t=o(this),e=t.text().toUpperCase();i===e&&(i=t.val())}),this.fields.set(t+"_state",i)},get:function(t){return this.fields.get(t+"_state")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.city=function(){return{set:function(t,e){this.fields.set(e+"_city",t)},get:function(t){return this.fields.get(t+"_city")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.postcode=function(){return{set:function(t,e){this.fields.set(e+"_postcode",t)},get:function(t){return this.fields.get(t+"_postcode")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.recipient=function(){return wc_stripe.CheckoutFields.prototype.name.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.payerName=function(){return wc_stripe.CheckoutFields.prototype.name.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.payerEmail=function(){return wc_stripe.CheckoutFields.prototype.email.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.payerPhone=function(){return wc_stripe.CheckoutFields.prototype.phone.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.phoneNumber=function(){return wc_stripe.CheckoutFields.prototype.phone.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.countryCode=function(){return wc_stripe.CheckoutFields.prototype.country.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.address1=function(){return wc_stripe.CheckoutFields.prototype.address_1.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.address2=function(){return wc_stripe.CheckoutFields.prototype.address_2.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.line1=function(){return wc_stripe.CheckoutFields.prototype.address_1.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.line2=function(){return wc_stripe.CheckoutFields.prototype.address_2.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.addressLine=function(){return{set:function(t,e){0<t.length&&this.fields.set(e+"_address_1",t[0]),1<t.length&&this.fields.set(e+"_address_2",t[1])},get:function(t){return[this.fields.get(t+"_address_1"),this.fields.get(t+"_address_2")]},isValid:function(t){return 0<t.length&&("string"==typeof t[0]&&0<t[0].length)}}},wc_stripe.CheckoutFields.prototype.region=function(){return wc_stripe.CheckoutFields.prototype.state.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.administrativeArea=function(){return wc_stripe.CheckoutFields.prototype.state.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.locality=function(){return wc_stripe.CheckoutFields.prototype.city.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.postal_code=function(){return wc_stripe.CheckoutFields.prototype.postcode.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.postalCode=function(){return wc_stripe.CheckoutFields.prototype.postcode.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.toJson=function(){var i={};return this.fields.forEach(function(t,e){i[e]=t}),i},wc_stripe.CheckoutFields.prototype.toFormFields=function(t){var i=[];this.fields.forEach(function(t,e){e='[name="'+e+'"]';o(e).length&&""!==t&&(o(e).val()!==t&&o(e).is("select")&&i.push(e),o(e).val(t))}),0<i.length&&o(i.join(",")).trigger("change"),void 0!==t&&o(document.body).trigger("update_checkout",t)},wc_stripe.CheckoutFields.prototype.validateFields=function(t){for(var e in this.params){var i=this.params[e];if(-1<e.indexOf(t)&&i.required&&o("#"+e).length&&o("#"+e).is(":visible")){i=o("#"+e).val();if(null==i||0===i.length)return!1}}return!0};try{i=Stripe(wc_stripe_params_v3.api_key,wc_stripe_params_v3.stripeParams)}catch(t){return a.alert(t),console.log(t)}var r=new wc_stripe.CheckoutFields(wc_stripe_checkout_fields,wc_stripe_params_v3.page)}(window,jQuery);
i18n/languages/woo-stripe-payment.pot CHANGED
@@ -2,14 +2,14 @@
2
  # This file is distributed under the same license as the Payment Plugins for Stripe WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Payment Plugins for Stripe WooCommerce 3.3.32\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woo-stripe-payment\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "POT-Creation-Date: 2022-11-11T18:37:02+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.4.0\n"
15
  "X-Domain: woo-stripe-payment\n"
@@ -372,7 +372,7 @@ msgstr ""
372
  #: includes/admin/meta-boxes/views/html-order-actions.php:48
373
  #: includes/admin/meta-boxes/views/html-order-pay.php:23
374
  #: includes/admin/meta-boxes/views/html-product-data.php:46
375
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:53
376
  #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:150
377
  #: includes/gateways/settings/applepay-settings.php:52
378
  #: includes/gateways/settings/cc-settings.php:50
@@ -508,7 +508,7 @@ msgstr ""
508
 
509
  #: includes/admin/meta-boxes/views/html-order-pay.php:21
510
  #: includes/admin/meta-boxes/views/html-product-data.php:15
511
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:49
512
  #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:146
513
  #: includes/gateways/settings/applepay-settings.php:48
514
  #: includes/gateways/settings/cc-settings.php:46
@@ -519,7 +519,7 @@ msgstr ""
519
 
520
  #: includes/admin/meta-boxes/views/html-order-pay.php:24
521
  #: includes/admin/meta-boxes/views/html-product-data.php:48
522
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:54
523
  #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:151
524
  #: includes/gateways/settings/applepay-settings.php:53
525
  #: includes/gateways/settings/cc-settings.php:51
@@ -1192,6 +1192,8 @@ msgstr ""
1192
 
1193
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:26
1194
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:27
 
 
1195
  #: packages/blocks/assets/js/payment-methods/local-payment/afterpay.js:123
1196
  #: packages/blocks/build/commons.js:3987
1197
  msgid "Afterpay"
@@ -1201,11 +1203,11 @@ msgstr ""
1201
  msgid "Afterpay gateway that integrates with your Stripe account."
1202
  msgstr ""
1203
 
1204
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:42
1205
  msgid "Complete Order"
1206
  msgstr ""
1207
 
1208
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:57
1209
  #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:154
1210
  #: includes/gateways/settings/applepay-settings.php:56
1211
  #: includes/gateways/settings/cc-settings.php:54
@@ -1213,168 +1215,168 @@ msgstr ""
1213
  msgid "This option determines whether the customer's funds are captured immediately or authorized and can be captured at a later date."
1214
  msgstr ""
1215
 
1216
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:62
1217
  #: includes/gateways/settings/applepay-settings.php:60
1218
  #: includes/gateways/settings/googlepay-settings.php:82
1219
  #: includes/gateways/settings/payment-request-settings.php:61
1220
  msgid "Payment Sections"
1221
  msgstr ""
1222
 
1223
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:65
1224
  #: includes/gateways/settings/applepay-settings.php:63
1225
  #: includes/gateways/settings/googlepay-settings.php:85
1226
  #: includes/gateways/settings/payment-request-settings.php:64
1227
  msgid "Product Page"
1228
  msgstr ""
1229
 
1230
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:66
1231
  #: includes/gateways/settings/applepay-settings.php:64
1232
  #: includes/gateways/settings/googlepay-settings.php:86
1233
  #: includes/gateways/settings/payment-request-settings.php:65
1234
  msgid "Cart Page"
1235
  msgstr ""
1236
 
1237
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:67
1238
  #: includes/gateways/settings/applepay-settings.php:65
1239
  #: includes/gateways/settings/googlepay-settings.php:87
1240
  #: includes/gateways/settings/payment-request-settings.php:66
1241
  msgid "Mini Cart"
1242
  msgstr ""
1243
 
1244
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:70
1245
  msgid "These are the additional sections where the Afterpay messaging will be enabled. You can control individual products via the Edit product page."
1246
  msgstr ""
1247
 
1248
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:74
1249
  msgid "Hide If Ineligible"
1250
  msgstr ""
1251
 
1252
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:79
1253
  msgid "If enabled, Afterpay won't show when the products in the cart are not eligible."
1254
  msgstr ""
1255
 
1256
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:86
1257
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:145
1258
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:204
1259
  #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:158
1260
  #: includes/gateways/settings/googlepay-settings.php:111
1261
  msgid "Icon"
1262
  msgstr ""
1263
 
1264
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:90
1265
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:149
1266
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:208
1267
- msgid "Black on mint"
1268
- msgstr ""
1269
-
1270
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:91
1271
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:150
1272
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:209
1273
- msgid "Black on white"
1274
  msgstr ""
1275
 
1276
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:92
1277
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:151
1278
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:210
1279
- msgid "Mint on black"
1280
  msgstr ""
1281
 
1282
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:93
1283
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:152
1284
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:211
 
 
 
 
 
 
1285
  msgid "White on black"
1286
  msgstr ""
1287
 
1288
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:96
1289
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:155
1290
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:214
1291
  #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:166
1292
  msgid "This is the icon style that appears next to the gateway on the checkout page."
1293
  msgstr ""
1294
 
1295
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:99
1296
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:158
1297
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:217
1298
  msgid "Intro text"
1299
  msgstr ""
1300
 
1301
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:110
1302
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:122
1303
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:169
1304
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:181
1305
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:228
1306
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:240
1307
  msgid "Modal link style"
1308
  msgstr ""
1309
 
1310
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:114
1311
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:173
1312
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:232
1313
- msgid "More info text"
1314
- msgstr ""
1315
-
1316
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:115
1317
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:174
1318
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:233
1319
- msgid "Circled info icon"
1320
  msgstr ""
1321
 
1322
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:116
1323
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:175
1324
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:234
1325
- msgid "Learn more text"
1326
  msgstr ""
1327
 
1328
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:118
1329
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:177
1330
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:236
1331
- msgid "This is the style of the Afterpay info link."
1332
  msgstr ""
1333
 
1334
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:126
1335
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:185
1336
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:244
1337
- msgid "Mint"
1338
  msgstr ""
1339
 
1340
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:127
1341
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:186
1342
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:245
 
 
 
 
 
 
1343
  #: includes/gateways/settings/googlepay-settings.php:133
1344
  msgid "White"
1345
  msgstr ""
1346
 
1347
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:129
1348
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:188
1349
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:247
1350
  msgid "This is the theme color for the Afterpay info modal."
1351
  msgstr ""
1352
 
1353
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:134
1354
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:193
1355
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:252
1356
  msgid "Show interest free"
1357
  msgstr ""
1358
 
1359
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:137
1360
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:196
1361
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:255
1362
  msgid "If enabled, the Afterpay message will contain the interest free text."
1363
  msgstr ""
1364
 
1365
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:406
1366
  msgid "Stripe accounts in the following countries can accept Afterpay payments with local currency settlement"
1367
  msgstr ""
1368
 
1369
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:413
1370
  msgid "Store currency must be %s for Afterpay to show because your Stripe account is registered in %s. This is a requirement of Afterpay."
1371
  msgstr ""
1372
 
1373
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:418
1374
  msgid "You can accept payments from customers in the same country that you registered your Stripe account in."
1375
  msgstr ""
1376
 
1377
- #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:426
1378
  msgid ""
1379
  "You can accept payments from customers in the same country that you registered your Stripe account in. Payments must also match the local \n"
1380
  "\t\t\tcurrency of the Stripe account country."
@@ -1506,7 +1508,7 @@ msgid "If enabled, the voucher link will be included in the order on-hold email
1506
  msgstr ""
1507
 
1508
  #: includes/gateways/class-wc-payment-gateway-stripe-boleto.php:65
1509
- #: includes/wc-stripe-functions.php:1173
1510
  msgid "Please enter a valid CPF / CNPJ"
1511
  msgstr ""
1512
 
@@ -1538,11 +1540,7 @@ msgid "Only the Stripe payment form can be used while Link is enabled."
1538
  msgstr ""
1539
 
1540
  #: includes/gateways/class-wc-payment-gateway-stripe-cc.php:322
1541
- msgid "The Payment Element card form design is only available to connected accounts at this time because it's a Stripe beta feature. To use the Payment Element in test mode, use the connect option on the API Settings page."
1542
- msgstr ""
1543
-
1544
- #: includes/gateways/class-wc-payment-gateway-stripe-cc.php:333
1545
- msgid "Stripe payment form (beta feature)"
1546
  msgstr ""
1547
 
1548
  #: includes/gateways/class-wc-payment-gateway-stripe-eps.php:26
@@ -2310,230 +2308,230 @@ msgstr ""
2310
  msgid "Rounded Form"
2311
  msgstr ""
2312
 
2313
- #: includes/wc-stripe-functions.php:1102
2314
  msgid "There was an error processing your credit card."
2315
  msgstr ""
2316
 
2317
- #: includes/wc-stripe-functions.php:1103
2318
  msgid "Your card number is incomplete."
2319
  msgstr ""
2320
 
2321
- #: includes/wc-stripe-functions.php:1104
2322
  msgid "Your card's expiration date is incomplete."
2323
  msgstr ""
2324
 
2325
- #: includes/wc-stripe-functions.php:1105
2326
  msgid "Your card's security code is incomplete."
2327
  msgstr ""
2328
 
2329
- #: includes/wc-stripe-functions.php:1106
2330
  msgid "Your card's zip code is incomplete."
2331
  msgstr ""
2332
 
2333
- #: includes/wc-stripe-functions.php:1107
2334
  msgid "The card number is incorrect. Check the card's number or use a different card."
2335
  msgstr ""
2336
 
2337
- #: includes/wc-stripe-functions.php:1108
2338
  msgid "The card's security code is incorrect. Check the card's security code or use a different card."
2339
  msgstr ""
2340
 
2341
- #: includes/wc-stripe-functions.php:1109
2342
  msgid "The card's ZIP code is incorrect. Check the card's ZIP code or use a different card."
2343
  msgstr ""
2344
 
2345
- #: includes/wc-stripe-functions.php:1110
2346
- #: includes/wc-stripe-functions.php:1115
2347
  msgid "The card number is invalid. Check the card details or use a different card."
2348
  msgstr ""
2349
 
2350
- #: includes/wc-stripe-functions.php:1111
2351
  msgid "This value provided to the field contains characters that are unsupported by the field."
2352
  msgstr ""
2353
 
2354
- #: includes/wc-stripe-functions.php:1112
2355
  msgid "The card's security code is invalid. Check the card's security code or use a different card."
2356
  msgstr ""
2357
 
2358
- #: includes/wc-stripe-functions.php:1113
2359
  msgid "The card's expiration month is incorrect. Check the expiration date or use a different card."
2360
  msgstr ""
2361
 
2362
- #: includes/wc-stripe-functions.php:1114
2363
  msgid "The card's expiration year is incorrect. Check the expiration date or use a different card."
2364
  msgstr ""
2365
 
2366
- #: includes/wc-stripe-functions.php:1116
2367
  msgid "The card's address is incorrect. Check the card's address or use a different card."
2368
  msgstr ""
2369
 
2370
- #: includes/wc-stripe-functions.php:1117
2371
  msgid "The card has expired. Check the expiration date or use a different card."
2372
  msgstr ""
2373
 
2374
- #: includes/wc-stripe-functions.php:1118
2375
  msgid "The card has been declined."
2376
  msgstr ""
2377
 
2378
- #: includes/wc-stripe-functions.php:1119
2379
  msgid "Your card's expiration year is in the past."
2380
  msgstr ""
2381
 
2382
- #: includes/wc-stripe-functions.php:1120
2383
  msgid "The bank account number provided is invalid (e.g., missing digits). Bank account information varies from country to country. We recommend creating validations in your entry forms based on the bank account formats we provide."
2384
  msgstr ""
2385
 
2386
- #: includes/wc-stripe-functions.php:1122
2387
  msgid "The specified amount is greater than the maximum amount allowed. Use a lower amount and try again."
2388
  msgstr ""
2389
 
2390
- #: includes/wc-stripe-functions.php:1123
2391
  msgid "The specified amount is less than the minimum amount allowed. Use a higher amount and try again."
2392
  msgstr ""
2393
 
2394
- #: includes/wc-stripe-functions.php:1124
2395
  msgid "The payment requires authentication to proceed. If your customer is off session, notify your customer to return to your application and complete the payment. If you provided the error_on_requires_action parameter, then your customer should try another card that does not require authentication."
2396
  msgstr ""
2397
 
2398
- #: includes/wc-stripe-functions.php:1126
2399
  msgid "The transfer or payout could not be completed because the associated account does not have a sufficient balance available. Create a new transfer or payout using an amount less than or equal to the account's available balance."
2400
  msgstr ""
2401
 
2402
- #: includes/wc-stripe-functions.php:1128
2403
  msgid "The bank account provided can not be used to charge, either because it is not verified yet or it is not supported."
2404
  msgstr ""
2405
 
2406
- #: includes/wc-stripe-functions.php:1129
2407
  msgid "The bank account provided already exists on the specified Customer object. If the bank account should also be attached to a different customer, include the correct customer ID when making the request again."
2408
  msgstr ""
2409
 
2410
- #: includes/wc-stripe-functions.php:1131
2411
  msgid "The bank account provided cannot be used for payouts. A different bank account must be used."
2412
  msgstr ""
2413
 
2414
- #: includes/wc-stripe-functions.php:1132
2415
  msgid "Your Connect platform is attempting to share an unverified bank account with a connected account."
2416
  msgstr ""
2417
 
2418
- #: includes/wc-stripe-functions.php:1133
2419
  msgid "The bank account cannot be verified, either because the microdeposit amounts provided do not match the actual amounts, or because verification has failed too many times."
2420
  msgstr ""
2421
 
2422
- #: includes/wc-stripe-functions.php:1135
2423
  msgid "This card has been declined too many times. You can try to charge this card again after 24 hours. We suggest reaching out to your customer to make sure they have entered all of their information correctly and that there are no issues with their card."
2424
  msgstr ""
2425
 
2426
- #: includes/wc-stripe-functions.php:1137
2427
  msgid "The charge you're attempting to capture has already been captured. Update the request with an uncaptured charge ID."
2428
  msgstr ""
2429
 
2430
- #: includes/wc-stripe-functions.php:1138
2431
  msgid "The charge you're attempting to refund has already been refunded. Update the request to use the ID of a charge that has not been refunded."
2432
  msgstr ""
2433
 
2434
- #: includes/wc-stripe-functions.php:1140
2435
  msgid "The charge you're attempting to refund has been charged back. Check the disputes documentation to learn how to respond to the dispute."
2436
  msgstr ""
2437
 
2438
- #: includes/wc-stripe-functions.php:1142
2439
  msgid "This charge would cause you to exceed your rolling-window processing limit for this source type. Please retry the charge later, or contact us to request a higher processing limit."
2440
  msgstr ""
2441
 
2442
- #: includes/wc-stripe-functions.php:1144
2443
  msgid "The charge cannot be captured as the authorization has expired. Auth and capture charges must be captured within seven days."
2444
  msgstr ""
2445
 
2446
- #: includes/wc-stripe-functions.php:1146
2447
  msgid "One or more provided parameters was not allowed for the given operation on the Charge. Check our API reference or the returned error message to see which values were not correct for that Charge."
2448
  msgstr ""
2449
 
2450
- #: includes/wc-stripe-functions.php:1148
2451
  msgid "The email address is invalid (e.g., not properly formatted). Check that the email address is properly formatted and only includes allowed characters."
2452
  msgstr ""
2453
 
2454
- #: includes/wc-stripe-functions.php:1150
2455
  msgid "The idempotency key provided is currently being used in another request. This occurs if your integration is making duplicate requests simultaneously."
2456
  msgstr ""
2457
 
2458
- #: includes/wc-stripe-functions.php:1152
2459
  msgid "The specified amount is invalid. The charge amount must be a positive integer in the smallest currency unit, and not exceed the minimum or maximum amount."
2460
  msgstr ""
2461
 
2462
- #: includes/wc-stripe-functions.php:1154
2463
  msgid "The source cannot be used because it is not in the correct state (e.g., a charge request is trying to use a source with a pending, failed, or consumed source). Check the status of the source you are attempting to use."
2464
  msgstr ""
2465
 
2466
- #: includes/wc-stripe-functions.php:1156
2467
  msgid "Both a customer and source ID have been provided, but the source has not been saved to the customer. To create a charge for a customer with a specified source, you must first save the card details."
2468
  msgstr ""
2469
 
2470
- #: includes/wc-stripe-functions.php:1158
2471
  msgid "The ZIP code provided was incorrect."
2472
  msgstr ""
2473
 
2474
- #: includes/wc-stripe-functions.php:1159
2475
  msgid "An error occurred while processing the card. Try again later or with a different payment method."
2476
  msgstr ""
2477
 
2478
- #: includes/wc-stripe-functions.php:1160
2479
  msgid "The card does not support this type of purchase."
2480
  msgstr ""
2481
 
2482
- #: includes/wc-stripe-functions.php:1161
2483
- #: includes/wc-stripe-functions.php:1164
2484
- #: includes/wc-stripe-functions.php:1166
2485
  msgid "The card has been declined for an unknown reason."
2486
  msgstr ""
2487
 
2488
- #: includes/wc-stripe-functions.php:1162
2489
  msgid "The customer has exceeded the balance or credit limit available on their card."
2490
  msgstr ""
2491
 
2492
- #: includes/wc-stripe-functions.php:1163
2493
  msgid "The card does not support the specified currency."
2494
  msgstr ""
2495
 
2496
- #: includes/wc-stripe-functions.php:1165
2497
  msgid "The payment has been declined as Stripe suspects it is fraudulent."
2498
  msgstr ""
2499
 
2500
- #: includes/wc-stripe-functions.php:1167
2501
  msgid "The PIN entered is incorrect. "
2502
  msgstr ""
2503
 
2504
- #: includes/wc-stripe-functions.php:1168
2505
  msgid "The card has insufficient funds to complete the purchase."
2506
  msgstr ""
2507
 
2508
- #: includes/wc-stripe-functions.php:1169
2509
  msgid "Please select a payment method before proceeding."
2510
  msgstr ""
2511
 
2512
- #: includes/wc-stripe-functions.php:1170
2513
  msgid "Please enter your IBAN before proceeding."
2514
  msgstr ""
2515
 
2516
- #: includes/wc-stripe-functions.php:1171
2517
  msgid "Please select a bank before proceeding"
2518
  msgstr ""
2519
 
2520
- #: includes/wc-stripe-functions.php:1172
2521
  msgid "The IBAN you entered is incomplete."
2522
  msgstr ""
2523
 
2524
- #: includes/wc-stripe-functions.php:1174
2525
  msgid "Your card was declined. Your request was in test mode, but you used a real credit card. Only test cards can be used in test mode."
2526
  msgstr ""
2527
 
2528
- #: includes/wc-stripe-functions.php:1176
2529
  msgid "You do not have permission to use the PaymentElement card form. Please send a request to https://support.stripe.com/ and ask for the \"server_side_confirmation_beta\" to be added to your account."
2530
  msgstr ""
2531
 
2532
- #: includes/wc-stripe-functions.php:1177
2533
  msgid "Please provide a billing phone number."
2534
  msgstr ""
2535
 
2536
- #: includes/wc-stripe-functions.php:1178
2537
  msgid "Your payment could not be processed at this time because your bank account does not support instant verification."
2538
  msgstr ""
2539
 
2
  # This file is distributed under the same license as the Payment Plugins for Stripe WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Payment Plugins for Stripe WooCommerce 3.3.33\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woo-stripe-payment\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "POT-Creation-Date: 2022-11-23T17:21:28+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.4.0\n"
15
  "X-Domain: woo-stripe-payment\n"
372
  #: includes/admin/meta-boxes/views/html-order-actions.php:48
373
  #: includes/admin/meta-boxes/views/html-order-pay.php:23
374
  #: includes/admin/meta-boxes/views/html-product-data.php:46
375
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:54
376
  #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:150
377
  #: includes/gateways/settings/applepay-settings.php:52
378
  #: includes/gateways/settings/cc-settings.php:50
508
 
509
  #: includes/admin/meta-boxes/views/html-order-pay.php:21
510
  #: includes/admin/meta-boxes/views/html-product-data.php:15
511
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:50
512
  #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:146
513
  #: includes/gateways/settings/applepay-settings.php:48
514
  #: includes/gateways/settings/cc-settings.php:46
519
 
520
  #: includes/admin/meta-boxes/views/html-order-pay.php:24
521
  #: includes/admin/meta-boxes/views/html-product-data.php:48
522
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:55
523
  #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:151
524
  #: includes/gateways/settings/applepay-settings.php:53
525
  #: includes/gateways/settings/cc-settings.php:51
1192
 
1193
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:26
1194
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:27
1195
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:31
1196
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:412
1197
  #: packages/blocks/assets/js/payment-methods/local-payment/afterpay.js:123
1198
  #: packages/blocks/build/commons.js:3987
1199
  msgid "Afterpay"
1203
  msgid "Afterpay gateway that integrates with your Stripe account."
1204
  msgstr ""
1205
 
1206
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:43
1207
  msgid "Complete Order"
1208
  msgstr ""
1209
 
1210
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:58
1211
  #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:154
1212
  #: includes/gateways/settings/applepay-settings.php:56
1213
  #: includes/gateways/settings/cc-settings.php:54
1215
  msgid "This option determines whether the customer's funds are captured immediately or authorized and can be captured at a later date."
1216
  msgstr ""
1217
 
1218
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:63
1219
  #: includes/gateways/settings/applepay-settings.php:60
1220
  #: includes/gateways/settings/googlepay-settings.php:82
1221
  #: includes/gateways/settings/payment-request-settings.php:61
1222
  msgid "Payment Sections"
1223
  msgstr ""
1224
 
1225
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:66
1226
  #: includes/gateways/settings/applepay-settings.php:63
1227
  #: includes/gateways/settings/googlepay-settings.php:85
1228
  #: includes/gateways/settings/payment-request-settings.php:64
1229
  msgid "Product Page"
1230
  msgstr ""
1231
 
1232
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:67
1233
  #: includes/gateways/settings/applepay-settings.php:64
1234
  #: includes/gateways/settings/googlepay-settings.php:86
1235
  #: includes/gateways/settings/payment-request-settings.php:65
1236
  msgid "Cart Page"
1237
  msgstr ""
1238
 
1239
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:68
1240
  #: includes/gateways/settings/applepay-settings.php:65
1241
  #: includes/gateways/settings/googlepay-settings.php:87
1242
  #: includes/gateways/settings/payment-request-settings.php:66
1243
  msgid "Mini Cart"
1244
  msgstr ""
1245
 
1246
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:71
1247
  msgid "These are the additional sections where the Afterpay messaging will be enabled. You can control individual products via the Edit product page."
1248
  msgstr ""
1249
 
1250
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:75
1251
  msgid "Hide If Ineligible"
1252
  msgstr ""
1253
 
1254
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:80
1255
  msgid "If enabled, Afterpay won't show when the products in the cart are not eligible."
1256
  msgstr ""
1257
 
1258
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:87
1259
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:146
1260
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:205
1261
  #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:158
1262
  #: includes/gateways/settings/googlepay-settings.php:111
1263
  msgid "Icon"
1264
  msgstr ""
1265
 
 
 
 
 
 
 
1266
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:91
1267
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:150
1268
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:209
1269
+ msgid "Black on mint"
1270
  msgstr ""
1271
 
1272
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:92
1273
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:151
1274
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:210
1275
+ msgid "Black on white"
1276
  msgstr ""
1277
 
1278
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:93
1279
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:152
1280
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:211
1281
+ msgid "Mint on black"
1282
+ msgstr ""
1283
+
1284
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:94
1285
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:153
1286
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:212
1287
  msgid "White on black"
1288
  msgstr ""
1289
 
1290
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:97
1291
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:156
1292
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:215
1293
  #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:166
1294
  msgid "This is the icon style that appears next to the gateway on the checkout page."
1295
  msgstr ""
1296
 
1297
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:100
1298
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:159
1299
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:218
1300
  msgid "Intro text"
1301
  msgstr ""
1302
 
1303
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:111
1304
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:123
1305
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:170
1306
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:182
1307
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:229
1308
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:241
1309
  msgid "Modal link style"
1310
  msgstr ""
1311
 
 
 
 
 
 
 
1312
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:115
1313
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:174
1314
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:233
1315
+ msgid "More info text"
1316
  msgstr ""
1317
 
1318
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:116
1319
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:175
1320
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:234
1321
+ msgid "Circled info icon"
1322
  msgstr ""
1323
 
1324
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:117
1325
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:176
1326
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:235
1327
+ msgid "Learn more text"
1328
  msgstr ""
1329
 
1330
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:119
1331
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:178
1332
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:237
1333
+ msgid "This is the style of the Afterpay info link."
1334
  msgstr ""
1335
 
1336
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:127
1337
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:186
1338
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:245
1339
+ msgid "Mint"
1340
+ msgstr ""
1341
+
1342
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:128
1343
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:187
1344
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:246
1345
  #: includes/gateways/settings/googlepay-settings.php:133
1346
  msgid "White"
1347
  msgstr ""
1348
 
1349
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:130
1350
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:189
1351
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:248
1352
  msgid "This is the theme color for the Afterpay info modal."
1353
  msgstr ""
1354
 
1355
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:135
1356
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:194
1357
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:253
1358
  msgid "Show interest free"
1359
  msgstr ""
1360
 
1361
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:138
1362
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:197
1363
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:256
1364
  msgid "If enabled, the Afterpay message will contain the interest free text."
1365
  msgstr ""
1366
 
1367
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:418
1368
  msgid "Stripe accounts in the following countries can accept Afterpay payments with local currency settlement"
1369
  msgstr ""
1370
 
1371
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:425
1372
  msgid "Store currency must be %s for Afterpay to show because your Stripe account is registered in %s. This is a requirement of Afterpay."
1373
  msgstr ""
1374
 
1375
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:430
1376
  msgid "You can accept payments from customers in the same country that you registered your Stripe account in."
1377
  msgstr ""
1378
 
1379
+ #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:438
1380
  msgid ""
1381
  "You can accept payments from customers in the same country that you registered your Stripe account in. Payments must also match the local \n"
1382
  "\t\t\tcurrency of the Stripe account country."
1508
  msgstr ""
1509
 
1510
  #: includes/gateways/class-wc-payment-gateway-stripe-boleto.php:65
1511
+ #: includes/wc-stripe-functions.php:1166
1512
  msgid "Please enter a valid CPF / CNPJ"
1513
  msgstr ""
1514
 
1540
  msgstr ""
1541
 
1542
  #: includes/gateways/class-wc-payment-gateway-stripe-cc.php:322
1543
+ msgid "The Stripe Payment form is only available to connected accounts at this time. To use the Stripe Payment form in test mode, use the connect option on the API Settings page."
 
 
 
 
1544
  msgstr ""
1545
 
1546
  #: includes/gateways/class-wc-payment-gateway-stripe-eps.php:26
2308
  msgid "Rounded Form"
2309
  msgstr ""
2310
 
2311
+ #: includes/wc-stripe-functions.php:1095
2312
  msgid "There was an error processing your credit card."
2313
  msgstr ""
2314
 
2315
+ #: includes/wc-stripe-functions.php:1096
2316
  msgid "Your card number is incomplete."
2317
  msgstr ""
2318
 
2319
+ #: includes/wc-stripe-functions.php:1097
2320
  msgid "Your card's expiration date is incomplete."
2321
  msgstr ""
2322
 
2323
+ #: includes/wc-stripe-functions.php:1098
2324
  msgid "Your card's security code is incomplete."
2325
  msgstr ""
2326
 
2327
+ #: includes/wc-stripe-functions.php:1099
2328
  msgid "Your card's zip code is incomplete."
2329
  msgstr ""
2330
 
2331
+ #: includes/wc-stripe-functions.php:1100
2332
  msgid "The card number is incorrect. Check the card's number or use a different card."
2333
  msgstr ""
2334
 
2335
+ #: includes/wc-stripe-functions.php:1101
2336
  msgid "The card's security code is incorrect. Check the card's security code or use a different card."
2337
  msgstr ""
2338
 
2339
+ #: includes/wc-stripe-functions.php:1102
2340
  msgid "The card's ZIP code is incorrect. Check the card's ZIP code or use a different card."
2341
  msgstr ""
2342
 
2343
+ #: includes/wc-stripe-functions.php:1103
2344
+ #: includes/wc-stripe-functions.php:1108
2345
  msgid "The card number is invalid. Check the card details or use a different card."
2346
  msgstr ""
2347
 
2348
+ #: includes/wc-stripe-functions.php:1104
2349
  msgid "This value provided to the field contains characters that are unsupported by the field."
2350
  msgstr ""
2351
 
2352
+ #: includes/wc-stripe-functions.php:1105
2353
  msgid "The card's security code is invalid. Check the card's security code or use a different card."
2354
  msgstr ""
2355
 
2356
+ #: includes/wc-stripe-functions.php:1106
2357
  msgid "The card's expiration month is incorrect. Check the expiration date or use a different card."
2358
  msgstr ""
2359
 
2360
+ #: includes/wc-stripe-functions.php:1107
2361
  msgid "The card's expiration year is incorrect. Check the expiration date or use a different card."
2362
  msgstr ""
2363
 
2364
+ #: includes/wc-stripe-functions.php:1109
2365
  msgid "The card's address is incorrect. Check the card's address or use a different card."
2366
  msgstr ""
2367
 
2368
+ #: includes/wc-stripe-functions.php:1110
2369
  msgid "The card has expired. Check the expiration date or use a different card."
2370
  msgstr ""
2371
 
2372
+ #: includes/wc-stripe-functions.php:1111
2373
  msgid "The card has been declined."
2374
  msgstr ""
2375
 
2376
+ #: includes/wc-stripe-functions.php:1112
2377
  msgid "Your card's expiration year is in the past."
2378
  msgstr ""
2379
 
2380
+ #: includes/wc-stripe-functions.php:1113
2381
  msgid "The bank account number provided is invalid (e.g., missing digits). Bank account information varies from country to country. We recommend creating validations in your entry forms based on the bank account formats we provide."
2382
  msgstr ""
2383
 
2384
+ #: includes/wc-stripe-functions.php:1115
2385
  msgid "The specified amount is greater than the maximum amount allowed. Use a lower amount and try again."
2386
  msgstr ""
2387
 
2388
+ #: includes/wc-stripe-functions.php:1116
2389
  msgid "The specified amount is less than the minimum amount allowed. Use a higher amount and try again."
2390
  msgstr ""
2391
 
2392
+ #: includes/wc-stripe-functions.php:1117
2393
  msgid "The payment requires authentication to proceed. If your customer is off session, notify your customer to return to your application and complete the payment. If you provided the error_on_requires_action parameter, then your customer should try another card that does not require authentication."
2394
  msgstr ""
2395
 
2396
+ #: includes/wc-stripe-functions.php:1119
2397
  msgid "The transfer or payout could not be completed because the associated account does not have a sufficient balance available. Create a new transfer or payout using an amount less than or equal to the account's available balance."
2398
  msgstr ""
2399
 
2400
+ #: includes/wc-stripe-functions.php:1121
2401
  msgid "The bank account provided can not be used to charge, either because it is not verified yet or it is not supported."
2402
  msgstr ""
2403
 
2404
+ #: includes/wc-stripe-functions.php:1122
2405
  msgid "The bank account provided already exists on the specified Customer object. If the bank account should also be attached to a different customer, include the correct customer ID when making the request again."
2406
  msgstr ""
2407
 
2408
+ #: includes/wc-stripe-functions.php:1124
2409
  msgid "The bank account provided cannot be used for payouts. A different bank account must be used."
2410
  msgstr ""
2411
 
2412
+ #: includes/wc-stripe-functions.php:1125
2413
  msgid "Your Connect platform is attempting to share an unverified bank account with a connected account."
2414
  msgstr ""
2415
 
2416
+ #: includes/wc-stripe-functions.php:1126
2417
  msgid "The bank account cannot be verified, either because the microdeposit amounts provided do not match the actual amounts, or because verification has failed too many times."
2418
  msgstr ""
2419
 
2420
+ #: includes/wc-stripe-functions.php:1128
2421
  msgid "This card has been declined too many times. You can try to charge this card again after 24 hours. We suggest reaching out to your customer to make sure they have entered all of their information correctly and that there are no issues with their card."
2422
  msgstr ""
2423
 
2424
+ #: includes/wc-stripe-functions.php:1130
2425
  msgid "The charge you're attempting to capture has already been captured. Update the request with an uncaptured charge ID."
2426
  msgstr ""
2427
 
2428
+ #: includes/wc-stripe-functions.php:1131
2429
  msgid "The charge you're attempting to refund has already been refunded. Update the request to use the ID of a charge that has not been refunded."
2430
  msgstr ""
2431
 
2432
+ #: includes/wc-stripe-functions.php:1133
2433
  msgid "The charge you're attempting to refund has been charged back. Check the disputes documentation to learn how to respond to the dispute."
2434
  msgstr ""
2435
 
2436
+ #: includes/wc-stripe-functions.php:1135
2437
  msgid "This charge would cause you to exceed your rolling-window processing limit for this source type. Please retry the charge later, or contact us to request a higher processing limit."
2438
  msgstr ""
2439
 
2440
+ #: includes/wc-stripe-functions.php:1137
2441
  msgid "The charge cannot be captured as the authorization has expired. Auth and capture charges must be captured within seven days."
2442
  msgstr ""
2443
 
2444
+ #: includes/wc-stripe-functions.php:1139
2445
  msgid "One or more provided parameters was not allowed for the given operation on the Charge. Check our API reference or the returned error message to see which values were not correct for that Charge."
2446
  msgstr ""
2447
 
2448
+ #: includes/wc-stripe-functions.php:1141
2449
  msgid "The email address is invalid (e.g., not properly formatted). Check that the email address is properly formatted and only includes allowed characters."
2450
  msgstr ""
2451
 
2452
+ #: includes/wc-stripe-functions.php:1143
2453
  msgid "The idempotency key provided is currently being used in another request. This occurs if your integration is making duplicate requests simultaneously."
2454
  msgstr ""
2455
 
2456
+ #: includes/wc-stripe-functions.php:1145
2457
  msgid "The specified amount is invalid. The charge amount must be a positive integer in the smallest currency unit, and not exceed the minimum or maximum amount."
2458
  msgstr ""
2459
 
2460
+ #: includes/wc-stripe-functions.php:1147
2461
  msgid "The source cannot be used because it is not in the correct state (e.g., a charge request is trying to use a source with a pending, failed, or consumed source). Check the status of the source you are attempting to use."
2462
  msgstr ""
2463
 
2464
+ #: includes/wc-stripe-functions.php:1149
2465
  msgid "Both a customer and source ID have been provided, but the source has not been saved to the customer. To create a charge for a customer with a specified source, you must first save the card details."
2466
  msgstr ""
2467
 
2468
+ #: includes/wc-stripe-functions.php:1151
2469
  msgid "The ZIP code provided was incorrect."
2470
  msgstr ""
2471
 
2472
+ #: includes/wc-stripe-functions.php:1152
2473
  msgid "An error occurred while processing the card. Try again later or with a different payment method."
2474
  msgstr ""
2475
 
2476
+ #: includes/wc-stripe-functions.php:1153
2477
  msgid "The card does not support this type of purchase."
2478
  msgstr ""
2479
 
2480
+ #: includes/wc-stripe-functions.php:1154
2481
+ #: includes/wc-stripe-functions.php:1157
2482
+ #: includes/wc-stripe-functions.php:1159
2483
  msgid "The card has been declined for an unknown reason."
2484
  msgstr ""
2485
 
2486
+ #: includes/wc-stripe-functions.php:1155
2487
  msgid "The customer has exceeded the balance or credit limit available on their card."
2488
  msgstr ""
2489
 
2490
+ #: includes/wc-stripe-functions.php:1156
2491
  msgid "The card does not support the specified currency."
2492
  msgstr ""
2493
 
2494
+ #: includes/wc-stripe-functions.php:1158
2495
  msgid "The payment has been declined as Stripe suspects it is fraudulent."
2496
  msgstr ""
2497
 
2498
+ #: includes/wc-stripe-functions.php:1160
2499
  msgid "The PIN entered is incorrect. "
2500
  msgstr ""
2501
 
2502
+ #: includes/wc-stripe-functions.php:1161
2503
  msgid "The card has insufficient funds to complete the purchase."
2504
  msgstr ""
2505
 
2506
+ #: includes/wc-stripe-functions.php:1162
2507
  msgid "Please select a payment method before proceeding."
2508
  msgstr ""
2509
 
2510
+ #: includes/wc-stripe-functions.php:1163
2511
  msgid "Please enter your IBAN before proceeding."
2512
  msgstr ""
2513
 
2514
+ #: includes/wc-stripe-functions.php:1164
2515
  msgid "Please select a bank before proceeding"
2516
  msgstr ""
2517
 
2518
+ #: includes/wc-stripe-functions.php:1165
2519
  msgid "The IBAN you entered is incomplete."
2520
  msgstr ""
2521
 
2522
+ #: includes/wc-stripe-functions.php:1167
2523
  msgid "Your card was declined. Your request was in test mode, but you used a real credit card. Only test cards can be used in test mode."
2524
  msgstr ""
2525
 
2526
+ #: includes/wc-stripe-functions.php:1169
2527
  msgid "You do not have permission to use the PaymentElement card form. Please send a request to https://support.stripe.com/ and ask for the \"server_side_confirmation_beta\" to be added to your account."
2528
  msgstr ""
2529
 
2530
+ #: includes/wc-stripe-functions.php:1170
2531
  msgid "Please provide a billing phone number."
2532
  msgstr ""
2533
 
2534
+ #: includes/wc-stripe-functions.php:1171
2535
  msgid "Your payment could not be processed at this time because your bank account does not support instant verification."
2536
  msgstr ""
2537
 
includes/class-stripe.php CHANGED
@@ -26,7 +26,7 @@ class WC_Stripe_Manager {
26
  *
27
  * @var string
28
  */
29
- public $version = '3.3.32';
30
 
31
  /**
32
  *
26
  *
27
  * @var string
28
  */
29
+ public $version = '3.3.33';
30
 
31
  /**
32
  *
includes/class-wc-stripe-payment-intent.php CHANGED
@@ -285,7 +285,7 @@ class WC_Stripe_Payment_Intent extends WC_Stripe_Payment {
285
  // if there is a payment method attached already, then ensure the payment_method_type
286
  // associated with that attached payment_method is included.
287
  if ( $intent && ! empty( $intent->payment_method ) && \is_array( $intent->payment_method_types ) ) {
288
- $args['payment_method_types'] = array_unique( array_merge( $args['payment_method_types'], $intent->payment_method_types ) );
289
  }
290
 
291
  $this->payment_method->add_stripe_order_args( $args, $order );
285
  // if there is a payment method attached already, then ensure the payment_method_type
286
  // associated with that attached payment_method is included.
287
  if ( $intent && ! empty( $intent->payment_method ) && \is_array( $intent->payment_method_types ) ) {
288
+ $args['payment_method_types'] = array_values( array_unique( array_merge( $args['payment_method_types'], $intent->payment_method_types ) ) );
289
  }
290
 
291
  $this->payment_method->add_stripe_order_args( $args, $order );
includes/gateways/class-wc-payment-gateway-stripe-afterpay.php CHANGED
@@ -28,7 +28,8 @@ class WC_Payment_Gateway_Stripe_Afterpay extends WC_Payment_Gateway_Stripe_Local
28
  $this->method_description = __( 'Afterpay gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
29
  $this->icon = '';
30
  parent::__construct();
31
- $this->template_name = 'afterpay.php';
 
32
  }
33
 
34
  public function init_supports() {
@@ -402,6 +403,17 @@ class WC_Payment_Gateway_Stripe_Afterpay extends WC_Payment_Gateway_Stripe_Local
402
  return parent::get_title();
403
  }
404
 
 
 
 
 
 
 
 
 
 
 
 
405
  protected function get_payment_description() {
406
  $desc = '<p>' . __( 'Stripe accounts in the following countries can accept Afterpay payments with local currency settlement', 'woo-stripe-payment' ) . ': ' . implode( ',', $this->countries ) . '</p>';
407
  if ( ( $country = stripe_wc()->account_settings->get_account_country( wc_stripe_mode() ) ) ) {
28
  $this->method_description = __( 'Afterpay gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
29
  $this->icon = '';
30
  parent::__construct();
31
+ $this->title = __( 'Afterpay', 'woo-stripe-payment' );
32
+ $this->template_name = 'afterpay.php';
33
  }
34
 
35
  public function init_supports() {
403
  return parent::get_title();
404
  }
405
 
406
+ public function get_payment_token( $method_id, $method_details = array() ) {
407
+ /**
408
+ *
409
+ * @var WC_Payment_Token_Stripe_Local $token
410
+ */
411
+ $token = parent::get_payment_token( $method_id, $method_details );
412
+ $token->set_gateway_title( __( 'Afterpay', 'woo-stripe-payment' ) );
413
+
414
+ return $token;
415
+ }
416
+
417
  protected function get_payment_description() {
418
  $desc = '<p>' . __( 'Stripe accounts in the following countries can accept Afterpay payments with local currency settlement', 'woo-stripe-payment' ) . ': ' . implode( ',', $this->countries ) . '</p>';
419
  if ( ( $country = stripe_wc()->account_settings->get_account_country( wc_stripe_mode() ) ) ) {
includes/gateways/class-wc-payment-gateway-stripe-cc.php CHANGED
@@ -319,23 +319,13 @@ class WC_Payment_Gateway_Stripe_CC extends WC_Payment_Gateway_Stripe {
319
  $key = wc_stripe_get_publishable_key( 'live' );
320
  if ( ! $key ) {
321
  $value = 'inline';
322
- WC_Admin_Settings::add_error( __( 'The Payment Element card form design is only available to connected accounts at this time because it\'s a Stripe beta feature. To use the Payment Element in test mode, use the connect option on the API Settings page.', 'woo-stripe-payment' ) );
323
  }
324
  }
325
 
326
  return $value;
327
  }
328
 
329
- public function get_form_fields() {
330
- $fields = parent::get_form_fields();
331
- if ( wc_stripe_test_mode() ) {
332
- // until server side updates for the payment element are released fully, show a notice
333
- $fields['form_type']['options']['payment'] = __( 'Stripe payment form (beta feature)', 'woo-stripe-payment' );
334
- }
335
-
336
- return $fields;
337
- }
338
-
339
  public function is_deferred_intent_creation() {
340
  return $this->is_payment_element_active();
341
  }
319
  $key = wc_stripe_get_publishable_key( 'live' );
320
  if ( ! $key ) {
321
  $value = 'inline';
322
+ WC_Admin_Settings::add_error( __( 'The Stripe Payment form is only available to connected accounts at this time. To use the Stripe Payment form in test mode, use the connect option on the API Settings page.', 'woo-stripe-payment' ) );
323
  }
324
  }
325
 
326
  return $value;
327
  }
328
 
 
 
 
 
 
 
 
 
 
 
329
  public function is_deferred_intent_creation() {
330
  return $this->is_payment_element_active();
331
  }
includes/wc-stripe-functions.php CHANGED
@@ -952,13 +952,6 @@ function wc_stripe_get_order_from_transaction( $transaction_id ) {
952
  'limit' => 1,
953
  'return' => 'ids',
954
  'transaction_id' => $transaction_id
955
- /*'field_query' => [
956
- [
957
- 'field' => 'transaction_id',
958
- 'value' => $transaction_id,
959
- 'compare' => '='
960
- ]
961
- ]*/
962
  ] );
963
  $order_id = ! empty( $order_ids ) ? $order_ids[0] : null;
964
  } else {
952
  'limit' => 1,
953
  'return' => 'ids',
954
  'transaction_id' => $transaction_id
 
 
 
 
 
 
 
955
  ] );
956
  $order_id = ! empty( $order_ids ) ? $order_ids[0] : null;
957
  } else {
packages/blocks/src/Assets/Api.php CHANGED
@@ -87,7 +87,7 @@ class Api {
87
  }
88
 
89
  public function register_external_script( $handle, $src, $deps, $version, $footer = true ) {
90
- wp_enqueue_script( $handle, $src, $deps, $version, $footer );
91
  }
92
 
93
  public function enqueue_style() {
87
  }
88
 
89
  public function register_external_script( $handle, $src, $deps, $version, $footer = true ) {
90
+ wp_register_script( $handle, $src, $deps, $version, $footer );
91
  }
92
 
93
  public function enqueue_style() {
packages/woofunnels/assets/js/upsell/index.js CHANGED
@@ -5,18 +5,21 @@ let stripe;
5
 
6
  let data = {};
7
 
 
 
 
 
 
 
 
8
  const initialize = () => {
9
  $(document).on('wfocu_external', onHandleSubmit);
10
  window.addEventListener('hashchange', handleHashChange);
11
  wfocuCommons.addFilter('wfocu_front_charge_data', addChargeData);
12
- loadStripe(getData('publishableKey', (() => {
13
- if (getData('account')) {
14
- return {stripeAccount: getData('account')};
15
- }
16
- return {};
17
- })())).then((client) => {
18
  stripe = client;
19
  }).catch(error => {
 
20
  });
21
  }
22
 
5
 
6
  let data = {};
7
 
8
+ const getStripeParams = () => {
9
+ if (getData('account')) {
10
+ return {stripeAccount: getData('account')};
11
+ }
12
+ return {};
13
+ }
14
+
15
  const initialize = () => {
16
  $(document).on('wfocu_external', onHandleSubmit);
17
  window.addEventListener('hashchange', handleHashChange);
18
  wfocuCommons.addFilter('wfocu_front_charge_data', addChargeData);
19
+ loadStripe(getData('publishableKey'), getStripeParams()).then((client) => {
 
 
 
 
 
20
  stripe = client;
21
  }).catch(error => {
22
+ console.log(error);
23
  });
24
  }
25
 
packages/woofunnels/build/wc-stripe-woofunnels-upsell.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('jquery'), 'version' => '0f49a88ebd0f1c23f9e5f79950967f4b');
1
+ <?php return array('dependencies' => array('jquery'), 'version' => '1dbb6690cc9e41d1dc7393206daa212c');
packages/woofunnels/build/wc-stripe-woofunnels-upsell.js CHANGED
@@ -1,2 +1,2 @@
1
- (()=>{var e,t,n,r,o,i,a,c,u,l,s,d={318:e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}}},465:(e,t,n)=>{"use strict";n.r(t),n.d(t,{loadStripe:()=>s});var r="https://js.stripe.com/v3",o=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,i="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",a=null,c=function(e,t,n){if(null===e)return null;var r=e.apply(void 0,t);return function(e,t){e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",version:"1.42.1",startTime:t})}(r,n),r},u=Promise.resolve().then((function(){return e=null,null!==a||(a=new Promise((function(t,n){if("undefined"!=typeof window)if(window.Stripe&&e&&console.warn(i),window.Stripe)t(window.Stripe);else try{var a=function(){for(var e=document.querySelectorAll('script[src^="'.concat(r,'"]')),t=0;t<e.length;t++){var n=e[t];if(o.test(n.src))return n}return null}();a&&e?console.warn(i):a||(a=function(e){var t=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",n=document.createElement("script");n.src="".concat(r).concat(t);var o=document.head||document.body;if(!o)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return o.appendChild(n),n}(e)),a.addEventListener("load",(function(){window.Stripe?t(window.Stripe):n(new Error("Stripe.js not available"))})),a.addEventListener("error",(function(){n(new Error("Failed to load Stripe.js"))}))}catch(e){return void n(e)}else t(null)}))),a;var e})),l=!1;u.catch((function(e){l||console.warn(e)}));var s=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];l=!0;var r=Date.now();return u.then((function(e){return c(e,t,r)}))}},567:e=>{"use strict";e.exports=window.jQuery}},p={};function f(e){var t=p[e];if(void 0!==t)return t.exports;var n=p[e]={exports:{}};return d[e](n,n.exports,f),n.exports}f.d=(e,t)=>{for(var n in t)f.o(t,n)&&!f.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},f.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),f.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t=f(318),n=f(465),r=t(f(567)),o={},i=function(e,t){l("bucket",t)},a=function(t){var n=t.newURL.match(/response=(.*)/);if(n){var r,o,i=JSON.parse(window.atob(decodeURIComponent(n[1])));null===(r=u("bucket"))||void 0===r||null===(o=r.swal)||void 0===o||o.hide(),l("paymentIntent",i.payment_intent),history.pushState({},"",window.location.pathname+window.location.search),e.confirmCardPayment(i.client_secret).then((function(e){e.error?s():(l("paymentComplete",!0),u("bucket").sendBucket())})).catch((function(e){console.log(e)}))}},c=function(e){return e._payment_intent=u("paymentIntent"),e},u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return o.hasOwnProperty(e)||(o[e]=t),o[e]},l=function(e,t){o[e]=t},s=function(){u("bucket").inOfferTransaction=!1,u("bucket").EnableButtonState(),u("bucket").HasEventRunning=!1},(0,r.default)(document).on("wfocuBucketCreated",(function(t,s){var d,p;o=null===(d=window)||void 0===d||null===(p=d.wfocu_vars)||void 0===p?void 0:p.stripeData,l("bucket",s),(0,r.default)(document).on("wfocu_external",i),window.addEventListener("hashchange",a),wfocuCommons.addFilter("wfocu_front_charge_data",c),(0,n.loadStripe)(u("publishableKey",u("account")?{stripeAccount:u("account")}:{})).then((function(t){e=t})).catch((function(e){}))})),(this.wc_stripe=this.wc_stripe||{})["wc-stripe-woofunnels-upsell"]={}})();
2
  //# sourceMappingURL=wc-stripe-woofunnels-upsell.js.map
1
+ (()=>{var e,t,n,r,o,i,a,c,u,l,s,d,p={318:e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}}},465:(e,t,n)=>{"use strict";n.r(t),n.d(t,{loadStripe:()=>s});var r="https://js.stripe.com/v3",o=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,i="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",a=null,c=function(e,t,n){if(null===e)return null;var r=e.apply(void 0,t);return function(e,t){e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",version:"1.42.1",startTime:t})}(r,n),r},u=Promise.resolve().then((function(){return e=null,null!==a||(a=new Promise((function(t,n){if("undefined"!=typeof window)if(window.Stripe&&e&&console.warn(i),window.Stripe)t(window.Stripe);else try{var a=function(){for(var e=document.querySelectorAll('script[src^="'.concat(r,'"]')),t=0;t<e.length;t++){var n=e[t];if(o.test(n.src))return n}return null}();a&&e?console.warn(i):a||(a=function(e){var t=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",n=document.createElement("script");n.src="".concat(r).concat(t);var o=document.head||document.body;if(!o)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return o.appendChild(n),n}(e)),a.addEventListener("load",(function(){window.Stripe?t(window.Stripe):n(new Error("Stripe.js not available"))})),a.addEventListener("error",(function(){n(new Error("Failed to load Stripe.js"))}))}catch(e){return void n(e)}else t(null)}))),a;var e})),l=!1;u.catch((function(e){l||console.warn(e)}));var s=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];l=!0;var r=Date.now();return u.then((function(e){return c(e,t,r)}))}},567:e=>{"use strict";e.exports=window.jQuery}},f={};function w(e){var t=f[e];if(void 0!==t)return t.exports;var n=f[e]={exports:{}};return p[e](n,n.exports,w),n.exports}w.d=(e,t)=>{for(var n in t)w.o(t,n)&&!w.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},w.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),w.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t=w(318),n=w(465),r=t(w(567)),o={},i=function(){(0,r.default)(document).on("wfocu_external",a),window.addEventListener("hashchange",c),wfocuCommons.addFilter("wfocu_front_charge_data",u),(0,n.loadStripe)(l("publishableKey"),l("account")?{stripeAccount:l("account")}:{}).then((function(t){e=t})).catch((function(e){console.log(e)}))},a=function(e,t){s("bucket",t)},c=function(t){var n=t.newURL.match(/response=(.*)/);if(n){var r,o,i=JSON.parse(window.atob(decodeURIComponent(n[1])));null===(r=l("bucket"))||void 0===r||null===(o=r.swal)||void 0===o||o.hide(),s("paymentIntent",i.payment_intent),history.pushState({},"",window.location.pathname+window.location.search),e.confirmCardPayment(i.client_secret).then((function(e){e.error?d():(s("paymentComplete",!0),l("bucket").sendBucket())})).catch((function(e){console.log(e)}))}},u=function(e){return e._payment_intent=l("paymentIntent"),e},l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return o.hasOwnProperty(e)||(o[e]=t),o[e]},s=function(e,t){o[e]=t},d=function(){l("bucket").inOfferTransaction=!1,l("bucket").EnableButtonState(),l("bucket").HasEventRunning=!1},(0,r.default)(document).on("wfocuBucketCreated",(function(e,t){var n,r;o=null===(n=window)||void 0===n||null===(r=n.wfocu_vars)||void 0===r?void 0:r.stripeData,s("bucket",t),i()})),(this.wc_stripe=this.wc_stripe||{})["wc-stripe-woofunnels-upsell"]={}})();
2
  //# sourceMappingURL=wc-stripe-woofunnels-upsell.js.map
packages/woofunnels/build/wc-stripe-woofunnels-upsell.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"wc-stripe-woofunnels-upsell.js","mappings":"UAGIA,E,EAHJ,EACA,EAIIC,EAuBEC,EAIAC,EAqBAC,EAKAC,EAOAC,EAIAC,E,WC/DNC,EAAOC,QANP,SAAgCC,GAC9B,OAAOA,GAAOA,EAAIC,WAAaD,EAAM,CACnC,QAAWA,K,4DCFf,IAAIE,EAAS,2BACTC,EAAe,4CACfC,EAA0B,mJA2C1BC,EAAgB,KAkDhBC,EAAa,SAAoBC,EAAaC,EAAMC,GACtD,GAAoB,OAAhBF,EACF,OAAO,KAGT,IAAIjB,EAASiB,EAAYG,WAAMC,EAAWH,GAE1C,OArEoB,SAAyBlB,EAAQmB,GAChDnB,GAAWA,EAAOsB,kBAIvBtB,EAAOsB,iBAAiB,CACtBC,KAAM,YACNC,QAAS,SACTL,UAAWA,IA4DbM,CAAgBzB,EAAQmB,GACjBnB,GAKL0B,EAAkBC,QAAQC,UAAUC,MAAK,WAC3C,OA9DmCC,EA8DjB,KA5DI,OAAlBf,IAIJA,EAAgB,IAAIY,SAAQ,SAAUC,EAASG,GAC7C,GAAsB,oBAAXC,OAWX,GAJIA,OAAOC,QAAUH,GACnBI,QAAQC,KAAKrB,GAGXkB,OAAOC,OACTL,EAAQI,OAAOC,aAIjB,IACE,IAAIG,EAnEO,WAGf,IAFA,IAAIC,EAAUC,SAASC,iBAAiB,gBAAiBC,OAAO5B,EAAQ,OAE/D6B,EAAI,EAAGA,EAAIJ,EAAQK,OAAQD,IAAK,CACvC,IAAIL,EAASC,EAAQI,GAErB,GAAK5B,EAAa8B,KAAKP,EAAOQ,KAI9B,OAAOR,EAGT,OAAO,KAsDUS,GAETT,GAAUN,EACZI,QAAQC,KAAKrB,GACHsB,IACVA,EAxDW,SAAsBN,GACvC,IAAIgB,EAAchB,IAAWA,EAAOiB,qBAAuB,8BAAgC,GACvFX,EAASE,SAASU,cAAc,UACpCZ,EAAOQ,IAAM,GAAGJ,OAAO5B,GAAQ4B,OAAOM,GACtC,IAAIG,EAAaX,SAASY,MAAQZ,SAASa,KAE3C,IAAKF,EACH,MAAM,IAAIG,MAAM,+EAIlB,OADAH,EAAWI,YAAYjB,GAChBA,EA6CQkB,CAAaxB,IAGxBM,EAAOmB,iBAAiB,QAAQ,WAC1BvB,OAAOC,OACTL,EAAQI,OAAOC,QAEfF,EAAO,IAAIqB,MAAM,+BAGrBhB,EAAOmB,iBAAiB,SAAS,WAC/BxB,EAAO,IAAIqB,MAAM,gCAEnB,MAAOI,GAEP,YADAzB,EAAOyB,QAjCP5B,EAAQ,UAPHb,EAHM,IAAoBe,KAgEjC2B,GAAa,EACjB/B,EAAuB,OAAE,SAAUgC,GAC5BD,GACHvB,QAAQC,KAAKuB,MAGjB,IAAIC,EAAa,WACf,IAAK,IAAIC,EAAOC,UAAUnB,OAAQxB,EAAO,IAAI4C,MAAMF,GAAOG,EAAO,EAAGA,EAAOH,EAAMG,IAC/E7C,EAAK6C,GAAQF,UAAUE,GAGzBN,GAAa,EACb,IAAItC,EAAY6C,KAAKC,MACrB,OAAOvC,EAAgBG,MAAK,SAAUZ,GACpC,OAAOD,EAAWC,EAAaC,EAAMC,Q,qBC5HzCX,EAAOC,QAAUuB,OAAe,SCC5BkC,EAA2B,GAG/B,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqB/C,IAAjBgD,EACH,OAAOA,EAAa5D,QAGrB,IAAID,EAAS0D,EAAyBE,GAAY,CAGjD3D,QAAS,IAOV,OAHA6D,EAAoBF,GAAU5D,EAAQA,EAAOC,QAAS0D,GAG/C3D,EAAOC,QCpBf0D,EAAoBI,EAAI,CAAC9D,EAAS+D,KACjC,IAAI,IAAIC,KAAOD,EACXL,EAAoBO,EAAEF,EAAYC,KAASN,EAAoBO,EAAEjE,EAASgE,IAC5EE,OAAOC,eAAenE,EAASgE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3EN,EAAoBO,EAAI,CAAChE,EAAKqE,IAAUJ,OAAOK,UAAUC,eAAeC,KAAKxE,EAAKqE,GCClFZ,EAAoBgB,EAAK1E,IACH,oBAAX2E,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAenE,EAAS2E,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAenE,EAAS,aAAc,CAAE6E,OAAO,K,SPLvD,SACA,YAIIrF,EAAO,GAuBLC,EAAiB,SAACqF,EAAGC,GACvBlF,EAAQ,SAAUkF,IAGhBrF,EAAmB,SAACoF,GACtB,IAAIE,EAAQF,EAAEG,OAAOD,MAAM,iBAC3B,GAAIA,EAAO,SACD/E,EAAMiF,KAAKC,MAAM5D,OAAO6D,KAAKC,mBAAmBL,EAAM,MAC3C,QAAjB,EAAApF,EAAQ,iBAAS,OAAM,QAAN,EAAjB,EAAmB0F,YAAI,OAAvB,EAAyBC,OACzB1F,EAAQ,gBAAiBI,EAAIuF,gBAC7BC,QAAQC,UAAU,GAAI,GAAInE,OAAOoE,SAASC,SAAWrE,OAAOoE,SAASE,QACrEtG,EAAOuG,mBAAmB7F,EAAI8F,eAAe3E,MAAK,SAAA4E,GAC1CA,EAASjD,MAETjD,KAEAD,EAAQ,mBAAmB,GAC3BD,EAAQ,UAAUqG,iBAEvBC,OAAM,SAAAnD,GACLtB,QAAQ0E,IAAIpD,QAKlBpD,EAAgB,SAACmF,GAEnB,OADAA,EAAmB,gBAAIlF,EAAQ,iBACxBkF,GAGLlF,EAAU,SAACoE,GAA6B,IAAxBoC,EAAe,UAAH,6CAAG,KAIjC,OAHK5G,EAAKgF,eAAeR,KACrBxE,EAAKwE,GAAOoC,GAET5G,EAAKwE,IAGVnE,EAAU,SAACmE,EAAKa,GAClBrF,EAAKwE,GAAOa,GAGV/E,EAAsB,WACxBF,EAAQ,UAAUyG,oBAAqB,EACvCzG,EAAQ,UAAU0G,oBAClB1G,EAAQ,UAAU2G,iBAAkB,IAGxC,EAAAC,EAAAA,SAAE3E,UAAU4E,GAAG,sBArDS,SAAC3B,EAAGC,GAAW,QACnCvF,EAAa,QAAT,EAAG+B,cAAM,OAAY,QAAZ,EAAN,EAAQmF,kBAAU,WAAZ,EAAN,EAAoBC,WAC3B9G,EAAQ,SAAUkF,IAhBlB,EAAAyB,EAAAA,SAAE3E,UAAU4E,GAAG,iBAAkBhH,GACjC8B,OAAOuB,iBAAiB,aAAcpD,GACtCkH,aAAaC,UAAU,0BAA2BlH,IAClD,EAAAuD,EAAAA,YAAWtD,EAAQ,iBACXA,EAAQ,WACD,CAACkH,cAAelH,EAAQ,YAE5B,KACJwB,MAAK,SAAC2F,GACTxH,EAASwH,KACVb,OAAM,SAAAnD,W","sources":["webpack://wc_stripe/./packages/woofunnels/assets/js/upsell/index.js","webpack://wc_stripe/./node_modules/@babel/runtime/helpers/interopRequireDefault.js","webpack://wc_stripe/./node_modules/@stripe/stripe-js/dist/stripe.esm.js","webpack://wc_stripe/external window \"jQuery\"","webpack://wc_stripe/webpack/bootstrap","webpack://wc_stripe/webpack/runtime/define property getters","webpack://wc_stripe/webpack/runtime/hasOwnProperty shorthand","webpack://wc_stripe/webpack/runtime/make namespace object"],"sourcesContent":["import {loadStripe} from '@stripe/stripe-js';\nimport $ from 'jquery';\n\nlet stripe;\n\nlet data = {};\n\nconst initialize = () => {\n $(document).on('wfocu_external', onHandleSubmit);\n window.addEventListener('hashchange', handleHashChange);\n wfocuCommons.addFilter('wfocu_front_charge_data', addChargeData);\n loadStripe(getData('publishableKey', (() => {\n if (getData('account')) {\n return {stripeAccount: getData('account')};\n }\n return {};\n })())).then((client) => {\n stripe = client;\n }).catch(error => {\n });\n}\n\nconst onBucketCreated = (e, bucket) => {\n data = window?.wfocu_vars?.stripeData;\n setData('bucket', bucket);\n initialize();\n}\n\nconst onHandleSubmit = (e, bucket) => {\n setData('bucket', bucket);\n}\n\nconst handleHashChange = (e) => {\n var match = e.newURL.match(/response=(.*)/);\n if (match) {\n const obj = JSON.parse(window.atob(decodeURIComponent(match[1])));\n getData('bucket')?.swal?.hide();\n setData('paymentIntent', obj.payment_intent);\n history.pushState({}, '', window.location.pathname + window.location.search);\n stripe.confirmCardPayment(obj.client_secret).then(response => {\n if (response.error) {\n // display message\n resetPaymentProcess();\n } else {\n setData('paymentComplete', true);\n getData('bucket').sendBucket();\n }\n }).catch(error => {\n console.log(error);\n });\n }\n}\n\nconst addChargeData = (e) => {\n e['_payment_intent'] = getData('paymentIntent');\n return e;\n}\n\nconst getData = (key, defaultValue = null) => {\n if (!data.hasOwnProperty(key)) {\n data[key] = defaultValue;\n }\n return data[key];\n}\n\nconst setData = (key, value) => {\n data[key] = value;\n}\n\nconst resetPaymentProcess = () => {\n getData('bucket').inOfferTransaction = false;\n getData('bucket').EnableButtonState();\n getData('bucket').HasEventRunning = false;\n}\n\n$(document).on('wfocuBucketCreated', onBucketCreated);","function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\n\nmodule.exports = _interopRequireDefault;","var V3_URL = 'https://js.stripe.com/v3';\nvar V3_URL_REGEX = /^https:\\/\\/js\\.stripe\\.com\\/v3\\/?(\\?.*)?$/;\nvar EXISTING_SCRIPT_MESSAGE = 'loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used';\nvar findScript = function findScript() {\n var scripts = document.querySelectorAll(\"script[src^=\\\"\".concat(V3_URL, \"\\\"]\"));\n\n for (var i = 0; i < scripts.length; i++) {\n var script = scripts[i];\n\n if (!V3_URL_REGEX.test(script.src)) {\n continue;\n }\n\n return script;\n }\n\n return null;\n};\n\nvar injectScript = function injectScript(params) {\n var queryString = params && !params.advancedFraudSignals ? '?advancedFraudSignals=false' : '';\n var script = document.createElement('script');\n script.src = \"\".concat(V3_URL).concat(queryString);\n var headOrBody = document.head || document.body;\n\n if (!headOrBody) {\n throw new Error('Expected document.body not to be null. Stripe.js requires a <body> element.');\n }\n\n headOrBody.appendChild(script);\n return script;\n};\n\nvar registerWrapper = function registerWrapper(stripe, startTime) {\n if (!stripe || !stripe._registerWrapper) {\n return;\n }\n\n stripe._registerWrapper({\n name: 'stripe-js',\n version: \"1.42.1\",\n startTime: startTime\n });\n};\n\nvar stripePromise = null;\nvar loadScript = function loadScript(params) {\n // Ensure that we only attempt to load Stripe.js at most once\n if (stripePromise !== null) {\n return stripePromise;\n }\n\n stripePromise = new Promise(function (resolve, reject) {\n if (typeof window === 'undefined') {\n // Resolve to null when imported server side. This makes the module\n // safe to import in an isomorphic code base.\n resolve(null);\n return;\n }\n\n if (window.Stripe && params) {\n console.warn(EXISTING_SCRIPT_MESSAGE);\n }\n\n if (window.Stripe) {\n resolve(window.Stripe);\n return;\n }\n\n try {\n var script = findScript();\n\n if (script && params) {\n console.warn(EXISTING_SCRIPT_MESSAGE);\n } else if (!script) {\n script = injectScript(params);\n }\n\n script.addEventListener('load', function () {\n if (window.Stripe) {\n resolve(window.Stripe);\n } else {\n reject(new Error('Stripe.js not available'));\n }\n });\n script.addEventListener('error', function () {\n reject(new Error('Failed to load Stripe.js'));\n });\n } catch (error) {\n reject(error);\n return;\n }\n });\n return stripePromise;\n};\nvar initStripe = function initStripe(maybeStripe, args, startTime) {\n if (maybeStripe === null) {\n return null;\n }\n\n var stripe = maybeStripe.apply(undefined, args);\n registerWrapper(stripe, startTime);\n return stripe;\n}; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\n// own script injection.\n\nvar stripePromise$1 = Promise.resolve().then(function () {\n return loadScript(null);\n});\nvar loadCalled = false;\nstripePromise$1[\"catch\"](function (err) {\n if (!loadCalled) {\n console.warn(err);\n }\n});\nvar loadStripe = function loadStripe() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n loadCalled = true;\n var startTime = Date.now();\n return stripePromise$1.then(function (maybeStripe) {\n return initStripe(maybeStripe, args, startTime);\n });\n};\n\nexport { loadStripe };\n","module.exports = window[\"jQuery\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};"],"names":["stripe","data","onHandleSubmit","handleHashChange","addChargeData","getData","setData","resetPaymentProcess","module","exports","obj","__esModule","V3_URL","V3_URL_REGEX","EXISTING_SCRIPT_MESSAGE","stripePromise","initStripe","maybeStripe","args","startTime","apply","undefined","_registerWrapper","name","version","registerWrapper","stripePromise$1","Promise","resolve","then","params","reject","window","Stripe","console","warn","script","scripts","document","querySelectorAll","concat","i","length","test","src","findScript","queryString","advancedFraudSignals","createElement","headOrBody","head","body","Error","appendChild","injectScript","addEventListener","error","loadCalled","err","loadStripe","_len","arguments","Array","_key","Date","now","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","d","definition","key","o","Object","defineProperty","enumerable","get","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","e","bucket","match","newURL","JSON","parse","atob","decodeURIComponent","swal","hide","payment_intent","history","pushState","location","pathname","search","confirmCardPayment","client_secret","response","sendBucket","catch","log","defaultValue","inOfferTransaction","EnableButtonState","HasEventRunning","$","on","wfocu_vars","stripeData","wfocuCommons","addFilter","stripeAccount","client"],"sourceRoot":""}
1
+ {"version":3,"file":"wc-stripe-woofunnels-upsell.js","mappings":"UAGIA,E,EAHJ,EACA,EAIIC,EASEC,EAiBAC,EAIAC,EAqBAC,EAKAC,EAOAC,EAIAC,E,WClENC,EAAOC,QANP,SAAgCC,GAC9B,OAAOA,GAAOA,EAAIC,WAAaD,EAAM,CACnC,QAAWA,K,4DCFf,IAAIE,EAAS,2BACTC,EAAe,4CACfC,EAA0B,mJA2C1BC,EAAgB,KAkDhBC,EAAa,SAAoBC,EAAaC,EAAMC,GACtD,GAAoB,OAAhBF,EACF,OAAO,KAGT,IAAIlB,EAASkB,EAAYG,WAAMC,EAAWH,GAE1C,OArEoB,SAAyBnB,EAAQoB,GAChDpB,GAAWA,EAAOuB,kBAIvBvB,EAAOuB,iBAAiB,CACtBC,KAAM,YACNC,QAAS,SACTL,UAAWA,IA4DbM,CAAgB1B,EAAQoB,GACjBpB,GAKL2B,EAAkBC,QAAQC,UAAUC,MAAK,WAC3C,OA9DmCC,EA8DjB,KA5DI,OAAlBf,IAIJA,EAAgB,IAAIY,SAAQ,SAAUC,EAASG,GAC7C,GAAsB,oBAAXC,OAWX,GAJIA,OAAOC,QAAUH,GACnBI,QAAQC,KAAKrB,GAGXkB,OAAOC,OACTL,EAAQI,OAAOC,aAIjB,IACE,IAAIG,EAnEO,WAGf,IAFA,IAAIC,EAAUC,SAASC,iBAAiB,gBAAiBC,OAAO5B,EAAQ,OAE/D6B,EAAI,EAAGA,EAAIJ,EAAQK,OAAQD,IAAK,CACvC,IAAIL,EAASC,EAAQI,GAErB,GAAK5B,EAAa8B,KAAKP,EAAOQ,KAI9B,OAAOR,EAGT,OAAO,KAsDUS,GAETT,GAAUN,EACZI,QAAQC,KAAKrB,GACHsB,IACVA,EAxDW,SAAsBN,GACvC,IAAIgB,EAAchB,IAAWA,EAAOiB,qBAAuB,8BAAgC,GACvFX,EAASE,SAASU,cAAc,UACpCZ,EAAOQ,IAAM,GAAGJ,OAAO5B,GAAQ4B,OAAOM,GACtC,IAAIG,EAAaX,SAASY,MAAQZ,SAASa,KAE3C,IAAKF,EACH,MAAM,IAAIG,MAAM,+EAIlB,OADAH,EAAWI,YAAYjB,GAChBA,EA6CQkB,CAAaxB,IAGxBM,EAAOmB,iBAAiB,QAAQ,WAC1BvB,OAAOC,OACTL,EAAQI,OAAOC,QAEfF,EAAO,IAAIqB,MAAM,+BAGrBhB,EAAOmB,iBAAiB,SAAS,WAC/BxB,EAAO,IAAIqB,MAAM,gCAEnB,MAAOI,GAEP,YADAzB,EAAOyB,QAjCP5B,EAAQ,UAPHb,EAHM,IAAoBe,KAgEjC2B,GAAa,EACjB/B,EAAuB,OAAE,SAAUgC,GAC5BD,GACHvB,QAAQC,KAAKuB,MAGjB,IAAIC,EAAa,WACf,IAAK,IAAIC,EAAOC,UAAUnB,OAAQxB,EAAO,IAAI4C,MAAMF,GAAOG,EAAO,EAAGA,EAAOH,EAAMG,IAC/E7C,EAAK6C,GAAQF,UAAUE,GAGzBN,GAAa,EACb,IAAItC,EAAY6C,KAAKC,MACrB,OAAOvC,EAAgBG,MAAK,SAAUZ,GACpC,OAAOD,EAAWC,EAAaC,EAAMC,Q,qBC5HzCX,EAAOC,QAAUuB,OAAe,SCC5BkC,EAA2B,GAG/B,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqB/C,IAAjBgD,EACH,OAAOA,EAAa5D,QAGrB,IAAID,EAAS0D,EAAyBE,GAAY,CAGjD3D,QAAS,IAOV,OAHA6D,EAAoBF,GAAU5D,EAAQA,EAAOC,QAAS0D,GAG/C3D,EAAOC,QCpBf0D,EAAoBI,EAAI,CAAC9D,EAAS+D,KACjC,IAAI,IAAIC,KAAOD,EACXL,EAAoBO,EAAEF,EAAYC,KAASN,EAAoBO,EAAEjE,EAASgE,IAC5EE,OAAOC,eAAenE,EAASgE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3EN,EAAoBO,EAAI,CAAChE,EAAKqE,IAAUJ,OAAOK,UAAUC,eAAeC,KAAKxE,EAAKqE,GCClFZ,EAAoBgB,EAAK1E,IACH,oBAAX2E,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAenE,EAAS2E,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAenE,EAAS,aAAc,CAAE6E,OAAO,K,SPLvD,SACA,YAIItF,EAAO,GASLC,EAAa,YACf,EAAAsF,EAAAA,SAAEjD,UAAUkD,GAAG,iBAAkBtF,GACjC8B,OAAOuB,iBAAiB,aAAcpD,GACtCsF,aAAaC,UAAU,0BAA2BtF,IAClD,EAAAuD,EAAAA,YAAWtD,EAAQ,kBAVfA,EAAQ,WACD,CAACsF,cAAetF,EAAQ,YAE5B,IAOkDwB,MAAK,SAAC+D,GAC3D7F,EAAS6F,KACVC,OAAM,SAAArC,GACLtB,QAAQ4D,IAAItC,OAUdtD,EAAiB,SAAC6F,EAAGC,GACvB1F,EAAQ,SAAU0F,IAGhB7F,EAAmB,SAAC4F,GACtB,IAAIE,EAAQF,EAAEG,OAAOD,MAAM,iBAC3B,GAAIA,EAAO,SACDvF,EAAMyF,KAAKC,MAAMpE,OAAOqE,KAAKC,mBAAmBL,EAAM,MAC3C,QAAjB,EAAA5F,EAAQ,iBAAS,OAAM,QAAN,EAAjB,EAAmBkG,YAAI,OAAvB,EAAyBC,OACzBlG,EAAQ,gBAAiBI,EAAI+F,gBAC7BC,QAAQC,UAAU,GAAI,GAAI3E,OAAO4E,SAASC,SAAW7E,OAAO4E,SAASE,QACrE/G,EAAOgH,mBAAmBrG,EAAIsG,eAAenF,MAAK,SAAAoF,GAC1CA,EAASzD,MAETjD,KAEAD,EAAQ,mBAAmB,GAC3BD,EAAQ,UAAU6G,iBAEvBrB,OAAM,SAAArC,GACLtB,QAAQ4D,IAAItC,QAKlBpD,EAAgB,SAAC2F,GAEnB,OADAA,EAAmB,gBAAI1F,EAAQ,iBACxB0F,GAGL1F,EAAU,SAACoE,GAA6B,IAAxB0C,EAAe,UAAH,6CAAG,KAIjC,OAHKnH,EAAKiF,eAAeR,KACrBzE,EAAKyE,GAAO0C,GAETnH,EAAKyE,IAGVnE,EAAU,SAACmE,EAAKa,GAClBtF,EAAKyE,GAAOa,GAGV/E,EAAsB,WACxBF,EAAQ,UAAU+G,oBAAqB,EACvC/G,EAAQ,UAAUgH,oBAClBhH,EAAQ,UAAUiH,iBAAkB,IAGxC,EAAA/B,EAAAA,SAAEjD,UAAUkD,GAAG,sBArDS,SAACO,EAAGC,GAAW,QACnChG,EAAa,QAAT,EAAGgC,cAAM,OAAY,QAAZ,EAAN,EAAQuF,kBAAU,WAAZ,EAAN,EAAoBC,WAC3BlH,EAAQ,SAAU0F,GAClB/F,Q","sources":["webpack://wc_stripe/./packages/woofunnels/assets/js/upsell/index.js","webpack://wc_stripe/./node_modules/@babel/runtime/helpers/interopRequireDefault.js","webpack://wc_stripe/./node_modules/@stripe/stripe-js/dist/stripe.esm.js","webpack://wc_stripe/external window \"jQuery\"","webpack://wc_stripe/webpack/bootstrap","webpack://wc_stripe/webpack/runtime/define property getters","webpack://wc_stripe/webpack/runtime/hasOwnProperty shorthand","webpack://wc_stripe/webpack/runtime/make namespace object"],"sourcesContent":["import {loadStripe} from '@stripe/stripe-js';\nimport $ from 'jquery';\n\nlet stripe;\n\nlet data = {};\n\nconst getStripeParams = () => {\n if (getData('account')) {\n return {stripeAccount: getData('account')};\n }\n return {};\n}\n\nconst initialize = () => {\n $(document).on('wfocu_external', onHandleSubmit);\n window.addEventListener('hashchange', handleHashChange);\n wfocuCommons.addFilter('wfocu_front_charge_data', addChargeData);\n loadStripe(getData('publishableKey'), getStripeParams()).then((client) => {\n stripe = client;\n }).catch(error => {\n console.log(error);\n });\n}\n\nconst onBucketCreated = (e, bucket) => {\n data = window?.wfocu_vars?.stripeData;\n setData('bucket', bucket);\n initialize();\n}\n\nconst onHandleSubmit = (e, bucket) => {\n setData('bucket', bucket);\n}\n\nconst handleHashChange = (e) => {\n var match = e.newURL.match(/response=(.*)/);\n if (match) {\n const obj = JSON.parse(window.atob(decodeURIComponent(match[1])));\n getData('bucket')?.swal?.hide();\n setData('paymentIntent', obj.payment_intent);\n history.pushState({}, '', window.location.pathname + window.location.search);\n stripe.confirmCardPayment(obj.client_secret).then(response => {\n if (response.error) {\n // display message\n resetPaymentProcess();\n } else {\n setData('paymentComplete', true);\n getData('bucket').sendBucket();\n }\n }).catch(error => {\n console.log(error);\n });\n }\n}\n\nconst addChargeData = (e) => {\n e['_payment_intent'] = getData('paymentIntent');\n return e;\n}\n\nconst getData = (key, defaultValue = null) => {\n if (!data.hasOwnProperty(key)) {\n data[key] = defaultValue;\n }\n return data[key];\n}\n\nconst setData = (key, value) => {\n data[key] = value;\n}\n\nconst resetPaymentProcess = () => {\n getData('bucket').inOfferTransaction = false;\n getData('bucket').EnableButtonState();\n getData('bucket').HasEventRunning = false;\n}\n\n$(document).on('wfocuBucketCreated', onBucketCreated);","function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\n\nmodule.exports = _interopRequireDefault;","var V3_URL = 'https://js.stripe.com/v3';\nvar V3_URL_REGEX = /^https:\\/\\/js\\.stripe\\.com\\/v3\\/?(\\?.*)?$/;\nvar EXISTING_SCRIPT_MESSAGE = 'loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used';\nvar findScript = function findScript() {\n var scripts = document.querySelectorAll(\"script[src^=\\\"\".concat(V3_URL, \"\\\"]\"));\n\n for (var i = 0; i < scripts.length; i++) {\n var script = scripts[i];\n\n if (!V3_URL_REGEX.test(script.src)) {\n continue;\n }\n\n return script;\n }\n\n return null;\n};\n\nvar injectScript = function injectScript(params) {\n var queryString = params && !params.advancedFraudSignals ? '?advancedFraudSignals=false' : '';\n var script = document.createElement('script');\n script.src = \"\".concat(V3_URL).concat(queryString);\n var headOrBody = document.head || document.body;\n\n if (!headOrBody) {\n throw new Error('Expected document.body not to be null. Stripe.js requires a <body> element.');\n }\n\n headOrBody.appendChild(script);\n return script;\n};\n\nvar registerWrapper = function registerWrapper(stripe, startTime) {\n if (!stripe || !stripe._registerWrapper) {\n return;\n }\n\n stripe._registerWrapper({\n name: 'stripe-js',\n version: \"1.42.1\",\n startTime: startTime\n });\n};\n\nvar stripePromise = null;\nvar loadScript = function loadScript(params) {\n // Ensure that we only attempt to load Stripe.js at most once\n if (stripePromise !== null) {\n return stripePromise;\n }\n\n stripePromise = new Promise(function (resolve, reject) {\n if (typeof window === 'undefined') {\n // Resolve to null when imported server side. This makes the module\n // safe to import in an isomorphic code base.\n resolve(null);\n return;\n }\n\n if (window.Stripe && params) {\n console.warn(EXISTING_SCRIPT_MESSAGE);\n }\n\n if (window.Stripe) {\n resolve(window.Stripe);\n return;\n }\n\n try {\n var script = findScript();\n\n if (script && params) {\n console.warn(EXISTING_SCRIPT_MESSAGE);\n } else if (!script) {\n script = injectScript(params);\n }\n\n script.addEventListener('load', function () {\n if (window.Stripe) {\n resolve(window.Stripe);\n } else {\n reject(new Error('Stripe.js not available'));\n }\n });\n script.addEventListener('error', function () {\n reject(new Error('Failed to load Stripe.js'));\n });\n } catch (error) {\n reject(error);\n return;\n }\n });\n return stripePromise;\n};\nvar initStripe = function initStripe(maybeStripe, args, startTime) {\n if (maybeStripe === null) {\n return null;\n }\n\n var stripe = maybeStripe.apply(undefined, args);\n registerWrapper(stripe, startTime);\n return stripe;\n}; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\n// own script injection.\n\nvar stripePromise$1 = Promise.resolve().then(function () {\n return loadScript(null);\n});\nvar loadCalled = false;\nstripePromise$1[\"catch\"](function (err) {\n if (!loadCalled) {\n console.warn(err);\n }\n});\nvar loadStripe = function loadStripe() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n loadCalled = true;\n var startTime = Date.now();\n return stripePromise$1.then(function (maybeStripe) {\n return initStripe(maybeStripe, args, startTime);\n });\n};\n\nexport { loadStripe };\n","module.exports = window[\"jQuery\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};"],"names":["stripe","data","initialize","onHandleSubmit","handleHashChange","addChargeData","getData","setData","resetPaymentProcess","module","exports","obj","__esModule","V3_URL","V3_URL_REGEX","EXISTING_SCRIPT_MESSAGE","stripePromise","initStripe","maybeStripe","args","startTime","apply","undefined","_registerWrapper","name","version","registerWrapper","stripePromise$1","Promise","resolve","then","params","reject","window","Stripe","console","warn","script","scripts","document","querySelectorAll","concat","i","length","test","src","findScript","queryString","advancedFraudSignals","createElement","headOrBody","head","body","Error","appendChild","injectScript","addEventListener","error","loadCalled","err","loadStripe","_len","arguments","Array","_key","Date","now","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","d","definition","key","o","Object","defineProperty","enumerable","get","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","$","on","wfocuCommons","addFilter","stripeAccount","client","catch","log","e","bucket","match","newURL","JSON","parse","atob","decodeURIComponent","swal","hide","payment_intent","history","pushState","location","pathname","search","confirmCardPayment","client_secret","response","sendBucket","defaultValue","inOfferTransaction","EnableButtonState","HasEventRunning","wfocu_vars","stripeData"],"sourceRoot":""}
packages/woofunnels/src/Upsell/LinkIntegration.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace PaymentPlugins\WooFunnels\Stripe\Upsell;
4
+
5
+ class LinkIntegration {
6
+
7
+ public function __construct() {
8
+ add_filter( 'wc_stripe_funnelkit_upsell_create_payment_intent', [ $this, 'add_payment_intent_params' ], 10, 3 );
9
+ }
10
+
11
+ /**
12
+ * @param array $params
13
+ * @param \WC_Order $order
14
+ * @param \WC_Stripe_Gateway $client
15
+ *
16
+ * @return void
17
+ */
18
+ public function add_payment_intent_params( $params, $order, $client ) {
19
+ if ( $order->get_payment_method() === 'stripe_cc' ) {
20
+ if ( \PaymentPlugins\Stripe\Link\LinkIntegration::instance()->is_active() ) {
21
+ $payment_intent = $client->mode( $order )->paymentIntents->retrieve( $order->get_meta( \WC_Stripe_Constants::PAYMENT_INTENT_ID ) );
22
+ if ( ! is_wp_error( $payment_intent ) ) {
23
+ $params['payment_method_types'] = array_values( array_unique( array_merge( $params['payment_method_types'], $payment_intent->payment_method_types ) ) );
24
+ }
25
+ }
26
+ }
27
+
28
+ return $params;
29
+ }
30
+
31
+ }
packages/woofunnels/src/Upsell/PaymentGateways.php CHANGED
@@ -12,6 +12,7 @@ class PaymentGateways {
12
 
13
  public function __construct( AssetsApi $assets ) {
14
  $this->assets = $assets;
 
15
  $this->initialize();
16
  }
17
 
12
 
13
  public function __construct( AssetsApi $assets ) {
14
  $this->assets = $assets;
15
+ new LinkIntegration();
16
  $this->initialize();
17
  }
18
 
packages/woofunnels/src/Upsell/PaymentGateways/BasePaymentGateway.php CHANGED
@@ -176,7 +176,9 @@ class BasePaymentGateway extends \WFOCU_Gateway {
176
  $this->payment->add_order_currency( $params, $order );
177
  $this->payment->add_order_shipping_address( $params, $order );
178
 
179
- $result = $this->client->paymentIntents->mode( wc_stripe_order_mode( $order ) )->create( $params );
 
 
180
  if ( is_wp_error( $result ) ) {
181
  throw new \Exception( $result->get_error_message(), 400 );
182
  }
176
  $this->payment->add_order_currency( $params, $order );
177
  $this->payment->add_order_shipping_address( $params, $order );
178
 
179
+ $params = apply_filters( 'wc_stripe_funnelkit_upsell_create_payment_intent', $params, $order, $this->client );
180
+
181
+ $result = $this->client->mode( $order )->paymentIntents->create( $params );
182
  if ( is_wp_error( $result ) ) {
183
  throw new \Exception( $result->get_error_message(), 400 );
184
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: stripe, ach, klarna, credit card, apple pay, google pay, ideal, sepa, sofo
4
  Requires at least: 3.0.1
5
  Tested up to: 6.1
6
  Requires PHP: 5.6
7
- Stable tag: 3.3.32
8
  Copyright: Payment Plugins
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -62,6 +62,10 @@ If you're site is not loading over https, then Stripe won't render the Payment R
62
  9. Stripe Link for high conversion
63
 
64
  == Changelog ==
 
 
 
 
65
  = 3.3.32 - 11/11/22 =
66
  * Updated - Improved Payment form (beta) performance
67
  * Updated - Improved Link integration
4
  Requires at least: 3.0.1
5
  Tested up to: 6.1
6
  Requires PHP: 5.6
7
+ Stable tag: 3.3.33
8
  Copyright: Payment Plugins
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
62
  9. Stripe Link for high conversion
63
 
64
  == Changelog ==
65
+ = 3.3.33 - 11/23/22 =
66
+ * Fixed - Afterpay payment method title not showing in order received emails and on order details page
67
+ * Updated - Removed "beta" from Payment form label in settings
68
+ * Added - Link support for FunnelKit/WooFunnels Upsells
69
  = 3.3.32 - 11/11/22 =
70
  * Updated - Improved Payment form (beta) performance
71
  * Updated - Improved Link integration
stripe-payments.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Payment Plugins for Stripe WooCommerce
5
  * Plugin URI: https://docs.paymentplugins.com/wc-stripe/config/
6
  * Description: Accept Credit Cards, Google Pay, Apple Pay, ACH, Klarna and more using Stripe.
7
- * Version: 3.3.32
8
  * Author: Payment Plugins, support@paymentplugins.com
9
  * Text Domain: woo-stripe-payment
10
  * Domain Path: /i18n/languages/
4
  * Plugin Name: Payment Plugins for Stripe WooCommerce
5
  * Plugin URI: https://docs.paymentplugins.com/wc-stripe/config/
6
  * Description: Accept Credit Cards, Google Pay, Apple Pay, ACH, Klarna and more using Stripe.
7
+ * Version: 3.3.33
8
  * Author: Payment Plugins, support@paymentplugins.com
9
  * Text Domain: woo-stripe-payment
10
  * Domain Path: /i18n/languages/
vendor/composer/installed.php CHANGED
@@ -3,7 +3,7 @@
3
  'name' => '__root__',
4
  'pretty_version' => 'dev-master',
5
  'version' => 'dev-master',
6
- 'reference' => 'bf0e10a1f19cbbf12b334266c26cb22af1ef6fe7',
7
  'type' => 'library',
8
  'install_path' => __DIR__ . '/../../',
9
  'aliases' => array(),
@@ -13,7 +13,7 @@
13
  '__root__' => array(
14
  'pretty_version' => 'dev-master',
15
  'version' => 'dev-master',
16
- 'reference' => 'bf0e10a1f19cbbf12b334266c26cb22af1ef6fe7',
17
  'type' => 'library',
18
  'install_path' => __DIR__ . '/../../',
19
  'aliases' => array(),
3
  'name' => '__root__',
4
  'pretty_version' => 'dev-master',
5
  'version' => 'dev-master',
6
+ 'reference' => '536269ae95c3361adadde05a3fab5c1452d13d81',
7
  'type' => 'library',
8
  'install_path' => __DIR__ . '/../../',
9
  'aliases' => array(),
13
  '__root__' => array(
14
  'pretty_version' => 'dev-master',
15
  'version' => 'dev-master',
16
+ 'reference' => '536269ae95c3361adadde05a3fab5c1452d13d81',
17
  'type' => 'library',
18
  'install_path' => __DIR__ . '/../../',
19
  'aliases' => array(),