Version Description
- Added - Refund webhook support so refunds created in Stripe dashboard sync with WooCommerce store
- Added - Option to control when local payment methods are visible on checkout page based on billing country
- Added - wc_stripe_refund_args filter
- Added - Support for SEPA subscription amount changes
- Added - SEPA to subscription customer change payment method page
- Added - Filter so frontend error html can be customized
- Added - Authorize option for Klarna payments so they can be authorized or captured
- Added - Handle SCA for subscriptions with free trial
- Fixed - Sorting of Apple Pay payment methods in Apple Wallet
- Updated - GPay gateway converted to payment intents for SCA.
- Updated - Credit card form moved Saved Card label to right of checkbox
Download this release
Release Info
Developer | mr.clayton |
Plugin | Payment Plugins for Stripe WooCommerce |
Version | 3.2.10 |
Comparing to | |
See all releases |
Code changes from version 3.2.9 to 3.2.10
- assets/css/stripe-rtl.css +9 -14
- assets/css/stripe.css +9 -14
- assets/css/stripe.min-rtl.css +1 -1
- assets/css/stripe.min.css +1 -1
- assets/js/admin/admin-settings.js +34 -27
- assets/js/frontend/cc-forms.js +1 -1
- assets/js/frontend/credit-card.js +17 -143
- assets/js/frontend/form-handler.js +1 -1
- assets/js/frontend/googlepay-cart.js +7 -6
- assets/js/frontend/googlepay-checkout.js +2 -0
- assets/js/frontend/googlepay-product.js +1 -0
- assets/js/frontend/local-payment.js +9 -5
- assets/js/frontend/local-payment.min.js +1 -1
- assets/js/frontend/payment-request.js +8 -3
- assets/js/frontend/wc-stripe.js +173 -23
- assets/js/frontend/wc-stripe.min.js +1 -1
- i18n/languages/woo-stripe-payment.pot +198 -153
- includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php +102 -20
- includes/abstract/abstract-wc-payment-gateway-stripe.php +23 -3
- includes/abstract/abstract-wc-stripe-payment.php +304 -296
- includes/admin/settings/class-wc-stripe-api-settings.php +66 -15
- includes/admin/views/html-multi-select-countries.php +34 -0
- includes/class-stripe.php +1 -1
- includes/class-wc-stripe-field-manager.php +3 -0
- includes/class-wc-stripe-frontend-scripts.php +6 -24
- includes/class-wc-stripe-gateway-conversions.php +3 -2
- includes/class-wc-stripe-payment-charge-local.php +11 -6
- includes/controllers/class-wc-stripe-controller-checkout.php +2 -1
- includes/controllers/class-wc-stripe-controller-gateway-settings.php +20 -3
- includes/controllers/class-wc-stripe-controller-payment-intent.php +91 -91
- includes/gateways/class-wc-payment-gateway-stripe-ach.php +1 -0
- includes/gateways/class-wc-payment-gateway-stripe-alipay.php +5 -0
- includes/gateways/class-wc-payment-gateway-stripe-fpx.php +1 -1
- includes/gateways/class-wc-payment-gateway-stripe-googlepay.php +3 -1
- includes/gateways/class-wc-payment-gateway-stripe-grabpay.php +1 -1
- includes/gateways/class-wc-payment-gateway-stripe-klarna.php +14 -1
- includes/gateways/class-wc-payment-gateway-stripe-sepa.php +9 -2
- includes/gateways/class-wc-payment-gateway-stripe-sofort.php +1 -1
- includes/gateways/class-wc-payment-gateway-stripe-wechat.php +5 -0
- includes/gateways/settings/cc-settings.php +137 -148
- includes/gateways/settings/googlepay-settings.php +148 -148
- includes/tokens/class-wc-payment-token-stripe-googlepay.php +27 -31
- includes/traits/wc-stripe-payment-traits.php +123 -122
- includes/traits/wc-stripe-settings-trait.php +28 -0
- includes/wc-stripe-functions.php +18 -0
- includes/wc-stripe-hooks.php +30 -29
- includes/wc-stripe-webhook-functions.php +218 -164
- readme.txt +13 -1
- stripe-payments.php +1 -1
- templates/cc-forms/bootstrap.php +2 -2
- templates/checkout/credit-card.php +18 -19
assets/css/stripe-rtl.css
CHANGED
@@ -208,9 +208,16 @@ label.wc-stripe-label-payment-type:after {
|
|
208 |
margin-bottom: 1em;
|
209 |
}
|
210 |
|
|
|
|
|
|
|
|
|
|
|
|
|
211 |
.wc-stripe_cc-container .wc-stripe-save-source .save-source-label {
|
212 |
display: block;
|
213 |
-
|
|
|
214 |
}
|
215 |
|
216 |
.wc-stripe_cc-container .wc-stripe-save-source input[type="checkbox"] {
|
@@ -694,11 +701,6 @@ ul.payment_methods li[class*=payment_method_stripe_] .wc-stripe_cc-new-method-co
|
|
694 |
margin: 0px;
|
695 |
}
|
696 |
|
697 |
-
.wc-stripe_cc-container .wc-stripe-save-source .save-source-label {
|
698 |
-
padding: 0;
|
699 |
-
margin-bottom: 5px;
|
700 |
-
}
|
701 |
-
|
702 |
div[id*=wc_stripe_local_payment_stripe_].StripeElement {
|
703 |
border: 1px solid #eee;
|
704 |
border-radius: 4px;
|
@@ -729,14 +731,8 @@ div[id*=wc_stripe_local_payment_stripe_].StripeElement {
|
|
729 |
margin: 0;
|
730 |
}
|
731 |
|
732 |
-
div.payment_method_stripe_cc,
|
733 |
-
div.payment_method_stripe_sepa,
|
734 |
-
div.payment_method_stripe_ideal,
|
735 |
-
div.payment_method_stripe_fpx,
|
736 |
#wc_stripe_local_payment_stripe_klarna,
|
737 |
-
li[class*=payment_method_stripe_] div.wc-
|
738 |
-
li[class*=payment_method_stripe_] div.wc-stripe_applepay-container.has_tokens,
|
739 |
-
li[class*=payment_method_stripe_] div.wc-stripe_payment_request-container.has_tokens {
|
740 |
margin-top: 10px;
|
741 |
}
|
742 |
|
@@ -869,4 +865,3 @@ li.payment_method_stripe_sofort.wc-stripe-no-desc .payment_box.wc-stripe-no-meth
|
|
869 |
margin: 0;
|
870 |
}
|
871 |
|
872 |
-
|
208 |
margin-bottom: 1em;
|
209 |
}
|
210 |
|
211 |
+
.wc-stripe_cc-new-method-container .wc-stripe-save-source{
|
212 |
+
display: flex;
|
213 |
+
align-items: center;
|
214 |
+
justify-content: flex-start;
|
215 |
+
}
|
216 |
+
|
217 |
.wc-stripe_cc-container .wc-stripe-save-source .save-source-label {
|
218 |
display: block;
|
219 |
+
padding: 0;
|
220 |
+
margin: 0 5px 0px 0;
|
221 |
}
|
222 |
|
223 |
.wc-stripe_cc-container .wc-stripe-save-source input[type="checkbox"] {
|
701 |
margin: 0px;
|
702 |
}
|
703 |
|
|
|
|
|
|
|
|
|
|
|
704 |
div[id*=wc_stripe_local_payment_stripe_].StripeElement {
|
705 |
border: 1px solid #eee;
|
706 |
border-radius: 4px;
|
731 |
margin: 0;
|
732 |
}
|
733 |
|
|
|
|
|
|
|
|
|
734 |
#wc_stripe_local_payment_stripe_klarna,
|
735 |
+
li[class*=payment_method_stripe_] div.wc-stripe-gateway-container.has_tokens{
|
|
|
|
|
736 |
margin-top: 10px;
|
737 |
}
|
738 |
|
865 |
margin: 0;
|
866 |
}
|
867 |
|
|
assets/css/stripe.css
CHANGED
@@ -208,9 +208,16 @@ label.wc-stripe-label-payment-type:after {
|
|
208 |
margin-bottom: 1em;
|
209 |
}
|
210 |
|
|
|
|
|
|
|
|
|
|
|
|
|
211 |
.wc-stripe_cc-container .wc-stripe-save-source .save-source-label {
|
212 |
display: block;
|
213 |
-
|
|
|
214 |
}
|
215 |
|
216 |
.wc-stripe_cc-container .wc-stripe-save-source input[type="checkbox"] {
|
@@ -694,11 +701,6 @@ ul.payment_methods li[class*=payment_method_stripe_] .wc-stripe_cc-new-method-co
|
|
694 |
margin: 0px;
|
695 |
}
|
696 |
|
697 |
-
.wc-stripe_cc-container .wc-stripe-save-source .save-source-label {
|
698 |
-
padding: 0;
|
699 |
-
margin-bottom: 5px;
|
700 |
-
}
|
701 |
-
|
702 |
div[id*=wc_stripe_local_payment_stripe_].StripeElement {
|
703 |
border: 1px solid #eee;
|
704 |
border-radius: 4px;
|
@@ -729,14 +731,8 @@ div[id*=wc_stripe_local_payment_stripe_].StripeElement {
|
|
729 |
margin: 0;
|
730 |
}
|
731 |
|
732 |
-
div.payment_method_stripe_cc,
|
733 |
-
div.payment_method_stripe_sepa,
|
734 |
-
div.payment_method_stripe_ideal,
|
735 |
-
div.payment_method_stripe_fpx,
|
736 |
#wc_stripe_local_payment_stripe_klarna,
|
737 |
-
li[class*=payment_method_stripe_] div.wc-
|
738 |
-
li[class*=payment_method_stripe_] div.wc-stripe_applepay-container.has_tokens,
|
739 |
-
li[class*=payment_method_stripe_] div.wc-stripe_payment_request-container.has_tokens {
|
740 |
margin-top: 10px;
|
741 |
}
|
742 |
|
@@ -869,4 +865,3 @@ li.payment_method_stripe_sofort.wc-stripe-no-desc .payment_box.wc-stripe-no-meth
|
|
869 |
margin: 0;
|
870 |
}
|
871 |
|
872 |
-
|
208 |
margin-bottom: 1em;
|
209 |
}
|
210 |
|
211 |
+
.wc-stripe_cc-new-method-container .wc-stripe-save-source{
|
212 |
+
display: flex;
|
213 |
+
align-items: center;
|
214 |
+
justify-content: flex-start;
|
215 |
+
}
|
216 |
+
|
217 |
.wc-stripe_cc-container .wc-stripe-save-source .save-source-label {
|
218 |
display: block;
|
219 |
+
padding: 0;
|
220 |
+
margin: 0 0 0px 5px;
|
221 |
}
|
222 |
|
223 |
.wc-stripe_cc-container .wc-stripe-save-source input[type="checkbox"] {
|
701 |
margin: 0px;
|
702 |
}
|
703 |
|
|
|
|
|
|
|
|
|
|
|
704 |
div[id*=wc_stripe_local_payment_stripe_].StripeElement {
|
705 |
border: 1px solid #eee;
|
706 |
border-radius: 4px;
|
731 |
margin: 0;
|
732 |
}
|
733 |
|
|
|
|
|
|
|
|
|
734 |
#wc_stripe_local_payment_stripe_klarna,
|
735 |
+
li[class*=payment_method_stripe_] div.wc-stripe-gateway-container.has_tokens{
|
|
|
|
|
736 |
margin-top: 10px;
|
737 |
}
|
738 |
|
865 |
margin: 0;
|
866 |
}
|
867 |
|
|
assets/css/stripe.min-rtl.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.wc-stripe-card-icons-container,.wc-stripe-paymentRequest-icons-container{float:left;display:inline-block}ul.payment_methods li[class*=payment_method]{margin:0;padding:0}li[class*=payment_method] input[type=radio]{margin:0 5px 0 10px}li[class*=payment_method] input[type=radio]+label:not(.wc-stripe-label-payment-type){margin:0}.woocommerce-checkout #payment ul.payment_methods li[class*=payment_method_stripe_]:nth-child(n+2),ul.payment_methods li[class*=payment_method_stripe_]:nth-child(n+2){margin:0}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon,li.payment_method_stripe_payment_request .wc-stripe-paymentRequest-icons-container img{max-width:44px;max-height:27px;width:44px;height:27px;float:none;display:inline}li.payment_method_stripe_payment_request .wc-stripe-paymentRequest-icons-container img{width:25px;height:25px;max-width:25px;max-height:25px}ul.payment_methods label[for*=payment_method_stripe]:after{clear:left;content:"";display:block}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon:nth-child(2n+2){margin:0 2px}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon.open.visa{padding-top:2px}ul.payment_methods li[class*=payment_method_stripe_] label>img:first-of-type{float:left!important}.wc-stripe_cc-new-method-container{margin-bottom:1em}.wc-stripe_cc-container .StripeElement{box-sizing:border-box;height:40px;padding:10px 12px;border-radius:4px;background-color:#fff;-webkit-transition:box-shadow 150ms ease;transition:box-shadow 150ms ease}input.wc-stripe-klarna-category,input.wc-stripe-payment-type{display:none!important}body .wfacp_main_form.woocommerce .wc-stripe-save-source label.checkbox{padding:0!important}input[type=radio]+label.wc-stripe-label-payment-type,label.wc-stripe-label-klarna-category,label.wc-stripe-label-payment-type{margin-bottom:1em;display:block;padding:0!important;color:#000}.theme-flatsome div.wc-stripe-saved-methods-container{margin:0 0 1em 0}label.wc-stripe-label-klarna-category:before,label.wc-stripe-label-payment-type:before{content:"";display:inline-block;width:11px;height:11px;border:2px solid #fff;box-shadow:0 0 0 2px #000;background:#fff;margin-right:4px;margin-left:.5em;border-radius:100%;-webkit-transform:translateY(2px);-ms-transform:translateY(2px);transform:translateY(2px)}input.wc-stripe-klarna-category:checked+label.wc-stripe-label-klarna-category:before,input.wc-stripe-payment-type:checked+label.wc-stripe-label-payment-type:before{background:#000}label.wc-stripe-label-payment-type:after{content:none!important;display:none!important}.select2-results__options li.wc-stripe-select2-container,.wc-stripe-saved-methods-container .select2-container .select2-selection--single .wc-stripe-select2-container{display:flex;align-items:center;height:42px;line-height:42px!important}.select2-container .select2-selection--single .wc-stripe-select2-container:before,.select2-results__options li.wc-stripe-select2-container:before{content:'';background-repeat:no-repeat;background-size:40px 24px;width:40px;height:42px;display:inline-block;margin-left:8px;background-position:center}.select2-container .select2-selection--single .wc-stripe-select2-container.visa:before,.select2-results__options li.wc-stripe-select2-container.visa:before{background-image:url(../img/cards/visa.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.mastercard:before,.select2-results__options li.wc-stripe-select2-container.mastercard:before{background-image:url(../img/cards/mastercard.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.americanexpress:before,.select2-results__options li.wc-stripe-select2-container.americanexpress:before{background-image:url(../img/cards/amex.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.amex:before,.select2-results__options li.wc-stripe-select2-container.amex:before{background-image:url(../img/cards/amex.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.discover:before,.select2-results__options li.wc-stripe-select2-container.discover:before{background-image:url(../img/cards/discover.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.mastercard:before,.select2-results__options li.wc-stripe-select2-container.mastercard:before{background-image:url(../img/cards/mastercard.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.dinersclub:before,.select2-results__options li.wc-stripe-select2-container.dinersclub:before{background-image:url(../img/cards/diners.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.diners:before,.select2-results__options li.wc-stripe-select2-container.diners:before{background-image:url(../img/cards/diners.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.jcb:before,.select2-results__options li.wc-stripe-select2-container.jcb:before{background-image:url(../img/cards/jcb.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.stripe_sepa:before,.select2-results__options li.wc-stripe-select2-container.stripe_sepa:before{background-image:url(../img/sepa.svg)}.select2-results__options li.wc-stripe-select2-container.wc-stripe-ach:before{display:none}#wc-stripe-card-element{margin-bottom:1em}.wc-stripe_cc-container .wc-stripe-save-source .save-source-label{display:block;margin-top:10px}.wc-stripe_cc-container .wc-stripe-save-source input[type=checkbox]{opacity:0;position:absolute;width:20px;height:20px}.wc-stripe_cc-container .wc-stripe-save-source label.checkbox{position:relative}.wc-stripe_cc-container .save-source-checkbox{height:20px;width:20px;position:relative;background-color:#fff;display:block;border-radius:3px;border:1px solid #bababa}.wc-stripe_cc-container .save-source-checkbox:after{content:"";position:absolute;top:0;right:0}.wc-stripe_cc-container .wc-stripe-save-source input[type=checkbox]:checked+.save-source-checkbox:after{right:6px;top:2px;width:7px;height:12px;border:solid #2196f3;border-width:0 0 3px 3px;-webkit-transform:rotate(-45deg);-ms-transform:rotate(-45deg);transform:rotate(-45deg);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}li.payment_method_stripe_applepay,li.payment_method_stripe_googlepay,li.payment_method_stripe_payment_request{display:none}#payment #place_order.wc-stripe-hide,#place_order.wc-stripe-hide,.woocommerce-checkout-review-order #payment #place_order.wc-stripe-hide{position:absolute!important;z-index:-1000!important;height:0!important;padding:0!important;opacity:0!important}.wc-stripe-product-checkout-container{display:none;width:100%}.wc-stripe-product-checkout-container.bottom{margin-top:1em}.wc-stripe-product-checkout-container.top{margin-bottom:1em}.wc-stripe-product-checkout-container.active{display:block}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods,.wc-stripe-product-checkout-container ul.wc_stripe_product_payment_methods{list-style:none;margin:0;padding:0}.wc-stripe-cart-checkout-container{margin:0;padding:0;clear:both}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods{margin-bottom:1.5em}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods li[class*=payment_method_stripe_],.wc-stripe-product-checkout-container ul.wc_stripe_product_payment_methods li[class*=payment_method_stripe_]{margin:0 0 1em 0}.wc_stripe_cart_payment_methods .gpay-button,.wc_stripe_cart_payment_methods .gpay-card-info-container,.wc_stripe_product_payment_methods .gpay-button,.wc_stripe_product_payment_methods .gpay-card-info-container{width:100%!important;margin:0}.wc_stripe_product_payment_methods .disabled{opacity:.45}.stripe_cart_gateway_active .checkout-button,.woocommerce-cart .stripe_cart_gateway_active .wc-proceed-to-checkout .checkout-button{margin-bottom:0}.wc-stripe-cart-or{margin:1em 0;text-align:center}li.wc-stripe-payment-method.or{display:none}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods.active li.wc-stripe-payment-method.or{display:block;margin:15px 0}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods.active li.wc-stripe-payment-method.or p{margin:0}li[class*=payment_method_stripe_].active~li.wc-stripe-payment-method.or{display:block;margin:0}li.payment_method_stripe_applepay label:first-of-type img{width:49px;max-height:32px}li.payment_method_stripe_googlepay label:first-of-type img{width:48px;max-height:35px}li.payment_method_stripe_googlepay label:first-of-type img[src*=googlepay_standard]{width:60px;max-height:35px}li.payment_method_stripe_ach label:first-of-type img{width:32px;height:32px;min-width:32px;min-height:32px}.gpay-button:hover{background-origin:content-box;background-position:center center;background-repeat:no-repeat;background-size:contain}.gpay-button:active{background-origin:content-box;background-position:center center;background-repeat:no-repeat;background-size:contain}.gpay-button:focus{background-origin:content-box;background-position:center center;background-repeat:no-repeat;background-size:contain}@supports (-webkit-appearance:-apple-pay-button){.apple-pay-button{display:block;-webkit-appearance:-apple-pay-button;width:100%;max-width:100%;min-width:200px;height:40px;max-height:40px}.apple-pay-button-black{-apple-pay-button-style:#000}.apple-pay-button-white{-apple-pay-button-style:#fff}.apple-pay-button-white-with-line{-apple-pay-button-style:white-outline}.applepay-top-container .apple-pay-button{max-width:240px}.woocommerce-checkout-payment .apple-pay-button{max-width:240px}body.single-product div.product form.cart .wc_stripe_product_payment_methods .apple-pay-button{max-width:100%}}.wc-stripe-banner-checkout{display:none;padding:20px 15px 0 15px;border:1px solid #d1d1d1;border-width:0 0 1px;position:relative;margin:1em 0}.wc-stripe-banner-checkout.active{display:block}.wc-stripe-banner-checkout span.banner-title{position:absolute;display:flex;align-items:center;top:-13px;left:0;right:0;background:0 0;white-space:nowrap;font-size:16px}.wc-stripe-banner-checkout span.banner-title:after,.wc-stripe-banner-checkout span.banner-title:before{content:' ';height:1px;background:#d1d1d1;display:block;width:50%}.wc-stripe-banner-checkout span.banner-title:before{margin-left:8px}.wc-stripe-banner-checkout span.banner-title:after{margin-right:8px}.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways{list-style:none;margin:0;padding:0}.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways li.wc-stripe-checkout-banner-gateway{margin:0 0 20px 0;display:none}.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways li.wc-stripe-checkout-banner-gateway .gpay-button,.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways li.wc-stripe-checkout-banner-gateway .gpay-card-info-container{margin:0}.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways .gpay-button,.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways .gpay-card-info-container{width:100%}.wc_stripe_cart_payment_methods .payment_method_stripe_payment_request .StripeElement,.wc_stripe_product_payment_methods .payment_method_stripe_payment_request .StripeElement{padding:0;width:100%}.woocommerce-checkout #wc-stripe-payment-request-container.StripeElement{width:240px;padding:0}.wc-stripe-checkout-banner-gateway #wc-stripe-payment-request-banner.StripeElement{width:100%}ul.payment_methods li.payment_method_stripe_p24 img{max-width:90px;width:90px;max-height:45px}ul.payment_methods li.payment_method_stripe_ideal img{max-width:38px;width:38px;max-height:35px}ul.payment_methods li.payment_method_stripe_fpx img{max-width:75px;width:75px;max-height:25px}ul.payment_methods li.payment_method_stripe_klarna img{max-width:72px;width:72px;max-height:20px}ul.payment_methods li.payment_method_stripe_giropay img{max-width:65px;width:65px;max-height:28px}ul.payment_methods li.payment_method_stripe_eps img{max-width:70px;width:70px;max-height:46px}ul.payment_methods li.payment_method_stripe_multibanco img{max-width:48px;width:48px;max-height:48px}ul.payment_methods li.payment_method_stripe_sepa img{max-width:67px;width:67px;max-height:18px}ul.payment_methods li.payment_method_stripe_sofort img{max-width:70px;width:70px;max-height:21px}label[for=payment_method_stripe_bancontact] img,ul.payment_methods li.payment_method_stripe_bancontact img{width:60px;height:42px;max-width:60px;max-height:42px}ul.payment_methods li.payment_method_stripe_wechat label img{max-width:82px;width:82px;max-height:23px}ul.payment_methods li.payment_method_stripe_alipay img{max-width:72px;width:72px;height:36px;max-height:36px}ul.payment_methods li.payment_method_stripe_grabpay img{max-width:95px;width:95px;max-height:28px}#wc-stripe-card-element{width:100%}li.banner_payment_method_stripe_payment_request .StripeElement{padding:0}.single-product .blockMsg{border:none!important;background-color:transparent!important}#wc-stripe-card{position:absolute!important;top:50%;left:8px;transform:translatey(-50%);width:23px;height:15px;padding:0;border:none}#wc-stripe-card.active{width:32px;height:20px}input[id=stripe-postal-code]:focus{outline:0;background:0 0;border:none;box-shadow:none}div.postalCode:focus{outline:0;border:none}li[class*=payment_method_stripe] .select2-container .select2-selection--single{height:42px;padding:0 5px}li[class*=payment_method_stripe] .select2-container--default .select2-selection--single .select2-selection__arrow{height:42px;top:1px;left:1px}.blockUI.blockMsg{font-size:20px;white-space:nowrap}#wc-stripe-payment-request-container.disabled{opacity:.45}.wc-stripe-paymentRequest-icons-container img{float:none}.select2-container .select2-selection--single .wc-stripe-select2-container.wc-stripe-ach:before{display:none}ul.wc_stripe_cart_payment_methods li.wc-stripe-payment-method button,ul.wc_stripe_checkout_banner_gateways li button,ul.wc_stripe_product_payment_methods li[class*=payment_method_stripe_] button{margin:0}ul.payment_methods li[class*=payment_method]{margin:0;padding:10px 0}ul.payment_methods li[class*=payment_method] input[name=payment_method]{margin:0 5px 0 10px;float:none}ul.payment_methods li[class*=payment_method]>input[name=payment_method]+label{padding-top:0;padding-left:0;padding-bottom:0}ul.payment_methods{list-style:none}ul.payment_methods li[class*=payment_method_stripe_] .wc-stripe_cc-new-method-container label:before{display:none}.wc-stripe_cc-container .wc-stripe-save-source label.checkbox{padding:0!important;margin:0}.wc-stripe_cc-container .wc-stripe-save-source .save-source-label{padding:0;margin-bottom:5px}div[id*=wc_stripe_local_payment_stripe_].StripeElement{border:1px solid #eee;border-radius:4px}.qrcode-message{margin:10px 0 0 0}#wc_stripe_local_payment_stripe_becs,#wc_stripe_local_payment_stripe_sepa{padding:10px 12px;box-shadow:0 1px 3px 0 #e6ebf1}.wc-stripe-local-desc.stripe_becs,.wc-stripe-local-desc.stripe_sepa{margin:10px 0}.wc-stripe-clear{clear:both;height:0;visibility:hidden}.wc-stripe-gateway-desc p{margin:0}#wc_stripe_local_payment_stripe_klarna,div.payment_method_stripe_cc,div.payment_method_stripe_fpx,div.payment_method_stripe_ideal,div.payment_method_stripe_sepa,li[class*=payment_method_stripe_] div.wc-stripe_applepay-container.has_tokens,li[class*=payment_method_stripe_] div.wc-stripe_googlepay-container.has_tokens,li[class*=payment_method_stripe_] div.wc-stripe_payment_request-container.has_tokens{margin-top:10px}.wc-stripe-gateway-desc{margin-top:10px}#wc-stripe-card-element.StripeElement--webkit-autofill{background-color:transparent!important}#wc_stripe_local_payment_stripe_klarna .stripe-klarna-categories{list-style:none;margin:0;padding:10px}li.payment_method_stripe_alipay,li.payment_method_stripe_bancontact,li.payment_method_stripe_becs,li.payment_method_stripe_eps,li.payment_method_stripe_fpx,li.payment_method_stripe_giropay,li.payment_method_stripe_ideal,li.payment_method_stripe_klarna,li.payment_method_stripe_multibanco,li.payment_method_stripe_p24,li.payment_method_stripe_sepa,li.payment_method_stripe_sofort,li.payment_method_stripe_wechat{display:none}.widget_shopping_cart_content .wc-stripe-mini-cart-payment-methods{list-style:none;margin:0;padding:0}.widget_shopping_cart_content .wc-stripe-mini-cart-payment-methods li{margin:0}.widget_shopping_cart_content a.wc-stripe-applepay-mini-cart,.widget_shopping_cart_content a.wc-stripe-gpay-mini-cart,.widget_shopping_cart_content a.wc-stripe-payment-request-mini-cart{background:0 0;padding:0;border:none}a.wc-stripe-gpay-mini-cart .gpay-button,a.wc-stripe-gpay-mini-cart .gpay-card-info-container a.wc-stripe-applepay-mini-cart .apple-pay-button{width:100%;margin:0}.wc-stripe-payment-request-mini-cart.StripeElement{padding:0;background:0 0;border:none;width:100%}.wc-stripe-payment-request-mini-cart.StripeElement .__PrivateStripeElement{width:100%}.widget_shopping_cart_content .wc-stripe-overlay{display:none!important;position:absolute;background:rgba(255,255,255,.75);height:100%;width:100%;z-index:-1}.widget_shopping_cart_content .wc-stripe-overlay.active{display:block!important;z-index:9999}.wc-stripe-klarna-loader{display:flex;justify-content:center;position:relative;width:100%;height:30px;box-sizing:border-box;transform:scale(.65)}.wc-stripe-klarna-loader div{box-sizing:border-box;display:block;position:absolute;box-sizing:border-box;width:30px;height:30px;border:3px solid #000;border-radius:50%;animation:klarna-payments-loader 1.3s cubic-bezier(.5,0,.5,1) infinite;border-color:#000 transparent transparent transparent}.wc-stripe-klarna-loader div:nth-child(1){animation-delay:-.45s}.wc-stripe-klarna-loader div:nth-child(2){animation-delay:-.3s}.wc-stripe-klarna-loader div:nth-child(3){animation-delay:-.15s}@keyframes klarna-payments-loader{0%{transform:rotate(0)}100%{transform:rotate(-360deg)}}li.payment_method_stripe_alipay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_applepay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_bancontact.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_eps.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_giropay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_googlepay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_grabpay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_multibanco.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_p24.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_payment_request.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_sofort.wc-stripe-no-desc .payment_box.wc-stripe-no-methods{padding:0;margin:0}
|
1 |
+
.wc-stripe-card-icons-container,.wc-stripe-paymentRequest-icons-container{float:left;display:inline-block}ul.payment_methods li[class*=payment_method]{margin:0;padding:0}li[class*=payment_method] input[type=radio]{margin:0 5px 0 10px}li[class*=payment_method] input[type=radio]+label:not(.wc-stripe-label-payment-type){margin:0}.woocommerce-checkout #payment ul.payment_methods li[class*=payment_method_stripe_]:nth-child(n+2),ul.payment_methods li[class*=payment_method_stripe_]:nth-child(n+2){margin:0}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon,li.payment_method_stripe_payment_request .wc-stripe-paymentRequest-icons-container img{max-width:44px;max-height:27px;width:44px;height:27px;float:none;display:inline}li.payment_method_stripe_payment_request .wc-stripe-paymentRequest-icons-container img{width:25px;height:25px;max-width:25px;max-height:25px}ul.payment_methods label[for*=payment_method_stripe]:after{clear:left;content:"";display:block}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon:nth-child(2n+2){margin:0 2px}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon.open.visa{padding-top:2px}ul.payment_methods li[class*=payment_method_stripe_] label>img:first-of-type{float:left!important}.wc-stripe_cc-new-method-container{margin-bottom:1em}.wc-stripe_cc-container .StripeElement{box-sizing:border-box;height:40px;padding:10px 12px;border-radius:4px;background-color:#fff;-webkit-transition:box-shadow 150ms ease;transition:box-shadow 150ms ease}input.wc-stripe-klarna-category,input.wc-stripe-payment-type{display:none!important}body .wfacp_main_form.woocommerce .wc-stripe-save-source label.checkbox{padding:0!important}input[type=radio]+label.wc-stripe-label-payment-type,label.wc-stripe-label-klarna-category,label.wc-stripe-label-payment-type{margin-bottom:1em;display:block;padding:0!important;color:#000}.theme-flatsome div.wc-stripe-saved-methods-container{margin:0 0 1em 0}label.wc-stripe-label-klarna-category:before,label.wc-stripe-label-payment-type:before{content:"";display:inline-block;width:11px;height:11px;border:2px solid #fff;box-shadow:0 0 0 2px #000;background:#fff;margin-right:4px;margin-left:.5em;border-radius:100%;-webkit-transform:translateY(2px);-ms-transform:translateY(2px);transform:translateY(2px)}input.wc-stripe-klarna-category:checked+label.wc-stripe-label-klarna-category:before,input.wc-stripe-payment-type:checked+label.wc-stripe-label-payment-type:before{background:#000}label.wc-stripe-label-payment-type:after{content:none!important;display:none!important}.select2-results__options li.wc-stripe-select2-container,.wc-stripe-saved-methods-container .select2-container .select2-selection--single .wc-stripe-select2-container{display:flex;align-items:center;height:42px;line-height:42px!important}.select2-container .select2-selection--single .wc-stripe-select2-container:before,.select2-results__options li.wc-stripe-select2-container:before{content:'';background-repeat:no-repeat;background-size:40px 24px;width:40px;height:42px;display:inline-block;margin-left:8px;background-position:center}.select2-container .select2-selection--single .wc-stripe-select2-container.visa:before,.select2-results__options li.wc-stripe-select2-container.visa:before{background-image:url(../img/cards/visa.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.mastercard:before,.select2-results__options li.wc-stripe-select2-container.mastercard:before{background-image:url(../img/cards/mastercard.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.americanexpress:before,.select2-results__options li.wc-stripe-select2-container.americanexpress:before{background-image:url(../img/cards/amex.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.amex:before,.select2-results__options li.wc-stripe-select2-container.amex:before{background-image:url(../img/cards/amex.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.discover:before,.select2-results__options li.wc-stripe-select2-container.discover:before{background-image:url(../img/cards/discover.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.mastercard:before,.select2-results__options li.wc-stripe-select2-container.mastercard:before{background-image:url(../img/cards/mastercard.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.dinersclub:before,.select2-results__options li.wc-stripe-select2-container.dinersclub:before{background-image:url(../img/cards/diners.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.diners:before,.select2-results__options li.wc-stripe-select2-container.diners:before{background-image:url(../img/cards/diners.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.jcb:before,.select2-results__options li.wc-stripe-select2-container.jcb:before{background-image:url(../img/cards/jcb.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.stripe_sepa:before,.select2-results__options li.wc-stripe-select2-container.stripe_sepa:before{background-image:url(../img/sepa.svg)}.select2-results__options li.wc-stripe-select2-container.wc-stripe-ach:before{display:none}#wc-stripe-card-element{margin-bottom:1em}.wc-stripe_cc-new-method-container .wc-stripe-save-source{display:flex;align-items:center;justify-content:flex-start}.wc-stripe_cc-container .wc-stripe-save-source .save-source-label{display:block;padding:0;margin:0 5px 0 0}.wc-stripe_cc-container .wc-stripe-save-source input[type=checkbox]{opacity:0;position:absolute;width:20px;height:20px}.wc-stripe_cc-container .wc-stripe-save-source label.checkbox{position:relative}.wc-stripe_cc-container .save-source-checkbox{height:20px;width:20px;position:relative;background-color:#fff;display:block;border-radius:3px;border:1px solid #bababa}.wc-stripe_cc-container .save-source-checkbox:after{content:"";position:absolute;top:0;right:0}.wc-stripe_cc-container .wc-stripe-save-source input[type=checkbox]:checked+.save-source-checkbox:after{right:6px;top:2px;width:7px;height:12px;border:solid #2196f3;border-width:0 0 3px 3px;-webkit-transform:rotate(-45deg);-ms-transform:rotate(-45deg);transform:rotate(-45deg);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}li.payment_method_stripe_applepay,li.payment_method_stripe_googlepay,li.payment_method_stripe_payment_request{display:none}#payment #place_order.wc-stripe-hide,#place_order.wc-stripe-hide,.woocommerce-checkout-review-order #payment #place_order.wc-stripe-hide{position:absolute!important;z-index:-1000!important;height:0!important;padding:0!important;opacity:0!important}.wc-stripe-product-checkout-container{display:none;width:100%}.wc-stripe-product-checkout-container.bottom{margin-top:1em}.wc-stripe-product-checkout-container.top{margin-bottom:1em}.wc-stripe-product-checkout-container.active{display:block}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods,.wc-stripe-product-checkout-container ul.wc_stripe_product_payment_methods{list-style:none;margin:0;padding:0}.wc-stripe-cart-checkout-container{margin:0;padding:0;clear:both}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods{margin-bottom:1.5em}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods li[class*=payment_method_stripe_],.wc-stripe-product-checkout-container ul.wc_stripe_product_payment_methods li[class*=payment_method_stripe_]{margin:0 0 1em 0}.wc_stripe_cart_payment_methods .gpay-button,.wc_stripe_cart_payment_methods .gpay-card-info-container,.wc_stripe_product_payment_methods .gpay-button,.wc_stripe_product_payment_methods .gpay-card-info-container{width:100%!important;margin:0}.wc_stripe_product_payment_methods .disabled{opacity:.45}.stripe_cart_gateway_active .checkout-button,.woocommerce-cart .stripe_cart_gateway_active .wc-proceed-to-checkout .checkout-button{margin-bottom:0}.wc-stripe-cart-or{margin:1em 0;text-align:center}li.wc-stripe-payment-method.or{display:none}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods.active li.wc-stripe-payment-method.or{display:block;margin:15px 0}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods.active li.wc-stripe-payment-method.or p{margin:0}li[class*=payment_method_stripe_].active~li.wc-stripe-payment-method.or{display:block;margin:0}li.payment_method_stripe_applepay label:first-of-type img{width:49px;max-height:32px}li.payment_method_stripe_googlepay label:first-of-type img{width:48px;max-height:35px}li.payment_method_stripe_googlepay label:first-of-type img[src*=googlepay_standard]{width:60px;max-height:35px}li.payment_method_stripe_ach label:first-of-type img{width:32px;height:32px;min-width:32px;min-height:32px}.gpay-button:hover{background-origin:content-box;background-position:center center;background-repeat:no-repeat;background-size:contain}.gpay-button:active{background-origin:content-box;background-position:center center;background-repeat:no-repeat;background-size:contain}.gpay-button:focus{background-origin:content-box;background-position:center center;background-repeat:no-repeat;background-size:contain}@supports (-webkit-appearance:-apple-pay-button){.apple-pay-button{display:block;-webkit-appearance:-apple-pay-button;width:100%;max-width:100%;min-width:200px;height:40px;max-height:40px}.apple-pay-button-black{-apple-pay-button-style:#000}.apple-pay-button-white{-apple-pay-button-style:#fff}.apple-pay-button-white-with-line{-apple-pay-button-style:white-outline}.applepay-top-container .apple-pay-button{max-width:240px}.woocommerce-checkout-payment .apple-pay-button{max-width:240px}body.single-product div.product form.cart .wc_stripe_product_payment_methods .apple-pay-button{max-width:100%}}.wc-stripe-banner-checkout{display:none;padding:20px 15px 0 15px;border:1px solid #d1d1d1;border-width:0 0 1px;position:relative;margin:1em 0}.wc-stripe-banner-checkout.active{display:block}.wc-stripe-banner-checkout span.banner-title{position:absolute;display:flex;align-items:center;top:-13px;left:0;right:0;background:0 0;white-space:nowrap;font-size:16px}.wc-stripe-banner-checkout span.banner-title:after,.wc-stripe-banner-checkout span.banner-title:before{content:' ';height:1px;background:#d1d1d1;display:block;width:50%}.wc-stripe-banner-checkout span.banner-title:before{margin-left:8px}.wc-stripe-banner-checkout span.banner-title:after{margin-right:8px}.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways{list-style:none;margin:0;padding:0}.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways li.wc-stripe-checkout-banner-gateway{margin:0 0 20px 0;display:none}.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways li.wc-stripe-checkout-banner-gateway .gpay-button,.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways li.wc-stripe-checkout-banner-gateway .gpay-card-info-container{margin:0}.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways .gpay-button,.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways .gpay-card-info-container{width:100%}.wc_stripe_cart_payment_methods .payment_method_stripe_payment_request .StripeElement,.wc_stripe_product_payment_methods .payment_method_stripe_payment_request .StripeElement{padding:0;width:100%}.woocommerce-checkout #wc-stripe-payment-request-container.StripeElement{width:240px;padding:0}.wc-stripe-checkout-banner-gateway #wc-stripe-payment-request-banner.StripeElement{width:100%}ul.payment_methods li.payment_method_stripe_p24 img{max-width:90px;width:90px;max-height:45px}ul.payment_methods li.payment_method_stripe_ideal img{max-width:38px;width:38px;max-height:35px}ul.payment_methods li.payment_method_stripe_fpx img{max-width:75px;width:75px;max-height:25px}ul.payment_methods li.payment_method_stripe_klarna img{max-width:72px;width:72px;max-height:20px}ul.payment_methods li.payment_method_stripe_giropay img{max-width:65px;width:65px;max-height:28px}ul.payment_methods li.payment_method_stripe_eps img{max-width:70px;width:70px;max-height:46px}ul.payment_methods li.payment_method_stripe_multibanco img{max-width:48px;width:48px;max-height:48px}ul.payment_methods li.payment_method_stripe_sepa img{max-width:67px;width:67px;max-height:18px}ul.payment_methods li.payment_method_stripe_sofort img{max-width:70px;width:70px;max-height:21px}label[for=payment_method_stripe_bancontact] img,ul.payment_methods li.payment_method_stripe_bancontact img{width:60px;height:42px;max-width:60px;max-height:42px}ul.payment_methods li.payment_method_stripe_wechat label img{max-width:82px;width:82px;max-height:23px}ul.payment_methods li.payment_method_stripe_alipay img{max-width:72px;width:72px;height:36px;max-height:36px}ul.payment_methods li.payment_method_stripe_grabpay img{max-width:95px;width:95px;max-height:28px}#wc-stripe-card-element{width:100%}li.banner_payment_method_stripe_payment_request .StripeElement{padding:0}.single-product .blockMsg{border:none!important;background-color:transparent!important}#wc-stripe-card{position:absolute!important;top:50%;left:8px;transform:translatey(-50%);width:23px;height:15px;padding:0;border:none}#wc-stripe-card.active{width:32px;height:20px}input[id=stripe-postal-code]:focus{outline:0;background:0 0;border:none;box-shadow:none}div.postalCode:focus{outline:0;border:none}li[class*=payment_method_stripe] .select2-container .select2-selection--single{height:42px;padding:0 5px}li[class*=payment_method_stripe] .select2-container--default .select2-selection--single .select2-selection__arrow{height:42px;top:1px;left:1px}.blockUI.blockMsg{font-size:20px;white-space:nowrap}#wc-stripe-payment-request-container.disabled{opacity:.45}.wc-stripe-paymentRequest-icons-container img{float:none}.select2-container .select2-selection--single .wc-stripe-select2-container.wc-stripe-ach:before{display:none}ul.wc_stripe_cart_payment_methods li.wc-stripe-payment-method button,ul.wc_stripe_checkout_banner_gateways li button,ul.wc_stripe_product_payment_methods li[class*=payment_method_stripe_] button{margin:0}ul.payment_methods li[class*=payment_method]{margin:0;padding:10px 0}ul.payment_methods li[class*=payment_method] input[name=payment_method]{margin:0 5px 0 10px;float:none}ul.payment_methods li[class*=payment_method]>input[name=payment_method]+label{padding-top:0;padding-left:0;padding-bottom:0}ul.payment_methods{list-style:none}ul.payment_methods li[class*=payment_method_stripe_] .wc-stripe_cc-new-method-container label:before{display:none}.wc-stripe_cc-container .wc-stripe-save-source label.checkbox{padding:0!important;margin:0}div[id*=wc_stripe_local_payment_stripe_].StripeElement{border:1px solid #eee;border-radius:4px}.qrcode-message{margin:10px 0 0 0}#wc_stripe_local_payment_stripe_becs,#wc_stripe_local_payment_stripe_sepa{padding:10px 12px;box-shadow:0 1px 3px 0 #e6ebf1}.wc-stripe-local-desc.stripe_becs,.wc-stripe-local-desc.stripe_sepa{margin:10px 0}.wc-stripe-clear{clear:both;height:0;visibility:hidden}.wc-stripe-gateway-desc p{margin:0}#wc_stripe_local_payment_stripe_klarna,li[class*=payment_method_stripe_] div.wc-stripe-gateway-container.has_tokens{margin-top:10px}.wc-stripe-gateway-desc{margin-top:10px}#wc-stripe-card-element.StripeElement--webkit-autofill{background-color:transparent!important}#wc_stripe_local_payment_stripe_klarna .stripe-klarna-categories{list-style:none;margin:0;padding:10px}li.payment_method_stripe_alipay,li.payment_method_stripe_bancontact,li.payment_method_stripe_becs,li.payment_method_stripe_eps,li.payment_method_stripe_fpx,li.payment_method_stripe_giropay,li.payment_method_stripe_ideal,li.payment_method_stripe_klarna,li.payment_method_stripe_multibanco,li.payment_method_stripe_p24,li.payment_method_stripe_sepa,li.payment_method_stripe_sofort,li.payment_method_stripe_wechat{display:none}.widget_shopping_cart_content .wc-stripe-mini-cart-payment-methods{list-style:none;margin:0;padding:0}.widget_shopping_cart_content .wc-stripe-mini-cart-payment-methods li{margin:0}.widget_shopping_cart_content a.wc-stripe-applepay-mini-cart,.widget_shopping_cart_content a.wc-stripe-gpay-mini-cart,.widget_shopping_cart_content a.wc-stripe-payment-request-mini-cart{background:0 0;padding:0;border:none}a.wc-stripe-gpay-mini-cart .gpay-button,a.wc-stripe-gpay-mini-cart .gpay-card-info-container a.wc-stripe-applepay-mini-cart .apple-pay-button{width:100%;margin:0}.wc-stripe-payment-request-mini-cart.StripeElement{padding:0;background:0 0;border:none;width:100%}.wc-stripe-payment-request-mini-cart.StripeElement .__PrivateStripeElement{width:100%}.widget_shopping_cart_content .wc-stripe-overlay{display:none!important;position:absolute;background:rgba(255,255,255,.75);height:100%;width:100%;z-index:-1}.widget_shopping_cart_content .wc-stripe-overlay.active{display:block!important;z-index:9999}.wc-stripe-klarna-loader{display:flex;justify-content:center;position:relative;width:100%;height:30px;box-sizing:border-box;transform:scale(.65)}.wc-stripe-klarna-loader div{box-sizing:border-box;display:block;position:absolute;box-sizing:border-box;width:30px;height:30px;border:3px solid #000;border-radius:50%;animation:klarna-payments-loader 1.3s cubic-bezier(.5,0,.5,1) infinite;border-color:#000 transparent transparent transparent}.wc-stripe-klarna-loader div:nth-child(1){animation-delay:-.45s}.wc-stripe-klarna-loader div:nth-child(2){animation-delay:-.3s}.wc-stripe-klarna-loader div:nth-child(3){animation-delay:-.15s}@keyframes klarna-payments-loader{0%{transform:rotate(0)}100%{transform:rotate(-360deg)}}li.payment_method_stripe_alipay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_applepay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_bancontact.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_eps.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_giropay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_googlepay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_grabpay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_multibanco.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_p24.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_payment_request.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_sofort.wc-stripe-no-desc .payment_box.wc-stripe-no-methods{padding:0;margin:0}
|
assets/css/stripe.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.wc-stripe-card-icons-container,.wc-stripe-paymentRequest-icons-container{float:right;display:inline-block}ul.payment_methods li[class*=payment_method]{margin:0;padding:0}li[class*=payment_method] input[type=radio]{margin:0 10px 0 5px}li[class*=payment_method] input[type=radio]+label:not(.wc-stripe-label-payment-type){margin:0}.woocommerce-checkout #payment ul.payment_methods li[class*=payment_method_stripe_]:nth-child(n+2),ul.payment_methods li[class*=payment_method_stripe_]:nth-child(n+2){margin:0}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon,li.payment_method_stripe_payment_request .wc-stripe-paymentRequest-icons-container img{max-width:44px;max-height:27px;width:44px;height:27px;float:none;display:inline}li.payment_method_stripe_payment_request .wc-stripe-paymentRequest-icons-container img{width:25px;height:25px;max-width:25px;max-height:25px}ul.payment_methods label[for*=payment_method_stripe]:after{clear:right;content:"";display:block}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon:nth-child(2n+2){margin:0 2px}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon.open.visa{padding-top:2px}ul.payment_methods li[class*=payment_method_stripe_] label>img:first-of-type{float:right!important}.wc-stripe_cc-new-method-container{margin-bottom:1em}.wc-stripe_cc-container .StripeElement{box-sizing:border-box;height:40px;padding:10px 12px;border-radius:4px;background-color:#fff;-webkit-transition:box-shadow 150ms ease;transition:box-shadow 150ms ease}input.wc-stripe-klarna-category,input.wc-stripe-payment-type{display:none!important}body .wfacp_main_form.woocommerce .wc-stripe-save-source label.checkbox{padding:0!important}input[type=radio]+label.wc-stripe-label-payment-type,label.wc-stripe-label-klarna-category,label.wc-stripe-label-payment-type{margin-bottom:1em;display:block;padding:0!important;color:#000}.theme-flatsome div.wc-stripe-saved-methods-container{margin:0 0 1em 0}label.wc-stripe-label-klarna-category:before,label.wc-stripe-label-payment-type:before{content:"";display:inline-block;width:11px;height:11px;border:2px solid #fff;box-shadow:0 0 0 2px #000;background:#fff;margin-left:4px;margin-right:.5em;border-radius:100%;-webkit-transform:translateY(2px);-ms-transform:translateY(2px);transform:translateY(2px)}input.wc-stripe-klarna-category:checked+label.wc-stripe-label-klarna-category:before,input.wc-stripe-payment-type:checked+label.wc-stripe-label-payment-type:before{background:#000}label.wc-stripe-label-payment-type:after{content:none!important;display:none!important}.select2-results__options li.wc-stripe-select2-container,.wc-stripe-saved-methods-container .select2-container .select2-selection--single .wc-stripe-select2-container{display:flex;align-items:center;height:42px;line-height:42px!important}.select2-container .select2-selection--single .wc-stripe-select2-container:before,.select2-results__options li.wc-stripe-select2-container:before{content:'';background-repeat:no-repeat;background-size:40px 24px;width:40px;height:42px;display:inline-block;margin-right:8px;background-position:center}.select2-container .select2-selection--single .wc-stripe-select2-container.visa:before,.select2-results__options li.wc-stripe-select2-container.visa:before{background-image:url(../img/cards/visa.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.mastercard:before,.select2-results__options li.wc-stripe-select2-container.mastercard:before{background-image:url(../img/cards/mastercard.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.americanexpress:before,.select2-results__options li.wc-stripe-select2-container.americanexpress:before{background-image:url(../img/cards/amex.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.amex:before,.select2-results__options li.wc-stripe-select2-container.amex:before{background-image:url(../img/cards/amex.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.discover:before,.select2-results__options li.wc-stripe-select2-container.discover:before{background-image:url(../img/cards/discover.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.mastercard:before,.select2-results__options li.wc-stripe-select2-container.mastercard:before{background-image:url(../img/cards/mastercard.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.dinersclub:before,.select2-results__options li.wc-stripe-select2-container.dinersclub:before{background-image:url(../img/cards/diners.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.diners:before,.select2-results__options li.wc-stripe-select2-container.diners:before{background-image:url(../img/cards/diners.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.jcb:before,.select2-results__options li.wc-stripe-select2-container.jcb:before{background-image:url(../img/cards/jcb.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.stripe_sepa:before,.select2-results__options li.wc-stripe-select2-container.stripe_sepa:before{background-image:url(../img/sepa.svg)}.select2-results__options li.wc-stripe-select2-container.wc-stripe-ach:before{display:none}#wc-stripe-card-element{margin-bottom:1em}.wc-stripe_cc-container .wc-stripe-save-source .save-source-label{display:block;margin-top:10px}.wc-stripe_cc-container .wc-stripe-save-source input[type=checkbox]{opacity:0;position:absolute;width:20px;height:20px}.wc-stripe_cc-container .wc-stripe-save-source label.checkbox{position:relative}.wc-stripe_cc-container .save-source-checkbox{height:20px;width:20px;position:relative;background-color:#fff;display:block;border-radius:3px;border:1px solid #bababa}.wc-stripe_cc-container .save-source-checkbox:after{content:"";position:absolute;top:0;left:0}.wc-stripe_cc-container .wc-stripe-save-source input[type=checkbox]:checked+.save-source-checkbox:after{left:6px;top:2px;width:7px;height:12px;border:solid #2196f3;border-width:0 3px 3px 0;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}li.payment_method_stripe_applepay,li.payment_method_stripe_googlepay,li.payment_method_stripe_payment_request{display:none}#payment #place_order.wc-stripe-hide,#place_order.wc-stripe-hide,.woocommerce-checkout-review-order #payment #place_order.wc-stripe-hide{position:absolute!important;z-index:-1000!important;height:0!important;padding:0!important;opacity:0!important}.wc-stripe-product-checkout-container{display:none;width:100%}.wc-stripe-product-checkout-container.bottom{margin-top:1em}.wc-stripe-product-checkout-container.top{margin-bottom:1em}.wc-stripe-product-checkout-container.active{display:block}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods,.wc-stripe-product-checkout-container ul.wc_stripe_product_payment_methods{list-style:none;margin:0;padding:0}.wc-stripe-cart-checkout-container{margin:0;padding:0;clear:both}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods{margin-bottom:1.5em}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods li[class*=payment_method_stripe_],.wc-stripe-product-checkout-container ul.wc_stripe_product_payment_methods li[class*=payment_method_stripe_]{margin:0 0 1em 0}.wc_stripe_cart_payment_methods .gpay-button,.wc_stripe_cart_payment_methods .gpay-card-info-container,.wc_stripe_product_payment_methods .gpay-button,.wc_stripe_product_payment_methods .gpay-card-info-container{width:100%!important;margin:0}.wc_stripe_product_payment_methods .disabled{opacity:.45}.stripe_cart_gateway_active .checkout-button,.woocommerce-cart .stripe_cart_gateway_active .wc-proceed-to-checkout .checkout-button{margin-bottom:0}.wc-stripe-cart-or{margin:1em 0;text-align:center}li.wc-stripe-payment-method.or{display:none}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods.active li.wc-stripe-payment-method.or{display:block;margin:15px 0}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods.active li.wc-stripe-payment-method.or p{margin:0}li[class*=payment_method_stripe_].active~li.wc-stripe-payment-method.or{display:block;margin:0}li.payment_method_stripe_applepay label:first-of-type img{width:49px;max-height:32px}li.payment_method_stripe_googlepay label:first-of-type img{width:48px;max-height:35px}li.payment_method_stripe_googlepay label:first-of-type img[src*=googlepay_standard]{width:60px;max-height:35px}li.payment_method_stripe_ach label:first-of-type img{width:32px;height:32px;min-width:32px;min-height:32px}.gpay-button:hover{background-origin:content-box;background-position:center center;background-repeat:no-repeat;background-size:contain}.gpay-button:active{background-origin:content-box;background-position:center center;background-repeat:no-repeat;background-size:contain}.gpay-button:focus{background-origin:content-box;background-position:center center;background-repeat:no-repeat;background-size:contain}@supports (-webkit-appearance:-apple-pay-button){.apple-pay-button{display:block;-webkit-appearance:-apple-pay-button;width:100%;max-width:100%;min-width:200px;height:40px;max-height:40px}.apple-pay-button-black{-apple-pay-button-style:#000}.apple-pay-button-white{-apple-pay-button-style:#fff}.apple-pay-button-white-with-line{-apple-pay-button-style:white-outline}.applepay-top-container .apple-pay-button{max-width:240px}.woocommerce-checkout-payment .apple-pay-button{max-width:240px}body.single-product div.product form.cart .wc_stripe_product_payment_methods .apple-pay-button{max-width:100%}}.wc-stripe-banner-checkout{display:none;padding:20px 15px 0 15px;border:1px solid #d1d1d1;border-width:0 0 1px;position:relative;margin:1em 0}.wc-stripe-banner-checkout.active{display:block}.wc-stripe-banner-checkout span.banner-title{position:absolute;display:flex;align-items:center;top:-13px;right:0;left:0;background:0 0;white-space:nowrap;font-size:16px}.wc-stripe-banner-checkout span.banner-title:after,.wc-stripe-banner-checkout span.banner-title:before{content:' ';height:1px;background:#d1d1d1;display:block;width:50%}.wc-stripe-banner-checkout span.banner-title:before{margin-right:8px}.wc-stripe-banner-checkout span.banner-title:after{margin-left:8px}.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways{list-style:none;margin:0;padding:0}.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways li.wc-stripe-checkout-banner-gateway{margin:0 0 20px 0;display:none}.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways li.wc-stripe-checkout-banner-gateway .gpay-button,.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways li.wc-stripe-checkout-banner-gateway .gpay-card-info-container{margin:0}.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways .gpay-button,.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways .gpay-card-info-container{width:100%}.wc_stripe_cart_payment_methods .payment_method_stripe_payment_request .StripeElement,.wc_stripe_product_payment_methods .payment_method_stripe_payment_request .StripeElement{padding:0;width:100%}.woocommerce-checkout #wc-stripe-payment-request-container.StripeElement{width:240px;padding:0}.wc-stripe-checkout-banner-gateway #wc-stripe-payment-request-banner.StripeElement{width:100%}ul.payment_methods li.payment_method_stripe_p24 img{max-width:90px;width:90px;max-height:45px}ul.payment_methods li.payment_method_stripe_ideal img{max-width:38px;width:38px;max-height:35px}ul.payment_methods li.payment_method_stripe_fpx img{max-width:75px;width:75px;max-height:25px}ul.payment_methods li.payment_method_stripe_klarna img{max-width:72px;width:72px;max-height:20px}ul.payment_methods li.payment_method_stripe_giropay img{max-width:65px;width:65px;max-height:28px}ul.payment_methods li.payment_method_stripe_eps img{max-width:70px;width:70px;max-height:46px}ul.payment_methods li.payment_method_stripe_multibanco img{max-width:48px;width:48px;max-height:48px}ul.payment_methods li.payment_method_stripe_sepa img{max-width:67px;width:67px;max-height:18px}ul.payment_methods li.payment_method_stripe_sofort img{max-width:70px;width:70px;max-height:21px}label[for=payment_method_stripe_bancontact] img,ul.payment_methods li.payment_method_stripe_bancontact img{width:60px;height:42px;max-width:60px;max-height:42px}ul.payment_methods li.payment_method_stripe_wechat label img{max-width:82px;width:82px;max-height:23px}ul.payment_methods li.payment_method_stripe_alipay img{max-width:72px;width:72px;height:36px;max-height:36px}ul.payment_methods li.payment_method_stripe_grabpay img{max-width:95px;width:95px;max-height:28px}#wc-stripe-card-element{width:100%}li.banner_payment_method_stripe_payment_request .StripeElement{padding:0}.single-product .blockMsg{border:none!important;background-color:transparent!important}#wc-stripe-card{position:absolute!important;top:50%;right:8px;transform:translatey(-50%);width:23px;height:15px;padding:0;border:none}#wc-stripe-card.active{width:32px;height:20px}input[id=stripe-postal-code]:focus{outline:0;background:0 0;border:none;box-shadow:none}div.postalCode:focus{outline:0;border:none}li[class*=payment_method_stripe] .select2-container .select2-selection--single{height:42px;padding:0 5px}li[class*=payment_method_stripe] .select2-container--default .select2-selection--single .select2-selection__arrow{height:42px;top:1px;right:1px}.blockUI.blockMsg{font-size:20px;white-space:nowrap}#wc-stripe-payment-request-container.disabled{opacity:.45}.wc-stripe-paymentRequest-icons-container img{float:none}.select2-container .select2-selection--single .wc-stripe-select2-container.wc-stripe-ach:before{display:none}ul.wc_stripe_cart_payment_methods li.wc-stripe-payment-method button,ul.wc_stripe_checkout_banner_gateways li button,ul.wc_stripe_product_payment_methods li[class*=payment_method_stripe_] button{margin:0}ul.payment_methods li[class*=payment_method]{margin:0;padding:10px 0}ul.payment_methods li[class*=payment_method] input[name=payment_method]{margin:0 10px 0 5px;float:none}ul.payment_methods li[class*=payment_method]>input[name=payment_method]+label{padding-top:0;padding-right:0;padding-bottom:0}ul.payment_methods{list-style:none}ul.payment_methods li[class*=payment_method_stripe_] .wc-stripe_cc-new-method-container label:before{display:none}.wc-stripe_cc-container .wc-stripe-save-source label.checkbox{padding:0!important;margin:0}.wc-stripe_cc-container .wc-stripe-save-source .save-source-label{padding:0;margin-bottom:5px}div[id*=wc_stripe_local_payment_stripe_].StripeElement{border:1px solid #eee;border-radius:4px}.qrcode-message{margin:10px 0 0 0}#wc_stripe_local_payment_stripe_becs,#wc_stripe_local_payment_stripe_sepa{padding:10px 12px;box-shadow:0 1px 3px 0 #e6ebf1}.wc-stripe-local-desc.stripe_becs,.wc-stripe-local-desc.stripe_sepa{margin:10px 0}.wc-stripe-clear{clear:both;height:0;visibility:hidden}.wc-stripe-gateway-desc p{margin:0}#wc_stripe_local_payment_stripe_klarna,div.payment_method_stripe_cc,div.payment_method_stripe_fpx,div.payment_method_stripe_ideal,div.payment_method_stripe_sepa,li[class*=payment_method_stripe_] div.wc-stripe_applepay-container.has_tokens,li[class*=payment_method_stripe_] div.wc-stripe_googlepay-container.has_tokens,li[class*=payment_method_stripe_] div.wc-stripe_payment_request-container.has_tokens{margin-top:10px}.wc-stripe-gateway-desc{margin-top:10px}#wc-stripe-card-element.StripeElement--webkit-autofill{background-color:transparent!important}#wc_stripe_local_payment_stripe_klarna .stripe-klarna-categories{list-style:none;margin:0;padding:10px}li.payment_method_stripe_alipay,li.payment_method_stripe_bancontact,li.payment_method_stripe_becs,li.payment_method_stripe_eps,li.payment_method_stripe_fpx,li.payment_method_stripe_giropay,li.payment_method_stripe_ideal,li.payment_method_stripe_klarna,li.payment_method_stripe_multibanco,li.payment_method_stripe_p24,li.payment_method_stripe_sepa,li.payment_method_stripe_sofort,li.payment_method_stripe_wechat{display:none}.widget_shopping_cart_content .wc-stripe-mini-cart-payment-methods{list-style:none;margin:0;padding:0}.widget_shopping_cart_content .wc-stripe-mini-cart-payment-methods li{margin:0}.widget_shopping_cart_content a.wc-stripe-applepay-mini-cart,.widget_shopping_cart_content a.wc-stripe-gpay-mini-cart,.widget_shopping_cart_content a.wc-stripe-payment-request-mini-cart{background:0 0;padding:0;border:none}a.wc-stripe-gpay-mini-cart .gpay-button,a.wc-stripe-gpay-mini-cart .gpay-card-info-container a.wc-stripe-applepay-mini-cart .apple-pay-button{width:100%;margin:0}.wc-stripe-payment-request-mini-cart.StripeElement{padding:0;background:0 0;border:none;width:100%}.wc-stripe-payment-request-mini-cart.StripeElement .__PrivateStripeElement{width:100%}.widget_shopping_cart_content .wc-stripe-overlay{display:none!important;position:absolute;background:rgba(255,255,255,.75);height:100%;width:100%;z-index:-1}.widget_shopping_cart_content .wc-stripe-overlay.active{display:block!important;z-index:9999}.wc-stripe-klarna-loader{display:flex;justify-content:center;position:relative;width:100%;height:30px;box-sizing:border-box;transform:scale(.65)}.wc-stripe-klarna-loader div{box-sizing:border-box;display:block;position:absolute;box-sizing:border-box;width:30px;height:30px;border:3px solid #000;border-radius:50%;animation:klarna-payments-loader 1.3s cubic-bezier(.5,0,.5,1) infinite;border-color:#000 transparent transparent transparent}.wc-stripe-klarna-loader div:nth-child(1){animation-delay:-.45s}.wc-stripe-klarna-loader div:nth-child(2){animation-delay:-.3s}.wc-stripe-klarna-loader div:nth-child(3){animation-delay:-.15s}@keyframes klarna-payments-loader{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}li.payment_method_stripe_alipay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_applepay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_bancontact.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_eps.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_giropay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_googlepay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_grabpay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_multibanco.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_p24.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_payment_request.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_sofort.wc-stripe-no-desc .payment_box.wc-stripe-no-methods{padding:0;margin:0}
|
1 |
+
.wc-stripe-card-icons-container,.wc-stripe-paymentRequest-icons-container{float:right;display:inline-block}ul.payment_methods li[class*=payment_method]{margin:0;padding:0}li[class*=payment_method] input[type=radio]{margin:0 10px 0 5px}li[class*=payment_method] input[type=radio]+label:not(.wc-stripe-label-payment-type){margin:0}.woocommerce-checkout #payment ul.payment_methods li[class*=payment_method_stripe_]:nth-child(n+2),ul.payment_methods li[class*=payment_method_stripe_]:nth-child(n+2){margin:0}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon,li.payment_method_stripe_payment_request .wc-stripe-paymentRequest-icons-container img{max-width:44px;max-height:27px;width:44px;height:27px;float:none;display:inline}li.payment_method_stripe_payment_request .wc-stripe-paymentRequest-icons-container img{width:25px;height:25px;max-width:25px;max-height:25px}ul.payment_methods label[for*=payment_method_stripe]:after{clear:right;content:"";display:block}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon:nth-child(2n+2){margin:0 2px}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon.open.visa{padding-top:2px}ul.payment_methods li[class*=payment_method_stripe_] label>img:first-of-type{float:right!important}.wc-stripe_cc-new-method-container{margin-bottom:1em}.wc-stripe_cc-container .StripeElement{box-sizing:border-box;height:40px;padding:10px 12px;border-radius:4px;background-color:#fff;-webkit-transition:box-shadow 150ms ease;transition:box-shadow 150ms ease}input.wc-stripe-klarna-category,input.wc-stripe-payment-type{display:none!important}body .wfacp_main_form.woocommerce .wc-stripe-save-source label.checkbox{padding:0!important}input[type=radio]+label.wc-stripe-label-payment-type,label.wc-stripe-label-klarna-category,label.wc-stripe-label-payment-type{margin-bottom:1em;display:block;padding:0!important;color:#000}.theme-flatsome div.wc-stripe-saved-methods-container{margin:0 0 1em 0}label.wc-stripe-label-klarna-category:before,label.wc-stripe-label-payment-type:before{content:"";display:inline-block;width:11px;height:11px;border:2px solid #fff;box-shadow:0 0 0 2px #000;background:#fff;margin-left:4px;margin-right:.5em;border-radius:100%;-webkit-transform:translateY(2px);-ms-transform:translateY(2px);transform:translateY(2px)}input.wc-stripe-klarna-category:checked+label.wc-stripe-label-klarna-category:before,input.wc-stripe-payment-type:checked+label.wc-stripe-label-payment-type:before{background:#000}label.wc-stripe-label-payment-type:after{content:none!important;display:none!important}.select2-results__options li.wc-stripe-select2-container,.wc-stripe-saved-methods-container .select2-container .select2-selection--single .wc-stripe-select2-container{display:flex;align-items:center;height:42px;line-height:42px!important}.select2-container .select2-selection--single .wc-stripe-select2-container:before,.select2-results__options li.wc-stripe-select2-container:before{content:'';background-repeat:no-repeat;background-size:40px 24px;width:40px;height:42px;display:inline-block;margin-right:8px;background-position:center}.select2-container .select2-selection--single .wc-stripe-select2-container.visa:before,.select2-results__options li.wc-stripe-select2-container.visa:before{background-image:url(../img/cards/visa.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.mastercard:before,.select2-results__options li.wc-stripe-select2-container.mastercard:before{background-image:url(../img/cards/mastercard.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.americanexpress:before,.select2-results__options li.wc-stripe-select2-container.americanexpress:before{background-image:url(../img/cards/amex.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.amex:before,.select2-results__options li.wc-stripe-select2-container.amex:before{background-image:url(../img/cards/amex.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.discover:before,.select2-results__options li.wc-stripe-select2-container.discover:before{background-image:url(../img/cards/discover.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.mastercard:before,.select2-results__options li.wc-stripe-select2-container.mastercard:before{background-image:url(../img/cards/mastercard.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.dinersclub:before,.select2-results__options li.wc-stripe-select2-container.dinersclub:before{background-image:url(../img/cards/diners.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.diners:before,.select2-results__options li.wc-stripe-select2-container.diners:before{background-image:url(../img/cards/diners.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.jcb:before,.select2-results__options li.wc-stripe-select2-container.jcb:before{background-image:url(../img/cards/jcb.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.stripe_sepa:before,.select2-results__options li.wc-stripe-select2-container.stripe_sepa:before{background-image:url(../img/sepa.svg)}.select2-results__options li.wc-stripe-select2-container.wc-stripe-ach:before{display:none}#wc-stripe-card-element{margin-bottom:1em}.wc-stripe_cc-new-method-container .wc-stripe-save-source{display:flex;align-items:center;justify-content:flex-start}.wc-stripe_cc-container .wc-stripe-save-source .save-source-label{display:block;padding:0;margin:0 0 0 5px}.wc-stripe_cc-container .wc-stripe-save-source input[type=checkbox]{opacity:0;position:absolute;width:20px;height:20px}.wc-stripe_cc-container .wc-stripe-save-source label.checkbox{position:relative}.wc-stripe_cc-container .save-source-checkbox{height:20px;width:20px;position:relative;background-color:#fff;display:block;border-radius:3px;border:1px solid #bababa}.wc-stripe_cc-container .save-source-checkbox:after{content:"";position:absolute;top:0;left:0}.wc-stripe_cc-container .wc-stripe-save-source input[type=checkbox]:checked+.save-source-checkbox:after{left:6px;top:2px;width:7px;height:12px;border:solid #2196f3;border-width:0 3px 3px 0;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}li.payment_method_stripe_applepay,li.payment_method_stripe_googlepay,li.payment_method_stripe_payment_request{display:none}#payment #place_order.wc-stripe-hide,#place_order.wc-stripe-hide,.woocommerce-checkout-review-order #payment #place_order.wc-stripe-hide{position:absolute!important;z-index:-1000!important;height:0!important;padding:0!important;opacity:0!important}.wc-stripe-product-checkout-container{display:none;width:100%}.wc-stripe-product-checkout-container.bottom{margin-top:1em}.wc-stripe-product-checkout-container.top{margin-bottom:1em}.wc-stripe-product-checkout-container.active{display:block}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods,.wc-stripe-product-checkout-container ul.wc_stripe_product_payment_methods{list-style:none;margin:0;padding:0}.wc-stripe-cart-checkout-container{margin:0;padding:0;clear:both}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods{margin-bottom:1.5em}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods li[class*=payment_method_stripe_],.wc-stripe-product-checkout-container ul.wc_stripe_product_payment_methods li[class*=payment_method_stripe_]{margin:0 0 1em 0}.wc_stripe_cart_payment_methods .gpay-button,.wc_stripe_cart_payment_methods .gpay-card-info-container,.wc_stripe_product_payment_methods .gpay-button,.wc_stripe_product_payment_methods .gpay-card-info-container{width:100%!important;margin:0}.wc_stripe_product_payment_methods .disabled{opacity:.45}.stripe_cart_gateway_active .checkout-button,.woocommerce-cart .stripe_cart_gateway_active .wc-proceed-to-checkout .checkout-button{margin-bottom:0}.wc-stripe-cart-or{margin:1em 0;text-align:center}li.wc-stripe-payment-method.or{display:none}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods.active li.wc-stripe-payment-method.or{display:block;margin:15px 0}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods.active li.wc-stripe-payment-method.or p{margin:0}li[class*=payment_method_stripe_].active~li.wc-stripe-payment-method.or{display:block;margin:0}li.payment_method_stripe_applepay label:first-of-type img{width:49px;max-height:32px}li.payment_method_stripe_googlepay label:first-of-type img{width:48px;max-height:35px}li.payment_method_stripe_googlepay label:first-of-type img[src*=googlepay_standard]{width:60px;max-height:35px}li.payment_method_stripe_ach label:first-of-type img{width:32px;height:32px;min-width:32px;min-height:32px}.gpay-button:hover{background-origin:content-box;background-position:center center;background-repeat:no-repeat;background-size:contain}.gpay-button:active{background-origin:content-box;background-position:center center;background-repeat:no-repeat;background-size:contain}.gpay-button:focus{background-origin:content-box;background-position:center center;background-repeat:no-repeat;background-size:contain}@supports (-webkit-appearance:-apple-pay-button){.apple-pay-button{display:block;-webkit-appearance:-apple-pay-button;width:100%;max-width:100%;min-width:200px;height:40px;max-height:40px}.apple-pay-button-black{-apple-pay-button-style:#000}.apple-pay-button-white{-apple-pay-button-style:#fff}.apple-pay-button-white-with-line{-apple-pay-button-style:white-outline}.applepay-top-container .apple-pay-button{max-width:240px}.woocommerce-checkout-payment .apple-pay-button{max-width:240px}body.single-product div.product form.cart .wc_stripe_product_payment_methods .apple-pay-button{max-width:100%}}.wc-stripe-banner-checkout{display:none;padding:20px 15px 0 15px;border:1px solid #d1d1d1;border-width:0 0 1px;position:relative;margin:1em 0}.wc-stripe-banner-checkout.active{display:block}.wc-stripe-banner-checkout span.banner-title{position:absolute;display:flex;align-items:center;top:-13px;right:0;left:0;background:0 0;white-space:nowrap;font-size:16px}.wc-stripe-banner-checkout span.banner-title:after,.wc-stripe-banner-checkout span.banner-title:before{content:' ';height:1px;background:#d1d1d1;display:block;width:50%}.wc-stripe-banner-checkout span.banner-title:before{margin-right:8px}.wc-stripe-banner-checkout span.banner-title:after{margin-left:8px}.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways{list-style:none;margin:0;padding:0}.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways li.wc-stripe-checkout-banner-gateway{margin:0 0 20px 0;display:none}.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways li.wc-stripe-checkout-banner-gateway .gpay-button,.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways li.wc-stripe-checkout-banner-gateway .gpay-card-info-container{margin:0}.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways .gpay-button,.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways .gpay-card-info-container{width:100%}.wc_stripe_cart_payment_methods .payment_method_stripe_payment_request .StripeElement,.wc_stripe_product_payment_methods .payment_method_stripe_payment_request .StripeElement{padding:0;width:100%}.woocommerce-checkout #wc-stripe-payment-request-container.StripeElement{width:240px;padding:0}.wc-stripe-checkout-banner-gateway #wc-stripe-payment-request-banner.StripeElement{width:100%}ul.payment_methods li.payment_method_stripe_p24 img{max-width:90px;width:90px;max-height:45px}ul.payment_methods li.payment_method_stripe_ideal img{max-width:38px;width:38px;max-height:35px}ul.payment_methods li.payment_method_stripe_fpx img{max-width:75px;width:75px;max-height:25px}ul.payment_methods li.payment_method_stripe_klarna img{max-width:72px;width:72px;max-height:20px}ul.payment_methods li.payment_method_stripe_giropay img{max-width:65px;width:65px;max-height:28px}ul.payment_methods li.payment_method_stripe_eps img{max-width:70px;width:70px;max-height:46px}ul.payment_methods li.payment_method_stripe_multibanco img{max-width:48px;width:48px;max-height:48px}ul.payment_methods li.payment_method_stripe_sepa img{max-width:67px;width:67px;max-height:18px}ul.payment_methods li.payment_method_stripe_sofort img{max-width:70px;width:70px;max-height:21px}label[for=payment_method_stripe_bancontact] img,ul.payment_methods li.payment_method_stripe_bancontact img{width:60px;height:42px;max-width:60px;max-height:42px}ul.payment_methods li.payment_method_stripe_wechat label img{max-width:82px;width:82px;max-height:23px}ul.payment_methods li.payment_method_stripe_alipay img{max-width:72px;width:72px;height:36px;max-height:36px}ul.payment_methods li.payment_method_stripe_grabpay img{max-width:95px;width:95px;max-height:28px}#wc-stripe-card-element{width:100%}li.banner_payment_method_stripe_payment_request .StripeElement{padding:0}.single-product .blockMsg{border:none!important;background-color:transparent!important}#wc-stripe-card{position:absolute!important;top:50%;right:8px;transform:translatey(-50%);width:23px;height:15px;padding:0;border:none}#wc-stripe-card.active{width:32px;height:20px}input[id=stripe-postal-code]:focus{outline:0;background:0 0;border:none;box-shadow:none}div.postalCode:focus{outline:0;border:none}li[class*=payment_method_stripe] .select2-container .select2-selection--single{height:42px;padding:0 5px}li[class*=payment_method_stripe] .select2-container--default .select2-selection--single .select2-selection__arrow{height:42px;top:1px;right:1px}.blockUI.blockMsg{font-size:20px;white-space:nowrap}#wc-stripe-payment-request-container.disabled{opacity:.45}.wc-stripe-paymentRequest-icons-container img{float:none}.select2-container .select2-selection--single .wc-stripe-select2-container.wc-stripe-ach:before{display:none}ul.wc_stripe_cart_payment_methods li.wc-stripe-payment-method button,ul.wc_stripe_checkout_banner_gateways li button,ul.wc_stripe_product_payment_methods li[class*=payment_method_stripe_] button{margin:0}ul.payment_methods li[class*=payment_method]{margin:0;padding:10px 0}ul.payment_methods li[class*=payment_method] input[name=payment_method]{margin:0 10px 0 5px;float:none}ul.payment_methods li[class*=payment_method]>input[name=payment_method]+label{padding-top:0;padding-right:0;padding-bottom:0}ul.payment_methods{list-style:none}ul.payment_methods li[class*=payment_method_stripe_] .wc-stripe_cc-new-method-container label:before{display:none}.wc-stripe_cc-container .wc-stripe-save-source label.checkbox{padding:0!important;margin:0}div[id*=wc_stripe_local_payment_stripe_].StripeElement{border:1px solid #eee;border-radius:4px}.qrcode-message{margin:10px 0 0 0}#wc_stripe_local_payment_stripe_becs,#wc_stripe_local_payment_stripe_sepa{padding:10px 12px;box-shadow:0 1px 3px 0 #e6ebf1}.wc-stripe-local-desc.stripe_becs,.wc-stripe-local-desc.stripe_sepa{margin:10px 0}.wc-stripe-clear{clear:both;height:0;visibility:hidden}.wc-stripe-gateway-desc p{margin:0}#wc_stripe_local_payment_stripe_klarna,li[class*=payment_method_stripe_] div.wc-stripe-gateway-container.has_tokens{margin-top:10px}.wc-stripe-gateway-desc{margin-top:10px}#wc-stripe-card-element.StripeElement--webkit-autofill{background-color:transparent!important}#wc_stripe_local_payment_stripe_klarna .stripe-klarna-categories{list-style:none;margin:0;padding:10px}li.payment_method_stripe_alipay,li.payment_method_stripe_bancontact,li.payment_method_stripe_becs,li.payment_method_stripe_eps,li.payment_method_stripe_fpx,li.payment_method_stripe_giropay,li.payment_method_stripe_ideal,li.payment_method_stripe_klarna,li.payment_method_stripe_multibanco,li.payment_method_stripe_p24,li.payment_method_stripe_sepa,li.payment_method_stripe_sofort,li.payment_method_stripe_wechat{display:none}.widget_shopping_cart_content .wc-stripe-mini-cart-payment-methods{list-style:none;margin:0;padding:0}.widget_shopping_cart_content .wc-stripe-mini-cart-payment-methods li{margin:0}.widget_shopping_cart_content a.wc-stripe-applepay-mini-cart,.widget_shopping_cart_content a.wc-stripe-gpay-mini-cart,.widget_shopping_cart_content a.wc-stripe-payment-request-mini-cart{background:0 0;padding:0;border:none}a.wc-stripe-gpay-mini-cart .gpay-button,a.wc-stripe-gpay-mini-cart .gpay-card-info-container a.wc-stripe-applepay-mini-cart .apple-pay-button{width:100%;margin:0}.wc-stripe-payment-request-mini-cart.StripeElement{padding:0;background:0 0;border:none;width:100%}.wc-stripe-payment-request-mini-cart.StripeElement .__PrivateStripeElement{width:100%}.widget_shopping_cart_content .wc-stripe-overlay{display:none!important;position:absolute;background:rgba(255,255,255,.75);height:100%;width:100%;z-index:-1}.widget_shopping_cart_content .wc-stripe-overlay.active{display:block!important;z-index:9999}.wc-stripe-klarna-loader{display:flex;justify-content:center;position:relative;width:100%;height:30px;box-sizing:border-box;transform:scale(.65)}.wc-stripe-klarna-loader div{box-sizing:border-box;display:block;position:absolute;box-sizing:border-box;width:30px;height:30px;border:3px solid #000;border-radius:50%;animation:klarna-payments-loader 1.3s cubic-bezier(.5,0,.5,1) infinite;border-color:#000 transparent transparent transparent}.wc-stripe-klarna-loader div:nth-child(1){animation-delay:-.45s}.wc-stripe-klarna-loader div:nth-child(2){animation-delay:-.3s}.wc-stripe-klarna-loader div:nth-child(3){animation-delay:-.15s}@keyframes klarna-payments-loader{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}li.payment_method_stripe_alipay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_applepay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_bancontact.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_eps.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_giropay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_googlepay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_grabpay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_multibanco.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_p24.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_payment_request.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_sofort.wc-stripe-no-desc .payment_box.wc-stripe-no-methods{padding:0;margin:0}
|
assets/js/admin/admin-settings.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
jQuery(function($) {
|
2 |
|
3 |
function Settings() {
|
4 |
this.params = wc_stripe_setting_params;
|
@@ -10,7 +10,7 @@ jQuery(function($) {
|
|
10 |
* [init description]
|
11 |
* @return {[type]} [description]
|
12 |
*/
|
13 |
-
Settings.prototype.init = function() {
|
14 |
$('[name^="woocommerce_stripe"]').on('change', this.display_children.bind(this));
|
15 |
|
16 |
$('select.stripe-accepted-cards').on('select2:select', this.reorder_multiselect);
|
@@ -21,7 +21,7 @@ jQuery(function($) {
|
|
21 |
|
22 |
$('.wc-stripe-connection-test').on('click', this.do_connection_test.bind(this));
|
23 |
|
24 |
-
if (typeof(wc_stripe_admin_notices) != 'undefined') {
|
25 |
this.display_notices();
|
26 |
}
|
27 |
|
@@ -33,13 +33,13 @@ jQuery(function($) {
|
|
33 |
* @param {[type]} e [description]
|
34 |
* @return {[type]} [description]
|
35 |
*/
|
36 |
-
Settings.prototype.display_children = function(e) {
|
37 |
-
$('[data-show-if]').each(function(i, el) {
|
38 |
var $this = $(el);
|
39 |
var values = $this.data('show-if');
|
40 |
var hidden = [];
|
41 |
-
$.each(values, function(k, v) {
|
42 |
-
$key = $(this.prefix + k);
|
43 |
if (hidden.indexOf($this.attr('id')) == -1) {
|
44 |
if ($key.is(':checkbox')) {
|
45 |
if ($key.is(':checked') == v) {
|
@@ -69,7 +69,7 @@ jQuery(function($) {
|
|
69 |
* @param {[type]} e [description]
|
70 |
* @return {[type]} [description]
|
71 |
*/
|
72 |
-
Settings.prototype.reorder_multiselect = function(e) {
|
73 |
var element = e.params.data.element;
|
74 |
var $element = $(element);
|
75 |
$element.detach();
|
@@ -81,28 +81,28 @@ jQuery(function($) {
|
|
81 |
* [register_domain description]
|
82 |
* @return {[type]} [description]
|
83 |
*/
|
84 |
-
Settings.prototype.register_domain = function(e) {
|
85 |
e.preventDefault();
|
86 |
this.block();
|
87 |
$.ajax({
|
88 |
url: this.params.routes.apple_domain,
|
89 |
dataType: 'json',
|
90 |
method: 'POST',
|
91 |
-
data: {
|
92 |
-
}).done(function(response) {
|
93 |
this.unblock();
|
94 |
if (response.code) {
|
95 |
window.alert(response.message);
|
96 |
} else {
|
97 |
window.alert(response.message);
|
98 |
}
|
99 |
-
}.bind(this)).fail(function(xhr, textStatus, errorThrown) {
|
100 |
this.unblock();
|
101 |
window.alert(errorThrown);
|
102 |
}.bind(this))
|
103 |
}
|
104 |
|
105 |
-
Settings.prototype.create_webhook = function(e) {
|
106 |
e.preventDefault();
|
107 |
this.block();
|
108 |
var env = $('#woocommerce_stripe_api_mode').val();
|
@@ -110,8 +110,8 @@ jQuery(function($) {
|
|
110 |
url: this.params.routes.create_webhook,
|
111 |
dataType: 'json',
|
112 |
method: 'POST',
|
113 |
-
data: {
|
114 |
-
}).done(function(response) {
|
115 |
this.unblock();
|
116 |
if (response.code) {
|
117 |
window.alert(response.message);
|
@@ -119,13 +119,13 @@ jQuery(function($) {
|
|
119 |
$('#woocommerce_stripe_api_webhook_secret_' + env).val(response.secret);
|
120 |
window.alert(response.message);
|
121 |
}
|
122 |
-
}.bind(this)).fail(function(xhr, textStatus, errorThrown) {
|
123 |
this.unblock();
|
124 |
window.alert(errorThrown);
|
125 |
}.bind(this))
|
126 |
}
|
127 |
|
128 |
-
Settings.prototype.do_connection_test = function(e) {
|
129 |
e.preventDefault();
|
130 |
this.block();
|
131 |
var mode = $('#woocommerce_stripe_api_mode').val();
|
@@ -133,25 +133,32 @@ jQuery(function($) {
|
|
133 |
url: this.params.routes.connection_test,
|
134 |
dataType: 'json',
|
135 |
method: 'POST',
|
136 |
-
data: {
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
141 |
this.unblock();
|
142 |
if (response.code) {
|
143 |
window.alert(response.message);
|
144 |
} else {
|
145 |
window.alert(response.message);
|
146 |
}
|
147 |
-
}.bind(this)).fail(function(xhr, textStatus, errorThrown) {
|
148 |
this.unblock();
|
149 |
window.alert(errorThrown);
|
150 |
}.bind(this))
|
151 |
}
|
152 |
|
153 |
-
Settings.prototype.display_notices = function() {
|
154 |
-
$.each(wc_stripe_admin_notices, function(idx, notice) {
|
155 |
$('.woo-nav-tab-wrapper').after(notice);
|
156 |
}.bind(this))
|
157 |
}
|
@@ -161,7 +168,7 @@ jQuery(function($) {
|
|
161 |
* @param {[type]} $el [description]
|
162 |
* @return {[type]} [description]
|
163 |
*/
|
164 |
-
Settings.prototype.block = function() {
|
165 |
$('.wc-stripe-settings-container').block({
|
166 |
message: null,
|
167 |
overlayCSS: {
|
@@ -176,7 +183,7 @@ jQuery(function($) {
|
|
176 |
* @param {[type]} $el [description]
|
177 |
* @return {[type]} [description]
|
178 |
*/
|
179 |
-
Settings.prototype.unblock = function() {
|
180 |
$('.wc-stripe-settings-container').unblock();
|
181 |
}
|
182 |
|
1 |
+
jQuery(function ($) {
|
2 |
|
3 |
function Settings() {
|
4 |
this.params = wc_stripe_setting_params;
|
10 |
* [init description]
|
11 |
* @return {[type]} [description]
|
12 |
*/
|
13 |
+
Settings.prototype.init = function () {
|
14 |
$('[name^="woocommerce_stripe"]').on('change', this.display_children.bind(this));
|
15 |
|
16 |
$('select.stripe-accepted-cards').on('select2:select', this.reorder_multiselect);
|
21 |
|
22 |
$('.wc-stripe-connection-test').on('click', this.do_connection_test.bind(this));
|
23 |
|
24 |
+
if (typeof (wc_stripe_admin_notices) != 'undefined') {
|
25 |
this.display_notices();
|
26 |
}
|
27 |
|
33 |
* @param {[type]} e [description]
|
34 |
* @return {[type]} [description]
|
35 |
*/
|
36 |
+
Settings.prototype.display_children = function (e) {
|
37 |
+
$('[data-show-if]').each(function (i, el) {
|
38 |
var $this = $(el);
|
39 |
var values = $this.data('show-if');
|
40 |
var hidden = [];
|
41 |
+
$.each(values, function (k, v) {
|
42 |
+
var $key = $(this.prefix + k);
|
43 |
if (hidden.indexOf($this.attr('id')) == -1) {
|
44 |
if ($key.is(':checkbox')) {
|
45 |
if ($key.is(':checked') == v) {
|
69 |
* @param {[type]} e [description]
|
70 |
* @return {[type]} [description]
|
71 |
*/
|
72 |
+
Settings.prototype.reorder_multiselect = function (e) {
|
73 |
var element = e.params.data.element;
|
74 |
var $element = $(element);
|
75 |
$element.detach();
|
81 |
* [register_domain description]
|
82 |
* @return {[type]} [description]
|
83 |
*/
|
84 |
+
Settings.prototype.register_domain = function (e) {
|
85 |
e.preventDefault();
|
86 |
this.block();
|
87 |
$.ajax({
|
88 |
url: this.params.routes.apple_domain,
|
89 |
dataType: 'json',
|
90 |
method: 'POST',
|
91 |
+
data: {_wpnonce: this.params.rest_nonce}
|
92 |
+
}).done(function (response) {
|
93 |
this.unblock();
|
94 |
if (response.code) {
|
95 |
window.alert(response.message);
|
96 |
} else {
|
97 |
window.alert(response.message);
|
98 |
}
|
99 |
+
}.bind(this)).fail(function (xhr, textStatus, errorThrown) {
|
100 |
this.unblock();
|
101 |
window.alert(errorThrown);
|
102 |
}.bind(this))
|
103 |
}
|
104 |
|
105 |
+
Settings.prototype.create_webhook = function (e) {
|
106 |
e.preventDefault();
|
107 |
this.block();
|
108 |
var env = $('#woocommerce_stripe_api_mode').val();
|
110 |
url: this.params.routes.create_webhook,
|
111 |
dataType: 'json',
|
112 |
method: 'POST',
|
113 |
+
data: {_wpnonce: this.params.rest_nonce, environment: env}
|
114 |
+
}).done(function (response) {
|
115 |
this.unblock();
|
116 |
if (response.code) {
|
117 |
window.alert(response.message);
|
119 |
$('#woocommerce_stripe_api_webhook_secret_' + env).val(response.secret);
|
120 |
window.alert(response.message);
|
121 |
}
|
122 |
+
}.bind(this)).fail(function (xhr, textStatus, errorThrown) {
|
123 |
this.unblock();
|
124 |
window.alert(errorThrown);
|
125 |
}.bind(this))
|
126 |
}
|
127 |
|
128 |
+
Settings.prototype.do_connection_test = function (e) {
|
129 |
e.preventDefault();
|
130 |
this.block();
|
131 |
var mode = $('#woocommerce_stripe_api_mode').val();
|
133 |
url: this.params.routes.connection_test,
|
134 |
dataType: 'json',
|
135 |
method: 'POST',
|
136 |
+
data: (function () {
|
137 |
+
var data = {
|
138 |
+
_wpnonce: this.params.rest_nonce,
|
139 |
+
mode: mode
|
140 |
+
};
|
141 |
+
if (mode === 'test') {
|
142 |
+
data.secret_key = $('#woocommerce_stripe_api_secret_key_test').val();
|
143 |
+
data.publishable_key = $('#woocommerce_stripe_api_publishable_key_test').val();
|
144 |
+
}
|
145 |
+
return data;
|
146 |
+
}.bind(this)())
|
147 |
+
}).done(function (response) {
|
148 |
this.unblock();
|
149 |
if (response.code) {
|
150 |
window.alert(response.message);
|
151 |
} else {
|
152 |
window.alert(response.message);
|
153 |
}
|
154 |
+
}.bind(this)).fail(function (xhr, textStatus, errorThrown) {
|
155 |
this.unblock();
|
156 |
window.alert(errorThrown);
|
157 |
}.bind(this))
|
158 |
}
|
159 |
|
160 |
+
Settings.prototype.display_notices = function () {
|
161 |
+
$.each(wc_stripe_admin_notices, function (idx, notice) {
|
162 |
$('.woo-nav-tab-wrapper').after(notice);
|
163 |
}.bind(this))
|
164 |
}
|
168 |
* @param {[type]} $el [description]
|
169 |
* @return {[type]} [description]
|
170 |
*/
|
171 |
+
Settings.prototype.block = function () {
|
172 |
$('.wc-stripe-settings-container').block({
|
173 |
message: null,
|
174 |
overlayCSS: {
|
183 |
* @param {[type]} $el [description]
|
184 |
* @return {[type]} [description]
|
185 |
*/
|
186 |
+
Settings.prototype.unblock = function () {
|
187 |
$('.wc-stripe-settings-container').unblock();
|
188 |
}
|
189 |
|
assets/js/frontend/cc-forms.js
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
minimalist.prototype.prev = function(e) {
|
21 |
e.preventDefault();
|
22 |
this.index--;
|
23 |
-
$('.wc-stripe-minimalist-form .field-container[data-index="' + (this.index + 1) + '"]').addClass('field-container--hidden')
|
24 |
$('.wc-stripe-minimalist-form .field-container[data-index="' + this.index + '"]').removeClass('field-container--hidden');
|
25 |
this.updateSteppers();
|
26 |
}
|
20 |
minimalist.prototype.prev = function(e) {
|
21 |
e.preventDefault();
|
22 |
this.index--;
|
23 |
+
$('.wc-stripe-minimalist-form .field-container[data-index="' + (this.index + 1) + '"]').addClass('field-container--hidden');
|
24 |
$('.wc-stripe-minimalist-form .field-container[data-index="' + this.index + '"]').removeClass('field-container--hidden');
|
25 |
this.updateSteppers();
|
26 |
}
|
assets/js/frontend/credit-card.js
CHANGED
@@ -8,7 +8,7 @@
|
|
8 |
function CC() {
|
9 |
wc_stripe.BaseGateway.call(this, wc_stripe_credit_card_params);
|
10 |
wc_stripe.CheckoutGateway.call(this);
|
11 |
-
window.addEventListener('hashchange', this.
|
12 |
wc_stripe.credit_card = this;
|
13 |
this.has3DSecureParams();
|
14 |
}
|
@@ -121,8 +121,10 @@
|
|
121 |
}
|
122 |
}
|
123 |
} else if ($('#stripe-postal-code').length) {
|
124 |
-
if ($('#stripe-postal-code').val() !=
|
125 |
$('#stripe-postal-code').addClass('StripeElement--complete');
|
|
|
|
|
126 |
}
|
127 |
}
|
128 |
}
|
@@ -156,7 +158,7 @@
|
|
156 |
} else {
|
157 |
$('#stripe-postal-code').removeClass('empty');
|
158 |
}
|
159 |
-
}.bind(this))
|
160 |
$('#stripe-postal-code').on('change', this.validate_postal_field.bind(this));
|
161 |
$('#stripe-postal-code').trigger('change');
|
162 |
}
|
@@ -181,31 +183,6 @@
|
|
181 |
}
|
182 |
}
|
183 |
|
184 |
-
/**
|
185 |
-
*
|
186 |
-
*/
|
187 |
-
CC.prototype.hashChange = function (e) {
|
188 |
-
if (this.is_gateway_selected()) {
|
189 |
-
var match = e.newURL.match(/response=(.*)/);
|
190 |
-
if (match) {
|
191 |
-
try {
|
192 |
-
var obj = JSON.parse(window.atob(match[1]));
|
193 |
-
if (obj && obj.hasOwnProperty('client_secret')) {
|
194 |
-
history.pushState({}, '', window.location.pathname);
|
195 |
-
this.handle_card_action(obj);
|
196 |
-
}
|
197 |
-
} catch (err) {
|
198 |
-
|
199 |
-
}
|
200 |
-
}
|
201 |
-
return true;
|
202 |
-
}
|
203 |
-
return true;
|
204 |
-
}
|
205 |
-
|
206 |
-
/**
|
207 |
-
*
|
208 |
-
*/
|
209 |
CC.prototype.place_order = function (e) {
|
210 |
if (this.is_gateway_selected()) {
|
211 |
if (this.can_create_setup_intent() && !this.is_saved_method_selected()) {
|
@@ -213,7 +190,12 @@
|
|
213 |
this.stripe.confirmCardSetup(this.client_secret, {
|
214 |
payment_method: {
|
215 |
card: this.is_custom_form() ? this.cardNumber : this.card,
|
216 |
-
billing_details:
|
|
|
|
|
|
|
|
|
|
|
217 |
}
|
218 |
}).then(function (result) {
|
219 |
if (result.error) {
|
@@ -256,33 +238,6 @@
|
|
256 |
return wc_stripe.CheckoutGateway.prototype.checkout_place_order.apply(this, arguments);
|
257 |
}
|
258 |
|
259 |
-
/**
|
260 |
-
* [sync_payment_intent description]
|
261 |
-
* @param {[type]} order_id [description]
|
262 |
-
* @param {[type]} client_secret [description]
|
263 |
-
* @return {[type]} [description]
|
264 |
-
*/
|
265 |
-
CC.prototype.sync_payment_intent = function (order_id, client_secret) {
|
266 |
-
return new Promise(function (resolve, reject) {
|
267 |
-
// call intent api
|
268 |
-
$.when($.ajax({
|
269 |
-
method: 'POST',
|
270 |
-
dataType: 'json',
|
271 |
-
url: this.params.routes.sync_intent,
|
272 |
-
data: {order_id: order_id, client_secret: client_secret},
|
273 |
-
beforeSend: this.ajax_before_send.bind(this)
|
274 |
-
})).done(function (response) {
|
275 |
-
if (response.code) {
|
276 |
-
reject(response);
|
277 |
-
} else {
|
278 |
-
resolve(response);
|
279 |
-
}
|
280 |
-
}).fail(function (xhr, textStatus, errorThrown) {
|
281 |
-
this.submit_error(errorThrown);
|
282 |
-
}.bind(this));
|
283 |
-
}.bind(this))
|
284 |
-
}
|
285 |
-
|
286 |
/**
|
287 |
*
|
288 |
*/
|
@@ -425,97 +380,16 @@
|
|
425 |
}
|
426 |
|
427 |
CC.prototype.get_billing_details = function () {
|
428 |
-
var details =
|
429 |
-
|
430 |
-
address: {
|
431 |
-
city: this.fields.get('billing_city', null),
|
432 |
-
country: this.fields.get('billing_country', null),
|
433 |
-
line1: this.fields.get('billing_address_1', null),
|
434 |
-
line2: this.fields.get('billing_address_2', null),
|
435 |
-
postal_code: this.get_postal_code(),
|
436 |
-
state: this.fields.get('billing_state', null)
|
437 |
-
}
|
438 |
-
}
|
439 |
-
if (!details.name || details.name === ' ') {
|
440 |
-
delete details.name;
|
441 |
-
}
|
442 |
-
if (this.fields.get('billing_email') != '') {
|
443 |
-
details.email = this.fields.get('billing_email');
|
444 |
-
}
|
445 |
-
if (this.fields.get('billing_phone') != '') {
|
446 |
-
details.phone = this.fields.get('billing_phone');
|
447 |
-
}
|
448 |
return details;
|
449 |
}
|
450 |
|
451 |
CC.prototype.can_create_setup_intent = function () {
|
452 |
-
return this.is_add_payment_method_page() || this.is_change_payment_method()
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
if (this.is_gateway_selected() && this.get_page() === 'order_pay') {
|
457 |
-
if (window.location.hash && typeof window.location.hash === 'string') {
|
458 |
-
var match = window.location.hash.match(/response=(.*)/);
|
459 |
-
try {
|
460 |
-
var obj = JSON.parse(window.atob(match[1]));
|
461 |
-
if (obj && obj.hasOwnProperty('client_secret')) {
|
462 |
-
$('[name="terms"]').prop('checked', true);
|
463 |
-
this.handle_card_action(obj);
|
464 |
-
}
|
465 |
-
} catch (err) {
|
466 |
-
|
467 |
-
}
|
468 |
-
}
|
469 |
-
}
|
470 |
-
}
|
471 |
-
|
472 |
-
CC.prototype.handle_card_action = function (obj) {
|
473 |
-
try {
|
474 |
-
this.stripe.handleCardAction(obj.client_secret).then(function (result) {
|
475 |
-
if (result.error) {
|
476 |
-
this.payment_token_received = false;
|
477 |
-
this.submit_error(result.error);
|
478 |
-
this.sync_payment_intent(obj.order_id, obj.client_secret).catch(function (response) {
|
479 |
-
this.submit_error(response.message);
|
480 |
-
}.bind(this));
|
481 |
-
return;
|
482 |
-
}
|
483 |
-
if (this.get_page() === 'checkout' && $('.woocommerce-remove-coupon').length) {
|
484 |
-
// coupons so process via REST
|
485 |
-
this.submit_checkout_order();
|
486 |
-
} else {
|
487 |
-
var $form = this.get_form();
|
488 |
-
$form.unblock().removeClass('processing');
|
489 |
-
$form.submit();
|
490 |
-
}
|
491 |
-
}.bind(this)).catch(function (error) {
|
492 |
-
this.submit_error(error.message);
|
493 |
-
}.bind(this))
|
494 |
-
return false;
|
495 |
-
} catch (err) {
|
496 |
-
|
497 |
-
}
|
498 |
-
}
|
499 |
-
|
500 |
-
CC.prototype.submit_checkout_order = function () {
|
501 |
-
$.ajax({
|
502 |
-
method: 'POST',
|
503 |
-
url: this.params.routes.checkout_payment,
|
504 |
-
dataType: 'json',
|
505 |
-
data: $.extend({}, this.fields.toJson(), {'_wpnonce': this.params.rest_nonce})
|
506 |
-
}).done(function (result) {
|
507 |
-
if (result.result && result.result === 'success') {
|
508 |
-
window.location = result.redirect;
|
509 |
-
} else {
|
510 |
-
if (result.messages) {
|
511 |
-
this.submit_error(result.messages);
|
512 |
-
} else {
|
513 |
-
this.submit_error(wc_checkout_params.i18n_checkout_error);
|
514 |
-
}
|
515 |
-
}
|
516 |
-
}.bind(this)).fail(function () {
|
517 |
-
|
518 |
-
}.bind(this))
|
519 |
}
|
520 |
|
521 |
new CC();
|
8 |
function CC() {
|
9 |
wc_stripe.BaseGateway.call(this, wc_stripe_credit_card_params);
|
10 |
wc_stripe.CheckoutGateway.call(this);
|
11 |
+
window.addEventListener('hashchange', this.hashchange.bind(this));
|
12 |
wc_stripe.credit_card = this;
|
13 |
this.has3DSecureParams();
|
14 |
}
|
121 |
}
|
122 |
}
|
123 |
} else if ($('#stripe-postal-code').length) {
|
124 |
+
if ($('#stripe-postal-code').val() != '') {
|
125 |
$('#stripe-postal-code').addClass('StripeElement--complete');
|
126 |
+
} else {
|
127 |
+
$('#stripe-postal-code').removeClass('StripeElement--complete');
|
128 |
}
|
129 |
}
|
130 |
}
|
158 |
} else {
|
159 |
$('#stripe-postal-code').removeClass('empty');
|
160 |
}
|
161 |
+
}.bind(this));
|
162 |
$('#stripe-postal-code').on('change', this.validate_postal_field.bind(this));
|
163 |
$('#stripe-postal-code').trigger('change');
|
164 |
}
|
183 |
}
|
184 |
}
|
185 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
186 |
CC.prototype.place_order = function (e) {
|
187 |
if (this.is_gateway_selected()) {
|
188 |
if (this.can_create_setup_intent() && !this.is_saved_method_selected()) {
|
190 |
this.stripe.confirmCardSetup(this.client_secret, {
|
191 |
payment_method: {
|
192 |
card: this.is_custom_form() ? this.cardNumber : this.card,
|
193 |
+
billing_details: (function () {
|
194 |
+
if (this.is_current_page('checkout')) {
|
195 |
+
return this.get_billing_details();
|
196 |
+
}
|
197 |
+
return $.extend({}, this.is_custom_form() ? {address: {postal_code: $('#stripe-postal-code').val()}} : {});
|
198 |
+
}.bind(this)())
|
199 |
}
|
200 |
}).then(function (result) {
|
201 |
if (result.error) {
|
238 |
return wc_stripe.CheckoutGateway.prototype.checkout_place_order.apply(this, arguments);
|
239 |
}
|
240 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
241 |
/**
|
242 |
*
|
243 |
*/
|
380 |
}
|
381 |
|
382 |
CC.prototype.get_billing_details = function () {
|
383 |
+
var details = wc_stripe.BaseGateway.prototype.get_billing_details.call(this);
|
384 |
+
details.address.postal_code = this.get_postal_code();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
385 |
return details;
|
386 |
}
|
387 |
|
388 |
CC.prototype.can_create_setup_intent = function () {
|
389 |
+
return this.is_add_payment_method_page() || this.is_change_payment_method() ||
|
390 |
+
(this.is_current_page('checkout') && this.cart_contains_subscription() && this.get_gateway_data() && this.get_total_price_cents() == 0) ||
|
391 |
+
(this.is_current_page('checkout') && typeof wc_stripe_preorder_exists !== 'undefined') ||
|
392 |
+
(this.is_current_page('order_pay') && 'pre_order' in this.get_gateway_data() && this.get_gateway_data().pre_order === true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
393 |
}
|
394 |
|
395 |
new CC();
|
assets/js/frontend/form-handler.js
CHANGED
@@ -56,7 +56,7 @@ jQuery(function($) {
|
|
56 |
*/
|
57 |
Handler.prototype.payment_type_change = function() {
|
58 |
var gateway = this.get_payment_method();
|
59 |
-
$input = $('[name="' + gateway + '_payment_type_key"]:checked');
|
60 |
if ($input.length === 0 || $input.val() === "new") {
|
61 |
$('.wc-' + gateway + '-saved-methods-container').slideUp(400, function() {
|
62 |
$('.wc-' + gateway + '-new-method-container').slideDown(400);
|
56 |
*/
|
57 |
Handler.prototype.payment_type_change = function() {
|
58 |
var gateway = this.get_payment_method();
|
59 |
+
var $input = $('[name="' + gateway + '_payment_type_key"]:checked');
|
60 |
if ($input.length === 0 || $input.val() === "new") {
|
61 |
$('.wc-' + gateway + '-saved-methods-container').slideUp(400, function() {
|
62 |
$('.wc-' + gateway + '-new-method-container').slideDown(400);
|
assets/js/frontend/googlepay-cart.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
(function($, wc_stripe) {
|
2 |
|
3 |
/**
|
4 |
* @constructor
|
@@ -6,6 +6,7 @@
|
|
6 |
function GPay() {
|
7 |
wc_stripe.BaseGateway.call(this, wc_stripe_googlepay_cart_params);
|
8 |
wc_stripe.CartGateway.call(this);
|
|
|
9 |
}
|
10 |
|
11 |
/**
|
@@ -17,9 +18,9 @@
|
|
17 |
/**
|
18 |
* @return {[type]}
|
19 |
*/
|
20 |
-
GPay.prototype.initialize = function() {
|
21 |
this.createPaymentsClient();
|
22 |
-
this.isReadyToPay().then(function() {
|
23 |
$(this.container).show().addClass('active').parent().addClass('active');
|
24 |
this.add_cart_totals_class();
|
25 |
}.bind(this))
|
@@ -28,7 +29,7 @@
|
|
28 |
/**
|
29 |
* @return {[type]}
|
30 |
*/
|
31 |
-
GPay.prototype.create_button = function() {
|
32 |
wc_stripe.GooglePay.prototype.create_button.apply(this, arguments);
|
33 |
$('#wc-stripe-googlepay-container').append(this.$button);
|
34 |
}
|
@@ -36,7 +37,7 @@
|
|
36 |
/**
|
37 |
* @return {[type]}
|
38 |
*/
|
39 |
-
GPay.prototype.updated_html = function() {
|
40 |
if (this.can_pay) {
|
41 |
this.create_button();
|
42 |
$(this.container).show().addClass('active').parent().addClass('active');
|
@@ -48,7 +49,7 @@
|
|
48 |
* @param {[type]}
|
49 |
* @return {[null]}
|
50 |
*/
|
51 |
-
GPay.prototype.payment_data_updated = function(response, event) {
|
52 |
if (event.callbackTrigger === "SHIPPING_ADDRESS") {
|
53 |
$(document.body).trigger('wc_update_cart');
|
54 |
}
|
1 |
+
(function ($, wc_stripe) {
|
2 |
|
3 |
/**
|
4 |
* @constructor
|
6 |
function GPay() {
|
7 |
wc_stripe.BaseGateway.call(this, wc_stripe_googlepay_cart_params);
|
8 |
wc_stripe.CartGateway.call(this);
|
9 |
+
window.addEventListener('hashchange', this.hashchange.bind(this));
|
10 |
}
|
11 |
|
12 |
/**
|
18 |
/**
|
19 |
* @return {[type]}
|
20 |
*/
|
21 |
+
GPay.prototype.initialize = function () {
|
22 |
this.createPaymentsClient();
|
23 |
+
this.isReadyToPay().then(function () {
|
24 |
$(this.container).show().addClass('active').parent().addClass('active');
|
25 |
this.add_cart_totals_class();
|
26 |
}.bind(this))
|
29 |
/**
|
30 |
* @return {[type]}
|
31 |
*/
|
32 |
+
GPay.prototype.create_button = function () {
|
33 |
wc_stripe.GooglePay.prototype.create_button.apply(this, arguments);
|
34 |
$('#wc-stripe-googlepay-container').append(this.$button);
|
35 |
}
|
37 |
/**
|
38 |
* @return {[type]}
|
39 |
*/
|
40 |
+
GPay.prototype.updated_html = function () {
|
41 |
if (this.can_pay) {
|
42 |
this.create_button();
|
43 |
$(this.container).show().addClass('active').parent().addClass('active');
|
49 |
* @param {[type]}
|
50 |
* @return {[null]}
|
51 |
*/
|
52 |
+
GPay.prototype.payment_data_updated = function (response, event) {
|
53 |
if (event.callbackTrigger === "SHIPPING_ADDRESS") {
|
54 |
$(document.body).trigger('wc_update_cart');
|
55 |
}
|
assets/js/frontend/googlepay-checkout.js
CHANGED
@@ -7,6 +7,8 @@
|
|
7 |
this.can_pay = false;
|
8 |
wc_stripe.BaseGateway.call(this, wc_stripe_googlepay_checkout_params);
|
9 |
wc_stripe.CheckoutGateway.call(this);
|
|
|
|
|
10 |
}
|
11 |
|
12 |
/**
|
7 |
this.can_pay = false;
|
8 |
wc_stripe.BaseGateway.call(this, wc_stripe_googlepay_checkout_params);
|
9 |
wc_stripe.CheckoutGateway.call(this);
|
10 |
+
window.addEventListener('hashchange', this.hashchange.bind(this));
|
11 |
+
this.has3DSecureParams();
|
12 |
}
|
13 |
|
14 |
/**
|
assets/js/frontend/googlepay-product.js
CHANGED
@@ -5,6 +5,7 @@
|
|
5 |
*/
|
6 |
function GPay() {
|
7 |
wc_stripe.BaseGateway.call(this, wc_stripe_googlepay_product_params);
|
|
|
8 |
}
|
9 |
|
10 |
/**
|
5 |
*/
|
6 |
function GPay() {
|
7 |
wc_stripe.BaseGateway.call(this, wc_stripe_googlepay_product_params);
|
8 |
+
window.addEventListener('hashchange', this.hashchange.bind(this));
|
9 |
}
|
10 |
|
11 |
/**
|
assets/js/frontend/local-payment.js
CHANGED
@@ -17,7 +17,7 @@
|
|
17 |
|
18 |
$(document.body).on('click', '#place_order', this.place_order.bind(this));
|
19 |
|
20 |
-
if (this.
|
21 |
$('#order_review').on('submit', this.process_order_pay.bind(this));
|
22 |
}
|
23 |
|
@@ -86,7 +86,7 @@
|
|
86 |
|
87 |
LocalPayment.prototype.place_order = function (e) {
|
88 |
if (this.is_gateway_selected()) {
|
89 |
-
if (!this.payment_token_received) {
|
90 |
e.preventDefault();
|
91 |
this.createSource();
|
92 |
}
|
@@ -235,7 +235,7 @@
|
|
235 |
}).done(function (response) {
|
236 |
resolve(response);
|
237 |
}.bind(this)).fail(function () {
|
238 |
-
reject(
|
239 |
}.bind(this))
|
240 |
}.bind(this))
|
241 |
}
|
@@ -619,12 +619,16 @@
|
|
619 |
}
|
620 |
|
621 |
Sepa.prototype.getSourceArgs = function () {
|
622 |
-
|
623 |
mandate: {
|
624 |
notification_method: 'email',
|
625 |
-
interval: this.cart_contains_subscription() ? 'scheduled' : 'one_time'
|
626 |
}
|
627 |
});
|
|
|
|
|
|
|
|
|
628 |
}
|
629 |
|
630 |
IDEAL.prototype = $.extend({}, LocalPayment.prototype, IDEAL.prototype);
|
17 |
|
18 |
$(document.body).on('click', '#place_order', this.place_order.bind(this));
|
19 |
|
20 |
+
if (this.is_current_page('order_pay')) {
|
21 |
$('#order_review').on('submit', this.process_order_pay.bind(this));
|
22 |
}
|
23 |
|
86 |
|
87 |
LocalPayment.prototype.place_order = function (e) {
|
88 |
if (this.is_gateway_selected()) {
|
89 |
+
if (!this.payment_token_received && !this.is_saved_method_selected()) {
|
90 |
e.preventDefault();
|
91 |
this.createSource();
|
92 |
}
|
235 |
}).done(function (response) {
|
236 |
resolve(response);
|
237 |
}.bind(this)).fail(function () {
|
238 |
+
reject();
|
239 |
}.bind(this))
|
240 |
}.bind(this))
|
241 |
}
|
619 |
}
|
620 |
|
621 |
Sepa.prototype.getSourceArgs = function () {
|
622 |
+
var args = $.extend({}, LocalPayment.prototype.getSourceArgs.apply(this, arguments), {
|
623 |
mandate: {
|
624 |
notification_method: 'email',
|
625 |
+
interval: this.cart_contains_subscription() || this.is_change_payment_method() ? 'scheduled' : 'one_time'
|
626 |
}
|
627 |
});
|
628 |
+
if (args.mandate.interval === 'scheduled') {
|
629 |
+
delete args.amount;
|
630 |
+
}
|
631 |
+
return args;
|
632 |
}
|
633 |
|
634 |
IDEAL.prototype = $.extend({}, LocalPayment.prototype, IDEAL.prototype);
|
assets/js/frontend/local-payment.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(r,i){var e=r("#place_order").css("width");function s(e){i.BaseGateway.call(this,e),i.CheckoutGateway.call(this),r(document.body).on("click","#place_order",this.place_order.bind(this)),"order_pay"===this.get_page()&&r("#order_review").on("submit",this.process_order_pay.bind(this)),this.maybe_hide_gateway()}function t(e){this.elementType="idealBank",this.confirmation_method="confirmIdealPayment",s.call(this,e),window.addEventListener("hashchange",this.hashChange.bind(this))}function n(e){this.elementType="iban",s.call(this,e)}function o(e){s.call(this,e),r(document.body).on("change",".wc-stripe-klarna-category",this.category_change.bind(this)),window.addEventListener("hashchange",this.hashchange.bind(this)),r("form.checkout").on("change",".form-row:not(.address-field) .input-text, .form-row:not(.address-field) select",this.input_change.bind(this))}function a(e){this.elementType="fpxBank",this.confirmation_method="confirmFpxPayment",s.call(this,e),window.addEventListener("hashchange",this.hashChange.bind(this))}function h(e){s.call(this,e),window.addEventListener("hashchange",this.hashChange.bind(this))}function c(e){this.elementType="auBankAccount",this.confirmation_method="confirmAuBecsDebitPayment",s.call(this,e),window.addEventListener("hashchange",this.hashChange.bind(this))}function p(e){this.confirmation_method="confirmGrabPayPayment",s.call(this,e),window.addEventListener("hashchange",this.hashChange.bind(this))}r(document.body).on("updated_checkout",function(){r("#place_order").css("min-width",e)}),(s.prototype=r.extend({},i.BaseGateway.prototype,i.CheckoutGateway.prototype)).initialize=function(){this.mount_button()},s.prototype.elementType=null,s.prototype.is_active=function(){return r("#wc_stripe_local_payment_"+this.gateway_id).data("active")},s.prototype.maybe_hide_gateway=function(){this.is_active()?r(this.container).show():r(this.container).hide()},s.prototype.createSource=function(){return new Promise(function(t,e){var i=function(e){e.error?this.submit_error(e.error.message):(this.payment_token_received=!0,r(this.token_selector).val(e.source.id),this.get_form().submit()),t()}.bind(this);if(null!=this.elementType)if(this.confirmation_method){if(!this.isValidElement())return this.submit_error({code:"empty_element_"+this.params.local_payment_type,message:wc_stripe_messages.empty_element});this.payment_token_received=!0,this.get_form().submit()}else this.stripe.createSource(this.element,this.getSourceArgs()).then(i)["catch"](function(e){this.submit_error(e.message)}.bind(this));else this.payment_token_received=!0,this.get_form().submit()}.bind(this))},s.prototype.place_order=function(e){this.is_gateway_selected()&&(this.payment_token_received||(e.preventDefault(),this.createSource()))},s.prototype.process_order_pay=function(e){this.is_gateway_selected()&&(e.preventDefault(),(e=this.get_form().serializeArray()).push({name:"_wpnonce",value:this.params.rest_nonce}),e.push({name:"order_id",value:this.params.order_id}),r.ajax({url:this.params.routes.order_pay+window.location.search,method:"POST",dataType:"json",data:r.param(e)}).done(function(e){e.success?window.location.href=e.redirect:this.submit_error(e.message)}.bind(this)).fail(function(e,t,i){this.submit_error(i)}.bind(this)))},s.prototype.show_payment_button=function(){this.show_place_order()},s.prototype.hide_place_order=function(){},s.prototype.show_place_order=function(){i.CheckoutGateway.prototype.show_place_order.apply(this,arguments),this.payment_token_received&&r("#place_order").text(r("#place_order").data("value"))},s.prototype.getSourceArgs=function(){return{type:this.params.local_payment_type,amount:this.get_total_price_cents(),currency:this.get_currency(),owner:{name:this.get_customer_name("billing"),email:this.fields.get("billing_email",null)},redirect:{return_url:this.params.return_url}}},s.prototype.updated_checkout=function(){this.mount_button(),this.maybe_hide_gateway()},s.prototype.mount_button=function(){var e="#wc_stripe_local_payment_"+this.gateway_id;r(e).length&&null!=this.elementType&&(r(e).empty(),this.element||(this.element=this.elements.create(this.elementType,this.params.element_params),this.element.on("change",this.handleElementChange.bind(this))),this.elementEmpty=!0,this.element.mount(e))},s.prototype.handleElementChange=function(e){this.elementEmpty=e.empty},s.prototype.load_external_script=function(e){var t=document.createElement("script");t.type="text/javascript",t.src=e,t.onload=function(){this.script_loaded=!0}.bind(this),document.body.appendChild(t)},s.prototype.hashChange=function(e){!this.is_gateway_selected()||(e=e.newURL.match(/response=(.*)/))&&(history.pushState({},"",window.location.pathname),e=JSON.parse(window.atob(e[1])),this.processConfirmation(e))},s.prototype.processConfirmation=function(e){this.stripe[this.confirmation_method](e.client_secret,this.get_confirmation_args(e)).then(function(e){if(e.error)return this.submit_error(e.error.message);this.get_form().submit()}.bind(this))},s.prototype.get_confirmation_args=function(e){e={payment_method:{billing_details:{name:this.get_first_name("billing")+" "+this.get_last_name("billing")}},return_url:e.return_url};return this.elementType&&(e.payment_method[this.params.local_payment_type]=this.element),e},s.prototype.isValidElement=function(){return!this.element||!this.elementEmpty},s.prototype.delete_order_source=function(){return new Promise(function(t,e){r.ajax({url:this.params.routes.delete_order_source,method:"DELETE",dataType:"json",beforeSend:this.ajax_before_send.bind(this)}).done(function(e){t(e)}.bind(this)).fail(function(){e(response)}.bind(this))}.bind(this))},s.prototype.update_source=function(i){return new Promise(function(t,e){r.ajax({url:this.params.routes.update_source,method:"POST",dataType:"json",data:{_wpnonce:this.params.rest_nonce,updates:i,source_id:this.source.id,client_secret:this.source.client_secret,payment_method:this.gateway_id}}).done(function(e){t(e.source)}.bind(this)).fail(function(){e()})}.bind(this))},o.prototype.category_change=function(e){var t=function(){r('[id^="klarna-instance-"]').slideUp();var e=r('[name="klarna_category"]:checked').val();r("#klarna-instance-"+e).slideDown()}.bind(this);e.originalEvent?t():(clearTimeout(this.categoryChangeTimer),this.categoryChangeTimer=setTimeout(t,500))},o.prototype.processConfirmation=function(e){window.Klarna.Payments.init({client_token:e.klarna.client_token},function(e){}.bind(this)),this.payment_categories=e.klarna.payment_method_categories.split(","),this.render_ui(!0)},o.prototype.hashchange=function(){this.is_gateway_selected()&&(history.pushState({},"",window.location.pathname),this.get_form().submit())},o.prototype.render_ui=function(e){if((this.show_form_false=0)<this.payment_categories.length){r("#wc_stripe_local_payment_stripe_klarna").show();for(var t=0;t<this.payment_categories.length;t++){var i,s="#klarna-instance-"+this.payment_categories[t];if(r(s).empty(),r("#klarna-category-"+this.payment_categories[t]).length){this.params.translate&&(i=this.source.klarna[this.payment_categories[t]+"_name"],r('label[for="klarna_'+this.payment_categories[t]+'"').text(i)),r("#klarna-category-"+this.payment_categories[t]).show();try{window.Klarna.Payments.load({container:s,payment_method_category:this.payment_categories[t],instance_id:"klarna-instance-"+this.payment_categories[t]},function(e){e.show_form||(this.source=null)}.bind(this))}catch(n){window.alert(n)}}}e&&r('[id^="klarna-category-"]:visible [name="klarna_category"]').first().prop("checked",!0).trigger("change")}},o.prototype.place_order=function(e){this.is_gateway_selected()&&(e.preventDefault(),this.checkout_fields_valid()&&window.Klarna.Payments.authorize({instance_id:"klarna-instance-"+r('[name="klarna_category"]:checked').val()},function(e){e.approved?(this.set_nonce(this.source.id),this.payment_token_received=!0,this.get_form().submit()):e.error?this.submit_error(e.error):this.submit_error(this.params.messages.klarna_error)}.bind(this)))},o.prototype.klarna_fields_valid=function(){if(this.fields.validateFields("billing"))return!this.needs_shipping()||(!!("billing"===this.get_shipping_prefix()||"shipping"===this.get_shipping_prefix()&&this.fields.validateFields("shipping"))||void 0)},o.prototype.initialize=function(){this.is_gateway_selected()&&this.is_active()&&!this.source&&this.klarna_fields_valid()&&this.createSource()},o.prototype.createSource=function(){clearTimeout(this.createSourceTimer),this.createSourceTimer=setTimeout(function(){this.show_loader(),this.stripe.createSource(this.getSourceArgs()).then(function(e){if(this.hide_loader(),e.error)return this.submit_error(e.error.message);this.source=e.source,this.set_nonce(this.source.id),this.filter_payment_method_categories(),this.processConfirmation(this.source)}.bind(this))["catch"](function(e){this.hide_loader(),this.submit_error(e.message)}.bind(this))}.bind(this),100)},o.prototype.getSourceArgs=function(){return r.extend(!0,{},this.get_gateway_data().source_args,function(){var e,t={owner:{name:this.fields.get("billing_first_name")+" "+this.fields.get("billing_last_name"),email:this.fields.get("billing_email"),address:{city:this.fields.get("billing_city"),country:this.fields.get("billing_country"),line1:this.fields.get("billing_address_1"),line2:this.fields.get("billing_address_2"),postal_code:this.fields.get("billing_postcode"),state:this.fields.get("billing_state")}},klarna:{purchase_country:this.fields.get("billing_country"),first_name:this.fields.get("billing_first_name"),last_name:this.fields.get("billing_last_name")}};return this.needs_shipping()&&(e=this.get_shipping_prefix(),t.klarna.shipping_first_name=this.fields.get("first_name",e),t.klarna.shipping_last_name=this.fields.get("last_name",e),t.source_order={shipping:{address:{city:this.fields.get("city",e),country:this.fields.get("country",e),line1:this.fields.get("address_1",e),line2:this.fields.get("address_2",e),postal_code:this.fields.get("postcode",e),state:this.fields.get("state",e)}}}),t}.bind(this)())},o.prototype.updated_checkout=function(){this.source?this.update_source():this.is_gateway_selected()&&this.is_active()&&this.klarna_fields_valid()&&this.createSource(),s.prototype.updated_checkout.apply(this,arguments)},o.prototype.update_source=function(){var e=this.get_source_update_args(this.getSourceArgs());this.show_loader(),s.prototype.update_source.call(this,e).then(function(e){this.source=e,this.filter_payment_method_categories(),this.hide_loader(),this.render_ui()}.bind(this))},o.prototype.checkout_error=function(){s.prototype.checkout_error.apply(this,arguments),this.is_gateway_selected()&&this.createSource()},o.prototype.show_loader=function(){r(this.container).find(".wc-stripe-klarna-loader").remove(),r(this.container).find('label[for="payment_method_'+this.gateway_id+'" ]').after(this.params.klarna_loader)},o.prototype.hide_loader=function(){r(this.container).find(".wc-stripe-klarna-loader").remove()},o.prototype.filter_payment_method_categories=function(){var e=this.source.klarna.payment_method_categories.split(",");this.source.klarna.payment_method_categories=e.filter(function(e){return-1<this.get_gateway_data().payment_sections.indexOf(e)}.bind(this)).join(",")},o.prototype.get_source_update_args=function(e){return["type","currency","statement_descriptor","redirect","klarna.product","klarna.locale","klarna.custom_payment_methods"].reduce(function(e,t){if(-1<t.indexOf(".")){var i=t.split(".");return delete i.slice(0,i.length-1).reduce(function(e,t){return e[t]},e)[t=i[i.length-1]],e}return delete e[t],e},e)},o.prototype.on_payment_method_selected=function(e,t){t===this.gateway_id&&(this.source||(this.klarna_fields_valid()?this.createSource():this.submit_error(this.params.messages.required_field)),i.CheckoutGateway.prototype.on_payment_method_selected.apply(this,arguments))},o.prototype.input_change=function(){this.is_gateway_selected()&&(this.source?this.update_source():this.klarna_fields_valid()&&this.createSource())},h.prototype.updated_checkout=function(){!this.script_loaded&&r(this.container).length&&this.load_external_script(this.params.qr_script),s.prototype.updated_checkout.apply(this,arguments)},h.prototype.hashChange=function(e){!this.is_gateway_selected()||(e=e.newURL.match(/qrcode=(.*)/))&&(history.pushState({},"",window.location.pathname),this.qrcode=JSON.parse(window.atob(e[1])),this.get_form().unblock().removeClass("processing").addClass("wechat"),new QRCode("wc_stripe_local_payment_stripe_wechat",{text:this.qrcode.code,width:128,height:128,colorDark:"#424770",colorLight:"#f8fbfd",correctLevel:QRCode.CorrectLevel.H}),r("#wc_stripe_local_payment_stripe_wechat").append('<p class="qrcode-message">'+this.params.qr_message+"</p>"),this.payment_token_received=!0,this.show_place_order())},h.prototype.place_order=function(){this.get_form().is(".wechat")?window.location=this.qrcode.redirect:s.prototype.place_order.apply(this,arguments)},c.prototype.get_confirmation_args=function(e){var t=s.prototype.get_confirmation_args.apply(this,arguments);return t.payment_method.billing_details.email=this.fields.get("billing_email"),t},n.prototype.getSourceArgs=function(){return r.extend({},s.prototype.getSourceArgs.apply(this,arguments),{mandate:{notification_method:"email",interval:this.cart_contains_subscription()?"scheduled":"one_time"}})},t.prototype=r.extend({},s.prototype,t.prototype),n.prototype=r.extend({},s.prototype,n.prototype),o.prototype=r.extend({},s.prototype,o.prototype),a.prototype=r.extend({},s.prototype,a.prototype),h.prototype=r.extend({},s.prototype,h.prototype),c.prototype=r.extend({},s.prototype,c.prototype),p.prototype=r.extend({},s.prototype,p.prototype);var l,_={ideal:t,sepa_debit:n,klarna:o,fpx:a,wechat:h,au_becs_debit:c,grabpay:p};for(l in wc_stripe_local_payment_params.gateways){var d=wc_stripe_local_payment_params.gateways[l];new(_[d.local_payment_type]||s)(d)}}(jQuery,window.wc_stripe);
|
1 |
+
!function(r,i){var e=r("#place_order").css("width");function s(e){i.BaseGateway.call(this,e),i.CheckoutGateway.call(this),r(document.body).on("click","#place_order",this.place_order.bind(this)),this.is_current_page("order_pay")&&r("#order_review").on("submit",this.process_order_pay.bind(this)),this.maybe_hide_gateway()}function t(e){this.elementType="idealBank",this.confirmation_method="confirmIdealPayment",s.call(this,e),window.addEventListener("hashchange",this.hashChange.bind(this))}function n(e){this.elementType="iban",s.call(this,e)}function a(e){s.call(this,e),r(document.body).on("change",".wc-stripe-klarna-category",this.category_change.bind(this)),window.addEventListener("hashchange",this.hashchange.bind(this)),r("form.checkout").on("change",".form-row:not(.address-field) .input-text, .form-row:not(.address-field) select",this.input_change.bind(this))}function o(e){this.elementType="fpxBank",this.confirmation_method="confirmFpxPayment",s.call(this,e),window.addEventListener("hashchange",this.hashChange.bind(this))}function h(e){s.call(this,e),window.addEventListener("hashchange",this.hashChange.bind(this))}function c(e){this.elementType="auBankAccount",this.confirmation_method="confirmAuBecsDebitPayment",s.call(this,e),window.addEventListener("hashchange",this.hashChange.bind(this))}function p(e){this.confirmation_method="confirmGrabPayPayment",s.call(this,e),window.addEventListener("hashchange",this.hashChange.bind(this))}r(document.body).on("updated_checkout",function(){r("#place_order").css("min-width",e)}),(s.prototype=r.extend({},i.BaseGateway.prototype,i.CheckoutGateway.prototype)).initialize=function(){this.mount_button()},s.prototype.elementType=null,s.prototype.is_active=function(){return r("#wc_stripe_local_payment_"+this.gateway_id).data("active")},s.prototype.maybe_hide_gateway=function(){this.is_active()?r(this.container).show():r(this.container).hide()},s.prototype.createSource=function(){return new Promise(function(t,e){var i=function(e){e.error?this.submit_error(e.error.message):(this.payment_token_received=!0,r(this.token_selector).val(e.source.id),this.get_form().submit()),t()}.bind(this);if(null!=this.elementType)if(this.confirmation_method){if(!this.isValidElement())return this.submit_error({code:"empty_element_"+this.params.local_payment_type,message:wc_stripe_messages.empty_element});this.payment_token_received=!0,this.get_form().submit()}else this.stripe.createSource(this.element,this.getSourceArgs()).then(i)["catch"](function(e){this.submit_error(e.message)}.bind(this));else this.payment_token_received=!0,this.get_form().submit()}.bind(this))},s.prototype.place_order=function(e){this.is_gateway_selected()&&(this.payment_token_received||this.is_saved_method_selected()||(e.preventDefault(),this.createSource()))},s.prototype.process_order_pay=function(e){this.is_gateway_selected()&&(e.preventDefault(),(e=this.get_form().serializeArray()).push({name:"_wpnonce",value:this.params.rest_nonce}),e.push({name:"order_id",value:this.params.order_id}),r.ajax({url:this.params.routes.order_pay+window.location.search,method:"POST",dataType:"json",data:r.param(e)}).done(function(e){e.success?window.location.href=e.redirect:this.submit_error(e.message)}.bind(this)).fail(function(e,t,i){this.submit_error(i)}.bind(this)))},s.prototype.show_payment_button=function(){this.show_place_order()},s.prototype.hide_place_order=function(){},s.prototype.show_place_order=function(){i.CheckoutGateway.prototype.show_place_order.apply(this,arguments),this.payment_token_received&&r("#place_order").text(r("#place_order").data("value"))},s.prototype.getSourceArgs=function(){return{type:this.params.local_payment_type,amount:this.get_total_price_cents(),currency:this.get_currency(),owner:{name:this.get_customer_name("billing"),email:this.fields.get("billing_email",null)},redirect:{return_url:this.params.return_url}}},s.prototype.updated_checkout=function(){this.mount_button(),this.maybe_hide_gateway()},s.prototype.mount_button=function(){var e="#wc_stripe_local_payment_"+this.gateway_id;r(e).length&&null!=this.elementType&&(r(e).empty(),this.element||(this.element=this.elements.create(this.elementType,this.params.element_params),this.element.on("change",this.handleElementChange.bind(this))),this.elementEmpty=!0,this.element.mount(e))},s.prototype.handleElementChange=function(e){this.elementEmpty=e.empty},s.prototype.load_external_script=function(e){var t=document.createElement("script");t.type="text/javascript",t.src=e,t.onload=function(){this.script_loaded=!0}.bind(this),document.body.appendChild(t)},s.prototype.hashChange=function(e){!this.is_gateway_selected()||(e=e.newURL.match(/response=(.*)/))&&(history.pushState({},"",window.location.pathname),e=JSON.parse(window.atob(e[1])),this.processConfirmation(e))},s.prototype.processConfirmation=function(e){this.stripe[this.confirmation_method](e.client_secret,this.get_confirmation_args(e)).then(function(e){if(e.error)return this.submit_error(e.error.message);this.get_form().submit()}.bind(this))},s.prototype.get_confirmation_args=function(e){e={payment_method:{billing_details:{name:this.get_first_name("billing")+" "+this.get_last_name("billing")}},return_url:e.return_url};return this.elementType&&(e.payment_method[this.params.local_payment_type]=this.element),e},s.prototype.isValidElement=function(){return!this.element||!this.elementEmpty},s.prototype.delete_order_source=function(){return new Promise(function(t,e){r.ajax({url:this.params.routes.delete_order_source,method:"DELETE",dataType:"json",beforeSend:this.ajax_before_send.bind(this)}).done(function(e){t(e)}.bind(this)).fail(function(){e()}.bind(this))}.bind(this))},s.prototype.update_source=function(i){return new Promise(function(t,e){r.ajax({url:this.params.routes.update_source,method:"POST",dataType:"json",data:{_wpnonce:this.params.rest_nonce,updates:i,source_id:this.source.id,client_secret:this.source.client_secret,payment_method:this.gateway_id}}).done(function(e){t(e.source)}.bind(this)).fail(function(){e()})}.bind(this))},a.prototype.category_change=function(e){var t=function(){r('[id^="klarna-instance-"]').slideUp();var e=r('[name="klarna_category"]:checked').val();r("#klarna-instance-"+e).slideDown()}.bind(this);e.originalEvent?t():(clearTimeout(this.categoryChangeTimer),this.categoryChangeTimer=setTimeout(t,500))},a.prototype.processConfirmation=function(e){window.Klarna.Payments.init({client_token:e.klarna.client_token},function(e){}.bind(this)),this.payment_categories=e.klarna.payment_method_categories.split(","),this.render_ui(!0)},a.prototype.hashchange=function(){this.is_gateway_selected()&&(history.pushState({},"",window.location.pathname),this.get_form().submit())},a.prototype.render_ui=function(e){if((this.show_form_false=0)<this.payment_categories.length){r("#wc_stripe_local_payment_stripe_klarna").show();for(var t=0;t<this.payment_categories.length;t++){var i,s="#klarna-instance-"+this.payment_categories[t];if(r(s).empty(),r("#klarna-category-"+this.payment_categories[t]).length){this.params.translate&&(i=this.source.klarna[this.payment_categories[t]+"_name"],r('label[for="klarna_'+this.payment_categories[t]+'"').text(i)),r("#klarna-category-"+this.payment_categories[t]).show();try{window.Klarna.Payments.load({container:s,payment_method_category:this.payment_categories[t],instance_id:"klarna-instance-"+this.payment_categories[t]},function(e){e.show_form||(this.source=null)}.bind(this))}catch(n){window.alert(n)}}}e&&r('[id^="klarna-category-"]:visible [name="klarna_category"]').first().prop("checked",!0).trigger("change")}},a.prototype.place_order=function(e){this.is_gateway_selected()&&(e.preventDefault(),this.checkout_fields_valid()&&window.Klarna.Payments.authorize({instance_id:"klarna-instance-"+r('[name="klarna_category"]:checked').val()},function(e){e.approved?(this.set_nonce(this.source.id),this.payment_token_received=!0,this.get_form().submit()):e.error?this.submit_error(e.error):this.submit_error(this.params.messages.klarna_error)}.bind(this)))},a.prototype.klarna_fields_valid=function(){if(this.fields.validateFields("billing"))return!this.needs_shipping()||(!!("billing"===this.get_shipping_prefix()||"shipping"===this.get_shipping_prefix()&&this.fields.validateFields("shipping"))||void 0)},a.prototype.initialize=function(){this.is_gateway_selected()&&this.is_active()&&!this.source&&this.klarna_fields_valid()&&this.createSource()},a.prototype.createSource=function(){clearTimeout(this.createSourceTimer),this.createSourceTimer=setTimeout(function(){this.show_loader(),this.stripe.createSource(this.getSourceArgs()).then(function(e){if(this.hide_loader(),e.error)return this.submit_error(e.error.message);this.source=e.source,this.set_nonce(this.source.id),this.filter_payment_method_categories(),this.processConfirmation(this.source)}.bind(this))["catch"](function(e){this.hide_loader(),this.submit_error(e.message)}.bind(this))}.bind(this),100)},a.prototype.getSourceArgs=function(){return r.extend(!0,{},this.get_gateway_data().source_args,function(){var e,t={owner:{name:this.fields.get("billing_first_name")+" "+this.fields.get("billing_last_name"),email:this.fields.get("billing_email"),address:{city:this.fields.get("billing_city"),country:this.fields.get("billing_country"),line1:this.fields.get("billing_address_1"),line2:this.fields.get("billing_address_2"),postal_code:this.fields.get("billing_postcode"),state:this.fields.get("billing_state")}},klarna:{purchase_country:this.fields.get("billing_country"),first_name:this.fields.get("billing_first_name"),last_name:this.fields.get("billing_last_name")}};return this.needs_shipping()&&(e=this.get_shipping_prefix(),t.klarna.shipping_first_name=this.fields.get("first_name",e),t.klarna.shipping_last_name=this.fields.get("last_name",e),t.source_order={shipping:{address:{city:this.fields.get("city",e),country:this.fields.get("country",e),line1:this.fields.get("address_1",e),line2:this.fields.get("address_2",e),postal_code:this.fields.get("postcode",e),state:this.fields.get("state",e)}}}),t}.bind(this)())},a.prototype.updated_checkout=function(){this.source?this.update_source():this.is_gateway_selected()&&this.is_active()&&this.klarna_fields_valid()&&this.createSource(),s.prototype.updated_checkout.apply(this,arguments)},a.prototype.update_source=function(){var e=this.get_source_update_args(this.getSourceArgs());this.show_loader(),s.prototype.update_source.call(this,e).then(function(e){this.source=e,this.filter_payment_method_categories(),this.hide_loader(),this.render_ui()}.bind(this))},a.prototype.checkout_error=function(){s.prototype.checkout_error.apply(this,arguments),this.is_gateway_selected()&&this.createSource()},a.prototype.show_loader=function(){r(this.container).find(".wc-stripe-klarna-loader").remove(),r(this.container).find('label[for="payment_method_'+this.gateway_id+'" ]').after(this.params.klarna_loader)},a.prototype.hide_loader=function(){r(this.container).find(".wc-stripe-klarna-loader").remove()},a.prototype.filter_payment_method_categories=function(){var e=this.source.klarna.payment_method_categories.split(",");this.source.klarna.payment_method_categories=e.filter(function(e){return-1<this.get_gateway_data().payment_sections.indexOf(e)}.bind(this)).join(",")},a.prototype.get_source_update_args=function(e){return["type","currency","statement_descriptor","redirect","klarna.product","klarna.locale","klarna.custom_payment_methods"].reduce(function(e,t){if(-1<t.indexOf(".")){var i=t.split(".");return delete i.slice(0,i.length-1).reduce(function(e,t){return e[t]},e)[t=i[i.length-1]],e}return delete e[t],e},e)},a.prototype.on_payment_method_selected=function(e,t){t===this.gateway_id&&(this.source||(this.klarna_fields_valid()?this.createSource():this.submit_error(this.params.messages.required_field)),i.CheckoutGateway.prototype.on_payment_method_selected.apply(this,arguments))},a.prototype.input_change=function(){this.is_gateway_selected()&&(this.source?this.update_source():this.klarna_fields_valid()&&this.createSource())},h.prototype.updated_checkout=function(){!this.script_loaded&&r(this.container).length&&this.load_external_script(this.params.qr_script),s.prototype.updated_checkout.apply(this,arguments)},h.prototype.hashChange=function(e){!this.is_gateway_selected()||(e=e.newURL.match(/qrcode=(.*)/))&&(history.pushState({},"",window.location.pathname),this.qrcode=JSON.parse(window.atob(e[1])),this.get_form().unblock().removeClass("processing").addClass("wechat"),new QRCode("wc_stripe_local_payment_stripe_wechat",{text:this.qrcode.code,width:128,height:128,colorDark:"#424770",colorLight:"#f8fbfd",correctLevel:QRCode.CorrectLevel.H}),r("#wc_stripe_local_payment_stripe_wechat").append('<p class="qrcode-message">'+this.params.qr_message+"</p>"),this.payment_token_received=!0,this.show_place_order())},h.prototype.place_order=function(){this.get_form().is(".wechat")?window.location=this.qrcode.redirect:s.prototype.place_order.apply(this,arguments)},c.prototype.get_confirmation_args=function(e){var t=s.prototype.get_confirmation_args.apply(this,arguments);return t.payment_method.billing_details.email=this.fields.get("billing_email"),t},n.prototype.getSourceArgs=function(){var e=r.extend({},s.prototype.getSourceArgs.apply(this,arguments),{mandate:{notification_method:"email",interval:this.cart_contains_subscription()||this.is_change_payment_method()?"scheduled":"one_time"}});return"scheduled"===e.mandate.interval&&delete e.amount,e},t.prototype=r.extend({},s.prototype,t.prototype),n.prototype=r.extend({},s.prototype,n.prototype),a.prototype=r.extend({},s.prototype,a.prototype),o.prototype=r.extend({},s.prototype,o.prototype),h.prototype=r.extend({},s.prototype,h.prototype),c.prototype=r.extend({},s.prototype,c.prototype),p.prototype=r.extend({},s.prototype,p.prototype);var l,_={ideal:t,sepa_debit:n,klarna:a,fpx:o,wechat:h,au_becs_debit:c,grabpay:p};for(l in wc_stripe_local_payment_params.gateways){var d=wc_stripe_local_payment_params.gateways[l];new(_[d.local_payment_type]||s)(d)}}(jQuery,window.wc_stripe);
|
assets/js/frontend/payment-request.js
CHANGED
@@ -1,12 +1,15 @@
|
|
1 |
(function ($, wc_stripe) {
|
2 |
|
|
|
|
|
3 |
// Product page functionality
|
4 |
if ($(document.body).is('.single-product')) {
|
5 |
/**
|
6 |
* [PaymentRequest description]
|
7 |
*/
|
8 |
-
function
|
9 |
wc_stripe.BaseGateway.call(this, wc_stripe_payment_request_params);
|
|
|
10 |
this.old_qty = this.get_quantity();
|
11 |
}
|
12 |
|
@@ -115,8 +118,9 @@
|
|
115 |
/**
|
116 |
* [PaymentRequest description]
|
117 |
*/
|
118 |
-
function
|
119 |
wc_stripe.BaseGateway.call(this, wc_stripe_payment_request_params);
|
|
|
120 |
}
|
121 |
|
122 |
PaymentRequest.prototype = $.extend({}, wc_stripe.BaseGateway.prototype, wc_stripe.CartGateway.prototype, wc_stripe.PaymentRequest.prototype);
|
@@ -168,8 +172,9 @@
|
|
168 |
/**
|
169 |
* [PaymentRequest description]
|
170 |
*/
|
171 |
-
function
|
172 |
wc_stripe.BaseGateway.call(this, wc_stripe_payment_request_params);
|
|
|
173 |
}
|
174 |
|
175 |
PaymentRequest.prototype = $.extend({}, wc_stripe.BaseGateway.prototype, wc_stripe.CheckoutGateway.prototype, wc_stripe.PaymentRequest.prototype);
|
1 |
(function ($, wc_stripe) {
|
2 |
|
3 |
+
var PaymentRequest;
|
4 |
+
|
5 |
// Product page functionality
|
6 |
if ($(document.body).is('.single-product')) {
|
7 |
/**
|
8 |
* [PaymentRequest description]
|
9 |
*/
|
10 |
+
PaymentRequest = function () {
|
11 |
wc_stripe.BaseGateway.call(this, wc_stripe_payment_request_params);
|
12 |
+
window.addEventListener('hashchange', this.hashchange.bind(this));
|
13 |
this.old_qty = this.get_quantity();
|
14 |
}
|
15 |
|
118 |
/**
|
119 |
* [PaymentRequest description]
|
120 |
*/
|
121 |
+
PaymentRequest = function () {
|
122 |
wc_stripe.BaseGateway.call(this, wc_stripe_payment_request_params);
|
123 |
+
window.addEventListener('hashchange', this.hashchange.bind(this));
|
124 |
}
|
125 |
|
126 |
PaymentRequest.prototype = $.extend({}, wc_stripe.BaseGateway.prototype, wc_stripe.CartGateway.prototype, wc_stripe.PaymentRequest.prototype);
|
172 |
/**
|
173 |
* [PaymentRequest description]
|
174 |
*/
|
175 |
+
PaymentRequest = function () {
|
176 |
wc_stripe.BaseGateway.call(this, wc_stripe_payment_request_params);
|
177 |
+
window.addEventListener('hashchange', this.hashchange.bind(this));
|
178 |
}
|
179 |
|
180 |
PaymentRequest.prototype = $.extend({}, wc_stripe.BaseGateway.prototype, wc_stripe.CheckoutGateway.prototype, wc_stripe.PaymentRequest.prototype);
|
assets/js/frontend/wc-stripe.js
CHANGED
@@ -87,13 +87,21 @@
|
|
87 |
*/
|
88 |
|
89 |
|
90 |
-
wc_stripe.BaseGateway.prototype.submit_error = function (
|
91 |
-
message = this.get_error_message(
|
92 |
|
93 |
-
if (message.indexOf('</ul>')
|
94 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
}
|
96 |
-
|
|
|
97 |
this.submit_message(message);
|
98 |
};
|
99 |
|
@@ -139,6 +147,30 @@
|
|
139 |
}
|
140 |
};
|
141 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
wc_stripe.BaseGateway.prototype.get_first_name = function (prefix) {
|
143 |
return $('#' + prefix + '_first_name').val();
|
144 |
};
|
@@ -182,6 +214,9 @@
|
|
182 |
var data = $(this.container).find(".woocommerce_".concat(this.gateway_id, "_gateway_data")).data('gateway');
|
183 |
if (typeof data === 'undefined' && this.is_current_page('checkout')) {
|
184 |
data = $('form.checkout').find(".woocommerce_".concat(this.gateway_id, "_gateway_data")).data('gateway');
|
|
|
|
|
|
|
185 |
}
|
186 |
return data;
|
187 |
};
|
@@ -239,7 +274,6 @@
|
|
239 |
}
|
240 |
});
|
241 |
}
|
242 |
-
;
|
243 |
}
|
244 |
/**
|
245 |
* @return {[type]}
|
@@ -626,10 +660,95 @@
|
|
626 |
}.bind(this));
|
627 |
}.bind(this));
|
628 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
629 |
/**
|
630 |
-
*
|
|
|
|
|
|
|
631 |
*/
|
632 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
633 |
|
634 |
wc_stripe.BaseGateway.prototype.serialize_form = function ($form) {
|
635 |
var formData = $form.find('input').filter(function (i, e) {
|
@@ -801,6 +920,23 @@
|
|
801 |
}
|
802 |
};
|
803 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
804 |
wc_stripe.CheckoutGateway.prototype.update_shipping_address = function () {
|
805 |
return wc_stripe.BaseGateway.prototype.update_shipping_address.apply(this, arguments).then(function (data) {
|
806 |
// populate the checkout fields with the address
|
@@ -1262,21 +1398,21 @@
|
|
1262 |
apiVersion: 2,
|
1263 |
apiVersionMinor: 0
|
1264 |
};
|
1265 |
-
|
1266 |
-
var allowedCardAuthMethods = ["PAN_ONLY"];
|
1267 |
var baseCardPaymentMethod = {
|
1268 |
type: 'CARD',
|
1269 |
parameters: {
|
1270 |
-
allowedAuthMethods:
|
1271 |
-
allowedCardNetworks:
|
|
|
1272 |
}
|
1273 |
};
|
|
|
1274 |
/**
|
1275 |
* Populate the WC checkout fields.
|
1276 |
* @param {[type]}
|
1277 |
* @return {[type]}
|
1278 |
*/
|
1279 |
-
|
1280 |
wc_stripe.GooglePay.prototype.update_addresses = function (paymentData) {
|
1281 |
if (paymentData.paymentMethodData.info.billingAddress) {
|
1282 |
var billing_address = paymentData.paymentMethodData.info.billingAddress;
|
@@ -1497,7 +1633,17 @@
|
|
1497 |
this.paymentsClient.loadPaymentData(this.build_payment_request()).then(function (paymentData) {
|
1498 |
var data = JSON.parse(paymentData.paymentMethodData.tokenizationData.token);
|
1499 |
this.update_addresses(paymentData);
|
1500 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1501 |
}.bind(this))["catch"](function (err) {
|
1502 |
if (err.statusCode === "CANCELED") {
|
1503 |
return;
|
@@ -1602,7 +1748,7 @@
|
|
1602 |
wc_stripe.CheckoutFields = function (params, page) {
|
1603 |
this.params = params;
|
1604 |
this.page = page;
|
1605 |
-
this.session_values = this.
|
1606 |
this.fields = new Map(Object.keys(this.params).map(function (k) {
|
1607 |
if (this.params[k].value === null) {
|
1608 |
if (k in this.session_values && this.session_values[k] !== null) {
|
@@ -1626,7 +1772,7 @@
|
|
1626 |
}
|
1627 |
};
|
1628 |
|
1629 |
-
wc_stripe.CheckoutFields.prototype.
|
1630 |
if ('sessionStorage' in window && window.sessionStorage !== null) {
|
1631 |
return ['getItem', 'setItem'].reduce(function (exists, method) {
|
1632 |
return !exists ? exists : method in sessionStorage;
|
@@ -1637,7 +1783,7 @@
|
|
1637 |
|
1638 |
wc_stripe.CheckoutFields.prototype.init_i18n = function () {
|
1639 |
if (typeof wc_address_i18n_params !== 'undefined') {
|
1640 |
-
this.locales =
|
1641 |
} else {
|
1642 |
this.locales = null;
|
1643 |
}
|
@@ -1652,7 +1798,7 @@
|
|
1652 |
if (name === 'billing_country' || name === 'shipping_country') {
|
1653 |
this.update_required_fields(value, name);
|
1654 |
}
|
1655 |
-
if (this.
|
1656 |
sessionStorage.setItem('wc_stripe_checkout_fields', JSON.stringify(this.toJson()));
|
1657 |
}
|
1658 |
} catch (err) {
|
@@ -1701,10 +1847,11 @@
|
|
1701 |
};
|
1702 |
|
1703 |
wc_stripe.CheckoutFields.prototype.get = function (k, prefix) {
|
|
|
1704 |
if (this[k] && typeof this[k] === 'function') {
|
1705 |
-
|
1706 |
} else {
|
1707 |
-
|
1708 |
|
1709 |
if (typeof value === 'undefined' || value === null || value === '') {
|
1710 |
if (typeof prefix !== 'undefined') {
|
@@ -2046,9 +2193,12 @@
|
|
2046 |
}
|
2047 |
|
2048 |
try {
|
2049 |
-
stripe = Stripe(wc_stripe_params_v3.api_key, {
|
2050 |
-
|
2051 |
-
|
|
|
|
|
|
|
2052 |
} catch (error) {
|
2053 |
window.alert(error);
|
2054 |
console.log(error);
|
87 |
*/
|
88 |
|
89 |
|
90 |
+
wc_stripe.BaseGateway.prototype.submit_error = function (error) {
|
91 |
+
var message = this.get_error_message(error);
|
92 |
|
93 |
+
if (message.indexOf('</ul>') < 0) {
|
94 |
+
var classes = (function () {
|
95 |
+
var classes = 'woocommerce-NoticeGroup';
|
96 |
+
if (this.is_current_page('checkout')) {
|
97 |
+
classes += ' woocommerce-NoticeGroup-checkout';
|
98 |
+
}
|
99 |
+
return classes;
|
100 |
+
}.bind(this)());
|
101 |
+
message = '<div class="' + classes + '"><ul class="woocommerce-error"><li>' + message + '</li></ul></div>';
|
102 |
}
|
103 |
+
var custom_message = $(document.body).triggerHandler('wc_stripe_submit_error', [message, error, this]);
|
104 |
+
message = typeof custom_message === 'undefined' ? message : custom_message;
|
105 |
this.submit_message(message);
|
106 |
};
|
107 |
|
147 |
}
|
148 |
};
|
149 |
|
150 |
+
wc_stripe.BaseGateway.prototype.get_billing_details = function () {
|
151 |
+
var details = {
|
152 |
+
name: this.get_customer_name('billing'),
|
153 |
+
address: {
|
154 |
+
city: this.fields.get('billing_city', null),
|
155 |
+
country: this.fields.get('billing_country', null),
|
156 |
+
line1: this.fields.get('billing_address_1', null),
|
157 |
+
line2: this.fields.get('billing_address_2', null),
|
158 |
+
postal_code: this.fields.get('billing_postcode', null),
|
159 |
+
state: this.fields.get('billing_state', null)
|
160 |
+
}
|
161 |
+
}
|
162 |
+
if (!details.name || details.name === ' ') {
|
163 |
+
delete details.name;
|
164 |
+
}
|
165 |
+
if (this.fields.get('billing_email') != '') {
|
166 |
+
details.email = this.fields.get('billing_email');
|
167 |
+
}
|
168 |
+
if (this.fields.get('billing_phone') != '') {
|
169 |
+
details.phone = this.fields.get('billing_phone');
|
170 |
+
}
|
171 |
+
return details;
|
172 |
+
}
|
173 |
+
|
174 |
wc_stripe.BaseGateway.prototype.get_first_name = function (prefix) {
|
175 |
return $('#' + prefix + '_first_name').val();
|
176 |
};
|
214 |
var data = $(this.container).find(".woocommerce_".concat(this.gateway_id, "_gateway_data")).data('gateway');
|
215 |
if (typeof data === 'undefined' && this.is_current_page('checkout')) {
|
216 |
data = $('form.checkout').find(".woocommerce_".concat(this.gateway_id, "_gateway_data")).data('gateway');
|
217 |
+
if (typeof data === 'undefined') {
|
218 |
+
data = $('.woocommerce_' + this.gateway_id + '_gateway_data').data('gateway');
|
219 |
+
}
|
220 |
}
|
221 |
return data;
|
222 |
};
|
274 |
}
|
275 |
});
|
276 |
}
|
|
|
277 |
}
|
278 |
/**
|
279 |
* @return {[type]}
|
660 |
}.bind(this));
|
661 |
}.bind(this));
|
662 |
};
|
663 |
+
|
664 |
+
wc_stripe.BaseGateway.prototype.process_payment = function () {
|
665 |
+
$.ajax({
|
666 |
+
method: 'POST',
|
667 |
+
url: this.params.routes.checkout_payment,
|
668 |
+
dataType: 'json',
|
669 |
+
data: $.extend({}, this.fields.toJson(), {'_wpnonce': this.params.rest_nonce})
|
670 |
+
}).done(function (result) {
|
671 |
+
if (result.result && result.result === 'success') {
|
672 |
+
window.location = result.redirect;
|
673 |
+
} else {
|
674 |
+
if (result.messages) {
|
675 |
+
this.submit_error(result.messages);
|
676 |
+
} else {
|
677 |
+
this.submit_error(wc_checkout_params.i18n_checkout_error);
|
678 |
+
}
|
679 |
+
}
|
680 |
+
}.bind(this)).fail(function () {
|
681 |
+
|
682 |
+
}.bind(this))
|
683 |
+
}
|
684 |
+
|
685 |
+
wc_stripe.BaseGateway.prototype.handle_card_action = function (obj) {
|
686 |
+
try {
|
687 |
+
this.stripe.handleCardAction(obj.client_secret).then(function (result) {
|
688 |
+
if (result.error) {
|
689 |
+
this.payment_token_received = false;
|
690 |
+
this.submit_error(result.error);
|
691 |
+
this.sync_payment_intent(obj.order_id, obj.client_secret).catch(function (response) {
|
692 |
+
this.submit_error(response.message);
|
693 |
+
}.bind(this));
|
694 |
+
return;
|
695 |
+
}
|
696 |
+
if (this.is_current_page('order_pay')) {
|
697 |
+
this.get_form().submit();
|
698 |
+
} else {
|
699 |
+
this.process_payment();
|
700 |
+
}
|
701 |
+
}.bind(this)).catch(function (error) {
|
702 |
+
this.submit_error(error.message);
|
703 |
+
}.bind(this))
|
704 |
+
return false;
|
705 |
+
} catch (err) {
|
706 |
+
|
707 |
+
}
|
708 |
+
}
|
709 |
+
|
710 |
+
wc_stripe.BaseGateway.prototype.hashchange = function (e) {
|
711 |
+
var match = e.newURL.match(/response=(.*)/);
|
712 |
+
if (match) {
|
713 |
+
try {
|
714 |
+
var obj = JSON.parse(window.atob(match[1]));
|
715 |
+
if (obj && obj.hasOwnProperty('client_secret') && obj.gateway_id === this.gateway_id) {
|
716 |
+
history.pushState({}, '', window.location.pathname);
|
717 |
+
this.handle_card_action(obj);
|
718 |
+
}
|
719 |
+
} catch (err) {
|
720 |
+
|
721 |
+
}
|
722 |
+
}
|
723 |
+
return true;
|
724 |
+
}
|
725 |
+
|
726 |
/**
|
727 |
+
* [sync_payment_intent description]
|
728 |
+
* @param {[type]} order_id [description]
|
729 |
+
* @param {[type]} client_secret [description]
|
730 |
+
* @return {[type]} [description]
|
731 |
*/
|
732 |
+
wc_stripe.BaseGateway.prototype.sync_payment_intent = function (order_id, client_secret) {
|
733 |
+
return new Promise(function (resolve, reject) {
|
734 |
+
// call intent api
|
735 |
+
$.when($.ajax({
|
736 |
+
method: 'POST',
|
737 |
+
dataType: 'json',
|
738 |
+
url: this.params.routes.sync_intent,
|
739 |
+
data: {order_id: order_id, client_secret: client_secret},
|
740 |
+
beforeSend: this.ajax_before_send.bind(this)
|
741 |
+
})).done(function (response) {
|
742 |
+
if (response.code) {
|
743 |
+
reject(response);
|
744 |
+
} else {
|
745 |
+
resolve(response);
|
746 |
+
}
|
747 |
+
}).fail(function (xhr, textStatus, errorThrown) {
|
748 |
+
this.submit_error(errorThrown);
|
749 |
+
}.bind(this));
|
750 |
+
}.bind(this))
|
751 |
+
}
|
752 |
|
753 |
wc_stripe.BaseGateway.prototype.serialize_form = function ($form) {
|
754 |
var formData = $form.find('input').filter(function (i, e) {
|
920 |
}
|
921 |
};
|
922 |
|
923 |
+
wc_stripe.CheckoutGateway.prototype.has3DSecureParams = function () {
|
924 |
+
if (this.is_gateway_selected() && (this.is_current_page('order_pay') || this.is_change_payment_method())) {
|
925 |
+
if (window.location.hash && typeof window.location.hash === 'string') {
|
926 |
+
var match = window.location.hash.match(/response=(.*)/);
|
927 |
+
try {
|
928 |
+
var obj = JSON.parse(window.atob(match[1]));
|
929 |
+
if (obj && obj.hasOwnProperty('client_secret')) {
|
930 |
+
$('[name="terms"]').prop('checked', true);
|
931 |
+
this.handle_card_action(obj);
|
932 |
+
}
|
933 |
+
} catch (err) {
|
934 |
+
|
935 |
+
}
|
936 |
+
}
|
937 |
+
}
|
938 |
+
}
|
939 |
+
|
940 |
wc_stripe.CheckoutGateway.prototype.update_shipping_address = function () {
|
941 |
return wc_stripe.BaseGateway.prototype.update_shipping_address.apply(this, arguments).then(function (data) {
|
942 |
// populate the checkout fields with the address
|
1398 |
apiVersion: 2,
|
1399 |
apiVersionMinor: 0
|
1400 |
};
|
1401 |
+
|
|
|
1402 |
var baseCardPaymentMethod = {
|
1403 |
type: 'CARD',
|
1404 |
parameters: {
|
1405 |
+
allowedAuthMethods: ["PAN_ONLY"],
|
1406 |
+
allowedCardNetworks: ["AMEX", "DISCOVER", "INTERAC", "JCB", "MASTERCARD", "VISA"],
|
1407 |
+
assuranceDetailsRequired: true
|
1408 |
}
|
1409 |
};
|
1410 |
+
|
1411 |
/**
|
1412 |
* Populate the WC checkout fields.
|
1413 |
* @param {[type]}
|
1414 |
* @return {[type]}
|
1415 |
*/
|
|
|
1416 |
wc_stripe.GooglePay.prototype.update_addresses = function (paymentData) {
|
1417 |
if (paymentData.paymentMethodData.info.billingAddress) {
|
1418 |
var billing_address = paymentData.paymentMethodData.info.billingAddress;
|
1633 |
this.paymentsClient.loadPaymentData(this.build_payment_request()).then(function (paymentData) {
|
1634 |
var data = JSON.parse(paymentData.paymentMethodData.tokenizationData.token);
|
1635 |
this.update_addresses(paymentData);
|
1636 |
+
// convert token to payment method
|
1637 |
+
this.stripe.createPaymentMethod({
|
1638 |
+
type: 'card',
|
1639 |
+
card: {token: data.id},
|
1640 |
+
billing_details: this.get_billing_details()
|
1641 |
+
}).then(function (result) {
|
1642 |
+
if (result.error) {
|
1643 |
+
return this.submit_error(result.error);
|
1644 |
+
}
|
1645 |
+
this.on_token_received(result.paymentMethod);
|
1646 |
+
}.bind(this));
|
1647 |
}.bind(this))["catch"](function (err) {
|
1648 |
if (err.statusCode === "CANCELED") {
|
1649 |
return;
|
1748 |
wc_stripe.CheckoutFields = function (params, page) {
|
1749 |
this.params = params;
|
1750 |
this.page = page;
|
1751 |
+
this.session_values = this.supportsSessionStorage() && sessionStorage.getItem('wc_stripe_checkout_fields') ? JSON.parse(sessionStorage.getItem('wc_stripe_checkout_fields')) : {};
|
1752 |
this.fields = new Map(Object.keys(this.params).map(function (k) {
|
1753 |
if (this.params[k].value === null) {
|
1754 |
if (k in this.session_values && this.session_values[k] !== null) {
|
1772 |
}
|
1773 |
};
|
1774 |
|
1775 |
+
wc_stripe.CheckoutFields.prototype.supportsSessionStorage = function () {
|
1776 |
if ('sessionStorage' in window && window.sessionStorage !== null) {
|
1777 |
return ['getItem', 'setItem'].reduce(function (exists, method) {
|
1778 |
return !exists ? exists : method in sessionStorage;
|
1783 |
|
1784 |
wc_stripe.CheckoutFields.prototype.init_i18n = function () {
|
1785 |
if (typeof wc_address_i18n_params !== 'undefined') {
|
1786 |
+
this.locales = JSON.parse(wc_address_i18n_params.locale.replace(/"/g, '"'));
|
1787 |
} else {
|
1788 |
this.locales = null;
|
1789 |
}
|
1798 |
if (name === 'billing_country' || name === 'shipping_country') {
|
1799 |
this.update_required_fields(value, name);
|
1800 |
}
|
1801 |
+
if (this.supportsSessionStorage()) {
|
1802 |
sessionStorage.setItem('wc_stripe_checkout_fields', JSON.stringify(this.toJson()));
|
1803 |
}
|
1804 |
} catch (err) {
|
1847 |
};
|
1848 |
|
1849 |
wc_stripe.CheckoutFields.prototype.get = function (k, prefix) {
|
1850 |
+
var value;
|
1851 |
if (this[k] && typeof this[k] === 'function') {
|
1852 |
+
value = this[k]().get.call(this, prefix);
|
1853 |
} else {
|
1854 |
+
value = this.fields.get(k);
|
1855 |
|
1856 |
if (typeof value === 'undefined' || value === null || value === '') {
|
1857 |
if (typeof prefix !== 'undefined') {
|
2193 |
}
|
2194 |
|
2195 |
try {
|
2196 |
+
stripe = Stripe(wc_stripe_params_v3.api_key, (function () {
|
2197 |
+
if (wc_stripe_params_v3.mode === 'test' && wc_stripe_params_v3.account === '') {
|
2198 |
+
return {};
|
2199 |
+
}
|
2200 |
+
return {stripeAccount: wc_stripe_params_v3.account};
|
2201 |
+
}()));
|
2202 |
} catch (error) {
|
2203 |
window.alert(error);
|
2204 |
console.log(error);
|
assets/js/frontend/wc-stripe.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(i,o){i.wc_stripe={};var s=null;"undefined"==typeof wc_stripe_checkout_fields&&(i.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=s,this.elements=s.elements(o.extend({},{locale:"auto"},this.get_element_options())),this.fields=r,this.initialize()},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.get_element_options=function(){return{}},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){-1==(t=this.get_error_message(t)).indexOf("</ul>")&&(t='<div class="woocommerce-error">'+t+"</div>"),this.submit_message(t)},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.code&&(t=wc_stripe_messages[t.code]||t.message),t},wc_stripe.BaseGateway.prototype.submit_message=function(t){o(".woocommerce-error, .woocommerce-message, .woocommerce-info").remove();var e=o(this.message_container);e.closest("form").length&&(e=e.closest("form")),e.prepend(t),e.removeClass("processing").unblock(),e.find(".input-text, select, input:checkbox").blur(),o.scroll_to_notices?o.scroll_to_notices(e):o("html, body").animate({scrollTop:e.offset().top-100},1e3)},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.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")&&(t=o("form.checkout").find(".woocommerce_".concat(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.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=s.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){i.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"),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 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){0<this.params.user_id&&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?i.location.reload():"success"===t.result?i.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.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("cfw_updated_checkout",this.updated_checkout.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.order_review()},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.order_review=function(){var t,e=i.location.href.match(/order_review.+payment_method=([\w]+).+payment_nonce=(.+)/);e&&1<e.length&&(t=e[1],e=e[2],this.gateway_id===t&&(this.payment_token_received=!0,this.set_nonce(e),this.set_use_new_option(!0)))},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(":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&&o("form.checkout").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},wc_stripe.CheckoutGateway.prototype.unblock=function(){o().block&&o("form.checkout").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.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.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.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 0<o('[name="variation_id"]').length},wc_stripe.ProductGateway.prototype.variable_product_selected=function(){return!1!==this.get_product_data().variation},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.add_to_cart=function(){return new Promise(function(e,i){this.block(),o.ajax({url:this.params.routes.add_to_cart,method:"POST",dataType:"json",data:{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()},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){o.ajax({url:this.params.routes.cart_calculation,method:"POST",dataType:"json",data:{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},beforeSend:this.ajax_before_send.bind(this)}).done(function(t){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(){}.bind(this))}.bind(this))},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(){};var a={apiVersion:2,apiVersionMinor:0},n={type:"CARD",parameters:{allowedAuthMethods:["PAN_ONLY"],allowedCardNetworks:["AMEX","DISCOVER","INTERAC","JCB","MASTERCARD","VISA"]}};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)),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({},a,{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({},a);e.allowedPaymentMethods=[n],this.paymentsClient.isReadyToPay(e).then(function(){this.can_pay=!0,this.create_button(),t()}.bind(this))["catch"](function(t){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({onClick:this.start.bind(this),buttonColor:this.params.button_color,buttonType:this.params.button_style})),this.$button.addClass("gpay-button-container")},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.on_token_received(e)}.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.initialize=function(){this.createPaymentRequest(),this.canMakePayment()},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.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){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.PaymentRequest.prototype.create_button=function(){this.paymentRequestButton.mount("#wc-stripe-payment-request-container")},wc_stripe.CheckoutFields=function(t,e){this.params=t,this.page=e,this.session_values=this.supportSessionStorage()&&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"))&&(o("form.checkout").on("change",".input-text, select",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.supportSessionStorage=function(){return"sessionStorage"in i&&null!==i.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=o.parseJSON(wc_address_i18n_params.locale.replace(/"/g,'"')):this.locales=null},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.supportSessionStorage()&&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.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){t=t.split(" ");0<t.length&&this.fields.set(e+"_first_name",t[0]),1<t.length&&this.fields.set(e+"_last_name",t[1])},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{s=Stripe(wc_stripe_params_v3.api_key,{stripeAccount:wc_stripe_params_v3.account})}catch(t){return i.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.elements=i.elements(o.extend({},{locale:"auto"},this.get_element_options())),this.fields=r,this.initialize()},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.get_element_options=function(){return{}},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){var e=this.get_error_message(t);e.indexOf("</ul>")<0&&(e='<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>'+e+"</li></ul></div>");t=o(document.body).triggerHandler("wc_stripe_submit_error",[e,t,this]);e=void 0===t?e:t,this.submit_message(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.code&&(t=wc_stripe_messages[t.code]||t.message),t},wc_stripe.BaseGateway.prototype.submit_message=function(t){o(".woocommerce-error, .woocommerce-message, .woocommerce-info").remove();var e=o(this.message_container);e.closest("form").length&&(e=e.closest("form")),e.prepend(t),e.removeClass("processing").unblock(),e.find(".input-text, select, input:checkbox").blur(),o.scroll_to_notices?o.scroll_to_notices(e):o("html, body").animate({scrollTop:e.offset().top-100},1e3)},wc_stripe.BaseGateway.prototype.get_billing_details=function(){var t={name:this.get_customer_name("billing"),address:{city:this.fields.get("billing_city",null),country:this.fields.get("billing_country",null),line1:this.fields.get("billing_address_1",null),line2:this.fields.get("billing_address_2",null),postal_code:this.fields.get("billing_postcode",null),state:this.fields.get("billing_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.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.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"),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 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){0<this.params.user_id&&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(){o.ajax({method:"POST",url:this.params.routes.checkout_payment,dataType:"json",data:o.extend({},this.fields.toJson(),{_wpnonce:this.params.rest_nonce})}).done(function(t){t.result&&"success"===t.result?a.location=t.redirect:t.messages?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_card_action=function(e){try{return this.stripe.handleCardAction(e.client_secret).then(function(t){if(t.error)return this.payment_token_received=!1,this.submit_error(t.error),void this.sync_payment_intent(e.order_id,e.client_secret)["catch"](function(t){this.submit_error(t.message)}.bind(this));this.is_current_page("order_pay")?this.get_form().submit():this.process_payment()}.bind(this))["catch"](function(t){this.submit_error(t.message)}.bind(this)),!1}catch(t){}},wc_stripe.BaseGateway.prototype.hashchange=function(t){var e=t.newURL.match(/response=(.*)/);if(e)try{var i=JSON.parse(a.atob(e[1]));i&&i.hasOwnProperty("client_secret")&&i.gateway_id===this.gateway_id&&(history.pushState({},"",a.location.pathname),this.handle_card_action(i))}catch(s){}return!0},wc_stripe.BaseGateway.prototype.sync_payment_intent=function(t,s){return new Promise(function(e,i){o.when(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.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("cfw_updated_checkout",this.updated_checkout.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.order_review()},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.order_review=function(){var t,e=a.location.href.match(/order_review.+payment_method=([\w]+).+payment_nonce=(.+)/);e&&1<e.length&&(t=e[1],e=e[2],this.gateway_id===t&&(this.payment_token_received=!0,this.set_nonce(e),this.set_use_new_option(!0)))},wc_stripe.CheckoutGateway.prototype.has3DSecureParams=function(){if(this.is_gateway_selected()&&(this.is_current_page("order_pay")||this.is_change_payment_method())&&a.location.hash&&"string"==typeof a.location.hash){var t=a.location.hash.match(/response=(.*)/);try{var e=JSON.parse(a.atob(t[1]));e&&e.hasOwnProperty("client_secret")&&(o('[name="terms"]').prop("checked",!0),this.handle_card_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(":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&&o("form.checkout").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},wc_stripe.CheckoutGateway.prototype.unblock=function(){o().block&&o("form.checkout").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.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.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.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 0<o('[name="variation_id"]').length},wc_stripe.ProductGateway.prototype.variable_product_selected=function(){return!1!==this.get_product_data().variation},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.add_to_cart=function(){return new Promise(function(e,i){this.block(),o.ajax({url:this.params.routes.add_to_cart,method:"POST",dataType:"json",data:{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()},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){o.ajax({url:this.params.routes.cart_calculation,method:"POST",dataType:"json",data:{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},beforeSend:this.ajax_before_send.bind(this)}).done(function(t){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(){}.bind(this))}.bind(this))},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(){};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)),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){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({onClick:this.start.bind(this),buttonColor:this.params.button_color,buttonType:this.params.button_style})),this.$button.addClass("gpay-button-container")},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.initialize=function(){this.createPaymentRequest(),this.canMakePayment()},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.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){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.PaymentRequest.prototype.create_button=function(){this.paymentRequestButton.mount("#wc-stripe-payment-request-container")},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"))&&(o("form.checkout").on("change",".input-text, select",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(/"/g,'"')):this.locales=null},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.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){t=t.split(" ");0<t.length&&this.fields.set(e+"_first_name",t[0]),1<t.length&&this.fields.set(e+"_last_name",t[1])},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,"test"===wc_stripe_params_v3.mode&&""===wc_stripe_params_v3.account?{}:{stripeAccount:wc_stripe_params_v3.account})}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
@@ -1,15 +1,15 @@
|
|
1 |
-
# Copyright (C)
|
2 |
# This file is distributed under the same license as the Stripe For WooCommerce plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Stripe For WooCommerce 3.2.
|
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:
|
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"
|
@@ -30,7 +30,7 @@ msgstr ""
|
|
30 |
msgid "Payment Plugins, support@paymentplugins.com"
|
31 |
msgstr ""
|
32 |
|
33 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:
|
34 |
#: includes/admin/meta-boxes/views/html-product-data.php:14
|
35 |
#: includes/gateways/settings/ach-settings.php:9
|
36 |
#: includes/gateways/settings/applepay-settings.php:11
|
@@ -40,11 +40,11 @@ msgstr ""
|
|
40 |
msgid "Enabled"
|
41 |
msgstr ""
|
42 |
|
43 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:
|
44 |
msgid "If enabled, your site can accept %s payments through Stripe."
|
45 |
msgstr ""
|
46 |
|
47 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:
|
48 |
#: includes/gateways/settings/ach-settings.php:66
|
49 |
#: includes/gateways/settings/applepay-settings.php:20
|
50 |
#: includes/gateways/settings/cc-settings.php:17
|
@@ -53,7 +53,7 @@ msgstr ""
|
|
53 |
msgid "General Settings"
|
54 |
msgstr ""
|
55 |
|
56 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:
|
57 |
#: includes/admin/meta-boxes/views/html-charge-data-subview.php:47
|
58 |
#: includes/gateways/settings/ach-settings.php:70
|
59 |
#: includes/gateways/settings/applepay-settings.php:24
|
@@ -63,7 +63,7 @@ msgstr ""
|
|
63 |
msgid "Title"
|
64 |
msgstr ""
|
65 |
|
66 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:
|
67 |
#: includes/gateways/settings/ach-settings.php:76
|
68 |
#: includes/gateways/settings/applepay-settings.php:30
|
69 |
#: includes/gateways/settings/cc-settings.php:27
|
@@ -72,7 +72,7 @@ msgstr ""
|
|
72 |
msgid "Description"
|
73 |
msgstr ""
|
74 |
|
75 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:
|
76 |
#: includes/gateways/settings/ach-settings.php:79
|
77 |
#: includes/gateways/settings/applepay-settings.php:33
|
78 |
#: includes/gateways/settings/cc-settings.php:30
|
@@ -81,25 +81,38 @@ msgstr ""
|
|
81 |
msgid "Leave blank if you don't want a description to show for the gateway."
|
82 |
msgstr ""
|
83 |
|
84 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:
|
85 |
#: includes/gateways/settings/ach-settings.php:83
|
86 |
msgid "Order Button Text"
|
87 |
msgstr ""
|
88 |
|
89 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:
|
90 |
#: includes/gateways/settings/ach-settings.php:86
|
91 |
msgid "The text on the Place Order button that displays when the gateway is selected on the checkout page."
|
92 |
msgstr ""
|
93 |
|
94 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
msgid "Order %s"
|
96 |
msgstr ""
|
97 |
|
98 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:
|
99 |
msgid "Gateway will appear when store currency is <strong>%s</strong>"
|
100 |
msgstr ""
|
101 |
|
102 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:
|
|
|
|
|
|
|
|
|
|
|
103 |
msgid " & billing country is <strong>%s</strong>"
|
104 |
msgstr ""
|
105 |
|
@@ -111,7 +124,7 @@ msgstr ""
|
|
111 |
#: includes/controllers/class-wc-stripe-controller-cart.php:134
|
112 |
#: includes/controllers/class-wc-stripe-controller-cart.php:192
|
113 |
#: includes/controllers/class-wc-stripe-controller-googlepay.php:136
|
114 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:
|
115 |
msgid "Total"
|
116 |
msgstr ""
|
117 |
|
@@ -128,6 +141,7 @@ msgid "Error saving payment method. Reason: %s"
|
|
128 |
msgstr ""
|
129 |
|
130 |
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:538
|
|
|
131 |
msgid "Order refunded in Stripe. Amount: %s"
|
132 |
msgstr ""
|
133 |
|
@@ -199,7 +213,7 @@ msgid "Error saving payment method for subscription. Reason: %s"
|
|
199 |
msgstr ""
|
200 |
|
201 |
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:1191
|
202 |
-
#: includes/abstract/abstract-wc-stripe-payment.php:
|
203 |
msgid "Order %1$s from %2$s"
|
204 |
msgstr ""
|
205 |
|
@@ -223,29 +237,29 @@ msgstr ""
|
|
223 |
msgid "Increase your conversion rate by offering %1$s on your Product and Cart pages, or at the top of the checkout page. <br/><strong>Note:</strong> you can control which products display %s by going to the product edit page."
|
224 |
msgstr ""
|
225 |
|
226 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
227 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
228 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:
|
229 |
#: includes/wc-stripe-functions.php:405
|
230 |
#: includes/wc-stripe-functions.php:470
|
231 |
msgid "Shipping"
|
232 |
msgstr ""
|
233 |
|
234 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
235 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
236 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:
|
237 |
#: includes/wc-stripe-functions.php:422
|
238 |
#: includes/wc-stripe-functions.php:478
|
239 |
msgid "Discount"
|
240 |
msgstr ""
|
241 |
|
242 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
243 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:
|
244 |
#: includes/wc-stripe-functions.php:430
|
245 |
msgid "Tax"
|
246 |
msgstr ""
|
247 |
|
248 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
249 |
#: includes/wc-stripe-functions.php:489
|
250 |
msgid "Fees"
|
251 |
msgstr ""
|
@@ -270,13 +284,13 @@ msgstr ""
|
|
270 |
msgid "Transaction Id cannot be empty."
|
271 |
msgstr ""
|
272 |
|
273 |
-
#: includes/abstract/abstract-wc-stripe-payment.php:
|
274 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-ach.php:
|
275 |
msgid "Error processing payment. Reason: %s"
|
276 |
msgstr ""
|
277 |
|
278 |
#: includes/abstract/abstract-wc-stripe-rest-controller.php:58
|
279 |
-
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:
|
280 |
#: includes/controllers/class-wc-stripe-controller-order-actions.php:325
|
281 |
msgid "You do not have permissions to access this resource."
|
282 |
msgstr ""
|
@@ -341,6 +355,7 @@ msgstr ""
|
|
341 |
#: includes/admin/meta-boxes/views/html-order-actions.php:48
|
342 |
#: includes/admin/meta-boxes/views/html-order-pay.php:23
|
343 |
#: includes/admin/meta-boxes/views/html-product-data.php:47
|
|
|
344 |
#: includes/gateways/settings/applepay-settings.php:52
|
345 |
#: includes/gateways/settings/cc-settings.php:49
|
346 |
#: includes/gateways/settings/googlepay-settings.php:70
|
@@ -357,12 +372,12 @@ msgid "Charge Data"
|
|
357 |
msgstr ""
|
358 |
|
359 |
#: includes/admin/meta-boxes/views/html-charge-data-subview.php:24
|
360 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
361 |
msgid "Mode"
|
362 |
msgstr ""
|
363 |
|
364 |
#: includes/admin/meta-boxes/views/html-charge-data-subview.php:25
|
365 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
366 |
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:184
|
367 |
msgid "Live"
|
368 |
msgstr ""
|
@@ -467,6 +482,7 @@ msgstr ""
|
|
467 |
|
468 |
#: includes/admin/meta-boxes/views/html-order-pay.php:21
|
469 |
#: includes/admin/meta-boxes/views/html-product-data.php:15
|
|
|
470 |
#: includes/gateways/settings/applepay-settings.php:48
|
471 |
#: includes/gateways/settings/cc-settings.php:45
|
472 |
#: includes/gateways/settings/googlepay-settings.php:66
|
@@ -476,6 +492,7 @@ msgstr ""
|
|
476 |
|
477 |
#: includes/admin/meta-boxes/views/html-order-pay.php:24
|
478 |
#: includes/admin/meta-boxes/views/html-product-data.php:49
|
|
|
479 |
#: includes/gateways/settings/applepay-settings.php:53
|
480 |
#: includes/gateways/settings/cc-settings.php:50
|
481 |
#: includes/gateways/settings/googlepay-settings.php:71
|
@@ -520,90 +537,113 @@ msgstr ""
|
|
520 |
msgid "API Settings"
|
521 |
msgstr ""
|
522 |
|
523 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
|
|
|
|
|
|
|
|
524 |
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:184
|
525 |
msgid "Test"
|
526 |
msgstr ""
|
527 |
|
528 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
529 |
msgid "The mode determines if you are processing test transactions or live transactions on your site. Test mode allows you to simulate payments so you can test your integration."
|
530 |
msgstr ""
|
531 |
|
532 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
533 |
msgid "Account ID"
|
534 |
msgstr ""
|
535 |
|
536 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
537 |
msgid "This is your Stripe Connect ID and serves as a unique identifier."
|
538 |
msgstr ""
|
539 |
|
540 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
541 |
msgid "Connect Stripe Account"
|
542 |
msgstr ""
|
543 |
|
544 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
545 |
msgid "Click to Connect"
|
546 |
msgstr ""
|
547 |
|
548 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
549 |
msgid "We make it easy to connect Stripe to your site. Click the Connect button to go through our connect flow."
|
550 |
msgstr ""
|
551 |
|
552 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
553 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
554 |
msgid "Connection Test"
|
555 |
msgstr ""
|
556 |
|
557 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
|
|
558 |
msgid "Click this button to perform a connection test. If successful, your site is connected to Stripe."
|
559 |
msgstr ""
|
560 |
|
561 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
562 |
msgid "Webhook url"
|
563 |
msgstr ""
|
564 |
|
565 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
566 |
msgid "<strong>Important:</strong> the webhook url is called by Stripe when events occur in your account, like a source becomes chargeable. You must add this webhook to your Stripe Dashboard if you are using any of the local gateways. %1$sWebhook guide%2$s"
|
567 |
msgstr ""
|
568 |
|
569 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
570 |
msgid "Live Webhook Secret"
|
571 |
msgstr ""
|
572 |
|
573 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
574 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
575 |
msgid "The webhook secret is used to authenticate webhooks sent from Stripe. It ensures no 3rd party can send you events, pretending to be Stripe. %1$sWebhook guide%2$s"
|
576 |
msgstr ""
|
577 |
|
578 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
579 |
msgid "Test Webhook Secret"
|
580 |
msgstr ""
|
581 |
|
582 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
583 |
msgid "Debug Log"
|
584 |
msgstr ""
|
585 |
|
586 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
587 |
msgid "When enabled, the plugin logs important errors and info that can help you troubleshoot potential issues."
|
588 |
msgstr ""
|
589 |
|
590 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
591 |
msgid "%s Your Stripe account has been connected. You can now accept Live and Test payments. You can Re-Connect if you want to recycle your API keys for security."
|
592 |
msgstr ""
|
593 |
|
594 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
595 |
msgid "Click To Re-Connect"
|
596 |
msgstr ""
|
597 |
|
598 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
599 |
msgid "Please try again."
|
600 |
msgstr ""
|
601 |
|
602 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
603 |
msgid "We were not able to connect your Stripe account. Reason: %s"
|
604 |
msgstr ""
|
605 |
|
606 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
607 |
msgid "Your Stripe account has been connected to your WooCommerce store. You may now accept payments in Live and Test mode."
|
608 |
msgstr ""
|
609 |
|
@@ -712,16 +752,16 @@ msgstr ""
|
|
712 |
msgid "Quantity must be greater than zero."
|
713 |
msgstr ""
|
714 |
|
715 |
-
#: includes/controllers/class-wc-stripe-controller-checkout.php:
|
716 |
msgid "Some required fields were missing. Please click %1$shere%2$s to complete your payment."
|
717 |
msgstr ""
|
718 |
|
719 |
-
#: includes/controllers/class-wc-stripe-controller-checkout.php:
|
720 |
msgid "Please review your order details then click Place Order."
|
721 |
msgstr ""
|
722 |
|
723 |
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:82
|
724 |
-
msgid "You cannot register your domain until you have
|
725 |
msgstr ""
|
726 |
|
727 |
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:111
|
@@ -740,16 +780,20 @@ msgstr ""
|
|
740 |
msgid "Webhook created in Stripe for %s environment. You can test your webhook by logging in to the Stripe dashboard"
|
741 |
msgstr ""
|
742 |
|
743 |
-
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:
|
744 |
-
msgid "
|
745 |
msgstr ""
|
746 |
|
747 |
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:217
|
748 |
-
|
|
|
|
|
|
|
|
|
749 |
msgid "Mode: %s. Invalid publishable key. Please check your entry."
|
750 |
msgstr ""
|
751 |
|
752 |
-
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:
|
753 |
msgid "Connection test to Stripe was successful. Mode: %s."
|
754 |
msgstr ""
|
755 |
|
@@ -812,15 +856,15 @@ msgstr ""
|
|
812 |
msgid "ACH gateway that integrates with your Stripe account."
|
813 |
msgstr ""
|
814 |
|
815 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-ach.php:
|
816 |
msgid "Saved Banks"
|
817 |
msgstr ""
|
818 |
|
819 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-ach.php:
|
820 |
msgid "New Bank"
|
821 |
msgstr ""
|
822 |
|
823 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-ach.php:
|
824 |
msgid "You must set the API mode to live in order to enable the Plaid development environment."
|
825 |
msgstr ""
|
826 |
|
@@ -833,7 +877,7 @@ msgstr ""
|
|
833 |
msgid "Alipay gateway that integrates with your Stripe account."
|
834 |
msgstr ""
|
835 |
|
836 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-alipay.php:
|
837 |
msgid ""
|
838 |
"Gateway will appear when store currency is CNY, or currency matches merchant's \r\n"
|
839 |
"\t\t\t\t\tdefault Stripe currency. For merchants located in DK, NO, SE, & CH, currency must be EUR."
|
@@ -928,28 +972,28 @@ msgstr ""
|
|
928 |
msgid "Giropay gateway that integrates with your Stripe account."
|
929 |
msgstr ""
|
930 |
|
931 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:
|
932 |
#: includes/gateways/settings/googlepay-settings.php:43
|
933 |
msgid "Google Pay"
|
934 |
msgstr ""
|
935 |
|
936 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:
|
937 |
msgid "Stripe Google Pay"
|
938 |
msgstr ""
|
939 |
|
940 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:
|
941 |
msgid "Google Pay gateway that integrates with your Stripe account."
|
942 |
msgstr ""
|
943 |
|
944 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:
|
945 |
msgid "Please update you product quantity before using Google Pay."
|
946 |
msgstr ""
|
947 |
|
948 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:
|
949 |
msgid "Waiting..."
|
950 |
msgstr ""
|
951 |
|
952 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:
|
953 |
msgid "loading shipping methods..."
|
954 |
msgstr ""
|
955 |
|
@@ -971,52 +1015,59 @@ msgstr ""
|
|
971 |
msgid "Ideal gateway that integrates with your Stripe account."
|
972 |
msgstr ""
|
973 |
|
974 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:
|
975 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:
|
976 |
msgid "Klarna"
|
977 |
msgstr ""
|
978 |
|
979 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:
|
980 |
msgid "Klarna gateway that integrates with your Stripe account."
|
981 |
msgstr ""
|
982 |
|
983 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
984 |
msgid "Payment Categories"
|
985 |
msgstr ""
|
986 |
|
987 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:
|
988 |
msgid "These are the payment categories that will be displayed on the checkout page if they are supported. Note, depending on the customer's billing country, not all enabled options may show."
|
989 |
msgstr ""
|
990 |
|
991 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:
|
992 |
msgid "Use Stripe translation"
|
993 |
msgstr ""
|
994 |
|
995 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:
|
996 |
msgid "If enabled, the payment option labels will use the Stripe translated text."
|
997 |
msgstr ""
|
998 |
|
999 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:
|
1000 |
msgid "Fee total"
|
1001 |
msgstr ""
|
1002 |
|
1003 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:
|
1004 |
msgid "Pay Now"
|
1005 |
msgstr ""
|
1006 |
|
1007 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:
|
1008 |
msgid "Pay Later"
|
1009 |
msgstr ""
|
1010 |
|
1011 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:
|
1012 |
msgid "Pay Over Time"
|
1013 |
msgstr ""
|
1014 |
|
1015 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:
|
1016 |
msgid "Click %1$shere%2$s for Klarna test payment methods."
|
1017 |
msgstr ""
|
1018 |
|
1019 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:
|
1020 |
msgid "Your purchase is not approved."
|
1021 |
msgstr ""
|
1022 |
|
@@ -1076,23 +1127,23 @@ msgid ""
|
|
1076 |
"\t\t\tterms and conditions of your agreement with your bank. A refund must be claimed within 8 weeks starting from the date on which your account was debited."
|
1077 |
msgstr ""
|
1078 |
|
1079 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-sepa.php:
|
1080 |
msgid "Company Name"
|
1081 |
msgstr ""
|
1082 |
|
1083 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-sepa.php:
|
1084 |
msgid "The name of your company that will appear in the SEPA mandate."
|
1085 |
msgstr ""
|
1086 |
|
1087 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-sepa.php:
|
1088 |
msgid "SEPA Test Accounts"
|
1089 |
msgstr ""
|
1090 |
|
1091 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-sepa.php:
|
1092 |
msgid "New Account"
|
1093 |
msgstr ""
|
1094 |
|
1095 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-sepa.php:
|
1096 |
msgid "Saved Accounts"
|
1097 |
msgstr ""
|
1098 |
|
@@ -1114,7 +1165,7 @@ msgstr ""
|
|
1114 |
msgid "WeChat gateway that integrates with your Stripe account."
|
1115 |
msgstr ""
|
1116 |
|
1117 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-wechat.php:
|
1118 |
msgid "Scan the QR code using your WeChat app. Once scanned click the Place Order button."
|
1119 |
msgstr ""
|
1120 |
|
@@ -1242,12 +1293,6 @@ msgstr ""
|
|
1242 |
msgid "Credit Card Display"
|
1243 |
msgstr ""
|
1244 |
|
1245 |
-
#: includes/gateways/settings/applepay-settings.php:56
|
1246 |
-
#: includes/gateways/settings/cc-settings.php:53
|
1247 |
-
#: includes/gateways/settings/payment-request-settings.php:57
|
1248 |
-
msgid "This option determines whether the customer's funds are captured immediately or authorized and can be captured at a later date."
|
1249 |
-
msgstr ""
|
1250 |
-
|
1251 |
#: includes/gateways/settings/applepay-settings.php:60
|
1252 |
#: includes/gateways/settings/googlepay-settings.php:78
|
1253 |
#: includes/gateways/settings/payment-request-settings.php:61
|
@@ -1607,7 +1652,7 @@ msgstr ""
|
|
1607 |
msgid "Card Type"
|
1608 |
msgstr ""
|
1609 |
|
1610 |
-
#: includes/tokens/class-wc-payment-token-stripe-googlepay.php:
|
1611 |
msgid "Gateway Name"
|
1612 |
msgstr ""
|
1613 |
|
@@ -1641,218 +1686,218 @@ msgstr ""
|
|
1641 |
msgid "Kind Regards,"
|
1642 |
msgstr ""
|
1643 |
|
1644 |
-
#: includes/wc-stripe-functions.php:
|
1645 |
msgid "Bootstrap form"
|
1646 |
msgstr ""
|
1647 |
|
1648 |
-
#: includes/wc-stripe-functions.php:
|
1649 |
msgid "Simple form"
|
1650 |
msgstr ""
|
1651 |
|
1652 |
-
#: includes/wc-stripe-functions.php:
|
1653 |
msgid "Minimalist form"
|
1654 |
msgstr ""
|
1655 |
|
1656 |
-
#: includes/wc-stripe-functions.php:
|
1657 |
msgid "Inline Form"
|
1658 |
msgstr ""
|
1659 |
|
1660 |
-
#: includes/wc-stripe-functions.php:
|
1661 |
msgid "Rounded Form"
|
1662 |
msgstr ""
|
1663 |
|
1664 |
-
#: includes/wc-stripe-functions.php:
|
1665 |
msgid "There was an error processing your credit card."
|
1666 |
msgstr ""
|
1667 |
|
1668 |
-
#: includes/wc-stripe-functions.php:
|
1669 |
msgid "Your card number is incomplete."
|
1670 |
msgstr ""
|
1671 |
|
1672 |
-
#: includes/wc-stripe-functions.php:
|
1673 |
msgid "The card number is incorrect. Check the card's number or use a different card."
|
1674 |
msgstr ""
|
1675 |
|
1676 |
-
#: includes/wc-stripe-functions.php:
|
1677 |
msgid "The card's security code is incorrect. Check the card's security code or use a different card."
|
1678 |
msgstr ""
|
1679 |
|
1680 |
-
#: includes/wc-stripe-functions.php:
|
1681 |
msgid "The card's ZIP code is incorrect. Check the card's ZIP code or use a different card."
|
1682 |
msgstr ""
|
1683 |
|
1684 |
-
#: includes/wc-stripe-functions.php:
|
1685 |
-
#: includes/wc-stripe-functions.php:
|
1686 |
msgid "The card number is invalid. Check the card details or use a different card."
|
1687 |
msgstr ""
|
1688 |
|
1689 |
-
#: includes/wc-stripe-functions.php:
|
1690 |
msgid "This value provided to the field contains characters that are unsupported by the field."
|
1691 |
msgstr ""
|
1692 |
|
1693 |
-
#: includes/wc-stripe-functions.php:
|
1694 |
msgid "The card's security code is invalid. Check the card's security code or use a different card."
|
1695 |
msgstr ""
|
1696 |
|
1697 |
-
#: includes/wc-stripe-functions.php:
|
1698 |
msgid "The card's expiration month is incorrect. Check the expiration date or use a different card."
|
1699 |
msgstr ""
|
1700 |
|
1701 |
-
#: includes/wc-stripe-functions.php:
|
1702 |
msgid "The card's expiration year is incorrect. Check the expiration date or use a different card."
|
1703 |
msgstr ""
|
1704 |
|
1705 |
-
#: includes/wc-stripe-functions.php:
|
1706 |
msgid "The card's address is incorrect. Check the card's address or use a different card."
|
1707 |
msgstr ""
|
1708 |
|
1709 |
-
#: includes/wc-stripe-functions.php:
|
1710 |
msgid "The card has expired. Check the expiration date or use a different card."
|
1711 |
msgstr ""
|
1712 |
|
1713 |
-
#: includes/wc-stripe-functions.php:
|
1714 |
msgid "The card has been declined."
|
1715 |
msgstr ""
|
1716 |
|
1717 |
-
#: includes/wc-stripe-functions.php:
|
1718 |
msgid "Your card's expiration year is in the past."
|
1719 |
msgstr ""
|
1720 |
|
1721 |
-
#: includes/wc-stripe-functions.php:
|
1722 |
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."
|
1723 |
msgstr ""
|
1724 |
|
1725 |
-
#: includes/wc-stripe-functions.php:
|
1726 |
msgid "The specified amount is greater than the maximum amount allowed. Use a lower amount and try again."
|
1727 |
msgstr ""
|
1728 |
|
1729 |
-
#: includes/wc-stripe-functions.php:
|
1730 |
msgid "The specified amount is less than the minimum amount allowed. Use a higher amount and try again."
|
1731 |
msgstr ""
|
1732 |
|
1733 |
-
#: includes/wc-stripe-functions.php:
|
1734 |
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."
|
1735 |
msgstr ""
|
1736 |
|
1737 |
-
#: includes/wc-stripe-functions.php:
|
1738 |
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."
|
1739 |
msgstr ""
|
1740 |
|
1741 |
-
#: includes/wc-stripe-functions.php:
|
1742 |
msgid "The bank account provided can not be used to charge, either because it is not verified yet or it is not supported."
|
1743 |
msgstr ""
|
1744 |
|
1745 |
-
#: includes/wc-stripe-functions.php:
|
1746 |
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."
|
1747 |
msgstr ""
|
1748 |
|
1749 |
-
#: includes/wc-stripe-functions.php:
|
1750 |
msgid "The bank account provided cannot be used for payouts. A different bank account must be used."
|
1751 |
msgstr ""
|
1752 |
|
1753 |
-
#: includes/wc-stripe-functions.php:
|
1754 |
msgid "Your Connect platform is attempting to share an unverified bank account with a connected account."
|
1755 |
msgstr ""
|
1756 |
|
1757 |
-
#: includes/wc-stripe-functions.php:
|
1758 |
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."
|
1759 |
msgstr ""
|
1760 |
|
1761 |
-
#: includes/wc-stripe-functions.php:
|
1762 |
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."
|
1763 |
msgstr ""
|
1764 |
|
1765 |
-
#: includes/wc-stripe-functions.php:
|
1766 |
msgid "The charge you're attempting to capture has already been captured. Update the request with an uncaptured charge ID."
|
1767 |
msgstr ""
|
1768 |
|
1769 |
-
#: includes/wc-stripe-functions.php:
|
1770 |
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."
|
1771 |
msgstr ""
|
1772 |
|
1773 |
-
#: includes/wc-stripe-functions.php:
|
1774 |
msgid "The charge you're attempting to refund has been charged back. Check the disputes documentation to learn how to respond to the dispute."
|
1775 |
msgstr ""
|
1776 |
|
1777 |
-
#: includes/wc-stripe-functions.php:
|
1778 |
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."
|
1779 |
msgstr ""
|
1780 |
|
1781 |
-
#: includes/wc-stripe-functions.php:
|
1782 |
msgid "The charge cannot be captured as the authorization has expired. Auth and capture charges must be captured within seven days."
|
1783 |
msgstr ""
|
1784 |
|
1785 |
-
#: includes/wc-stripe-functions.php:
|
1786 |
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."
|
1787 |
msgstr ""
|
1788 |
|
1789 |
-
#: includes/wc-stripe-functions.php:
|
1790 |
msgid "The email address is invalid (e.g., not properly formatted). Check that the email address is properly formatted and only includes allowed characters."
|
1791 |
msgstr ""
|
1792 |
|
1793 |
-
#: includes/wc-stripe-functions.php:
|
1794 |
msgid "The idempotency key provided is currently being used in another request. This occurs if your integration is making duplicate requests simultaneously."
|
1795 |
msgstr ""
|
1796 |
|
1797 |
-
#: includes/wc-stripe-functions.php:
|
1798 |
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."
|
1799 |
msgstr ""
|
1800 |
|
1801 |
-
#: includes/wc-stripe-functions.php:
|
1802 |
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."
|
1803 |
msgstr ""
|
1804 |
|
1805 |
-
#: includes/wc-stripe-functions.php:
|
1806 |
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."
|
1807 |
msgstr ""
|
1808 |
|
1809 |
-
#: includes/wc-stripe-functions.php:
|
1810 |
msgid "The ZIP code provided was incorrect."
|
1811 |
msgstr ""
|
1812 |
|
1813 |
-
#: includes/wc-stripe-functions.php:
|
1814 |
msgid "An error occurred while processing the card. Try again later or with a different payment method."
|
1815 |
msgstr ""
|
1816 |
|
1817 |
-
#: includes/wc-stripe-functions.php:
|
1818 |
msgid "The card does not support this type of purchase."
|
1819 |
msgstr ""
|
1820 |
|
1821 |
-
#: includes/wc-stripe-functions.php:
|
1822 |
-
#: includes/wc-stripe-functions.php:
|
1823 |
-
#: includes/wc-stripe-functions.php:
|
1824 |
msgid "The card has been declined for an unknown reason."
|
1825 |
msgstr ""
|
1826 |
|
1827 |
-
#: includes/wc-stripe-functions.php:
|
1828 |
msgid "The customer has exceeded the balance or credit limit available on their card."
|
1829 |
msgstr ""
|
1830 |
|
1831 |
-
#: includes/wc-stripe-functions.php:
|
1832 |
msgid "The card does not support the specified currency."
|
1833 |
msgstr ""
|
1834 |
|
1835 |
-
#: includes/wc-stripe-functions.php:
|
1836 |
msgid "The payment has been declined as Stripe suspects it is fraudulent."
|
1837 |
msgstr ""
|
1838 |
|
1839 |
-
#: includes/wc-stripe-functions.php:
|
1840 |
msgid "The PIN entered is incorrect. "
|
1841 |
msgstr ""
|
1842 |
|
1843 |
-
#: includes/wc-stripe-functions.php:
|
1844 |
msgid "The card has insufficient funds to complete the purchase."
|
1845 |
msgstr ""
|
1846 |
|
1847 |
-
#: includes/wc-stripe-functions.php:
|
1848 |
msgid "Please select a payment method before proceeding."
|
1849 |
msgstr ""
|
1850 |
|
1851 |
-
#: includes/wc-stripe-functions.php:
|
1852 |
msgid "Please enter your IBAN before proceeding."
|
1853 |
msgstr ""
|
1854 |
|
1855 |
-
#: includes/wc-stripe-functions.php:
|
1856 |
msgid "Please select a bank before proceeding"
|
1857 |
msgstr ""
|
1858 |
|
@@ -1929,6 +1974,6 @@ msgstr ""
|
|
1929 |
msgid "Express Checkout"
|
1930 |
msgstr ""
|
1931 |
|
1932 |
-
#: templates/checkout/credit-card.php:
|
1933 |
msgid "Save Card"
|
1934 |
msgstr ""
|
1 |
+
# Copyright (C) 2021 Payment Plugins, support@paymentplugins.com
|
2 |
# This file is distributed under the same license as the Stripe For WooCommerce plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Stripe For WooCommerce 3.2.10\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: 2021-01-03T01:20:06+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"
|
30 |
msgid "Payment Plugins, support@paymentplugins.com"
|
31 |
msgstr ""
|
32 |
|
33 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:113
|
34 |
#: includes/admin/meta-boxes/views/html-product-data.php:14
|
35 |
#: includes/gateways/settings/ach-settings.php:9
|
36 |
#: includes/gateways/settings/applepay-settings.php:11
|
40 |
msgid "Enabled"
|
41 |
msgstr ""
|
42 |
|
43 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:118
|
44 |
msgid "If enabled, your site can accept %s payments through Stripe."
|
45 |
msgstr ""
|
46 |
|
47 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:122
|
48 |
#: includes/gateways/settings/ach-settings.php:66
|
49 |
#: includes/gateways/settings/applepay-settings.php:20
|
50 |
#: includes/gateways/settings/cc-settings.php:17
|
53 |
msgid "General Settings"
|
54 |
msgstr ""
|
55 |
|
56 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:126
|
57 |
#: includes/admin/meta-boxes/views/html-charge-data-subview.php:47
|
58 |
#: includes/gateways/settings/ach-settings.php:70
|
59 |
#: includes/gateways/settings/applepay-settings.php:24
|
63 |
msgid "Title"
|
64 |
msgstr ""
|
65 |
|
66 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:132
|
67 |
#: includes/gateways/settings/ach-settings.php:76
|
68 |
#: includes/gateways/settings/applepay-settings.php:30
|
69 |
#: includes/gateways/settings/cc-settings.php:27
|
72 |
msgid "Description"
|
73 |
msgstr ""
|
74 |
|
75 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:135
|
76 |
#: includes/gateways/settings/ach-settings.php:79
|
77 |
#: includes/gateways/settings/applepay-settings.php:33
|
78 |
#: includes/gateways/settings/cc-settings.php:30
|
81 |
msgid "Leave blank if you don't want a description to show for the gateway."
|
82 |
msgstr ""
|
83 |
|
84 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:139
|
85 |
#: includes/gateways/settings/ach-settings.php:83
|
86 |
msgid "Order Button Text"
|
87 |
msgstr ""
|
88 |
|
89 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:142
|
90 |
#: includes/gateways/settings/ach-settings.php:86
|
91 |
msgid "The text on the Place Order button that displays when the gateway is selected on the checkout page."
|
92 |
msgstr ""
|
93 |
|
94 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:166
|
95 |
+
msgid "When the billing country matches one of these values, the payment method will be hidden on the checkout page."
|
96 |
+
msgstr ""
|
97 |
+
|
98 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:179
|
99 |
+
msgid "When the billing country matches one of these values, the payment method will be shown on the checkout page."
|
100 |
+
msgstr ""
|
101 |
+
|
102 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:237
|
103 |
msgid "Order %s"
|
104 |
msgstr ""
|
105 |
|
106 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:361
|
107 |
msgid "Gateway will appear when store currency is <strong>%s</strong>"
|
108 |
msgstr ""
|
109 |
|
110 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:364
|
111 |
+
msgid " & billing country is not <strong>%s</strong>"
|
112 |
+
msgstr ""
|
113 |
+
|
114 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:366
|
115 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:369
|
116 |
msgid " & billing country is <strong>%s</strong>"
|
117 |
msgstr ""
|
118 |
|
124 |
#: includes/controllers/class-wc-stripe-controller-cart.php:134
|
125 |
#: includes/controllers/class-wc-stripe-controller-cart.php:192
|
126 |
#: includes/controllers/class-wc-stripe-controller-googlepay.php:136
|
127 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:106
|
128 |
msgid "Total"
|
129 |
msgstr ""
|
130 |
|
141 |
msgstr ""
|
142 |
|
143 |
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:538
|
144 |
+
#: includes/wc-stripe-webhook-functions.php:203
|
145 |
msgid "Order refunded in Stripe. Amount: %s"
|
146 |
msgstr ""
|
147 |
|
213 |
msgstr ""
|
214 |
|
215 |
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:1191
|
216 |
+
#: includes/abstract/abstract-wc-stripe-payment.php:227
|
217 |
msgid "Order %1$s from %2$s"
|
218 |
msgstr ""
|
219 |
|
237 |
msgid "Increase your conversion rate by offering %1$s on your Product and Cart pages, or at the top of the checkout page. <br/><strong>Note:</strong> you can control which products display %s by going to the product edit page."
|
238 |
msgstr ""
|
239 |
|
240 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:1573
|
241 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:1604
|
242 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:192
|
243 |
#: includes/wc-stripe-functions.php:405
|
244 |
#: includes/wc-stripe-functions.php:470
|
245 |
msgid "Shipping"
|
246 |
msgstr ""
|
247 |
|
248 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:1581
|
249 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:1607
|
250 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:202
|
251 |
#: includes/wc-stripe-functions.php:422
|
252 |
#: includes/wc-stripe-functions.php:478
|
253 |
msgid "Discount"
|
254 |
msgstr ""
|
255 |
|
256 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:1584
|
257 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:220
|
258 |
#: includes/wc-stripe-functions.php:430
|
259 |
msgid "Tax"
|
260 |
msgstr ""
|
261 |
|
262 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:1614
|
263 |
#: includes/wc-stripe-functions.php:489
|
264 |
msgid "Fees"
|
265 |
msgstr ""
|
284 |
msgid "Transaction Id cannot be empty."
|
285 |
msgstr ""
|
286 |
|
287 |
+
#: includes/abstract/abstract-wc-stripe-payment.php:294
|
288 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-ach.php:123
|
289 |
msgid "Error processing payment. Reason: %s"
|
290 |
msgstr ""
|
291 |
|
292 |
#: includes/abstract/abstract-wc-stripe-rest-controller.php:58
|
293 |
+
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:251
|
294 |
#: includes/controllers/class-wc-stripe-controller-order-actions.php:325
|
295 |
msgid "You do not have permissions to access this resource."
|
296 |
msgstr ""
|
355 |
#: includes/admin/meta-boxes/views/html-order-actions.php:48
|
356 |
#: includes/admin/meta-boxes/views/html-order-pay.php:23
|
357 |
#: includes/admin/meta-boxes/views/html-product-data.php:47
|
358 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:81
|
359 |
#: includes/gateways/settings/applepay-settings.php:52
|
360 |
#: includes/gateways/settings/cc-settings.php:49
|
361 |
#: includes/gateways/settings/googlepay-settings.php:70
|
372 |
msgstr ""
|
373 |
|
374 |
#: includes/admin/meta-boxes/views/html-charge-data-subview.php:24
|
375 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:38
|
376 |
msgid "Mode"
|
377 |
msgstr ""
|
378 |
|
379 |
#: includes/admin/meta-boxes/views/html-charge-data-subview.php:25
|
380 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:42
|
381 |
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:184
|
382 |
msgid "Live"
|
383 |
msgstr ""
|
482 |
|
483 |
#: includes/admin/meta-boxes/views/html-order-pay.php:21
|
484 |
#: includes/admin/meta-boxes/views/html-product-data.php:15
|
485 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:77
|
486 |
#: includes/gateways/settings/applepay-settings.php:48
|
487 |
#: includes/gateways/settings/cc-settings.php:45
|
488 |
#: includes/gateways/settings/googlepay-settings.php:66
|
492 |
|
493 |
#: includes/admin/meta-boxes/views/html-order-pay.php:24
|
494 |
#: includes/admin/meta-boxes/views/html-product-data.php:49
|
495 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:82
|
496 |
#: includes/gateways/settings/applepay-settings.php:53
|
497 |
#: includes/gateways/settings/cc-settings.php:50
|
498 |
#: includes/gateways/settings/googlepay-settings.php:71
|
537 |
msgid "API Settings"
|
538 |
msgstr ""
|
539 |
|
540 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:34
|
541 |
+
msgid "When test mode is enabled you can manually enter your API keys or go through the connect process. Live mode requires that you click the Connect button."
|
542 |
+
msgstr ""
|
543 |
+
|
544 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:41
|
545 |
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:184
|
546 |
msgid "Test"
|
547 |
msgstr ""
|
548 |
|
549 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:46
|
550 |
msgid "The mode determines if you are processing test transactions or live transactions on your site. Test mode allows you to simulate payments so you can test your integration."
|
551 |
msgstr ""
|
552 |
|
553 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:50
|
554 |
msgid "Account ID"
|
555 |
msgstr ""
|
556 |
|
557 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:55
|
558 |
msgid "This is your Stripe Connect ID and serves as a unique identifier."
|
559 |
msgstr ""
|
560 |
|
561 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:59
|
562 |
msgid "Connect Stripe Account"
|
563 |
msgstr ""
|
564 |
|
565 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:60
|
566 |
msgid "Click to Connect"
|
567 |
msgstr ""
|
568 |
|
569 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:62
|
570 |
msgid "We make it easy to connect Stripe to your site. Click the Connect button to go through our connect flow."
|
571 |
msgstr ""
|
572 |
|
573 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:65
|
574 |
+
msgid "Test Publishable Key"
|
575 |
+
msgstr ""
|
576 |
+
|
577 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:69
|
578 |
+
msgid "Your publishable key is used to initialize Stripe assets."
|
579 |
+
msgstr ""
|
580 |
+
|
581 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:77
|
582 |
+
msgid "Test Secret Key"
|
583 |
+
msgstr ""
|
584 |
+
|
585 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:81
|
586 |
+
msgid "Your secret key is used to authenticate requests to Stripe."
|
587 |
+
msgstr ""
|
588 |
+
|
589 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:90
|
590 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:91
|
591 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:102
|
592 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:103
|
593 |
msgid "Connection Test"
|
594 |
msgstr ""
|
595 |
|
596 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:93
|
597 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:105
|
598 |
msgid "Click this button to perform a connection test. If successful, your site is connected to Stripe."
|
599 |
msgstr ""
|
600 |
|
601 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:114
|
602 |
msgid "Webhook url"
|
603 |
msgstr ""
|
604 |
|
605 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:117
|
606 |
msgid "<strong>Important:</strong> the webhook url is called by Stripe when events occur in your account, like a source becomes chargeable. You must add this webhook to your Stripe Dashboard if you are using any of the local gateways. %1$sWebhook guide%2$s"
|
607 |
msgstr ""
|
608 |
|
609 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:121
|
610 |
msgid "Live Webhook Secret"
|
611 |
msgstr ""
|
612 |
|
613 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:122
|
614 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:128
|
615 |
msgid "The webhook secret is used to authenticate webhooks sent from Stripe. It ensures no 3rd party can send you events, pretending to be Stripe. %1$sWebhook guide%2$s"
|
616 |
msgstr ""
|
617 |
|
618 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:127
|
619 |
msgid "Test Webhook Secret"
|
620 |
msgstr ""
|
621 |
|
622 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:132
|
623 |
msgid "Debug Log"
|
624 |
msgstr ""
|
625 |
|
626 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:136
|
627 |
msgid "When enabled, the plugin logs important errors and info that can help you troubleshoot potential issues."
|
628 |
msgstr ""
|
629 |
|
630 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:141
|
631 |
msgid "%s Your Stripe account has been connected. You can now accept Live and Test payments. You can Re-Connect if you want to recycle your API keys for security."
|
632 |
msgstr ""
|
633 |
|
634 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:165
|
635 |
msgid "Click To Re-Connect"
|
636 |
msgstr ""
|
637 |
|
638 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:183
|
639 |
msgid "Please try again."
|
640 |
msgstr ""
|
641 |
|
642 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:186
|
643 |
msgid "We were not able to connect your Stripe account. Reason: %s"
|
644 |
msgstr ""
|
645 |
|
646 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:215
|
647 |
msgid "Your Stripe account has been connected to your WooCommerce store. You may now accept payments in Live and Test mode."
|
648 |
msgstr ""
|
649 |
|
752 |
msgid "Quantity must be greater than zero."
|
753 |
msgstr ""
|
754 |
|
755 |
+
#: includes/controllers/class-wc-stripe-controller-checkout.php:236
|
756 |
msgid "Some required fields were missing. Please click %1$shere%2$s to complete your payment."
|
757 |
msgstr ""
|
758 |
|
759 |
+
#: includes/controllers/class-wc-stripe-controller-checkout.php:285
|
760 |
msgid "Please review your order details then click Place Order."
|
761 |
msgstr ""
|
762 |
|
763 |
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:82
|
764 |
+
msgid "You cannot register your domain until you have completed the Connect process on the API Settings page. A registered domain is not required when test mode is enabled."
|
765 |
msgstr ""
|
766 |
|
767 |
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:111
|
780 |
msgid "Webhook created in Stripe for %s environment. You can test your webhook by logging in to the Stripe dashboard"
|
781 |
msgstr ""
|
782 |
|
783 |
+
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:207
|
784 |
+
msgid "You must enter your API keys or connect the plugin before performing a connection test."
|
785 |
msgstr ""
|
786 |
|
787 |
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:217
|
788 |
+
msgid "Mode: %s. Invalid secret key. Please check your entry."
|
789 |
+
msgstr ""
|
790 |
+
|
791 |
+
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:229
|
792 |
+
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:232
|
793 |
msgid "Mode: %s. Invalid publishable key. Please check your entry."
|
794 |
msgstr ""
|
795 |
|
796 |
+
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:243
|
797 |
msgid "Connection test to Stripe was successful. Mode: %s."
|
798 |
msgstr ""
|
799 |
|
856 |
msgid "ACH gateway that integrates with your Stripe account."
|
857 |
msgstr ""
|
858 |
|
859 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-ach.php:249
|
860 |
msgid "Saved Banks"
|
861 |
msgstr ""
|
862 |
|
863 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-ach.php:253
|
864 |
msgid "New Bank"
|
865 |
msgstr ""
|
866 |
|
867 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-ach.php:297
|
868 |
msgid "You must set the API mode to live in order to enable the Plaid development environment."
|
869 |
msgstr ""
|
870 |
|
877 |
msgid "Alipay gateway that integrates with your Stripe account."
|
878 |
msgstr ""
|
879 |
|
880 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-alipay.php:63
|
881 |
msgid ""
|
882 |
"Gateway will appear when store currency is CNY, or currency matches merchant's \r\n"
|
883 |
"\t\t\t\t\tdefault Stripe currency. For merchants located in DK, NO, SE, & CH, currency must be EUR."
|
972 |
msgid "Giropay gateway that integrates with your Stripe account."
|
973 |
msgstr ""
|
974 |
|
975 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:22
|
976 |
#: includes/gateways/settings/googlepay-settings.php:43
|
977 |
msgid "Google Pay"
|
978 |
msgstr ""
|
979 |
|
980 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:25
|
981 |
msgid "Stripe Google Pay"
|
982 |
msgstr ""
|
983 |
|
984 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:26
|
985 |
msgid "Google Pay gateway that integrates with your Stripe account."
|
986 |
msgstr ""
|
987 |
|
988 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:108
|
989 |
msgid "Please update you product quantity before using Google Pay."
|
990 |
msgstr ""
|
991 |
|
992 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:163
|
993 |
msgid "Waiting..."
|
994 |
msgstr ""
|
995 |
|
996 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:164
|
997 |
msgid "loading shipping methods..."
|
998 |
msgstr ""
|
999 |
|
1015 |
msgid "Ideal gateway that integrates with your Stripe account."
|
1016 |
msgstr ""
|
1017 |
|
1018 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:23
|
1019 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:26
|
1020 |
msgid "Klarna"
|
1021 |
msgstr ""
|
1022 |
|
1023 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:27
|
1024 |
msgid "Klarna gateway that integrates with your Stripe account."
|
1025 |
msgstr ""
|
1026 |
|
1027 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:85
|
1028 |
+
#: includes/gateways/settings/applepay-settings.php:56
|
1029 |
+
#: includes/gateways/settings/cc-settings.php:53
|
1030 |
+
#: includes/gateways/settings/payment-request-settings.php:57
|
1031 |
+
msgid "This option determines whether the customer's funds are captured immediately or authorized and can be captured at a later date."
|
1032 |
+
msgstr ""
|
1033 |
+
|
1034 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:88
|
1035 |
msgid "Payment Categories"
|
1036 |
msgstr ""
|
1037 |
|
1038 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:94
|
1039 |
msgid "These are the payment categories that will be displayed on the checkout page if they are supported. Note, depending on the customer's billing country, not all enabled options may show."
|
1040 |
msgstr ""
|
1041 |
|
1042 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:100
|
1043 |
msgid "Use Stripe translation"
|
1044 |
msgstr ""
|
1045 |
|
1046 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:104
|
1047 |
msgid "If enabled, the payment option labels will use the Stripe translated text."
|
1048 |
msgstr ""
|
1049 |
|
1050 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:212
|
1051 |
msgid "Fee total"
|
1052 |
msgstr ""
|
1053 |
|
1054 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:253
|
1055 |
msgid "Pay Now"
|
1056 |
msgstr ""
|
1057 |
|
1058 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:254
|
1059 |
msgid "Pay Later"
|
1060 |
msgstr ""
|
1061 |
|
1062 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:255
|
1063 |
msgid "Pay Over Time"
|
1064 |
msgstr ""
|
1065 |
|
1066 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:268
|
1067 |
msgid "Click %1$shere%2$s for Klarna test payment methods."
|
1068 |
msgstr ""
|
1069 |
|
1070 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:274
|
1071 |
msgid "Your purchase is not approved."
|
1072 |
msgstr ""
|
1073 |
|
1127 |
"\t\t\tterms and conditions of your agreement with your bank. A refund must be claimed within 8 weeks starting from the date on which your account was debited."
|
1128 |
msgstr ""
|
1129 |
|
1130 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-sepa.php:68
|
1131 |
msgid "Company Name"
|
1132 |
msgstr ""
|
1133 |
|
1134 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-sepa.php:72
|
1135 |
msgid "The name of your company that will appear in the SEPA mandate."
|
1136 |
msgstr ""
|
1137 |
|
1138 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-sepa.php:79
|
1139 |
msgid "SEPA Test Accounts"
|
1140 |
msgstr ""
|
1141 |
|
1142 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-sepa.php:83
|
1143 |
msgid "New Account"
|
1144 |
msgstr ""
|
1145 |
|
1146 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-sepa.php:87
|
1147 |
msgid "Saved Accounts"
|
1148 |
msgstr ""
|
1149 |
|
1165 |
msgid "WeChat gateway that integrates with your Stripe account."
|
1166 |
msgstr ""
|
1167 |
|
1168 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-wechat.php:72
|
1169 |
msgid "Scan the QR code using your WeChat app. Once scanned click the Place Order button."
|
1170 |
msgstr ""
|
1171 |
|
1293 |
msgid "Credit Card Display"
|
1294 |
msgstr ""
|
1295 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1296 |
#: includes/gateways/settings/applepay-settings.php:60
|
1297 |
#: includes/gateways/settings/googlepay-settings.php:78
|
1298 |
#: includes/gateways/settings/payment-request-settings.php:61
|
1652 |
msgid "Card Type"
|
1653 |
msgstr ""
|
1654 |
|
1655 |
+
#: includes/tokens/class-wc-payment-token-stripe-googlepay.php:21
|
1656 |
msgid "Gateway Name"
|
1657 |
msgstr ""
|
1658 |
|
1686 |
msgid "Kind Regards,"
|
1687 |
msgstr ""
|
1688 |
|
1689 |
+
#: includes/wc-stripe-functions.php:831
|
1690 |
msgid "Bootstrap form"
|
1691 |
msgstr ""
|
1692 |
|
1693 |
+
#: includes/wc-stripe-functions.php:857
|
1694 |
msgid "Simple form"
|
1695 |
msgstr ""
|
1696 |
|
1697 |
+
#: includes/wc-stripe-functions.php:880
|
1698 |
msgid "Minimalist form"
|
1699 |
msgstr ""
|
1700 |
|
1701 |
+
#: includes/wc-stripe-functions.php:906
|
1702 |
msgid "Inline Form"
|
1703 |
msgstr ""
|
1704 |
|
1705 |
+
#: includes/wc-stripe-functions.php:928
|
1706 |
msgid "Rounded Form"
|
1707 |
msgstr ""
|
1708 |
|
1709 |
+
#: includes/wc-stripe-functions.php:1146
|
1710 |
msgid "There was an error processing your credit card."
|
1711 |
msgstr ""
|
1712 |
|
1713 |
+
#: includes/wc-stripe-functions.php:1147
|
1714 |
msgid "Your card number is incomplete."
|
1715 |
msgstr ""
|
1716 |
|
1717 |
+
#: includes/wc-stripe-functions.php:1148
|
1718 |
msgid "The card number is incorrect. Check the card's number or use a different card."
|
1719 |
msgstr ""
|
1720 |
|
1721 |
+
#: includes/wc-stripe-functions.php:1149
|
1722 |
msgid "The card's security code is incorrect. Check the card's security code or use a different card."
|
1723 |
msgstr ""
|
1724 |
|
1725 |
+
#: includes/wc-stripe-functions.php:1150
|
1726 |
msgid "The card's ZIP code is incorrect. Check the card's ZIP code or use a different card."
|
1727 |
msgstr ""
|
1728 |
|
1729 |
+
#: includes/wc-stripe-functions.php:1151
|
1730 |
+
#: includes/wc-stripe-functions.php:1156
|
1731 |
msgid "The card number is invalid. Check the card details or use a different card."
|
1732 |
msgstr ""
|
1733 |
|
1734 |
+
#: includes/wc-stripe-functions.php:1152
|
1735 |
msgid "This value provided to the field contains characters that are unsupported by the field."
|
1736 |
msgstr ""
|
1737 |
|
1738 |
+
#: includes/wc-stripe-functions.php:1153
|
1739 |
msgid "The card's security code is invalid. Check the card's security code or use a different card."
|
1740 |
msgstr ""
|
1741 |
|
1742 |
+
#: includes/wc-stripe-functions.php:1154
|
1743 |
msgid "The card's expiration month is incorrect. Check the expiration date or use a different card."
|
1744 |
msgstr ""
|
1745 |
|
1746 |
+
#: includes/wc-stripe-functions.php:1155
|
1747 |
msgid "The card's expiration year is incorrect. Check the expiration date or use a different card."
|
1748 |
msgstr ""
|
1749 |
|
1750 |
+
#: includes/wc-stripe-functions.php:1157
|
1751 |
msgid "The card's address is incorrect. Check the card's address or use a different card."
|
1752 |
msgstr ""
|
1753 |
|
1754 |
+
#: includes/wc-stripe-functions.php:1158
|
1755 |
msgid "The card has expired. Check the expiration date or use a different card."
|
1756 |
msgstr ""
|
1757 |
|
1758 |
+
#: includes/wc-stripe-functions.php:1159
|
1759 |
msgid "The card has been declined."
|
1760 |
msgstr ""
|
1761 |
|
1762 |
+
#: includes/wc-stripe-functions.php:1160
|
1763 |
msgid "Your card's expiration year is in the past."
|
1764 |
msgstr ""
|
1765 |
|
1766 |
+
#: includes/wc-stripe-functions.php:1161
|
1767 |
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."
|
1768 |
msgstr ""
|
1769 |
|
1770 |
+
#: includes/wc-stripe-functions.php:1162
|
1771 |
msgid "The specified amount is greater than the maximum amount allowed. Use a lower amount and try again."
|
1772 |
msgstr ""
|
1773 |
|
1774 |
+
#: includes/wc-stripe-functions.php:1163
|
1775 |
msgid "The specified amount is less than the minimum amount allowed. Use a higher amount and try again."
|
1776 |
msgstr ""
|
1777 |
|
1778 |
+
#: includes/wc-stripe-functions.php:1164
|
1779 |
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."
|
1780 |
msgstr ""
|
1781 |
|
1782 |
+
#: includes/wc-stripe-functions.php:1165
|
1783 |
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."
|
1784 |
msgstr ""
|
1785 |
|
1786 |
+
#: includes/wc-stripe-functions.php:1166
|
1787 |
msgid "The bank account provided can not be used to charge, either because it is not verified yet or it is not supported."
|
1788 |
msgstr ""
|
1789 |
|
1790 |
+
#: includes/wc-stripe-functions.php:1167
|
1791 |
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."
|
1792 |
msgstr ""
|
1793 |
|
1794 |
+
#: includes/wc-stripe-functions.php:1168
|
1795 |
msgid "The bank account provided cannot be used for payouts. A different bank account must be used."
|
1796 |
msgstr ""
|
1797 |
|
1798 |
+
#: includes/wc-stripe-functions.php:1169
|
1799 |
msgid "Your Connect platform is attempting to share an unverified bank account with a connected account."
|
1800 |
msgstr ""
|
1801 |
|
1802 |
+
#: includes/wc-stripe-functions.php:1170
|
1803 |
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."
|
1804 |
msgstr ""
|
1805 |
|
1806 |
+
#: includes/wc-stripe-functions.php:1171
|
1807 |
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."
|
1808 |
msgstr ""
|
1809 |
|
1810 |
+
#: includes/wc-stripe-functions.php:1172
|
1811 |
msgid "The charge you're attempting to capture has already been captured. Update the request with an uncaptured charge ID."
|
1812 |
msgstr ""
|
1813 |
|
1814 |
+
#: includes/wc-stripe-functions.php:1173
|
1815 |
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."
|
1816 |
msgstr ""
|
1817 |
|
1818 |
+
#: includes/wc-stripe-functions.php:1174
|
1819 |
msgid "The charge you're attempting to refund has been charged back. Check the disputes documentation to learn how to respond to the dispute."
|
1820 |
msgstr ""
|
1821 |
|
1822 |
+
#: includes/wc-stripe-functions.php:1175
|
1823 |
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."
|
1824 |
msgstr ""
|
1825 |
|
1826 |
+
#: includes/wc-stripe-functions.php:1176
|
1827 |
msgid "The charge cannot be captured as the authorization has expired. Auth and capture charges must be captured within seven days."
|
1828 |
msgstr ""
|
1829 |
|
1830 |
+
#: includes/wc-stripe-functions.php:1177
|
1831 |
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."
|
1832 |
msgstr ""
|
1833 |
|
1834 |
+
#: includes/wc-stripe-functions.php:1178
|
1835 |
msgid "The email address is invalid (e.g., not properly formatted). Check that the email address is properly formatted and only includes allowed characters."
|
1836 |
msgstr ""
|
1837 |
|
1838 |
+
#: includes/wc-stripe-functions.php:1179
|
1839 |
msgid "The idempotency key provided is currently being used in another request. This occurs if your integration is making duplicate requests simultaneously."
|
1840 |
msgstr ""
|
1841 |
|
1842 |
+
#: includes/wc-stripe-functions.php:1180
|
1843 |
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."
|
1844 |
msgstr ""
|
1845 |
|
1846 |
+
#: includes/wc-stripe-functions.php:1181
|
1847 |
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."
|
1848 |
msgstr ""
|
1849 |
|
1850 |
+
#: includes/wc-stripe-functions.php:1182
|
1851 |
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."
|
1852 |
msgstr ""
|
1853 |
|
1854 |
+
#: includes/wc-stripe-functions.php:1183
|
1855 |
msgid "The ZIP code provided was incorrect."
|
1856 |
msgstr ""
|
1857 |
|
1858 |
+
#: includes/wc-stripe-functions.php:1184
|
1859 |
msgid "An error occurred while processing the card. Try again later or with a different payment method."
|
1860 |
msgstr ""
|
1861 |
|
1862 |
+
#: includes/wc-stripe-functions.php:1185
|
1863 |
msgid "The card does not support this type of purchase."
|
1864 |
msgstr ""
|
1865 |
|
1866 |
+
#: includes/wc-stripe-functions.php:1186
|
1867 |
+
#: includes/wc-stripe-functions.php:1189
|
1868 |
+
#: includes/wc-stripe-functions.php:1191
|
1869 |
msgid "The card has been declined for an unknown reason."
|
1870 |
msgstr ""
|
1871 |
|
1872 |
+
#: includes/wc-stripe-functions.php:1187
|
1873 |
msgid "The customer has exceeded the balance or credit limit available on their card."
|
1874 |
msgstr ""
|
1875 |
|
1876 |
+
#: includes/wc-stripe-functions.php:1188
|
1877 |
msgid "The card does not support the specified currency."
|
1878 |
msgstr ""
|
1879 |
|
1880 |
+
#: includes/wc-stripe-functions.php:1190
|
1881 |
msgid "The payment has been declined as Stripe suspects it is fraudulent."
|
1882 |
msgstr ""
|
1883 |
|
1884 |
+
#: includes/wc-stripe-functions.php:1192
|
1885 |
msgid "The PIN entered is incorrect. "
|
1886 |
msgstr ""
|
1887 |
|
1888 |
+
#: includes/wc-stripe-functions.php:1193
|
1889 |
msgid "The card has insufficient funds to complete the purchase."
|
1890 |
msgstr ""
|
1891 |
|
1892 |
+
#: includes/wc-stripe-functions.php:1194
|
1893 |
msgid "Please select a payment method before proceeding."
|
1894 |
msgstr ""
|
1895 |
|
1896 |
+
#: includes/wc-stripe-functions.php:1195
|
1897 |
msgid "Please enter your IBAN before proceeding."
|
1898 |
msgstr ""
|
1899 |
|
1900 |
+
#: includes/wc-stripe-functions.php:1196
|
1901 |
msgid "Please select a bank before proceeding"
|
1902 |
msgstr ""
|
1903 |
|
1974 |
msgid "Express Checkout"
|
1975 |
msgstr ""
|
1976 |
|
1977 |
+
#: templates/checkout/credit-card.php:21
|
1978 |
msgid "Save Card"
|
1979 |
msgstr ""
|
includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php
CHANGED
@@ -26,6 +26,12 @@ abstract class WC_Payment_Gateway_Stripe_Local_Payment extends WC_Payment_Gatewa
|
|
26 |
|
27 |
public $countries = array();
|
28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
protected $local_payment_description = '';
|
30 |
|
31 |
public function __construct() {
|
@@ -33,9 +39,13 @@ abstract class WC_Payment_Gateway_Stripe_Local_Payment extends WC_Payment_Gatewa
|
|
33 |
$this->template_name = 'local-payment.php';
|
34 |
parent::__construct();
|
35 |
$this->settings['method_format'] = 'gateway_title';
|
36 |
-
|
37 |
-
$this->
|
38 |
-
|
|
|
|
|
|
|
|
|
39 |
}
|
40 |
|
41 |
public function hooks() {
|
@@ -95,11 +105,11 @@ abstract class WC_Payment_Gateway_Stripe_Local_Payment extends WC_Payment_Gatewa
|
|
95 |
*/
|
96 |
public function get_local_payment_settings() {
|
97 |
return array(
|
98 |
-
'desc'
|
99 |
'type' => 'description',
|
100 |
-
'description' => $this
|
101 |
),
|
102 |
-
'enabled'
|
103 |
'title' => __( 'Enabled', 'woo-stripe-payment' ),
|
104 |
'type' => 'checkbox',
|
105 |
'default' => 'no',
|
@@ -107,30 +117,70 @@ abstract class WC_Payment_Gateway_Stripe_Local_Payment extends WC_Payment_Gatewa
|
|
107 |
'desc_tip' => true,
|
108 |
'description' => sprintf( __( 'If enabled, your site can accept %s payments through Stripe.', 'woo-stripe-payment' ), $this->get_method_title() ),
|
109 |
),
|
110 |
-
'general_settings'
|
111 |
'type' => 'title',
|
112 |
'title' => __( 'General Settings', 'woo-stripe-payment' ),
|
113 |
),
|
114 |
-
'title_text'
|
115 |
'type' => 'text',
|
116 |
'title' => __( 'Title', 'woo-stripe-payment' ),
|
117 |
'default' => $this->get_method_title(),
|
118 |
'desc_tip' => true,
|
119 |
'description' => sprintf( __( 'Title of the %s gateway' ), $this->get_method_title() ),
|
120 |
),
|
121 |
-
'description'
|
122 |
'title' => __( 'Description', 'woo-stripe-payment' ),
|
123 |
'type' => 'text',
|
124 |
'default' => '',
|
125 |
'description' => __( 'Leave blank if you don\'t want a description to show for the gateway.', 'woo-stripe-payment' ),
|
126 |
'desc_tip' => true,
|
127 |
),
|
128 |
-
'order_button_text'
|
129 |
'title' => __( 'Order Button Text', 'woo-stripe-payment' ),
|
130 |
'type' => 'text',
|
131 |
'default' => $this->get_order_button_text( $this->method_title ),
|
132 |
'description' => __( 'The text on the Place Order button that displays when the gateway is selected on the checkout page.', 'woo-stripe-payment' ),
|
133 |
'desc_tip' => true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
)
|
135 |
);
|
136 |
}
|
@@ -149,7 +199,7 @@ abstract class WC_Payment_Gateway_Stripe_Local_Payment extends WC_Payment_Gatewa
|
|
149 |
),
|
150 |
'element_params' => $this->get_element_params(),
|
151 |
'routes' => array(
|
152 |
-
'order_pay' =>
|
153 |
'delete_order_source' => WC_Stripe_Rest_API::get_endpoint( stripe_wc()->rest_api->checkout->rest_uri( 'order/source' ) ),
|
154 |
'update_source' => WC_Stripe_Rest_API::get_endpoint( stripe_wc()->rest_api->source->rest_uri( 'update' ) )
|
155 |
)
|
@@ -176,6 +226,8 @@ abstract class WC_Payment_Gateway_Stripe_Local_Payment extends WC_Payment_Gatewa
|
|
176 |
/**
|
177 |
*
|
178 |
* @param WC_Order $order
|
|
|
|
|
179 |
*/
|
180 |
public function get_source_args( $order ) {
|
181 |
$args = array(
|
@@ -184,13 +236,24 @@ abstract class WC_Payment_Gateway_Stripe_Local_Payment extends WC_Payment_Gatewa
|
|
184 |
'currency' => $order->get_currency(),
|
185 |
'statement_descriptor' => sprintf( __( 'Order %s', 'woo-stripe-payment' ), $order->get_order_number() ),
|
186 |
'owner' => array(
|
187 |
-
'name'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
188 |
),
|
189 |
'redirect' => array( 'return_url' => $this->get_local_payment_return_url( $order ) ),
|
190 |
);
|
191 |
if ( ( $email = $order->get_billing_email() ) ) {
|
192 |
$args['owner']['email'] = $email;
|
193 |
}
|
|
|
|
|
|
|
194 |
|
195 |
/**
|
196 |
* @param $args
|
@@ -240,6 +303,7 @@ abstract class WC_Payment_Gateway_Stripe_Local_Payment extends WC_Payment_Gatewa
|
|
240 |
|
241 |
public function is_local_payment_available() {
|
242 |
global $wp;
|
|
|
243 |
if ( isset( $wp->query_vars['order-pay'] ) ) {
|
244 |
$order = wc_get_order( absint( $wp->query_vars['order-pay'] ) );
|
245 |
$currency = $order->get_currency();
|
@@ -252,15 +316,27 @@ abstract class WC_Payment_Gateway_Stripe_Local_Payment extends WC_Payment_Gatewa
|
|
252 |
$billing_country = WC()->countries->get_base_country();
|
253 |
}
|
254 |
}
|
255 |
-
if (
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
|
|
260 |
} else {
|
261 |
-
|
262 |
}
|
263 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
264 |
}
|
265 |
|
266 |
public function get_payment_token( $method_id, $method_details = array() ) {
|
@@ -284,8 +360,14 @@ abstract class WC_Payment_Gateway_Stripe_Local_Payment extends WC_Payment_Gatewa
|
|
284 |
if ( $this->currencies ) {
|
285 |
$desc .= sprintf( __( 'Gateway will appear when store currency is <strong>%s</strong>', 'woo-stripe-payment' ), implode( ', ', $this->currencies ) );
|
286 |
}
|
287 |
-
if ( $this->
|
288 |
-
$desc .= sprintf( __( ' & billing country is <strong>%s</strong>', 'woo-stripe-payment' ), implode( ', ', $this->
|
|
|
|
|
|
|
|
|
|
|
|
|
289 |
}
|
290 |
|
291 |
return $desc;
|
26 |
|
27 |
public $countries = array();
|
28 |
|
29 |
+
/**
|
30 |
+
* @var array
|
31 |
+
* @since 3.2.10
|
32 |
+
*/
|
33 |
+
protected $limited_countries = array();
|
34 |
+
|
35 |
protected $local_payment_description = '';
|
36 |
|
37 |
public function __construct() {
|
39 |
$this->template_name = 'local-payment.php';
|
40 |
parent::__construct();
|
41 |
$this->settings['method_format'] = 'gateway_title';
|
42 |
+
|
43 |
+
if ( ! isset( $this->form_fields['charge_type'] ) ) {
|
44 |
+
$this->settings['charge_type'] = 'capture';
|
45 |
+
}
|
46 |
+
|
47 |
+
$this->settings['order_status'] = 'default';
|
48 |
+
$this->order_button_text = $this->get_option( 'order_button_text' );
|
49 |
}
|
50 |
|
51 |
public function hooks() {
|
105 |
*/
|
106 |
public function get_local_payment_settings() {
|
107 |
return array(
|
108 |
+
'desc' => array(
|
109 |
'type' => 'description',
|
110 |
+
'description' => array( $this, 'get_payment_description' ),
|
111 |
),
|
112 |
+
'enabled' => array(
|
113 |
'title' => __( 'Enabled', 'woo-stripe-payment' ),
|
114 |
'type' => 'checkbox',
|
115 |
'default' => 'no',
|
117 |
'desc_tip' => true,
|
118 |
'description' => sprintf( __( 'If enabled, your site can accept %s payments through Stripe.', 'woo-stripe-payment' ), $this->get_method_title() ),
|
119 |
),
|
120 |
+
'general_settings' => array(
|
121 |
'type' => 'title',
|
122 |
'title' => __( 'General Settings', 'woo-stripe-payment' ),
|
123 |
),
|
124 |
+
'title_text' => array(
|
125 |
'type' => 'text',
|
126 |
'title' => __( 'Title', 'woo-stripe-payment' ),
|
127 |
'default' => $this->get_method_title(),
|
128 |
'desc_tip' => true,
|
129 |
'description' => sprintf( __( 'Title of the %s gateway' ), $this->get_method_title() ),
|
130 |
),
|
131 |
+
'description' => array(
|
132 |
'title' => __( 'Description', 'woo-stripe-payment' ),
|
133 |
'type' => 'text',
|
134 |
'default' => '',
|
135 |
'description' => __( 'Leave blank if you don\'t want a description to show for the gateway.', 'woo-stripe-payment' ),
|
136 |
'desc_tip' => true,
|
137 |
),
|
138 |
+
'order_button_text' => array(
|
139 |
'title' => __( 'Order Button Text', 'woo-stripe-payment' ),
|
140 |
'type' => 'text',
|
141 |
'default' => $this->get_order_button_text( $this->method_title ),
|
142 |
'description' => __( 'The text on the Place Order button that displays when the gateway is selected on the checkout page.', 'woo-stripe-payment' ),
|
143 |
'desc_tip' => true
|
144 |
+
),
|
145 |
+
'allowed_countries' => array(
|
146 |
+
'title' => __( 'Selling location(s)', 'woocommerce' ),
|
147 |
+
'desc' => __( 'This option lets you limit which countries you are willing to sell to.', 'woocommerce' ),
|
148 |
+
'default' => 'specific',
|
149 |
+
'type' => 'select',
|
150 |
+
'class' => 'wc-enhanced-select wc-stripe-allowed-countries',
|
151 |
+
'css' => 'min-width: 350px;',
|
152 |
+
'desc_tip' => true,
|
153 |
+
'options' => array(
|
154 |
+
'all' => __( 'Sell to all countries', 'woocommerce' ),
|
155 |
+
'all_except' => __( 'Sell to all countries, except for…', 'woocommerce' ),
|
156 |
+
'specific' => __( 'Sell to specific countries', 'woocommerce' ),
|
157 |
+
),
|
158 |
+
),
|
159 |
+
'except_countries' => array(
|
160 |
+
'title' => __( 'Sell to all countries, except for…', 'woocommerce' ),
|
161 |
+
'type' => 'multi_select_countries',
|
162 |
+
'css' => 'min-width: 350px;',
|
163 |
+
'options' => $this->limited_countries,
|
164 |
+
'default' => array(),
|
165 |
+
'desc_tip' => true,
|
166 |
+
'description' => __( 'When the billing country matches one of these values, the payment method will be hidden on the checkout page.', 'woo-stripe-payment' ),
|
167 |
+
'custom_attributes' => array( 'data-show-if' => array( 'allowed_countries' => 'all_except' ) ),
|
168 |
+
'sanitize_callback' => function ( $value ) {
|
169 |
+
return is_array( $value ) ? $value : array();
|
170 |
+
}
|
171 |
+
),
|
172 |
+
'specific_countries' => array(
|
173 |
+
'title' => __( 'Sell to specific countries', 'woocommerce' ),
|
174 |
+
'type' => 'multi_select_countries',
|
175 |
+
'css' => 'min-width: 350px;',
|
176 |
+
'options' => $this->limited_countries,
|
177 |
+
'default' => $this->countries,
|
178 |
+
'desc_tip' => true,
|
179 |
+
'description' => __( 'When the billing country matches one of these values, the payment method will be shown on the checkout page.', 'woo-stripe-payment' ),
|
180 |
+
'custom_attributes' => array( 'data-show-if' => array( 'allowed_countries' => 'specific' ) ),
|
181 |
+
'sanitize_callback' => function ( $value ) {
|
182 |
+
return is_array( $value ) ? $value : array();
|
183 |
+
}
|
184 |
)
|
185 |
);
|
186 |
}
|
199 |
),
|
200 |
'element_params' => $this->get_element_params(),
|
201 |
'routes' => array(
|
202 |
+
'order_pay' => stripe_wc()->rest_api->checkout->rest_url( 'order-pay' ),
|
203 |
'delete_order_source' => WC_Stripe_Rest_API::get_endpoint( stripe_wc()->rest_api->checkout->rest_uri( 'order/source' ) ),
|
204 |
'update_source' => WC_Stripe_Rest_API::get_endpoint( stripe_wc()->rest_api->source->rest_uri( 'update' ) )
|
205 |
)
|
226 |
/**
|
227 |
*
|
228 |
* @param WC_Order $order
|
229 |
+
*
|
230 |
+
* @return array
|
231 |
*/
|
232 |
public function get_source_args( $order ) {
|
233 |
$args = array(
|
236 |
'currency' => $order->get_currency(),
|
237 |
'statement_descriptor' => sprintf( __( 'Order %s', 'woo-stripe-payment' ), $order->get_order_number() ),
|
238 |
'owner' => array(
|
239 |
+
'name' => $this->payment_object->get_name_from_order( $order, 'billing' ),
|
240 |
+
'address' => array(
|
241 |
+
'city' => $order->get_billing_city(),
|
242 |
+
'country' => $order->get_billing_country(),
|
243 |
+
'line1' => $order->get_billing_address_1(),
|
244 |
+
'line2' => $order->get_billing_address_2(),
|
245 |
+
'postal_code' => $order->get_billing_postcode(),
|
246 |
+
'state' => $order->get_billing_state(),
|
247 |
+
)
|
248 |
),
|
249 |
'redirect' => array( 'return_url' => $this->get_local_payment_return_url( $order ) ),
|
250 |
);
|
251 |
if ( ( $email = $order->get_billing_email() ) ) {
|
252 |
$args['owner']['email'] = $email;
|
253 |
}
|
254 |
+
if ( ( $phone = $order->get_billing_phone() ) ) {
|
255 |
+
$args['owner']['phone'] = $phone;
|
256 |
+
}
|
257 |
|
258 |
/**
|
259 |
* @param $args
|
303 |
|
304 |
public function is_local_payment_available() {
|
305 |
global $wp;
|
306 |
+
$_available = false;
|
307 |
if ( isset( $wp->query_vars['order-pay'] ) ) {
|
308 |
$order = wc_get_order( absint( $wp->query_vars['order-pay'] ) );
|
309 |
$currency = $order->get_currency();
|
316 |
$billing_country = WC()->countries->get_base_country();
|
317 |
}
|
318 |
}
|
319 |
+
if ( in_array( $currency, $this->currencies ) ) {
|
320 |
+
$type = $this->get_option( 'allowed_countries' );
|
321 |
+
if ( 'all_except' === $type ) {
|
322 |
+
$_available = ! in_array( $billing_country, $this->get_option( 'except_countries', array() ) );
|
323 |
+
} elseif ( 'specific' === $type ) {
|
324 |
+
$_available = in_array( $billing_country, $this->get_option( 'specific_countries', array() ) );
|
325 |
} else {
|
326 |
+
$_available = $this->limited_countries ? in_array( $billing_country, $this->limited_countries ) : true;
|
327 |
}
|
328 |
}
|
329 |
+
if ( $_available && method_exists( $this, 'validate_local_payment_available' ) ) {
|
330 |
+
$_available = $this->validate_local_payment_available( $currency, $billing_country );
|
331 |
+
}
|
332 |
+
|
333 |
+
/**
|
334 |
+
* @param array
|
335 |
+
* @param WC_Payment_Gateway_Stripe_Local_Payment
|
336 |
+
*
|
337 |
+
* @since 3.2.10
|
338 |
+
*/
|
339 |
+
return apply_filters( 'wc_stripe_local_payment_available', $_available, $this );
|
340 |
}
|
341 |
|
342 |
public function get_payment_token( $method_id, $method_details = array() ) {
|
360 |
if ( $this->currencies ) {
|
361 |
$desc .= sprintf( __( 'Gateway will appear when store currency is <strong>%s</strong>', 'woo-stripe-payment' ), implode( ', ', $this->currencies ) );
|
362 |
}
|
363 |
+
if ( 'all_except' === $this->get_option( 'allowed_countries' ) ) {
|
364 |
+
$desc .= sprintf( __( ' & billing country is not <strong>%s</strong>', 'woo-stripe-payment' ), implode( ', ', $this->get_option( 'except_countries' ) ) );
|
365 |
+
} elseif ( 'specific' === $this->get_option( 'allowed_countries' ) ) {
|
366 |
+
$desc .= sprintf( __( ' & billing country is <strong>%s</strong>', 'woo-stripe-payment' ), implode( ', ', $this->get_option( 'specific_countries' ) ) );
|
367 |
+
} else {
|
368 |
+
if ( $this->limited_countries ) {
|
369 |
+
$desc .= sprintf( __( ' & billing country is <strong>%s</strong>', 'woo-stripe-payment' ), implode( ', ', $this->limited_countries ) );
|
370 |
+
}
|
371 |
}
|
372 |
|
373 |
return $desc;
|
includes/abstract/abstract-wc-payment-gateway-stripe.php
CHANGED
@@ -1484,6 +1484,8 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
1484 |
$data['total'] = $order->get_total();
|
1485 |
$data['total_cents'] = wc_stripe_add_number_precision( $order->get_total(), $order->get_currency() );
|
1486 |
$data['currency'] = $order->get_currency();
|
|
|
|
|
1487 |
} else {
|
1488 |
$data['needs_shipping'] = WC()->cart->needs_shipping();
|
1489 |
if ( 'checkout' === $page && is_cart() ) {
|
@@ -1667,6 +1669,7 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
1667 |
|
1668 |
/**
|
1669 |
* @param array $methods
|
|
|
1670 |
*
|
1671 |
* @return array
|
1672 |
* @since 3.2.1
|
@@ -1675,15 +1678,32 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
1675 |
if ( wcs_stripe_active() && WC_Subscriptions_Change_Payment_Gateway::$is_request_to_change_payment ) {
|
1676 |
return $methods;
|
1677 |
} else {
|
1678 |
-
$methods
|
1679 |
-
$
|
1680 |
-
$
|
|
|
|
|
|
|
|
|
1681 |
foreach ( $packages as $i => $package ) {
|
1682 |
foreach ( $package['rates'] as $rate ) {
|
1683 |
$price = $incl_tax ? $rate->cost + $rate->get_shipping_tax() : $rate->cost;
|
1684 |
$methods[] = $this->get_formatted_shipping_method( $price, $rate, $i, $package, $incl_tax );
|
1685 |
}
|
1686 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1687 |
}
|
1688 |
|
1689 |
return $methods;
|
1484 |
$data['total'] = $order->get_total();
|
1485 |
$data['total_cents'] = wc_stripe_add_number_precision( $order->get_total(), $order->get_currency() );
|
1486 |
$data['currency'] = $order->get_currency();
|
1487 |
+
$data['pre_order'] = $this->order_contains_pre_order( $order );
|
1488 |
+
|
1489 |
} else {
|
1490 |
$data['needs_shipping'] = WC()->cart->needs_shipping();
|
1491 |
if ( 'checkout' === $page && is_cart() ) {
|
1669 |
|
1670 |
/**
|
1671 |
* @param array $methods
|
1672 |
+
* @param $sort
|
1673 |
*
|
1674 |
* @return array
|
1675 |
* @since 3.2.1
|
1678 |
if ( wcs_stripe_active() && WC_Subscriptions_Change_Payment_Gateway::$is_request_to_change_payment ) {
|
1679 |
return $methods;
|
1680 |
} else {
|
1681 |
+
$methods = array();
|
1682 |
+
$chosen_methods = array();
|
1683 |
+
$packages = $this->get_shipping_packages();
|
1684 |
+
$incl_tax = wc_stripe_display_prices_including_tax();
|
1685 |
+
foreach ( WC()->session->get( 'chosen_shipping_methods', array() ) as $i => $id ) {
|
1686 |
+
$chosen_methods[] = $this->get_shipping_method_id( $id, $i );
|
1687 |
+
}
|
1688 |
foreach ( $packages as $i => $package ) {
|
1689 |
foreach ( $package['rates'] as $rate ) {
|
1690 |
$price = $incl_tax ? $rate->cost + $rate->get_shipping_tax() : $rate->cost;
|
1691 |
$methods[] = $this->get_formatted_shipping_method( $price, $rate, $i, $package, $incl_tax );
|
1692 |
}
|
1693 |
}
|
1694 |
+
|
1695 |
+
/**
|
1696 |
+
* Sort shipping methods so the selected method is first in the array.
|
1697 |
+
*/
|
1698 |
+
usort( $methods, function ( $method ) use ( $chosen_methods ) {
|
1699 |
+
foreach ( $chosen_methods as $id ) {
|
1700 |
+
if ( in_array( $id, $method, true ) ) {
|
1701 |
+
return - 1;
|
1702 |
+
}
|
1703 |
+
}
|
1704 |
+
|
1705 |
+
return 1;
|
1706 |
+
} );
|
1707 |
}
|
1708 |
|
1709 |
return $methods;
|
includes/abstract/abstract-wc-stripe-payment.php
CHANGED
@@ -1,296 +1,304 @@
|
|
1 |
-
<?php
|
2 |
-
defined( 'ABSPATH' ) || exit();
|
3 |
-
|
4 |
-
/**
|
5 |
-
*
|
6 |
-
* @author PaymentPlugins
|
7 |
-
* @since 3.1.0
|
8 |
-
* @package Stripe/Abstract
|
9 |
-
*
|
10 |
-
*/
|
11 |
-
abstract class WC_Stripe_Payment {
|
12 |
-
|
13 |
-
/**
|
14 |
-
*
|
15 |
-
* @var WC_Payment_Gateway_Stripe
|
16 |
-
*/
|
17 |
-
protected $payment_method;
|
18 |
-
|
19 |
-
/**
|
20 |
-
*
|
21 |
-
* @var WC_Stripe_Gateway
|
22 |
-
*/
|
23 |
-
protected $gateway;
|
24 |
-
|
25 |
-
/**
|
26 |
-
*
|
27 |
-
* @param WC_Payment_Gateway_Stripe $payment_method
|
28 |
-
* @param WC_Stripe_Gateway $gateway
|
29 |
-
*/
|
30 |
-
public function __construct( $payment_method, $gateway ) {
|
31 |
-
$this->payment_method = $payment_method;
|
32 |
-
$this->gateway = $gateway;
|
33 |
-
}
|
34 |
-
|
35 |
-
public function get_gateway() {
|
36 |
-
return $this->gateway;
|
37 |
-
}
|
38 |
-
|
39 |
-
/**
|
40 |
-
* Process the payment for the order.
|
41 |
-
*
|
42 |
-
* @param WC_Order $order
|
43 |
-
* @param WC_Payment_Gateway_Stripe $payment_method
|
44 |
-
*/
|
45 |
-
public abstract function process_payment( $order );
|
46 |
-
|
47 |
-
/**
|
48 |
-
*
|
49 |
-
* @param float $amount
|
50 |
-
* @param WC_Order $order
|
51 |
-
*/
|
52 |
-
public abstract function capture_charge( $amount, $order );
|
53 |
-
|
54 |
-
/**
|
55 |
-
*
|
56 |
-
* @param WC_Order $order
|
57 |
-
*/
|
58 |
-
public abstract function void_charge( $order );
|
59 |
-
|
60 |
-
/**
|
61 |
-
*
|
62 |
-
* @param \Stripe\Charge $charge
|
63 |
-
*/
|
64 |
-
public abstract function get_payment_method_from_charge( $charge );
|
65 |
-
|
66 |
-
/**
|
67 |
-
*
|
68 |
-
* @param array $args
|
69 |
-
* @param WC_Order $order
|
70 |
-
*/
|
71 |
-
public abstract function add_order_payment_method( &$args, $order );
|
72 |
-
|
73 |
-
/**
|
74 |
-
*
|
75 |
-
* @param float $amount
|
76 |
-
* @param WC_Order $order
|
77 |
-
*/
|
78 |
-
public abstract function scheduled_subscription_payment( $amount, $order );
|
79 |
-
|
80 |
-
/**
|
81 |
-
*
|
82 |
-
* @param WC_Order $order
|
83 |
-
*/
|
84 |
-
public abstract function process_pre_order_payment( $order );
|
85 |
-
|
86 |
-
/**
|
87 |
-
* Return true if the charge can be voided.
|
88 |
-
*
|
89 |
-
* @param WC_Order $order
|
90 |
-
*/
|
91 |
-
public abstract function can_void_order( $order );
|
92 |
-
|
93 |
-
/**
|
94 |
-
* Perform post payment processes
|
95 |
-
*
|
96 |
-
* @param WC_Order $order
|
97 |
-
* @param \Stripe\Charge $charge
|
98 |
-
*
|
99 |
-
* @since 3.1.7
|
100 |
-
*/
|
101 |
-
public function payment_complete( $order, $charge ) {
|
102 |
-
$this->payment_method->save_order_meta( $order, $charge );
|
103 |
-
if ( 'pending' === $charge->status ) {
|
104 |
-
$order->update_status( apply_filters( 'wc_stripe_pending_charge_status', 'on-hold', $order, $this->payment_method ), sprintf( __( 'Charge %1$s is pending. Payment Method: %2$s. Payment will be completed once charge.succeeded webhook received from Stripe.', 'woo-stripe-payment' ), $order->get_transaction_id(), $order->get_payment_method_title() ) );
|
105 |
-
} else {
|
106 |
-
if ( $charge->captured ) {
|
107 |
-
$order->payment_complete( $charge->id );
|
108 |
-
} else {
|
109 |
-
$order_status = $this->payment_method->get_option( 'order_status' );
|
110 |
-
$order->update_status( apply_filters( 'wc_stripe_authorized_order_status', 'default' === $order_status ? 'on-hold' : $order_status, $order, $this->payment_method ) );
|
111 |
-
}
|
112 |
-
$order->add_order_note( sprintf( __( 'Order %1$s successful in Stripe. Charge: %2$s. Payment Method: %3$s', 'woo-stripe-payment' ), $charge->captured ? __( 'charge', 'woo-stripe-payment' ) : __( 'authorization', 'woo-stripe-payment' ), $order->get_transaction_id(), $order->get_payment_method_title() ) );
|
113 |
-
}
|
114 |
-
}
|
115 |
-
|
116 |
-
/**
|
117 |
-
*
|
118 |
-
* @param WC_Order $order
|
119 |
-
* @param float $amount
|
120 |
-
*
|
121 |
-
* @throws Exception
|
122 |
-
*/
|
123 |
-
public function process_refund( $order, $amount = null ) {
|
124 |
-
$charge = $order->get_transaction_id();
|
125 |
-
try {
|
126 |
-
if ( empty( $charge ) ) {
|
127 |
-
throw new Exception( __( 'Transaction Id cannot be empty.', 'woo-stripe-payment' ) );
|
128 |
-
}
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
*
|
224 |
-
* @param
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
*
|
234 |
-
* @param
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
*
|
243 |
-
* @param
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
'
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
$
|
295 |
-
|
296 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
defined( 'ABSPATH' ) || exit();
|
3 |
+
|
4 |
+
/**
|
5 |
+
*
|
6 |
+
* @author PaymentPlugins
|
7 |
+
* @since 3.1.0
|
8 |
+
* @package Stripe/Abstract
|
9 |
+
*
|
10 |
+
*/
|
11 |
+
abstract class WC_Stripe_Payment {
|
12 |
+
|
13 |
+
/**
|
14 |
+
*
|
15 |
+
* @var WC_Payment_Gateway_Stripe
|
16 |
+
*/
|
17 |
+
protected $payment_method;
|
18 |
+
|
19 |
+
/**
|
20 |
+
*
|
21 |
+
* @var WC_Stripe_Gateway
|
22 |
+
*/
|
23 |
+
protected $gateway;
|
24 |
+
|
25 |
+
/**
|
26 |
+
*
|
27 |
+
* @param WC_Payment_Gateway_Stripe $payment_method
|
28 |
+
* @param WC_Stripe_Gateway $gateway
|
29 |
+
*/
|
30 |
+
public function __construct( $payment_method, $gateway ) {
|
31 |
+
$this->payment_method = $payment_method;
|
32 |
+
$this->gateway = $gateway;
|
33 |
+
}
|
34 |
+
|
35 |
+
public function get_gateway() {
|
36 |
+
return $this->gateway;
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Process the payment for the order.
|
41 |
+
*
|
42 |
+
* @param WC_Order $order
|
43 |
+
* @param WC_Payment_Gateway_Stripe $payment_method
|
44 |
+
*/
|
45 |
+
public abstract function process_payment( $order );
|
46 |
+
|
47 |
+
/**
|
48 |
+
*
|
49 |
+
* @param float $amount
|
50 |
+
* @param WC_Order $order
|
51 |
+
*/
|
52 |
+
public abstract function capture_charge( $amount, $order );
|
53 |
+
|
54 |
+
/**
|
55 |
+
*
|
56 |
+
* @param WC_Order $order
|
57 |
+
*/
|
58 |
+
public abstract function void_charge( $order );
|
59 |
+
|
60 |
+
/**
|
61 |
+
*
|
62 |
+
* @param \Stripe\Charge $charge
|
63 |
+
*/
|
64 |
+
public abstract function get_payment_method_from_charge( $charge );
|
65 |
+
|
66 |
+
/**
|
67 |
+
*
|
68 |
+
* @param array $args
|
69 |
+
* @param WC_Order $order
|
70 |
+
*/
|
71 |
+
public abstract function add_order_payment_method( &$args, $order );
|
72 |
+
|
73 |
+
/**
|
74 |
+
*
|
75 |
+
* @param float $amount
|
76 |
+
* @param WC_Order $order
|
77 |
+
*/
|
78 |
+
public abstract function scheduled_subscription_payment( $amount, $order );
|
79 |
+
|
80 |
+
/**
|
81 |
+
*
|
82 |
+
* @param WC_Order $order
|
83 |
+
*/
|
84 |
+
public abstract function process_pre_order_payment( $order );
|
85 |
+
|
86 |
+
/**
|
87 |
+
* Return true if the charge can be voided.
|
88 |
+
*
|
89 |
+
* @param WC_Order $order
|
90 |
+
*/
|
91 |
+
public abstract function can_void_order( $order );
|
92 |
+
|
93 |
+
/**
|
94 |
+
* Perform post payment processes
|
95 |
+
*
|
96 |
+
* @param WC_Order $order
|
97 |
+
* @param \Stripe\Charge $charge
|
98 |
+
*
|
99 |
+
* @since 3.1.7
|
100 |
+
*/
|
101 |
+
public function payment_complete( $order, $charge ) {
|
102 |
+
$this->payment_method->save_order_meta( $order, $charge );
|
103 |
+
if ( 'pending' === $charge->status ) {
|
104 |
+
$order->update_status( apply_filters( 'wc_stripe_pending_charge_status', 'on-hold', $order, $this->payment_method ), sprintf( __( 'Charge %1$s is pending. Payment Method: %2$s. Payment will be completed once charge.succeeded webhook received from Stripe.', 'woo-stripe-payment' ), $order->get_transaction_id(), $order->get_payment_method_title() ) );
|
105 |
+
} else {
|
106 |
+
if ( $charge->captured ) {
|
107 |
+
$order->payment_complete( $charge->id );
|
108 |
+
} else {
|
109 |
+
$order_status = $this->payment_method->get_option( 'order_status' );
|
110 |
+
$order->update_status( apply_filters( 'wc_stripe_authorized_order_status', 'default' === $order_status ? 'on-hold' : $order_status, $order, $this->payment_method ) );
|
111 |
+
}
|
112 |
+
$order->add_order_note( sprintf( __( 'Order %1$s successful in Stripe. Charge: %2$s. Payment Method: %3$s', 'woo-stripe-payment' ), $charge->captured ? __( 'charge', 'woo-stripe-payment' ) : __( 'authorization', 'woo-stripe-payment' ), $order->get_transaction_id(), $order->get_payment_method_title() ) );
|
113 |
+
}
|
114 |
+
}
|
115 |
+
|
116 |
+
/**
|
117 |
+
*
|
118 |
+
* @param WC_Order $order
|
119 |
+
* @param float $amount
|
120 |
+
*
|
121 |
+
* @throws Exception
|
122 |
+
*/
|
123 |
+
public function process_refund( $order, $amount = null ) {
|
124 |
+
$charge = $order->get_transaction_id();
|
125 |
+
try {
|
126 |
+
if ( empty( $charge ) ) {
|
127 |
+
throw new Exception( __( 'Transaction Id cannot be empty.', 'woo-stripe-payment' ) );
|
128 |
+
}
|
129 |
+
|
130 |
+
/**
|
131 |
+
* @param array
|
132 |
+
* @param WC_Stripe_Payment
|
133 |
+
* @param WC_Order
|
134 |
+
*
|
135 |
+
* @since 3.2.10
|
136 |
+
*/
|
137 |
+
$args = apply_filters( 'wc_stripe_refund_args', array(
|
138 |
+
'charge' => $charge,
|
139 |
+
'amount' => wc_stripe_add_number_precision( $amount, $order->get_currency() ),
|
140 |
+
'metadata' => array(
|
141 |
+
'order_id' => $order->get_id(),
|
142 |
+
'created_via' => 'woocommerce'
|
143 |
+
)
|
144 |
+
), $this, $order );
|
145 |
+
$result = $this->gateway->refunds->mode( wc_stripe_order_mode( $order ) )->create( $args );
|
146 |
+
if ( ! is_wp_error( $result ) ) {
|
147 |
+
return true;
|
148 |
+
}
|
149 |
+
|
150 |
+
return $result;
|
151 |
+
} catch ( Exception $e ) {
|
152 |
+
return new WP_Error( 'refund-error', $e->getMessage() );
|
153 |
+
}
|
154 |
+
}
|
155 |
+
|
156 |
+
/**
|
157 |
+
* Return a failed order response.
|
158 |
+
*
|
159 |
+
* @return array
|
160 |
+
*/
|
161 |
+
public function order_error() {
|
162 |
+
wc_stripe_set_checkout_error();
|
163 |
+
|
164 |
+
return array( 'result' => 'failure' );
|
165 |
+
}
|
166 |
+
|
167 |
+
/**
|
168 |
+
*
|
169 |
+
* @param array $args
|
170 |
+
* @param WC_Order $order
|
171 |
+
*/
|
172 |
+
public function add_general_order_args( &$args, $order ) {
|
173 |
+
$this->add_order_amount( $args, $order );
|
174 |
+
$this->add_order_currency( $args, $order );
|
175 |
+
$this->add_order_description( $args, $order );
|
176 |
+
$this->add_order_shipping_address( $args, $order );
|
177 |
+
$this->add_order_metadata( $args, $order );
|
178 |
+
$this->add_order_payment_method( $args, $order );
|
179 |
+
}
|
180 |
+
|
181 |
+
/**
|
182 |
+
*
|
183 |
+
* @param array $args
|
184 |
+
* @param WC_Order $order
|
185 |
+
*/
|
186 |
+
public function add_order_metadata( &$args, $order ) {
|
187 |
+
$meta_data = array(
|
188 |
+
'gateway_id' => $this->payment_method->id,
|
189 |
+
'order_id' => $order->get_id(),
|
190 |
+
'user_id' => $order->get_user_id(),
|
191 |
+
'customer_id' => wc_stripe_get_customer_id( $order->get_user_id() ),
|
192 |
+
'ip_address' => $order->get_customer_ip_address(),
|
193 |
+
'user_agent' => isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : 'unavailable',
|
194 |
+
'partner' => 'PaymentPlugins',
|
195 |
+
'created' => time()
|
196 |
+
);
|
197 |
+
if ( has_action( 'woocommerce_order_number' ) ) {
|
198 |
+
$meta_data['order_number'] = $order->get_order_number();
|
199 |
+
}
|
200 |
+
$length = count( $meta_data );
|
201 |
+
|
202 |
+
foreach ( $order->get_items( 'line_item' ) as $item ) {
|
203 |
+
// Stripe limits metadata keys to 50 entries.
|
204 |
+
if ( $length < 50 ) {
|
205 |
+
/**
|
206 |
+
*
|
207 |
+
* @var WC_Order_Item_Product $item
|
208 |
+
*/
|
209 |
+
$key = 'product_' . $item->get_product_id();
|
210 |
+
$value = sprintf( '%s x %s', $item->get_name(), $item->get_quantity() );
|
211 |
+
// Stripe limits key names to 40 chars and values to 500 chars
|
212 |
+
if ( strlen( $key ) <= 40 && strlen( $value ) <= 500 ) {
|
213 |
+
$meta_data[ $key ] = $value;
|
214 |
+
$length ++;
|
215 |
+
}
|
216 |
+
}
|
217 |
+
}
|
218 |
+
$args['metadata'] = apply_filters( 'wc_stripe_order_meta_data', $meta_data, $order );
|
219 |
+
}
|
220 |
+
|
221 |
+
/**
|
222 |
+
*
|
223 |
+
* @param array $args
|
224 |
+
* @param WC_Order $order
|
225 |
+
*/
|
226 |
+
public function add_order_description( &$args, $order ) {
|
227 |
+
$args['description'] = sprintf( __( 'Order %1$s from %2$s', 'woo-stripe-payment' ), $order->get_order_number(), get_bloginfo( 'name' ) );
|
228 |
+
}
|
229 |
+
|
230 |
+
/**
|
231 |
+
*
|
232 |
+
* @param array $args
|
233 |
+
* @param WC_Order $order
|
234 |
+
* @param float $amount
|
235 |
+
*/
|
236 |
+
public function add_order_amount( &$args, $order, $amount = null ) {
|
237 |
+
$args['amount'] = wc_stripe_add_number_precision( $amount ? $amount : $order->get_total(), $order->get_currency() );
|
238 |
+
}
|
239 |
+
|
240 |
+
/**
|
241 |
+
*
|
242 |
+
* @param array $args
|
243 |
+
* @param WC_Order $order
|
244 |
+
*/
|
245 |
+
public function add_order_currency( &$args, $order ) {
|
246 |
+
$args['currency'] = $order->get_currency();
|
247 |
+
}
|
248 |
+
|
249 |
+
/**
|
250 |
+
*
|
251 |
+
* @param array $args
|
252 |
+
* @param WC_Order $order
|
253 |
+
*/
|
254 |
+
public function add_order_shipping_address( &$args, $order ) {
|
255 |
+
if ( wc_stripe_order_has_shipping_address( $order ) ) {
|
256 |
+
$args['shipping'] = array(
|
257 |
+
'address' => array(
|
258 |
+
'city' => $order->get_shipping_city(),
|
259 |
+
'country' => $order->get_shipping_country(),
|
260 |
+
'line1' => $order->get_shipping_address_1(),
|
261 |
+
'line2' => $order->get_shipping_address_2(),
|
262 |
+
'postal_code' => $order->get_shipping_postcode(),
|
263 |
+
'state' => $order->get_shipping_state(),
|
264 |
+
),
|
265 |
+
'name' => $this->get_name_from_order( $order, 'shipping' ),
|
266 |
+
);
|
267 |
+
} else {
|
268 |
+
$args['shipping'] = array();
|
269 |
+
}
|
270 |
+
}
|
271 |
+
|
272 |
+
/**
|
273 |
+
*
|
274 |
+
* @param WC_Order $order
|
275 |
+
* @param string $type
|
276 |
+
*
|
277 |
+
* @return string
|
278 |
+
*/
|
279 |
+
public function get_name_from_order( $order, $type ) {
|
280 |
+
if ( $type === 'billing' ) {
|
281 |
+
return sprintf( '%s %s', $order->get_billing_first_name(), $order->get_billing_last_name() );
|
282 |
+
} else {
|
283 |
+
return sprintf( '%s %s', $order->get_shipping_first_name(), $order->get_shipping_last_name() );
|
284 |
+
}
|
285 |
+
}
|
286 |
+
|
287 |
+
/**
|
288 |
+
* @param WC_Order $order
|
289 |
+
* @param WP_Error $error
|
290 |
+
*
|
291 |
+
* @since 3.1.7
|
292 |
+
*/
|
293 |
+
public function add_payment_failed_note( $order, $error ) {
|
294 |
+
$note = sprintf( __( 'Error processing payment. Reason: %s', 'woo-stripe-payment' ), $error->get_error_message() );
|
295 |
+
|
296 |
+
/**
|
297 |
+
* @param string $note
|
298 |
+
* @param WP_Error $error
|
299 |
+
*
|
300 |
+
*/
|
301 |
+
$note = apply_filters( 'wc_stripe_order_failed_note', $note, $error, $this->payment_method );
|
302 |
+
$order->update_status( 'failed', $note );
|
303 |
+
}
|
304 |
+
}
|
includes/admin/settings/class-wc-stripe-api-settings.php
CHANGED
@@ -25,11 +25,15 @@ class WC_Stripe_API_Settings extends WC_Stripe_Settings_API {
|
|
25 |
|
26 |
public function init_form_fields() {
|
27 |
$this->form_fields = array(
|
28 |
-
'title'
|
29 |
'type' => 'title',
|
30 |
'title' => __( 'API Settings', 'woo-stripe-payment' ),
|
31 |
),
|
32 |
-
'
|
|
|
|
|
|
|
|
|
33 |
'type' => 'select',
|
34 |
'title' => __( 'Mode', 'woo-stripe-payment' ),
|
35 |
'class' => 'wc-enhanced-select',
|
@@ -41,7 +45,7 @@ class WC_Stripe_API_Settings extends WC_Stripe_Settings_API {
|
|
41 |
'desc_tip' => true,
|
42 |
'description' => __( 'The mode determines if you are processing test transactions or live transactions on your site. Test mode allows you to simulate payments so you can test your integration.', 'woo-stripe-payment' ),
|
43 |
),
|
44 |
-
'account_id'
|
45 |
'type' => 'paragraph',
|
46 |
'title' => __( 'Account ID', 'woo-stripe-payment' ),
|
47 |
'text' => '',
|
@@ -50,40 +54,81 @@ class WC_Stripe_API_Settings extends WC_Stripe_Settings_API {
|
|
50 |
'desc_tip' => true,
|
51 |
'description' => __( 'This is your Stripe Connect ID and serves as a unique identifier.', 'woo-stripe-payment' ),
|
52 |
),
|
53 |
-
'stripe_connect'
|
54 |
'type' => 'stripe_connect',
|
55 |
'title' => __( 'Connect Stripe Account', 'woo-stripe-payment' ),
|
56 |
'label' => __( 'Click to Connect', 'woo-stripe-payment' ),
|
57 |
'class' => 'do-stripe-connect',
|
58 |
'description' => __( 'We make it easy to connect Stripe to your site. Click the Connect button to go through our connect flow.', 'woo-stripe-payment' ),
|
59 |
),
|
60 |
-
'
|
61 |
-
'
|
62 |
-
'
|
63 |
-
'
|
64 |
-
'
|
65 |
-
'description'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
),
|
67 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
'type' => 'paragraph',
|
69 |
'title' => __( 'Webhook url', 'woo-stripe-payment' ),
|
70 |
'class' => 'wc-stripe-webhook',
|
71 |
'text' => stripe_wc()->rest_api->webhook->rest_url( 'webhook' ),
|
72 |
'description' => sprintf( __( '<strong>Important:</strong> the webhook url is called by Stripe when events occur in your account, like a source becomes chargeable. You must add this webhook to your Stripe Dashboard if you are using any of the local gateways. %1$sWebhook guide%2$s', 'woo-stripe-payment' ), '<a target="_blank" href="https://docs.paymentplugins.com/wc-stripe/config/#/webhooks?id=configure-webhooks">', '</a>' ),
|
73 |
),
|
74 |
-
'webhook_secret_live'
|
75 |
'type' => 'password',
|
76 |
'title' => __( 'Live Webhook Secret', 'woo-stripe-payment' ),
|
77 |
'description' => sprintf( __( 'The webhook secret is used to authenticate webhooks sent from Stripe. It ensures no 3rd party can send you events, pretending to be Stripe. %1$sWebhook guide%2$s', 'woo-stripe-payment' ), '<a target="_blank" href="https://docs.paymentplugins.com/wc-stripe/config/#/webhooks?id=configure-webhooks">', '</a>' ),
|
78 |
'custom_attributes' => array( 'data-show-if' => array( 'mode' => 'live' ) ),
|
79 |
),
|
80 |
-
'webhook_secret_test'
|
81 |
'type' => 'password',
|
82 |
'title' => __( 'Test Webhook Secret', 'woo-stripe-payment' ),
|
83 |
'description' => sprintf( __( 'The webhook secret is used to authenticate webhooks sent from Stripe. It ensures no 3rd party can send you events, pretending to be Stripe. %1$sWebhook guide%2$s', 'woo-stripe-payment' ), '<a target="_blank" href="https://docs.paymentplugins.com/wc-stripe/config/#/webhooks?id=configure-webhooks">', '</a>' ),
|
84 |
'custom_attributes' => array( 'data-show-if' => array( 'mode' => 'test' ) ),
|
85 |
),
|
86 |
-
'debug_log'
|
87 |
'title' => __( 'Debug Log', 'woo-stripe-payment' ),
|
88 |
'type' => 'checkbox',
|
89 |
'desc_tip' => true,
|
@@ -96,7 +141,9 @@ class WC_Stripe_API_Settings extends WC_Stripe_Settings_API {
|
|
96 |
$this->form_fields['stripe_connect']['description'] = sprintf( __( '%s Your Stripe account has been connected. You can now accept Live and Test payments. You can Re-Connect if you want to recycle your API keys for security.', 'woo-stripe-payment' ), '<span class="dashicons dashicons-yes stipe-connect-active"></span>' );
|
97 |
$this->form_fields['stripe_connect']['active'] = true;
|
98 |
} else {
|
99 |
-
unset( $this->form_fields['account_id']
|
|
|
|
|
100 |
}
|
101 |
}
|
102 |
|
@@ -188,4 +235,8 @@ class WC_Stripe_API_Settings extends WC_Stripe_Settings_API {
|
|
188 |
)
|
189 |
) );
|
190 |
}
|
|
|
|
|
|
|
|
|
191 |
}
|
25 |
|
26 |
public function init_form_fields() {
|
27 |
$this->form_fields = array(
|
28 |
+
'title' => array(
|
29 |
'type' => 'title',
|
30 |
'title' => __( 'API Settings', 'woo-stripe-payment' ),
|
31 |
),
|
32 |
+
'test_mode_keys' => array(
|
33 |
+
'type' => 'description',
|
34 |
+
'description' => __( 'When test mode is enabled you can manually enter your API keys or go through the connect process. Live mode requires that you click the Connect button.', 'woo-stripe-payment' ),
|
35 |
+
),
|
36 |
+
'mode' => array(
|
37 |
'type' => 'select',
|
38 |
'title' => __( 'Mode', 'woo-stripe-payment' ),
|
39 |
'class' => 'wc-enhanced-select',
|
45 |
'desc_tip' => true,
|
46 |
'description' => __( 'The mode determines if you are processing test transactions or live transactions on your site. Test mode allows you to simulate payments so you can test your integration.', 'woo-stripe-payment' ),
|
47 |
),
|
48 |
+
'account_id' => array(
|
49 |
'type' => 'paragraph',
|
50 |
'title' => __( 'Account ID', 'woo-stripe-payment' ),
|
51 |
'text' => '',
|
54 |
'desc_tip' => true,
|
55 |
'description' => __( 'This is your Stripe Connect ID and serves as a unique identifier.', 'woo-stripe-payment' ),
|
56 |
),
|
57 |
+
'stripe_connect' => array(
|
58 |
'type' => 'stripe_connect',
|
59 |
'title' => __( 'Connect Stripe Account', 'woo-stripe-payment' ),
|
60 |
'label' => __( 'Click to Connect', 'woo-stripe-payment' ),
|
61 |
'class' => 'do-stripe-connect',
|
62 |
'description' => __( 'We make it easy to connect Stripe to your site. Click the Connect button to go through our connect flow.', 'woo-stripe-payment' ),
|
63 |
),
|
64 |
+
'publishable_key_test' => array(
|
65 |
+
'title' => __( 'Test Publishable Key', 'woo-stripe-payment' ),
|
66 |
+
'type' => 'text',
|
67 |
+
'default' => '',
|
68 |
+
'desc_tip' => true,
|
69 |
+
'description' => __( 'Your publishable key is used to initialize Stripe assets.', 'woo-stripe-payment' ),
|
70 |
+
'custom_attributes' => array(
|
71 |
+
'data-show-if' => array(
|
72 |
+
'mode' => 'test'
|
73 |
+
)
|
74 |
+
)
|
75 |
+
),
|
76 |
+
'secret_key_test' => array(
|
77 |
+
'title' => __( 'Test Secret Key', 'woo-stripe-payment' ),
|
78 |
+
'type' => 'password',
|
79 |
+
'default' => '',
|
80 |
+
'desc_tip' => true,
|
81 |
+
'description' => __( 'Your secret key is used to authenticate requests to Stripe.', 'woo-stripe-payment' ),
|
82 |
+
'custom_attributes' => array(
|
83 |
+
'data-show-if' => array(
|
84 |
+
'mode' => 'test'
|
85 |
+
)
|
86 |
+
)
|
87 |
),
|
88 |
+
'connection_test_live' => array(
|
89 |
+
'type' => 'stripe_button',
|
90 |
+
'title' => __( 'Connection Test', 'woo-stripe-payment' ),
|
91 |
+
'label' => __( 'Connection Test', 'woo-stripe-payment' ),
|
92 |
+
'class' => 'wc-stripe-connection-test live-mode button-secondary',
|
93 |
+
'description' => __( 'Click this button to perform a connection test. If successful, your site is connected to Stripe.', 'woo-stripe-payment' ),
|
94 |
+
'custom_attributes' => array(
|
95 |
+
'data-show-if' => array(
|
96 |
+
'mode' => 'live'
|
97 |
+
)
|
98 |
+
)
|
99 |
+
),
|
100 |
+
'connection_test_test' => array(
|
101 |
+
'type' => 'stripe_button',
|
102 |
+
'title' => __( 'Connection Test', 'woo-stripe-payment' ),
|
103 |
+
'label' => __( 'Connection Test', 'woo-stripe-payment' ),
|
104 |
+
'class' => 'wc-stripe-connection-test test-mode button-secondary',
|
105 |
+
'description' => __( 'Click this button to perform a connection test. If successful, your site is connected to Stripe.', 'woo-stripe-payment' ),
|
106 |
+
'custom_attributes' => array(
|
107 |
+
'data-show-if' => array(
|
108 |
+
'mode' => 'test'
|
109 |
+
)
|
110 |
+
)
|
111 |
+
),
|
112 |
+
'webhook_url' => array(
|
113 |
'type' => 'paragraph',
|
114 |
'title' => __( 'Webhook url', 'woo-stripe-payment' ),
|
115 |
'class' => 'wc-stripe-webhook',
|
116 |
'text' => stripe_wc()->rest_api->webhook->rest_url( 'webhook' ),
|
117 |
'description' => sprintf( __( '<strong>Important:</strong> the webhook url is called by Stripe when events occur in your account, like a source becomes chargeable. You must add this webhook to your Stripe Dashboard if you are using any of the local gateways. %1$sWebhook guide%2$s', 'woo-stripe-payment' ), '<a target="_blank" href="https://docs.paymentplugins.com/wc-stripe/config/#/webhooks?id=configure-webhooks">', '</a>' ),
|
118 |
),
|
119 |
+
'webhook_secret_live' => array(
|
120 |
'type' => 'password',
|
121 |
'title' => __( 'Live Webhook Secret', 'woo-stripe-payment' ),
|
122 |
'description' => sprintf( __( 'The webhook secret is used to authenticate webhooks sent from Stripe. It ensures no 3rd party can send you events, pretending to be Stripe. %1$sWebhook guide%2$s', 'woo-stripe-payment' ), '<a target="_blank" href="https://docs.paymentplugins.com/wc-stripe/config/#/webhooks?id=configure-webhooks">', '</a>' ),
|
123 |
'custom_attributes' => array( 'data-show-if' => array( 'mode' => 'live' ) ),
|
124 |
),
|
125 |
+
'webhook_secret_test' => array(
|
126 |
'type' => 'password',
|
127 |
'title' => __( 'Test Webhook Secret', 'woo-stripe-payment' ),
|
128 |
'description' => sprintf( __( 'The webhook secret is used to authenticate webhooks sent from Stripe. It ensures no 3rd party can send you events, pretending to be Stripe. %1$sWebhook guide%2$s', 'woo-stripe-payment' ), '<a target="_blank" href="https://docs.paymentplugins.com/wc-stripe/config/#/webhooks?id=configure-webhooks">', '</a>' ),
|
129 |
'custom_attributes' => array( 'data-show-if' => array( 'mode' => 'test' ) ),
|
130 |
),
|
131 |
+
'debug_log' => array(
|
132 |
'title' => __( 'Debug Log', 'woo-stripe-payment' ),
|
133 |
'type' => 'checkbox',
|
134 |
'desc_tip' => true,
|
141 |
$this->form_fields['stripe_connect']['description'] = sprintf( __( '%s Your Stripe account has been connected. You can now accept Live and Test payments. You can Re-Connect if you want to recycle your API keys for security.', 'woo-stripe-payment' ), '<span class="dashicons dashicons-yes stipe-connect-active"></span>' );
|
142 |
$this->form_fields['stripe_connect']['active'] = true;
|
143 |
} else {
|
144 |
+
unset( $this->form_fields['account_id'] );
|
145 |
+
// don't show the live connection test unless connect process has been completed.
|
146 |
+
unset( $this->form_fields['connection_test_live'] );
|
147 |
}
|
148 |
}
|
149 |
|
235 |
)
|
236 |
) );
|
237 |
}
|
238 |
+
|
239 |
+
public function localize_settings() {
|
240 |
+
return parent::localize_settings(); // TODO: Change the autogenerated stub
|
241 |
+
}
|
242 |
}
|
includes/admin/views/html-multi-select-countries.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$selections = (array) $value;
|
3 |
+
|
4 |
+
if ( ! empty( $data['options'] ) ) {
|
5 |
+
$countries = array_intersect_key( WC()->countries->countries, array_flip( $data['options'] ) );
|
6 |
+
} else {
|
7 |
+
$countries = WC()->countries->countries;
|
8 |
+
}
|
9 |
+
|
10 |
+
asort( $countries );
|
11 |
+
?>
|
12 |
+
<tr valign="top">
|
13 |
+
<th scope="row" class="titledesc">
|
14 |
+
<label for="<?php echo esc_attr( $data['id'] ); ?>"><?php echo esc_html( $data['title'] ); ?><?php echo $this->get_tooltip_html( $data ); // WPCS: XSS ok. ?></label>
|
15 |
+
</th>
|
16 |
+
<td class="forminp">
|
17 |
+
<select multiple="multiple" name="<?php echo esc_attr( $data['id'] ); ?>[]" style="width:350px"
|
18 |
+
data-placeholder="<?php esc_attr_e( 'Choose countries / regions…', 'woocommerce' ); ?>"
|
19 |
+
aria-label="<?php esc_attr_e( 'Country / Region', 'woocommerce' ); ?>" class="wc-enhanced-select"
|
20 |
+
<?php echo $this->get_custom_attribute_html( $data ); ?>>
|
21 |
+
<?php
|
22 |
+
if ( ! empty( $countries ) ) {
|
23 |
+
foreach ( $countries as $key => $val ) {
|
24 |
+
echo '<option value="' . esc_attr( $key ) . '"' . wc_selected( $key, $selections ) . '>' . esc_html( $val ) . '</option>'; // WPCS: XSS ok.
|
25 |
+
}
|
26 |
+
}
|
27 |
+
?>
|
28 |
+
</select>
|
29 |
+
<?php echo $this->get_description_html( $data ); ?>
|
30 |
+
<br/>
|
31 |
+
<a class="select_all button" href="#"><?php esc_html_e( 'Select all', 'woocommerce' ); ?></a>
|
32 |
+
<a class="select_none button" href="#"><?php esc_html_e( 'Select none', 'woocommerce' ); ?></a>
|
33 |
+
</td>
|
34 |
+
</tr>
|
includes/class-stripe.php
CHANGED
@@ -25,7 +25,7 @@ class WC_Stripe_Manager {
|
|
25 |
*
|
26 |
* @var string
|
27 |
*/
|
28 |
-
public $version = '3.2.
|
29 |
|
30 |
/**
|
31 |
*
|
25 |
*
|
26 |
* @var string
|
27 |
*/
|
28 |
+
public $version = '3.2.10';
|
29 |
|
30 |
/**
|
31 |
*
|
includes/class-wc-stripe-field-manager.php
CHANGED
@@ -46,6 +46,9 @@ class WC_Stripe_Field_Manager {
|
|
46 |
if ( WC()->cart && wcs_stripe_active() && WC_Subscriptions_Cart::cart_contains_subscription() ) {
|
47 |
wp_add_inline_script( 'wc-checkout', 'var wc_stripe_cart_contains_subscription = true;' );
|
48 |
}
|
|
|
|
|
|
|
49 |
do_action( 'wc_stripe_output_checkout_fields' );
|
50 |
}
|
51 |
|
46 |
if ( WC()->cart && wcs_stripe_active() && WC_Subscriptions_Cart::cart_contains_subscription() ) {
|
47 |
wp_add_inline_script( 'wc-checkout', 'var wc_stripe_cart_contains_subscription = true;' );
|
48 |
}
|
49 |
+
if ( WC()->cart && wc_stripe_pre_orders_active() && WC_Pre_Orders_Cart::cart_contains_pre_order() && WC_Pre_Orders_Product::product_is_charged_upon_release( WC_Pre_Orders_Cart::get_pre_order_product() ) ) {
|
50 |
+
wp_add_inline_script( 'wc-checkout', 'var wc_stripe_preorder_exists = true;' );
|
51 |
+
}
|
52 |
do_action( 'wc_stripe_output_checkout_fields' );
|
53 |
}
|
54 |
|
includes/class-wc-stripe-frontend-scripts.php
CHANGED
@@ -21,8 +21,7 @@ class WC_Stripe_Frontend_Scripts {
|
|
21 |
|
22 |
public $global_scripts = array(
|
23 |
'external' => 'https://js.stripe.com/v3/',
|
24 |
-
'gpay' => 'https://pay.google.com/gp/p/js/pay.js'
|
25 |
-
'plaid' => 'https://cdn.plaid.com/link/v2/stable/link-initialize.js',
|
26 |
);
|
27 |
|
28 |
public function __construct() {
|
@@ -78,7 +77,8 @@ class WC_Stripe_Frontend_Scripts {
|
|
78 |
'api_key' => wc_stripe_get_publishable_key(),
|
79 |
'account' => wc_stripe_get_account_id(),
|
80 |
'page' => $this->get_page_id(),
|
81 |
-
'version' => stripe_wc()->version()
|
|
|
82 |
),
|
83 |
'wc_stripe_params_v3'
|
84 |
);
|
@@ -122,14 +122,14 @@ class WC_Stripe_Frontend_Scripts {
|
|
122 |
}
|
123 |
|
124 |
public function register_script( $handle, $src, $deps = array(), $version = '', $footer = true ) {
|
125 |
-
$version = empty( $version ) ? stripe_wc()->version() : $version;
|
126 |
$this->registered_scripts[] = $this->get_handle( $handle );
|
127 |
wp_register_script( $this->get_handle( $handle ), $src, $deps, $version, $footer );
|
128 |
}
|
129 |
|
130 |
public function enqueue_script( $handle, $src = '', $deps = array(), $version = '', $footer = true ) {
|
131 |
$handle = $this->get_handle( $handle );
|
132 |
-
$version = empty( $version ) ? stripe_wc()->version() : $version;
|
133 |
if ( ! in_array( $handle, $this->registered_scripts ) ) {
|
134 |
$this->register_script( $handle, $src, $deps, $version, $footer );
|
135 |
}
|
@@ -178,25 +178,7 @@ class WC_Stripe_Frontend_Scripts {
|
|
178 |
}
|
179 |
|
180 |
private function get_page_id() {
|
181 |
-
|
182 |
-
if ( is_product() ) {
|
183 |
-
return 'product';
|
184 |
-
}
|
185 |
-
if ( is_cart() ) {
|
186 |
-
return 'cart';
|
187 |
-
}
|
188 |
-
if ( is_checkout() ) {
|
189 |
-
if ( ! empty( $wp->query_vars['order-pay'] ) ) {
|
190 |
-
return 'order_pay';
|
191 |
-
}
|
192 |
-
|
193 |
-
return 'checkout';
|
194 |
-
}
|
195 |
-
if ( is_add_payment_method_page() ) {
|
196 |
-
return 'add_payment_method';
|
197 |
-
}
|
198 |
-
|
199 |
-
return '';
|
200 |
}
|
201 |
|
202 |
public function print_footer_scripts() {
|
21 |
|
22 |
public $global_scripts = array(
|
23 |
'external' => 'https://js.stripe.com/v3/',
|
24 |
+
'gpay' => 'https://pay.google.com/gp/p/js/pay.js'
|
|
|
25 |
);
|
26 |
|
27 |
public function __construct() {
|
77 |
'api_key' => wc_stripe_get_publishable_key(),
|
78 |
'account' => wc_stripe_get_account_id(),
|
79 |
'page' => $this->get_page_id(),
|
80 |
+
'version' => stripe_wc()->version(),
|
81 |
+
'mode' => wc_stripe_mode()
|
82 |
),
|
83 |
'wc_stripe_params_v3'
|
84 |
);
|
122 |
}
|
123 |
|
124 |
public function register_script( $handle, $src, $deps = array(), $version = '', $footer = true ) {
|
125 |
+
$version = empty( $version ) && null !== $version ? stripe_wc()->version() : $version;
|
126 |
$this->registered_scripts[] = $this->get_handle( $handle );
|
127 |
wp_register_script( $this->get_handle( $handle ), $src, $deps, $version, $footer );
|
128 |
}
|
129 |
|
130 |
public function enqueue_script( $handle, $src = '', $deps = array(), $version = '', $footer = true ) {
|
131 |
$handle = $this->get_handle( $handle );
|
132 |
+
$version = empty( $version ) && null !== $version ? stripe_wc()->version() : $version;
|
133 |
if ( ! in_array( $handle, $this->registered_scripts ) ) {
|
134 |
$this->register_script( $handle, $src, $deps, $version, $footer );
|
135 |
}
|
178 |
}
|
179 |
|
180 |
private function get_page_id() {
|
181 |
+
return wc_stripe_get_current_page();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
182 |
}
|
183 |
|
184 |
public function print_footer_scripts() {
|
includes/class-wc-stripe-gateway-conversions.php
CHANGED
@@ -32,9 +32,10 @@ class WC_Stripe_Gateway_Conversion {
|
|
32 |
$payment_method = 'stripe_cc';
|
33 |
break;
|
34 |
}
|
35 |
-
|
|
|
36 |
update_post_meta( $order->get_id(), '_payment_method', $payment_method );
|
37 |
-
}
|
38 |
|
39 |
return $payment_method;
|
40 |
}
|
32 |
$payment_method = 'stripe_cc';
|
33 |
break;
|
34 |
}
|
35 |
+
// commented out in 3.2.10. Don't update the post_meta in case merchant switches back to other plugin.
|
36 |
+
/*if ( $payment_method !== $old_payment_method && ! empty( $payment_method ) ) {
|
37 |
update_post_meta( $order->get_id(), '_payment_method', $payment_method );
|
38 |
+
}*/
|
39 |
|
40 |
return $payment_method;
|
41 |
}
|
includes/class-wc-stripe-payment-charge-local.php
CHANGED
@@ -32,14 +32,19 @@ class WC_Stripe_Payment_Charge_Local extends WC_Stripe_Payment_Charge {
|
|
32 |
// update the source's metadata with the order id
|
33 |
if ( 'chargeable' !== $source->status ) {
|
34 |
$source = $this->gateway->sources->mode( wc_stripe_order_mode( $order ) )->update( $source_id, $this->payment_method->get_update_source_args( $order ) );
|
35 |
-
|
36 |
}
|
37 |
} else {
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
}
|
44 |
|
45 |
if ( is_wp_error( $source ) ) {
|
32 |
// update the source's metadata with the order id
|
33 |
if ( 'chargeable' !== $source->status ) {
|
34 |
$source = $this->gateway->sources->mode( wc_stripe_order_mode( $order ) )->update( $source_id, $this->payment_method->get_update_source_args( $order ) );
|
|
|
35 |
}
|
36 |
} else {
|
37 |
+
if ( $this->payment_method->use_saved_source() ) {
|
38 |
+
$source_id = $this->payment_method->get_saved_source_id();
|
39 |
+
$source = $source = $this->gateway->sources->mode( wc_stripe_order_mode( $order ) )->retrieve( $source_id );
|
40 |
+
} else {
|
41 |
+
// create the source
|
42 |
+
$args = $this->payment_method->get_source_args( $order );
|
43 |
+
$args['metadata']['order_id'] = $order->get_id();
|
44 |
+
$args['metadata']['created'] = time();
|
45 |
+
$source = $this->gateway->sources->mode( wc_stripe_order_mode( $order ) )->create( $args );
|
46 |
+
|
47 |
+
}
|
48 |
}
|
49 |
|
50 |
if ( is_wp_error( $source ) ) {
|
includes/controllers/class-wc-stripe-controller-checkout.php
CHANGED
@@ -141,8 +141,9 @@ class WC_Stripe_Controller_Checkout extends WC_Stripe_Rest_Controller {
|
|
141 |
*/
|
142 |
public function process_order_pay( $request ) {
|
143 |
global $wp;
|
|
|
144 |
|
145 |
-
$wp->
|
146 |
|
147 |
wc_maybe_define_constant( WC_Stripe_Constants::WOOCOMMERCE_STRIPE_ORDER_PAY, true );
|
148 |
|
141 |
*/
|
142 |
public function process_order_pay( $request ) {
|
143 |
global $wp;
|
144 |
+
$this->frontend_includes();
|
145 |
|
146 |
+
$wp->set_query_var( 'order-pay', $request->get_param( 'order_id' ) );
|
147 |
|
148 |
wc_maybe_define_constant( WC_Stripe_Constants::WOOCOMMERCE_STRIPE_ORDER_PAY, true );
|
149 |
|
includes/controllers/class-wc-stripe-controller-gateway-settings.php
CHANGED
@@ -79,7 +79,7 @@ class WC_Stripe_Controller_Gateway_Settings extends WC_Stripe_Rest_Controller {
|
|
79 |
try {
|
80 |
$api_key = wc_stripe_get_secret_key( 'live' );
|
81 |
if ( empty( $api_key ) ) {
|
82 |
-
throw new Exception( __( 'You cannot register your domain until you have
|
83 |
}
|
84 |
// fetch the Apple domains
|
85 |
$registered_domains = $gateway->applePayDomains->mode( 'live' )->all( array( 'limit' => 50 ) );
|
@@ -195,9 +195,21 @@ class WC_Stripe_Controller_Gateway_Settings extends WC_Stripe_Rest_Controller {
|
|
195 |
* @param WP_REST_Request $request
|
196 |
*/
|
197 |
public function connection_test( $request ) {
|
198 |
-
$mode
|
199 |
-
|
|
|
200 |
try {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
201 |
// test the secret key
|
202 |
$response = WC_Stripe_Gateway::load()->customers->mode( $mode )->all( array( 'limit' => 1 ) );
|
203 |
|
@@ -219,6 +231,11 @@ class WC_Stripe_Controller_Gateway_Settings extends WC_Stripe_Rest_Controller {
|
|
219 |
if ( $response['response']['code'] == 401 ) {
|
220 |
throw new Exception( sprintf( __( 'Mode: %s. Invalid publishable key. Please check your entry.', 'woo-stripe-payment' ), $mode ) );
|
221 |
}
|
|
|
|
|
|
|
|
|
|
|
222 |
} catch ( Exception $e ) {
|
223 |
return new WP_Error( 'connection-failure', $e->getMessage(), array( 'status' => 200 ) );
|
224 |
}
|
79 |
try {
|
80 |
$api_key = wc_stripe_get_secret_key( 'live' );
|
81 |
if ( empty( $api_key ) ) {
|
82 |
+
throw new Exception( __( 'You cannot register your domain until you have completed the Connect process on the API Settings page. A registered domain is not required when test mode is enabled.', 'woo-stripe-payment' ) );
|
83 |
}
|
84 |
// fetch the Apple domains
|
85 |
$registered_domains = $gateway->applePayDomains->mode( 'live' )->all( array( 'limit' => 50 ) );
|
195 |
* @param WP_REST_Request $request
|
196 |
*/
|
197 |
public function connection_test( $request ) {
|
198 |
+
$mode = $request->get_param( 'mode' );
|
199 |
+
$settings = stripe_wc()->api_settings;
|
200 |
+
$api_keys = null;
|
201 |
try {
|
202 |
+
if ( $mode === 'test' ) {
|
203 |
+
// if test mode and keys not empty, save them so connect test uses most recently entered keys.
|
204 |
+
$api_keys = array( $request->get_param( 'secret_key' ), $request->get_param( 'publishable_key' ) );
|
205 |
+
|
206 |
+
if ( in_array( null, $api_keys ) ) {
|
207 |
+
throw new Exception( sprintf( __( 'You must enter your API keys or connect the plugin before performing a connection test.', 'woo-stripe-payment' ) ) );
|
208 |
+
}
|
209 |
+
$settings->settings['publishable_key_test'] = $settings->validate_text_field( 'publishable_key_test', $request->get_param( 'publishable_key' ) );
|
210 |
+
$settings->settings['secret_key_test'] = $settings->validate_password_field( 'secret_key_test', $request->get_param( 'secret_key' ) );
|
211 |
+
}
|
212 |
+
|
213 |
// test the secret key
|
214 |
$response = WC_Stripe_Gateway::load()->customers->mode( $mode )->all( array( 'limit' => 1 ) );
|
215 |
|
231 |
if ( $response['response']['code'] == 401 ) {
|
232 |
throw new Exception( sprintf( __( 'Mode: %s. Invalid publishable key. Please check your entry.', 'woo-stripe-payment' ), $mode ) );
|
233 |
}
|
234 |
+
|
235 |
+
// if test mode and keys are good, save them
|
236 |
+
if ( $api_keys ) {
|
237 |
+
update_option( $settings->get_option_key(), $settings->settings, 'yes' );
|
238 |
+
}
|
239 |
} catch ( Exception $e ) {
|
240 |
return new WP_Error( 'connection-failure', $e->getMessage(), array( 'status' => 200 ) );
|
241 |
}
|
includes/controllers/class-wc-stripe-controller-payment-intent.php
CHANGED
@@ -1,91 +1,91 @@
|
|
1 |
-
<?php
|
2 |
-
defined( 'ABSPATH' ) || exit();
|
3 |
-
|
4 |
-
/**
|
5 |
-
* Controller which handles Payment Intent related actions such as creation.
|
6 |
-
*
|
7 |
-
* @author PaymentPlugins
|
8 |
-
* @package Stripe/Controllers
|
9 |
-
*
|
10 |
-
*/
|
11 |
-
class WC_Stripe_Controller_Payment_Intent extends WC_Stripe_Rest_Controller {
|
12 |
-
|
13 |
-
protected $namespace = '';
|
14 |
-
|
15 |
-
public function register_routes() {
|
16 |
-
register_rest_route(
|
17 |
-
$this->rest_uri(),
|
18 |
-
'setup-intent',
|
19 |
-
array(
|
20 |
-
'methods' => WP_REST_Server::READABLE,
|
21 |
-
'permission_callback' => '__return_true',
|
22 |
-
'callback' => array(
|
23 |
-
$this,
|
24 |
-
'create_setup_intent',
|
25 |
-
),
|
26 |
-
)
|
27 |
-
);
|
28 |
-
register_rest_route(
|
29 |
-
$this->rest_uri(),
|
30 |
-
'sync-payment-intent',
|
31 |
-
array(
|
32 |
-
'methods' => WP_REST_Server::CREATABLE,
|
33 |
-
'callback' => array( $this, 'sync_payment_intent' ),
|
34 |
-
'permission_callback' => '__return_true',
|
35 |
-
'args' => array(
|
36 |
-
'order_id' => array( 'required' => true ),
|
37 |
-
'client_secret' => array( 'required' => true ),
|
38 |
-
),
|
39 |
-
)
|
40 |
-
);
|
41 |
-
}
|
42 |
-
|
43 |
-
/**
|
44 |
-
*
|
45 |
-
* @param WP_REST_Request $request
|
46 |
-
*/
|
47 |
-
public function create_setup_intent( $request ) {
|
48 |
-
$intent = WC_Stripe_Gateway::load()->setupIntents->create( array( 'usage' => 'off_session' ) );
|
49 |
-
try {
|
50 |
-
if ( is_wp_error( $intent ) ) {
|
51 |
-
throw new Exception( $intent->get_error_message() );
|
52 |
-
}
|
53 |
-
|
54 |
-
return rest_ensure_response( array( 'intent' => array( 'client_secret' => $intent->client_secret ) ) );
|
55 |
-
} catch ( Exception $e ) {
|
56 |
-
return new WP_Error(
|
57 |
-
'payment-intent-error',
|
58 |
-
sprintf( __( 'Error creating payment intent. Reason: %s', 'woo-stripe-payment' ), $e->getMessage() ),
|
59 |
-
array(
|
60 |
-
'status' => 200,
|
61 |
-
)
|
62 |
-
);
|
63 |
-
}
|
64 |
-
}
|
65 |
-
|
66 |
-
/**
|
67 |
-
*
|
68 |
-
* @param WP_REST_Request $request
|
69 |
-
*/
|
70 |
-
public function sync_payment_intent( $request ) {
|
71 |
-
try {
|
72 |
-
$order = wc_get_order( absint( $request->get_param( 'order_id' ) ) );
|
73 |
-
if ( ! $order ) {
|
74 |
-
throw new Exception( __( 'Invalid order id provided', 'woo-stripe-payment' ) );
|
75 |
-
}
|
76 |
-
|
77 |
-
$intent = WC_Stripe_Gateway::load()->paymentIntents->retrieve( $order->get_meta( WC_Stripe_Constants::PAYMENT_INTENT_ID ) );
|
78 |
-
|
79 |
-
if ( ! hash_equals( $intent->client_secret, $request->get_param( 'client_secret' ) ) ) {
|
80 |
-
throw new Exception( __( 'You are not authorized to update this order.', 'woo-stripe-payment' ) );
|
81 |
-
}
|
82 |
-
|
83 |
-
$order->update_meta_data( WC_Stripe_Constants::PAYMENT_INTENT, $intent->jsonSerialize() );
|
84 |
-
$order->save();
|
85 |
-
|
86 |
-
return rest_ensure_response( array() );
|
87 |
-
} catch ( Exception $e ) {
|
88 |
-
return new WP_Error( 'payment-intent-error', $e->getMessage(), array( 'status' => 200 ) );
|
89 |
-
}
|
90 |
-
}
|
91 |
-
}
|
1 |
+
<?php
|
2 |
+
defined( 'ABSPATH' ) || exit();
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Controller which handles Payment Intent related actions such as creation.
|
6 |
+
*
|
7 |
+
* @author PaymentPlugins
|
8 |
+
* @package Stripe/Controllers
|
9 |
+
*
|
10 |
+
*/
|
11 |
+
class WC_Stripe_Controller_Payment_Intent extends WC_Stripe_Rest_Controller {
|
12 |
+
|
13 |
+
protected $namespace = '';
|
14 |
+
|
15 |
+
public function register_routes() {
|
16 |
+
register_rest_route(
|
17 |
+
$this->rest_uri(),
|
18 |
+
'setup-intent',
|
19 |
+
array(
|
20 |
+
'methods' => WP_REST_Server::READABLE,
|
21 |
+
'permission_callback' => '__return_true',
|
22 |
+
'callback' => array(
|
23 |
+
$this,
|
24 |
+
'create_setup_intent',
|
25 |
+
),
|
26 |
+
)
|
27 |
+
);
|
28 |
+
register_rest_route(
|
29 |
+
$this->rest_uri(),
|
30 |
+
'sync-payment-intent',
|
31 |
+
array(
|
32 |
+
'methods' => WP_REST_Server::CREATABLE,
|
33 |
+
'callback' => array( $this, 'sync_payment_intent' ),
|
34 |
+
'permission_callback' => '__return_true',
|
35 |
+
'args' => array(
|
36 |
+
'order_id' => array( 'required' => true ),
|
37 |
+
'client_secret' => array( 'required' => true ),
|
38 |
+
),
|
39 |
+
)
|
40 |
+
);
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
*
|
45 |
+
* @param WP_REST_Request $request
|
46 |
+
*/
|
47 |
+
public function create_setup_intent( $request ) {
|
48 |
+
$intent = WC_Stripe_Gateway::load()->setupIntents->create( array( 'usage' => 'off_session' ) );
|
49 |
+
try {
|
50 |
+
if ( is_wp_error( $intent ) ) {
|
51 |
+
throw new Exception( $intent->get_error_message() );
|
52 |
+
}
|
53 |
+
|
54 |
+
return rest_ensure_response( array( 'intent' => array( 'client_secret' => $intent->client_secret ) ) );
|
55 |
+
} catch ( Exception $e ) {
|
56 |
+
return new WP_Error(
|
57 |
+
'payment-intent-error',
|
58 |
+
sprintf( __( 'Error creating payment intent. Reason: %s', 'woo-stripe-payment' ), $e->getMessage() ),
|
59 |
+
array(
|
60 |
+
'status' => 200,
|
61 |
+
)
|
62 |
+
);
|
63 |
+
}
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
*
|
68 |
+
* @param WP_REST_Request $request
|
69 |
+
*/
|
70 |
+
public function sync_payment_intent( $request ) {
|
71 |
+
try {
|
72 |
+
$order = wc_get_order( absint( $request->get_param( 'order_id' ) ) );
|
73 |
+
if ( ! $order ) {
|
74 |
+
throw new Exception( __( 'Invalid order id provided', 'woo-stripe-payment' ) );
|
75 |
+
}
|
76 |
+
|
77 |
+
$intent = WC_Stripe_Gateway::load()->paymentIntents->retrieve( $order->get_meta( WC_Stripe_Constants::PAYMENT_INTENT_ID ) );
|
78 |
+
|
79 |
+
if ( ! hash_equals( $intent->client_secret, $request->get_param( 'client_secret' ) ) ) {
|
80 |
+
throw new Exception( __( 'You are not authorized to update this order.', 'woo-stripe-payment' ) );
|
81 |
+
}
|
82 |
+
|
83 |
+
$order->update_meta_data( WC_Stripe_Constants::PAYMENT_INTENT, $intent->jsonSerialize() );
|
84 |
+
$order->save();
|
85 |
+
|
86 |
+
return rest_ensure_response( array( 'success' => true ) );
|
87 |
+
} catch ( Exception $e ) {
|
88 |
+
return new WP_Error( 'payment-intent-error', $e->getMessage(), array( 'status' => 200 ) );
|
89 |
+
}
|
90 |
+
}
|
91 |
+
}
|
includes/gateways/class-wc-payment-gateway-stripe-ach.php
CHANGED
@@ -75,6 +75,7 @@ class WC_Payment_Gateway_Stripe_ACH extends WC_Payment_Gateway_Stripe {
|
|
75 |
* @see WC_Payment_Gateway_Stripe::enqueue_checkout_scripts()
|
76 |
*/
|
77 |
public function enqueue_checkout_scripts( $scripts ) {
|
|
|
78 |
$scripts->enqueue_script(
|
79 |
'ach',
|
80 |
$scripts->assets_url( 'js/frontend/ach-payments.js' ),
|
75 |
* @see WC_Payment_Gateway_Stripe::enqueue_checkout_scripts()
|
76 |
*/
|
77 |
public function enqueue_checkout_scripts( $scripts ) {
|
78 |
+
$scripts->register_script( 'plaid', 'https://cdn.plaid.com/link/v2/stable/link-initialize.js', array(), null );
|
79 |
$scripts->enqueue_script(
|
80 |
'ach',
|
81 |
$scripts->assets_url( 'js/frontend/ach-payments.js' ),
|
includes/gateways/class-wc-payment-gateway-stripe-alipay.php
CHANGED
@@ -28,6 +28,11 @@ class WC_Payment_Gateway_Stripe_Alipay extends WC_Payment_Gateway_Stripe_Local_P
|
|
28 |
parent::__construct();
|
29 |
}
|
30 |
|
|
|
|
|
|
|
|
|
|
|
31 |
/**
|
32 |
* @param string $currency
|
33 |
* @param string $billing_country
|
28 |
parent::__construct();
|
29 |
}
|
30 |
|
31 |
+
public function init_form_fields() {
|
32 |
+
parent::init_form_fields();
|
33 |
+
$this->form_fields['allowed_countries']['default'] = 'all';
|
34 |
+
}
|
35 |
+
|
36 |
/**
|
37 |
* @param string $currency
|
38 |
* @param string $billing_country
|
includes/gateways/class-wc-payment-gateway-stripe-fpx.php
CHANGED
@@ -20,7 +20,7 @@ class WC_Payment_Gateway_Stripe_FPX extends WC_Payment_Gateway_Stripe_Local_Paym
|
|
20 |
public function __construct() {
|
21 |
$this->local_payment_type = 'fpx';
|
22 |
$this->currencies = array( 'MYR' );
|
23 |
-
$this->countries = array();
|
24 |
$this->id = 'stripe_fpx';
|
25 |
$this->tab_title = __( 'FPX', 'woo-stripe-payment' );
|
26 |
$this->method_title = __( 'FPX', 'woo-stripe-payment' );
|
20 |
public function __construct() {
|
21 |
$this->local_payment_type = 'fpx';
|
22 |
$this->currencies = array( 'MYR' );
|
23 |
+
$this->countries = array( 'MY' );
|
24 |
$this->id = 'stripe_fpx';
|
25 |
$this->tab_title = __( 'FPX', 'woo-stripe-payment' );
|
26 |
$this->method_title = __( 'FPX', 'woo-stripe-payment' );
|
includes/gateways/class-wc-payment-gateway-stripe-googlepay.php
CHANGED
@@ -13,7 +13,9 @@ if ( ! class_exists( 'WC_Payment_Gateway_Stripe' ) ) {
|
|
13 |
*/
|
14 |
class WC_Payment_Gateway_Stripe_GooglePay extends WC_Payment_Gateway_Stripe {
|
15 |
|
16 |
-
use
|
|
|
|
|
17 |
|
18 |
public function __construct() {
|
19 |
$this->id = 'stripe_googlepay';
|
13 |
*/
|
14 |
class WC_Payment_Gateway_Stripe_GooglePay extends WC_Payment_Gateway_Stripe {
|
15 |
|
16 |
+
use WC_Stripe_Payment_Intent_Trait;
|
17 |
+
|
18 |
+
protected $payment_method_type = 'card';
|
19 |
|
20 |
public function __construct() {
|
21 |
$this->id = 'stripe_googlepay';
|
includes/gateways/class-wc-payment-gateway-stripe-grabpay.php
CHANGED
@@ -20,7 +20,7 @@ class WC_Payment_Gateway_Stripe_GrabPay extends WC_Payment_Gateway_Stripe_Local_
|
|
20 |
public function __construct() {
|
21 |
$this->local_payment_type = 'grabpay';
|
22 |
$this->currencies = array( 'SGD', 'MYR' );
|
23 |
-
$this->countries = array();
|
24 |
$this->id = 'stripe_grabpay';
|
25 |
$this->tab_title = __( 'GrabPay', 'woo-stripe-payment' );
|
26 |
$this->method_title = __( 'GrabPay', 'woo-stripe-payment' );
|
20 |
public function __construct() {
|
21 |
$this->local_payment_type = 'grabpay';
|
22 |
$this->currencies = array( 'SGD', 'MYR' );
|
23 |
+
$this->countries = array( 'MY', 'SG' );
|
24 |
$this->id = 'stripe_grabpay';
|
25 |
$this->tab_title = __( 'GrabPay', 'woo-stripe-payment' );
|
26 |
$this->method_title = __( 'GrabPay', 'woo-stripe-payment' );
|
includes/gateways/class-wc-payment-gateway-stripe-klarna.php
CHANGED
@@ -18,6 +18,7 @@ class WC_Payment_Gateway_Stripe_Klarna extends WC_Payment_Gateway_Stripe_Local_P
|
|
18 |
public function __construct() {
|
19 |
$this->local_payment_type = 'klarna';
|
20 |
$this->currencies = array( 'EUR', 'SEK', 'NOK', 'DKK', 'GBP', 'USD' );
|
|
|
21 |
$this->id = 'stripe_klarna';
|
22 |
$this->tab_title = __( 'Klarna', 'woo-stripe-payment' );
|
23 |
$this->template_name = 'local-payment.php';
|
@@ -50,7 +51,7 @@ class WC_Payment_Gateway_Stripe_Klarna extends WC_Payment_Gateway_Stripe_Local_P
|
|
50 |
if ( $billing_country ) {
|
51 |
$params = $this->get_required_parameters();
|
52 |
|
53 |
-
return isset( $params[ $currency ] ) &&
|
54 |
}
|
55 |
|
56 |
return false;
|
@@ -71,6 +72,18 @@ class WC_Payment_Gateway_Stripe_Klarna extends WC_Payment_Gateway_Stripe_Local_P
|
|
71 |
public function get_local_payment_settings() {
|
72 |
return wp_parse_args(
|
73 |
array(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
'payment_categories' => array(
|
75 |
'title' => __( 'Payment Categories', 'woo-stripe-payment' ),
|
76 |
'type' => 'multiselect',
|
18 |
public function __construct() {
|
19 |
$this->local_payment_type = 'klarna';
|
20 |
$this->currencies = array( 'EUR', 'SEK', 'NOK', 'DKK', 'GBP', 'USD' );
|
21 |
+
$this->countries = $this->limited_countries = array( 'US', 'AT', 'FI', 'DE', 'NL', 'DK', 'NO', 'SE', 'GB' );
|
22 |
$this->id = 'stripe_klarna';
|
23 |
$this->tab_title = __( 'Klarna', 'woo-stripe-payment' );
|
24 |
$this->template_name = 'local-payment.php';
|
51 |
if ( $billing_country ) {
|
52 |
$params = $this->get_required_parameters();
|
53 |
|
54 |
+
return isset( $params[ $currency ] ) && in_array( $billing_country, $params[ $currency ] ) !== false;
|
55 |
}
|
56 |
|
57 |
return false;
|
72 |
public function get_local_payment_settings() {
|
73 |
return wp_parse_args(
|
74 |
array(
|
75 |
+
'charge_type' => array(
|
76 |
+
'type' => 'select',
|
77 |
+
'title' => __( 'Charge Type', 'woo-stripe-payment' ),
|
78 |
+
'default' => 'capture',
|
79 |
+
'class' => 'wc-enhanced-select',
|
80 |
+
'options' => array(
|
81 |
+
'capture' => __( 'Capture', 'woo-stripe-payment' ),
|
82 |
+
'authorize' => __( 'Authorize', 'woo-stripe-payment' ),
|
83 |
+
),
|
84 |
+
'desc_tip' => true,
|
85 |
+
'description' => __( 'This option determines whether the customer\'s funds are captured immediately or authorized and can be captured at a later date.', 'woo-stripe-payment' ),
|
86 |
+
),
|
87 |
'payment_categories' => array(
|
88 |
'title' => __( 'Payment Categories', 'woo-stripe-payment' ),
|
89 |
'type' => 'multiselect',
|
includes/gateways/class-wc-payment-gateway-stripe-sepa.php
CHANGED
@@ -49,6 +49,13 @@ class WC_Payment_Gateway_Stripe_Sepa extends WC_Payment_Gateway_Stripe_Local_Pay
|
|
49 |
$this->supports[] = 'subscription_suspension';
|
50 |
$this->supports[] = 'subscription_date_changes';
|
51 |
$this->supports[] = 'subscription_payment_method_change_admin';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
}
|
53 |
|
54 |
public function get_element_params() {
|
@@ -80,7 +87,7 @@ class WC_Payment_Gateway_Stripe_Sepa extends WC_Payment_Gateway_Stripe_Local_Pay
|
|
80 |
return __( 'Saved Accounts', 'woo-stripe-payment' );
|
81 |
}
|
82 |
|
83 |
-
public function get_tokens() {
|
84 |
// always return an empty array if this is the checkout page because
|
85 |
// saved SEPA src's can only be used for the amount specified at source creation.
|
86 |
if ( is_checkout() ) {
|
@@ -88,5 +95,5 @@ class WC_Payment_Gateway_Stripe_Sepa extends WC_Payment_Gateway_Stripe_Local_Pay
|
|
88 |
}
|
89 |
|
90 |
return parent::get_tokens();
|
91 |
-
}
|
92 |
}
|
49 |
$this->supports[] = 'subscription_suspension';
|
50 |
$this->supports[] = 'subscription_date_changes';
|
51 |
$this->supports[] = 'subscription_payment_method_change_admin';
|
52 |
+
$this->supports[] = 'subscription_amount_changes';
|
53 |
+
$this->supports[] = 'subscription_payment_method_change_customer';
|
54 |
+
}
|
55 |
+
|
56 |
+
public function init_form_fields() {
|
57 |
+
parent::init_form_fields();
|
58 |
+
$this->form_fields['allowed_countries']['default'] = 'all';
|
59 |
}
|
60 |
|
61 |
public function get_element_params() {
|
87 |
return __( 'Saved Accounts', 'woo-stripe-payment' );
|
88 |
}
|
89 |
|
90 |
+
/*public function get_tokens() {
|
91 |
// always return an empty array if this is the checkout page because
|
92 |
// saved SEPA src's can only be used for the amount specified at source creation.
|
93 |
if ( is_checkout() ) {
|
95 |
}
|
96 |
|
97 |
return parent::get_tokens();
|
98 |
+
}*/
|
99 |
}
|
includes/gateways/class-wc-payment-gateway-stripe-sofort.php
CHANGED
@@ -19,7 +19,7 @@ class WC_Payment_Gateway_Stripe_Sofort extends WC_Payment_Gateway_Stripe_Local_P
|
|
19 |
$this->synchronous = false;
|
20 |
$this->local_payment_type = 'sofort';
|
21 |
$this->currencies = array( 'EUR' );
|
22 |
-
$this->countries = array( 'AT', 'BE', 'DE', 'ES', 'IT', 'NL' );
|
23 |
$this->id = 'stripe_sofort';
|
24 |
$this->tab_title = __( 'Sofort', 'woo-stripe-payment' );
|
25 |
$this->template_name = 'local-payment.php';
|
19 |
$this->synchronous = false;
|
20 |
$this->local_payment_type = 'sofort';
|
21 |
$this->currencies = array( 'EUR' );
|
22 |
+
$this->countries = $this->limited_countries = array( 'AT', 'BE', 'DE', 'ES', 'IT', 'NL' );
|
23 |
$this->id = 'stripe_sofort';
|
24 |
$this->tab_title = __( 'Sofort', 'woo-stripe-payment' );
|
25 |
$this->template_name = 'local-payment.php';
|
includes/gateways/class-wc-payment-gateway-stripe-wechat.php
CHANGED
@@ -28,6 +28,11 @@ class WC_Payment_Gateway_Stripe_WeChat extends WC_Payment_Gateway_Stripe_Local_P
|
|
28 |
parent::__construct();
|
29 |
}
|
30 |
|
|
|
|
|
|
|
|
|
|
|
31 |
/**
|
32 |
*
|
33 |
* {@inheritDoc}
|
28 |
parent::__construct();
|
29 |
}
|
30 |
|
31 |
+
public function init_form_fields() {
|
32 |
+
parent::init_form_fields();
|
33 |
+
$this->form_fields['allowed_countries']['default'] = 'all';
|
34 |
+
}
|
35 |
+
|
36 |
/**
|
37 |
*
|
38 |
* {@inheritDoc}
|
includes/gateways/settings/cc-settings.php
CHANGED
@@ -1,148 +1,137 @@
|
|
1 |
-
<?php
|
2 |
-
return array(
|
3 |
-
'enabled' => array(
|
4 |
-
'title' => __( 'Enabled', 'woo-stripe-payment' ),
|
5 |
-
'type' => 'checkbox',
|
6 |
-
'default' => 'yes',
|
7 |
-
'value' => 'yes',
|
8 |
-
'desc_tip' => true,
|
9 |
-
'description' => __( 'If enabled, your site can accept credit card payments through Stripe.', 'woo-stripe-payment' ),
|
10 |
-
),
|
11 |
-
'desc1' => array(
|
12 |
-
'type' => 'description',
|
13 |
-
'description' => sprintf( __( '%1$sTest cards%2$s', 'woo-stripe-payment' ), '<a target="_blank" href="https://stripe.com/docs/testing#cards">', '</a>' ),
|
14 |
-
),
|
15 |
-
'general_settings' => array(
|
16 |
-
'type' => 'title',
|
17 |
-
'title' => __( 'General Settings', 'woo-stripe-payment' ),
|
18 |
-
),
|
19 |
-
'title_text' => array(
|
20 |
-
'type' => 'text',
|
21 |
-
'title' => __( 'Title', 'woo-stripe-payment' ),
|
22 |
-
'default' => __( 'Credit Cards', 'woo-stripe-payment' ),
|
23 |
-
'desc_tip' => true,
|
24 |
-
'description' => __( 'Title of the credit card gateway' ),
|
25 |
-
),
|
26 |
-
'description' => array(
|
27 |
-
'title' => __( 'Description', 'woo-stripe-payment' ),
|
28 |
-
'type' => 'text',
|
29 |
-
'default' => '',
|
30 |
-
'description' => __( 'Leave blank if you don\'t want a description to show for the gateway.', 'woo-stripe-payment' ),
|
31 |
-
'desc_tip' => true,
|
32 |
-
),
|
33 |
-
'method_format' => array(
|
34 |
-
'title' => __( 'Credit Card Display', 'woo-stripe-payment' ),
|
35 |
-
'type' => 'select',
|
36 |
-
'class' => 'wc-enhanced-select',
|
37 |
-
'options' => wp_list_pluck( $this->get_method_formats(), 'example' ),
|
38 |
-
'value' => '',
|
39 |
-
'default' => 'type_ending_in',
|
40 |
-
'desc_tip' => true,
|
41 |
-
'description' => __( 'This option allows you to customize how the credit card will display for your customers on orders, subscriptions, etc.' ),
|
42 |
-
),
|
43 |
-
'charge_type' => array(
|
44 |
-
'type' => 'select',
|
45 |
-
'title' => __( 'Charge Type', 'woo-stripe-payment' ),
|
46 |
-
'default' => 'capture',
|
47 |
-
'class' => 'wc-enhanced-select',
|
48 |
-
'options' => array(
|
49 |
-
'capture' => __( 'Capture', 'woo-stripe-payment' ),
|
50 |
-
'authorize' => __( 'Authorize', 'woo-stripe-payment' ),
|
51 |
-
),
|
52 |
-
'desc_tip' => true,
|
53 |
-
'description' => __( 'This option determines whether the customer\'s funds are captured immediately or authorized and can be captured at a later date.', 'woo-stripe-payment' ),
|
54 |
-
),
|
55 |
-
'order_status' => array(
|
56 |
-
'type' => 'select',
|
57 |
-
'title' => __( 'Order Status', 'woo-stripe-payment' ),
|
58 |
-
'default' => 'default',
|
59 |
-
'class' => 'wc-enhanced-select',
|
60 |
-
'options' => array_merge( array( 'default' => __( 'Default', 'woo-stripe-payment' ) ), wc_get_order_statuses() ),
|
61 |
-
'tool_tip' => true,
|
62 |
-
'description' => __( 'This is the status of the order once payment is complete. If <b>Default</b> is selected, then WooCommerce will set the order status automatically based on internal logic which states if a product is virtual and downloadable then status is set to complete. Products that require shipping are set to Processing. Default is the recommended setting as it allows standard WooCommerce code to process the order status.', 'woo-stripe-payment' ),
|
63 |
-
),
|
64 |
-
'save_card_enabled' => array(
|
65 |
-
'type' => 'checkbox',
|
66 |
-
'value' => 'yes',
|
67 |
-
'default' => 'yes',
|
68 |
-
'title' => __( 'Allow Credit Card Save', 'woo-stripe-payment' ),
|
69 |
-
'desc_tip' => false,
|
70 |
-
'description' => __( 'If enabled, a checkbox will be available on the checkout page allowing your customers to save their credit card. The payment methods are stored securely in Stripe\'s vault and never touch your server. Note: if the cart contains a subscription, there will be no checkbox because the payment method will be saved automatically. There will also be no checkbox for guest checkout as a user must be logged in to save a payment method.', 'woo-stripe-payment' ),
|
71 |
-
),
|
72 |
-
'force_3d_secure' => array(
|
73 |
-
'title' => __( 'Force 3D Secure', 'woo-stripe-payment' ),
|
74 |
-
'type' => 'checkbox',
|
75 |
-
'value' => 'yes',
|
76 |
-
'default' => 'no',
|
77 |
-
'desc_tip' => false,
|
78 |
-
'description' => sprintf( __( 'Stripe internally determines when 3D secure should be presented based on their SCA engine. If <strong>Force 3D Secure</strong> is enabled, 3D Secure will be forced for ALL credit card transactions. In test mode 3D secure only shows for %1$s3DS Test Cards%2$s regardless of this setting.', 'woo-stripe-payment' ), '<a target="_blank" href="https://stripe.com/docs/testing#regulatory-cards">', '</a>' ),
|
79 |
-
),
|
80 |
-
'generic_error' => array(
|
81 |
-
'title' => __( 'Generic Errors', 'woo-stripe-payment' ),
|
82 |
-
'type' => 'checkbox',
|
83 |
-
'default' => 'no',
|
84 |
-
'value' => 'yes',
|
85 |
-
'desc_tip' => true,
|
86 |
-
'description' => __( 'If enabled, credit card errors will be generic when presented to the customer. Merchants may prefer to not provide details on why a card was not accepted for security purposes.', 'woo-stripe-payment' ),
|
87 |
-
),
|
88 |
-
'cards' => array(
|
89 |
-
'type' => 'multiselect',
|
90 |
-
'title' => __( 'Accepted Payment Methods', 'wwoo-stripe' ),
|
91 |
-
'class' => 'wc-enhanced-select stripe-accepted-cards',
|
92 |
-
'default' => array( 'amex', 'discover', 'visa', 'mastercard' ),
|
93 |
-
'options' => array(
|
94 |
-
'visa' => __( 'Visa', 'wwoo-stripe' ),
|
95 |
-
'amex' => __( 'Amex', 'wwoo-stripe' ),
|
96 |
-
'discover' => __( 'Discover', 'wwoo-stripe' ),
|
97 |
-
'mastercard' => __( 'MasterCard', 'wwoo-stripe' ),
|
98 |
-
'jcb' => __( 'JCB', 'wwoo-stripe' ),
|
99 |
-
'maestro' => __( 'Maestro', 'wwoo-stripe' ),
|
100 |
-
'diners' => __( 'Diners Club', 'wwoo-stripe' ),
|
101 |
-
'china_union_pay' => __( 'Union Pay', 'wwoo-stripe' ),
|
102 |
-
),
|
103 |
-
'desc_tip' => true,
|
104 |
-
'description' => __( 'The selected icons will show customers which credit card brands you accept.', 'wwoo-stripe' ),
|
105 |
-
),
|
106 |
-
'form_title' => array(
|
107 |
-
'type' => 'title',
|
108 |
-
'title' => __( 'Credit Card Form', 'woo-stripe-payment' ),
|
109 |
-
),
|
110 |
-
'form_type' => array(
|
111 |
-
'title' => __( 'Card Form', 'woo-stripe-payment' ),
|
112 |
-
'type' => 'select',
|
113 |
-
'options' => array(
|
114 |
-
'inline' => __( 'Stripe form', 'woo-stripe-payment' ),
|
115 |
-
'custom' => __( 'Custom form', 'woo-stripe-payment' ),
|
116 |
-
),
|
117 |
-
'default' => 'inline',
|
118 |
-
'description' => __( 'The Stripe form option displays a CC form rendered by Stripe. It works well with most themes. The custom card forms are offered if you want more options on the CC form design.', 'woo-stripe-payment' ),
|
119 |
-
),
|
120 |
-
'custom_form' => array(
|
121 |
-
'title' => __( 'Custom Form', 'woo-stripe-payment' ),
|
122 |
-
'type' => 'select',
|
123 |
-
'options' => wp_list_pluck( wc_stripe_get_custom_forms(), 'label' ),
|
124 |
-
'default' => 'bootstrap',
|
125 |
-
'description' => __( 'The design of the credit card form.', 'woo-stripe-payment' ),
|
126 |
-
'desc_tip' => true,
|
127 |
-
'custom_attributes' => array( 'data-show-if' => array( 'form_type' => 'custom' ) ),
|
128 |
-
),
|
129 |
-
'postal_enabled' => array(
|
130 |
-
'title' => __( 'Postal Code', 'woo-stripe-payment' ),
|
131 |
-
'type' => 'checkbox',
|
132 |
-
'default' => 'no',
|
133 |
-
'description' => __( 'If enabled, the CC form will show the postal code on the checkout page. If disabled, the billing field\'s postal code will be used. The postal code will show on the Add Payment Method page for security reasons.', 'woo-stripe-payment' ),
|
134 |
-
'desc_tip' => true,
|
135 |
-
'custom_attributes' => array( 'data-show-if' => array( 'form_type' => 'custom' ) ),
|
136 |
-
)
|
137 |
-
|
138 |
-
'title' => __ ( 'CVV Code', 'woo-stripe-payment' ),
|
139 |
-
'type' => 'checkbox', 'default' => 'yes',
|
140 |
-
'description' => __ ( 'If enabled, the CC form will show the cvv field.', 'woo-stripe-payment' ),
|
141 |
-
'desc_tip' => true,
|
142 |
-
'custom_attributes' => array(
|
143 |
-
'data-show-if' => array(
|
144 |
-
'form_type' => 'custom'
|
145 |
-
)
|
146 |
-
)
|
147 |
-
) */
|
148 |
-
);
|
1 |
+
<?php
|
2 |
+
return array(
|
3 |
+
'enabled' => array(
|
4 |
+
'title' => __( 'Enabled', 'woo-stripe-payment' ),
|
5 |
+
'type' => 'checkbox',
|
6 |
+
'default' => 'yes',
|
7 |
+
'value' => 'yes',
|
8 |
+
'desc_tip' => true,
|
9 |
+
'description' => __( 'If enabled, your site can accept credit card payments through Stripe.', 'woo-stripe-payment' ),
|
10 |
+
),
|
11 |
+
'desc1' => array(
|
12 |
+
'type' => 'description',
|
13 |
+
'description' => sprintf( __( '%1$sTest cards%2$s', 'woo-stripe-payment' ), '<a target="_blank" href="https://stripe.com/docs/testing#cards">', '</a>' ),
|
14 |
+
),
|
15 |
+
'general_settings' => array(
|
16 |
+
'type' => 'title',
|
17 |
+
'title' => __( 'General Settings', 'woo-stripe-payment' ),
|
18 |
+
),
|
19 |
+
'title_text' => array(
|
20 |
+
'type' => 'text',
|
21 |
+
'title' => __( 'Title', 'woo-stripe-payment' ),
|
22 |
+
'default' => __( 'Credit Cards', 'woo-stripe-payment' ),
|
23 |
+
'desc_tip' => true,
|
24 |
+
'description' => __( 'Title of the credit card gateway' ),
|
25 |
+
),
|
26 |
+
'description' => array(
|
27 |
+
'title' => __( 'Description', 'woo-stripe-payment' ),
|
28 |
+
'type' => 'text',
|
29 |
+
'default' => '',
|
30 |
+
'description' => __( 'Leave blank if you don\'t want a description to show for the gateway.', 'woo-stripe-payment' ),
|
31 |
+
'desc_tip' => true,
|
32 |
+
),
|
33 |
+
'method_format' => array(
|
34 |
+
'title' => __( 'Credit Card Display', 'woo-stripe-payment' ),
|
35 |
+
'type' => 'select',
|
36 |
+
'class' => 'wc-enhanced-select',
|
37 |
+
'options' => wp_list_pluck( $this->get_method_formats(), 'example' ),
|
38 |
+
'value' => '',
|
39 |
+
'default' => 'type_ending_in',
|
40 |
+
'desc_tip' => true,
|
41 |
+
'description' => __( 'This option allows you to customize how the credit card will display for your customers on orders, subscriptions, etc.' ),
|
42 |
+
),
|
43 |
+
'charge_type' => array(
|
44 |
+
'type' => 'select',
|
45 |
+
'title' => __( 'Charge Type', 'woo-stripe-payment' ),
|
46 |
+
'default' => 'capture',
|
47 |
+
'class' => 'wc-enhanced-select',
|
48 |
+
'options' => array(
|
49 |
+
'capture' => __( 'Capture', 'woo-stripe-payment' ),
|
50 |
+
'authorize' => __( 'Authorize', 'woo-stripe-payment' ),
|
51 |
+
),
|
52 |
+
'desc_tip' => true,
|
53 |
+
'description' => __( 'This option determines whether the customer\'s funds are captured immediately or authorized and can be captured at a later date.', 'woo-stripe-payment' ),
|
54 |
+
),
|
55 |
+
'order_status' => array(
|
56 |
+
'type' => 'select',
|
57 |
+
'title' => __( 'Order Status', 'woo-stripe-payment' ),
|
58 |
+
'default' => 'default',
|
59 |
+
'class' => 'wc-enhanced-select',
|
60 |
+
'options' => array_merge( array( 'default' => __( 'Default', 'woo-stripe-payment' ) ), wc_get_order_statuses() ),
|
61 |
+
'tool_tip' => true,
|
62 |
+
'description' => __( 'This is the status of the order once payment is complete. If <b>Default</b> is selected, then WooCommerce will set the order status automatically based on internal logic which states if a product is virtual and downloadable then status is set to complete. Products that require shipping are set to Processing. Default is the recommended setting as it allows standard WooCommerce code to process the order status.', 'woo-stripe-payment' ),
|
63 |
+
),
|
64 |
+
'save_card_enabled' => array(
|
65 |
+
'type' => 'checkbox',
|
66 |
+
'value' => 'yes',
|
67 |
+
'default' => 'yes',
|
68 |
+
'title' => __( 'Allow Credit Card Save', 'woo-stripe-payment' ),
|
69 |
+
'desc_tip' => false,
|
70 |
+
'description' => __( 'If enabled, a checkbox will be available on the checkout page allowing your customers to save their credit card. The payment methods are stored securely in Stripe\'s vault and never touch your server. Note: if the cart contains a subscription, there will be no checkbox because the payment method will be saved automatically. There will also be no checkbox for guest checkout as a user must be logged in to save a payment method.', 'woo-stripe-payment' ),
|
71 |
+
),
|
72 |
+
'force_3d_secure' => array(
|
73 |
+
'title' => __( 'Force 3D Secure', 'woo-stripe-payment' ),
|
74 |
+
'type' => 'checkbox',
|
75 |
+
'value' => 'yes',
|
76 |
+
'default' => 'no',
|
77 |
+
'desc_tip' => false,
|
78 |
+
'description' => sprintf( __( 'Stripe internally determines when 3D secure should be presented based on their SCA engine. If <strong>Force 3D Secure</strong> is enabled, 3D Secure will be forced for ALL credit card transactions. In test mode 3D secure only shows for %1$s3DS Test Cards%2$s regardless of this setting.', 'woo-stripe-payment' ), '<a target="_blank" href="https://stripe.com/docs/testing#regulatory-cards">', '</a>' ),
|
79 |
+
),
|
80 |
+
'generic_error' => array(
|
81 |
+
'title' => __( 'Generic Errors', 'woo-stripe-payment' ),
|
82 |
+
'type' => 'checkbox',
|
83 |
+
'default' => 'no',
|
84 |
+
'value' => 'yes',
|
85 |
+
'desc_tip' => true,
|
86 |
+
'description' => __( 'If enabled, credit card errors will be generic when presented to the customer. Merchants may prefer to not provide details on why a card was not accepted for security purposes.', 'woo-stripe-payment' ),
|
87 |
+
),
|
88 |
+
'cards' => array(
|
89 |
+
'type' => 'multiselect',
|
90 |
+
'title' => __( 'Accepted Payment Methods', 'wwoo-stripe' ),
|
91 |
+
'class' => 'wc-enhanced-select stripe-accepted-cards',
|
92 |
+
'default' => array( 'amex', 'discover', 'visa', 'mastercard' ),
|
93 |
+
'options' => array(
|
94 |
+
'visa' => __( 'Visa', 'wwoo-stripe' ),
|
95 |
+
'amex' => __( 'Amex', 'wwoo-stripe' ),
|
96 |
+
'discover' => __( 'Discover', 'wwoo-stripe' ),
|
97 |
+
'mastercard' => __( 'MasterCard', 'wwoo-stripe' ),
|
98 |
+
'jcb' => __( 'JCB', 'wwoo-stripe' ),
|
99 |
+
'maestro' => __( 'Maestro', 'wwoo-stripe' ),
|
100 |
+
'diners' => __( 'Diners Club', 'wwoo-stripe' ),
|
101 |
+
'china_union_pay' => __( 'Union Pay', 'wwoo-stripe' ),
|
102 |
+
),
|
103 |
+
'desc_tip' => true,
|
104 |
+
'description' => __( 'The selected icons will show customers which credit card brands you accept.', 'wwoo-stripe' ),
|
105 |
+
),
|
106 |
+
'form_title' => array(
|
107 |
+
'type' => 'title',
|
108 |
+
'title' => __( 'Credit Card Form', 'woo-stripe-payment' ),
|
109 |
+
),
|
110 |
+
'form_type' => array(
|
111 |
+
'title' => __( 'Card Form', 'woo-stripe-payment' ),
|
112 |
+
'type' => 'select',
|
113 |
+
'options' => array(
|
114 |
+
'inline' => __( 'Stripe form', 'woo-stripe-payment' ),
|
115 |
+
'custom' => __( 'Custom form', 'woo-stripe-payment' ),
|
116 |
+
),
|
117 |
+
'default' => 'inline',
|
118 |
+
'description' => __( 'The Stripe form option displays a CC form rendered by Stripe. It works well with most themes. The custom card forms are offered if you want more options on the CC form design.', 'woo-stripe-payment' ),
|
119 |
+
),
|
120 |
+
'custom_form' => array(
|
121 |
+
'title' => __( 'Custom Form', 'woo-stripe-payment' ),
|
122 |
+
'type' => 'select',
|
123 |
+
'options' => wp_list_pluck( wc_stripe_get_custom_forms(), 'label' ),
|
124 |
+
'default' => 'bootstrap',
|
125 |
+
'description' => __( 'The design of the credit card form.', 'woo-stripe-payment' ),
|
126 |
+
'desc_tip' => true,
|
127 |
+
'custom_attributes' => array( 'data-show-if' => array( 'form_type' => 'custom' ) ),
|
128 |
+
),
|
129 |
+
'postal_enabled' => array(
|
130 |
+
'title' => __( 'Postal Code', 'woo-stripe-payment' ),
|
131 |
+
'type' => 'checkbox',
|
132 |
+
'default' => 'no',
|
133 |
+
'description' => __( 'If enabled, the CC form will show the postal code on the checkout page. If disabled, the billing field\'s postal code will be used. The postal code will show on the Add Payment Method page for security reasons.', 'woo-stripe-payment' ),
|
134 |
+
'desc_tip' => true,
|
135 |
+
'custom_attributes' => array( 'data-show-if' => array( 'form_type' => 'custom' ) ),
|
136 |
+
)
|
137 |
+
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/gateways/settings/googlepay-settings.php
CHANGED
@@ -1,148 +1,148 @@
|
|
1 |
-
<?php
|
2 |
-
return array(
|
3 |
-
'desc1' => array(
|
4 |
-
'type' => 'description',
|
5 |
-
'description' => '<p><a target="_blank" href="https://pay.google.com/business/console">' . __( 'GPay Business Console', 'woo-stripe-payment' ) .
|
6 |
-
'</a></p>' .
|
7 |
-
'<p><a target="_blank" href="https://docs.paymentplugins.com/wc-stripe/config/#/stripe_googlepay?id=testing">Testing GPay</a></p>' .
|
8 |
-
__( 'When test mode is enabled, Google Pay will work without a merchant ID, allowing you to capture the necessary screenshots the Google API team needs to approve your integration request.', 'woo-stripe-payment' ),
|
9 |
-
),
|
10 |
-
'desc2' => array(
|
11 |
-
'type' => 'description',
|
12 |
-
'description' => sprintf(
|
13 |
-
'<p>%s</p>',
|
14 |
-
sprintf(
|
15 |
-
__( 'If you don\'t want to request a Google Merchant ID, you can use the %1$sPayment Request Gateway%2$s which has a Google Pay integration through Stripe via the Chrome browser.', 'woo-stripe-payment' ),
|
16 |
-
'<a target="_blank" href="' .
|
17 |
-
admin_url( 'admin.php?page=wc-settings&tab=checkout§ion=stripe_payment_request' ) . '">',
|
18 |
-
'</a>'
|
19 |
-
)
|
20 |
-
),
|
21 |
-
),
|
22 |
-
'enabled' => array(
|
23 |
-
'title' => __( 'Enabled', 'woo-stripe-payment' ),
|
24 |
-
'type' => 'checkbox',
|
25 |
-
'default' => 'no',
|
26 |
-
'value' => 'yes',
|
27 |
-
'desc_tip' => true,
|
28 |
-
'description' => __( 'If enabled, your site can accept Google Pay payments through Stripe.', 'woo-stripe-payment' ),
|
29 |
-
),
|
30 |
-
'general_settings' => array(
|
31 |
-
'type' => 'title',
|
32 |
-
'title' => __( 'General Settings', 'woo-stripe-payment' ),
|
33 |
-
),
|
34 |
-
'merchant_id' => array(
|
35 |
-
'type' => 'text',
|
36 |
-
'title' => __( 'Merchant ID', 'woo-stripe-payment' ),
|
37 |
-
'default' => '',
|
38 |
-
'description' => __( 'Your Google Merchant ID is given to you by the Google API team once you register for Google Pay. While testing in TEST mode you can leave this value blank and Google Pay will work.', 'woo-stripe-payment' ),
|
39 |
-
),
|
40 |
-
'title_text' => array(
|
41 |
-
'type' => 'text',
|
42 |
-
'title' => __( 'Title', 'woo-stripe-payment' ),
|
43 |
-
'default' => __( 'Google Pay', 'woo-stripe-payment' ),
|
44 |
-
'desc_tip' => true,
|
45 |
-
'description' => __( 'Title of the credit card gateway' ),
|
46 |
-
),
|
47 |
-
'description' => array(
|
48 |
-
'title' => __( 'Description', 'woo-stripe-payment' ),
|
49 |
-
'type' => 'text',
|
50 |
-
'default' => '',
|
51 |
-
'description' => __( 'Leave blank if you don\'t want a description to show for the gateway.', 'woo-stripe-payment' ),
|
52 |
-
'desc_tip' => true,
|
53 |
-
),
|
54 |
-
'method_format' => array(
|
55 |
-
'title' => __( 'Credit Card Display', 'woo-stripe-payment' ),
|
56 |
-
'type' => 'select',
|
57 |
-
'class' => 'wc-enhanced-select',
|
58 |
-
'options' => wp_list_pluck( $this->get_method_formats(), 'example' ),
|
59 |
-
'value' => '',
|
60 |
-
'default' => 'gpay_name',
|
61 |
-
'desc_tip' => true,
|
62 |
-
'description' => __( 'This option allows you to customize how the credit card will display for your customers on orders, subscriptions, etc.' ),
|
63 |
-
),
|
64 |
-
'charge_type' => array(
|
65 |
-
'type' => 'select',
|
66 |
-
'title' => __( 'Charge Type', 'woo-stripe-payment' ),
|
67 |
-
'default' => 'capture',
|
68 |
-
'class' => 'wc-enhanced-select',
|
69 |
-
'options' => array(
|
70 |
-
'capture' => __( 'Capture', 'woo-stripe-payment' ),
|
71 |
-
'authorize' => __( 'Authorize', 'woo-stripe-payment' ),
|
72 |
-
),
|
73 |
-
'desc_tip' => true,
|
74 |
-
'description' => __( 'This option determines whether the customer\'s funds are capture immediately or authorized and can be captured at a later date.', 'woo-stripe-payment' ),
|
75 |
-
),
|
76 |
-
'payment_sections' => array(
|
77 |
-
'type' => 'multiselect',
|
78 |
-
'title' => __( 'Payment Sections', 'woo-stripe-payment' ),
|
79 |
-
'class' => 'wc-enhanced-select',
|
80 |
-
'options' => array(
|
81 |
-
'product' => __( 'Product Page', 'woo-stripe-payment' ),
|
82 |
-
'cart' => __( 'Cart Page', 'woo-stripe-payment' ),
|
83 |
-
'mini_cart' => __( 'Mini Cart', 'woo-stripe-payment' ),
|
84 |
-
'checkout_banner' => __( 'Top of Checkout', 'woo-stripe-payment' ),
|
85 |
-
),
|
86 |
-
'default' => array( 'product', 'cart' ),
|
87 |
-
'description' => $this->get_payment_section_description(),
|
88 |
-
),
|
89 |
-
'order_status' => array(
|
90 |
-
'type' => 'select',
|
91 |
-
'title' => __( 'Order Status', 'woo-stripe-payment' ),
|
92 |
-
'default' => 'default',
|
93 |
-
'class' => 'wc-enhanced-select',
|
94 |
-
'options' => array_merge( array( 'default' => __( 'Default', 'woo-stripe-payment' ) ), wc_get_order_statuses() ),
|
95 |
-
'tool_tip' => true,
|
96 |
-
'description' => __( 'This is the status of the order once payment is complete. If <b>Default</b> is selected, then WooCommerce will set the order status automatically based on internal logic which states if a product is virtual and downloadable then status is set to complete. Products that require shipping are set to Processing. Default is the recommended setting as it allows standard WooCommerce code to process the order status.', 'woo-stripe-payment' ),
|
97 |
-
),
|
98 |
-
'merchant_name' => array(
|
99 |
-
'type' => 'text',
|
100 |
-
'title' => __( 'Merchant Name', 'woo-stripe-payment' ),
|
101 |
-
'default' => get_bloginfo( 'name' ),
|
102 |
-
'description' => __( 'The name of your business as it appears on the Google Pay payment sheet.', 'woo-stripe-payment' ),
|
103 |
-
'desc_tip' => true,
|
104 |
-
),
|
105 |
-
'icon' => array(
|
106 |
-
'title' => __( 'Icon', 'woo-stripe-payment' ),
|
107 |
-
'type' => 'select',
|
108 |
-
'options' => array(
|
109 |
-
'googlepay_outline' => __( 'With Outline', 'woo-stripe-payment' ),
|
110 |
-
'googlepay_standard' => __( 'Standard', 'woo-stripe-payment' ),
|
111 |
-
),
|
112 |
-
'default' => 'googlepay_outline',
|
113 |
-
'desc_tip' => true,
|
114 |
-
'description' => __( 'This is the icon style that appears next to the gateway on the checkout page. Google\'s API team typically requires the With Outline option on the checkout page for branding purposes.', 'woo-stripe-payment' ),
|
115 |
-
),
|
116 |
-
'button_section' => array(
|
117 |
-
'type' => 'title',
|
118 |
-
'title' => __( 'Button Options', 'woo-stripe-payment' ),
|
119 |
-
),
|
120 |
-
'button_color' => array(
|
121 |
-
'title' => __( 'Button Color', 'woo-stripe-payment' ),
|
122 |
-
'type' => 'select',
|
123 |
-
'class' => 'gpay-button-option button-color',
|
124 |
-
'options' => array(
|
125 |
-
'black' => __( 'Black', 'woo-stripe-payment' ),
|
126 |
-
'white' => __( 'White', 'woo-stripe-payment' ),
|
127 |
-
),
|
128 |
-
'default' => 'black',
|
129 |
-
'description' => __( 'The button color of the GPay button.', 'woo-stripe-payment' ),
|
130 |
-
),
|
131 |
-
'button_style' => array(
|
132 |
-
'title' => __( 'Button Style', 'woo-stripe-payment' ),
|
133 |
-
'type' => 'select',
|
134 |
-
'class' => 'gpay-button-option button-style',
|
135 |
-
'options' => array(
|
136 |
-
'long' => __( 'Long', 'woo-stripe-payment' ),
|
137 |
-
'short' => __( 'Short', 'woo-stripe-payment' ),
|
138 |
-
),
|
139 |
-
'default' => 'long',
|
140 |
-
'description' => __( 'The button style of the GPay button.', 'woo-stripe-payment' ),
|
141 |
-
),
|
142 |
-
'button_render' => array(
|
143 |
-
'type' => 'button_demo',
|
144 |
-
'title' => __( 'Button Design', 'woo-stripe-payment' ),
|
145 |
-
'id' => 'gpay-button',
|
146 |
-
'description' => __( 'If you can\'t see the Google Pay button, try switching to a Chrome browser.', 'woo-stripe-payment' ),
|
147 |
-
),
|
148 |
-
);
|
1 |
+
<?php
|
2 |
+
return array(
|
3 |
+
'desc1' => array(
|
4 |
+
'type' => 'description',
|
5 |
+
'description' => '<p><a target="_blank" href="https://pay.google.com/business/console">' . __( 'GPay Business Console', 'woo-stripe-payment' ) .
|
6 |
+
'</a></p>' .
|
7 |
+
'<p><a target="_blank" href="https://docs.paymentplugins.com/wc-stripe/config/#/stripe_googlepay?id=testing">Testing GPay</a></p>' .
|
8 |
+
__( 'When test mode is enabled, Google Pay will work without a merchant ID, allowing you to capture the necessary screenshots the Google API team needs to approve your integration request.', 'woo-stripe-payment' ),
|
9 |
+
),
|
10 |
+
'desc2' => array(
|
11 |
+
'type' => 'description',
|
12 |
+
'description' => sprintf(
|
13 |
+
'<p>%s</p>',
|
14 |
+
sprintf(
|
15 |
+
__( 'If you don\'t want to request a Google Merchant ID, you can use the %1$sPayment Request Gateway%2$s which has a Google Pay integration through Stripe via the Chrome browser.', 'woo-stripe-payment' ),
|
16 |
+
'<a target="_blank" href="' .
|
17 |
+
admin_url( 'admin.php?page=wc-settings&tab=checkout§ion=stripe_payment_request' ) . '">',
|
18 |
+
'</a>'
|
19 |
+
)
|
20 |
+
),
|
21 |
+
),
|
22 |
+
'enabled' => array(
|
23 |
+
'title' => __( 'Enabled', 'woo-stripe-payment' ),
|
24 |
+
'type' => 'checkbox',
|
25 |
+
'default' => 'no',
|
26 |
+
'value' => 'yes',
|
27 |
+
'desc_tip' => true,
|
28 |
+
'description' => __( 'If enabled, your site can accept Google Pay payments through Stripe.', 'woo-stripe-payment' ),
|
29 |
+
),
|
30 |
+
'general_settings' => array(
|
31 |
+
'type' => 'title',
|
32 |
+
'title' => __( 'General Settings', 'woo-stripe-payment' ),
|
33 |
+
),
|
34 |
+
'merchant_id' => array(
|
35 |
+
'type' => 'text',
|
36 |
+
'title' => __( 'Merchant ID', 'woo-stripe-payment' ),
|
37 |
+
'default' => '',
|
38 |
+
'description' => __( 'Your Google Merchant ID is given to you by the Google API team once you register for Google Pay. While testing in TEST mode you can leave this value blank and Google Pay will work.', 'woo-stripe-payment' ),
|
39 |
+
),
|
40 |
+
'title_text' => array(
|
41 |
+
'type' => 'text',
|
42 |
+
'title' => __( 'Title', 'woo-stripe-payment' ),
|
43 |
+
'default' => __( 'Google Pay', 'woo-stripe-payment' ),
|
44 |
+
'desc_tip' => true,
|
45 |
+
'description' => __( 'Title of the credit card gateway' ),
|
46 |
+
),
|
47 |
+
'description' => array(
|
48 |
+
'title' => __( 'Description', 'woo-stripe-payment' ),
|
49 |
+
'type' => 'text',
|
50 |
+
'default' => '',
|
51 |
+
'description' => __( 'Leave blank if you don\'t want a description to show for the gateway.', 'woo-stripe-payment' ),
|
52 |
+
'desc_tip' => true,
|
53 |
+
),
|
54 |
+
'method_format' => array(
|
55 |
+
'title' => __( 'Credit Card Display', 'woo-stripe-payment' ),
|
56 |
+
'type' => 'select',
|
57 |
+
'class' => 'wc-enhanced-select',
|
58 |
+
'options' => wp_list_pluck( $this->get_method_formats(), 'example' ),
|
59 |
+
'value' => '',
|
60 |
+
'default' => 'gpay_name',
|
61 |
+
'desc_tip' => true,
|
62 |
+
'description' => __( 'This option allows you to customize how the credit card will display for your customers on orders, subscriptions, etc.' ),
|
63 |
+
),
|
64 |
+
'charge_type' => array(
|
65 |
+
'type' => 'select',
|
66 |
+
'title' => __( 'Charge Type', 'woo-stripe-payment' ),
|
67 |
+
'default' => 'capture',
|
68 |
+
'class' => 'wc-enhanced-select',
|
69 |
+
'options' => array(
|
70 |
+
'capture' => __( 'Capture', 'woo-stripe-payment' ),
|
71 |
+
'authorize' => __( 'Authorize', 'woo-stripe-payment' ),
|
72 |
+
),
|
73 |
+
'desc_tip' => true,
|
74 |
+
'description' => __( 'This option determines whether the customer\'s funds are capture immediately or authorized and can be captured at a later date.', 'woo-stripe-payment' ),
|
75 |
+
),
|
76 |
+
'payment_sections' => array(
|
77 |
+
'type' => 'multiselect',
|
78 |
+
'title' => __( 'Payment Sections', 'woo-stripe-payment' ),
|
79 |
+
'class' => 'wc-enhanced-select',
|
80 |
+
'options' => array(
|
81 |
+
'product' => __( 'Product Page', 'woo-stripe-payment' ),
|
82 |
+
'cart' => __( 'Cart Page', 'woo-stripe-payment' ),
|
83 |
+
'mini_cart' => __( 'Mini Cart', 'woo-stripe-payment' ),
|
84 |
+
'checkout_banner' => __( 'Top of Checkout', 'woo-stripe-payment' ),
|
85 |
+
),
|
86 |
+
'default' => array( 'product', 'cart' ),
|
87 |
+
'description' => $this->get_payment_section_description(),
|
88 |
+
),
|
89 |
+
'order_status' => array(
|
90 |
+
'type' => 'select',
|
91 |
+
'title' => __( 'Order Status', 'woo-stripe-payment' ),
|
92 |
+
'default' => 'default',
|
93 |
+
'class' => 'wc-enhanced-select',
|
94 |
+
'options' => array_merge( array( 'default' => __( 'Default', 'woo-stripe-payment' ) ), wc_get_order_statuses() ),
|
95 |
+
'tool_tip' => true,
|
96 |
+
'description' => __( 'This is the status of the order once payment is complete. If <b>Default</b> is selected, then WooCommerce will set the order status automatically based on internal logic which states if a product is virtual and downloadable then status is set to complete. Products that require shipping are set to Processing. Default is the recommended setting as it allows standard WooCommerce code to process the order status.', 'woo-stripe-payment' ),
|
97 |
+
),
|
98 |
+
'merchant_name' => array(
|
99 |
+
'type' => 'text',
|
100 |
+
'title' => __( 'Merchant Name', 'woo-stripe-payment' ),
|
101 |
+
'default' => get_bloginfo( 'name' ),
|
102 |
+
'description' => __( 'The name of your business as it appears on the Google Pay payment sheet.', 'woo-stripe-payment' ),
|
103 |
+
'desc_tip' => true,
|
104 |
+
),
|
105 |
+
'icon' => array(
|
106 |
+
'title' => __( 'Icon', 'woo-stripe-payment' ),
|
107 |
+
'type' => 'select',
|
108 |
+
'options' => array(
|
109 |
+
'googlepay_outline' => __( 'With Outline', 'woo-stripe-payment' ),
|
110 |
+
'googlepay_standard' => __( 'Standard', 'woo-stripe-payment' ),
|
111 |
+
),
|
112 |
+
'default' => 'googlepay_outline',
|
113 |
+
'desc_tip' => true,
|
114 |
+
'description' => __( 'This is the icon style that appears next to the gateway on the checkout page. Google\'s API team typically requires the With Outline option on the checkout page for branding purposes.', 'woo-stripe-payment' ),
|
115 |
+
),
|
116 |
+
'button_section' => array(
|
117 |
+
'type' => 'title',
|
118 |
+
'title' => __( 'Button Options', 'woo-stripe-payment' ),
|
119 |
+
),
|
120 |
+
'button_color' => array(
|
121 |
+
'title' => __( 'Button Color', 'woo-stripe-payment' ),
|
122 |
+
'type' => 'select',
|
123 |
+
'class' => 'gpay-button-option button-color',
|
124 |
+
'options' => array(
|
125 |
+
'black' => __( 'Black', 'woo-stripe-payment' ),
|
126 |
+
'white' => __( 'White', 'woo-stripe-payment' ),
|
127 |
+
),
|
128 |
+
'default' => 'black',
|
129 |
+
'description' => __( 'The button color of the GPay button.', 'woo-stripe-payment' ),
|
130 |
+
),
|
131 |
+
'button_style' => array(
|
132 |
+
'title' => __( 'Button Style', 'woo-stripe-payment' ),
|
133 |
+
'type' => 'select',
|
134 |
+
'class' => 'gpay-button-option button-style',
|
135 |
+
'options' => array(
|
136 |
+
'long' => __( 'Long', 'woo-stripe-payment' ),
|
137 |
+
'short' => __( 'Short', 'woo-stripe-payment' ),
|
138 |
+
),
|
139 |
+
'default' => 'long',
|
140 |
+
'description' => __( 'The button style of the GPay button.', 'woo-stripe-payment' ),
|
141 |
+
),
|
142 |
+
'button_render' => array(
|
143 |
+
'type' => 'button_demo',
|
144 |
+
'title' => __( 'Button Design', 'woo-stripe-payment' ),
|
145 |
+
'id' => 'gpay-button',
|
146 |
+
'description' => __( 'If you can\'t see the Google Pay button, try switching to a Chrome browser.', 'woo-stripe-payment' ),
|
147 |
+
),
|
148 |
+
);
|
includes/tokens/class-wc-payment-token-stripe-googlepay.php
CHANGED
@@ -1,31 +1,27 @@
|
|
1 |
-
<?php
|
2 |
-
defined( 'ABSPATH' ) || exit();
|
3 |
-
|
4 |
-
if ( ! class_exists( 'WC_Payment_Token_Stripe_CC' ) ) {
|
5 |
-
return;
|
6 |
-
}
|
7 |
-
|
8 |
-
/**
|
9 |
-
*
|
10 |
-
* @author PaymentPlugins
|
11 |
-
* @package Stripe/Tokens
|
12 |
-
*
|
13 |
-
*/
|
14 |
-
class WC_Payment_Token_Stripe_GooglePay extends WC_Payment_Token_Stripe_CC {
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
)
|
29 |
-
) + parent::get_formats();
|
30 |
-
}
|
31 |
-
}
|
1 |
+
<?php
|
2 |
+
defined( 'ABSPATH' ) || exit();
|
3 |
+
|
4 |
+
if ( ! class_exists( 'WC_Payment_Token_Stripe_CC' ) ) {
|
5 |
+
return;
|
6 |
+
}
|
7 |
+
|
8 |
+
/**
|
9 |
+
*
|
10 |
+
* @author PaymentPlugins
|
11 |
+
* @package Stripe/Tokens
|
12 |
+
*
|
13 |
+
*/
|
14 |
+
class WC_Payment_Token_Stripe_GooglePay extends WC_Payment_Token_Stripe_CC {
|
15 |
+
|
16 |
+
protected $type = 'Stripe_GooglePay';
|
17 |
+
|
18 |
+
public function get_formats() {
|
19 |
+
return array(
|
20 |
+
'gpay_name' => array(
|
21 |
+
'label' => __( 'Gateway Name', 'woo-stripe-payment' ),
|
22 |
+
'example' => 'Visa 1111 (Google Pay)',
|
23 |
+
'format' => '{brand} {last4} (Google Pay)'
|
24 |
+
)
|
25 |
+
) + parent::get_formats();
|
26 |
+
}
|
27 |
+
}
|
|
|
|
|
|
|
|
includes/traits/wc-stripe-payment-traits.php
CHANGED
@@ -1,122 +1,123 @@
|
|
1 |
-
<?php
|
2 |
-
defined( 'ABSPATH' ) || exit();
|
3 |
-
|
4 |
-
/**
|
5 |
-
*
|
6 |
-
* @author Payment Plugins
|
7 |
-
* @since 3.1.0
|
8 |
-
* @package Stripe/Trait
|
9 |
-
*/
|
10 |
-
trait WC_Stripe_Payment_Intent_Trait {
|
11 |
-
|
12 |
-
public function get_payment_object() {
|
13 |
-
return WC_Stripe_Payment_Factory::load( 'payment_intent', $this, WC_Stripe_Gateway::load() );
|
14 |
-
}
|
15 |
-
|
16 |
-
public function get_payment_method_type() {
|
17 |
-
return $this->payment_method_type;
|
18 |
-
}
|
19 |
-
|
20 |
-
/**
|
21 |
-
*
|
22 |
-
* @param WC_Order $order
|
23 |
-
*/
|
24 |
-
public function get_confirmation_method( $order ) {
|
25 |
-
return 'manual';
|
26 |
-
}
|
27 |
-
|
28 |
-
/**
|
29 |
-
*
|
30 |
-
* @param \Stripe\PaymentIntent $secret
|
31 |
-
* @param WC_Order $order
|
32 |
-
*/
|
33 |
-
public function get_payment_intent_checkout_url( $intent, $order ) {
|
34 |
-
// rand is used to generate some random entropy so that window hash events are triggered.
|
35 |
-
return sprintf(
|
36 |
-
'#response=%s',
|
37 |
-
base64_encode(
|
38 |
-
wp_json_encode(
|
39 |
-
array(
|
40 |
-
'client_secret' => $intent->client_secret,
|
41 |
-
'order_id' => $order->get_id(),
|
42 |
-
'
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
}
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
*
|
56 |
-
* @
|
57 |
-
* @
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
}
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
*
|
69 |
-
* @
|
70 |
-
* @
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
}
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
*
|
82 |
-
* @
|
83 |
-
* @
|
84 |
-
*
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
*
|
93 |
-
* @param
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
'
|
104 |
-
'
|
105 |
-
'
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
*
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
}
|
|
1 |
+
<?php
|
2 |
+
defined( 'ABSPATH' ) || exit();
|
3 |
+
|
4 |
+
/**
|
5 |
+
*
|
6 |
+
* @author Payment Plugins
|
7 |
+
* @since 3.1.0
|
8 |
+
* @package Stripe/Trait
|
9 |
+
*/
|
10 |
+
trait WC_Stripe_Payment_Intent_Trait {
|
11 |
+
|
12 |
+
public function get_payment_object() {
|
13 |
+
return WC_Stripe_Payment_Factory::load( 'payment_intent', $this, WC_Stripe_Gateway::load() );
|
14 |
+
}
|
15 |
+
|
16 |
+
public function get_payment_method_type() {
|
17 |
+
return $this->payment_method_type;
|
18 |
+
}
|
19 |
+
|
20 |
+
/**
|
21 |
+
*
|
22 |
+
* @param WC_Order $order
|
23 |
+
*/
|
24 |
+
public function get_confirmation_method( $order ) {
|
25 |
+
return 'manual';
|
26 |
+
}
|
27 |
+
|
28 |
+
/**
|
29 |
+
*
|
30 |
+
* @param \Stripe\PaymentIntent $secret
|
31 |
+
* @param WC_Order $order
|
32 |
+
*/
|
33 |
+
public function get_payment_intent_checkout_url( $intent, $order ) {
|
34 |
+
// rand is used to generate some random entropy so that window hash events are triggered.
|
35 |
+
return sprintf(
|
36 |
+
'#response=%s',
|
37 |
+
base64_encode(
|
38 |
+
wp_json_encode(
|
39 |
+
array(
|
40 |
+
'client_secret' => $intent->client_secret,
|
41 |
+
'order_id' => $order->get_id(),
|
42 |
+
'gateway_id' => $this->id,
|
43 |
+
'time' => rand(
|
44 |
+
0,
|
45 |
+
999999
|
46 |
+
),
|
47 |
+
)
|
48 |
+
)
|
49 |
+
)
|
50 |
+
);
|
51 |
+
}
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
*
|
56 |
+
* @author Payment Plugins
|
57 |
+
* @since 3.1.0
|
58 |
+
* @package Stripe/Trait
|
59 |
+
*/
|
60 |
+
trait WC_Stripe_Payment_Charge_Trait {
|
61 |
+
|
62 |
+
public function get_payment_object() {
|
63 |
+
return WC_Stripe_Payment_Factory::load( 'charge', $this, WC_Stripe_Gateway::load() );
|
64 |
+
}
|
65 |
+
}
|
66 |
+
|
67 |
+
/**
|
68 |
+
*
|
69 |
+
* @author Payment Plugins
|
70 |
+
* @since 3.1.0
|
71 |
+
* @package Stripe/Trait
|
72 |
+
*/
|
73 |
+
trait WC_Stripe_Local_Payment_Charge_Trait {
|
74 |
+
|
75 |
+
public function get_payment_object() {
|
76 |
+
return WC_Stripe_Payment_Factory::load( 'local_charge', $this, WC_Stripe_Gateway::load() );
|
77 |
+
}
|
78 |
+
}
|
79 |
+
|
80 |
+
/**
|
81 |
+
*
|
82 |
+
* @author Payment Plugins
|
83 |
+
* @since 3.1.0
|
84 |
+
* @package Stripe/Trait
|
85 |
+
*
|
86 |
+
*/
|
87 |
+
trait WC_Stripe_Local_Payment_Intent_Trait {
|
88 |
+
|
89 |
+
use WC_Stripe_Payment_Intent_Trait;
|
90 |
+
|
91 |
+
/**
|
92 |
+
*
|
93 |
+
* @param \Stripe\PaymentIntent $secret
|
94 |
+
* @param WC_Order $order
|
95 |
+
*/
|
96 |
+
public function get_payment_intent_checkout_url( $intent, $order ) {
|
97 |
+
// rand is used to generate some random entropy so that window hash events are triggered.
|
98 |
+
return sprintf(
|
99 |
+
'#response=%s',
|
100 |
+
base64_encode(
|
101 |
+
wp_json_encode(
|
102 |
+
array(
|
103 |
+
'client_secret' => $intent->client_secret,
|
104 |
+
'gateway_id' => $this->id,
|
105 |
+
'return_url' => $this->get_local_payment_return_url( $order ),
|
106 |
+
'time' => rand(
|
107 |
+
0,
|
108 |
+
999999
|
109 |
+
),
|
110 |
+
)
|
111 |
+
)
|
112 |
+
)
|
113 |
+
);
|
114 |
+
}
|
115 |
+
|
116 |
+
/**
|
117 |
+
*
|
118 |
+
* @param WC_Order $order
|
119 |
+
*/
|
120 |
+
public function get_confirmation_method( $order ) {
|
121 |
+
return 'automatic';
|
122 |
+
}
|
123 |
+
}
|
includes/traits/wc-stripe-settings-trait.php
CHANGED
@@ -86,6 +86,9 @@ trait WC_Stripe_Settings_Trait {
|
|
86 |
'description' => '',
|
87 |
)
|
88 |
);
|
|
|
|
|
|
|
89 |
ob_start();
|
90 |
include stripe_wc()->plugin_path() . 'includes/admin/views/html-description.php';
|
91 |
|
@@ -153,6 +156,27 @@ trait WC_Stripe_Settings_Trait {
|
|
153 |
return ob_get_clean();
|
154 |
}
|
155 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
156 |
/**
|
157 |
* Added override to provide more control on which fields are saved and which are skipped.
|
158 |
* This plugin
|
@@ -186,4 +210,8 @@ trait WC_Stripe_Settings_Trait {
|
|
186 |
public function get_stripe_documentation_url() {
|
187 |
return sprintf( 'https://docs.paymentplugins.com/wc-stripe/config/#/%s', $this->id );
|
188 |
}
|
|
|
|
|
|
|
|
|
189 |
}
|
86 |
'description' => '',
|
87 |
)
|
88 |
);
|
89 |
+
if ( is_callable( $data['description'] ) ) {
|
90 |
+
$data['description'] = call_user_func( $data['description'] );
|
91 |
+
}
|
92 |
ob_start();
|
93 |
include stripe_wc()->plugin_path() . 'includes/admin/views/html-description.php';
|
94 |
|
156 |
return ob_get_clean();
|
157 |
}
|
158 |
|
159 |
+
public function generate_multi_select_countries_html( $key, $data ) {
|
160 |
+
$field_key = $this->get_field_key( $key );
|
161 |
+
$value = (array) $this->get_option( $key );
|
162 |
+
$data = wp_parse_args(
|
163 |
+
$data,
|
164 |
+
array(
|
165 |
+
'title' => '',
|
166 |
+
'class' => '',
|
167 |
+
'style' => '',
|
168 |
+
'description' => '',
|
169 |
+
'desc_tip' => false,
|
170 |
+
'id' => $field_key,
|
171 |
+
'options' => ! empty( $this->limited_countries ) ? $this->limited_countries : array()
|
172 |
+
)
|
173 |
+
);
|
174 |
+
ob_start();
|
175 |
+
include stripe_wc()->plugin_path() . 'includes/admin/views/html-multi-select-countries.php';
|
176 |
+
|
177 |
+
return ob_get_clean();
|
178 |
+
}
|
179 |
+
|
180 |
/**
|
181 |
* Added override to provide more control on which fields are saved and which are skipped.
|
182 |
* This plugin
|
210 |
public function get_stripe_documentation_url() {
|
211 |
return sprintf( 'https://docs.paymentplugins.com/wc-stripe/config/#/%s', $this->id );
|
212 |
}
|
213 |
+
|
214 |
+
public function validate_multi_select_countries_field( $key, $value ) {
|
215 |
+
return is_array( $value ) ? array_map( 'wc_clean', array_map( 'stripslashes', $value ) ) : '';
|
216 |
+
}
|
217 |
}
|
includes/wc-stripe-functions.php
CHANGED
@@ -797,6 +797,24 @@ function wc_stripe_add_number_precision( $value, $currency = '', $round = true )
|
|
797 |
return $value;
|
798 |
}
|
799 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
800 |
/**
|
801 |
* Return an array of credit card forms.
|
802 |
*
|
797 |
return $value;
|
798 |
}
|
799 |
|
800 |
+
/**
|
801 |
+
* Remove precision from a number.
|
802 |
+
*
|
803 |
+
* @param $value
|
804 |
+
* @param string $currency
|
805 |
+
* @param bool $round
|
806 |
+
*
|
807 |
+
* @since 3.2.10
|
808 |
+
*/
|
809 |
+
function wc_stripe_remove_number_precision( $value, $currency = '', $round = true ) {
|
810 |
+
$currency = empty( $currency ) ? get_woocommerce_currency() : $currency;
|
811 |
+
$currencies = wc_stripe_get_currencies();
|
812 |
+
$exp = isset( $currencies[ $currency ] ) ? $currencies[ $currency ] : 2;
|
813 |
+
$number = $value / pow( 10, $exp );
|
814 |
+
|
815 |
+
return $round ? round( $number, wc_get_price_decimals() ) : $number;
|
816 |
+
}
|
817 |
+
|
818 |
/**
|
819 |
* Return an array of credit card forms.
|
820 |
*
|
includes/wc-stripe-hooks.php
CHANGED
@@ -1,29 +1,30 @@
|
|
1 |
-
<?php
|
2 |
-
defined( 'ABSPATH' ) || exit();
|
3 |
-
|
4 |
-
/**
|
5 |
-
* Actions
|
6 |
-
*/
|
7 |
-
add_action( 'woocommerce_payment_token_deleted', 'wc_stripe_woocommerce_payment_token_deleted', 10, 2 );
|
8 |
-
add_action( 'woocommerce_order_status_cancelled', 'wc_stripe_order_cancelled', 10, 2 );
|
9 |
-
add_action( 'woocommerce_order_status_completed', 'wc_stripe_order_status_completed', 10, 2 );
|
10 |
-
add_action( 'wc_stripe_remove_order_locks', 'wc_stripe_remove_order_locks' );
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
add_action( '
|
16 |
-
add_action( '
|
17 |
-
add_action( '
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
add_filter( '
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
add_filter( '
|
29 |
-
add_filter( '
|
|
1 |
+
<?php
|
2 |
+
defined( 'ABSPATH' ) || exit();
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Actions
|
6 |
+
*/
|
7 |
+
add_action( 'woocommerce_payment_token_deleted', 'wc_stripe_woocommerce_payment_token_deleted', 10, 2 );
|
8 |
+
add_action( 'woocommerce_order_status_cancelled', 'wc_stripe_order_cancelled', 10, 2 );
|
9 |
+
add_action( 'woocommerce_order_status_completed', 'wc_stripe_order_status_completed', 10, 2 );
|
10 |
+
add_action( 'wc_stripe_remove_order_locks', 'wc_stripe_remove_order_locks' );
|
11 |
+
|
12 |
+
/**
|
13 |
+
* * Webhook Actions ***
|
14 |
+
*/
|
15 |
+
add_action( 'wc_stripe_webhook_source_chargeable', 'wc_stripe_process_source_chargeable', 10, 2 );
|
16 |
+
add_action( 'wc_stripe_webhook_charge_succeeded', 'wc_stripe_process_charge_succeeded', 10, 2 );
|
17 |
+
add_action( 'wc_stripe_webhook_charge_failed', 'wc_stripe_process_charge_failed', 10, 2 );
|
18 |
+
add_action( 'wc_stripe_webhook_payment_intent_succeeded', 'wc_stripe_process_payment_intent_succeeded', 10, 2 );
|
19 |
+
add_action( 'wc_stripe_webhook_charge_refunded', 'wc_stripe_process_create_refund' );
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Filters
|
23 |
+
*/
|
24 |
+
add_filter( 'wc_stripe_api_options', 'wc_stripe_api_options' );
|
25 |
+
add_filter( 'woocommerce_payment_gateways', 'wc_stripe_payment_gateways' );
|
26 |
+
add_filter( 'woocommerce_available_payment_gateways', 'wc_stripe_available_payment_gateways' );
|
27 |
+
add_action( 'woocommerce_process_shop_subscription_meta', 'wc_stripe_process_shop_subscription_meta', 10, 2 );
|
28 |
+
add_filter( 'woocommerce_payment_complete_order_status', 'wc_stripe_payment_complete_order_status', 10, 3 );
|
29 |
+
add_filter( 'woocommerce_get_customer_payment_tokens', 'wc_stripe_get_customer_payment_tokens', 10, 3 );
|
30 |
+
add_filter( 'woocommerce_credit_card_type_labels', 'wc_stripe_credit_card_labels' );
|
includes/wc-stripe-webhook-functions.php
CHANGED
@@ -1,164 +1,218 @@
|
|
1 |
-
<?php
|
2 |
-
defined( 'ABSPATH' ) || exit();
|
3 |
-
|
4 |
-
/**
|
5 |
-
* Processes the charge via webhooks for local payment methods like P24, EPS, etc.
|
6 |
-
*
|
7 |
-
* @param \Stripe\Source $source
|
8 |
-
* @param WP_REST_Request $request
|
9 |
-
*
|
10 |
-
* @since 3.0.0
|
11 |
-
* @package Stripe/Functions
|
12 |
-
*/
|
13 |
-
function wc_stripe_process_source_chargeable( $source, $request ) {
|
14 |
-
/*
|
15 |
-
* There is no order ID in the metadata which means this source was created
|
16 |
-
* client side using stripe.createsource()
|
17 |
-
* It will be processed via the checkout page.
|
18 |
-
*/
|
19 |
-
if ( $source->flow === 'none' && ! $source->metadata['order_id'] ) {
|
20 |
-
return;
|
21 |
-
}
|
22 |
-
$order = wc_get_order( wc_stripe_filter_order_id( $source->metadata['order_id'], $source ) );
|
23 |
-
if ( ! $order ) {
|
24 |
-
wc_stripe_log_error( sprintf( 'Could not create a charge for source %s. No order ID was found in your WordPress database.', $source->id ) );
|
25 |
-
|
26 |
-
return;
|
27 |
-
}
|
28 |
-
|
29 |
-
/**
|
30 |
-
*
|
31 |
-
* @var WC_Payment_Gateway_Stripe $payment_method
|
32 |
-
*/
|
33 |
-
$payment_method = WC()->payment_gateways()->payment_gateways()[ $order->get_payment_method() ];
|
34 |
-
|
35 |
-
// if the order has a transaction ID, then a charge has already been created.
|
36 |
-
if ( $payment_method->has_order_lock( $order ) || ( $transaction_id = $order->get_transaction_id() ) ) {
|
37 |
-
wc_stripe_log_info( sprintf( 'source.chargeable event received. Charge has already been created for order %s. Event exited.', $order->get_id() ) );
|
38 |
-
|
39 |
-
return;
|
40 |
-
}
|
41 |
-
$payment_method->set_order_lock( $order );
|
42 |
-
$payment_method->set_new_source_token( $source->id );
|
43 |
-
$result = $payment_method->payment_object->process_payment( $order );
|
44 |
-
|
45 |
-
if ( ! is_wp_error( $result ) && $result->complete_payment ) {
|
46 |
-
$payment_method->payment_object->payment_complete( $order, $result->charge );
|
47 |
-
}
|
48 |
-
}
|
49 |
-
|
50 |
-
/**
|
51 |
-
* When the charge has succeeded, the order should be completed.
|
52 |
-
*
|
53 |
-
* @param \Stripe\Charge $charge
|
54 |
-
* @param WP_REST_Request $request
|
55 |
-
*
|
56 |
-
* @since 3.0.5
|
57 |
-
* @package Stripe/Functions
|
58 |
-
*/
|
59 |
-
function wc_stripe_process_charge_succeeded( $charge, $request ) {
|
60 |
-
// charges that belong to a payment intent can be skipped
|
61 |
-
// because the payment_intent.succeeded event will be called.
|
62 |
-
if ( $charge->payment_intent ) {
|
63 |
-
return;
|
64 |
-
}
|
65 |
-
$order = wc_get_order( wc_stripe_filter_order_id( $charge->metadata['order_id'], $charge ) );
|
66 |
-
if ( ! $order ) {
|
67 |
-
wc_stripe_log_error( sprintf( 'Could not complete payment for charge %s. No order ID %s was found in your WordPress database.', $charge->id, $charge->metadata['order_id'] ) );
|
68 |
-
|
69 |
-
return;
|
70 |
-
}
|
71 |
-
|
72 |
-
/**
|
73 |
-
*
|
74 |
-
* @var WC_Payment_Gateway_Stripe $payment_method
|
75 |
-
*/
|
76 |
-
$payment_method = WC()->payment_gateways()->payment_gateways()[ $order->get_payment_method() ];
|
77 |
-
/**
|
78 |
-
* Only process for local payment methods. We make sure the payment method is asynchronous
|
79 |
-
* because synchronous payments are handled via the source.chargeable event which processes the payment.
|
80 |
-
* This event is relevant for payment methods that receive a charge.succeeded event at some arbitrary amount of time
|
81 |
-
* after the source is chargeable.
|
82 |
-
*/
|
83 |
-
if ( $payment_method instanceof WC_Payment_Gateway_Stripe_Local_Payment && ! $payment_method->synchronous ) {
|
84 |
-
|
85 |
-
// If the order's charge status is not equal to charge status from Stripe, then complete_payment.
|
86 |
-
if ( $order->get_meta( WC_Stripe_Constants::CHARGE_STATUS ) != $charge->status ) {
|
87 |
-
// want to prevent plugin from processing capture_charge since charge has already been captured.
|
88 |
-
remove_action( 'woocommerce_order_status_completed', 'wc_stripe_order_status_completed' );
|
89 |
-
|
90 |
-
// call payment complete so shipping, emails, etc are triggered.
|
91 |
-
$payment_method->payment_object->payment_complete( $order, $charge );
|
92 |
-
$order->add_order_note( __( 'Charge.succeeded webhook received. Payment has been completed.', 'woo-stripe-payment' ) );
|
93 |
-
}
|
94 |
-
}
|
95 |
-
}
|
96 |
-
|
97 |
-
/**
|
98 |
-
*
|
99 |
-
* @param \Stripe\PaymentIntent $intent
|
100 |
-
* @param WP_REST_Request $request
|
101 |
-
*
|
102 |
-
* @since 3.1.0
|
103 |
-
* @package Stripe/Functions
|
104 |
-
*/
|
105 |
-
function wc_stripe_process_payment_intent_succeeded( $intent, $request ) {
|
106 |
-
$order = wc_get_order( wc_stripe_filter_order_id( $intent->metadata['order_id'], $intent ) );
|
107 |
-
if ( ! $order ) {
|
108 |
-
wc_stripe_log_error( sprintf( 'Could not complete payment for payment_intent %s. No order ID was found in your WordPress database.', $intent->id ) );
|
109 |
-
|
110 |
-
return;
|
111 |
-
}
|
112 |
-
$payment_method = WC()->payment_gateways()->payment_gateways()[ $order->get_payment_method() ];
|
113 |
-
|
114 |
-
if ( $payment_method instanceof WC_Payment_Gateway_Stripe_Local_Payment ) {
|
115 |
-
/**
|
116 |
-
* Delay the event by one second to allow the redirect handler to process
|
117 |
-
* the payment.
|
118 |
-
*/
|
119 |
-
sleep( 1 );
|
120 |
-
|
121 |
-
if ( $payment_method->has_order_lock( $order ) || ( $transaction_id = $order->get_transaction_id() ) ) {
|
122 |
-
wc_stripe_log_info( sprintf( 'payment_intent.succeeded event received. Intent has been completed for order %s. Event exited.', $order->get_id() ) );
|
123 |
-
|
124 |
-
return;
|
125 |
-
}
|
126 |
-
|
127 |
-
$payment_method->set_order_lock( $order );
|
128 |
-
$result = $payment_method->payment_object->process_payment( $order );
|
129 |
-
|
130 |
-
if ( ! is_wp_error( $result ) && $result->complete_payment ) {
|
131 |
-
$payment_method->payment_object->payment_complete( $order, $result->charge );
|
132 |
-
$order->add_order_note( __( 'payment_intent.succeeded webhook received. Payment has been completed.', 'woo-stripe-payment' ) );
|
133 |
-
}
|
134 |
-
}
|
135 |
-
}
|
136 |
-
|
137 |
-
/**
|
138 |
-
*
|
139 |
-
* @param \Stripe\Charge $charge
|
140 |
-
* @param WP_REST_Request $request
|
141 |
-
*
|
142 |
-
* @since 3.1.1
|
143 |
-
* @package Stripe/Functions
|
144 |
-
*/
|
145 |
-
function wc_stripe_process_charge_failed( $charge, $request ) {
|
146 |
-
$order = wc_get_order( wc_stripe_filter_order_id( $charge->metadata['order_id'], $charge ) );
|
147 |
-
|
148 |
-
if ( $order ) {
|
149 |
-
$payment_methods = WC()->payment_gateways()->payment_gateways();
|
150 |
-
if ( isset( $payment_methods[ $order->get_payment_method() ] ) ) {
|
151 |
-
/**
|
152 |
-
*
|
153 |
-
* @var WC_Payment_Gateway_Stripe $payment_method
|
154 |
-
*/
|
155 |
-
$payment_method = $payment_methods[ $order->get_payment_method() ];
|
156 |
-
// only update order status if this is an asynchronous payment method,
|
157 |
-
// and there is no completed date on the order. If there is a complete date it
|
158 |
-
// means payment_complete was called on the order at some point
|
159 |
-
if ( ! $payment_method->synchronous && ! $order->get_date_completed() ) {
|
160 |
-
$order->update_status( 'failed', $charge->failure_message );
|
161 |
-
}
|
162 |
-
}
|
163 |
-
}
|
164 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
defined( 'ABSPATH' ) || exit();
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Processes the charge via webhooks for local payment methods like P24, EPS, etc.
|
6 |
+
*
|
7 |
+
* @param \Stripe\Source $source
|
8 |
+
* @param WP_REST_Request $request
|
9 |
+
*
|
10 |
+
* @since 3.0.0
|
11 |
+
* @package Stripe/Functions
|
12 |
+
*/
|
13 |
+
function wc_stripe_process_source_chargeable( $source, $request ) {
|
14 |
+
/*
|
15 |
+
* There is no order ID in the metadata which means this source was created
|
16 |
+
* client side using stripe.createsource()
|
17 |
+
* It will be processed via the checkout page.
|
18 |
+
*/
|
19 |
+
if ( $source->flow === 'none' && ! $source->metadata['order_id'] ) {
|
20 |
+
return;
|
21 |
+
}
|
22 |
+
$order = wc_get_order( wc_stripe_filter_order_id( $source->metadata['order_id'], $source ) );
|
23 |
+
if ( ! $order ) {
|
24 |
+
wc_stripe_log_error( sprintf( 'Could not create a charge for source %s. No order ID was found in your WordPress database.', $source->id ) );
|
25 |
+
|
26 |
+
return;
|
27 |
+
}
|
28 |
+
|
29 |
+
/**
|
30 |
+
*
|
31 |
+
* @var WC_Payment_Gateway_Stripe $payment_method
|
32 |
+
*/
|
33 |
+
$payment_method = WC()->payment_gateways()->payment_gateways()[ $order->get_payment_method() ];
|
34 |
+
|
35 |
+
// if the order has a transaction ID, then a charge has already been created.
|
36 |
+
if ( $payment_method->has_order_lock( $order ) || ( $transaction_id = $order->get_transaction_id() ) ) {
|
37 |
+
wc_stripe_log_info( sprintf( 'source.chargeable event received. Charge has already been created for order %s. Event exited.', $order->get_id() ) );
|
38 |
+
|
39 |
+
return;
|
40 |
+
}
|
41 |
+
$payment_method->set_order_lock( $order );
|
42 |
+
$payment_method->set_new_source_token( $source->id );
|
43 |
+
$result = $payment_method->payment_object->process_payment( $order );
|
44 |
+
|
45 |
+
if ( ! is_wp_error( $result ) && $result->complete_payment ) {
|
46 |
+
$payment_method->payment_object->payment_complete( $order, $result->charge );
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* When the charge has succeeded, the order should be completed.
|
52 |
+
*
|
53 |
+
* @param \Stripe\Charge $charge
|
54 |
+
* @param WP_REST_Request $request
|
55 |
+
*
|
56 |
+
* @since 3.0.5
|
57 |
+
* @package Stripe/Functions
|
58 |
+
*/
|
59 |
+
function wc_stripe_process_charge_succeeded( $charge, $request ) {
|
60 |
+
// charges that belong to a payment intent can be skipped
|
61 |
+
// because the payment_intent.succeeded event will be called.
|
62 |
+
if ( $charge->payment_intent ) {
|
63 |
+
return;
|
64 |
+
}
|
65 |
+
$order = wc_get_order( wc_stripe_filter_order_id( $charge->metadata['order_id'], $charge ) );
|
66 |
+
if ( ! $order ) {
|
67 |
+
wc_stripe_log_error( sprintf( 'Could not complete payment for charge %s. No order ID %s was found in your WordPress database.', $charge->id, $charge->metadata['order_id'] ) );
|
68 |
+
|
69 |
+
return;
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
*
|
74 |
+
* @var WC_Payment_Gateway_Stripe $payment_method
|
75 |
+
*/
|
76 |
+
$payment_method = WC()->payment_gateways()->payment_gateways()[ $order->get_payment_method() ];
|
77 |
+
/**
|
78 |
+
* Only process for local payment methods. We make sure the payment method is asynchronous
|
79 |
+
* because synchronous payments are handled via the source.chargeable event which processes the payment.
|
80 |
+
* This event is relevant for payment methods that receive a charge.succeeded event at some arbitrary amount of time
|
81 |
+
* after the source is chargeable.
|
82 |
+
*/
|
83 |
+
if ( $payment_method instanceof WC_Payment_Gateway_Stripe_Local_Payment && ! $payment_method->synchronous ) {
|
84 |
+
|
85 |
+
// If the order's charge status is not equal to charge status from Stripe, then complete_payment.
|
86 |
+
if ( $order->get_meta( WC_Stripe_Constants::CHARGE_STATUS ) != $charge->status ) {
|
87 |
+
// want to prevent plugin from processing capture_charge since charge has already been captured.
|
88 |
+
remove_action( 'woocommerce_order_status_completed', 'wc_stripe_order_status_completed' );
|
89 |
+
|
90 |
+
// call payment complete so shipping, emails, etc are triggered.
|
91 |
+
$payment_method->payment_object->payment_complete( $order, $charge );
|
92 |
+
$order->add_order_note( __( 'Charge.succeeded webhook received. Payment has been completed.', 'woo-stripe-payment' ) );
|
93 |
+
}
|
94 |
+
}
|
95 |
+
}
|
96 |
+
|
97 |
+
/**
|
98 |
+
*
|
99 |
+
* @param \Stripe\PaymentIntent $intent
|
100 |
+
* @param WP_REST_Request $request
|
101 |
+
*
|
102 |
+
* @since 3.1.0
|
103 |
+
* @package Stripe/Functions
|
104 |
+
*/
|
105 |
+
function wc_stripe_process_payment_intent_succeeded( $intent, $request ) {
|
106 |
+
$order = wc_get_order( wc_stripe_filter_order_id( $intent->metadata['order_id'], $intent ) );
|
107 |
+
if ( ! $order ) {
|
108 |
+
wc_stripe_log_error( sprintf( 'Could not complete payment for payment_intent %s. No order ID was found in your WordPress database.', $intent->id ) );
|
109 |
+
|
110 |
+
return;
|
111 |
+
}
|
112 |
+
$payment_method = WC()->payment_gateways()->payment_gateways()[ $order->get_payment_method() ];
|
113 |
+
|
114 |
+
if ( $payment_method instanceof WC_Payment_Gateway_Stripe_Local_Payment ) {
|
115 |
+
/**
|
116 |
+
* Delay the event by one second to allow the redirect handler to process
|
117 |
+
* the payment.
|
118 |
+
*/
|
119 |
+
sleep( 1 );
|
120 |
+
|
121 |
+
if ( $payment_method->has_order_lock( $order ) || ( $transaction_id = $order->get_transaction_id() ) ) {
|
122 |
+
wc_stripe_log_info( sprintf( 'payment_intent.succeeded event received. Intent has been completed for order %s. Event exited.', $order->get_id() ) );
|
123 |
+
|
124 |
+
return;
|
125 |
+
}
|
126 |
+
|
127 |
+
$payment_method->set_order_lock( $order );
|
128 |
+
$result = $payment_method->payment_object->process_payment( $order );
|
129 |
+
|
130 |
+
if ( ! is_wp_error( $result ) && $result->complete_payment ) {
|
131 |
+
$payment_method->payment_object->payment_complete( $order, $result->charge );
|
132 |
+
$order->add_order_note( __( 'payment_intent.succeeded webhook received. Payment has been completed.', 'woo-stripe-payment' ) );
|
133 |
+
}
|
134 |
+
}
|
135 |
+
}
|
136 |
+
|
137 |
+
/**
|
138 |
+
*
|
139 |
+
* @param \Stripe\Charge $charge
|
140 |
+
* @param WP_REST_Request $request
|
141 |
+
*
|
142 |
+
* @since 3.1.1
|
143 |
+
* @package Stripe/Functions
|
144 |
+
*/
|
145 |
+
function wc_stripe_process_charge_failed( $charge, $request ) {
|
146 |
+
$order = wc_get_order( wc_stripe_filter_order_id( $charge->metadata['order_id'], $charge ) );
|
147 |
+
|
148 |
+
if ( $order ) {
|
149 |
+
$payment_methods = WC()->payment_gateways()->payment_gateways();
|
150 |
+
if ( isset( $payment_methods[ $order->get_payment_method() ] ) ) {
|
151 |
+
/**
|
152 |
+
*
|
153 |
+
* @var WC_Payment_Gateway_Stripe $payment_method
|
154 |
+
*/
|
155 |
+
$payment_method = $payment_methods[ $order->get_payment_method() ];
|
156 |
+
// only update order status if this is an asynchronous payment method,
|
157 |
+
// and there is no completed date on the order. If there is a complete date it
|
158 |
+
// means payment_complete was called on the order at some point
|
159 |
+
if ( ! $payment_method->synchronous && ! $order->get_date_completed() ) {
|
160 |
+
$order->update_status( 'failed', $charge->failure_message );
|
161 |
+
}
|
162 |
+
}
|
163 |
+
}
|
164 |
+
}
|
165 |
+
|
166 |
+
/**
|
167 |
+
* Function that processes the charge.refund webhook. If the refund is created in the Stripe dashboard, a
|
168 |
+
* refund will be created in the WC system to keep WC and Stripe in sync.
|
169 |
+
*
|
170 |
+
* @param \Stripe\Charge $charge
|
171 |
+
*
|
172 |
+
* @since 3.2.15
|
173 |
+
*/
|
174 |
+
function wc_stripe_process_create_refund( $charge ) {
|
175 |
+
$mode = $charge->livemode ? 'live' : 'test';
|
176 |
+
$order = null;
|
177 |
+
// get the order ID from the charge
|
178 |
+
if ( isset( $charge->metadata['order_id'] ) ) {
|
179 |
+
$order = wc_get_order( absint( $charge->metadata['order_id'] ) );
|
180 |
+
} else {
|
181 |
+
// charge didn't have order ID for whatever reason, so get order from charge ID
|
182 |
+
$order = wc_stripe_get_order_from_transaction( $charge->id );
|
183 |
+
}
|
184 |
+
try {
|
185 |
+
if ( ! $order ) {
|
186 |
+
throw new Exception( sprintf( 'Could not match order with charge %s.', $charge->id ) );
|
187 |
+
}
|
188 |
+
// get the list of refunds and loop through them. Find the refund that doesn't have the required metadata attributes.
|
189 |
+
foreach ( $charge->refunds as $refund ) {
|
190 |
+
/**
|
191 |
+
* @var \Stripe\Refund $refund
|
192 |
+
*/
|
193 |
+
// refund was not created via WC
|
194 |
+
if ( ! isset( $refund->metadata['order_id'], $refund->metadata['created_via'] ) ) {
|
195 |
+
// create the refund then update it in Stripe
|
196 |
+
$result = wc_create_refund( array(
|
197 |
+
'amount' => wc_stripe_remove_number_precision( $refund->amount, $order->get_currency() ),
|
198 |
+
'order_id' => $order->get_id(),
|
199 |
+
'reason' => $refund->reason,
|
200 |
+
'refund_payment' => false
|
201 |
+
) );
|
202 |
+
if ( ! is_wp_error( $result ) ) {
|
203 |
+
$order->add_order_note( sprintf( __( 'Order refunded in Stripe. Amount: %s', 'woo-stripe-payment' ), $result->get_formatted_refund_amount() ) );
|
204 |
+
WC_Stripe_Gateway::load( $mode )->refunds->update( $refund->id, array(
|
205 |
+
'metadata' => array(
|
206 |
+
'order_id' => $order->get_id(),
|
207 |
+
'created_via' => 'stripe_dashboard'
|
208 |
+
)
|
209 |
+
) );
|
210 |
+
} else {
|
211 |
+
throw new Exception( $result->get_error_message() );
|
212 |
+
}
|
213 |
+
}
|
214 |
+
}
|
215 |
+
} catch ( Exception $e ) {
|
216 |
+
wc_stripe_log_error( sprintf( 'Error processing refund webhook. Error: %s', $e->getMessage() ) );
|
217 |
+
}
|
218 |
+
}
|
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: 5.6
|
6 |
Requires PHP: 5.6
|
7 |
-
Stable tag: 3.2.
|
8 |
Copyright: Payment Plugins
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
@@ -58,6 +58,18 @@ If you're site is not loading over https, then Stripe won't render the Payment R
|
|
58 |
8. Edit payment gateways on the product page
|
59 |
|
60 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
= 3.2.9 =
|
62 |
* Updated - WP tested to 5.6
|
63 |
* Updated - Tested with PHP 8
|
4 |
Requires at least: 3.0.1
|
5 |
Tested up to: 5.6
|
6 |
Requires PHP: 5.6
|
7 |
+
Stable tag: 3.2.10
|
8 |
Copyright: Payment Plugins
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
58 |
8. Edit payment gateways on the product page
|
59 |
|
60 |
== Changelog ==
|
61 |
+
= 3.2.10 =
|
62 |
+
* Added - Refund webhook support so refunds created in Stripe dashboard sync with WooCommerce store
|
63 |
+
* Added - Option to control when local payment methods are visible on checkout page based on billing country
|
64 |
+
* Added - wc_stripe_refund_args filter
|
65 |
+
* Added - Support for SEPA subscription amount changes
|
66 |
+
* Added - SEPA to subscription customer change payment method page
|
67 |
+
* Added - Filter so frontend error html can be customized
|
68 |
+
* Added - Authorize option for Klarna payments so they can be authorized or captured
|
69 |
+
* Added - Handle SCA for subscriptions with free trial
|
70 |
+
* Fixed - Sorting of Apple Pay payment methods in Apple Wallet
|
71 |
+
* Updated - GPay gateway converted to payment intents for SCA.
|
72 |
+
* Updated - Credit card form moved Saved Card label to right of checkbox
|
73 |
= 3.2.9 =
|
74 |
* Updated - WP tested to 5.6
|
75 |
* Updated - Tested with PHP 8
|
stripe-payments.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Stripe For WooCommerce
|
4 |
* Plugin URI: https://docs.paymentplugins.com/wc-stripe/config/
|
5 |
* Description: Accept credit cards, Google Pay, Apple Pay, ACH, Klarna and more using Stripe.
|
6 |
-
* Version: 3.2.
|
7 |
* Author: Payment Plugins, support@paymentplugins.com
|
8 |
* Text Domain: woo-stripe-payment
|
9 |
* Domain Path: /i18n/languages/
|
3 |
* Plugin Name: Stripe For WooCommerce
|
4 |
* Plugin URI: https://docs.paymentplugins.com/wc-stripe/config/
|
5 |
* Description: Accept credit cards, Google Pay, Apple Pay, ACH, Klarna and more using Stripe.
|
6 |
+
* Version: 3.2.10
|
7 |
* Author: Payment Plugins, support@paymentplugins.com
|
8 |
* Text Domain: woo-stripe-payment
|
9 |
* Domain Path: /i18n/languages/
|
templates/cc-forms/bootstrap.php
CHANGED
@@ -55,7 +55,7 @@
|
|
55 |
box-shadow: inset 0 0 0 1.25px #1b9404;
|
56 |
-webkit-box-shadow: inset 0 0 0 1.25px #1b9404;
|
57 |
}
|
58 |
-
.wc-stripe-bootstrap-form #stripe-postal-code:not(.empty)+label{
|
59 |
-webkit-transform: translateY(-150%);
|
60 |
-ms-transform: translateY(-150%);
|
61 |
transform: translateY(-150%);
|
@@ -90,7 +90,7 @@ li.payment_method_stripe_cc .payment_box{
|
|
90 |
}
|
91 |
.wc-stripe-bootstrap-form .mb-3,
|
92 |
.wc-stripe-bootstrap-form .my-3 {
|
93 |
-
margin-bottom:
|
94 |
}
|
95 |
.wc-stripe-bootstrap-form .col-md-3,
|
96 |
.wc-stripe-bootstrap-form .col-md-4,
|
55 |
box-shadow: inset 0 0 0 1.25px #1b9404;
|
56 |
-webkit-box-shadow: inset 0 0 0 1.25px #1b9404;
|
57 |
}
|
58 |
+
.wc-stripe-bootstrap-form #stripe-postal-code:not(.empty):not(.StripeElement--complete):not(.focused)+label{
|
59 |
-webkit-transform: translateY(-150%);
|
60 |
-ms-transform: translateY(-150%);
|
61 |
transform: translateY(-150%);
|
90 |
}
|
91 |
.wc-stripe-bootstrap-form .mb-3,
|
92 |
.wc-stripe-bootstrap-form .my-3 {
|
93 |
+
margin-bottom: 18px !important;
|
94 |
}
|
95 |
.wc-stripe-bootstrap-form .col-md-3,
|
96 |
.wc-stripe-bootstrap-form .col-md-4,
|
templates/checkout/credit-card.php
CHANGED
@@ -1,24 +1,23 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* @version 3.
|
4 |
-
*
|
5 |
* @var WC_Payment_Gateway_Stripe_CC $gateway
|
6 |
*/
|
7 |
?>
|
8 |
-
<?php if($gateway->is_custom_form_active())
|
9 |
-
|
10 |
-
<?php wc_stripe_get_template($gateway->get_custom_form_template(), ['gateway' => $gateway])?>
|
11 |
-
|
12 |
-
<?php else
|
13 |
-
|
14 |
-
<?php endif
|
15 |
-
<?php if($gateway->show_save_source())
|
16 |
-
<div class="wc-stripe-save-source">
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
<?php endif;?>
|
1 |
<?php
|
2 |
/**
|
3 |
+
* @version 3.2.10
|
4 |
+
*
|
5 |
* @var WC_Payment_Gateway_Stripe_CC $gateway
|
6 |
*/
|
7 |
?>
|
8 |
+
<?php if ( $gateway->is_custom_form_active() ): ?>
|
9 |
+
<div id="wc-stripe-cc-custom-form">
|
10 |
+
<?php wc_stripe_get_template( $gateway->get_custom_form_template(), [ 'gateway' => $gateway ] ) ?>
|
11 |
+
</div>
|
12 |
+
<?php else: ?>
|
13 |
+
<div id="wc-stripe-card-element"></div>
|
14 |
+
<?php endif; ?>
|
15 |
+
<?php if ( $gateway->show_save_source() ): ?>
|
16 |
+
<div class="wc-stripe-save-source">
|
17 |
+
<label class="checkbox">
|
18 |
+
<input type="checkbox" id="<?php echo $gateway->save_source_key ?>" name="<?php echo $gateway->save_source_key ?>" value="yes"/>
|
19 |
+
<span class="save-source-checkbox"></span>
|
20 |
+
</label>
|
21 |
+
<label class="save-source-label"><?php _e( 'Save Card', 'woo-stripe-payment' ) ?></label>
|
22 |
+
</div>
|
23 |
+
<?php endif; ?>
|
|