Version Description
- Fixed - Error message when using saved payment method for zero total subscription.
- Fixed - Undefined variable: gateways message on edit product page if no Stripe payment gateways are enabled.
- Added - Webhooks can be created from API Settings page.
- Added - Advanced Settings page where new options like Stripe fee, email receipt, etc can be managed.
- Added - Option to refund on order cancellation
- Added - Webhook charge.dispute.created, charge.dispute.closed, review.opened, review.closed functionality.
- Added - Klarna PaymentIntent integration. This new integration redirects to the Klarna payment page rather then the Klarna widget.
Download this release
Release Info
Developer | mr.clayton |
Plugin | Payment Plugins for Stripe WooCommerce |
Version | 3.3.13 |
Comparing to | |
See all releases |
Code changes from version 3.3.12 to 3.3.13
- assets/css/admin/admin-rtl.css +2 -1
- assets/css/admin/admin.css +2 -1
- assets/css/stripe-rtl.css +2 -1
- assets/css/stripe.css +2 -1
- assets/css/stripe.min-rtl.css +1 -1
- assets/css/stripe.min.css +1 -1
- assets/js/admin/admin-settings.js +32 -2
- assets/js/admin/meta-boxes-order.js +1 -4
- assets/js/frontend/local-payment.js +2 -294
- assets/js/frontend/local-payment.min.js +1 -1
- assets/js/frontend/wc-stripe.js +2 -1
- assets/js/frontend/wc-stripe.min.js +1 -1
- i18n/languages/woo-stripe-payment.pot +468 -398
- includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php +7 -4
- includes/abstract/abstract-wc-payment-gateway-stripe.php +82 -73
- includes/abstract/abstract-wc-stripe-payment.php +38 -23
- includes/abstract/abstract-wc-stripe-rest-controller.php +1 -1
- includes/admin/class-wc-stripe-admin-assets.php +6 -3
- includes/admin/class-wc-stripe-admin-settings.php +12 -3
- includes/admin/meta-boxes/class-wc-stripe-admin-meta-box-product-data.php +2 -0
- includes/admin/meta-boxes/class-wc-stripe-admin-order-metaboxes.php +28 -2
- includes/admin/meta-boxes/views/html-order-charge-data.php +2 -2
- includes/admin/settings/class-wc-stripe-advanced-settings.php +156 -0
- includes/admin/settings/class-wc-stripe-api-settings.php +120 -10
- includes/class-stripe.php +30 -10
- includes/class-wc-stripe-api-operation.php +15 -10
- includes/class-wc-stripe-api-request-filter.php +47 -0
- includes/class-wc-stripe-constants.php +13 -1
- includes/class-wc-stripe-gateway.php +79 -66
- includes/class-wc-stripe-payment-balance.php +94 -0
- includes/class-wc-stripe-payment-intent.php +25 -20
- includes/class-wc-stripe-redirect-handler.php +7 -1
- includes/class-wc-stripe-rest-api.php +17 -8
- includes/class-wc-stripe-update.php +10 -7
- includes/class-wc-stripe-utils.php +108 -0
- includes/controllers/class-wc-stripe-controller-gateway-settings.php +85 -52
- includes/controllers/class-wc-stripe-controller-source.php +12 -1
- includes/gateways/class-wc-payment-gateway-stripe-afterpay.php +13 -3
- includes/gateways/class-wc-payment-gateway-stripe-cc.php +6 -3
- includes/gateways/class-wc-payment-gateway-stripe-klarna.php +53 -294
- includes/gateways/settings/ach-settings.php +15 -1
- includes/traits/wc-stripe-payment-traits.php +13 -8
- includes/traits/wc-stripe-settings-trait.php +6 -3
- includes/updates/update-3.3.13.php +79 -0
- includes/wc-stripe-functions.php +117 -89
- includes/wc-stripe-hooks.php +6 -0
- includes/wc-stripe-webhook-functions.php +112 -8
- packages/blocks/assets/js/payment-methods/local-payment/klarna.js +48 -0
- packages/blocks/assets/js/payment-methods/local-payment/klarna/categories.js +0 -39
- packages/blocks/assets/js/payment-methods/local-payment/klarna/hooks/index.js +0 -2
- packages/blocks/assets/js/payment-methods/local-payment/klarna/hooks/use-create-source.js +0 -241
- packages/blocks/assets/js/payment-methods/local-payment/klarna/hooks/use-process-payment.js +0 -43
- packages/blocks/assets/js/payment-methods/local-payment/klarna/index.js +0 -140
- packages/blocks/assets/js/payment-methods/local-payment/klarna/loader.js +0 -9
- packages/blocks/assets/js/payment-methods/local-payment/klarna/styles.scss +0 -67
- packages/blocks/assets/js/payment-methods/local-payment/styles.scss +6 -0
- packages/blocks/build/commons.js +1 -1
- packages/blocks/build/commons.js.map +1 -1
assets/css/admin/admin-rtl.css
CHANGED
@@ -303,7 +303,8 @@
|
|
303 |
Â
background-image: url("data:image/png;base64,iVBOR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n4hlKnwt4bW11uCvW65x+cLXAkgkQDgMpXDtQRkhAydXRKQnJVTqq5liZTv/V0dDJHCyD6rIZT5mU+15Fgk36/X7n/oQ0beGawQTgtMZxT4UP2a1zt4I6n8bxPlLNU+u+GxS6HMwch43lBZzu+tHpXPaIPDRKWi2gPDKi6sDo2sqjBUxx91CbOWdBN6r+hCqfJu+ezfuXEfCdX7lw+k70nvDmGHwr7KSbRrmA9+POa7v5lgwHA2debJn5KSIvxQBnsXxj7qcfwe4a8bmAD4tWnLp6s7uzN2lWw33kdhkeK/lUpat+3Kg9C2ZMPIzuC6A9HmxDbsJeozndwNesXLCf2mO376gnz3TW4Jph2I3Y7cidnr7ynt54MJky/ZZli8jFTZHnE7Ikdmt+9Ua0wjg/bvSwM0+OHXER0ZV2PqULn4EGBjH8LKzgJH+OZnBpHG3kczuNgF7dUD/2DJ6JBlO6wLwP9OtgBt0vr22a3hrHBHQnQkSXlTWgahBlg+WgIMgHIoEpb6cdTvZ7A3QRRFruBDm+FnXRiyhZ3jY+YCXKLwgI0QNTYkKPt1d5YBBmAaJdver48bx/pWQZ/781wx06nq7kgGc0lu8ElOF74OqSBf4P9hj31KSAw4AAAAAASUVORK5CYII=")
|
304 |
Â
}
|
305 |
Â
|
306 |
-
.stipe-connect-active
|
Â
|
|
307 |
Â
font-size: 30px;
|
308 |
Â
color: green;
|
309 |
Â
width: 25px;
|
303 |
Â
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAAAwCAYAAABuZUjcAAAKRGlDQ1BJQ0MgUHJvZmlsZQAASA2dlndUFNcXx9/MbC+0XZYiZem9twWkLr1IlSYKy+4CS1nWZRewN0QFIoqICFYkKGLAaCgSK6JYCAgW7AEJIkoMRhEVlczGHPX3Oyf5/U7eH3c+8333nnfn3vvOGQAoASECYQ6sAEC2UCKO9PdmxsUnMPG9AAZEgAM2AHC4uaLQKL9ogK5AXzYzF3WS8V8LAuD1LYBaAK5bBIQzmX/p/+9DkSsSSwCA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eK/lUpat+3Kg9C2ZMPIzuC6A9HmxDbsJeozndwNesXLCf2mO376gnz3TW4Jph2I3Y7cidnr7ynt54MJky/ZZli8jFTZHnE7Ikdmt+9Ua0wjg/bvSwM0+OHXER0ZV2PqULn4EGBjH8LKzgJH+OZnBpHG3kczuNgF7dUD/2DJ6JBlO6wLwP9OtgBt0vr22a3hrHBHQnQkSXlTWgahBlg+WgIMgHIoEpb6cdTvZ7A3QRRFruBDm+FnXRiyhZ3jY+YCXKLwgI0QNTYkKPt1d5YBBmAaJdver48bx/pWQZ/781wx06nq7kgGc0lu8ElOF74OqSBf4P9hj31KSAw4AAAAAASUVORK5CYII=")
|
304 |
Â
}
|
305 |
Â
|
306 |
+
.stipe-connect-active,
|
307 |
+
.stripe-webhook-created{
|
308 |
Â
font-size: 30px;
|
309 |
Â
color: green;
|
310 |
Â
width: 25px;
|
assets/css/admin/admin.css
CHANGED
@@ -303,7 +303,8 @@
|
|
303 |
Â
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAAAwCAYAAABuZUjcAAAKRGlDQ1BJQ0MgUHJvZmlsZQAASA2dlndUFNcXx9/MbC+0XZYiZem9twWkLr1IlSYKy+4CS1nWZRewN0QFIoqICFYkKGLAaCgSK6JYCAgW7AEJIkoMRhEVlczGHPX3Oyf5/U7eH3c+8333nnfn3vvOGQAoASECYQ6sAEC2UCKO9PdmxsUnMPG9AAZEgAM2AHC4uaLQKL9ogK5AXzYzF3WS8V8LAuD1LYBaAK5bBIQzmX/p/+9DkSsSSwCAwtEAOx4/l4tyIcpZ+RKRTJ9EmZ6SKWMYI2MxmiDKqjJO+8Tmf/p8Yk8Z87KFPNRHlrOIl82TcRfKG/OkfJSREJSL8gT8fJRvoKyfJc0WoPwGZXo2n5MLAIYi0yV8bjrK1ihTxNGRbJTnAkCgpH3FKV+xhF+A5gkAO0e0RCxIS5cwjbkmTBtnZxYzgJ+fxZdILMI53EyOmMdk52SLOMIlAHz6ZlkUUJLVlokW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ruBDm+FnXRiyhZ3jY+YCXKLwgI0QNTYkKPt1d5YBBmAaJdver48bx/pWQZ/781wx06nq7kgGc0lu8ElOF74OqSBf4P9hj31KSAw4AAAAAASUVORK5CYII=")
|
304 |
Â
}
|
305 |
Â
|
306 |
-
.stipe-connect-active
|
Â
|
|
307 |
Â
font-size: 30px;
|
308 |
Â
color: green;
|
309 |
Â
width: 25px;
|
303 |
Â
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAAAwCAYAAABuZUjcAAAKRGlDQ1BJQ0MgUHJvZmlsZQAASA2dlndUFNcXx9/MbC+0XZYiZem9twWkLr1IlSYKy+4CS1nWZRewN0QFIoqICFYkKGLAaCgSK6JYCAgW7AEJIkoMRhEVlczGHPX3Oyf5/U7eH3c+8333nnfn3vvOGQAoASECYQ6sAEC2UCKO9PdmxsUnMPG9AAZEgAM2AHC4uaLQKL9ogK5AXzYzF3WS8V8LAuD1LYBaAK5bBIQzmX/p/+9DkSsSSwCAwtEAOx4/l4tyIcpZ+RKRTJ9EmZ6SKWMYI2MxmiDKqjJO+8Tmf/p8Yk8Z87KFPNRHlrOIl82TcRfKG/OkfJSREJSL8gT8fJRvoKyfJc0WoPwGZXo2n5MLAIYi0yV8bjrK1ihTxNGRbJTnAkCgpH3FKV+xhF+A5gkAO0e0RCxIS5cwjbkmTBtnZxYzgJ+fxZdILMI53EyOmMdk52SLOMIlAHz6ZlkUUJLVlokW2dHG2dHRwtYSLf/n9Y+bn73+GWS9/eTxMuLPnkGMni/al9gvWk4tAKwptDZbvmgpOwFoWw+A6t0vmv4+AOQLAWjt++p7GLJ5SZdIRC5WVvn5+ZYCPtdSVtDP6386fPb8e/jqPEvZeZ9rx/Thp3KkWRKmrKjcnKwcqZiZK+Jw+UyL/x7ifx34VVpf5WEeyU/li/lC9KgYdMoEwjS03UKeQCLIETIFwr/r8L8M+yoHGX6aaxRodR8BPckSKPTRAfJrD8DQyABJ3IPuQJ/7FkKMAbKbF6s99mnuUU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84xfQU0i+piya9fRhjrftfR2/L3M8TobToxYFEScnqehu0QW8ufX1eoGXJPNy6Mju3W2pAVgSeO4AHQLV+SR5pIVES+CQ1+QolPeoqlr0RMsFXJTkpXDbbVxVV/eclW+04wjTDod4HGe907aQuiImOV7RfbXVVdWNeqCMCUpu4ORM4Zl6csg2pC4X8GHRsNbdl6BrBs1MpWbh4DuLrhvoEGzZODVJHA7GPOuLJ5iG0ELAchUcn5mh63/n4hlKnwt4bW11uCvW65x+cLXAkgkQDgMpXDtQRkhAydXRKQnJVTqq5liZTv/V0dDJHCyD6rIZT5mU+15Fgk36/X7n/oQ0beGawQTgtMZxT4UP2a1zt4I6n8bxPlLNU+u+GxS6HMwch43lBZzu+tHpXPaIPDRKWi2gPDKi6sDo2sqjBUxx91CbOWdBN6r+hCqfJu+ezfuXEfCdX7lw+k70nvDmGHwr7KSbRrmA9+POa7v5lgwHA2debJn5KSIvxQBnsXxj7qcfwe4a8bmAD4tWnLp6s7uzN2lWw33kdhkeK/lUpat+3Kg9C2ZMPIzuC6A9HmxDbsJeozndwNesXLCf2mO376gnz3TW4Jph2I3Y7cidnr7ynt54MJky/ZZli8jFTZHnE7Ikdmt+9Ua0wjg/bvSwM0+OHXER0ZV2PqULn4EGBjH8LKzgJH+OZnBpHG3kczuNgF7dUD/2DJ6JBlO6wLwP9OtgBt0vr22a3hrHBHQnQkSXlTWgahBlg+WgIMgHIoEpb6cdTvZ7A3QRRFruBDm+FnXRiyhZ3jY+YCXKLwgI0QNTYkKPt1d5YBBmAaJdver48bx/pWQZ/781wx06nq7kgGc0lu8ElOF74OqSBf4P9hj31KSAw4AAAAAASUVORK5CYII=")
|
304 |
Â
}
|
305 |
Â
|
306 |
+
.stipe-connect-active,
|
307 |
+
.stripe-webhook-created{
|
308 |
Â
font-size: 30px;
|
309 |
Â
color: green;
|
310 |
Â
width: 25px;
|
assets/css/stripe-rtl.css
CHANGED
@@ -319,6 +319,7 @@ li.payment_method_stripe_payment_request {
|
|
319 |
Â
.wc-stripe-product-checkout-container ul.wc_stripe_product_payment_methods li[class*=payment_method_stripe_],
|
320 |
Â
.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods li[class*=payment_method_stripe_] {
|
321 |
Â
margin: 0 0 1em 0;
|
Â
|
|
322 |
Â
}
|
323 |
Â
|
324 |
Â
.wc-stripe-product-checkout-container ul.wc_stripe_product_payment_methods li[class*=payment_method_stripe_]:last-child,
|
@@ -899,7 +900,7 @@ li.payment_method_stripe_grabpay.wc-stripe-no-desc .payment_box.wc-stripe-no-met
|
|
899 |
Â
li.payment_method_stripe_multibanco.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,
|
900 |
Â
li.payment_method_stripe_p24.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,
|
901 |
Â
li.payment_method_stripe_sofort.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,
|
902 |
-
li.payment_method_stripe_oxxo.wc-stripe-no-desc .payment_box.wc-stripe-no-methods{
|
903 |
Â
padding: 0;
|
904 |
Â
margin: 0;
|
905 |
Â
}
|
319 |
Â
.wc-stripe-product-checkout-container ul.wc_stripe_product_payment_methods li[class*=payment_method_stripe_],
|
320 |
Â
.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods li[class*=payment_method_stripe_] {
|
321 |
Â
margin: 0 0 1em 0;
|
322 |
+
list-style: none;
|
323 |
Â
}
|
324 |
Â
|
325 |
Â
.wc-stripe-product-checkout-container ul.wc_stripe_product_payment_methods li[class*=payment_method_stripe_]:last-child,
|
900 |
Â
li.payment_method_stripe_multibanco.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,
|
901 |
Â
li.payment_method_stripe_p24.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,
|
902 |
Â
li.payment_method_stripe_sofort.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,
|
903 |
+
li.payment_method_stripe_oxxo.wc-stripe-no-desc .payment_box.wc-stripe-no-methods {
|
904 |
Â
padding: 0;
|
905 |
Â
margin: 0;
|
906 |
Â
}
|
assets/css/stripe.css
CHANGED
@@ -319,6 +319,7 @@ li.payment_method_stripe_payment_request {
|
|
319 |
Â
.wc-stripe-product-checkout-container ul.wc_stripe_product_payment_methods li[class*=payment_method_stripe_],
|
320 |
Â
.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods li[class*=payment_method_stripe_] {
|
321 |
Â
margin: 0 0 1em 0;
|
Â
|
|
322 |
Â
}
|
323 |
Â
|
324 |
Â
.wc-stripe-product-checkout-container ul.wc_stripe_product_payment_methods li[class*=payment_method_stripe_]:last-child,
|
@@ -899,7 +900,7 @@ li.payment_method_stripe_grabpay.wc-stripe-no-desc .payment_box.wc-stripe-no-met
|
|
899 |
Â
li.payment_method_stripe_multibanco.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,
|
900 |
Â
li.payment_method_stripe_p24.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,
|
901 |
Â
li.payment_method_stripe_sofort.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,
|
902 |
-
li.payment_method_stripe_oxxo.wc-stripe-no-desc .payment_box.wc-stripe-no-methods{
|
903 |
Â
padding: 0;
|
904 |
Â
margin: 0;
|
905 |
Â
}
|
319 |
Â
.wc-stripe-product-checkout-container ul.wc_stripe_product_payment_methods li[class*=payment_method_stripe_],
|
320 |
Â
.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods li[class*=payment_method_stripe_] {
|
321 |
Â
margin: 0 0 1em 0;
|
322 |
+
list-style: none;
|
323 |
Â
}
|
324 |
Â
|
325 |
Â
.wc-stripe-product-checkout-container ul.wc_stripe_product_payment_methods li[class*=payment_method_stripe_]:last-child,
|
900 |
Â
li.payment_method_stripe_multibanco.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,
|
901 |
Â
li.payment_method_stripe_p24.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,
|
902 |
Â
li.payment_method_stripe_sofort.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,
|
903 |
+
li.payment_method_stripe_oxxo.wc-stripe-no-desc .payment_box.wc-stripe-no-methods {
|
904 |
Â
padding: 0;
|
905 |
Â
margin: 0;
|
906 |
Â
}
|
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{max-width:43px;max-height:26px;width:43px;height:26px;float:none;display:inline}li.payment_method_stripe_payment_request .wc-stripe-paymentRequest-icons-container img:not(.gpay){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}.wc-stripe-saved-methods-container .select2-container .select2-selection--single .select2-selection__rendered{padding-right:8px}.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-checkout-container ul.wc_stripe_cart_payment_methods li[class*=payment_method_stripe_]:last-child,.wc-stripe-product-checkout-container ul.wc_stripe_product_payment_methods li[class*=payment_method_stripe_]:last-child{margin: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],li.payment_method_stripe_payment_request label:first-of-type img[src*=googlepay_standard]{width:60px;max-height:35px}li.payment_method_stripe_googlepay label:first-of-type img[src*=googlepay_round_outline],li.payment_method_stripe_payment_request label:first-of-type img[src*=googlepay_round_outline]{width:56px;max-height:30px}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!important;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_klarna img[src*=klarna_pink]{width:56px;height:32px;max-height:32px}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;transform:translateY(0)}.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}#payment .payment_methods li #wc_stripe_local_payment_stripe_wechat img,#wc_stripe_local_payment_stripe_wechat img{max-height:100%;float:none}.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_oxxo.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}.wc-stripe-shortcode-cart-buttons .wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods.active li.wc-stripe-payment-method.or{display:none}label[for=payment_method_stripe_afterpay]>#wc-stripe-afterpay-msg{display:inline-block}#wc-stripe-afterpay-cart-container #wc-stripe-afterpay-cart-msg .__PrivateStripeElement p,#wc-stripe-afterpay-product-msg .__PrivateStripeElement p,.payment_method_stripe_afterpay #wc-stripe-afterpay-msg .__PrivateStripeElement p{margin-bottom:0!important;margin-top:0!important}#wc-stripe-afterpay-cart-msg .__PrivateStripeElement p .AfterpayMessage-logo,.payment_method_stripe_afterpay #wc-stripe-afterpay-msg .__PrivateStripeElement p .AfterpayMessage-logo{vertical-align:middle}.payment_method_stripe_afterpay #wc_stripe_local_payment_stripe_afterpay.ineligible{display:none}.payment_method_stripe_afterpay .wc-stripe-afterpay__offsite{text-align:center;max-width:320px;margin:0 auto;padding:10px 0}.payment_method_stripe_afterpay .wc-stripe-afterpay__offsite img{display:inline-block}.payment_method_stripe_afterpay .wc-stripe-afterpay__offsite p{font-size:14px;margin-top:10px}#wc-stripe-afterpay-cart-container #wc-stripe-afterpay-cart-msg{text-align:right}#wc-stripe-afterpay-cart-container #wc-stripe-afterpay-cart-msg .AfterpayMessage-logoSvg,.payment_method_stripe_afterpay #wc-stripe-afterpay-msg .AfterpayMessage-logoSvg{min-width:64px;max-width:90px}#wc-stripe-afterpay-cart-container td{border:none}#wc-stripe-afterpay-cart-container td::before{content:''}.AfterpayMessage-logoSvg{display:inline-block}#wc-stripe-afterpay-product-msg{font-size:14px}#wc-stripe-afterpay-product-msg .AfterpayMessage-logoSvg{max-width:80px;min-width:64px}.wc-stripe-afterpay-minicart-msg{font-size:.8em}.afterpay-ineligible,.payment_method_stripe_afterpay.afterpay-ineligible{display:none}.woocommerce-mini-cart__buttons .gpay-card-info-container{min-width:100%}.woocommerce-mini-cart__buttons .gpay-card-info-container{margin:0}.wc-stripe-boleto__description{margin-top:10px}.wc-stripe-boleto__description div{display:flex;align-items:center}.wc-stripe-boleto__description div label{margin:0}.wc-stripe-klarna__testmode{margin-top:10px}.wc-stripe-klarna__testmode label{display:inline-block}
|
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{max-width:43px;max-height:26px;width:43px;height:26px;float:none;display:inline}li.payment_method_stripe_payment_request .wc-stripe-paymentRequest-icons-container img:not(.gpay){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}.wc-stripe-saved-methods-container .select2-container .select2-selection--single .select2-selection__rendered{padding-right:8px}.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;list-style:none}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods li[class*=payment_method_stripe_]:last-child,.wc-stripe-product-checkout-container ul.wc_stripe_product_payment_methods li[class*=payment_method_stripe_]:last-child{margin: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],li.payment_method_stripe_payment_request label:first-of-type img[src*=googlepay_standard]{width:60px;max-height:35px}li.payment_method_stripe_googlepay label:first-of-type img[src*=googlepay_round_outline],li.payment_method_stripe_payment_request label:first-of-type img[src*=googlepay_round_outline]{width:56px;max-height:30px}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!important;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_klarna img[src*=klarna_pink]{width:56px;height:32px;max-height:32px}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;transform:translateY(0)}.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}#payment .payment_methods li #wc_stripe_local_payment_stripe_wechat img,#wc_stripe_local_payment_stripe_wechat img{max-height:100%;float:none}.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_oxxo.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}.wc-stripe-shortcode-cart-buttons .wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods.active li.wc-stripe-payment-method.or{display:none}label[for=payment_method_stripe_afterpay]>#wc-stripe-afterpay-msg{display:inline-block}#wc-stripe-afterpay-cart-container #wc-stripe-afterpay-cart-msg .__PrivateStripeElement p,#wc-stripe-afterpay-product-msg .__PrivateStripeElement p,.payment_method_stripe_afterpay #wc-stripe-afterpay-msg .__PrivateStripeElement p{margin-bottom:0!important;margin-top:0!important}#wc-stripe-afterpay-cart-msg .__PrivateStripeElement p .AfterpayMessage-logo,.payment_method_stripe_afterpay #wc-stripe-afterpay-msg .__PrivateStripeElement p .AfterpayMessage-logo{vertical-align:middle}.payment_method_stripe_afterpay #wc_stripe_local_payment_stripe_afterpay.ineligible{display:none}.payment_method_stripe_afterpay .wc-stripe-afterpay__offsite{text-align:center;max-width:320px;margin:0 auto;padding:10px 0}.payment_method_stripe_afterpay .wc-stripe-afterpay__offsite img{display:inline-block}.payment_method_stripe_afterpay .wc-stripe-afterpay__offsite p{font-size:14px;margin-top:10px}#wc-stripe-afterpay-cart-container #wc-stripe-afterpay-cart-msg{text-align:right}#wc-stripe-afterpay-cart-container #wc-stripe-afterpay-cart-msg .AfterpayMessage-logoSvg,.payment_method_stripe_afterpay #wc-stripe-afterpay-msg .AfterpayMessage-logoSvg{min-width:64px;max-width:90px}#wc-stripe-afterpay-cart-container td{border:none}#wc-stripe-afterpay-cart-container td::before{content:''}.AfterpayMessage-logoSvg{display:inline-block}#wc-stripe-afterpay-product-msg{font-size:14px}#wc-stripe-afterpay-product-msg .AfterpayMessage-logoSvg{max-width:80px;min-width:64px}.wc-stripe-afterpay-minicart-msg{font-size:.8em}.afterpay-ineligible,.payment_method_stripe_afterpay.afterpay-ineligible{display:none}.woocommerce-mini-cart__buttons .gpay-card-info-container{min-width:100%}.woocommerce-mini-cart__buttons .gpay-card-info-container{margin:0}.wc-stripe-boleto__description{margin-top:10px}.wc-stripe-boleto__description div{display:flex;align-items:center}.wc-stripe-boleto__description div label{margin:0}.wc-stripe-klarna__testmode{margin-top:10px}.wc-stripe-klarna__testmode label{display:inline-block}
|
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{max-width:43px;max-height:26px;width:43px;height:26px;float:none;display:inline}li.payment_method_stripe_payment_request .wc-stripe-paymentRequest-icons-container img:not(.gpay){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}.wc-stripe-saved-methods-container .select2-container .select2-selection--single .select2-selection__rendered{padding-left:8px}.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-checkout-container ul.wc_stripe_cart_payment_methods li[class*=payment_method_stripe_]:last-child,.wc-stripe-product-checkout-container ul.wc_stripe_product_payment_methods li[class*=payment_method_stripe_]:last-child{margin: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],li.payment_method_stripe_payment_request label:first-of-type img[src*=googlepay_standard]{width:60px;max-height:35px}li.payment_method_stripe_googlepay label:first-of-type img[src*=googlepay_round_outline],li.payment_method_stripe_payment_request label:first-of-type img[src*=googlepay_round_outline]{width:56px;max-height:30px}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!important;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_klarna img[src*=klarna_pink]{width:56px;height:32px;max-height:32px}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;transform:translateY(0)}.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}#payment .payment_methods li #wc_stripe_local_payment_stripe_wechat img,#wc_stripe_local_payment_stripe_wechat img{max-height:100%;float:none}.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_oxxo.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}.wc-stripe-shortcode-cart-buttons .wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods.active li.wc-stripe-payment-method.or{display:none}label[for=payment_method_stripe_afterpay]>#wc-stripe-afterpay-msg{display:inline-block}#wc-stripe-afterpay-cart-container #wc-stripe-afterpay-cart-msg .__PrivateStripeElement p,#wc-stripe-afterpay-product-msg .__PrivateStripeElement p,.payment_method_stripe_afterpay #wc-stripe-afterpay-msg .__PrivateStripeElement p{margin-bottom:0!important;margin-top:0!important}#wc-stripe-afterpay-cart-msg .__PrivateStripeElement p .AfterpayMessage-logo,.payment_method_stripe_afterpay #wc-stripe-afterpay-msg .__PrivateStripeElement p .AfterpayMessage-logo{vertical-align:middle}.payment_method_stripe_afterpay #wc_stripe_local_payment_stripe_afterpay.ineligible{display:none}.payment_method_stripe_afterpay .wc-stripe-afterpay__offsite{text-align:center;max-width:320px;margin:0 auto;padding:10px 0}.payment_method_stripe_afterpay .wc-stripe-afterpay__offsite img{display:inline-block}.payment_method_stripe_afterpay .wc-stripe-afterpay__offsite p{font-size:14px;margin-top:10px}#wc-stripe-afterpay-cart-container #wc-stripe-afterpay-cart-msg{text-align:left}#wc-stripe-afterpay-cart-container #wc-stripe-afterpay-cart-msg .AfterpayMessage-logoSvg,.payment_method_stripe_afterpay #wc-stripe-afterpay-msg .AfterpayMessage-logoSvg{min-width:64px;max-width:90px}#wc-stripe-afterpay-cart-container td{border:none}#wc-stripe-afterpay-cart-container td::before{content:''}.AfterpayMessage-logoSvg{display:inline-block}#wc-stripe-afterpay-product-msg{font-size:14px}#wc-stripe-afterpay-product-msg .AfterpayMessage-logoSvg{max-width:80px;min-width:64px}.wc-stripe-afterpay-minicart-msg{font-size:.8em}.afterpay-ineligible,.payment_method_stripe_afterpay.afterpay-ineligible{display:none}.woocommerce-mini-cart__buttons .gpay-card-info-container{min-width:100%}.woocommerce-mini-cart__buttons .gpay-card-info-container{margin:0}.wc-stripe-boleto__description{margin-top:10px}.wc-stripe-boleto__description div{display:flex;align-items:center}.wc-stripe-boleto__description div label{margin:0}.wc-stripe-klarna__testmode{margin-top:10px}.wc-stripe-klarna__testmode label{display:inline-block}
|
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{max-width:43px;max-height:26px;width:43px;height:26px;float:none;display:inline}li.payment_method_stripe_payment_request .wc-stripe-paymentRequest-icons-container img:not(.gpay){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}.wc-stripe-saved-methods-container .select2-container .select2-selection--single .select2-selection__rendered{padding-left:8px}.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;list-style:none}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods li[class*=payment_method_stripe_]:last-child,.wc-stripe-product-checkout-container ul.wc_stripe_product_payment_methods li[class*=payment_method_stripe_]:last-child{margin: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],li.payment_method_stripe_payment_request label:first-of-type img[src*=googlepay_standard]{width:60px;max-height:35px}li.payment_method_stripe_googlepay label:first-of-type img[src*=googlepay_round_outline],li.payment_method_stripe_payment_request label:first-of-type img[src*=googlepay_round_outline]{width:56px;max-height:30px}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!important;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_klarna img[src*=klarna_pink]{width:56px;height:32px;max-height:32px}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;transform:translateY(0)}.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}#payment .payment_methods li #wc_stripe_local_payment_stripe_wechat img,#wc_stripe_local_payment_stripe_wechat img{max-height:100%;float:none}.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_oxxo.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}.wc-stripe-shortcode-cart-buttons .wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods.active li.wc-stripe-payment-method.or{display:none}label[for=payment_method_stripe_afterpay]>#wc-stripe-afterpay-msg{display:inline-block}#wc-stripe-afterpay-cart-container #wc-stripe-afterpay-cart-msg .__PrivateStripeElement p,#wc-stripe-afterpay-product-msg .__PrivateStripeElement p,.payment_method_stripe_afterpay #wc-stripe-afterpay-msg .__PrivateStripeElement p{margin-bottom:0!important;margin-top:0!important}#wc-stripe-afterpay-cart-msg .__PrivateStripeElement p .AfterpayMessage-logo,.payment_method_stripe_afterpay #wc-stripe-afterpay-msg .__PrivateStripeElement p .AfterpayMessage-logo{vertical-align:middle}.payment_method_stripe_afterpay #wc_stripe_local_payment_stripe_afterpay.ineligible{display:none}.payment_method_stripe_afterpay .wc-stripe-afterpay__offsite{text-align:center;max-width:320px;margin:0 auto;padding:10px 0}.payment_method_stripe_afterpay .wc-stripe-afterpay__offsite img{display:inline-block}.payment_method_stripe_afterpay .wc-stripe-afterpay__offsite p{font-size:14px;margin-top:10px}#wc-stripe-afterpay-cart-container #wc-stripe-afterpay-cart-msg{text-align:left}#wc-stripe-afterpay-cart-container #wc-stripe-afterpay-cart-msg .AfterpayMessage-logoSvg,.payment_method_stripe_afterpay #wc-stripe-afterpay-msg .AfterpayMessage-logoSvg{min-width:64px;max-width:90px}#wc-stripe-afterpay-cart-container td{border:none}#wc-stripe-afterpay-cart-container td::before{content:''}.AfterpayMessage-logoSvg{display:inline-block}#wc-stripe-afterpay-product-msg{font-size:14px}#wc-stripe-afterpay-product-msg .AfterpayMessage-logoSvg{max-width:80px;min-width:64px}.wc-stripe-afterpay-minicart-msg{font-size:.8em}.afterpay-ineligible,.payment_method_stripe_afterpay.afterpay-ineligible{display:none}.woocommerce-mini-cart__buttons .gpay-card-info-container{min-width:100%}.woocommerce-mini-cart__buttons .gpay-card-info-container{margin:0}.wc-stripe-boleto__description{margin-top:10px}.wc-stripe-boleto__description div{display:flex;align-items:center}.wc-stripe-boleto__description div label{margin:0}.wc-stripe-klarna__testmode{margin-top:10px}.wc-stripe-klarna__testmode label{display:inline-block}
|
assets/js/admin/admin-settings.js
CHANGED
@@ -17,7 +17,7 @@ jQuery(function ($) {
|
|
17 |
Â
|
18 |
Â
$('.api-register-domain').on('click', this.register_domain.bind(this));
|
19 |
Â
|
20 |
-
$('.wc-stripe-create-webhook').on('click', this.
|
21 |
Â
|
22 |
Â
$('.wc-stripe-connection-test').on('click', this.do_connection_test.bind(this));
|
23 |
Â
|
@@ -106,8 +106,16 @@ jQuery(function ($) {
|
|
106 |
Â
}.bind(this))
|
107 |
Â
}
|
108 |
Â
|
109 |
-
Settings.prototype.
|
110 |
Â
e.preventDefault();
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
111 |
Â
this.block();
|
112 |
Â
var env = $('#woocommerce_stripe_api_mode').val();
|
113 |
Â
$.ajax({
|
@@ -129,6 +137,28 @@ jQuery(function ($) {
|
|
129 |
Â
}.bind(this))
|
130 |
Â
}
|
131 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
132 |
Â
Settings.prototype.do_connection_test = function (e) {
|
133 |
Â
e.preventDefault();
|
134 |
Â
this.block();
|
17 |
Â
|
18 |
Â
$('.api-register-domain').on('click', this.register_domain.bind(this));
|
19 |
Â
|
20 |
+
$('.wc-stripe-create-webhook').on('click', this.manage_webhook.bind(this));
|
21 |
Â
|
22 |
Â
$('.wc-stripe-connection-test').on('click', this.do_connection_test.bind(this));
|
23 |
Â
|
106 |
Â
}.bind(this))
|
107 |
Â
}
|
108 |
Â
|
109 |
+
Settings.prototype.manage_webhook = function (e) {
|
110 |
Â
e.preventDefault();
|
111 |
+
if ($(e.currentTarget).is('.wc-stripe-delete-webhook')) {
|
112 |
+
this.delete_webhook();
|
113 |
+
} else {
|
114 |
+
this.create_webhook();
|
115 |
+
}
|
116 |
+
}
|
117 |
+
|
118 |
+
Settings.prototype.create_webhook = function () {
|
119 |
Â
this.block();
|
120 |
Â
var env = $('#woocommerce_stripe_api_mode').val();
|
121 |
Â
$.ajax({
|
137 |
Â
}.bind(this))
|
138 |
Â
}
|
139 |
Â
|
140 |
+
Settings.prototype.delete_webhook = function () {
|
141 |
+
this.block();
|
142 |
+
var mode = $('#woocommerce_stripe_api_mode').val();
|
143 |
+
$.ajax({
|
144 |
+
url: this.params.routes.delete_webhook,
|
145 |
+
dataType: 'json',
|
146 |
+
method: 'POST',
|
147 |
+
data: {_wpnonce: this.params.rest_nonce, mode: mode}
|
148 |
+
}).done(function (response) {
|
149 |
+
this.unblock();
|
150 |
+
if (response.code) {
|
151 |
+
window.alert(response.message);
|
152 |
+
} else {
|
153 |
+
$('#woocommerce_stripe_api_webhook_secret_' + mode).val('');
|
154 |
+
window.location.reload();
|
155 |
+
}
|
156 |
+
}.bind(this)).fail(function (xhr, textStatus, errorThrown) {
|
157 |
+
this.unblock();
|
158 |
+
window.alert(errorThrown);
|
159 |
+
}.bind(this))
|
160 |
+
}
|
161 |
+
|
162 |
Â
Settings.prototype.do_connection_test = function (e) {
|
163 |
Â
e.preventDefault();
|
164 |
Â
this.block();
|
assets/js/admin/meta-boxes-order.js
CHANGED
@@ -12,7 +12,7 @@
|
|
12 |
Â
}
|
13 |
Â
|
14 |
Â
MetaBox.prototype.initialize = function () {
|
15 |
-
$(document.body).on('click', '.do-transaction-view',
|
16 |
Â
this.render_charge_view.bind(this)).on('click',
|
17 |
Â
'.do-api-capture', this.do_api_capture.bind(this)).on('click',
|
18 |
Â
'.do-api-cancel', this.do_api_cancel.bind(this)).on('click', '.wc-stripe-pay-order', this.open_pay_order_modal.bind(this)).on(
|
@@ -117,9 +117,6 @@
|
|
117 |
Â
|
118 |
Â
MetaBox.prototype.open_pay_order_modal = function (e) {
|
119 |
Â
e.preventDefault();
|
120 |
-
if (wc_stripe_order_pay_params.order_status !== 'pending') {
|
121 |
-
return window.alert(wc_stripe_order_pay_params.messages.order_status);
|
122 |
-
}
|
123 |
Â
$(e.target).WCStripePayOrderBackboneModal({
|
124 |
Â
template: 'wc-stripe-modal-pay-order',
|
125 |
Â
params: {
|
12 |
Â
}
|
13 |
Â
|
14 |
Â
MetaBox.prototype.initialize = function () {
|
15 |
+
$(document.body).on('click', '.do-stripe-transaction-view',
|
16 |
Â
this.render_charge_view.bind(this)).on('click',
|
17 |
Â
'.do-api-capture', this.do_api_capture.bind(this)).on('click',
|
18 |
Â
'.do-api-cancel', this.do_api_cancel.bind(this)).on('click', '.wc-stripe-pay-order', this.open_pay_order_modal.bind(this)).on(
|
117 |
Â
|
118 |
Â
MetaBox.prototype.open_pay_order_modal = function (e) {
|
119 |
Â
e.preventDefault();
|
Â
|
|
Â
|
|
Â
|
|
120 |
Â
$(e.target).WCStripePayOrderBackboneModal({
|
121 |
Â
template: 'wc-stripe-modal-pay-order',
|
122 |
Â
params: {
|
assets/js/frontend/local-payment.js
CHANGED
@@ -289,9 +289,9 @@
|
|
289 |
Â
|
290 |
Â
/****** Klarna ******/
|
291 |
Â
function Klarna(params) {
|
Â
|
|
292 |
Â
LocalPayment.call(this, params);
|
293 |
-
|
294 |
-
$('form.checkout').on('change', '.form-row:not(.address-field):not(#account_password_field) .input-text, .form-row:not(.address-field) select', this.input_change.bind(this));
|
295 |
Â
}
|
296 |
Â
|
297 |
Â
function FPX(params) {
|
@@ -337,298 +337,6 @@
|
|
337 |
Â
window.addEventListener('hashchange', this.hashChange.bind(this));
|
338 |
Â
}
|
339 |
Â
|
340 |
-
Klarna.prototype.disable_place_order = function () {
|
341 |
-
$('#place_order').prop('disabled', true);
|
342 |
-
}
|
343 |
-
|
344 |
-
Klarna.prototype.enable_place_order = function () {
|
345 |
-
$('#place_order').prop('disabled', false);
|
346 |
-
}
|
347 |
-
|
348 |
-
Klarna.prototype.category_change = function (e) {
|
349 |
-
var change_category = function () {
|
350 |
-
$('[id^="klarna-instance-"]').slideUp();
|
351 |
-
var category = $('[name="klarna_category"]:checked').val();
|
352 |
-
$('#klarna-instance-' + category).slideDown();
|
353 |
-
}.bind(this);
|
354 |
-
// if this is triggered via code, set delay to prevent rapid change
|
355 |
-
if (!e.originalEvent) {
|
356 |
-
clearTimeout(this.categoryChangeTimer);
|
357 |
-
this.categoryChangeTimer = setTimeout(change_category, 500);
|
358 |
-
} else {
|
359 |
-
change_category();
|
360 |
-
}
|
361 |
-
}
|
362 |
-
|
363 |
-
Klarna.prototype.processConfirmation = function (source) {
|
364 |
-
window.Klarna.Payments.init({
|
365 |
-
client_token: source.klarna.client_token
|
366 |
-
}, function (response) {
|
367 |
-
|
368 |
-
}.bind(this));
|
369 |
-
this.payment_categories = source.klarna.payment_method_categories.split(",");
|
370 |
-
this.render_ui(true).then(function () {
|
371 |
-
this.enable_place_order();
|
372 |
-
}.bind(this));
|
373 |
-
}
|
374 |
-
|
375 |
-
Klarna.prototype.hashchange = function () {
|
376 |
-
if (this.is_gateway_selected()) {
|
377 |
-
history.pushState({}, '', window.location.pathname);
|
378 |
-
this.get_form().removeClass('processing');
|
379 |
-
this.get_form().submit();
|
380 |
-
}
|
381 |
-
}
|
382 |
-
|
383 |
-
Klarna.prototype.render_ui = function (trigger_change) {
|
384 |
-
return new Promise(function (resolve) {
|
385 |
-
if (this.payment_categories.length > 0) {
|
386 |
-
this.disable_place_order();
|
387 |
-
var promises = [];
|
388 |
-
$('#wc_stripe_local_payment_stripe_klarna').show();
|
389 |
-
for (var i = 0; i < this.payment_categories.length; i++) {
|
390 |
-
var container = '#klarna-instance-' + this.payment_categories[i];
|
391 |
-
$(container).empty();
|
392 |
-
if ($('#klarna-category-' + this.payment_categories[i]).length) {
|
393 |
-
if (this.params.translate) {
|
394 |
-
var text = this.source.klarna[this.payment_categories[i] + '_name'];
|
395 |
-
$('label[for="klarna_' + this.payment_categories[i] + '"').text(text);
|
396 |
-
}
|
397 |
-
$('#klarna-category-' + this.payment_categories[i]).show();
|
398 |
-
try {
|
399 |
-
promises.push(new Promise(function (resolve) {
|
400 |
-
window.Klarna.Payments.load({
|
401 |
-
container: container,
|
402 |
-
payment_method_category: this.payment_categories[i],
|
403 |
-
instance_id: 'klarna-instance-' + this.payment_categories[i]
|
404 |
-
}, function (response) {
|
405 |
-
resolve();
|
406 |
-
}.bind(this));
|
407 |
-
}.bind(this)));
|
408 |
-
} catch (e) {
|
409 |
-
window.alert(e);
|
410 |
-
resolve();
|
411 |
-
}
|
412 |
-
}
|
413 |
-
}
|
414 |
-
Promise.all(promises).then(function () {
|
415 |
-
resolve();
|
416 |
-
});
|
417 |
-
if (trigger_change) {
|
418 |
-
$('[id^="klarna-category-"]:visible [name="klarna_category"]').first().prop('checked', true).trigger('change');
|
419 |
-
}
|
420 |
-
} else {
|
421 |
-
resolve();
|
422 |
-
}
|
423 |
-
}.bind(this));
|
424 |
-
}
|
425 |
-
|
426 |
-
Klarna.prototype.place_order = function (e) {
|
427 |
-
if (this.is_gateway_selected()) {
|
428 |
-
e.preventDefault();
|
429 |
-
if (this.checkout_fields_valid()) {
|
430 |
-
window.Klarna.Payments.authorize({
|
431 |
-
instance_id: 'klarna-instance-' + $('[name="klarna_category"]:checked').val()
|
432 |
-
}, function (res) {
|
433 |
-
if (res.approved) {
|
434 |
-
this.set_nonce(this.source.id);
|
435 |
-
this.payment_token_received = true;
|
436 |
-
this.get_form().submit();
|
437 |
-
} else {
|
438 |
-
if (res.error) {
|
439 |
-
this.submit_error(res.error);
|
440 |
-
} else {
|
441 |
-
this.submit_error(this.params.messages.klarna_error);
|
442 |
-
}
|
443 |
-
}
|
444 |
-
}.bind(this));
|
445 |
-
}
|
446 |
-
}
|
447 |
-
}
|
448 |
-
|
449 |
-
Klarna.prototype.klarna_fields_valid = function () {
|
450 |
-
if (this.fields.validateFields('billing')) {
|
451 |
-
if (this.needs_shipping()) {
|
452 |
-
if ('billing' === this.get_shipping_prefix() || ('shipping' === this.get_shipping_prefix() && this.fields.validateFields('shipping'))) {
|
453 |
-
return true;
|
454 |
-
}
|
455 |
-
} else {
|
456 |
-
return true;
|
457 |
-
}
|
458 |
-
}
|
459 |
-
}
|
460 |
-
|
461 |
-
Klarna.prototype.initialize = function () {
|
462 |
-
if (this.is_gateway_selected() && this.is_active() && !this.source) {
|
463 |
-
// if fields valid create source
|
464 |
-
if (this.klarna_fields_valid()) {
|
465 |
-
this.createSource();
|
466 |
-
}
|
467 |
-
}
|
468 |
-
}
|
469 |
-
|
470 |
-
Klarna.prototype.createSource = function () {
|
471 |
-
// prevents multiple calls to the createSource function
|
472 |
-
// from interfering with eachother
|
473 |
-
if (this.sourceCreated) {
|
474 |
-
return;
|
475 |
-
}
|
476 |
-
this.sourceCreated = true;
|
477 |
-
this.show_loader();
|
478 |
-
this.disable_place_order();
|
479 |
-
this.stripe.createSource(this.getSourceArgs()).then(function (response) {
|
480 |
-
// create payment sections
|
481 |
-
this.hide_loader();
|
482 |
-
if (response.error) {
|
483 |
-
return this.submit_error(response.error.message);
|
484 |
-
}
|
485 |
-
this.source = response.source;
|
486 |
-
this.set_nonce(this.source.id);
|
487 |
-
this.filter_payment_method_categories();
|
488 |
-
this.processConfirmation(this.source);
|
489 |
-
}.bind(this)).catch(function (err) {
|
490 |
-
this.sourceCreated = false;
|
491 |
-
this.enable_place_order();
|
492 |
-
this.hide_loader();
|
493 |
-
this.submit_error(err.message);
|
494 |
-
}.bind(this));
|
495 |
-
}
|
496 |
-
|
497 |
-
Klarna.prototype.getSourceArgs = function () {
|
498 |
-
return $.extend(true, {}, this.get_gateway_data().source_args, (function () {
|
499 |
-
var args = {
|
500 |
-
owner: {
|
501 |
-
name: this.fields.get('billing_first_name') + ' ' + this.fields.get('billing_last_name'),
|
502 |
-
email: this.fields.get('billing_email'),
|
503 |
-
address: {
|
504 |
-
city: this.fields.get('billing_city'),
|
505 |
-
country: this.fields.get('billing_country'),
|
506 |
-
line1: this.fields.get('billing_address_1'),
|
507 |
-
line2: this.fields.get('billing_address_2'),
|
508 |
-
postal_code: this.fields.get('billing_postcode'),
|
509 |
-
state: this.fields.get('billing_state')
|
510 |
-
}
|
511 |
-
},
|
512 |
-
klarna: {
|
513 |
-
purchase_country: this.fields.get('billing_country'),
|
514 |
-
first_name: this.fields.get('billing_first_name'),
|
515 |
-
last_name: this.fields.get('billing_last_name')
|
516 |
-
}
|
517 |
-
}
|
518 |
-
if (this.needs_shipping()) {
|
519 |
-
var prefix = this.get_shipping_prefix();
|
520 |
-
args.klarna.shipping_first_name = this.fields.get('first_name', prefix);
|
521 |
-
args.klarna.shipping_last_name = this.fields.get('last_name', prefix);
|
522 |
-
args.source_order = {
|
523 |
-
shipping: {
|
524 |
-
address: {
|
525 |
-
city: this.fields.get('city', prefix),
|
526 |
-
country: this.fields.get('country', prefix),
|
527 |
-
line1: this.fields.get('address_1', prefix),
|
528 |
-
line2: this.fields.get('address_2', prefix),
|
529 |
-
postal_code: this.fields.get('postcode', prefix),
|
530 |
-
state: this.fields.get('state', prefix)
|
531 |
-
}
|
532 |
-
}
|
533 |
-
}
|
534 |
-
}
|
535 |
-
return args;
|
536 |
-
}.bind(this)()));
|
537 |
-
}
|
538 |
-
|
539 |
-
Klarna.prototype.updated_checkout = function () {
|
540 |
-
LocalPayment.prototype.updated_checkout.apply(this, arguments);
|
541 |
-
if (this.source && this.is_active()) {
|
542 |
-
// update the source
|
543 |
-
this.update_source();
|
544 |
-
|
545 |
-
} else {
|
546 |
-
if (this.is_gateway_selected() && this.is_active() && this.klarna_fields_valid()) {
|
547 |
-
this.createSource();
|
548 |
-
}
|
549 |
-
}
|
550 |
-
}
|
551 |
-
|
552 |
-
Klarna.prototype.update_source = function () {
|
553 |
-
var args = this.get_source_update_args(this.getSourceArgs());
|
554 |
-
this.show_loader();
|
555 |
-
this.disable_place_order();
|
556 |
-
LocalPayment.prototype.update_source.call(this, args).then(function (source) {
|
557 |
-
this.source = source;
|
558 |
-
this.filter_payment_method_categories();
|
559 |
-
this.hide_loader();
|
560 |
-
this.render_ui().then(this.enable_place_order.bind(this));
|
561 |
-
}.bind(this)).catch(this.enable_place_order.bind(this));
|
562 |
-
}
|
563 |
-
|
564 |
-
Klarna.prototype.checkout_error = function () {
|
565 |
-
LocalPayment.prototype.checkout_error.apply(this, arguments);
|
566 |
-
if (this.is_gateway_selected()) {
|
567 |
-
this.createSource();
|
568 |
-
}
|
569 |
-
}
|
570 |
-
|
571 |
-
Klarna.prototype.show_loader = function () {
|
572 |
-
$(this.container).find('.wc-stripe-klarna-loader').remove();
|
573 |
-
$(this.container).find('label[for="payment_method_' + this.gateway_id + '" ]').after(this.params.klarna_loader);
|
574 |
-
}
|
575 |
-
|
576 |
-
Klarna.prototype.hide_loader = function () {
|
577 |
-
$(this.container).find('.wc-stripe-klarna-loader').remove();
|
578 |
-
}
|
579 |
-
|
580 |
-
Klarna.prototype.filter_payment_method_categories = function () {
|
581 |
-
var categories = this.source.klarna.payment_method_categories.split(',');
|
582 |
-
this.source.klarna.payment_method_categories = categories.filter(function (value) {
|
583 |
-
return this.get_gateway_data().payment_sections.indexOf(value) > -1;
|
584 |
-
}.bind(this)).join(',');
|
585 |
-
}
|
586 |
-
|
587 |
-
Klarna.prototype.get_source_update_args = function (args) {
|
588 |
-
function reduce(obj, k) {
|
589 |
-
if (k.indexOf('.') > -1) {
|
590 |
-
var keys = k.split('.');
|
591 |
-
var obj2 = keys.slice(0, keys.length - 1).reduce(function (obj, k) {
|
592 |
-
return obj[k];
|
593 |
-
}, obj);
|
594 |
-
k = keys[keys.length - 1];
|
595 |
-
delete obj2[k];
|
596 |
-
return obj;
|
597 |
-
}
|
598 |
-
delete obj[k];
|
599 |
-
return obj;
|
600 |
-
}
|
601 |
-
|
602 |
-
return ['type', 'currency', 'statement_descriptor', 'redirect', 'klarna.product', 'klarna.locale', 'klarna.custom_payment_methods'].reduce(reduce, args);
|
603 |
-
}
|
604 |
-
|
605 |
-
Klarna.prototype.on_payment_method_selected = function (e, payment_method) {
|
606 |
-
if (payment_method === this.gateway_id) {
|
607 |
-
// only need an email address to create a Klarna source
|
608 |
-
if (!this.source) {
|
609 |
-
if (this.klarna_fields_valid()) {
|
610 |
-
this.createSource();
|
611 |
-
} else {
|
612 |
-
this.submit_error(this.params.messages.required_field);
|
613 |
-
}
|
614 |
-
}
|
615 |
-
wc_stripe.CheckoutGateway.prototype.on_payment_method_selected.apply(this, arguments);
|
616 |
-
}
|
617 |
-
}
|
618 |
-
|
619 |
-
Klarna.prototype.input_change = function () {
|
620 |
-
// if the fields are valid, then create the source if it doesn't exist
|
621 |
-
if (this.is_gateway_selected()) {
|
622 |
-
if (!this.source) {
|
623 |
-
if (this.klarna_fields_valid()) {
|
624 |
-
this.createSource();
|
625 |
-
}
|
626 |
-
} else {
|
627 |
-
this.update_source();
|
628 |
-
}
|
629 |
-
}
|
630 |
-
}
|
631 |
-
|
632 |
Â
WeChat.prototype.updated_checkout = function () {
|
633 |
Â
if (!this.script_loaded && $(this.container).length) {
|
634 |
Â
this.load_external_script(this.params.qr_script);
|
289 |
Â
|
290 |
Â
/****** Klarna ******/
|
291 |
Â
function Klarna(params) {
|
292 |
+
this.confirmation_method = 'confirmKlarnaPayment';
|
293 |
Â
LocalPayment.call(this, params);
|
294 |
+
window.addEventListener('hashchange', this.hashChange.bind(this));
|
Â
|
|
295 |
Â
}
|
296 |
Â
|
297 |
Â
function FPX(params) {
|
337 |
Â
window.addEventListener('hashchange', this.hashChange.bind(this));
|
338 |
Â
}
|
339 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â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
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
340 |
Â
WeChat.prototype.updated_checkout = function () {
|
341 |
Â
if (!this.script_loaded && $(this.container).length) {
|
342 |
Â
this.load_external_script(this.params.qr_script);
|
assets/js/frontend/local-payment.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(r,i){function e(t){i.BaseGateway.call(this,t),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(t){this.elementType="idealBank",this.confirmation_method="confirmIdealPayment",e.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function s(t){this.elementType="p24Bank",this.confirmation_method="confirmP24Payment",e.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function n(t){this.elementType="iban",e.call(this,t)}function o(t){e.call(this,t),r(document.body).on("change",".wc-stripe-klarna-category",this.category_change.bind(this)),r("form.checkout").on("change",".form-row:not(.address-field):not(#account_password_field) .input-text, .form-row:not(.address-field) select",this.input_change.bind(this))}function a(t){this.elementType="fpxBank",this.confirmation_method="confirmFpxPayment",e.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function h(t){e.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function c(t){this.elementType="auBankAccount",this.confirmation_method="confirmAuBecsDebitPayment",e.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function p(t){this.confirmation_method="confirmGrabPayPayment",e.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function _(t){this.confirmation_method="confirmAfterpayClearpayPayment",e.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function l(t){this.confirmation_method="confirmBoletoPayment",e.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function d(t){this.confirmation_method="confirmOxxoPayment",e.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}(e.prototype=r.extend({},i.BaseGateway.prototype,i.CheckoutGateway.prototype)).initialize=function(){this.mount_button()},e.prototype.elementType=null,e.prototype.is_active=function(){return r("#wc_stripe_local_payment_"+this.gateway_id).data("active")},e.prototype.maybe_hide_gateway=function(){this.is_active()?r(this.container).show():r(this.container).hide()},e.prototype.createSource=function(){return new Promise(function(e,t){var i=function(t){t.error?this.submit_error(t.error):(this.payment_token_received=!0,this.set_nonce(t.source.id),this.get_form().submit()),e()}.bind(this);if(null!=this.elementType)if(this.confirmation_method)if(this.confirmation_obj)this.processConfirmation(this.confirmation_obj);else{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(t){this.submit_error(t.message)}.bind(this));else this.payment_token_received=!0,this.get_form().submit()}.bind(this))},e.prototype.place_order=function(t){this.is_gateway_selected()&&(this.payment_token_received||this.is_saved_method_selected()||(t.preventDefault(),this.createSource()))},e.prototype.process_order_pay=function(t){var e;this.is_gateway_selected()&&(t.preventDefault(),(e=this.get_form().serializeArray()).push({name:"_wpnonce",value:this.params.rest_nonce}),e.push({name:"order_id",value:this.params.order_id}),t=window.location.search,this.params.routes.order_pay.match(/\?/)&&(t="&"+t.substr(1)),r.ajax({url:this.params.routes.order_pay+t,method:"POST",dataType:"json",data:r.param(e)}).done(function(t){t.success?window.location.href=t.redirect:this.submit_error(t.message)}.bind(this)).fail(function(t,e,i){this.submit_error(i)}.bind(this)))},e.prototype.show_payment_button=function(){this.show_place_order()},e.prototype.hide_place_order=function(){},e.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"))},e.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}}},e.prototype.updated_checkout=function(){this.mount_button(),this.maybe_hide_gateway()},e.prototype.mount_button=function(){var t="#wc_stripe_local_payment_"+this.gateway_id;r(t).length&&null!=this.elementType&&(r(t).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(t))},e.prototype.handleElementChange=function(t){this.elementEmpty=t.empty},e.prototype.load_external_script=function(t){var e=document.createElement("script");e.type="text/javascript",e.src=t,e.onload=function(){this.script_loaded=!0}.bind(this),document.body.appendChild(e)},e.prototype.hashChange=function(t){!this.is_gateway_selected()||(t=t.newURL.match(/response=(.*)/))&&(history.pushState({},"",window.location.pathname),t=JSON.parse(window.atob(decodeURIComponent(t[1]))),this.processConfirmation(t))},e.prototype.processConfirmation=function(e){this.stripe[this.confirmation_method](e.client_secret,this.get_confirmation_args(e)).then(function(t){if(t.error)return this.confirmation_obj=e,this.payment_token_received=!1,this.submit_error(t.error.message);window.location.href=decodeURI(e.order_received_url)}.bind(this))},e.prototype.get_confirmation_args=function(t){t={payment_method:{billing_details:this.get_billing_details()},return_url:t.return_url};return this.elementType&&(t.payment_method[this.params.local_payment_type]=this.element),t},e.prototype.isValidElement=function(){return!this.element||!this.elementEmpty},e.prototype.delete_order_source=function(){return new Promise(function(e,t){r.ajax({url:this.params.routes.delete_order_source,method:"DELETE",dataType:"json",beforeSend:this.ajax_before_send.bind(this)}).done(function(t){e(t)}.bind(this)).fail(function(){t()}.bind(this))}.bind(this))},e.prototype.update_source=function(i){return new Promise(function(e,t){this.updateSourceXhr&&this.updateSourceXhr.abort(),this.updateSourceXhr=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(t){e(t.source)}.bind(this)).fail(function(){t()})}.bind(this))},o.prototype.disable_place_order=function(){r("#place_order").prop("disabled",!0)},o.prototype.enable_place_order=function(){r("#place_order").prop("disabled",!1)},o.prototype.category_change=function(t){var e=function(){r('[id^="klarna-instance-"]').slideUp();var t=r('[name="klarna_category"]:checked').val();r("#klarna-instance-"+t).slideDown()}.bind(this);t.originalEvent?e():(clearTimeout(this.categoryChangeTimer),this.categoryChangeTimer=setTimeout(e,500))},o.prototype.processConfirmation=function(t){window.Klarna.Payments.init({client_token:t.klarna.client_token},function(t){}.bind(this)),this.payment_categories=t.klarna.payment_method_categories.split(","),this.render_ui(!0).then(function(){this.enable_place_order()}.bind(this))},o.prototype.hashchange=function(){this.is_gateway_selected()&&(history.pushState({},"",window.location.pathname),this.get_form().removeClass("processing"),this.get_form().submit())},o.prototype.render_ui=function(a){return new Promise(function(t){if(0<this.payment_categories.length){this.disable_place_order();var e=[];r("#wc_stripe_local_payment_stripe_klarna").show();for(var i=0;i<this.payment_categories.length;i++){var s,n="#klarna-instance-"+this.payment_categories[i];if(r(n).empty(),r("#klarna-category-"+this.payment_categories[i]).length){this.params.translate&&(s=this.source.klarna[this.payment_categories[i]+"_name"],r('label[for="klarna_'+this.payment_categories[i]+'"').text(s)),r("#klarna-category-"+this.payment_categories[i]).show();try{e.push(new Promise(function(e){window.Klarna.Payments.load({container:n,payment_method_category:this.payment_categories[i],instance_id:"klarna-instance-"+this.payment_categories[i]},function(t){e()}.bind(this))}.bind(this)))}catch(o){window.alert(o),t()}}}Promise.all(e).then(function(){t()}),a&&r('[id^="klarna-category-"]:visible [name="klarna_category"]').first().prop("checked",!0).trigger("change")}else t()}.bind(this))},o.prototype.place_order=function(t){this.is_gateway_selected()&&(t.preventDefault(),this.checkout_fields_valid()&&window.Klarna.Payments.authorize({instance_id:"klarna-instance-"+r('[name="klarna_category"]:checked').val()},function(t){t.approved?(this.set_nonce(this.source.id),this.payment_token_received=!0,this.get_form().submit()):t.error?this.submit_error(t.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(){this.sourceCreated||(this.sourceCreated=!0,this.show_loader(),this.disable_place_order(),this.stripe.createSource(this.getSourceArgs()).then(function(t){if(this.hide_loader(),t.error)return this.submit_error(t.error.message);this.source=t.source,this.set_nonce(this.source.id),this.filter_payment_method_categories(),this.processConfirmation(this.source)}.bind(this))["catch"](function(t){this.sourceCreated=!1,this.enable_place_order(),this.hide_loader(),this.submit_error(t.message)}.bind(this)))},o.prototype.getSourceArgs=function(){return r.extend(!0,{},this.get_gateway_data().source_args,function(){var t,e={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()&&(t=this.get_shipping_prefix(),e.klarna.shipping_first_name=this.fields.get("first_name",t),e.klarna.shipping_last_name=this.fields.get("last_name",t),e.source_order={shipping:{address:{city:this.fields.get("city",t),country:this.fields.get("country",t),line1:this.fields.get("address_1",t),line2:this.fields.get("address_2",t),postal_code:this.fields.get("postcode",t),state:this.fields.get("state",t)}}}),e}.bind(this)())},o.prototype.updated_checkout=function(){e.prototype.updated_checkout.apply(this,arguments),this.source&&this.is_active()?this.update_source():this.is_gateway_selected()&&this.is_active()&&this.klarna_fields_valid()&&this.createSource()},o.prototype.update_source=function(){var t=this.get_source_update_args(this.getSourceArgs());this.show_loader(),this.disable_place_order(),e.prototype.update_source.call(this,t).then(function(t){this.source=t,this.filter_payment_method_categories(),this.hide_loader(),this.render_ui().then(this.enable_place_order.bind(this))}.bind(this))["catch"](this.enable_place_order.bind(this))},o.prototype.checkout_error=function(){e.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 t=this.source.klarna.payment_method_categories.split(",");this.source.klarna.payment_method_categories=t.filter(function(t){return-1<this.get_gateway_data().payment_sections.indexOf(t)}.bind(this)).join(",")},o.prototype.get_source_update_args=function(t){return["type","currency","statement_descriptor","redirect","klarna.product","klarna.locale","klarna.custom_payment_methods"].reduce(function(t,e){if(-1<e.indexOf(".")){var i=e.split(".");return delete i.slice(0,i.length-1).reduce(function(t,e){return t[e]},t)[e=i[i.length-1]],t}return delete t[e],t},t)},o.prototype.on_payment_method_selected=function(t,e){e===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),e.prototype.updated_checkout.apply(this,arguments)},h.prototype.hashChange=function(t){!this.is_gateway_selected()||(t=t.newURL.match(/qrcode=(.*)/))&&(history.pushState({},"",window.location.pathname),this.qrcode=JSON.parse(window.atob(decodeURIComponent(t[1]))),this.get_form().unblock().removeClass("processing").addClass("wechat"),new QRCode("wc_stripe_local_payment_stripe_wechat",{text:this.qrcode.code,width:parseInt(this.params.qr_size),height:parseInt(this.params.qr_size),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:e.prototype.place_order.apply(this,arguments)},n.prototype.getSourceArgs=function(){var t=r.extend({},e.prototype.getSourceArgs.apply(this,arguments),{mandate:{notification_method:"email",interval:this.cart_contains_subscription()||this.is_change_payment_method()?"scheduled":"one_time"}});return"scheduled"===t.mandate.interval&&delete t.amount,t},_.prototype.updated_checkout=function(){this.maybe_hide_gateway(),this.add_eligibility(this.container,parseFloat(this.get_total_price())),this.msgElement&&r(this.container).length&&(this.elements=this.stripe.elements(this.get_element_options()),this.initialize_messaging())},_.prototype.initialize=function(){this.add_eligibility(this.container,parseFloat(this.get_total_price())),this.initialize_messaging()},_.prototype.initialize_messaging=function(){this.msgElement=this.elements.create("afterpayClearpayMessage",r.extend({},this.params.msg_options,{amount:this.get_total_price_cents(),currency:this.get_currency()})),this.mount_message()},_.prototype.mount_message=function(t){t&&this.msgElement.update({amount:this.get_total_price_cents(),currency:this.get_currency()}),r('label[for="payment_method_stripe_afterpay"]').find("#wc-stripe-afterpay-msg").length||r('label[for="payment_method_stripe_afterpay"]').append('<div id="wc-stripe-afterpay-msg"></div>'),this.msgElement.mount("#wc-stripe-afterpay-msg")},_.prototype.get_element_options=function(){var t=this.params.locale;return"GB"==this.fields.get("billing_country")&&["fr-FR","it-IT","es-ES"].indexOf(t)<0?t="en-GB":this.params.supported_locales.indexOf(this.params.locale)<0&&(t="auto"),{locale:t}},_.prototype.add_eligibility=function(t,e){i.Afterpay.prototype.add_eligibility.apply(this,arguments),this.is_eligible(e)||r(this.container).find(".wc-stripe-afterpay__offsite").addClass("afterpay-ineligible")},l.prototype.get_confirmation_args=function(t){t=e.prototype.get_confirmation_args.call(this,t);return t.payment_method.boleto={tax_id:this.get_tax_id()},t},l.prototype.createSource=function(){var t=this.get_tax_id();if(!t||!t.match(/^(\w{3}\.){2}\w{3}-\w{2}$|^(\w{11}|\w{14})$|^\w{2}\.\w{3}\.\w{3}\/\w{4}-\w{2}$/))return this.submit_error({code:"incomplete_boleto_tax_id"});this.payment_token_received=!0,this.get_form().submit()},l.prototype.get_tax_id=function(){return r("#wc_stripe_boleto_tax_id").val()},t.prototype=r.extend({},e.prototype,t.prototype),s.prototype=r.extend({},e.prototype,s.prototype),n.prototype=r.extend({},e.prototype,n.prototype),o.prototype=r.extend({},e.prototype,o.prototype),a.prototype=r.extend({},e.prototype,a.prototype),h.prototype=r.extend({},e.prototype,h.prototype),c.prototype=r.extend({},e.prototype,c.prototype),p.prototype=r.extend({},e.prototype,p.prototype),_.prototype=r.extend({},e.prototype,i.Afterpay.prototype,_.prototype),l.prototype=r.extend({},e.prototype,l.prototype),d.prototype=r.extend({},e.prototype,d.prototype);var m,u={ideal:t,p24:s,sepa_debit:n,klarna:o,fpx:a,wechat:h,au_becs_debit:c,grabpay:p,afterpay_clearpay:_,boleto:l,oxxo:d};for(m in wc_stripe_local_payment_params.gateways){var y=wc_stripe_local_payment_params.gateways[m];new(u[y.local_payment_type]||e)(y)}}(jQuery,window.wc_stripe);
|
1 |
+
!function(o,i){function e(t){i.BaseGateway.call(this,t),i.CheckoutGateway.call(this),o(document.body).on("click","#place_order",this.place_order.bind(this)),this.is_current_page("order_pay")&&o("#order_review").on("submit",this.process_order_pay.bind(this)),this.maybe_hide_gateway()}function t(t){this.elementType="idealBank",this.confirmation_method="confirmIdealPayment",e.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function n(t){this.elementType="p24Bank",this.confirmation_method="confirmP24Payment",e.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function a(t){this.elementType="iban",e.call(this,t)}function r(t){this.confirmation_method="confirmKlarnaPayment",e.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function s(t){this.elementType="fpxBank",this.confirmation_method="confirmFpxPayment",e.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function p(t){e.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function h(t){this.elementType="auBankAccount",this.confirmation_method="confirmAuBecsDebitPayment",e.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function c(t){this.confirmation_method="confirmGrabPayPayment",e.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function d(t){this.confirmation_method="confirmAfterpayClearpayPayment",e.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function _(t){this.confirmation_method="confirmBoletoPayment",e.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function l(t){this.confirmation_method="confirmOxxoPayment",e.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}(e.prototype=o.extend({},i.BaseGateway.prototype,i.CheckoutGateway.prototype)).initialize=function(){this.mount_button()},e.prototype.elementType=null,e.prototype.is_active=function(){return o("#wc_stripe_local_payment_"+this.gateway_id).data("active")},e.prototype.maybe_hide_gateway=function(){this.is_active()?o(this.container).show():o(this.container).hide()},e.prototype.createSource=function(){return new Promise(function(e,t){var i=function(t){t.error?this.submit_error(t.error):(this.payment_token_received=!0,this.set_nonce(t.source.id),this.get_form().submit()),e()}.bind(this);if(null!=this.elementType)if(this.confirmation_method)if(this.confirmation_obj)this.processConfirmation(this.confirmation_obj);else{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(t){this.submit_error(t.message)}.bind(this));else this.payment_token_received=!0,this.get_form().submit()}.bind(this))},e.prototype.place_order=function(t){this.is_gateway_selected()&&(this.payment_token_received||this.is_saved_method_selected()||(t.preventDefault(),this.createSource()))},e.prototype.process_order_pay=function(t){var e;this.is_gateway_selected()&&(t.preventDefault(),(e=this.get_form().serializeArray()).push({name:"_wpnonce",value:this.params.rest_nonce}),e.push({name:"order_id",value:this.params.order_id}),t=window.location.search,this.params.routes.order_pay.match(/\?/)&&(t="&"+t.substr(1)),o.ajax({url:this.params.routes.order_pay+t,method:"POST",dataType:"json",data:o.param(e)}).done(function(t){t.success?window.location.href=t.redirect:this.submit_error(t.message)}.bind(this)).fail(function(t,e,i){this.submit_error(i)}.bind(this)))},e.prototype.show_payment_button=function(){this.show_place_order()},e.prototype.hide_place_order=function(){},e.prototype.show_place_order=function(){i.CheckoutGateway.prototype.show_place_order.apply(this,arguments),this.payment_token_received&&o("#place_order").text(o("#place_order").data("value"))},e.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}}},e.prototype.updated_checkout=function(){this.mount_button(),this.maybe_hide_gateway()},e.prototype.mount_button=function(){var t="#wc_stripe_local_payment_"+this.gateway_id;o(t).length&&null!=this.elementType&&(o(t).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(t))},e.prototype.handleElementChange=function(t){this.elementEmpty=t.empty},e.prototype.load_external_script=function(t){var e=document.createElement("script");e.type="text/javascript",e.src=t,e.onload=function(){this.script_loaded=!0}.bind(this),document.body.appendChild(e)},e.prototype.hashChange=function(t){!this.is_gateway_selected()||(t=t.newURL.match(/response=(.*)/))&&(history.pushState({},"",window.location.pathname),t=JSON.parse(window.atob(decodeURIComponent(t[1]))),this.processConfirmation(t))},e.prototype.processConfirmation=function(e){this.stripe[this.confirmation_method](e.client_secret,this.get_confirmation_args(e)).then(function(t){if(t.error)return this.confirmation_obj=e,this.payment_token_received=!1,this.submit_error(t.error.message);window.location.href=decodeURI(e.order_received_url)}.bind(this))},e.prototype.get_confirmation_args=function(t){t={payment_method:{billing_details:this.get_billing_details()},return_url:t.return_url};return this.elementType&&(t.payment_method[this.params.local_payment_type]=this.element),t},e.prototype.isValidElement=function(){return!this.element||!this.elementEmpty},e.prototype.delete_order_source=function(){return new Promise(function(e,t){o.ajax({url:this.params.routes.delete_order_source,method:"DELETE",dataType:"json",beforeSend:this.ajax_before_send.bind(this)}).done(function(t){e(t)}.bind(this)).fail(function(){t()}.bind(this))}.bind(this))},e.prototype.update_source=function(i){return new Promise(function(e,t){this.updateSourceXhr&&this.updateSourceXhr.abort(),this.updateSourceXhr=o.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(t){e(t.source)}.bind(this)).fail(function(){t()})}.bind(this))},p.prototype.updated_checkout=function(){!this.script_loaded&&o(this.container).length&&this.load_external_script(this.params.qr_script),e.prototype.updated_checkout.apply(this,arguments)},p.prototype.hashChange=function(t){!this.is_gateway_selected()||(t=t.newURL.match(/qrcode=(.*)/))&&(history.pushState({},"",window.location.pathname),this.qrcode=JSON.parse(window.atob(decodeURIComponent(t[1]))),this.get_form().unblock().removeClass("processing").addClass("wechat"),new QRCode("wc_stripe_local_payment_stripe_wechat",{text:this.qrcode.code,width:parseInt(this.params.qr_size),height:parseInt(this.params.qr_size),colorDark:"#424770",colorLight:"#f8fbfd",correctLevel:QRCode.CorrectLevel.H}),o("#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())},p.prototype.place_order=function(){this.get_form().is(".wechat")?window.location=this.qrcode.redirect:e.prototype.place_order.apply(this,arguments)},a.prototype.getSourceArgs=function(){var t=o.extend({},e.prototype.getSourceArgs.apply(this,arguments),{mandate:{notification_method:"email",interval:this.cart_contains_subscription()||this.is_change_payment_method()?"scheduled":"one_time"}});return"scheduled"===t.mandate.interval&&delete t.amount,t},d.prototype.updated_checkout=function(){this.maybe_hide_gateway(),this.add_eligibility(this.container,parseFloat(this.get_total_price())),this.msgElement&&o(this.container).length&&(this.elements=this.stripe.elements(this.get_element_options()),this.initialize_messaging())},d.prototype.initialize=function(){this.add_eligibility(this.container,parseFloat(this.get_total_price())),this.initialize_messaging()},d.prototype.initialize_messaging=function(){this.msgElement=this.elements.create("afterpayClearpayMessage",o.extend({},this.params.msg_options,{amount:this.get_total_price_cents(),currency:this.get_currency()})),this.mount_message()},d.prototype.mount_message=function(t){t&&this.msgElement.update({amount:this.get_total_price_cents(),currency:this.get_currency()}),o('label[for="payment_method_stripe_afterpay"]').find("#wc-stripe-afterpay-msg").length||o('label[for="payment_method_stripe_afterpay"]').append('<div id="wc-stripe-afterpay-msg"></div>'),this.msgElement.mount("#wc-stripe-afterpay-msg")},d.prototype.get_element_options=function(){var t=this.params.locale;return"GB"==this.fields.get("billing_country")&&["fr-FR","it-IT","es-ES"].indexOf(t)<0?t="en-GB":this.params.supported_locales.indexOf(this.params.locale)<0&&(t="auto"),{locale:t}},d.prototype.add_eligibility=function(t,e){i.Afterpay.prototype.add_eligibility.apply(this,arguments),this.is_eligible(e)||o(this.container).find(".wc-stripe-afterpay__offsite").addClass("afterpay-ineligible")},_.prototype.get_confirmation_args=function(t){t=e.prototype.get_confirmation_args.call(this,t);return t.payment_method.boleto={tax_id:this.get_tax_id()},t},_.prototype.createSource=function(){var t=this.get_tax_id();if(!t||!t.match(/^(\w{3}\.){2}\w{3}-\w{2}$|^(\w{11}|\w{14})$|^\w{2}\.\w{3}\.\w{3}\/\w{4}-\w{2}$/))return this.submit_error({code:"incomplete_boleto_tax_id"});this.payment_token_received=!0,this.get_form().submit()},_.prototype.get_tax_id=function(){return o("#wc_stripe_boleto_tax_id").val()},t.prototype=o.extend({},e.prototype,t.prototype),n.prototype=o.extend({},e.prototype,n.prototype),a.prototype=o.extend({},e.prototype,a.prototype),r.prototype=o.extend({},e.prototype,r.prototype),s.prototype=o.extend({},e.prototype,s.prototype),p.prototype=o.extend({},e.prototype,p.prototype),h.prototype=o.extend({},e.prototype,h.prototype),c.prototype=o.extend({},e.prototype,c.prototype),d.prototype=o.extend({},e.prototype,i.Afterpay.prototype,d.prototype),_.prototype=o.extend({},e.prototype,_.prototype),l.prototype=o.extend({},e.prototype,l.prototype);var m,y={ideal:t,p24:n,sepa_debit:a,klarna:r,fpx:s,wechat:p,au_becs_debit:h,grabpay:c,afterpay_clearpay:d,boleto:_,oxxo:l};for(m in wc_stripe_local_payment_params.gateways){var u=wc_stripe_local_payment_params.gateways[m];new(y[u.local_payment_type]||e)(u)}}(jQuery,window.wc_stripe);
|
assets/js/frontend/wc-stripe.js
CHANGED
@@ -1541,8 +1541,9 @@
|
|
1541 |
Â
|
1542 |
Â
wc_stripe.PaymentRequest.prototype.canMakePayment = function () {
|
1543 |
Â
return new Promise(function (resolve) {
|
Â
|
|
1544 |
Â
this.paymentRequest.canMakePayment().then(function (result) {
|
1545 |
-
if (result && !result.applePay) {
|
1546 |
Â
this.can_pay = true;
|
1547 |
Â
this.create_button();
|
1548 |
Â
$(this.container).show();
|
1541 |
Â
|
1542 |
Â
wc_stripe.PaymentRequest.prototype.canMakePayment = function () {
|
1543 |
Â
return new Promise(function (resolve) {
|
1544 |
+
var paymentRequest = this.paymentRequest;
|
1545 |
Â
this.paymentRequest.canMakePayment().then(function (result) {
|
1546 |
+
if (result && !result.applePay && paymentRequest === this.paymentRequest) {
|
1547 |
Â
this.can_pay = true;
|
1548 |
Â
this.create_button();
|
1549 |
Â
$(this.container).show();
|
assets/js/frontend/wc-stripe.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(a,o){a.wc_stripe={};var i=null;"undefined"==typeof wc_stripe_checkout_fields&&(a.wc_stripe_checkout_fields=[]),wc_stripe.BaseGateway=function(t,e){this.params=t,this.gateway_id=this.params.gateway_id,this.container=void 0===e?"li.payment_method_".concat(this.gateway_id):e,o(this.container).length||(this.container=".payment_method_".concat(this.gateway_id)),this.token_selector=this.params.token_selector,this.saved_method_selector=this.params.saved_method_selector,this.payment_token_received=!1,this.stripe=i,this.fields=r,this.elements=i.elements(o.extend({},{locale:"auto"},this.get_element_options())),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.set_intent=function(t){this.fields.set(this.gateway_id+"_payment_intent_key",t),o("#"+this.gateway_id+"_payment_intent_key").val(t)},wc_stripe.BaseGateway.prototype.get_element_options=function(){return this.params.elementOptions},wc_stripe.BaseGateway.prototype.initialize=function(){},wc_stripe.BaseGateway.prototype.create_button=function(){},wc_stripe.BaseGateway.prototype.is_gateway_selected=function(){return o('[name="payment_method"]:checked').val()===this.gateway_id},wc_stripe.BaseGateway.prototype.is_saved_method_selected=function(){return this.is_gateway_selected()&&"saved"===o('[name="'+this.gateway_id+'_payment_type_key"]:checked').val()},wc_stripe.BaseGateway.prototype.has_checkout_error=function(){return 0<o("#wc_stripe_checkout_error").length&&this.is_gateway_selected()},wc_stripe.BaseGateway.prototype.submit_error=function(t){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=t.code&&wc_stripe_messages[t.code]?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"),this.fields.exists("shipping_phone")&&this.fields.isEmpty("shipping_phone")&&this.fields.set("shipping_phone",t.payerPhone)),t.shippingAddress&&this.populate_shipping_fields(t.shippingAddress),t.paymentMethod.billing_details.address&&this.populate_billing_fields(t.paymentMethod.billing_details.address)},wc_stripe.BaseGateway.prototype.populate_address_fields=function(t,e){for(var i in t)null!==t[i]&&this.fields.set(i,t[i],e)},wc_stripe.BaseGateway.prototype.populate_billing_fields=function(t){this.populate_address_fields(t,"billing")},wc_stripe.BaseGateway.prototype.populate_shipping_fields=function(t){this.populate_address_fields(t,"shipping")},wc_stripe.BaseGateway.prototype.get_address_fields=function(){return["first_name","last_name","country","address_1","address_2","city","state","postcode","phone","email"]},wc_stripe.BaseGateway.prototype.get_address_object=function(e){var i={};return this.get_address_fields().forEach(function(t){i[t]=this.fields.get(t,e)}.bind(this)),i},wc_stripe.BaseGateway.prototype.is_current_page=function(t){return Array.isArray(t)?-1<t.indexOf(this.get_page()):this.get_page()===t},wc_stripe.BaseGateway.prototype.is_valid_address=function(t,e,i){if(o.isEmptyObject(t))return!1;var s=this.get_address_fields();void 0!==i&&i.forEach(function(t){-1<s.indexOf(t)&&s.splice(s.indexOf(t),1)});for(var a=0;a<s.length;a++){var n=s[a];if(this.fields.required(e+"_"+n)&&(!t[n]||"undefined"==typeof t[n]||!this.fields.isValid(n,t[n],t)))return!1}return!0},wc_stripe.BaseGateway.prototype.ajax_before_send=function(t){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(t,e){o.ajax({method:"POST",url:this.params.routes.checkout_payment,dataType:"json",data:o.extend({},this.fields.toJson(),{order_id:t,order_key:e}),beforeSend:this.ajax_before_send.bind(this)}).done(function(t){if(t.result&&"success"===t.result)a.location=t.redirect;else{if(t.reload)return a.location.reload();t.messages?(this.payment_token_received=!1,this.submit_error(t.messages)):this.submit_error(wc_checkout_params.i18n_checkout_error)}}.bind(this)).fail(function(){}.bind(this))},wc_stripe.BaseGateway.prototype.handle_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(e.order_id,e.order_key)}.bind(this))["catch"](function(t){this.submit_error(t.message)}.bind(this)),!1}catch(t){}},wc_stripe.BaseGateway.prototype.handle_card_setup=function(e){try{return this.stripe.confirmCardSetup(e.client_secret).then(function(t){if(t.error)return this.payment_token_received=!1,this.submit_error(t.error);this.is_current_page("order_pay")?this.get_form().submit():this.process_payment(e.order_id,e.order_key)}.bind(this))["catch"](function(t){this.submit_error(t.message)}.bind(this)),!1}catch(t){}},wc_stripe.BaseGateway.prototype.hashchange=function(t){var e=t.newURL.match(/response=(.*)/);if(e)try{var i=JSON.parse(a.atob(decodeURIComponent(e[1])));i&&i.hasOwnProperty("client_secret")&&i.gateway_id===this.gateway_id&&(history.pushState({},"",a.location.pathname),"intent"===i.type?this.handle_card_action(i):this.handle_card_setup(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("checkout_error",this.checkout_error.bind(this)),o(this.token_selector).closest("form").on("checkout_place_order_"+this.gateway_id,this.checkout_place_order.bind(this)),o(document.body).on("wc_stripe_new_method_"+this.gateway_id,this.on_show_new_methods.bind(this)),o(document.body).on("wc_stripe_saved_method_"+this.gateway_id,this.on_show_saved_methods.bind(this)),o(document.body).on("wc_stripe_payment_method_selected",this.on_payment_method_selected.bind(this)),this.banner_enabled()&&o(".woocommerce-billing-fields").length&&o(".wc-stripe-banner-checkout").css("max-width",o(".woocommerce-billing-fields").outerWidth(!0)),this.container_styles(),this.hasOrderReviewParams()},wc_stripe.CheckoutGateway.prototype.container_styles=function(){this.params.description||o(this.container).addClass("wc-stripe-no-desc"),o(this.container).find(".wc-stripe-saved-methods").length||o(this.container).find(".payment_box").addClass("wc-stripe-no-methods")},wc_stripe.CheckoutGateway.prototype.hasOrderReviewParams=function(){var t=a.location.search.match(/_stripe_order_review=(.+)/);if(t&&1<t.length)try{var e=JSON.parse(a.atob(decodeURIComponent(t[1])));this.gateway_id===e.payment_method&&(o(function(){this.payment_token_received=!0,this.set_nonce(e.payment_nonce),this.set_use_new_option(!0)}.bind(this)),history.pushState({},"",a.location.pathname))}catch(i){}},wc_stripe.CheckoutGateway.prototype.has3DSecureParams=function(){if((this.is_current_page("order_pay")||this.is_change_payment_method())&&a.location.hash&&"string"==typeof a.location.hash){var t=a.location.hash.match(/response=(.*)/);if(t)try{var e=JSON.parse(a.atob(decodeURIComponent(t[1])));e&&e.hasOwnProperty("client_secret")&&e.gateway_id===this.gateway_id&&(o(function(){this.set_payment_method(this.gateway_id),this.set_use_new_option(!0),this.set_nonce(e.pm),!0===e.save_method&&this.set_save_payment_method(!0),o('[name="terms"]').prop("checked",!0)}.bind(this)),history.pushState({},"",a.location.pathname+a.location.search),this.handle_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(":visible")&&!o('[name="terms"]').is(":checked"))},wc_stripe.CheckoutGateway.prototype.get_payment_method=function(){return o('[name="payment_method"]:checked').val()},wc_stripe.CheckoutGateway.prototype.set_use_new_option=function(t){o("#"+this.gateway_id+"_use_new").prop("checked",t).trigger("change")},wc_stripe.CheckoutGateway.prototype.checkout_place_order=function(){return this.is_valid_checkout()?!!this.is_saved_method_selected()||this.payment_token_received:(this.submit_error(this.params.messages.terms),!1)},wc_stripe.CheckoutGateway.prototype.on_token_received=function(t){this.payment_token_received=!0,this.set_nonce(t.id),this.hide_payment_button(),this.show_place_order()},wc_stripe.CheckoutGateway.prototype.block=function(){o().block&&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&&e.indexOf("stripe_")<0&&this.show_place_order())},wc_stripe.CheckoutGateway.prototype.banner_enabled=function(){return"1"===this.params.banner_enabled},wc_stripe.CheckoutGateway.prototype.checkout_fields_valid=function(){if(["checkout","order_pay"].indexOf(this.get_page())<0)return!0;var t=!0;return(t=this.fields.validateFields("billing"))?this.needs_shipping()&&o("#ship-to-different-address-checkbox").is(":checked")?(t=this.fields.validateFields("shipping"))||this.submit_error(this.params.messages.required_field):(t=this.is_valid_checkout())||this.submit_error(this.params.messages.terms):this.submit_error(this.params.messages.required_field),t},wc_stripe.CheckoutGateway.prototype.cart_contains_subscription=function(){return"undefined"!=typeof wc_stripe_cart_contains_subscription&&!0===wc_stripe_cart_contains_subscription},wc_stripe.CheckoutGateway.prototype.set_save_payment_method=function(t){o('[name="'+this.gateway_id+'_save_source_key"]').prop("checked",t)},wc_stripe.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(){var t=o('input[name="variation_id"]').val();return!!t&&"0"!=t},wc_stripe.ProductGateway.prototype.get_product_data=function(){return this.get_gateway_data().product},wc_stripe.ProductGateway.prototype.set_product_data=function(t){var e=this.get_gateway_data();e.product=t,this.set_gateway_data(e)},wc_stripe.ProductGateway.prototype.get_form=function(){return o(this.container).closest("form")},wc_stripe.ProductGateway.prototype.add_to_cart=function(){return new Promise(function(e,i){this.block();var t={product_id:this.get_product_data().id,variation_id:this.is_variable_product()?o('[name="variation_id"]').val():0,qty:o('[name="quantity"]').val(),payment_method:this.gateway_id,currency:this.get_currency(),page_id:this.get_page()},s=this.get_form().find(':not([name="add-to-cart"],[name="quantity"],[name^="attribute_"],[name="variation_id"])').serializeArray();if(s)for(var a in s)t[s[a].name]=s[a].value;o.ajax({url:this.params.routes.add_to_cart,method:"POST",dataType:"json",data:o.extend({},t,this.get_product_variations()),beforeSend:this.ajax_before_send.bind(this)}).done(function(t){this.unblock(),t.code?(this.submit_error(t.message),i(t)):(this.set_total_price(t.data.total),this.set_total_price_cents(t.data.totalCents),this.set_display_items(t.data.displayItems),e(t.data))}.bind(this)).fail(function(t,e,i){this.unblock(),this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.ProductGateway.prototype.cart_calculation=function(t){return new Promise(function(e,i){o.ajax({url:this.params.routes.cart_calculation,method:"POST",dataType:"json",data:o.extend({},{product_id:this.get_product_data().id,variation_id:this.is_variable_product()&&t?t:0,qty:o('[name="quantity"]').val(),currency:this.get_currency(),payment_method:this.gateway_id},this.get_product_variations()),beforeSend:this.ajax_before_send.bind(this)}).done(function(t){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.ProductGateway.prototype.get_product_variations=function(){var s={};return this.is_variable_product()&&o('.variations [name^="attribute_"]').each(function(t,e){var i=o(e),e=i.data("attribute_name")||i.attr("name");s[e]=i.val()}),s},wc_stripe.CartGateway=function(){this.message_container="div.woocommerce",o(document.body).on("updated_wc_div",this.updated_html.bind(this)),o(document.body).on("updated_cart_totals",this.updated_html.bind(this)),o(document.body).on("wc_cart_emptied",this.cart_emptied.bind(this))},wc_stripe.CartGateway.prototype.submit_error=function(t){this.submit_message(this.get_error_message(t))},wc_stripe.CartGateway.prototype.updated_html=function(t){},wc_stripe.CartGateway.prototype.cart_emptied=function(t){},wc_stripe.CartGateway.prototype.add_cart_totals_class=function(){o(".cart_totals").addClass("stripe_cart_gateway_active")},wc_stripe.GooglePay=function(){};var s={apiVersion:2,apiVersionMinor:0},n={type:"CARD",parameters:{allowedAuthMethods:["PAN_ONLY"],allowedCardNetworks:["AMEX","DISCOVER","INTERAC","JCB","MASTERCARD","VISA"],assuranceDetailsRequired:!0}};wc_stripe.GooglePay.prototype.update_addresses=function(t){var e;t.paymentMethodData.info.billingAddress&&(e=t.paymentMethodData.info.billingAddress,this.is_current_page("checkout")&&this.is_valid_address(this.billing_address_object,"billing",["phone","email"])&&(e={phoneNumber:e.phoneNumber}),this.populate_billing_fields(e),e.phoneNumber&&this.fields.exists("shipping_phone")&&this.fields.isEmpty("shipping_phone")&&this.fields.set("shipping_phone",e.phoneNumber)),t.shippingAddress&&this.populate_shipping_fields(t.shippingAddress),t.email&&this.fields.set("email",t.email,"billing")},wc_stripe.GooglePay.prototype.map_address=function(t){return{city:t.locality,postcode:t.postalCode,state:t.administrativeArea,country:t.countryCode}},wc_stripe.GooglePay.prototype.update_payment_data=function(s){return new Promise(function(e,i){var t="default"==s.shippingOptionData.id?null:s.shippingOptionData.id;o.when(o.ajax({url:this.params.routes.payment_data,dataType:"json",method:"POST",data:{address:this.map_address(s.shippingAddress),shipping_method:t,page_id:this.get_page(),currency:this.get_currency()},beforeSend:this.ajax_before_send.bind(this)})).done(function(t){t.code?i(t.data.data):e(t.data)}.bind(this)).fail(function(){i()}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.on_payment_data_changed=function(i){return new Promise(function(e){this.update_payment_data(i).then(function(t){e(t.paymentRequestUpdate),this.set_selected_shipping_methods(t.shipping_methods),this.payment_data_updated(t,i)}.bind(this))["catch"](function(t){e(t)}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.payment_data_updated=function(t){},wc_stripe.GooglePay.prototype.get_merchant_info=function(){var t={merchantId:this.params.merchant_id,merchantName:this.params.merchant_name};return"TEST"===this.params.environment&&delete t.merchantId,t},wc_stripe.GooglePay.prototype.get_payment_options=function(){var t,e={environment:this.params.environment,merchantInfo:this.get_merchant_info(),paymentDataCallbacks:{onPaymentAuthorized:function(){return new Promise(function(t){t({transactionState:"SUCCESS"})}.bind(this))}}};return this.needs_shipping()&&(t=this.get_shipping_prefix(),(!this.is_current_page("checkout")||this.is_valid_address(this.get_address_object(t),t,["email","phone"]))&&this.is_current_page("checkout")||(e.paymentDataCallbacks.onPaymentDataChanged=this.on_payment_data_changed.bind(this))),e},wc_stripe.GooglePay.prototype.build_payment_request=function(){var t=o.extend({},s,{emailRequired:this.fields.requestFieldInWallet("billing_email"),merchantInfo:this.get_merchant_info(),allowedPaymentMethods:[o.extend({type:"CARD",tokenizationSpecification:{type:"PAYMENT_GATEWAY",parameters:{gateway:"stripe","stripe:version":"2018-10-31","stripe:publishableKey":this.params.api_key}}},n)],shippingAddressRequired:function(){if(this.needs_shipping()){var t=this.get_shipping_prefix();if(this.is_current_page("checkout")&&!this.is_valid_address(this.get_address_object(t),t,["email","phone"])||!this.is_current_page("checkout"))return!0}return!1}.bind(this)(),transactionInfo:{countryCode:this.params.processing_country,currencyCode:this.get_currency(),totalPriceStatus:"ESTIMATED",totalPrice:this.get_total_price().toString(),displayItems:this.get_display_items(),totalPriceLabel:this.params.total_price_label}});return t.allowedPaymentMethods[0].parameters.billingAddressRequired=function(){if(this.is_current_page("checkout")){var t=this.billing_address_object=this.get_address_object("billing");return this.fields.requestFieldInWallet("billing_phone")||!this.is_valid_address(t,"billing",["email"])?!0:!1}return!0}.bind(this)(),t.allowedPaymentMethods[0].parameters.billingAddressRequired&&(t.allowedPaymentMethods[0].parameters.billingAddressParameters={format:"FULL",phoneNumberRequired:this.fields.requestFieldInWallet("billing_phone")}),t.shippingAddressRequired?(t.shippingAddressParameters={},t.shippingOptionRequired=!0,t.shippingOptionParameters={shippingOptions:this.get_shipping_options()},t.callbackIntents=["SHIPPING_ADDRESS","SHIPPING_OPTION","PAYMENT_AUTHORIZATION"]):t.callbackIntents=["PAYMENT_AUTHORIZATION"],this.payment_request_options=t},wc_stripe.GooglePay.prototype.createPaymentsClient=function(){this.paymentsClient=new google.payments.api.PaymentsClient(this.get_payment_options())},wc_stripe.GooglePay.prototype.isReadyToPay=function(){return new Promise(function(t){var e=o.extend({},s);e.allowedPaymentMethods=[n],this.paymentsClient.isReadyToPay(e).then(function(){this.can_pay=!0,this.create_button(),t()}.bind(this))["catch"](function(t){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,buttonSizeMode:this.params.button_size_mode})),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.get_payment_request_options=function(){return o.extend({},wc_stripe.BaseGateway.prototype.get_payment_request_options.apply(this,arguments),{disableWallets:["googlePay"]})},wc_stripe.ApplePay.prototype.create_button=function(){this.$button&&this.$button.remove(),this.$button=o(this.params.button),this.$button.on("click",this.start.bind(this)),this.append_button()},wc_stripe.ApplePay.prototype.canMakePayment=function(){return new Promise(function(e){this.paymentRequest.canMakePayment().then(function(t){t&&t.applePay&&(this.can_pay=!0,this.create_button(),o(this.container).show(),e(t))}.bind(this))}.bind(this))},wc_stripe.ApplePay.prototype.start=function(t){t.preventDefault(),this.paymentRequest.update(this.get_payment_request_update({total:{pending:!1}})),this.paymentRequest.show()},wc_stripe.PaymentRequest=function(){},wc_stripe.PaymentRequest.prototype.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.Afterpay=function(){},wc_stripe.Afterpay.prototype.is_eligible=function(t){return this.needs_shipping()&&t>this.get_min()&&t<this.get_max()},wc_stripe.Afterpay.prototype.get_min=function(){var t=this.get_currency(),t=this.params.requirements[t];return t?t[1]:0},wc_stripe.Afterpay.prototype.get_max=function(){var t=this.get_currency(),t=this.params.requirements[t];return t?t[2]:0},wc_stripe.Afterpay.prototype.add_eligibility=function(t,e){o(t).length&&(this.is_eligible(e)?o(t).removeClass("afterpay-ineligible"):this.hide_ineligible_active()&&o(t).addClass("afterpay-ineligible"))},wc_stripe.Afterpay.prototype.hide_ineligible_active=function(){return"yes"===this.params.hide_ineligible},wc_stripe.CheckoutFields=function(t,e){this.params=t,this.page=e,this.session_values=this.supportsSessionStorage()&&sessionStorage.getItem("wc_stripe_checkout_fields")?JSON.parse(sessionStorage.getItem("wc_stripe_checkout_fields")):{},this.fields=new Map(Object.keys(this.params).map(function(t){return null===this.params[t].value&&(t in this.session_values&&null!==this.session_values[t]?this.params[t].value=this.session_values[t]:this.params[t].value=""),[t,this.params[t].value]}.bind(this))),("checkout"===e||"cart"===e&&o(document.body).is(".woocommerce-checkout")||0<o("form.woocommerce-checkout").length)&&(o(document.body).on("updated_checkout",this.updated_checkout.bind(this)),o("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.updated_checkout=function(){this.syncCheckoutFieldsWithDOM()},wc_stripe.CheckoutFields.prototype.syncCheckoutFieldsWithDOM=function(){for(var t in this.params)o("#"+t).length&&this.fields.set(t,o("#"+t).val())},wc_stripe.CheckoutFields.prototype.onChange=function(t){try{var e=t.currentTarget.name,i=t.currentTarget.value;this.fields.set(e,i),"billing_country"!==e&&"shipping_country"!==e||this.update_required_fields(i,e),this.supportsSessionStorage()&&sessionStorage.setItem("wc_stripe_checkout_fields",JSON.stringify(this.toJson()))}catch(s){console.log(s)}},wc_stripe.CheckoutFields.prototype.update_required_fields=function(t,e){if(this.locales){var i,s=-1<e.indexOf("billing_")?"billing_":"shipping_",t="undefined"!=typeof this.locales[t]?this.locales[t]:this.locales["default"],a=o.extend(!0,{},this.locales["default"],t);for(i in a){var n=s+i;this.params[n]&&(this.params[n]=o.extend(!0,{},this.params[n],a[i]))}}},wc_stripe.CheckoutFields.prototype.on_ship_to_address_change=function(t){o(t.currentTarget).is(":checked")&&this.update_required_fields(o("#shipping_country").val(),"shipping_country")},wc_stripe.CheckoutFields.prototype.requestFieldInWallet=function(t){return"checkout"===this.page?this.required(t)&&this.isEmpty(t):"order_pay"!==this.page&&this.required(t)},wc_stripe.CheckoutFields.prototype.set=function(t,e,i){this[t]&&"function"==typeof this[t]?this[t]().set.call(this,e,i):this.fields.set(t,e)},wc_stripe.CheckoutFields.prototype.get=function(t,e){var i;return this[t]&&"function"==typeof this[t]?i=this[t]().get.call(this,e):null!=(i=this.fields.get(t))&&""!==i||void 0!==e&&(i=e),void 0===i?"":i},wc_stripe.CheckoutFields.prototype.required=function(t){return!(!this.params[t]||"undefined"==typeof this.params[t].required)&&this.params[t].required},wc_stripe.CheckoutFields.prototype.exists=function(t){return t in this.params},wc_stripe.CheckoutFields.prototype.isEmpty=function(t){if(this.fields.has(t)){t=this.fields.get(t);return null==t||"string"==typeof t&&0===t.trim().length}return!0},wc_stripe.CheckoutFields.prototype.isValid=function(t){if(this[t]&&"function"==typeof this[t])return this[t]().isValid.apply(this,Array.prototype.slice.call(arguments,1))},wc_stripe.CheckoutFields.prototype.first_name=function(){return{set:function(t,e){this.fields.set(e+"_first_name",t)},get:function(t){return this.fields.get(t+"_first_name")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.last_name=function(){return{set:function(t,e){this.fields.set(e+"_last_name",t)},get:function(t){return this.fields.get(t+"_last_name")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.address_1=function(){return{set:function(t,e){this.fields.set(e+"_address_1",t)},get:function(t){return this.fields.get(t+"_address_1")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.address_2=function(){return{set:function(t,e){this.fields.set(e+"_address_2",t)},get:function(t){return this.fields.get(t+"_address_2")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.name=function(){return{set:function(t,e){this.fields.set(e+"_full_name",t);var i=t.split(" ");1<i.length?(t=i.pop(),this.fields.set(e+"_first_name",i.join(" ")),this.fields.set(e+"_last_name",t)):1==i.length&&this.fields.set(e+"_first_name",i[0])},get:function(t){return this.fields.get(t+"_first_name")+" "+this.fields.get(t+"_last_name")}}},wc_stripe.CheckoutFields.prototype.email=function(){return{set:function(t,e){this.fields.set(e+"_email",t)},get:function(t){return this.fields.get(t+"_email")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.phone=function(){return{set:function(t,e){this.fields.set(e+"_phone",t)},get:function(t){return this.fields.get(t+"_phone")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.country=function(){return{set:function(t,e){this.fields.set(e+"_country",t)},get:function(t){return this.fields.get(t+"_country")},isValid:function(t){return"string"==typeof t&&2===t.length}}},wc_stripe.CheckoutFields.prototype.state=function(){return{set:function(i,t){2<(i=i.toUpperCase()).length&&"checkout"===this.page&&o("#"+t+"_state option").each(function(){var t=o(this),e=t.text().toUpperCase();i===e&&(i=t.val())}),this.fields.set(t+"_state",i)},get:function(t){return this.fields.get(t+"_state")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.city=function(){return{set:function(t,e){this.fields.set(e+"_city",t)},get:function(t){return this.fields.get(t+"_city")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.postcode=function(){return{set:function(t,e){this.fields.set(e+"_postcode",t)},get:function(t){return this.fields.get(t+"_postcode")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.recipient=function(){return wc_stripe.CheckoutFields.prototype.name.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.payerName=function(){return wc_stripe.CheckoutFields.prototype.name.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.payerEmail=function(){return wc_stripe.CheckoutFields.prototype.email.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.payerPhone=function(){return wc_stripe.CheckoutFields.prototype.phone.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.phoneNumber=function(){return wc_stripe.CheckoutFields.prototype.phone.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.countryCode=function(){return wc_stripe.CheckoutFields.prototype.country.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.address1=function(){return wc_stripe.CheckoutFields.prototype.address_1.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.address2=function(){return wc_stripe.CheckoutFields.prototype.address_2.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.line1=function(){return wc_stripe.CheckoutFields.prototype.address_1.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.line2=function(){return wc_stripe.CheckoutFields.prototype.address_2.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.addressLine=function(){return{set:function(t,e){0<t.length&&this.fields.set(e+"_address_1",t[0]),1<t.length&&this.fields.set(e+"_address_2",t[1])},get:function(t){return[this.fields.get(t+"_address_1"),this.fields.get(t+"_address_2")]},isValid:function(t){return 0<t.length&&("string"==typeof t[0]&&0<t[0].length)}}},wc_stripe.CheckoutFields.prototype.region=function(){return wc_stripe.CheckoutFields.prototype.state.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.administrativeArea=function(){return wc_stripe.CheckoutFields.prototype.state.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.locality=function(){return wc_stripe.CheckoutFields.prototype.city.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.postal_code=function(){return wc_stripe.CheckoutFields.prototype.postcode.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.postalCode=function(){return wc_stripe.CheckoutFields.prototype.postcode.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.toJson=function(){var i={};return this.fields.forEach(function(t,e){i[e]=t}),i},wc_stripe.CheckoutFields.prototype.toFormFields=function(t){var i=[];this.fields.forEach(function(t,e){e='[name="'+e+'"]';o(e).length&&""!==t&&(o(e).val()!==t&&o(e).is("select")&&i.push(e),o(e).val(t))}),0<i.length&&o(i.join(",")).trigger("change"),void 0!==t&&o(document.body).trigger("update_checkout",t)},wc_stripe.CheckoutFields.prototype.validateFields=function(t){for(var e in this.params){var i=this.params[e];if(-1<e.indexOf(t)&&i.required&&o("#"+e).length&&o("#"+e).is(":visible")){i=o("#"+e).val();if(null==i||0===i.length)return!1}}return!0};try{i=Stripe(wc_stripe_params_v3.api_key,"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);
|
1 |
+
!function(a,o){a.wc_stripe={};var i=null;"undefined"==typeof wc_stripe_checkout_fields&&(a.wc_stripe_checkout_fields=[]),wc_stripe.BaseGateway=function(t,e){this.params=t,this.gateway_id=this.params.gateway_id,this.container=void 0===e?"li.payment_method_".concat(this.gateway_id):e,o(this.container).length||(this.container=".payment_method_".concat(this.gateway_id)),this.token_selector=this.params.token_selector,this.saved_method_selector=this.params.saved_method_selector,this.payment_token_received=!1,this.stripe=i,this.fields=r,this.elements=i.elements(o.extend({},{locale:"auto"},this.get_element_options())),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.set_intent=function(t){this.fields.set(this.gateway_id+"_payment_intent_key",t),o("#"+this.gateway_id+"_payment_intent_key").val(t)},wc_stripe.BaseGateway.prototype.get_element_options=function(){return this.params.elementOptions},wc_stripe.BaseGateway.prototype.initialize=function(){},wc_stripe.BaseGateway.prototype.create_button=function(){},wc_stripe.BaseGateway.prototype.is_gateway_selected=function(){return o('[name="payment_method"]:checked').val()===this.gateway_id},wc_stripe.BaseGateway.prototype.is_saved_method_selected=function(){return this.is_gateway_selected()&&"saved"===o('[name="'+this.gateway_id+'_payment_type_key"]:checked').val()},wc_stripe.BaseGateway.prototype.has_checkout_error=function(){return 0<o("#wc_stripe_checkout_error").length&&this.is_gateway_selected()},wc_stripe.BaseGateway.prototype.submit_error=function(t){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=t.code&&wc_stripe_messages[t.code]?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"),this.fields.exists("shipping_phone")&&this.fields.isEmpty("shipping_phone")&&this.fields.set("shipping_phone",t.payerPhone)),t.shippingAddress&&this.populate_shipping_fields(t.shippingAddress),t.paymentMethod.billing_details.address&&this.populate_billing_fields(t.paymentMethod.billing_details.address)},wc_stripe.BaseGateway.prototype.populate_address_fields=function(t,e){for(var i in t)null!==t[i]&&this.fields.set(i,t[i],e)},wc_stripe.BaseGateway.prototype.populate_billing_fields=function(t){this.populate_address_fields(t,"billing")},wc_stripe.BaseGateway.prototype.populate_shipping_fields=function(t){this.populate_address_fields(t,"shipping")},wc_stripe.BaseGateway.prototype.get_address_fields=function(){return["first_name","last_name","country","address_1","address_2","city","state","postcode","phone","email"]},wc_stripe.BaseGateway.prototype.get_address_object=function(e){var i={};return this.get_address_fields().forEach(function(t){i[t]=this.fields.get(t,e)}.bind(this)),i},wc_stripe.BaseGateway.prototype.is_current_page=function(t){return Array.isArray(t)?-1<t.indexOf(this.get_page()):this.get_page()===t},wc_stripe.BaseGateway.prototype.is_valid_address=function(t,e,i){if(o.isEmptyObject(t))return!1;var s=this.get_address_fields();void 0!==i&&i.forEach(function(t){-1<s.indexOf(t)&&s.splice(s.indexOf(t),1)});for(var a=0;a<s.length;a++){var n=s[a];if(this.fields.required(e+"_"+n)&&(!t[n]||"undefined"==typeof t[n]||!this.fields.isValid(n,t[n],t)))return!1}return!0},wc_stripe.BaseGateway.prototype.ajax_before_send=function(t){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(t,e){o.ajax({method:"POST",url:this.params.routes.checkout_payment,dataType:"json",data:o.extend({},this.fields.toJson(),{order_id:t,order_key:e}),beforeSend:this.ajax_before_send.bind(this)}).done(function(t){if(t.result&&"success"===t.result)a.location=t.redirect;else{if(t.reload)return a.location.reload();t.messages?(this.payment_token_received=!1,this.submit_error(t.messages)):this.submit_error(wc_checkout_params.i18n_checkout_error)}}.bind(this)).fail(function(){}.bind(this))},wc_stripe.BaseGateway.prototype.handle_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(e.order_id,e.order_key)}.bind(this))["catch"](function(t){this.submit_error(t.message)}.bind(this)),!1}catch(t){}},wc_stripe.BaseGateway.prototype.handle_card_setup=function(e){try{return this.stripe.confirmCardSetup(e.client_secret).then(function(t){if(t.error)return this.payment_token_received=!1,this.submit_error(t.error);this.is_current_page("order_pay")?this.get_form().submit():this.process_payment(e.order_id,e.order_key)}.bind(this))["catch"](function(t){this.submit_error(t.message)}.bind(this)),!1}catch(t){}},wc_stripe.BaseGateway.prototype.hashchange=function(t){var e=t.newURL.match(/response=(.*)/);if(e)try{var i=JSON.parse(a.atob(decodeURIComponent(e[1])));i&&i.hasOwnProperty("client_secret")&&i.gateway_id===this.gateway_id&&(history.pushState({},"",a.location.pathname),"intent"===i.type?this.handle_card_action(i):this.handle_card_setup(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("checkout_error",this.checkout_error.bind(this)),o(this.token_selector).closest("form").on("checkout_place_order_"+this.gateway_id,this.checkout_place_order.bind(this)),o(document.body).on("wc_stripe_new_method_"+this.gateway_id,this.on_show_new_methods.bind(this)),o(document.body).on("wc_stripe_saved_method_"+this.gateway_id,this.on_show_saved_methods.bind(this)),o(document.body).on("wc_stripe_payment_method_selected",this.on_payment_method_selected.bind(this)),this.banner_enabled()&&o(".woocommerce-billing-fields").length&&o(".wc-stripe-banner-checkout").css("max-width",o(".woocommerce-billing-fields").outerWidth(!0)),this.container_styles(),this.hasOrderReviewParams()},wc_stripe.CheckoutGateway.prototype.container_styles=function(){this.params.description||o(this.container).addClass("wc-stripe-no-desc"),o(this.container).find(".wc-stripe-saved-methods").length||o(this.container).find(".payment_box").addClass("wc-stripe-no-methods")},wc_stripe.CheckoutGateway.prototype.hasOrderReviewParams=function(){var t=a.location.search.match(/_stripe_order_review=(.+)/);if(t&&1<t.length)try{var e=JSON.parse(a.atob(decodeURIComponent(t[1])));this.gateway_id===e.payment_method&&(o(function(){this.payment_token_received=!0,this.set_nonce(e.payment_nonce),this.set_use_new_option(!0)}.bind(this)),history.pushState({},"",a.location.pathname))}catch(i){}},wc_stripe.CheckoutGateway.prototype.has3DSecureParams=function(){if((this.is_current_page("order_pay")||this.is_change_payment_method())&&a.location.hash&&"string"==typeof a.location.hash){var t=a.location.hash.match(/response=(.*)/);if(t)try{var e=JSON.parse(a.atob(decodeURIComponent(t[1])));e&&e.hasOwnProperty("client_secret")&&e.gateway_id===this.gateway_id&&(o(function(){this.set_payment_method(this.gateway_id),this.set_use_new_option(!0),this.set_nonce(e.pm),!0===e.save_method&&this.set_save_payment_method(!0),o('[name="terms"]').prop("checked",!0)}.bind(this)),history.pushState({},"",a.location.pathname+a.location.search),this.handle_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(":visible")&&!o('[name="terms"]').is(":checked"))},wc_stripe.CheckoutGateway.prototype.get_payment_method=function(){return o('[name="payment_method"]:checked').val()},wc_stripe.CheckoutGateway.prototype.set_use_new_option=function(t){o("#"+this.gateway_id+"_use_new").prop("checked",t).trigger("change")},wc_stripe.CheckoutGateway.prototype.checkout_place_order=function(){return this.is_valid_checkout()?!!this.is_saved_method_selected()||this.payment_token_received:(this.submit_error(this.params.messages.terms),!1)},wc_stripe.CheckoutGateway.prototype.on_token_received=function(t){this.payment_token_received=!0,this.set_nonce(t.id),this.hide_payment_button(),this.show_place_order()},wc_stripe.CheckoutGateway.prototype.block=function(){o().block&&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&&e.indexOf("stripe_")<0&&this.show_place_order())},wc_stripe.CheckoutGateway.prototype.banner_enabled=function(){return"1"===this.params.banner_enabled},wc_stripe.CheckoutGateway.prototype.checkout_fields_valid=function(){if(["checkout","order_pay"].indexOf(this.get_page())<0)return!0;var t=!0;return(t=this.fields.validateFields("billing"))?this.needs_shipping()&&o("#ship-to-different-address-checkbox").is(":checked")?(t=this.fields.validateFields("shipping"))||this.submit_error(this.params.messages.required_field):(t=this.is_valid_checkout())||this.submit_error(this.params.messages.terms):this.submit_error(this.params.messages.required_field),t},wc_stripe.CheckoutGateway.prototype.cart_contains_subscription=function(){return"undefined"!=typeof wc_stripe_cart_contains_subscription&&!0===wc_stripe_cart_contains_subscription},wc_stripe.CheckoutGateway.prototype.set_save_payment_method=function(t){o('[name="'+this.gateway_id+'_save_source_key"]').prop("checked",t)},wc_stripe.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(){var t=o('input[name="variation_id"]').val();return!!t&&"0"!=t},wc_stripe.ProductGateway.prototype.get_product_data=function(){return this.get_gateway_data().product},wc_stripe.ProductGateway.prototype.set_product_data=function(t){var e=this.get_gateway_data();e.product=t,this.set_gateway_data(e)},wc_stripe.ProductGateway.prototype.get_form=function(){return o(this.container).closest("form")},wc_stripe.ProductGateway.prototype.add_to_cart=function(){return new Promise(function(e,i){this.block();var t={product_id:this.get_product_data().id,variation_id:this.is_variable_product()?o('[name="variation_id"]').val():0,qty:o('[name="quantity"]').val(),payment_method:this.gateway_id,currency:this.get_currency(),page_id:this.get_page()},s=this.get_form().find(':not([name="add-to-cart"],[name="quantity"],[name^="attribute_"],[name="variation_id"])').serializeArray();if(s)for(var a in s)t[s[a].name]=s[a].value;o.ajax({url:this.params.routes.add_to_cart,method:"POST",dataType:"json",data:o.extend({},t,this.get_product_variations()),beforeSend:this.ajax_before_send.bind(this)}).done(function(t){this.unblock(),t.code?(this.submit_error(t.message),i(t)):(this.set_total_price(t.data.total),this.set_total_price_cents(t.data.totalCents),this.set_display_items(t.data.displayItems),e(t.data))}.bind(this)).fail(function(t,e,i){this.unblock(),this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.ProductGateway.prototype.cart_calculation=function(t){return new Promise(function(e,i){o.ajax({url:this.params.routes.cart_calculation,method:"POST",dataType:"json",data:o.extend({},{product_id:this.get_product_data().id,variation_id:this.is_variable_product()&&t?t:0,qty:o('[name="quantity"]').val(),currency:this.get_currency(),payment_method:this.gateway_id},this.get_product_variations()),beforeSend:this.ajax_before_send.bind(this)}).done(function(t){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.ProductGateway.prototype.get_product_variations=function(){var s={};return this.is_variable_product()&&o('.variations [name^="attribute_"]').each(function(t,e){var i=o(e),e=i.data("attribute_name")||i.attr("name");s[e]=i.val()}),s},wc_stripe.CartGateway=function(){this.message_container="div.woocommerce",o(document.body).on("updated_wc_div",this.updated_html.bind(this)),o(document.body).on("updated_cart_totals",this.updated_html.bind(this)),o(document.body).on("wc_cart_emptied",this.cart_emptied.bind(this))},wc_stripe.CartGateway.prototype.submit_error=function(t){this.submit_message(this.get_error_message(t))},wc_stripe.CartGateway.prototype.updated_html=function(t){},wc_stripe.CartGateway.prototype.cart_emptied=function(t){},wc_stripe.CartGateway.prototype.add_cart_totals_class=function(){o(".cart_totals").addClass("stripe_cart_gateway_active")},wc_stripe.GooglePay=function(){};var s={apiVersion:2,apiVersionMinor:0},n={type:"CARD",parameters:{allowedAuthMethods:["PAN_ONLY"],allowedCardNetworks:["AMEX","DISCOVER","INTERAC","JCB","MASTERCARD","VISA"],assuranceDetailsRequired:!0}};wc_stripe.GooglePay.prototype.update_addresses=function(t){var e;t.paymentMethodData.info.billingAddress&&(e=t.paymentMethodData.info.billingAddress,this.is_current_page("checkout")&&this.is_valid_address(this.billing_address_object,"billing",["phone","email"])&&(e={phoneNumber:e.phoneNumber}),this.populate_billing_fields(e),e.phoneNumber&&this.fields.exists("shipping_phone")&&this.fields.isEmpty("shipping_phone")&&this.fields.set("shipping_phone",e.phoneNumber)),t.shippingAddress&&this.populate_shipping_fields(t.shippingAddress),t.email&&this.fields.set("email",t.email,"billing")},wc_stripe.GooglePay.prototype.map_address=function(t){return{city:t.locality,postcode:t.postalCode,state:t.administrativeArea,country:t.countryCode}},wc_stripe.GooglePay.prototype.update_payment_data=function(s){return new Promise(function(e,i){var t="default"==s.shippingOptionData.id?null:s.shippingOptionData.id;o.when(o.ajax({url:this.params.routes.payment_data,dataType:"json",method:"POST",data:{address:this.map_address(s.shippingAddress),shipping_method:t,page_id:this.get_page(),currency:this.get_currency()},beforeSend:this.ajax_before_send.bind(this)})).done(function(t){t.code?i(t.data.data):e(t.data)}.bind(this)).fail(function(){i()}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.on_payment_data_changed=function(i){return new Promise(function(e){this.update_payment_data(i).then(function(t){e(t.paymentRequestUpdate),this.set_selected_shipping_methods(t.shipping_methods),this.payment_data_updated(t,i)}.bind(this))["catch"](function(t){e(t)}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.payment_data_updated=function(t){},wc_stripe.GooglePay.prototype.get_merchant_info=function(){var t={merchantId:this.params.merchant_id,merchantName:this.params.merchant_name};return"TEST"===this.params.environment&&delete t.merchantId,t},wc_stripe.GooglePay.prototype.get_payment_options=function(){var t,e={environment:this.params.environment,merchantInfo:this.get_merchant_info(),paymentDataCallbacks:{onPaymentAuthorized:function(){return new Promise(function(t){t({transactionState:"SUCCESS"})}.bind(this))}}};return this.needs_shipping()&&(t=this.get_shipping_prefix(),(!this.is_current_page("checkout")||this.is_valid_address(this.get_address_object(t),t,["email","phone"]))&&this.is_current_page("checkout")||(e.paymentDataCallbacks.onPaymentDataChanged=this.on_payment_data_changed.bind(this))),e},wc_stripe.GooglePay.prototype.build_payment_request=function(){var t=o.extend({},s,{emailRequired:this.fields.requestFieldInWallet("billing_email"),merchantInfo:this.get_merchant_info(),allowedPaymentMethods:[o.extend({type:"CARD",tokenizationSpecification:{type:"PAYMENT_GATEWAY",parameters:{gateway:"stripe","stripe:version":"2018-10-31","stripe:publishableKey":this.params.api_key}}},n)],shippingAddressRequired:function(){if(this.needs_shipping()){var t=this.get_shipping_prefix();if(this.is_current_page("checkout")&&!this.is_valid_address(this.get_address_object(t),t,["email","phone"])||!this.is_current_page("checkout"))return!0}return!1}.bind(this)(),transactionInfo:{countryCode:this.params.processing_country,currencyCode:this.get_currency(),totalPriceStatus:"ESTIMATED",totalPrice:this.get_total_price().toString(),displayItems:this.get_display_items(),totalPriceLabel:this.params.total_price_label}});return t.allowedPaymentMethods[0].parameters.billingAddressRequired=function(){if(this.is_current_page("checkout")){var t=this.billing_address_object=this.get_address_object("billing");return this.fields.requestFieldInWallet("billing_phone")||!this.is_valid_address(t,"billing",["email"])?!0:!1}return!0}.bind(this)(),t.allowedPaymentMethods[0].parameters.billingAddressRequired&&(t.allowedPaymentMethods[0].parameters.billingAddressParameters={format:"FULL",phoneNumberRequired:this.fields.requestFieldInWallet("billing_phone")}),t.shippingAddressRequired?(t.shippingAddressParameters={},t.shippingOptionRequired=!0,t.shippingOptionParameters={shippingOptions:this.get_shipping_options()},t.callbackIntents=["SHIPPING_ADDRESS","SHIPPING_OPTION","PAYMENT_AUTHORIZATION"]):t.callbackIntents=["PAYMENT_AUTHORIZATION"],this.payment_request_options=t},wc_stripe.GooglePay.prototype.createPaymentsClient=function(){this.paymentsClient=new google.payments.api.PaymentsClient(this.get_payment_options())},wc_stripe.GooglePay.prototype.isReadyToPay=function(){return new Promise(function(t){var e=o.extend({},s);e.allowedPaymentMethods=[n],this.paymentsClient.isReadyToPay(e).then(function(){this.can_pay=!0,this.create_button(),t()}.bind(this))["catch"](function(t){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,buttonSizeMode:this.params.button_size_mode})),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.get_payment_request_options=function(){return o.extend({},wc_stripe.BaseGateway.prototype.get_payment_request_options.apply(this,arguments),{disableWallets:["googlePay"]})},wc_stripe.ApplePay.prototype.create_button=function(){this.$button&&this.$button.remove(),this.$button=o(this.params.button),this.$button.on("click",this.start.bind(this)),this.append_button()},wc_stripe.ApplePay.prototype.canMakePayment=function(){return new Promise(function(e){this.paymentRequest.canMakePayment().then(function(t){t&&t.applePay&&(this.can_pay=!0,this.create_button(),o(this.container).show(),e(t))}.bind(this))}.bind(this))},wc_stripe.ApplePay.prototype.start=function(t){t.preventDefault(),this.paymentRequest.update(this.get_payment_request_update({total:{pending:!1}})),this.paymentRequest.show()},wc_stripe.PaymentRequest=function(){},wc_stripe.PaymentRequest.prototype.initialize=function(){this.createPaymentRequest(),this.createPaymentRequestButton(),this.canMakePayment(),this.paymentRequestButton.on("click",this.button_click.bind(this))},wc_stripe.PaymentRequest.prototype.button_click=function(t){},wc_stripe.PaymentRequest.prototype.createPaymentRequestButton=function(){this.paymentRequestButton&&this.paymentRequestButton.destroy(),this.paymentRequestButton=this.elements.create("paymentRequestButton",{paymentRequest:this.paymentRequest,style:{paymentRequestButton:{type:this.params.button.type,theme:this.params.button.theme,height:this.params.button.height}}})},wc_stripe.PaymentRequest.prototype.canMakePayment=function(){return new Promise(function(e){var i=this.paymentRequest;this.paymentRequest.canMakePayment().then(function(t){t&&!t.applePay&&i===this.paymentRequest&&(this.can_pay=!0,this.create_button(),o(this.container).show(),e(t))}.bind(this))}.bind(this))},wc_stripe.PaymentRequest.prototype.create_button=function(){this.paymentRequestButton.mount("#wc-stripe-payment-request-container")},wc_stripe.Afterpay=function(){},wc_stripe.Afterpay.prototype.is_eligible=function(t){return this.needs_shipping()&&t>this.get_min()&&t<this.get_max()},wc_stripe.Afterpay.prototype.get_min=function(){var t=this.get_currency(),t=this.params.requirements[t];return t?t[1]:0},wc_stripe.Afterpay.prototype.get_max=function(){var t=this.get_currency(),t=this.params.requirements[t];return t?t[2]:0},wc_stripe.Afterpay.prototype.add_eligibility=function(t,e){o(t).length&&(this.is_eligible(e)?o(t).removeClass("afterpay-ineligible"):this.hide_ineligible_active()&&o(t).addClass("afterpay-ineligible"))},wc_stripe.Afterpay.prototype.hide_ineligible_active=function(){return"yes"===this.params.hide_ineligible},wc_stripe.CheckoutFields=function(t,e){this.params=t,this.page=e,this.session_values=this.supportsSessionStorage()&&sessionStorage.getItem("wc_stripe_checkout_fields")?JSON.parse(sessionStorage.getItem("wc_stripe_checkout_fields")):{},this.fields=new Map(Object.keys(this.params).map(function(t){return null===this.params[t].value&&(t in this.session_values&&null!==this.session_values[t]?this.params[t].value=this.session_values[t]:this.params[t].value=""),[t,this.params[t].value]}.bind(this))),("checkout"===e||"cart"===e&&o(document.body).is(".woocommerce-checkout")||0<o("form.woocommerce-checkout").length)&&(o(document.body).on("updated_checkout",this.updated_checkout.bind(this)),o("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.updated_checkout=function(){this.syncCheckoutFieldsWithDOM()},wc_stripe.CheckoutFields.prototype.syncCheckoutFieldsWithDOM=function(){for(var t in this.params)o("#"+t).length&&this.fields.set(t,o("#"+t).val())},wc_stripe.CheckoutFields.prototype.onChange=function(t){try{var e=t.currentTarget.name,i=t.currentTarget.value;this.fields.set(e,i),"billing_country"!==e&&"shipping_country"!==e||this.update_required_fields(i,e),this.supportsSessionStorage()&&sessionStorage.setItem("wc_stripe_checkout_fields",JSON.stringify(this.toJson()))}catch(s){console.log(s)}},wc_stripe.CheckoutFields.prototype.update_required_fields=function(t,e){if(this.locales){var i,s=-1<e.indexOf("billing_")?"billing_":"shipping_",t="undefined"!=typeof this.locales[t]?this.locales[t]:this.locales["default"],a=o.extend(!0,{},this.locales["default"],t);for(i in a){var n=s+i;this.params[n]&&(this.params[n]=o.extend(!0,{},this.params[n],a[i]))}}},wc_stripe.CheckoutFields.prototype.on_ship_to_address_change=function(t){o(t.currentTarget).is(":checked")&&this.update_required_fields(o("#shipping_country").val(),"shipping_country")},wc_stripe.CheckoutFields.prototype.requestFieldInWallet=function(t){return"checkout"===this.page?this.required(t)&&this.isEmpty(t):"order_pay"!==this.page&&this.required(t)},wc_stripe.CheckoutFields.prototype.set=function(t,e,i){this[t]&&"function"==typeof this[t]?this[t]().set.call(this,e,i):this.fields.set(t,e)},wc_stripe.CheckoutFields.prototype.get=function(t,e){var i;return this[t]&&"function"==typeof this[t]?i=this[t]().get.call(this,e):null!=(i=this.fields.get(t))&&""!==i||void 0!==e&&(i=e),void 0===i?"":i},wc_stripe.CheckoutFields.prototype.required=function(t){return!(!this.params[t]||"undefined"==typeof this.params[t].required)&&this.params[t].required},wc_stripe.CheckoutFields.prototype.exists=function(t){return t in this.params},wc_stripe.CheckoutFields.prototype.isEmpty=function(t){if(this.fields.has(t)){t=this.fields.get(t);return null==t||"string"==typeof t&&0===t.trim().length}return!0},wc_stripe.CheckoutFields.prototype.isValid=function(t){if(this[t]&&"function"==typeof this[t])return this[t]().isValid.apply(this,Array.prototype.slice.call(arguments,1))},wc_stripe.CheckoutFields.prototype.first_name=function(){return{set:function(t,e){this.fields.set(e+"_first_name",t)},get:function(t){return this.fields.get(t+"_first_name")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.last_name=function(){return{set:function(t,e){this.fields.set(e+"_last_name",t)},get:function(t){return this.fields.get(t+"_last_name")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.address_1=function(){return{set:function(t,e){this.fields.set(e+"_address_1",t)},get:function(t){return this.fields.get(t+"_address_1")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.address_2=function(){return{set:function(t,e){this.fields.set(e+"_address_2",t)},get:function(t){return this.fields.get(t+"_address_2")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.name=function(){return{set:function(t,e){this.fields.set(e+"_full_name",t);var i=t.split(" ");1<i.length?(t=i.pop(),this.fields.set(e+"_first_name",i.join(" ")),this.fields.set(e+"_last_name",t)):1==i.length&&this.fields.set(e+"_first_name",i[0])},get:function(t){return this.fields.get(t+"_first_name")+" "+this.fields.get(t+"_last_name")}}},wc_stripe.CheckoutFields.prototype.email=function(){return{set:function(t,e){this.fields.set(e+"_email",t)},get:function(t){return this.fields.get(t+"_email")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.phone=function(){return{set:function(t,e){this.fields.set(e+"_phone",t)},get:function(t){return this.fields.get(t+"_phone")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.country=function(){return{set:function(t,e){this.fields.set(e+"_country",t)},get:function(t){return this.fields.get(t+"_country")},isValid:function(t){return"string"==typeof t&&2===t.length}}},wc_stripe.CheckoutFields.prototype.state=function(){return{set:function(i,t){2<(i=i.toUpperCase()).length&&"checkout"===this.page&&o("#"+t+"_state option").each(function(){var t=o(this),e=t.text().toUpperCase();i===e&&(i=t.val())}),this.fields.set(t+"_state",i)},get:function(t){return this.fields.get(t+"_state")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.city=function(){return{set:function(t,e){this.fields.set(e+"_city",t)},get:function(t){return this.fields.get(t+"_city")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.postcode=function(){return{set:function(t,e){this.fields.set(e+"_postcode",t)},get:function(t){return this.fields.get(t+"_postcode")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.recipient=function(){return wc_stripe.CheckoutFields.prototype.name.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.payerName=function(){return wc_stripe.CheckoutFields.prototype.name.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.payerEmail=function(){return wc_stripe.CheckoutFields.prototype.email.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.payerPhone=function(){return wc_stripe.CheckoutFields.prototype.phone.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.phoneNumber=function(){return wc_stripe.CheckoutFields.prototype.phone.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.countryCode=function(){return wc_stripe.CheckoutFields.prototype.country.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.address1=function(){return wc_stripe.CheckoutFields.prototype.address_1.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.address2=function(){return wc_stripe.CheckoutFields.prototype.address_2.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.line1=function(){return wc_stripe.CheckoutFields.prototype.address_1.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.line2=function(){return wc_stripe.CheckoutFields.prototype.address_2.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.addressLine=function(){return{set:function(t,e){0<t.length&&this.fields.set(e+"_address_1",t[0]),1<t.length&&this.fields.set(e+"_address_2",t[1])},get:function(t){return[this.fields.get(t+"_address_1"),this.fields.get(t+"_address_2")]},isValid:function(t){return 0<t.length&&("string"==typeof t[0]&&0<t[0].length)}}},wc_stripe.CheckoutFields.prototype.region=function(){return wc_stripe.CheckoutFields.prototype.state.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.administrativeArea=function(){return wc_stripe.CheckoutFields.prototype.state.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.locality=function(){return wc_stripe.CheckoutFields.prototype.city.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.postal_code=function(){return wc_stripe.CheckoutFields.prototype.postcode.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.postalCode=function(){return wc_stripe.CheckoutFields.prototype.postcode.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.toJson=function(){var i={};return this.fields.forEach(function(t,e){i[e]=t}),i},wc_stripe.CheckoutFields.prototype.toFormFields=function(t){var i=[];this.fields.forEach(function(t,e){e='[name="'+e+'"]';o(e).length&&""!==t&&(o(e).val()!==t&&o(e).is("select")&&i.push(e),o(e).val(t))}),0<i.length&&o(i.join(",")).trigger("change"),void 0!==t&&o(document.body).trigger("update_checkout",t)},wc_stripe.CheckoutFields.prototype.validateFields=function(t){for(var e in this.params){var i=this.params[e];if(-1<e.indexOf(t)&&i.required&&o("#"+e).length&&o("#"+e).is(":visible")){i=o("#"+e).val();if(null==i||0===i.length)return!1}}return!0};try{i=Stripe(wc_stripe_params_v3.api_key,"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
@@ -2,14 +2,14 @@
|
|
2 |
Â
# This file is distributed under the same license as the Payment Plugins for Stripe WooCommerce plugin.
|
3 |
Â
msgid ""
|
4 |
Â
msgstr ""
|
5 |
-
"Project-Id-Version: Payment Plugins for Stripe WooCommerce 3.3.
|
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-11-
|
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,9 +30,9 @@ 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:
|
36 |
Â
#: includes/gateways/settings/applepay-settings.php:11
|
37 |
Â
#: includes/gateways/settings/cc-settings.php:4
|
38 |
Â
#: includes/gateways/settings/googlepay-settings.php:23
|
@@ -40,12 +40,12 @@ 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:
|
49 |
Â
#: includes/gateways/settings/applepay-settings.php:20
|
50 |
Â
#: includes/gateways/settings/cc-settings.php:17
|
51 |
Â
#: includes/gateways/settings/googlepay-settings.php:32
|
@@ -53,9 +53,9 @@ 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:
|
59 |
Â
#: includes/gateways/settings/applepay-settings.php:24
|
60 |
Â
#: includes/gateways/settings/cc-settings.php:21
|
61 |
Â
#: includes/gateways/settings/googlepay-settings.php:42
|
@@ -63,8 +63,8 @@ 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:
|
68 |
Â
#: includes/gateways/settings/applepay-settings.php:30
|
69 |
Â
#: includes/gateways/settings/cc-settings.php:27
|
70 |
Â
#: includes/gateways/settings/googlepay-settings.php:48
|
@@ -72,8 +72,8 @@ 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:
|
77 |
Â
#: includes/gateways/settings/applepay-settings.php:33
|
78 |
Â
#: includes/gateways/settings/cc-settings.php:30
|
79 |
Â
#: includes/gateways/settings/googlepay-settings.php:51
|
@@ -81,46 +81,50 @@ 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:
|
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:
|
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 "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:
|
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:
|
103 |
Â
msgid "Order %s"
|
104 |
Â
msgstr ""
|
105 |
Â
|
106 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:
|
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:
|
111 |
Â
msgid " & billing country is not <strong>%s</strong>"
|
112 |
Â
msgstr ""
|
113 |
Â
|
114 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:
|
115 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:
|
116 |
Â
msgid " & billing country is <strong>%s</strong>"
|
117 |
Â
msgstr ""
|
118 |
Â
|
119 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
120 |
Â
msgid "Please fill out all required fields."
|
121 |
Â
msgstr ""
|
122 |
Â
|
123 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
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
|
@@ -130,163 +134,157 @@ msgstr ""
|
|
130 |
Â
msgid "Total"
|
131 |
Â
msgstr ""
|
132 |
Â
|
133 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
134 |
Â
msgid "User must be logged in."
|
135 |
Â
msgstr ""
|
136 |
Â
|
137 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
138 |
Â
msgid "Error saving payment method. Reason: %s"
|
139 |
Â
msgstr ""
|
140 |
Â
|
141 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
142 |
-
#: includes/wc-stripe-webhook-functions.php:
|
143 |
Â
msgid "Order refunded in Stripe. Amount: %s"
|
144 |
Â
msgstr ""
|
145 |
Â
|
146 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
147 |
Â
msgid "Order amount captured in Stripe. Amount: %s"
|
148 |
Â
msgstr ""
|
149 |
Â
|
150 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
151 |
Â
msgid "Error capturing charge in Stripe. Reason: %s"
|
152 |
Â
msgstr ""
|
153 |
Â
|
154 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
155 |
Â
msgid "Error voiding charge. Reason: %s"
|
156 |
Â
msgstr ""
|
157 |
Â
|
158 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
159 |
Â
msgid "Charge voided in Stripe."
|
160 |
Â
msgstr ""
|
161 |
Â
|
162 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
163 |
Â
msgid "n/a"
|
164 |
Â
msgstr ""
|
165 |
Â
|
166 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
167 |
Â
#: includes/admin/meta-boxes/views/html-order-pay.php:42
|
168 |
Â
msgid "New Card"
|
169 |
Â
msgstr ""
|
170 |
Â
|
171 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
172 |
Â
#: includes/admin/meta-boxes/views/html-order-pay.php:30
|
173 |
Â
msgid "Saved Cards"
|
174 |
Â
msgstr ""
|
175 |
Â
|
176 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
177 |
Â
msgid "Attempt to save payment method failed. Reason: %s"
|
178 |
Â
msgstr ""
|
179 |
Â
|
180 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
181 |
Â
msgid "We were not able to save your payment method. To prevent billing issues with your subscription, please add a payment method to the subscription."
|
182 |
Â
msgstr ""
|
183 |
Â
|
184 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
185 |
Â
msgid "We were not able to save your payment method. Reason: %s"
|
186 |
Â
msgstr ""
|
187 |
Â
|
188 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
189 |
Â
msgid "Payment Method Token"
|
190 |
Â
msgstr ""
|
191 |
Â
|
192 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
193 |
Â
msgid "Recurring payment for order failed. Reason: %s"
|
194 |
Â
msgstr ""
|
195 |
Â
|
196 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
197 |
Â
msgid "Recurring payment captured in Stripe. Payment method: %s"
|
198 |
Â
msgstr ""
|
199 |
Â
|
200 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
201 |
Â
msgid "Recurring payment authorized in Stripe. Payment method: %s"
|
202 |
Â
msgstr ""
|
203 |
Â
|
204 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
205 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
206 |
Â
msgid "Customer must manually complete payment for payment method %s"
|
207 |
Â
msgstr ""
|
208 |
Â
|
209 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
210 |
-
#: includes/abstract/abstract-wc-stripe-payment.php:
|
211 |
Â
msgid "Order %1$s from %2$s"
|
212 |
Â
msgstr ""
|
213 |
Â
|
214 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
215 |
Â
msgid "Pre-order payment for order failed. Reason: %s"
|
216 |
Â
msgstr ""
|
217 |
Â
|
218 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
219 |
Â
msgid "Pre-order payment captured in Stripe. Payment method: %s"
|
220 |
Â
msgstr ""
|
221 |
Â
|
222 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
223 |
Â
msgid "Pre-order payment authorized in Stripe. Payment method: %s"
|
224 |
Â
msgstr ""
|
225 |
Â
|
226 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
227 |
Â
msgid "Cannot process payment"
|
228 |
Â
msgstr ""
|
229 |
Â
|
230 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
231 |
Â
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."
|
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:233
|
237 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:294
|
238 |
Â
msgid "Shipping"
|
239 |
Â
msgstr ""
|
240 |
Â
|
241 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
242 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
243 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:243
|
244 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:304
|
245 |
Â
msgid "Discount"
|
246 |
Â
msgstr ""
|
247 |
Â
|
248 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
249 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:261
|
250 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:326
|
251 |
Â
msgid "Tax"
|
252 |
Â
msgstr ""
|
253 |
Â
|
254 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
255 |
Â
msgid "Fees"
|
256 |
Â
msgstr ""
|
257 |
Â
|
258 |
-
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:
|
259 |
Â
msgid "Error saving payment method for subscription. Reason: %s"
|
260 |
Â
msgstr ""
|
261 |
Â
|
262 |
-
#: includes/abstract/abstract-wc-stripe-payment.php:
|
263 |
Â
msgid "Charge %1$s is pending. Payment Method: %2$s. Payment will be completed once charge.succeeded webhook received from Stripe."
|
264 |
Â
msgstr ""
|
265 |
Â
|
266 |
-
#: includes/abstract/abstract-wc-stripe-payment.php:
|
267 |
Â
msgid "Order %1$s successful in Stripe. Charge: %2$s. Payment Method: %3$s"
|
268 |
Â
msgstr ""
|
269 |
Â
|
270 |
-
#: includes/abstract/abstract-wc-stripe-payment.php:
|
271 |
Â
msgid "charge"
|
272 |
Â
msgstr ""
|
273 |
Â
|
274 |
-
#: includes/abstract/abstract-wc-stripe-payment.php:
|
275 |
Â
msgid "authorization"
|
276 |
Â
msgstr ""
|
277 |
Â
|
278 |
-
#: includes/abstract/abstract-wc-stripe-payment.php:
|
279 |
Â
msgid "Transaction Id cannot be empty."
|
280 |
Â
msgstr ""
|
281 |
Â
|
282 |
-
#: includes/abstract/abstract-wc-stripe-payment.php:
|
283 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-ach.php:121
|
284 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-cc.php:
|
285 |
Â
msgid "Error processing payment. Reason: %s"
|
286 |
Â
msgstr ""
|
287 |
Â
|
288 |
Â
#: includes/abstract/abstract-wc-stripe-rest-controller.php:58
|
289 |
-
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:
|
290 |
Â
#: includes/controllers/class-wc-stripe-controller-order-actions.php:325
|
291 |
Â
msgid "You do not have permissions to access this resource."
|
292 |
Â
msgstr ""
|
@@ -321,15 +319,18 @@ msgstr ""
|
|
321 |
Â
msgid "Local Gateways"
|
322 |
Â
msgstr ""
|
323 |
Â
|
324 |
-
#: includes/admin/class-wc-stripe-admin-settings.php:
|
Â
|
|
325 |
Â
msgid "Stripe Email Options"
|
326 |
Â
msgstr ""
|
327 |
Â
|
328 |
-
#: includes/admin/class-wc-stripe-admin-settings.php:
|
Â
|
|
329 |
Â
msgid "Email Receipt"
|
330 |
Â
msgstr ""
|
331 |
Â
|
332 |
-
#: includes/admin/class-wc-stripe-admin-settings.php:
|
Â
|
|
333 |
Â
msgid "If enabled, an email receipt will be sent to the customer by Stripe when the order is processed."
|
334 |
Â
msgstr ""
|
335 |
Â
|
@@ -337,10 +338,18 @@ msgstr ""
|
|
337 |
Â
msgid "Stripe Settings"
|
338 |
Â
msgstr ""
|
339 |
Â
|
340 |
-
#: includes/admin/meta-boxes/class-wc-stripe-admin-order-metaboxes.php:
|
341 |
Â
msgid "You must create the order before payment can be processed."
|
342 |
Â
msgstr ""
|
343 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
344 |
Â
#: includes/admin/meta-boxes/views/html-charge-data-subview.php:9
|
345 |
Â
#: includes/admin/views/html-user-profile.php:36
|
346 |
Â
#: includes/admin/views/html-user-profile.php:69
|
@@ -355,8 +364,8 @@ 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:46
|
358 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
359 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:
|
360 |
Â
#: includes/gateways/settings/applepay-settings.php:52
|
361 |
Â
#: includes/gateways/settings/cc-settings.php:49
|
362 |
Â
#: includes/gateways/settings/googlepay-settings.php:70
|
@@ -373,19 +382,19 @@ msgid "Charge Data"
|
|
373 |
Â
msgstr ""
|
374 |
Â
|
375 |
Â
#: includes/admin/meta-boxes/views/html-charge-data-subview.php:24
|
376 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
377 |
Â
msgid "Mode"
|
378 |
Â
msgstr ""
|
379 |
Â
|
380 |
Â
#: includes/admin/meta-boxes/views/html-charge-data-subview.php:25
|
381 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
382 |
-
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:
|
383 |
Â
msgid "Live"
|
384 |
Â
msgstr ""
|
385 |
Â
|
386 |
Â
#: includes/admin/meta-boxes/views/html-charge-data-subview.php:25
|
387 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
388 |
-
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:
|
389 |
Â
msgid "Test"
|
390 |
Â
msgstr ""
|
391 |
Â
|
@@ -417,7 +426,7 @@ msgstr ""
|
|
417 |
Â
#: templates/cc-forms/bootstrap.php:16
|
418 |
Â
#: templates/cc-forms/minimalist.php:30
|
419 |
Â
#: packages/blocks/assets/js/payment-methods/credit-card/components/bootstrap/index.js:19
|
420 |
-
#: packages/blocks/build/commons.js:
|
421 |
Â
msgid "Exp"
|
422 |
Â
msgstr ""
|
423 |
Â
|
@@ -491,8 +500,8 @@ msgstr ""
|
|
491 |
Â
|
492 |
Â
#: includes/admin/meta-boxes/views/html-order-pay.php:21
|
493 |
Â
#: includes/admin/meta-boxes/views/html-product-data.php:15
|
494 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
495 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:
|
496 |
Â
#: includes/gateways/settings/applepay-settings.php:48
|
497 |
Â
#: includes/gateways/settings/cc-settings.php:45
|
498 |
Â
#: includes/gateways/settings/googlepay-settings.php:66
|
@@ -502,8 +511,8 @@ msgstr ""
|
|
502 |
Â
|
503 |
Â
#: includes/admin/meta-boxes/views/html-order-pay.php:24
|
504 |
Â
#: includes/admin/meta-boxes/views/html-product-data.php:48
|
505 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
506 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:
|
507 |
Â
#: includes/gateways/settings/applepay-settings.php:53
|
508 |
Â
#: includes/gateways/settings/cc-settings.php:50
|
509 |
Â
#: includes/gateways/settings/googlepay-settings.php:71
|
@@ -543,113 +552,206 @@ msgstr ""
|
|
543 |
Â
msgid "Save"
|
544 |
Â
msgstr ""
|
545 |
Â
|
546 |
-
#: includes/admin/settings/class-wc-stripe-
|
547 |
-
#: includes/admin/settings/class-wc-stripe-
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
548 |
Â
msgid "API Settings"
|
549 |
Â
msgstr ""
|
550 |
Â
|
551 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
552 |
Â
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."
|
553 |
Â
msgstr ""
|
554 |
Â
|
555 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
556 |
Â
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."
|
557 |
Â
msgstr ""
|
558 |
Â
|
559 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
560 |
Â
msgid "Account ID"
|
561 |
Â
msgstr ""
|
562 |
Â
|
563 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
564 |
Â
msgid "This is your Stripe Connect ID and serves as a unique identifier."
|
565 |
Â
msgstr ""
|
566 |
Â
|
567 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
568 |
Â
msgid "Connect Stripe Account"
|
569 |
Â
msgstr ""
|
570 |
Â
|
571 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
572 |
Â
msgid "Click to Connect"
|
573 |
Â
msgstr ""
|
574 |
Â
|
575 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
576 |
Â
msgid "We make it easy to connect Stripe to your site. Click the Connect button to go through our connect flow."
|
577 |
Â
msgstr ""
|
578 |
Â
|
579 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
580 |
Â
msgid "Test Publishable Key"
|
581 |
Â
msgstr ""
|
582 |
Â
|
583 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
584 |
Â
msgid "Your publishable key is used to initialize Stripe assets."
|
585 |
Â
msgstr ""
|
586 |
Â
|
587 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
588 |
Â
msgid "Test Secret Key"
|
589 |
Â
msgstr ""
|
590 |
Â
|
591 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
592 |
Â
msgid "Your secret key is used to authenticate requests to Stripe."
|
593 |
Â
msgstr ""
|
594 |
Â
|
595 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
596 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
597 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
598 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
599 |
Â
msgid "Connection Test"
|
600 |
Â
msgstr ""
|
601 |
Â
|
602 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
603 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
604 |
Â
msgid "Click this button to perform a connection test. If successful, your site is connected to Stripe."
|
605 |
Â
msgstr ""
|
606 |
Â
|
607 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
608 |
Â
msgid "Webhook url"
|
609 |
Â
msgstr ""
|
610 |
Â
|
611 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
612 |
-
msgid "<strong>Important:</strong> the webhook url is called by Stripe when events occur in your account, like a source becomes chargeable.
|
613 |
Â
msgstr ""
|
614 |
Â
|
615 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
616 |
Â
msgid "Live Webhook Secret"
|
617 |
Â
msgstr ""
|
618 |
Â
|
619 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
620 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
621 |
Â
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"
|
622 |
Â
msgstr ""
|
623 |
Â
|
624 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
625 |
Â
msgid "Test Webhook Secret"
|
626 |
Â
msgstr ""
|
627 |
Â
|
628 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
629 |
Â
msgid "Debug Log"
|
630 |
Â
msgstr ""
|
631 |
Â
|
632 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
633 |
Â
msgid "When enabled, the plugin logs important errors and info that can help you troubleshoot potential issues."
|
634 |
Â
msgstr ""
|
635 |
Â
|
636 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
637 |
Â
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."
|
638 |
Â
msgstr ""
|
639 |
Â
|
640 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
641 |
Â
msgid "Click To Re-Connect"
|
642 |
Â
msgstr ""
|
643 |
Â
|
644 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
645 |
Â
msgid "Please try again."
|
646 |
Â
msgstr ""
|
647 |
Â
|
648 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
649 |
Â
msgid "We were not able to connect your Stripe account. Reason: %s"
|
650 |
Â
msgstr ""
|
651 |
Â
|
652 |
-
#: includes/admin/settings/class-wc-stripe-api-settings.php:
|
653 |
Â
msgid "Your Stripe account has been connected to your WooCommerce store. You may now accept payments in Live and Test mode."
|
654 |
Â
msgstr ""
|
655 |
Â
|
@@ -722,27 +824,27 @@ msgstr ""
|
|
722 |
Â
msgid "No matches found"
|
723 |
Â
msgstr ""
|
724 |
Â
|
725 |
-
#: includes/class-wc-stripe-redirect-handler.php:
|
726 |
Â
msgid "Error retrieving payment source. Reason: %s"
|
727 |
Â
msgstr ""
|
728 |
Â
|
729 |
-
#: includes/class-wc-stripe-redirect-handler.php:
|
730 |
Â
msgid "This request is invalid. Please try again."
|
731 |
Â
msgstr ""
|
732 |
Â
|
733 |
-
#: includes/class-wc-stripe-redirect-handler.php:
|
734 |
Â
msgid "Payment authorization failed. Please select another payment method."
|
735 |
Â
msgstr ""
|
736 |
Â
|
737 |
-
#: includes/class-wc-stripe-redirect-handler.php:
|
738 |
Â
msgid "Payment authorization failed."
|
739 |
Â
msgstr ""
|
740 |
Â
|
741 |
-
#: includes/class-wc-stripe-rest-api.php:
|
742 |
Â
msgid "%1$s is an invalid controller name."
|
743 |
Â
msgstr ""
|
744 |
Â
|
745 |
-
#: includes/class-wc-stripe-update.php:
|
746 |
Â
msgid "Thank you for updating Stripe for WooCommerce to version %1$s."
|
747 |
Â
msgstr ""
|
748 |
Â
|
@@ -767,42 +869,42 @@ msgstr ""
|
|
767 |
Â
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."
|
768 |
Â
msgstr ""
|
769 |
Â
|
770 |
-
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:
|
771 |
Â
msgid "Domain registered successfully. You can confirm in your Stripe Dashboard at https://dashboard.stripe.com/account/apple_pay."
|
772 |
Â
msgstr ""
|
773 |
Â
|
774 |
-
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:
|
775 |
Â
msgid "You must configure your secret key before creating webhooks."
|
776 |
Â
msgstr ""
|
777 |
Â
|
778 |
-
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:
|
779 |
Â
msgid "There is already a webhook configured for this site. If you want to delete the webhook, login to your Stripe Dashboard."
|
780 |
Â
msgstr ""
|
781 |
Â
|
782 |
-
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:
|
783 |
Â
msgid "Webhook created in Stripe for %s environment. You can test your webhook by logging in to the Stripe dashboard"
|
784 |
Â
msgstr ""
|
785 |
Â
|
786 |
-
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:
|
787 |
Â
msgid "You must enter your API keys or connect the plugin before performing a connection test."
|
788 |
Â
msgstr ""
|
789 |
Â
|
790 |
-
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:
|
791 |
Â
msgid "Mode: %s. Invalid secret key. Please check your entry."
|
792 |
Â
msgstr ""
|
793 |
Â
|
794 |
-
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:
|
795 |
-
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:
|
796 |
Â
msgid "Mode: %s. Invalid publishable key. Please check your entry."
|
797 |
Â
msgstr ""
|
798 |
Â
|
799 |
-
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:
|
800 |
Â
msgid "Connection test to Stripe was successful. Mode: %s."
|
801 |
Â
msgstr ""
|
802 |
Â
|
803 |
Â
#: includes/controllers/class-wc-stripe-controller-googlepay.php:85
|
804 |
Â
#: packages/blocks/assets/js/payment-methods/googlepay/hooks/use-payments-client.js:155
|
805 |
-
#: packages/blocks/build/commons.js:
|
806 |
Â
msgid "Your shipping address is not serviceable."
|
807 |
Â
msgstr ""
|
808 |
Â
|
@@ -838,7 +940,7 @@ msgid "You are not authorized to update this order."
|
|
838 |
Â
msgstr ""
|
839 |
Â
|
840 |
Â
#: includes/controllers/class-wc-stripe-controller-source.php:51
|
841 |
-
#: includes/controllers/class-wc-stripe-controller-source.php:
|
842 |
Â
msgid "Error updating source."
|
843 |
Â
msgstr ""
|
844 |
Â
|
@@ -882,179 +984,179 @@ msgstr ""
|
|
882 |
Â
msgid "You must set the API mode to live in order to enable the Plaid development environment."
|
883 |
Â
msgstr ""
|
884 |
Â
|
885 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:25
|
886 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:26
|
Â
|
|
887 |
Â
#: packages/blocks/assets/js/payment-methods/local-payment/afterpay.js:80
|
888 |
-
#: packages/blocks/build/commons.js:
|
889 |
Â
msgid "Afterpay"
|
890 |
Â
msgstr ""
|
891 |
Â
|
892 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
893 |
Â
msgid "Afterpay gateway that integrates with your Stripe account."
|
894 |
Â
msgstr ""
|
895 |
Â
|
896 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
897 |
Â
msgid "Complete Order"
|
898 |
Â
msgstr ""
|
899 |
Â
|
900 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
901 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:
|
902 |
Â
#: includes/gateways/settings/applepay-settings.php:56
|
903 |
Â
#: includes/gateways/settings/cc-settings.php:53
|
904 |
Â
#: includes/gateways/settings/payment-request-settings.php:57
|
905 |
Â
msgid "This option determines whether the customer's funds are captured immediately or authorized and can be captured at a later date."
|
906 |
Â
msgstr ""
|
907 |
Â
|
908 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
909 |
Â
#: includes/gateways/settings/applepay-settings.php:60
|
910 |
Â
#: includes/gateways/settings/googlepay-settings.php:78
|
911 |
Â
#: includes/gateways/settings/payment-request-settings.php:61
|
912 |
Â
msgid "Payment Sections"
|
913 |
Â
msgstr ""
|
914 |
Â
|
915 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
916 |
Â
#: includes/gateways/settings/applepay-settings.php:63
|
917 |
Â
#: includes/gateways/settings/googlepay-settings.php:81
|
918 |
Â
#: includes/gateways/settings/payment-request-settings.php:64
|
919 |
Â
msgid "Product Page"
|
920 |
Â
msgstr ""
|
921 |
Â
|
922 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
923 |
Â
#: includes/gateways/settings/applepay-settings.php:64
|
924 |
Â
#: includes/gateways/settings/googlepay-settings.php:82
|
925 |
Â
#: includes/gateways/settings/payment-request-settings.php:65
|
926 |
Â
msgid "Cart Page"
|
927 |
Â
msgstr ""
|
928 |
Â
|
929 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
930 |
Â
#: includes/gateways/settings/applepay-settings.php:65
|
931 |
Â
#: includes/gateways/settings/googlepay-settings.php:83
|
932 |
Â
#: includes/gateways/settings/payment-request-settings.php:66
|
933 |
Â
msgid "Mini Cart"
|
934 |
Â
msgstr ""
|
935 |
Â
|
936 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
937 |
Â
msgid "These are the additional sections where the Afterpay messaging will be enabled. You can control individual products via the Edit product page."
|
938 |
Â
msgstr ""
|
939 |
Â
|
940 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
941 |
Â
msgid "Hide If Ineligible"
|
942 |
Â
msgstr ""
|
943 |
Â
|
944 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
945 |
Â
msgid "If enabled, Afterpay won't show when the products in the cart are not eligible."
|
946 |
Â
msgstr ""
|
947 |
Â
|
948 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
949 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
950 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
951 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:
|
952 |
Â
#: includes/gateways/settings/googlepay-settings.php:106
|
953 |
Â
msgid "Icon"
|
954 |
Â
msgstr ""
|
955 |
Â
|
956 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:89
|
957 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:148
|
958 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:207
|
959 |
-
msgid "Black on mint"
|
960 |
-
msgstr ""
|
961 |
-
|
962 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:90
|
963 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:149
|
964 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:208
|
965 |
-
msgid "Black on
|
966 |
Â
msgstr ""
|
967 |
Â
|
968 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:91
|
969 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:150
|
970 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:209
|
971 |
-
msgid "
|
972 |
Â
msgstr ""
|
973 |
Â
|
974 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:92
|
975 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:151
|
976 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:210
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
977 |
Â
msgid "White on black"
|
978 |
Â
msgstr ""
|
979 |
Â
|
980 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
981 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
982 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
983 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:
|
984 |
Â
msgid "This is the icon style that appears next to the gateway on the checkout page."
|
985 |
Â
msgstr ""
|
986 |
Â
|
987 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
988 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
989 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
990 |
Â
msgid "Intro text"
|
991 |
Â
msgstr ""
|
992 |
Â
|
993 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
994 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
995 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
996 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
997 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
998 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
999 |
Â
msgid "Modal link style"
|
1000 |
Â
msgstr ""
|
1001 |
Â
|
1002 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:113
|
1003 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:172
|
1004 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:231
|
1005 |
-
msgid "More info text"
|
1006 |
-
msgstr ""
|
1007 |
-
|
1008 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:114
|
1009 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:173
|
1010 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:232
|
1011 |
-
msgid "
|
1012 |
Â
msgstr ""
|
1013 |
Â
|
1014 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:115
|
1015 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:174
|
1016 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:233
|
1017 |
-
msgid "
|
1018 |
Â
msgstr ""
|
1019 |
Â
|
1020 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
1021 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
1022 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
1023 |
-
msgid "
|
1024 |
Â
msgstr ""
|
1025 |
Â
|
1026 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
1027 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
1028 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
1029 |
-
msgid "
|
1030 |
Â
msgstr ""
|
1031 |
Â
|
1032 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:126
|
1033 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:185
|
1034 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:244
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
1035 |
Â
#: includes/gateways/settings/googlepay-settings.php:127
|
1036 |
Â
msgid "White"
|
1037 |
Â
msgstr ""
|
1038 |
Â
|
1039 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
1040 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
1041 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
1042 |
Â
msgid "This is the theme color for the Afterpay info modal."
|
1043 |
Â
msgstr ""
|
1044 |
Â
|
1045 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
1046 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
1047 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
1048 |
Â
msgid "Show interest free"
|
1049 |
Â
msgstr ""
|
1050 |
Â
|
1051 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
1052 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
1053 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
1054 |
Â
msgid "If enabled, the Afterpay message will contain the interest free text."
|
1055 |
Â
msgstr ""
|
1056 |
Â
|
1057 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:
|
1058 |
Â
msgid "Store currency must be %s for Afterpay to show because your Stripe account is registered in %s. This is a requirement of Afterpay."
|
1059 |
Â
msgstr ""
|
1060 |
Â
|
@@ -1133,20 +1235,20 @@ msgid "Boleto gateway that integrates with your Stripe account."
|
|
1133 |
Â
msgstr ""
|
1134 |
Â
|
1135 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-boleto.php:38
|
1136 |
-
#: includes/wc-stripe-functions.php:
|
1137 |
Â
msgid "Please enter a valid CPF / CNPJ"
|
1138 |
Â
msgstr ""
|
1139 |
Â
|
1140 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-cc.php:
|
1141 |
Â
#: includes/gateways/settings/cc-settings.php:22
|
1142 |
Â
msgid "Credit Cards"
|
1143 |
Â
msgstr ""
|
1144 |
Â
|
1145 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-cc.php:
|
1146 |
Â
msgid "Stripe Credit Cards"
|
1147 |
Â
msgstr ""
|
1148 |
Â
|
1149 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-cc.php:
|
1150 |
Â
msgid "Credit card gateway that integrates with your Stripe account."
|
1151 |
Â
msgstr ""
|
1152 |
Â
|
@@ -1221,7 +1323,7 @@ msgstr ""
|
|
1221 |
Â
msgid "Ideal gateway that integrates with your Stripe account."
|
1222 |
Â
msgstr ""
|
1223 |
Â
|
1224 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:
|
1225 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:26
|
1226 |
Â
msgid "Klarna"
|
1227 |
Â
msgstr ""
|
@@ -1230,60 +1332,14 @@ msgstr ""
|
|
1230 |
Â
msgid "Klarna gateway that integrates with your Stripe account."
|
1231 |
Â
msgstr ""
|
1232 |
Â
|
1233 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:
|
1234 |
Â
msgid "Black text"
|
1235 |
Â
msgstr ""
|
1236 |
Â
|
1237 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:
|
1238 |
Â
msgid "Pink background black text"
|
1239 |
Â
msgstr ""
|
1240 |
Â
|
1241 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:100
|
1242 |
-
msgid "Payment Categories"
|
1243 |
-
msgstr ""
|
1244 |
-
|
1245 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:106
|
1246 |
-
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."
|
1247 |
-
msgstr ""
|
1248 |
-
|
1249 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:112
|
1250 |
-
msgid "Use Stripe translation"
|
1251 |
-
msgstr ""
|
1252 |
-
|
1253 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:116
|
1254 |
-
msgid "If enabled, the payment option labels will use the Stripe translated text."
|
1255 |
-
msgstr ""
|
1256 |
-
|
1257 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:253
|
1258 |
-
msgid "Fee total"
|
1259 |
-
msgstr ""
|
1260 |
-
|
1261 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:318
|
1262 |
-
msgid "Fee"
|
1263 |
-
msgstr ""
|
1264 |
-
|
1265 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:353
|
1266 |
-
msgid "Pay Now"
|
1267 |
-
msgstr ""
|
1268 |
-
|
1269 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:354
|
1270 |
-
msgid "Pay Later"
|
1271 |
-
msgstr ""
|
1272 |
-
|
1273 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:355
|
1274 |
-
msgid "Pay Over Time"
|
1275 |
-
msgstr ""
|
1276 |
-
|
1277 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:368
|
1278 |
-
msgid "Click %1$shere%2$s for Klarna test payment methods."
|
1279 |
-
msgstr ""
|
1280 |
-
|
1281 |
-
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:374
|
1282 |
-
#: packages/blocks/assets/js/payment-methods/local-payment/klarna/hooks/use-process-payment.js:31
|
1283 |
-
#: packages/blocks/build/commons.js:4093
|
1284 |
-
msgid "Your purchase is not approved."
|
1285 |
-
msgstr ""
|
1286 |
-
|
1287 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-multibanco.php:23
|
1288 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-multibanco.php:26
|
1289 |
Â
msgid "Multibanco"
|
@@ -1397,116 +1453,140 @@ msgstr ""
|
|
1397 |
Â
|
1398 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-wechat.php:91
|
1399 |
Â
#: packages/blocks/assets/js/payment-methods/local-payment/wechat.js:130
|
1400 |
-
#: packages/blocks/build/commons.js:
|
1401 |
Â
msgid "Scan the QR code using your WeChat app. Once scanned click the Place Order button."
|
1402 |
Â
msgstr ""
|
1403 |
Â
|
1404 |
-
#: includes/gateways/settings/ach-settings.php:
|
1405 |
Â
msgid "For US customers only."
|
1406 |
Â
msgstr ""
|
1407 |
Â
|
1408 |
-
#: includes/gateways/settings/ach-settings.php:
|
1409 |
Â
msgid "Read through our %1$sdocumentation%2$s to configure ACH payments"
|
1410 |
Â
msgstr ""
|
1411 |
Â
|
1412 |
-
#: includes/gateways/settings/ach-settings.php:
|
1413 |
Â
msgid "If enabled, your site can accept ACH payments through Stripe."
|
1414 |
Â
msgstr ""
|
1415 |
Â
|
1416 |
-
#: includes/gateways/settings/ach-settings.php:
|
1417 |
Â
msgid "Plaid Environment"
|
1418 |
Â
msgstr ""
|
1419 |
Â
|
1420 |
-
#: includes/gateways/settings/ach-settings.php:
|
1421 |
Â
msgid "Sandbox"
|
1422 |
Â
msgstr ""
|
1423 |
Â
|
1424 |
-
#: includes/gateways/settings/ach-settings.php:
|
1425 |
Â
msgid "Development"
|
1426 |
Â
msgstr ""
|
1427 |
Â
|
1428 |
-
#: includes/gateways/settings/ach-settings.php:
|
1429 |
Â
msgid "Production"
|
1430 |
Â
msgstr ""
|
1431 |
Â
|
1432 |
-
#: includes/gateways/settings/ach-settings.php:
|
1433 |
Â
msgid "The active Plaid environment. You must set API mode to live to use Plaid's development environment."
|
1434 |
Â
msgstr ""
|
1435 |
Â
|
1436 |
-
#: includes/gateways/settings/ach-settings.php:
|
1437 |
Â
msgid "Plaid Keys"
|
1438 |
Â
msgstr ""
|
1439 |
Â
|
1440 |
-
#: includes/gateways/settings/ach-settings.php:
|
1441 |
Â
msgid "ID that identifies your Plaid account."
|
1442 |
Â
msgstr ""
|
1443 |
Â
|
1444 |
-
#: includes/gateways/settings/ach-settings.php:
|
1445 |
Â
msgid "Plaid Secrets"
|
1446 |
Â
msgstr ""
|
1447 |
Â
|
1448 |
-
#: includes/gateways/settings/ach-settings.php:
|
1449 |
Â
msgid "Sandbox Secret"
|
1450 |
Â
msgstr ""
|
1451 |
Â
|
1452 |
-
#: includes/gateways/settings/ach-settings.php:
|
1453 |
Â
msgid "Key that acts as a password when connecting to Plaid's sandbox environment."
|
1454 |
Â
msgstr ""
|
1455 |
Â
|
1456 |
-
#: includes/gateways/settings/ach-settings.php:
|
1457 |
Â
msgid "Development Secret"
|
1458 |
Â
msgstr ""
|
1459 |
Â
|
1460 |
-
#: includes/gateways/settings/ach-settings.php:
|
1461 |
Â
msgid "Development allows you to test real bank credentials with test transactions."
|
1462 |
Â
msgstr ""
|
1463 |
Â
|
1464 |
-
#: includes/gateways/settings/ach-settings.php:
|
1465 |
Â
msgid "Production Secret"
|
1466 |
Â
msgstr ""
|
1467 |
Â
|
1468 |
-
#: includes/gateways/settings/ach-settings.php:
|
1469 |
Â
msgid "Key that acts as a password when connecting to Plaid's production environment."
|
1470 |
Â
msgstr ""
|
1471 |
Â
|
1472 |
-
#: includes/gateways/settings/ach-settings.php:
|
1473 |
Â
msgid "ACH Payment"
|
1474 |
Â
msgstr ""
|
1475 |
Â
|
1476 |
-
#: includes/gateways/settings/ach-settings.php:
|
1477 |
Â
#: includes/tokens/class-wc-payment-token-stripe-ach.php:92
|
1478 |
Â
msgid "Bank Payment"
|
1479 |
Â
msgstr ""
|
1480 |
Â
|
1481 |
-
#: includes/gateways/settings/ach-settings.php:
|
1482 |
Â
msgid "Client Name"
|
1483 |
Â
msgstr ""
|
1484 |
Â
|
1485 |
-
#: includes/gateways/settings/ach-settings.php:
|
1486 |
Â
msgid "The name that appears on the ACH payment screen."
|
1487 |
Â
msgstr ""
|
1488 |
Â
|
1489 |
-
#: includes/gateways/settings/ach-settings.php:
|
1490 |
Â
msgid "ACH Display"
|
1491 |
Â
msgstr ""
|
1492 |
Â
|
1493 |
-
#: includes/gateways/settings/ach-settings.php:
|
1494 |
-
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
1495 |
Â
msgstr ""
|
1496 |
Â
|
1497 |
Â
#: includes/gateways/settings/ach-settings.php:117
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
1498 |
Â
msgid "None"
|
1499 |
Â
msgstr ""
|
1500 |
Â
|
1501 |
-
#: includes/gateways/settings/ach-settings.php:
|
1502 |
Â
msgid "Amount"
|
1503 |
Â
msgstr ""
|
1504 |
Â
|
1505 |
-
#: includes/gateways/settings/ach-settings.php:
|
1506 |
Â
msgid "Percentage"
|
1507 |
Â
msgstr ""
|
1508 |
Â
|
1509 |
-
#: includes/gateways/settings/ach-settings.php:
|
1510 |
Â
msgid "You can assign a fee to the order for ACH payments. Amount is a static amount and percentage is a percentage of the cart amount."
|
1511 |
Â
msgstr ""
|
1512 |
Â
|
@@ -1540,27 +1620,6 @@ msgstr ""
|
|
1540 |
Â
msgid "Top of Checkout"
|
1541 |
Â
msgstr ""
|
1542 |
Â
|
1543 |
-
#: includes/gateways/settings/applepay-settings.php:73
|
1544 |
-
#: includes/gateways/settings/cc-settings.php:57
|
1545 |
-
#: includes/gateways/settings/googlepay-settings.php:91
|
1546 |
-
#: includes/gateways/settings/payment-request-settings.php:74
|
1547 |
-
msgid "Order Status"
|
1548 |
-
msgstr ""
|
1549 |
-
|
1550 |
-
#: includes/gateways/settings/applepay-settings.php:76
|
1551 |
-
#: includes/gateways/settings/cc-settings.php:60
|
1552 |
-
#: includes/gateways/settings/googlepay-settings.php:94
|
1553 |
-
#: includes/gateways/settings/payment-request-settings.php:77
|
1554 |
-
msgid "Default"
|
1555 |
-
msgstr ""
|
1556 |
-
|
1557 |
-
#: includes/gateways/settings/applepay-settings.php:78
|
1558 |
-
#: includes/gateways/settings/cc-settings.php:62
|
1559 |
-
#: includes/gateways/settings/googlepay-settings.php:96
|
1560 |
-
#: includes/gateways/settings/payment-request-settings.php:79
|
1561 |
-
msgid "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."
|
1562 |
-
msgstr ""
|
1563 |
-
|
1564 |
Â
#: includes/gateways/settings/applepay-settings.php:82
|
1565 |
Â
#: includes/gateways/settings/payment-request-settings.php:83
|
1566 |
Â
msgid "Button Settings"
|
@@ -1945,249 +2004,265 @@ msgstr ""
|
|
1945 |
Â
msgid "Kind Regards,"
|
1946 |
Â
msgstr ""
|
1947 |
Â
|
1948 |
-
#: includes/wc-stripe-functions.php:
|
1949 |
Â
msgid "Bootstrap form"
|
1950 |
Â
msgstr ""
|
1951 |
Â
|
1952 |
-
#: includes/wc-stripe-functions.php:
|
1953 |
Â
msgid "Simple form"
|
1954 |
Â
msgstr ""
|
1955 |
Â
|
1956 |
-
#: includes/wc-stripe-functions.php:
|
1957 |
Â
msgid "Minimalist form"
|
1958 |
Â
msgstr ""
|
1959 |
Â
|
1960 |
-
#: includes/wc-stripe-functions.php:
|
1961 |
Â
msgid "Inline Form"
|
1962 |
Â
msgstr ""
|
1963 |
Â
|
1964 |
-
#: includes/wc-stripe-functions.php:
|
1965 |
Â
msgid "Rounded Form"
|
1966 |
Â
msgstr ""
|
1967 |
Â
|
1968 |
-
#: includes/wc-stripe-functions.php:
|
1969 |
Â
msgid "There was an error processing your credit card."
|
1970 |
Â
msgstr ""
|
1971 |
Â
|
1972 |
-
#: includes/wc-stripe-functions.php:
|
1973 |
Â
msgid "Your card number is incomplete."
|
1974 |
Â
msgstr ""
|
1975 |
Â
|
1976 |
-
#: includes/wc-stripe-functions.php:
|
1977 |
Â
msgid "Your card's expiration date is incomplete."
|
1978 |
Â
msgstr ""
|
1979 |
Â
|
1980 |
-
#: includes/wc-stripe-functions.php:
|
1981 |
Â
msgid "Your card's security code is incomplete."
|
1982 |
Â
msgstr ""
|
1983 |
Â
|
1984 |
-
#: includes/wc-stripe-functions.php:
|
1985 |
Â
msgid "Your card's zip code is incomplete."
|
1986 |
Â
msgstr ""
|
1987 |
Â
|
1988 |
-
#: includes/wc-stripe-functions.php:
|
1989 |
Â
msgid "The card number is incorrect. Check the card's number or use a different card."
|
1990 |
Â
msgstr ""
|
1991 |
Â
|
1992 |
-
#: includes/wc-stripe-functions.php:
|
1993 |
Â
msgid "The card's security code is incorrect. Check the card's security code or use a different card."
|
1994 |
Â
msgstr ""
|
1995 |
Â
|
1996 |
-
#: includes/wc-stripe-functions.php:
|
1997 |
Â
msgid "The card's ZIP code is incorrect. Check the card's ZIP code or use a different card."
|
1998 |
Â
msgstr ""
|
1999 |
Â
|
2000 |
-
#: includes/wc-stripe-functions.php:
|
2001 |
-
#: includes/wc-stripe-functions.php:
|
2002 |
Â
msgid "The card number is invalid. Check the card details or use a different card."
|
2003 |
Â
msgstr ""
|
2004 |
Â
|
2005 |
-
#: includes/wc-stripe-functions.php:
|
2006 |
Â
msgid "This value provided to the field contains characters that are unsupported by the field."
|
2007 |
Â
msgstr ""
|
2008 |
Â
|
2009 |
-
#: includes/wc-stripe-functions.php:
|
2010 |
Â
msgid "The card's security code is invalid. Check the card's security code or use a different card."
|
2011 |
Â
msgstr ""
|
2012 |
Â
|
2013 |
-
#: includes/wc-stripe-functions.php:
|
2014 |
Â
msgid "The card's expiration month is incorrect. Check the expiration date or use a different card."
|
2015 |
Â
msgstr ""
|
2016 |
Â
|
2017 |
-
#: includes/wc-stripe-functions.php:
|
2018 |
Â
msgid "The card's expiration year is incorrect. Check the expiration date or use a different card."
|
2019 |
Â
msgstr ""
|
2020 |
Â
|
2021 |
-
#: includes/wc-stripe-functions.php:
|
2022 |
Â
msgid "The card's address is incorrect. Check the card's address or use a different card."
|
2023 |
Â
msgstr ""
|
2024 |
Â
|
2025 |
-
#: includes/wc-stripe-functions.php:
|
2026 |
Â
msgid "The card has expired. Check the expiration date or use a different card."
|
2027 |
Â
msgstr ""
|
2028 |
Â
|
2029 |
-
#: includes/wc-stripe-functions.php:
|
2030 |
Â
msgid "The card has been declined."
|
2031 |
Â
msgstr ""
|
2032 |
Â
|
2033 |
-
#: includes/wc-stripe-functions.php:
|
2034 |
Â
msgid "Your card's expiration year is in the past."
|
2035 |
Â
msgstr ""
|
2036 |
Â
|
2037 |
-
#: includes/wc-stripe-functions.php:
|
2038 |
Â
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."
|
2039 |
Â
msgstr ""
|
2040 |
Â
|
2041 |
-
#: includes/wc-stripe-functions.php:
|
2042 |
Â
msgid "The specified amount is greater than the maximum amount allowed. Use a lower amount and try again."
|
2043 |
Â
msgstr ""
|
2044 |
Â
|
2045 |
-
#: includes/wc-stripe-functions.php:
|
2046 |
Â
msgid "The specified amount is less than the minimum amount allowed. Use a higher amount and try again."
|
2047 |
Â
msgstr ""
|
2048 |
Â
|
2049 |
-
#: includes/wc-stripe-functions.php:
|
2050 |
Â
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."
|
2051 |
Â
msgstr ""
|
2052 |
Â
|
2053 |
-
#: includes/wc-stripe-functions.php:
|
2054 |
Â
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."
|
2055 |
Â
msgstr ""
|
2056 |
Â
|
2057 |
-
#: includes/wc-stripe-functions.php:
|
2058 |
Â
msgid "The bank account provided can not be used to charge, either because it is not verified yet or it is not supported."
|
2059 |
Â
msgstr ""
|
2060 |
Â
|
2061 |
-
#: includes/wc-stripe-functions.php:
|
2062 |
Â
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."
|
2063 |
Â
msgstr ""
|
2064 |
Â
|
2065 |
-
#: includes/wc-stripe-functions.php:
|
2066 |
Â
msgid "The bank account provided cannot be used for payouts. A different bank account must be used."
|
2067 |
Â
msgstr ""
|
2068 |
Â
|
2069 |
-
#: includes/wc-stripe-functions.php:
|
2070 |
Â
msgid "Your Connect platform is attempting to share an unverified bank account with a connected account."
|
2071 |
Â
msgstr ""
|
2072 |
Â
|
2073 |
-
#: includes/wc-stripe-functions.php:
|
2074 |
Â
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."
|
2075 |
Â
msgstr ""
|
2076 |
Â
|
2077 |
-
#: includes/wc-stripe-functions.php:
|
2078 |
Â
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."
|
2079 |
Â
msgstr ""
|
2080 |
Â
|
2081 |
-
#: includes/wc-stripe-functions.php:
|
2082 |
Â
msgid "The charge you're attempting to capture has already been captured. Update the request with an uncaptured charge ID."
|
2083 |
Â
msgstr ""
|
2084 |
Â
|
2085 |
-
#: includes/wc-stripe-functions.php:
|
2086 |
Â
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."
|
2087 |
Â
msgstr ""
|
2088 |
Â
|
2089 |
-
#: includes/wc-stripe-functions.php:
|
2090 |
Â
msgid "The charge you're attempting to refund has been charged back. Check the disputes documentation to learn how to respond to the dispute."
|
2091 |
Â
msgstr ""
|
2092 |
Â
|
2093 |
-
#: includes/wc-stripe-functions.php:
|
2094 |
Â
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."
|
2095 |
Â
msgstr ""
|
2096 |
Â
|
2097 |
-
#: includes/wc-stripe-functions.php:
|
2098 |
Â
msgid "The charge cannot be captured as the authorization has expired. Auth and capture charges must be captured within seven days."
|
2099 |
Â
msgstr ""
|
2100 |
Â
|
2101 |
-
#: includes/wc-stripe-functions.php:
|
2102 |
Â
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."
|
2103 |
Â
msgstr ""
|
2104 |
Â
|
2105 |
-
#: includes/wc-stripe-functions.php:
|
2106 |
Â
msgid "The email address is invalid (e.g., not properly formatted). Check that the email address is properly formatted and only includes allowed characters."
|
2107 |
Â
msgstr ""
|
2108 |
Â
|
2109 |
-
#: includes/wc-stripe-functions.php:
|
2110 |
Â
msgid "The idempotency key provided is currently being used in another request. This occurs if your integration is making duplicate requests simultaneously."
|
2111 |
Â
msgstr ""
|
2112 |
Â
|
2113 |
-
#: includes/wc-stripe-functions.php:
|
2114 |
Â
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."
|
2115 |
Â
msgstr ""
|
2116 |
Â
|
2117 |
-
#: includes/wc-stripe-functions.php:
|
2118 |
Â
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."
|
2119 |
Â
msgstr ""
|
2120 |
Â
|
2121 |
-
#: includes/wc-stripe-functions.php:
|
2122 |
Â
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."
|
2123 |
Â
msgstr ""
|
2124 |
Â
|
2125 |
-
#: includes/wc-stripe-functions.php:
|
2126 |
Â
msgid "The ZIP code provided was incorrect."
|
2127 |
Â
msgstr ""
|
2128 |
Â
|
2129 |
-
#: includes/wc-stripe-functions.php:
|
2130 |
Â
msgid "An error occurred while processing the card. Try again later or with a different payment method."
|
2131 |
Â
msgstr ""
|
2132 |
Â
|
2133 |
-
#: includes/wc-stripe-functions.php:
|
2134 |
Â
msgid "The card does not support this type of purchase."
|
2135 |
Â
msgstr ""
|
2136 |
Â
|
2137 |
-
#: includes/wc-stripe-functions.php:
|
2138 |
-
#: includes/wc-stripe-functions.php:
|
2139 |
-
#: includes/wc-stripe-functions.php:
|
2140 |
Â
msgid "The card has been declined for an unknown reason."
|
2141 |
Â
msgstr ""
|
2142 |
Â
|
2143 |
-
#: includes/wc-stripe-functions.php:
|
2144 |
Â
msgid "The customer has exceeded the balance or credit limit available on their card."
|
2145 |
Â
msgstr ""
|
2146 |
Â
|
2147 |
-
#: includes/wc-stripe-functions.php:
|
2148 |
Â
msgid "The card does not support the specified currency."
|
2149 |
Â
msgstr ""
|
2150 |
Â
|
2151 |
-
#: includes/wc-stripe-functions.php:
|
2152 |
Â
msgid "The payment has been declined as Stripe suspects it is fraudulent."
|
2153 |
Â
msgstr ""
|
2154 |
Â
|
2155 |
-
#: includes/wc-stripe-functions.php:
|
2156 |
Â
msgid "The PIN entered is incorrect. "
|
2157 |
Â
msgstr ""
|
2158 |
Â
|
2159 |
-
#: includes/wc-stripe-functions.php:
|
2160 |
Â
msgid "The card has insufficient funds to complete the purchase."
|
2161 |
Â
msgstr ""
|
2162 |
Â
|
2163 |
-
#: includes/wc-stripe-functions.php:
|
2164 |
Â
msgid "Please select a payment method before proceeding."
|
2165 |
Â
msgstr ""
|
2166 |
Â
|
2167 |
-
#: includes/wc-stripe-functions.php:
|
2168 |
Â
msgid "Please enter your IBAN before proceeding."
|
2169 |
Â
msgstr ""
|
2170 |
Â
|
2171 |
-
#: includes/wc-stripe-functions.php:
|
2172 |
Â
msgid "Please select a bank before proceeding"
|
2173 |
Â
msgstr ""
|
2174 |
Â
|
2175 |
-
#: includes/wc-stripe-functions.php:
|
2176 |
Â
msgid "The IBAN you entered is incomplete."
|
2177 |
Â
msgstr ""
|
2178 |
Â
|
2179 |
-
#: includes/wc-stripe-functions.php:
|
2180 |
Â
msgid "Your card was declined. Your request was in test mode, but you used a real credit card. Only test cards can be used in test mode."
|
2181 |
Â
msgstr ""
|
2182 |
Â
|
2183 |
-
#: includes/wc-stripe-webhook-functions.php:
|
2184 |
Â
msgid "Charge.succeeded webhook received. Payment has been completed."
|
2185 |
Â
msgstr ""
|
2186 |
Â
|
2187 |
-
#: includes/wc-stripe-webhook-functions.php:
|
2188 |
Â
msgid "payment_intent.succeeded webhook received. Payment has been completed."
|
2189 |
Â
msgstr ""
|
2190 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
2191 |
Â
#: packages/blocks/src/Payments/CreditCardPayment.php:27
|
2192 |
Â
#: templates/checkout/credit-card.php:22
|
2193 |
Â
msgid "Save Card"
|
@@ -2212,8 +2287,8 @@ msgstr ""
|
|
2212 |
Â
#: templates/cc-forms/simple.php:12
|
2213 |
Â
#: packages/blocks/assets/js/payment-methods/credit-card/components/bootstrap/index.js:13
|
2214 |
Â
#: packages/blocks/assets/js/payment-methods/credit-card/components/simple/index.js:19
|
2215 |
-
#: packages/blocks/build/commons.js:
|
2216 |
-
#: packages/blocks/build/commons.js:
|
2217 |
Â
msgid "Card Number"
|
2218 |
Â
msgstr ""
|
2219 |
Â
|
@@ -2223,8 +2298,8 @@ msgstr ""
|
|
2223 |
Â
#: templates/cc-forms/simple.php:26
|
2224 |
Â
#: packages/blocks/assets/js/payment-methods/credit-card/components/bootstrap/index.js:24
|
2225 |
Â
#: packages/blocks/assets/js/payment-methods/credit-card/components/simple/index.js:40
|
2226 |
-
#: packages/blocks/build/commons.js:
|
2227 |
-
#: packages/blocks/build/commons.js:
|
2228 |
Â
msgid "CVV"
|
2229 |
Â
msgstr ""
|
2230 |
Â
|
@@ -2244,7 +2319,7 @@ msgstr ""
|
|
2244 |
Â
|
2245 |
Â
#: templates/cc-forms/simple.php:20
|
2246 |
Â
#: packages/blocks/assets/js/payment-methods/credit-card/components/simple/index.js:31
|
2247 |
-
#: packages/blocks/build/commons.js:
|
2248 |
Â
msgid "Expiration"
|
2249 |
Â
msgstr ""
|
2250 |
Â
|
@@ -2254,19 +2329,19 @@ msgstr ""
|
|
2254 |
Â
|
2255 |
Â
#: templates/checkout/ach.php:11
|
2256 |
Â
#: packages/blocks/assets/js/payment-methods/ach/payment-method.js:59
|
2257 |
-
#: packages/blocks/build/commons.js:
|
2258 |
Â
msgid "username"
|
2259 |
Â
msgstr ""
|
2260 |
Â
|
2261 |
Â
#: templates/checkout/ach.php:12
|
2262 |
Â
#: packages/blocks/assets/js/payment-methods/ach/payment-method.js:62
|
2263 |
-
#: packages/blocks/build/commons.js:
|
2264 |
Â
msgid "password"
|
2265 |
Â
msgstr ""
|
2266 |
Â
|
2267 |
Â
#: templates/checkout/ach.php:13
|
2268 |
Â
#: packages/blocks/assets/js/payment-methods/ach/payment-method.js:65
|
2269 |
-
#: packages/blocks/build/commons.js:
|
2270 |
Â
msgid "pin"
|
2271 |
Â
msgstr ""
|
2272 |
Â
|
@@ -2276,7 +2351,7 @@ msgstr ""
|
|
2276 |
Â
|
2277 |
Â
#: templates/checkout/afterpay.php:11
|
2278 |
Â
#: packages/blocks/assets/js/payment-methods/local-payment/afterpay.js:66
|
2279 |
-
#: packages/blocks/build/commons.js:
|
2280 |
Â
msgid "After clicking \"%s\", you will be redirected to Afterpay to complete your purchase securely."
|
2281 |
Â
msgstr ""
|
2282 |
Â
|
@@ -2286,25 +2361,25 @@ msgstr ""
|
|
2286 |
Â
|
2287 |
Â
#: templates/checkout/boleto.php:17
|
2288 |
Â
#: packages/blocks/assets/js/payment-methods/local-payment/boleto.js:48
|
2289 |
-
#: packages/blocks/build/commons.js:
|
2290 |
Â
msgid "Test mode values"
|
2291 |
Â
msgstr ""
|
2292 |
Â
|
2293 |
Â
#: templates/checkout/boleto.php:27
|
2294 |
Â
#: packages/blocks/assets/js/payment-methods/local-payment/boleto.js:58
|
2295 |
-
#: packages/blocks/build/commons.js:
|
2296 |
Â
msgid "Accepted formats"
|
2297 |
Â
msgstr ""
|
2298 |
Â
|
2299 |
Â
#: templates/checkout/boleto.php:29
|
2300 |
Â
#: packages/blocks/assets/js/payment-methods/local-payment/boleto.js:61
|
2301 |
-
#: packages/blocks/build/commons.js:
|
2302 |
Â
msgid "XXX.XXX.XXX-XX or XXXXXXXXXXX"
|
2303 |
Â
msgstr ""
|
2304 |
Â
|
2305 |
Â
#: templates/checkout/boleto.php:32
|
2306 |
Â
#: packages/blocks/assets/js/payment-methods/local-payment/boleto.js:65
|
2307 |
-
#: packages/blocks/build/commons.js:
|
2308 |
Â
msgid "XX.XXX.XXX/XXXX-XX or XXXXXXXXXXXXXX"
|
2309 |
Â
msgstr ""
|
2310 |
Â
|
@@ -2312,50 +2387,45 @@ msgstr ""
|
|
2312 |
Â
msgid "Express Checkout"
|
2313 |
Â
msgstr ""
|
2314 |
Â
|
2315 |
-
#: templates/checkout/klarna.php:
|
2316 |
-
#: packages/blocks/assets/js/payment-methods/local-payment/klarna
|
2317 |
-
#: packages/blocks/build/commons.js:
|
2318 |
Â
msgid "Test mode sms"
|
2319 |
Â
msgstr ""
|
2320 |
Â
|
2321 |
Â
#: packages/blocks/assets/js/payment-methods/ach/payment-method.js:56
|
2322 |
-
#: packages/blocks/build/commons.js:
|
2323 |
Â
msgid "Test Credentials"
|
2324 |
Â
msgstr ""
|
2325 |
Â
|
2326 |
Â
#: packages/blocks/assets/js/payment-methods/credit-card/components/custom-card-form.js:73
|
2327 |
-
#: packages/blocks/build/commons.js:
|
2328 |
Â
msgid "%s is not a valid blocks Stripe custom form. Please choose another custom form option in the Credit Card Settings."
|
2329 |
Â
msgstr ""
|
2330 |
Â
|
2331 |
Â
#: packages/blocks/assets/js/payment-methods/local-payment/boleto.js:27
|
2332 |
-
#: packages/blocks/build/commons.js:
|
2333 |
Â
msgid "Please enter a valid CPF/CNPJ value"
|
2334 |
Â
msgstr ""
|
2335 |
Â
|
2336 |
Â
#: packages/blocks/assets/js/payment-methods/local-payment/hooks/use-create-source.js:73
|
2337 |
Â
#: packages/blocks/assets/js/payment-methods/local-payment/hooks/use-validate-checkout.js:10
|
2338 |
-
#: packages/blocks/build/commons.js:
|
2339 |
-
#: packages/blocks/build/commons.js:
|
2340 |
Â
msgid "Please enter your payment info before proceeding."
|
2341 |
Â
msgstr ""
|
2342 |
Â
|
2343 |
-
#: packages/blocks/assets/js/payment-methods/local-payment/klarna/index.js:108
|
2344 |
-
#: packages/blocks/build/commons.js:4213
|
2345 |
-
msgid "Please fill out all required fields before paying with Klarna."
|
2346 |
-
msgstr ""
|
2347 |
-
|
2348 |
Â
#: packages/blocks/assets/js/payment-methods/local-payment/wechat.js:51
|
2349 |
-
#: packages/blocks/build/commons.js:
|
2350 |
Â
msgid "Please scan your QR code to continue with payment."
|
2351 |
Â
msgstr ""
|
2352 |
Â
|
2353 |
Â
#: packages/blocks/assets/js/payment-methods/local-payment/wechat.js:97
|
2354 |
-
#: packages/blocks/build/commons.js:
|
2355 |
Â
msgid "Please fill out all the required fields in order to complete the WeChat payment."
|
2356 |
Â
msgstr ""
|
2357 |
Â
|
2358 |
Â
#: packages/blocks/assets/js/payment-methods/local-payment/wechat.js:127
|
2359 |
-
#: packages/blocks/build/commons.js:
|
2360 |
Â
msgid "Test mode: Click the Place Order button to proceed."
|
2361 |
Â
msgstr ""
|
2 |
Â
# This file is distributed under the same license as the Payment Plugins for Stripe WooCommerce plugin.
|
3 |
Â
msgid ""
|
4 |
Â
msgstr ""
|
5 |
+
"Project-Id-Version: Payment Plugins for Stripe WooCommerce 3.3.13\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-11-22T21:35:05+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:115
|
34 |
Â
#: includes/admin/meta-boxes/views/html-product-data.php:14
|
35 |
+
#: includes/gateways/settings/ach-settings.php:13
|
36 |
Â
#: includes/gateways/settings/applepay-settings.php:11
|
37 |
Â
#: includes/gateways/settings/cc-settings.php:4
|
38 |
Â
#: includes/gateways/settings/googlepay-settings.php:23
|
40 |
Â
msgid "Enabled"
|
41 |
Â
msgstr ""
|
42 |
Â
|
43 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:120
|
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:124
|
48 |
+
#: includes/gateways/settings/ach-settings.php:70
|
49 |
Â
#: includes/gateways/settings/applepay-settings.php:20
|
50 |
Â
#: includes/gateways/settings/cc-settings.php:17
|
51 |
Â
#: includes/gateways/settings/googlepay-settings.php:32
|
53 |
Â
msgid "General Settings"
|
54 |
Â
msgstr ""
|
55 |
Â
|
56 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:128
|
57 |
Â
#: includes/admin/meta-boxes/views/html-charge-data-subview.php:47
|
58 |
+
#: includes/gateways/settings/ach-settings.php:74
|
59 |
Â
#: includes/gateways/settings/applepay-settings.php:24
|
60 |
Â
#: includes/gateways/settings/cc-settings.php:21
|
61 |
Â
#: includes/gateways/settings/googlepay-settings.php:42
|
63 |
Â
msgid "Title"
|
64 |
Â
msgstr ""
|
65 |
Â
|
66 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:134
|
67 |
+
#: includes/gateways/settings/ach-settings.php:80
|
68 |
Â
#: includes/gateways/settings/applepay-settings.php:30
|
69 |
Â
#: includes/gateways/settings/cc-settings.php:27
|
70 |
Â
#: includes/gateways/settings/googlepay-settings.php:48
|
72 |
Â
msgid "Description"
|
73 |
Â
msgstr ""
|
74 |
Â
|
75 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:137
|
76 |
+
#: includes/gateways/settings/ach-settings.php:83
|
77 |
Â
#: includes/gateways/settings/applepay-settings.php:33
|
78 |
Â
#: includes/gateways/settings/cc-settings.php:30
|
79 |
Â
#: includes/gateways/settings/googlepay-settings.php:51
|
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:141
|
85 |
+
#: includes/gateways/settings/ach-settings.php:87
|
86 |
Â
msgid "Order Button Text"
|
87 |
Â
msgstr ""
|
88 |
Â
|
89 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:144
|
90 |
+
#: includes/gateways/settings/ach-settings.php:90
|
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:168
|
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:181
|
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:239
|
103 |
Â
msgid "Order %s"
|
104 |
Â
msgstr ""
|
105 |
Â
|
106 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:378
|
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:381
|
111 |
Â
msgid " & billing country is not <strong>%s</strong>"
|
112 |
Â
msgstr ""
|
113 |
Â
|
114 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:383
|
115 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:386
|
116 |
Â
msgid " & billing country is <strong>%s</strong>"
|
117 |
Â
msgstr ""
|
118 |
Â
|
119 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:408
|
120 |
+
msgid "Pay with %s"
|
121 |
+
msgstr ""
|
122 |
+
|
123 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:409
|
124 |
Â
msgid "Please fill out all required fields."
|
125 |
Â
msgstr ""
|
126 |
Â
|
127 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:424
|
128 |
Â
#: includes/controllers/class-wc-stripe-controller-cart.php:134
|
129 |
Â
#: includes/controllers/class-wc-stripe-controller-cart.php:192
|
130 |
Â
#: includes/controllers/class-wc-stripe-controller-googlepay.php:136
|
134 |
Â
msgid "Total"
|
135 |
Â
msgstr ""
|
136 |
Â
|
137 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:495
|
138 |
Â
msgid "User must be logged in."
|
139 |
Â
msgstr ""
|
140 |
Â
|
141 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:521
|
142 |
Â
msgid "Error saving payment method. Reason: %s"
|
143 |
Â
msgstr ""
|
144 |
Â
|
145 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:540
|
146 |
+
#: includes/wc-stripe-webhook-functions.php:232
|
147 |
Â
msgid "Order refunded in Stripe. Amount: %s"
|
148 |
Â
msgstr ""
|
149 |
Â
|
150 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:583
|
151 |
Â
msgid "Order amount captured in Stripe. Amount: %s"
|
152 |
Â
msgstr ""
|
153 |
Â
|
154 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:587
|
155 |
Â
msgid "Error capturing charge in Stripe. Reason: %s"
|
156 |
Â
msgstr ""
|
157 |
Â
|
158 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:608
|
159 |
Â
msgid "Error voiding charge. Reason: %s"
|
160 |
Â
msgstr ""
|
161 |
Â
|
162 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:610
|
163 |
Â
msgid "Charge voided in Stripe."
|
164 |
Â
msgstr ""
|
165 |
Â
|
166 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:788
|
167 |
Â
msgid "n/a"
|
168 |
Â
msgstr ""
|
169 |
Â
|
170 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:816
|
171 |
Â
#: includes/admin/meta-boxes/views/html-order-pay.php:42
|
172 |
Â
msgid "New Card"
|
173 |
Â
msgstr ""
|
174 |
Â
|
175 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:820
|
176 |
Â
#: includes/admin/meta-boxes/views/html-order-pay.php:30
|
177 |
Â
msgid "Saved Cards"
|
178 |
Â
msgstr ""
|
179 |
Â
|
180 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:1015
|
181 |
Â
msgid "Attempt to save payment method failed. Reason: %s"
|
182 |
Â
msgstr ""
|
183 |
Â
|
184 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:1040
|
185 |
Â
msgid "We were not able to save your payment method. To prevent billing issues with your subscription, please add a payment method to the subscription."
|
186 |
Â
msgstr ""
|
187 |
Â
|
188 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:1042
|
189 |
Â
msgid "We were not able to save your payment method. Reason: %s"
|
190 |
Â
msgstr ""
|
191 |
Â
|
192 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:1076
|
193 |
Â
msgid "Payment Method Token"
|
194 |
Â
msgstr ""
|
195 |
Â
|
196 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:1096
|
197 |
Â
msgid "Recurring payment for order failed. Reason: %s"
|
198 |
Â
msgstr ""
|
199 |
Â
|
200 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:1110
|
201 |
Â
msgid "Recurring payment captured in Stripe. Payment method: %s"
|
202 |
Â
msgstr ""
|
203 |
Â
|
204 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:1113
|
205 |
Â
msgid "Recurring payment authorized in Stripe. Payment method: %s"
|
206 |
Â
msgstr ""
|
207 |
Â
|
208 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:1116
|
209 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:1349
|
210 |
Â
msgid "Customer must manually complete payment for payment method %s"
|
211 |
Â
msgstr ""
|
212 |
Â
|
213 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:1150
|
214 |
+
#: includes/abstract/abstract-wc-stripe-payment.php:268
|
215 |
Â
msgid "Order %1$s from %2$s"
|
216 |
Â
msgstr ""
|
217 |
Â
|
218 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:1335
|
219 |
Â
msgid "Pre-order payment for order failed. Reason: %s"
|
220 |
Â
msgstr ""
|
221 |
Â
|
222 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:1343
|
223 |
Â
msgid "Pre-order payment captured in Stripe. Payment method: %s"
|
224 |
Â
msgstr ""
|
225 |
Â
|
226 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:1346
|
227 |
Â
msgid "Pre-order payment authorized in Stripe. Payment method: %s"
|
228 |
Â
msgstr ""
|
229 |
Â
|
230 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:1418
|
231 |
Â
msgid "Cannot process payment"
|
232 |
Â
msgstr ""
|
233 |
Â
|
234 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:1426
|
235 |
Â
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."
|
236 |
Â
msgstr ""
|
237 |
Â
|
238 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:1542
|
239 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:1573
|
Â
|
|
Â
|
|
240 |
Â
msgid "Shipping"
|
241 |
Â
msgstr ""
|
242 |
Â
|
243 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:1550
|
244 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:1576
|
Â
|
|
Â
|
|
245 |
Â
msgid "Discount"
|
246 |
Â
msgstr ""
|
247 |
Â
|
248 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:1553
|
Â
|
|
Â
|
|
249 |
Â
msgid "Tax"
|
250 |
Â
msgstr ""
|
251 |
Â
|
252 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:1583
|
253 |
Â
msgid "Fees"
|
254 |
Â
msgstr ""
|
255 |
Â
|
256 |
+
#: includes/abstract/abstract-wc-payment-gateway-stripe.php:1777
|
257 |
Â
msgid "Error saving payment method for subscription. Reason: %s"
|
258 |
Â
msgstr ""
|
259 |
Â
|
260 |
+
#: includes/abstract/abstract-wc-stripe-payment.php:109
|
261 |
Â
msgid "Charge %1$s is pending. Payment Method: %2$s. Payment will be completed once charge.succeeded webhook received from Stripe."
|
262 |
Â
msgstr ""
|
263 |
Â
|
264 |
+
#: includes/abstract/abstract-wc-stripe-payment.php:119
|
265 |
Â
msgid "Order %1$s successful in Stripe. Charge: %2$s. Payment Method: %3$s"
|
266 |
Â
msgstr ""
|
267 |
Â
|
268 |
+
#: includes/abstract/abstract-wc-stripe-payment.php:120
|
269 |
Â
msgid "charge"
|
270 |
Â
msgstr ""
|
271 |
Â
|
272 |
+
#: includes/abstract/abstract-wc-stripe-payment.php:120
|
273 |
Â
msgid "authorization"
|
274 |
Â
msgstr ""
|
275 |
Â
|
276 |
+
#: includes/abstract/abstract-wc-stripe-payment.php:142
|
277 |
Â
msgid "Transaction Id cannot be empty."
|
278 |
Â
msgstr ""
|
279 |
Â
|
280 |
+
#: includes/abstract/abstract-wc-stripe-payment.php:335
|
281 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-ach.php:121
|
282 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-cc.php:280
|
283 |
Â
msgid "Error processing payment. Reason: %s"
|
284 |
Â
msgstr ""
|
285 |
Â
|
286 |
Â
#: includes/abstract/abstract-wc-stripe-rest-controller.php:58
|
287 |
+
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:290
|
288 |
Â
#: includes/controllers/class-wc-stripe-controller-order-actions.php:325
|
289 |
Â
msgid "You do not have permissions to access this resource."
|
290 |
Â
msgstr ""
|
319 |
Â
msgid "Local Gateways"
|
320 |
Â
msgstr ""
|
321 |
Â
|
322 |
+
#: includes/admin/class-wc-stripe-admin-settings.php:95
|
323 |
+
#: includes/admin/settings/class-wc-stripe-advanced-settings.php:112
|
324 |
Â
msgid "Stripe Email Options"
|
325 |
Â
msgstr ""
|
326 |
Â
|
327 |
+
#: includes/admin/class-wc-stripe-admin-settings.php:99
|
328 |
+
#: includes/admin/settings/class-wc-stripe-advanced-settings.php:116
|
329 |
Â
msgid "Email Receipt"
|
330 |
Â
msgstr ""
|
331 |
Â
|
332 |
+
#: includes/admin/class-wc-stripe-admin-settings.php:102
|
333 |
+
#: includes/admin/settings/class-wc-stripe-advanced-settings.php:118
|
334 |
Â
msgid "If enabled, an email receipt will be sent to the customer by Stripe when the order is processed."
|
335 |
Â
msgstr ""
|
336 |
Â
|
338 |
Â
msgid "Stripe Settings"
|
339 |
Â
msgstr ""
|
340 |
Â
|
341 |
+
#: includes/admin/meta-boxes/class-wc-stripe-admin-order-metaboxes.php:86
|
342 |
Â
msgid "You must create the order before payment can be processed."
|
343 |
Â
msgstr ""
|
344 |
Â
|
345 |
+
#: includes/admin/meta-boxes/class-wc-stripe-admin-order-metaboxes.php:105
|
346 |
+
msgid "Stripe Fee"
|
347 |
+
msgstr ""
|
348 |
+
|
349 |
+
#: includes/admin/meta-boxes/class-wc-stripe-admin-order-metaboxes.php:110
|
350 |
+
msgid "Net payout"
|
351 |
+
msgstr ""
|
352 |
+
|
353 |
Â
#: includes/admin/meta-boxes/views/html-charge-data-subview.php:9
|
354 |
Â
#: includes/admin/views/html-user-profile.php:36
|
355 |
Â
#: includes/admin/views/html-user-profile.php:69
|
364 |
Â
#: includes/admin/meta-boxes/views/html-order-actions.php:48
|
365 |
Â
#: includes/admin/meta-boxes/views/html-order-pay.php:23
|
366 |
Â
#: includes/admin/meta-boxes/views/html-product-data.php:46
|
367 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:53
|
368 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:116
|
369 |
Â
#: includes/gateways/settings/applepay-settings.php:52
|
370 |
Â
#: includes/gateways/settings/cc-settings.php:49
|
371 |
Â
#: includes/gateways/settings/googlepay-settings.php:70
|
382 |
Â
msgstr ""
|
383 |
Â
|
384 |
Â
#: includes/admin/meta-boxes/views/html-charge-data-subview.php:24
|
385 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:40
|
386 |
Â
msgid "Mode"
|
387 |
Â
msgstr ""
|
388 |
Â
|
389 |
Â
#: includes/admin/meta-boxes/views/html-charge-data-subview.php:25
|
390 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:44
|
391 |
+
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:182
|
392 |
Â
msgid "Live"
|
393 |
Â
msgstr ""
|
394 |
Â
|
395 |
Â
#: includes/admin/meta-boxes/views/html-charge-data-subview.php:25
|
396 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:43
|
397 |
+
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:182
|
398 |
Â
msgid "Test"
|
399 |
Â
msgstr ""
|
400 |
Â
|
426 |
Â
#: templates/cc-forms/bootstrap.php:16
|
427 |
Â
#: templates/cc-forms/minimalist.php:30
|
428 |
Â
#: packages/blocks/assets/js/payment-methods/credit-card/components/bootstrap/index.js:19
|
429 |
+
#: packages/blocks/build/commons.js:1645
|
430 |
Â
msgid "Exp"
|
431 |
Â
msgstr ""
|
432 |
Â
|
500 |
Â
|
501 |
Â
#: includes/admin/meta-boxes/views/html-order-pay.php:21
|
502 |
Â
#: includes/admin/meta-boxes/views/html-product-data.php:15
|
503 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:49
|
504 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:112
|
505 |
Â
#: includes/gateways/settings/applepay-settings.php:48
|
506 |
Â
#: includes/gateways/settings/cc-settings.php:45
|
507 |
Â
#: includes/gateways/settings/googlepay-settings.php:66
|
511 |
Â
|
512 |
Â
#: includes/admin/meta-boxes/views/html-order-pay.php:24
|
513 |
Â
#: includes/admin/meta-boxes/views/html-product-data.php:48
|
514 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:54
|
515 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:117
|
516 |
Â
#: includes/gateways/settings/applepay-settings.php:53
|
517 |
Â
#: includes/gateways/settings/cc-settings.php:50
|
518 |
Â
#: includes/gateways/settings/googlepay-settings.php:71
|
552 |
Â
msgid "Save"
|
553 |
Â
msgstr ""
|
554 |
Â
|
555 |
+
#: includes/admin/settings/class-wc-stripe-advanced-settings.php:12
|
556 |
+
#: includes/admin/settings/class-wc-stripe-advanced-settings.php:27
|
557 |
+
msgid "Advanced Settings"
|
558 |
+
msgstr ""
|
559 |
+
|
560 |
+
#: includes/admin/settings/class-wc-stripe-advanced-settings.php:31
|
561 |
+
msgid "This section provides advanced settings that allow you to configure functionality that fits your business process."
|
562 |
+
msgstr ""
|
563 |
+
|
564 |
+
#: includes/admin/settings/class-wc-stripe-advanced-settings.php:34
|
565 |
+
msgid "Display Stripe Fee"
|
566 |
+
msgstr ""
|
567 |
+
|
568 |
+
#: includes/admin/settings/class-wc-stripe-advanced-settings.php:39
|
569 |
+
msgid "If enabled, the Stripe fee will be displayed on the Order Details page. The fee and net payout are displayed in your Stripe account currency."
|
570 |
+
msgstr ""
|
571 |
+
|
572 |
+
#: includes/admin/settings/class-wc-stripe-advanced-settings.php:43
|
573 |
+
msgid "Fee Display Currency"
|
574 |
+
msgstr ""
|
575 |
+
|
576 |
+
#: includes/admin/settings/class-wc-stripe-advanced-settings.php:46
|
577 |
+
msgid "If enabled, the Stripe fee and payout will be displayed in the currency of the order. Stripe by default provides the fee and payout in the Stripe account's currency."
|
578 |
+
msgstr ""
|
579 |
+
|
580 |
+
#: includes/admin/settings/class-wc-stripe-advanced-settings.php:55
|
581 |
+
msgid "Refund On Cancel"
|
582 |
+
msgstr ""
|
583 |
+
|
584 |
+
#: includes/admin/settings/class-wc-stripe-advanced-settings.php:60
|
585 |
+
msgid "If enabled, the plugin will process a payment cancellation or refund within Stripe when the order's status is set to cancelled."
|
586 |
+
msgstr ""
|
587 |
+
|
588 |
+
#: includes/admin/settings/class-wc-stripe-advanced-settings.php:63
|
589 |
+
msgid "Dispute Settings"
|
590 |
+
msgstr ""
|
591 |
+
|
592 |
+
#: includes/admin/settings/class-wc-stripe-advanced-settings.php:67
|
593 |
+
msgid "Dispute Created"
|
594 |
+
msgstr ""
|
595 |
+
|
596 |
+
#: includes/admin/settings/class-wc-stripe-advanced-settings.php:70
|
597 |
+
msgid "If enabled, the plugin will listen for the <strong>charge.dispute.created</strong> webhook event and set the order's status to on-hold by default."
|
598 |
+
msgstr ""
|
599 |
+
|
600 |
+
#: includes/admin/settings/class-wc-stripe-advanced-settings.php:74
|
601 |
+
msgid "Disputed Created Order Status"
|
602 |
+
msgstr ""
|
603 |
+
|
604 |
+
#: includes/admin/settings/class-wc-stripe-advanced-settings.php:78
|
605 |
+
msgid "The status assigned to an order when a dispute is created."
|
606 |
+
msgstr ""
|
607 |
+
|
608 |
+
#: includes/admin/settings/class-wc-stripe-advanced-settings.php:86
|
609 |
+
msgid "Dispute Closed"
|
610 |
+
msgstr ""
|
611 |
+
|
612 |
+
#: includes/admin/settings/class-wc-stripe-advanced-settings.php:89
|
613 |
+
msgid "If enabled, the plugin will listen for the <strong>charge.dispute.closed</strong> webhook event and set the order's status back to status before the dispute was opened."
|
614 |
+
msgstr ""
|
615 |
+
|
616 |
+
#: includes/admin/settings/class-wc-stripe-advanced-settings.php:93
|
617 |
+
msgid "Review Settings"
|
618 |
+
msgstr ""
|
619 |
+
|
620 |
+
#: includes/admin/settings/class-wc-stripe-advanced-settings.php:97
|
621 |
+
msgid "Review Created"
|
622 |
+
msgstr ""
|
623 |
+
|
624 |
+
#: includes/admin/settings/class-wc-stripe-advanced-settings.php:100
|
625 |
+
msgid "If enabled, the plugin will listen for the <strong>review.created</strong> webhook event and set the order's status to on-hold by default."
|
626 |
+
msgstr ""
|
627 |
+
|
628 |
+
#: includes/admin/settings/class-wc-stripe-advanced-settings.php:104
|
629 |
+
msgid "Review Closed"
|
630 |
+
msgstr ""
|
631 |
+
|
632 |
+
#: includes/admin/settings/class-wc-stripe-advanced-settings.php:107
|
633 |
+
msgid "If enabled, the plugin will listen for the <strong>review.closed</strong> webhook event and set the order's status back to the status before the review was opened."
|
634 |
+
msgstr ""
|
635 |
+
|
636 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:16
|
637 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:31
|
638 |
Â
msgid "API Settings"
|
639 |
Â
msgstr ""
|
640 |
Â
|
641 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:35
|
642 |
Â
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."
|
643 |
Â
msgstr ""
|
644 |
Â
|
645 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:48
|
646 |
Â
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."
|
647 |
Â
msgstr ""
|
648 |
Â
|
649 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:53
|
650 |
Â
msgid "Account ID"
|
651 |
Â
msgstr ""
|
652 |
Â
|
653 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:58
|
654 |
Â
msgid "This is your Stripe Connect ID and serves as a unique identifier."
|
655 |
Â
msgstr ""
|
656 |
Â
|
657 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:62
|
658 |
Â
msgid "Connect Stripe Account"
|
659 |
Â
msgstr ""
|
660 |
Â
|
661 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:63
|
662 |
Â
msgid "Click to Connect"
|
663 |
Â
msgstr ""
|
664 |
Â
|
665 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:65
|
666 |
Â
msgid "We make it easy to connect Stripe to your site. Click the Connect button to go through our connect flow."
|
667 |
Â
msgstr ""
|
668 |
Â
|
669 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:68
|
670 |
Â
msgid "Test Publishable Key"
|
671 |
Â
msgstr ""
|
672 |
Â
|
673 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:72
|
674 |
Â
msgid "Your publishable key is used to initialize Stripe assets."
|
675 |
Â
msgstr ""
|
676 |
Â
|
677 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:80
|
678 |
Â
msgid "Test Secret Key"
|
679 |
Â
msgstr ""
|
680 |
Â
|
681 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:84
|
682 |
Â
msgid "Your secret key is used to authenticate requests to Stripe."
|
683 |
Â
msgstr ""
|
684 |
Â
|
685 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:93
|
686 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:94
|
687 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:105
|
688 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:106
|
689 |
Â
msgid "Connection Test"
|
690 |
Â
msgstr ""
|
691 |
Â
|
692 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:96
|
693 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:108
|
694 |
Â
msgid "Click this button to perform a connection test. If successful, your site is connected to Stripe."
|
695 |
Â
msgstr ""
|
696 |
Â
|
697 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:117
|
698 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:118
|
699 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:128
|
700 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:129
|
701 |
+
msgid "Create Webhook"
|
702 |
+
msgstr ""
|
703 |
+
|
704 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:139
|
705 |
Â
msgid "Webhook url"
|
706 |
Â
msgstr ""
|
707 |
Â
|
708 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:143
|
709 |
+
msgid "<strong>Important:</strong> the webhook url is called by Stripe when events occur in your account, like a source becomes chargeable. Use the Create Webhook button or add the webhook manually in your Stripe account."
|
710 |
Â
msgstr ""
|
711 |
Â
|
712 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:148
|
713 |
Â
msgid "Live Webhook Secret"
|
714 |
Â
msgstr ""
|
715 |
Â
|
716 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:149
|
717 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:158
|
718 |
Â
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"
|
719 |
Â
msgstr ""
|
720 |
Â
|
721 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:157
|
722 |
Â
msgid "Test Webhook Secret"
|
723 |
Â
msgstr ""
|
724 |
Â
|
725 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:165
|
726 |
Â
msgid "Debug Log"
|
727 |
Â
msgstr ""
|
728 |
Â
|
729 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:169
|
730 |
Â
msgid "When enabled, the plugin logs important errors and info that can help you troubleshoot potential issues."
|
731 |
Â
msgstr ""
|
732 |
Â
|
733 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:175
|
734 |
Â
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."
|
735 |
Â
msgstr ""
|
736 |
Â
|
737 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:188
|
738 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:189
|
739 |
+
msgid "Delete Webhook"
|
740 |
+
msgstr ""
|
741 |
+
|
742 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:213
|
743 |
Â
msgid "Click To Re-Connect"
|
744 |
Â
msgstr ""
|
745 |
Â
|
746 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:231
|
747 |
Â
msgid "Please try again."
|
748 |
Â
msgstr ""
|
749 |
Â
|
750 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:234
|
751 |
Â
msgid "We were not able to connect your Stripe account. Reason: %s"
|
752 |
Â
msgstr ""
|
753 |
Â
|
754 |
+
#: includes/admin/settings/class-wc-stripe-api-settings.php:266
|
755 |
Â
msgid "Your Stripe account has been connected to your WooCommerce store. You may now accept payments in Live and Test mode."
|
756 |
Â
msgstr ""
|
757 |
Â
|
824 |
Â
msgid "No matches found"
|
825 |
Â
msgstr ""
|
826 |
Â
|
827 |
+
#: includes/class-wc-stripe-redirect-handler.php:38
|
828 |
Â
msgid "Error retrieving payment source. Reason: %s"
|
829 |
Â
msgstr ""
|
830 |
Â
|
831 |
+
#: includes/class-wc-stripe-redirect-handler.php:40
|
832 |
Â
msgid "This request is invalid. Please try again."
|
833 |
Â
msgstr ""
|
834 |
Â
|
835 |
+
#: includes/class-wc-stripe-redirect-handler.php:60
|
836 |
Â
msgid "Payment authorization failed. Please select another payment method."
|
837 |
Â
msgstr ""
|
838 |
Â
|
839 |
+
#: includes/class-wc-stripe-redirect-handler.php:66
|
840 |
Â
msgid "Payment authorization failed."
|
841 |
Â
msgstr ""
|
842 |
Â
|
843 |
+
#: includes/class-wc-stripe-rest-api.php:41
|
844 |
Â
msgid "%1$s is an invalid controller name."
|
845 |
Â
msgstr ""
|
846 |
Â
|
847 |
+
#: includes/class-wc-stripe-update.php:50
|
848 |
Â
msgid "Thank you for updating Stripe for WooCommerce to version %1$s."
|
849 |
Â
msgstr ""
|
850 |
Â
|
869 |
Â
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."
|
870 |
Â
msgstr ""
|
871 |
Â
|
872 |
+
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:117
|
873 |
Â
msgid "Domain registered successfully. You can confirm in your Stripe Dashboard at https://dashboard.stripe.com/account/apple_pay."
|
874 |
Â
msgstr ""
|
875 |
Â
|
876 |
+
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:140
|
877 |
Â
msgid "You must configure your secret key before creating webhooks."
|
878 |
Â
msgstr ""
|
879 |
Â
|
880 |
+
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:162
|
881 |
Â
msgid "There is already a webhook configured for this site. If you want to delete the webhook, login to your Stripe Dashboard."
|
882 |
Â
msgstr ""
|
883 |
Â
|
884 |
+
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:179
|
885 |
Â
msgid "Webhook created in Stripe for %s environment. You can test your webhook by logging in to the Stripe dashboard"
|
886 |
Â
msgstr ""
|
887 |
Â
|
888 |
+
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:227
|
889 |
Â
msgid "You must enter your API keys or connect the plugin before performing a connection test."
|
890 |
Â
msgstr ""
|
891 |
Â
|
892 |
+
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:240
|
893 |
Â
msgid "Mode: %s. Invalid secret key. Please check your entry."
|
894 |
Â
msgstr ""
|
895 |
Â
|
896 |
+
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:264
|
897 |
+
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:267
|
898 |
Â
msgid "Mode: %s. Invalid publishable key. Please check your entry."
|
899 |
Â
msgstr ""
|
900 |
Â
|
901 |
+
#: includes/controllers/class-wc-stripe-controller-gateway-settings.php:281
|
902 |
Â
msgid "Connection test to Stripe was successful. Mode: %s."
|
903 |
Â
msgstr ""
|
904 |
Â
|
905 |
Â
#: includes/controllers/class-wc-stripe-controller-googlepay.php:85
|
906 |
Â
#: packages/blocks/assets/js/payment-methods/googlepay/hooks/use-payments-client.js:155
|
907 |
+
#: packages/blocks/build/commons.js:2327
|
908 |
Â
msgid "Your shipping address is not serviceable."
|
909 |
Â
msgstr ""
|
910 |
Â
|
940 |
Â
msgstr ""
|
941 |
Â
|
942 |
Â
#: includes/controllers/class-wc-stripe-controller-source.php:51
|
943 |
+
#: includes/controllers/class-wc-stripe-controller-source.php:71
|
944 |
Â
msgid "Error updating source."
|
945 |
Â
msgstr ""
|
946 |
Â
|
984 |
Â
msgid "You must set the API mode to live in order to enable the Plaid development environment."
|
985 |
Â
msgstr ""
|
986 |
Â
|
Â
|
|
987 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:26
|
988 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:27
|
989 |
Â
#: packages/blocks/assets/js/payment-methods/local-payment/afterpay.js:80
|
990 |
+
#: packages/blocks/build/commons.js:3181
|
991 |
Â
msgid "Afterpay"
|
992 |
Â
msgstr ""
|
993 |
Â
|
994 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:28
|
995 |
Â
msgid "Afterpay gateway that integrates with your Stripe account."
|
996 |
Â
msgstr ""
|
997 |
Â
|
998 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:42
|
999 |
Â
msgid "Complete Order"
|
1000 |
Â
msgstr ""
|
1001 |
Â
|
1002 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:57
|
1003 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:120
|
1004 |
Â
#: includes/gateways/settings/applepay-settings.php:56
|
1005 |
Â
#: includes/gateways/settings/cc-settings.php:53
|
1006 |
Â
#: includes/gateways/settings/payment-request-settings.php:57
|
1007 |
Â
msgid "This option determines whether the customer's funds are captured immediately or authorized and can be captured at a later date."
|
1008 |
Â
msgstr ""
|
1009 |
Â
|
1010 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:62
|
1011 |
Â
#: includes/gateways/settings/applepay-settings.php:60
|
1012 |
Â
#: includes/gateways/settings/googlepay-settings.php:78
|
1013 |
Â
#: includes/gateways/settings/payment-request-settings.php:61
|
1014 |
Â
msgid "Payment Sections"
|
1015 |
Â
msgstr ""
|
1016 |
Â
|
1017 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:65
|
1018 |
Â
#: includes/gateways/settings/applepay-settings.php:63
|
1019 |
Â
#: includes/gateways/settings/googlepay-settings.php:81
|
1020 |
Â
#: includes/gateways/settings/payment-request-settings.php:64
|
1021 |
Â
msgid "Product Page"
|
1022 |
Â
msgstr ""
|
1023 |
Â
|
1024 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:66
|
1025 |
Â
#: includes/gateways/settings/applepay-settings.php:64
|
1026 |
Â
#: includes/gateways/settings/googlepay-settings.php:82
|
1027 |
Â
#: includes/gateways/settings/payment-request-settings.php:65
|
1028 |
Â
msgid "Cart Page"
|
1029 |
Â
msgstr ""
|
1030 |
Â
|
1031 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:67
|
1032 |
Â
#: includes/gateways/settings/applepay-settings.php:65
|
1033 |
Â
#: includes/gateways/settings/googlepay-settings.php:83
|
1034 |
Â
#: includes/gateways/settings/payment-request-settings.php:66
|
1035 |
Â
msgid "Mini Cart"
|
1036 |
Â
msgstr ""
|
1037 |
Â
|
1038 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:70
|
1039 |
Â
msgid "These are the additional sections where the Afterpay messaging will be enabled. You can control individual products via the Edit product page."
|
1040 |
Â
msgstr ""
|
1041 |
Â
|
1042 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:74
|
1043 |
Â
msgid "Hide If Ineligible"
|
1044 |
Â
msgstr ""
|
1045 |
Â
|
1046 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:79
|
1047 |
Â
msgid "If enabled, Afterpay won't show when the products in the cart are not eligible."
|
1048 |
Â
msgstr ""
|
1049 |
Â
|
1050 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:86
|
1051 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:145
|
1052 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:204
|
1053 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:124
|
1054 |
Â
#: includes/gateways/settings/googlepay-settings.php:106
|
1055 |
Â
msgid "Icon"
|
1056 |
Â
msgstr ""
|
1057 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
1058 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:90
|
1059 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:149
|
1060 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:208
|
1061 |
+
msgid "Black on mint"
|
1062 |
Â
msgstr ""
|
1063 |
Â
|
1064 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:91
|
1065 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:150
|
1066 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:209
|
1067 |
+
msgid "Black on white"
|
1068 |
Â
msgstr ""
|
1069 |
Â
|
1070 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:92
|
1071 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:151
|
1072 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:210
|
1073 |
+
msgid "Mint on black"
|
1074 |
+
msgstr ""
|
1075 |
+
|
1076 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:93
|
1077 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:152
|
1078 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:211
|
1079 |
Â
msgid "White on black"
|
1080 |
Â
msgstr ""
|
1081 |
Â
|
1082 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:96
|
1083 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:155
|
1084 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:214
|
1085 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:132
|
1086 |
Â
msgid "This is the icon style that appears next to the gateway on the checkout page."
|
1087 |
Â
msgstr ""
|
1088 |
Â
|
1089 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:99
|
1090 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:158
|
1091 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:217
|
1092 |
Â
msgid "Intro text"
|
1093 |
Â
msgstr ""
|
1094 |
Â
|
1095 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:110
|
1096 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:122
|
1097 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:169
|
1098 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:181
|
1099 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:228
|
1100 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:240
|
1101 |
Â
msgid "Modal link style"
|
1102 |
Â
msgstr ""
|
1103 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
1104 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:114
|
1105 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:173
|
1106 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:232
|
1107 |
+
msgid "More info text"
|
1108 |
Â
msgstr ""
|
1109 |
Â
|
1110 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:115
|
1111 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:174
|
1112 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:233
|
1113 |
+
msgid "Circled info icon"
|
1114 |
Â
msgstr ""
|
1115 |
Â
|
1116 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:116
|
1117 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:175
|
1118 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:234
|
1119 |
+
msgid "Learn more text"
|
1120 |
Â
msgstr ""
|
1121 |
Â
|
1122 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:118
|
1123 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:177
|
1124 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:236
|
1125 |
+
msgid "This is the style of the Afterpay info link."
|
1126 |
Â
msgstr ""
|
1127 |
Â
|
1128 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:126
|
1129 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:185
|
1130 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:244
|
1131 |
+
msgid "Mint"
|
1132 |
+
msgstr ""
|
1133 |
+
|
1134 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:127
|
1135 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:186
|
1136 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:245
|
1137 |
Â
#: includes/gateways/settings/googlepay-settings.php:127
|
1138 |
Â
msgid "White"
|
1139 |
Â
msgstr ""
|
1140 |
Â
|
1141 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:129
|
1142 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:188
|
1143 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:247
|
1144 |
Â
msgid "This is the theme color for the Afterpay info modal."
|
1145 |
Â
msgstr ""
|
1146 |
Â
|
1147 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:134
|
1148 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:193
|
1149 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:252
|
1150 |
Â
msgid "Show interest free"
|
1151 |
Â
msgstr ""
|
1152 |
Â
|
1153 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:137
|
1154 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:196
|
1155 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:255
|
1156 |
Â
msgid "If enabled, the Afterpay message will contain the interest free text."
|
1157 |
Â
msgstr ""
|
1158 |
Â
|
1159 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:385
|
1160 |
Â
msgid "Store currency must be %s for Afterpay to show because your Stripe account is registered in %s. This is a requirement of Afterpay."
|
1161 |
Â
msgstr ""
|
1162 |
Â
|
1235 |
Â
msgstr ""
|
1236 |
Â
|
1237 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-boleto.php:38
|
1238 |
+
#: includes/wc-stripe-functions.php:1128
|
1239 |
Â
msgid "Please enter a valid CPF / CNPJ"
|
1240 |
Â
msgstr ""
|
1241 |
Â
|
1242 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-cc.php:20
|
1243 |
Â
#: includes/gateways/settings/cc-settings.php:22
|
1244 |
Â
msgid "Credit Cards"
|
1245 |
Â
msgstr ""
|
1246 |
Â
|
1247 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-cc.php:23
|
1248 |
Â
msgid "Stripe Credit Cards"
|
1249 |
Â
msgstr ""
|
1250 |
Â
|
1251 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-cc.php:24
|
1252 |
Â
msgid "Credit card gateway that integrates with your Stripe account."
|
1253 |
Â
msgstr ""
|
1254 |
Â
|
1323 |
Â
msgid "Ideal gateway that integrates with your Stripe account."
|
1324 |
Â
msgstr ""
|
1325 |
Â
|
1326 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:24
|
1327 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:26
|
1328 |
Â
msgid "Klarna"
|
1329 |
Â
msgstr ""
|
1332 |
Â
msgid "Klarna gateway that integrates with your Stripe account."
|
1333 |
Â
msgstr ""
|
1334 |
Â
|
1335 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:127
|
1336 |
Â
msgid "Black text"
|
1337 |
Â
msgstr ""
|
1338 |
Â
|
1339 |
+
#: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:128
|
1340 |
Â
msgid "Pink background black text"
|
1341 |
Â
msgstr ""
|
1342 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
1343 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-multibanco.php:23
|
1344 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-multibanco.php:26
|
1345 |
Â
msgid "Multibanco"
|
1453 |
Â
|
1454 |
Â
#: includes/gateways/class-wc-payment-gateway-stripe-wechat.php:91
|
1455 |
Â
#: packages/blocks/assets/js/payment-methods/local-payment/wechat.js:130
|
1456 |
+
#: packages/blocks/build/commons.js:4289
|
1457 |
Â
msgid "Scan the QR code using your WeChat app. Once scanned click the Place Order button."
|
1458 |
Â
msgstr ""
|
1459 |
Â
|
1460 |
+
#: includes/gateways/settings/ach-settings.php:6
|
1461 |
Â
msgid "For US customers only."
|
1462 |
Â
msgstr ""
|
1463 |
Â
|
1464 |
+
#: includes/gateways/settings/ach-settings.php:8
|
1465 |
Â
msgid "Read through our %1$sdocumentation%2$s to configure ACH payments"
|
1466 |
Â
msgstr ""
|
1467 |
Â
|
1468 |
+
#: includes/gateways/settings/ach-settings.php:18
|
1469 |
Â
msgid "If enabled, your site can accept ACH payments through Stripe."
|
1470 |
Â
msgstr ""
|
1471 |
Â
|
1472 |
+
#: includes/gateways/settings/ach-settings.php:22
|
1473 |
Â
msgid "Plaid Environment"
|
1474 |
Â
msgstr ""
|
1475 |
Â
|
1476 |
+
#: includes/gateways/settings/ach-settings.php:25
|
1477 |
Â
msgid "Sandbox"
|
1478 |
Â
msgstr ""
|
1479 |
Â
|
1480 |
+
#: includes/gateways/settings/ach-settings.php:26
|
1481 |
Â
msgid "Development"
|
1482 |
Â
msgstr ""
|
1483 |
Â
|
1484 |
+
#: includes/gateways/settings/ach-settings.php:27
|
1485 |
Â
msgid "Production"
|
1486 |
Â
msgstr ""
|
1487 |
Â
|
1488 |
+
#: includes/gateways/settings/ach-settings.php:30
|
1489 |
Â
msgid "The active Plaid environment. You must set API mode to live to use Plaid's development environment."
|
1490 |
Â
msgstr ""
|
1491 |
Â
|
1492 |
+
#: includes/gateways/settings/ach-settings.php:34
|
1493 |
Â
msgid "Plaid Keys"
|
1494 |
Â
msgstr ""
|
1495 |
Â
|
1496 |
+
#: includes/gateways/settings/ach-settings.php:40
|
1497 |
Â
msgid "ID that identifies your Plaid account."
|
1498 |
Â
msgstr ""
|
1499 |
Â
|
1500 |
+
#: includes/gateways/settings/ach-settings.php:45
|
1501 |
Â
msgid "Plaid Secrets"
|
1502 |
Â
msgstr ""
|
1503 |
Â
|
1504 |
+
#: includes/gateways/settings/ach-settings.php:48
|
1505 |
Â
msgid "Sandbox Secret"
|
1506 |
Â
msgstr ""
|
1507 |
Â
|
1508 |
+
#: includes/gateways/settings/ach-settings.php:51
|
1509 |
Â
msgid "Key that acts as a password when connecting to Plaid's sandbox environment."
|
1510 |
Â
msgstr ""
|
1511 |
Â
|
1512 |
+
#: includes/gateways/settings/ach-settings.php:55
|
1513 |
Â
msgid "Development Secret"
|
1514 |
Â
msgstr ""
|
1515 |
Â
|
1516 |
+
#: includes/gateways/settings/ach-settings.php:58
|
1517 |
Â
msgid "Development allows you to test real bank credentials with test transactions."
|
1518 |
Â
msgstr ""
|
1519 |
Â
|
1520 |
+
#: includes/gateways/settings/ach-settings.php:62
|
1521 |
Â
msgid "Production Secret"
|
1522 |
Â
msgstr ""
|
1523 |
Â
|
1524 |
+
#: includes/gateways/settings/ach-settings.php:65
|
1525 |
Â
msgid "Key that acts as a password when connecting to Plaid's production environment."
|
1526 |
Â
msgstr ""
|
1527 |
Â
|
1528 |
+
#: includes/gateways/settings/ach-settings.php:75
|
1529 |
Â
msgid "ACH Payment"
|
1530 |
Â
msgstr ""
|
1531 |
Â
|
1532 |
+
#: includes/gateways/settings/ach-settings.php:89
|
1533 |
Â
#: includes/tokens/class-wc-payment-token-stripe-ach.php:92
|
1534 |
Â
msgid "Bank Payment"
|
1535 |
Â
msgstr ""
|
1536 |
Â
|
1537 |
+
#: includes/gateways/settings/ach-settings.php:95
|
1538 |
Â
msgid "Client Name"
|
1539 |
Â
msgstr ""
|
1540 |
Â
|
1541 |
+
#: includes/gateways/settings/ach-settings.php:97
|
1542 |
Â
msgid "The name that appears on the ACH payment screen."
|
1543 |
Â
msgstr ""
|
1544 |
Â
|
1545 |
+
#: includes/gateways/settings/ach-settings.php:101
|
1546 |
Â
msgid "ACH Display"
|
1547 |
Â
msgstr ""
|
1548 |
Â
|
1549 |
+
#: includes/gateways/settings/ach-settings.php:112
|
1550 |
+
#: includes/gateways/settings/applepay-settings.php:73
|
1551 |
+
#: includes/gateways/settings/cc-settings.php:57
|
1552 |
+
#: includes/gateways/settings/googlepay-settings.php:91
|
1553 |
+
#: includes/gateways/settings/payment-request-settings.php:74
|
1554 |
+
msgid "Order Status"
|
1555 |
+
msgstr ""
|
1556 |
+
|
1557 |
+
#: includes/gateways/settings/ach-settings.php:115
|
1558 |
+
#: includes/gateways/settings/applepay-settings.php:76
|
1559 |
+
#: includes/gateways/settings/cc-settings.php:60
|
1560 |
+
#: includes/gateways/settings/googlepay-settings.php:94
|
1561 |
+
#: includes/gateways/settings/payment-request-settings.php:77
|
1562 |
+
msgid "Default"
|
1563 |
Â
msgstr ""
|
1564 |
Â
|
1565 |
Â
#: includes/gateways/settings/ach-settings.php:117
|
1566 |
+
#: includes/gateways/settings/applepay-settings.php:78
|
1567 |
+
#: includes/gateways/settings/cc-settings.php:62
|
1568 |
+
#: includes/gateways/settings/googlepay-settings.php:96
|
1569 |
+
#: includes/gateways/settings/payment-request-settings.php:79
|
1570 |
+
msgid "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."
|
1571 |
+
msgstr ""
|
1572 |
+
|
1573 |
+
#: includes/gateways/settings/ach-settings.php:121
|
1574 |
+
msgid "ACH Fee"
|
1575 |
+
msgstr ""
|
1576 |
+
|
1577 |
+
#: includes/gateways/settings/ach-settings.php:131
|
1578 |
Â
msgid "None"
|
1579 |
Â
msgstr ""
|
1580 |
Â
|
1581 |
+
#: includes/gateways/settings/ach-settings.php:132
|
1582 |
Â
msgid "Amount"
|
1583 |
Â
msgstr ""
|
1584 |
Â
|
1585 |
+
#: includes/gateways/settings/ach-settings.php:133
|
1586 |
Â
msgid "Percentage"
|
1587 |
Â
msgstr ""
|
1588 |
Â
|
1589 |
+
#: includes/gateways/settings/ach-settings.php:136
|
1590 |
Â
msgid "You can assign a fee to the order for ACH payments. Amount is a static amount and percentage is a percentage of the cart amount."
|
1591 |
Â
msgstr ""
|
1592 |
Â
|
1620 |
Â
msgid "Top of Checkout"
|
1621 |
Â
msgstr ""
|
1622 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
1623 |
Â
#: includes/gateways/settings/applepay-settings.php:82
|
1624 |
Â
#: includes/gateways/settings/payment-request-settings.php:83
|
1625 |
Â
msgid "Button Settings"
|
2004 |
Â
msgid "Kind Regards,"
|
2005 |
Â
msgstr ""
|
2006 |
Â
|
2007 |
+
#: includes/wc-stripe-functions.php:729
|
2008 |
Â
msgid "Bootstrap form"
|
2009 |
Â
msgstr ""
|
2010 |
Â
|
2011 |
+
#: includes/wc-stripe-functions.php:755
|
2012 |
Â
msgid "Simple form"
|
2013 |
Â
msgstr ""
|
2014 |
Â
|
2015 |
+
#: includes/wc-stripe-functions.php:778
|
2016 |
Â
msgid "Minimalist form"
|
2017 |
Â
msgstr ""
|
2018 |
Â
|
2019 |
+
#: includes/wc-stripe-functions.php:804
|
2020 |
Â
msgid "Inline Form"
|
2021 |
Â
msgstr ""
|
2022 |
Â
|
2023 |
+
#: includes/wc-stripe-functions.php:826
|
2024 |
Â
msgid "Rounded Form"
|
2025 |
Â
msgstr ""
|
2026 |
Â
|
2027 |
+
#: includes/wc-stripe-functions.php:1057
|
2028 |
Â
msgid "There was an error processing your credit card."
|
2029 |
Â
msgstr ""
|
2030 |
Â
|
2031 |
+
#: includes/wc-stripe-functions.php:1058
|
2032 |
Â
msgid "Your card number is incomplete."
|
2033 |
Â
msgstr ""
|
2034 |
Â
|
2035 |
+
#: includes/wc-stripe-functions.php:1059
|
2036 |
Â
msgid "Your card's expiration date is incomplete."
|
2037 |
Â
msgstr ""
|
2038 |
Â
|
2039 |
+
#: includes/wc-stripe-functions.php:1060
|
2040 |
Â
msgid "Your card's security code is incomplete."
|
2041 |
Â
msgstr ""
|
2042 |
Â
|
2043 |
+
#: includes/wc-stripe-functions.php:1061
|
2044 |
Â
msgid "Your card's zip code is incomplete."
|
2045 |
Â
msgstr ""
|
2046 |
Â
|
2047 |
+
#: includes/wc-stripe-functions.php:1062
|
2048 |
Â
msgid "The card number is incorrect. Check the card's number or use a different card."
|
2049 |
Â
msgstr ""
|
2050 |
Â
|
2051 |
+
#: includes/wc-stripe-functions.php:1063
|
2052 |
Â
msgid "The card's security code is incorrect. Check the card's security code or use a different card."
|
2053 |
Â
msgstr ""
|
2054 |
Â
|
2055 |
+
#: includes/wc-stripe-functions.php:1064
|
2056 |
Â
msgid "The card's ZIP code is incorrect. Check the card's ZIP code or use a different card."
|
2057 |
Â
msgstr ""
|
2058 |
Â
|
2059 |
+
#: includes/wc-stripe-functions.php:1065
|
2060 |
+
#: includes/wc-stripe-functions.php:1070
|
2061 |
Â
msgid "The card number is invalid. Check the card details or use a different card."
|
2062 |
Â
msgstr ""
|
2063 |
Â
|
2064 |
+
#: includes/wc-stripe-functions.php:1066
|
2065 |
Â
msgid "This value provided to the field contains characters that are unsupported by the field."
|
2066 |
Â
msgstr ""
|
2067 |
Â
|
2068 |
+
#: includes/wc-stripe-functions.php:1067
|
2069 |
Â
msgid "The card's security code is invalid. Check the card's security code or use a different card."
|
2070 |
Â
msgstr ""
|
2071 |
Â
|
2072 |
+
#: includes/wc-stripe-functions.php:1068
|
2073 |
Â
msgid "The card's expiration month is incorrect. Check the expiration date or use a different card."
|
2074 |
Â
msgstr ""
|
2075 |
Â
|
2076 |
+
#: includes/wc-stripe-functions.php:1069
|
2077 |
Â
msgid "The card's expiration year is incorrect. Check the expiration date or use a different card."
|
2078 |
Â
msgstr ""
|
2079 |
Â
|
2080 |
+
#: includes/wc-stripe-functions.php:1071
|
2081 |
Â
msgid "The card's address is incorrect. Check the card's address or use a different card."
|
2082 |
Â
msgstr ""
|
2083 |
Â
|
2084 |
+
#: includes/wc-stripe-functions.php:1072
|
2085 |
Â
msgid "The card has expired. Check the expiration date or use a different card."
|
2086 |
Â
msgstr ""
|
2087 |
Â
|
2088 |
+
#: includes/wc-stripe-functions.php:1073
|
2089 |
Â
msgid "The card has been declined."
|
2090 |
Â
msgstr ""
|
2091 |
Â
|
2092 |
+
#: includes/wc-stripe-functions.php:1074
|
2093 |
Â
msgid "Your card's expiration year is in the past."
|
2094 |
Â
msgstr ""
|
2095 |
Â
|
2096 |
+
#: includes/wc-stripe-functions.php:1075
|
2097 |
Â
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."
|
2098 |
Â
msgstr ""
|
2099 |
Â
|
2100 |
+
#: includes/wc-stripe-functions.php:1077
|
2101 |
Â
msgid "The specified amount is greater than the maximum amount allowed. Use a lower amount and try again."
|
2102 |
Â
msgstr ""
|
2103 |
Â
|
2104 |
+
#: includes/wc-stripe-functions.php:1078
|
2105 |
Â
msgid "The specified amount is less than the minimum amount allowed. Use a higher amount and try again."
|
2106 |
Â
msgstr ""
|
2107 |
Â
|
2108 |
+
#: includes/wc-stripe-functions.php:1079
|
2109 |
Â
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."
|
2110 |
Â
msgstr ""
|
2111 |
Â
|
2112 |
+
#: includes/wc-stripe-functions.php:1081
|
2113 |
Â
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."
|
2114 |
Â
msgstr ""
|
2115 |
Â
|
2116 |
+
#: includes/wc-stripe-functions.php:1083
|
2117 |
Â
msgid "The bank account provided can not be used to charge, either because it is not verified yet or it is not supported."
|
2118 |
Â
msgstr ""
|
2119 |
Â
|
2120 |
+
#: includes/wc-stripe-functions.php:1084
|
2121 |
Â
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."
|
2122 |
Â
msgstr ""
|
2123 |
Â
|
2124 |
+
#: includes/wc-stripe-functions.php:1086
|
2125 |
Â
msgid "The bank account provided cannot be used for payouts. A different bank account must be used."
|
2126 |
Â
msgstr ""
|
2127 |
Â
|
2128 |
+
#: includes/wc-stripe-functions.php:1087
|
2129 |
Â
msgid "Your Connect platform is attempting to share an unverified bank account with a connected account."
|
2130 |
Â
msgstr ""
|
2131 |
Â
|
2132 |
+
#: includes/wc-stripe-functions.php:1088
|
2133 |
Â
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."
|
2134 |
Â
msgstr ""
|
2135 |
Â
|
2136 |
+
#: includes/wc-stripe-functions.php:1090
|
2137 |
Â
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."
|
2138 |
Â
msgstr ""
|
2139 |
Â
|
2140 |
+
#: includes/wc-stripe-functions.php:1092
|
2141 |
Â
msgid "The charge you're attempting to capture has already been captured. Update the request with an uncaptured charge ID."
|
2142 |
Â
msgstr ""
|
2143 |
Â
|
2144 |
+
#: includes/wc-stripe-functions.php:1093
|
2145 |
Â
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."
|
2146 |
Â
msgstr ""
|
2147 |
Â
|
2148 |
+
#: includes/wc-stripe-functions.php:1095
|
2149 |
Â
msgid "The charge you're attempting to refund has been charged back. Check the disputes documentation to learn how to respond to the dispute."
|
2150 |
Â
msgstr ""
|
2151 |
Â
|
2152 |
+
#: includes/wc-stripe-functions.php:1097
|
2153 |
Â
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."
|
2154 |
Â
msgstr ""
|
2155 |
Â
|
2156 |
+
#: includes/wc-stripe-functions.php:1099
|
2157 |
Â
msgid "The charge cannot be captured as the authorization has expired. Auth and capture charges must be captured within seven days."
|
2158 |
Â
msgstr ""
|
2159 |
Â
|
2160 |
+
#: includes/wc-stripe-functions.php:1101
|
2161 |
Â
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."
|
2162 |
Â
msgstr ""
|
2163 |
Â
|
2164 |
+
#: includes/wc-stripe-functions.php:1103
|
2165 |
Â
msgid "The email address is invalid (e.g., not properly formatted). Check that the email address is properly formatted and only includes allowed characters."
|
2166 |
Â
msgstr ""
|
2167 |
Â
|
2168 |
+
#: includes/wc-stripe-functions.php:1105
|
2169 |
Â
msgid "The idempotency key provided is currently being used in another request. This occurs if your integration is making duplicate requests simultaneously."
|
2170 |
Â
msgstr ""
|
2171 |
Â
|
2172 |
+
#: includes/wc-stripe-functions.php:1107
|
2173 |
Â
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."
|
2174 |
Â
msgstr ""
|
2175 |
Â
|
2176 |
+
#: includes/wc-stripe-functions.php:1109
|
2177 |
Â
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."
|
2178 |
Â
msgstr ""
|
2179 |
Â
|
2180 |
+
#: includes/wc-stripe-functions.php:1111
|
2181 |
Â
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."
|
2182 |
Â
msgstr ""
|
2183 |
Â
|
2184 |
+
#: includes/wc-stripe-functions.php:1113
|
2185 |
Â
msgid "The ZIP code provided was incorrect."
|
2186 |
Â
msgstr ""
|
2187 |
Â
|
2188 |
+
#: includes/wc-stripe-functions.php:1114
|
2189 |
Â
msgid "An error occurred while processing the card. Try again later or with a different payment method."
|
2190 |
Â
msgstr ""
|
2191 |
Â
|
2192 |
+
#: includes/wc-stripe-functions.php:1115
|
2193 |
Â
msgid "The card does not support this type of purchase."
|
2194 |
Â
msgstr ""
|
2195 |
Â
|
2196 |
+
#: includes/wc-stripe-functions.php:1116
|
2197 |
+
#: includes/wc-stripe-functions.php:1119
|
2198 |
+
#: includes/wc-stripe-functions.php:1121
|
2199 |
Â
msgid "The card has been declined for an unknown reason."
|
2200 |
Â
msgstr ""
|
2201 |
Â
|
2202 |
+
#: includes/wc-stripe-functions.php:1117
|
2203 |
Â
msgid "The customer has exceeded the balance or credit limit available on their card."
|
2204 |
Â
msgstr ""
|
2205 |
Â
|
2206 |
+
#: includes/wc-stripe-functions.php:1118
|
2207 |
Â
msgid "The card does not support the specified currency."
|
2208 |
Â
msgstr ""
|
2209 |
Â
|
2210 |
+
#: includes/wc-stripe-functions.php:1120
|
2211 |
Â
msgid "The payment has been declined as Stripe suspects it is fraudulent."
|
2212 |
Â
msgstr ""
|
2213 |
Â
|
2214 |
+
#: includes/wc-stripe-functions.php:1122
|
2215 |
Â
msgid "The PIN entered is incorrect. "
|
2216 |
Â
msgstr ""
|
2217 |
Â
|
2218 |
+
#: includes/wc-stripe-functions.php:1123
|
2219 |
Â
msgid "The card has insufficient funds to complete the purchase."
|
2220 |
Â
msgstr ""
|
2221 |
Â
|
2222 |
+
#: includes/wc-stripe-functions.php:1124
|
2223 |
Â
msgid "Please select a payment method before proceeding."
|
2224 |
Â
msgstr ""
|
2225 |
Â
|
2226 |
+
#: includes/wc-stripe-functions.php:1125
|
2227 |
Â
msgid "Please enter your IBAN before proceeding."
|
2228 |
Â
msgstr ""
|
2229 |
Â
|
2230 |
+
#: includes/wc-stripe-functions.php:1126
|
2231 |
Â
msgid "Please select a bank before proceeding"
|
2232 |
Â
msgstr ""
|
2233 |
Â
|
2234 |
+
#: includes/wc-stripe-functions.php:1127
|
2235 |
Â
msgid "The IBAN you entered is incomplete."
|
2236 |
Â
msgstr ""
|
2237 |
Â
|
2238 |
+
#: includes/wc-stripe-functions.php:1129
|
2239 |
Â
msgid "Your card was declined. Your request was in test mode, but you used a real credit card. Only test cards can be used in test mode."
|
2240 |
Â
msgstr ""
|
2241 |
Â
|
2242 |
+
#: includes/wc-stripe-webhook-functions.php:106
|
2243 |
Â
msgid "Charge.succeeded webhook received. Payment has been completed."
|
2244 |
Â
msgstr ""
|
2245 |
Â
|
2246 |
+
#: includes/wc-stripe-webhook-functions.php:146
|
2247 |
Â
msgid "payment_intent.succeeded webhook received. Payment has been completed."
|
2248 |
Â
msgstr ""
|
2249 |
Â
|
2250 |
+
#: includes/wc-stripe-webhook-functions.php:280
|
2251 |
+
msgid "A dispute has been created for charge %1$s. Dispute status: %2$s."
|
2252 |
+
msgstr ""
|
2253 |
+
|
2254 |
+
#: includes/wc-stripe-webhook-functions.php:309
|
2255 |
+
msgid "Dispute %1$s has been closed. Result: %2$s."
|
2256 |
+
msgstr ""
|
2257 |
+
|
2258 |
+
#: includes/wc-stripe-webhook-functions.php:335
|
2259 |
+
msgid "A review has been opened for charge %1$s. Reason: %2$s."
|
2260 |
+
msgstr ""
|
2261 |
+
|
2262 |
+
#: includes/wc-stripe-webhook-functions.php:353
|
2263 |
+
msgid "A review has been closed for charge %1$s. Reason: %2$s."
|
2264 |
+
msgstr ""
|
2265 |
+
|
2266 |
Â
#: packages/blocks/src/Payments/CreditCardPayment.php:27
|
2267 |
Â
#: templates/checkout/credit-card.php:22
|
2268 |
Â
msgid "Save Card"
|
2287 |
Â
#: templates/cc-forms/simple.php:12
|
2288 |
Â
#: packages/blocks/assets/js/payment-methods/credit-card/components/bootstrap/index.js:13
|
2289 |
Â
#: packages/blocks/assets/js/payment-methods/credit-card/components/simple/index.js:19
|
2290 |
+
#: packages/blocks/build/commons.js:1639
|
2291 |
+
#: packages/blocks/build/commons.js:1778
|
2292 |
Â
msgid "Card Number"
|
2293 |
Â
msgstr ""
|
2294 |
Â
|
2298 |
Â
#: templates/cc-forms/simple.php:26
|
2299 |
Â
#: packages/blocks/assets/js/payment-methods/credit-card/components/bootstrap/index.js:24
|
2300 |
Â
#: packages/blocks/assets/js/payment-methods/credit-card/components/simple/index.js:40
|
2301 |
+
#: packages/blocks/build/commons.js:1650
|
2302 |
+
#: packages/blocks/build/commons.js:1799
|
2303 |
Â
msgid "CVV"
|
2304 |
Â
msgstr ""
|
2305 |
Â
|
2319 |
Â
|
2320 |
Â
#: templates/cc-forms/simple.php:20
|
2321 |
Â
#: packages/blocks/assets/js/payment-methods/credit-card/components/simple/index.js:31
|
2322 |
+
#: packages/blocks/build/commons.js:1790
|
2323 |
Â
msgid "Expiration"
|
2324 |
Â
msgstr ""
|
2325 |
Â
|
2329 |
Â
|
2330 |
Â
#: templates/checkout/ach.php:11
|
2331 |
Â
#: packages/blocks/assets/js/payment-methods/ach/payment-method.js:59
|
2332 |
+
#: packages/blocks/build/commons.js:1461
|
2333 |
Â
msgid "username"
|
2334 |
Â
msgstr ""
|
2335 |
Â
|
2336 |
Â
#: templates/checkout/ach.php:12
|
2337 |
Â
#: packages/blocks/assets/js/payment-methods/ach/payment-method.js:62
|
2338 |
+
#: packages/blocks/build/commons.js:1464
|
2339 |
Â
msgid "password"
|
2340 |
Â
msgstr ""
|
2341 |
Â
|
2342 |
Â
#: templates/checkout/ach.php:13
|
2343 |
Â
#: packages/blocks/assets/js/payment-methods/ach/payment-method.js:65
|
2344 |
+
#: packages/blocks/build/commons.js:1467
|
2345 |
Â
msgid "pin"
|
2346 |
Â
msgstr ""
|
2347 |
Â
|
2351 |
Â
|
2352 |
Â
#: templates/checkout/afterpay.php:11
|
2353 |
Â
#: packages/blocks/assets/js/payment-methods/local-payment/afterpay.js:66
|
2354 |
+
#: packages/blocks/build/commons.js:3167
|
2355 |
Â
msgid "After clicking \"%s\", you will be redirected to Afterpay to complete your purchase securely."
|
2356 |
Â
msgstr ""
|
2357 |
Â
|
2361 |
Â
|
2362 |
Â
#: templates/checkout/boleto.php:17
|
2363 |
Â
#: packages/blocks/assets/js/payment-methods/local-payment/boleto.js:48
|
2364 |
+
#: packages/blocks/build/commons.js:3357
|
2365 |
Â
msgid "Test mode values"
|
2366 |
Â
msgstr ""
|
2367 |
Â
|
2368 |
Â
#: templates/checkout/boleto.php:27
|
2369 |
Â
#: packages/blocks/assets/js/payment-methods/local-payment/boleto.js:58
|
2370 |
+
#: packages/blocks/build/commons.js:3367
|
2371 |
Â
msgid "Accepted formats"
|
2372 |
Â
msgstr ""
|
2373 |
Â
|
2374 |
Â
#: templates/checkout/boleto.php:29
|
2375 |
Â
#: packages/blocks/assets/js/payment-methods/local-payment/boleto.js:61
|
2376 |
+
#: packages/blocks/build/commons.js:3370
|
2377 |
Â
msgid "XXX.XXX.XXX-XX or XXXXXXXXXXX"
|
2378 |
Â
msgstr ""
|
2379 |
Â
|
2380 |
Â
#: templates/checkout/boleto.php:32
|
2381 |
Â
#: packages/blocks/assets/js/payment-methods/local-payment/boleto.js:65
|
2382 |
+
#: packages/blocks/build/commons.js:3374
|
2383 |
Â
msgid "XX.XXX.XXX/XXXX-XX or XXXXXXXXXXXXXX"
|
2384 |
Â
msgstr ""
|
2385 |
Â
|
2387 |
Â
msgid "Express Checkout"
|
2388 |
Â
msgstr ""
|
2389 |
Â
|
2390 |
+
#: templates/checkout/klarna-v2.php:12
|
2391 |
+
#: packages/blocks/assets/js/payment-methods/local-payment/klarna.js:15
|
2392 |
+
#: packages/blocks/build/commons.js:3775
|
2393 |
Â
msgid "Test mode sms"
|
2394 |
Â
msgstr ""
|
2395 |
Â
|
2396 |
Â
#: packages/blocks/assets/js/payment-methods/ach/payment-method.js:56
|
2397 |
+
#: packages/blocks/build/commons.js:1458
|
2398 |
Â
msgid "Test Credentials"
|
2399 |
Â
msgstr ""
|
2400 |
Â
|
2401 |
Â
#: packages/blocks/assets/js/payment-methods/credit-card/components/custom-card-form.js:73
|
2402 |
+
#: packages/blocks/build/commons.js:1734
|
2403 |
Â
msgid "%s is not a valid blocks Stripe custom form. Please choose another custom form option in the Credit Card Settings."
|
2404 |
Â
msgstr ""
|
2405 |
Â
|
2406 |
Â
#: packages/blocks/assets/js/payment-methods/local-payment/boleto.js:27
|
2407 |
+
#: packages/blocks/build/commons.js:3336
|
2408 |
Â
msgid "Please enter a valid CPF/CNPJ value"
|
2409 |
Â
msgstr ""
|
2410 |
Â
|
2411 |
Â
#: packages/blocks/assets/js/payment-methods/local-payment/hooks/use-create-source.js:73
|
2412 |
Â
#: packages/blocks/assets/js/payment-methods/local-payment/hooks/use-validate-checkout.js:10
|
2413 |
+
#: packages/blocks/build/commons.js:3654
|
2414 |
+
#: packages/blocks/build/commons.js:3691
|
2415 |
Â
msgid "Please enter your payment info before proceeding."
|
2416 |
Â
msgstr ""
|
2417 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
2418 |
Â
#: packages/blocks/assets/js/payment-methods/local-payment/wechat.js:51
|
2419 |
+
#: packages/blocks/build/commons.js:4210
|
2420 |
Â
msgid "Please scan your QR code to continue with payment."
|
2421 |
Â
msgstr ""
|
2422 |
Â
|
2423 |
Â
#: packages/blocks/assets/js/payment-methods/local-payment/wechat.js:97
|
2424 |
+
#: packages/blocks/build/commons.js:4256
|
2425 |
Â
msgid "Please fill out all the required fields in order to complete the WeChat payment."
|
2426 |
Â
msgstr ""
|
2427 |
Â
|
2428 |
Â
#: packages/blocks/assets/js/payment-methods/local-payment/wechat.js:127
|
2429 |
+
#: packages/blocks/build/commons.js:4286
|
2430 |
Â
msgid "Test mode: Click the Place Order button to proceed."
|
2431 |
Â
msgstr ""
|
includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
Â
<?php
|
Â
|
|
2 |
Â
defined( 'ABSPATH' ) || exit();
|
3 |
Â
|
4 |
Â
if ( ! class_exists( 'WC_Payment_Gateway_Stripe' ) ) {
|
@@ -18,6 +19,7 @@ abstract class WC_Payment_Gateway_Stripe_Local_Payment extends WC_Payment_Gatewa
|
|
18 |
Â
|
19 |
Â
/**
|
20 |
Â
* Currencies this gateway accepts
|
Â
|
|
21 |
Â
* @var array
|
22 |
Â
*/
|
23 |
Â
public $currencies = array();
|
@@ -65,7 +67,7 @@ abstract class WC_Payment_Gateway_Stripe_Local_Payment extends WC_Payment_Gatewa
|
|
65 |
Â
/**
|
66 |
Â
*
|
67 |
Â
* @param \Stripe\Source $source
|
68 |
-
* @param WC_Order
|
69 |
Â
*/
|
70 |
Â
public function get_source_redirect_url( $source, $order ) {
|
71 |
Â
return $source->redirect->url;
|
@@ -325,7 +327,7 @@ abstract class WC_Payment_Gateway_Stripe_Local_Payment extends WC_Payment_Gatewa
|
|
325 |
Â
} else {
|
326 |
Â
$currency = get_woocommerce_currency();
|
327 |
Â
$customer = WC()->customer;
|
328 |
-
$billing_country = $customer ? $customer->get_billing_country() :
|
329 |
Â
$total = WC()->cart ? WC()->cart->total : 0;
|
330 |
Â
if ( ! $billing_country ) {
|
331 |
Â
$billing_country = WC()->countries->get_base_country();
|
@@ -399,11 +401,11 @@ abstract class WC_Payment_Gateway_Stripe_Local_Payment extends WC_Payment_Gatewa
|
|
399 |
Â
*
|
400 |
Â
* @param string $text
|
401 |
Â
*
|
402 |
-
* @return string
|
403 |
Â
* @since 3.1.3
|
Â
|
|
404 |
Â
*/
|
405 |
Â
public function get_order_button_text( $text ) {
|
406 |
-
return apply_filters( 'wc_stripe_order_button_text', $text, $this );
|
407 |
Â
}
|
408 |
Â
|
409 |
Â
public function has_enqueued_scripts( $scripts ) {
|
@@ -413,4 +415,5 @@ abstract class WC_Payment_Gateway_Stripe_Local_Payment extends WC_Payment_Gatewa
|
|
413 |
Â
public function get_stripe_documentation_url() {
|
414 |
Â
return 'https://docs.paymentplugins.com/wc-stripe/config/#/stripe_local_gateways';
|
415 |
Â
}
|
Â
|
|
416 |
Â
}
|
1 |
Â
<?php
|
2 |
+
|
3 |
Â
defined( 'ABSPATH' ) || exit();
|
4 |
Â
|
5 |
Â
if ( ! class_exists( 'WC_Payment_Gateway_Stripe' ) ) {
|
19 |
Â
|
20 |
Â
/**
|
21 |
Â
* Currencies this gateway accepts
|
22 |
+
*
|
23 |
Â
* @var array
|
24 |
Â
*/
|
25 |
Â
public $currencies = array();
|
67 |
Â
/**
|
68 |
Â
*
|
69 |
Â
* @param \Stripe\Source $source
|
70 |
+
* @param WC_Order $order
|
71 |
Â
*/
|
72 |
Â
public function get_source_redirect_url( $source, $order ) {
|
73 |
Â
return $source->redirect->url;
|
327 |
Â
} else {
|
328 |
Â
$currency = get_woocommerce_currency();
|
329 |
Â
$customer = WC()->customer;
|
330 |
+
$billing_country = $customer ? $customer->get_billing_country() : NULL;
|
331 |
Â
$total = WC()->cart ? WC()->cart->total : 0;
|
332 |
Â
if ( ! $billing_country ) {
|
333 |
Â
$billing_country = WC()->countries->get_base_country();
|
401 |
Â
*
|
402 |
Â
* @param string $text
|
403 |
Â
*
|
Â
|
|
404 |
Â
* @since 3.1.3
|
405 |
+
* @return string
|
406 |
Â
*/
|
407 |
Â
public function get_order_button_text( $text ) {
|
408 |
+
return apply_filters( 'wc_stripe_order_button_text', sprintf( __( 'Pay with %s', 'woo-stripe-payment' ), $text ), $this );
|
409 |
Â
}
|
410 |
Â
|
411 |
Â
public function has_enqueued_scripts( $scripts ) {
|
415 |
Â
public function get_stripe_documentation_url() {
|
416 |
Â
return 'https://docs.paymentplugins.com/wc-stripe/config/#/stripe_local_gateways';
|
417 |
Â
}
|
418 |
+
|
419 |
Â
}
|
includes/abstract/abstract-wc-payment-gateway-stripe.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
Â
<?php
|
Â
|
|
2 |
Â
defined( 'ABSPATH' ) || exit();
|
3 |
Â
|
4 |
Â
if ( ! class_exists( 'WC_Payment_Gateway' ) ) {
|
@@ -332,7 +333,9 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
332 |
Â
*/
|
333 |
Â
public function enqueue_mini_cart_scripts( $scripts ) {
|
334 |
Â
if ( ! wp_script_is( $scripts->get_handle( 'mini-cart' ) ) ) {
|
335 |
-
$scripts->enqueue_script( 'mini-cart',
|
Â
|
|
Â
|
|
336 |
Â
}
|
337 |
Â
$scripts->localize_script( 'mini-cart', $this->get_localized_params(), 'wc_' . $this->id . '_mini_cart_params' );
|
338 |
Â
}
|
@@ -429,7 +432,7 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
429 |
Â
/**
|
430 |
Â
* Save the Stripe data to the order.
|
431 |
Â
*
|
432 |
-
* @param WC_Order
|
433 |
Â
* @param \Stripe\Charge $charge
|
434 |
Â
*/
|
435 |
Â
public function save_order_meta( $order, $charge ) {
|
@@ -457,9 +460,9 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
457 |
Â
}
|
458 |
Â
}
|
459 |
Â
/**
|
460 |
-
* @param WC_Order
|
461 |
Â
* @param WC_Payment_Gateway_Stripe $this
|
462 |
-
* @param \Stripe\Charge
|
463 |
Â
*
|
464 |
Â
* @since 3.2.7
|
465 |
Â
*/
|
@@ -513,7 +516,8 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
513 |
Â
'result' => 'success',
|
514 |
Â
'redirect' => wc_get_account_endpoint_url( 'payment-methods' ),
|
515 |
Â
);
|
516 |
-
}
|
Â
|
|
517 |
Â
wc_add_notice( sprintf( __( 'Error saving payment method. Reason: %s', 'woo-stripe-payment' ), $e->getMessage() ), 'error' );
|
518 |
Â
|
519 |
Â
return array( 'result' => 'error' );
|
@@ -550,7 +554,7 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
550 |
Â
/**
|
551 |
Â
* Captures the charge for the Stripe order.
|
552 |
Â
*
|
553 |
-
* @param float
|
554 |
Â
* @param WC_Order $order
|
555 |
Â
*/
|
556 |
Â
public function capture_charge( $amount, $order ) {
|
@@ -564,21 +568,20 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
564 |
Â
|
565 |
Â
if ( ! is_wp_error( $result ) ) {
|
566 |
Â
remove_action( 'woocommerce_order_status_completed', 'wc_stripe_order_status_completed' );
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
567 |
Â
$order->payment_complete();
|
568 |
Â
if ( $amount != $order->get_total() ) {
|
569 |
Â
$order->set_total( $amount );
|
570 |
Â
$order->save();
|
571 |
Â
}
|
572 |
-
$order->add_order_note(
|
573 |
-
|
574 |
-
__( 'Order amount captured in Stripe. Amount: %s', 'woo-stripe-payment' ),
|
575 |
-
wc_price(
|
576 |
-
$amount,
|
577 |
-
array(
|
578 |
-
'currency' => $order->get_currency(),
|
579 |
-
)
|
580 |
-
)
|
581 |
-
)
|
582 |
Â
);
|
583 |
Â
} else {
|
584 |
Â
$order->add_order_note( sprintf( __( 'Error capturing charge in Stripe. Reason: %s', 'woo-stripe-payment' ), $result->get_error_message() ) );
|
@@ -622,7 +625,7 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
622 |
Â
|
623 |
Â
/**
|
624 |
Â
*
|
625 |
-
* @param string
|
626 |
Â
* @param \Stripe\Card|array $method_details
|
627 |
Â
*/
|
628 |
Â
public function get_payment_token( $method_id, $method_details = null ) {
|
@@ -694,7 +697,8 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
694 |
Â
* Return true of the customer is using a saved payment method.
|
695 |
Â
*/
|
696 |
Â
public function use_saved_source() {
|
697 |
-
return ( ! empty( $_POST[ $this->payment_type_key ] ) && wc_clean( $_POST[ $this->payment_type_key ] ) === 'saved' ) || $this->payment_method_token
|
Â
|
|
698 |
Â
}
|
699 |
Â
|
700 |
Â
/**
|
@@ -771,7 +775,7 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
771 |
Â
|
772 |
Â
/**
|
773 |
Â
*
|
774 |
-
* @param array
|
775 |
Â
* @param WC_Payment_Token_Stripe_CC $payment_token
|
776 |
Â
*/
|
777 |
Â
public function payment_methods_list_item( $item, $payment_token ) {
|
@@ -791,7 +795,7 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
791 |
Â
|
792 |
Â
/**
|
793 |
Â
*
|
794 |
-
* @param string
|
795 |
Â
* @param WC_Payment_Token_Stripe $token
|
796 |
Â
*/
|
797 |
Â
public function delete_payment_method( $token_id, $token ) {
|
@@ -864,8 +868,8 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
864 |
Â
}
|
865 |
Â
|
866 |
Â
/**
|
867 |
-
* @param bool
|
868 |
-
* @param WC_Order
|
869 |
Â
* @param WC_Payment_Gateway_Stripe $this
|
870 |
Â
*
|
871 |
Â
* @since 3.3.12
|
@@ -903,9 +907,9 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
903 |
Â
}
|
904 |
Â
|
905 |
Â
/**
|
906 |
-
* @param array
|
907 |
Â
* @param WC_Order|null $order
|
908 |
-
* @param string
|
909 |
Â
*/
|
910 |
Â
return apply_filters( 'wc_stripe_get_display_items', $items, $order, $page );
|
911 |
Â
}
|
@@ -944,8 +948,8 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
944 |
Â
/**
|
945 |
Â
* Return true if mini-cart checkout is enabled for this gateway
|
946 |
Â
*
|
947 |
-
* @return bool
|
948 |
Â
* @since 3.1.8
|
Â
|
|
949 |
Â
*/
|
950 |
Â
public function mini_cart_enabled() {
|
951 |
Â
return in_array( 'mini_cart', $this->get_option( 'payment_sections', array() ) );
|
@@ -959,8 +963,7 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
959 |
Â
public function banner_checkout_enabled() {
|
960 |
Â
global $wp;
|
961 |
Â
|
962 |
-
return empty( $wp->query_vars['order-pay'] ) && $this->supports( 'wc_stripe_banner_checkout' ) &&
|
963 |
-
in_array( 'checkout_banner', $this->get_option( 'payment_sections', array() ) );
|
964 |
Â
}
|
965 |
Â
|
966 |
Â
/**
|
@@ -995,7 +998,7 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
995 |
Â
* If the payment method has already been saved to the customer
|
996 |
Â
* then simply return true.
|
997 |
Â
*
|
998 |
-
* @param string
|
999 |
Â
* @param WC_Order $order
|
1000 |
Â
* @param
|
1001 |
Â
*
|
@@ -1045,7 +1048,7 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
1045 |
Â
/**
|
1046 |
Â
*
|
1047 |
Â
* @param string $token_id
|
1048 |
-
* @param int
|
1049 |
Â
*
|
1050 |
Â
* @return null|WC_Payment_Token_Stripe_CC
|
1051 |
Â
*/
|
@@ -1062,7 +1065,7 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
1062 |
Â
|
1063 |
Â
/**
|
1064 |
Â
*
|
1065 |
-
* @param array
|
1066 |
Â
* @param WC_Subscription $subscription
|
1067 |
Â
*/
|
1068 |
Â
public function subscription_payment_meta( $payment_meta, $subscription ) {
|
@@ -1080,7 +1083,7 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
1080 |
Â
|
1081 |
Â
/**
|
1082 |
Â
*
|
1083 |
-
* @param float
|
1084 |
Â
* @param WC_Order $order
|
1085 |
Â
*/
|
1086 |
Â
public function scheduled_subscription_payment( $amount, $order ) {
|
@@ -1102,10 +1105,12 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
1102 |
Â
|
1103 |
Â
if ( $result->complete_payment ) {
|
1104 |
Â
if ( $result->charge->captured ) {
|
Â
|
|
1105 |
Â
$order->payment_complete( $result->charge->id );
|
1106 |
Â
$order->add_order_note( sprintf( __( 'Recurring payment captured in Stripe. Payment method: %s', 'woo-stripe-payment' ), $order->get_payment_method_title() ) );
|
1107 |
Â
} else {
|
1108 |
-
$order->update_status( apply_filters( 'wc_stripe_authorized_renewal_order_status', 'on-hold', $order, $this ),
|
Â
|
|
1109 |
Â
}
|
1110 |
Â
} else {
|
1111 |
Â
$order->update_status( 'pending', sprintf( __( 'Customer must manually complete payment for payment method %s', 'woo-stripe-payment' ), $order->get_payment_method_title() ) );
|
@@ -1230,9 +1235,9 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
1230 |
Â
}
|
1231 |
Â
}
|
1232 |
Â
/**
|
1233 |
-
* @param WC_Order
|
1234 |
Â
* @param WC_Payment_Gateway_Stripe $this
|
1235 |
-
* @param null
|
1236 |
Â
*
|
1237 |
Â
* @since 3.2.7
|
1238 |
Â
*/
|
@@ -1299,7 +1304,7 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
1299 |
Â
|
1300 |
Â
/**
|
1301 |
Â
*
|
1302 |
-
* @param WC_Order
|
1303 |
Â
* @param WC_Payment_Gateway_Stripe $gateway
|
1304 |
Â
*/
|
1305 |
Â
public function trigger_post_payment_processes( $order, $gateway ) {
|
@@ -1330,14 +1335,15 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
1330 |
Â
$order->add_order_note( sprintf( __( 'Pre-order payment for order failed. Reason: %s', 'woo-stripe-payment' ), $result->get_error_message() ) );
|
1331 |
Â
} else {
|
1332 |
Â
if ( $result->complete_payment ) {
|
1333 |
-
|
1334 |
Â
$this->save_order_meta( $order, $result->charge );
|
1335 |
Â
|
1336 |
Â
if ( $result->charge->captured ) {
|
Â
|
|
1337 |
Â
$order->payment_complete( $result->charge->id );
|
1338 |
Â
$order->add_order_note( sprintf( __( 'Pre-order payment captured in Stripe. Payment method: %s', 'woo-stripe-payment' ), $order->get_payment_method_title() ) );
|
1339 |
Â
} else {
|
1340 |
-
$order->update_status( apply_filters( 'wc_stripe_authorized_preorder_order_status', 'on-hold', $order, $this ),
|
Â
|
|
1341 |
Â
}
|
1342 |
Â
} else {
|
1343 |
Â
$order->update_status( 'pending', sprintf( __( 'Customer must manually complete payment for payment method %s', 'woo-stripe-payment' ), $order->get_payment_method_title() ) );
|
@@ -1350,9 +1356,9 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
1350 |
Â
* This acts as a lazy conversion
|
1351 |
Â
* method for merchants that have switched to our plugin from other plugins.
|
1352 |
Â
*
|
1353 |
-
* @param string
|
1354 |
Â
* @param WC_Order $order
|
1355 |
-
* @param string
|
1356 |
Â
*
|
1357 |
Â
* @since 3.1.0
|
1358 |
Â
*/
|
@@ -1391,7 +1397,7 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
1391 |
Â
* Gateways can override this method to add attributes to the Stripe object before it's
|
1392 |
Â
* sent to Stripe.
|
1393 |
Â
*
|
1394 |
-
* @param array
|
1395 |
Â
* @param WC_Order $order
|
1396 |
Â
*/
|
1397 |
Â
public function add_stripe_order_args( &$args, $order ) {
|
@@ -1417,14 +1423,16 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
1417 |
Â
* @since 3.1.2
|
1418 |
Â
*/
|
1419 |
Â
private function get_payment_section_description() {
|
1420 |
-
return sprintf( __( '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.',
|
Â
|
|
Â
|
|
1421 |
Â
}
|
1422 |
Â
|
1423 |
Â
/**
|
1424 |
Â
* Outputs fields required by Google Pay to render the payment wallet.
|
1425 |
Â
*
|
1426 |
Â
* @param string $page
|
1427 |
-
* @param array
|
1428 |
Â
*/
|
1429 |
Â
public function output_display_items( $page = 'checkout', $data = array() ) {
|
1430 |
Â
global $wp;
|
@@ -1446,7 +1454,6 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
1446 |
Â
$data['total_cents'] = wc_stripe_add_number_precision( $order->get_total(), $order->get_currency() );
|
1447 |
Â
$data['currency'] = $order->get_currency();
|
1448 |
Â
$data['pre_order'] = $this->order_contains_pre_order( $order );
|
1449 |
-
|
1450 |
Â
} else {
|
1451 |
Â
$data['needs_shipping'] = WC()->cart->needs_shipping();
|
1452 |
Â
if ( 'checkout' === $page && is_cart() ) {
|
@@ -1465,8 +1472,8 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
1465 |
Â
);
|
1466 |
Â
}
|
1467 |
Â
/**
|
1468 |
-
* @param array
|
1469 |
-
* @param string
|
1470 |
Â
* @param WC_Payment_Gateway_Stripe $this
|
1471 |
Â
*
|
1472 |
Â
* @since 3.1.8
|
@@ -1478,7 +1485,7 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
1478 |
Â
|
1479 |
Â
/**
|
1480 |
Â
* @param array $deps
|
1481 |
-
* @param
|
1482 |
Â
*
|
1483 |
Â
* @since 3.1.8
|
1484 |
Â
*/
|
@@ -1487,8 +1494,8 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
1487 |
Â
}
|
1488 |
Â
|
1489 |
Â
/**
|
1490 |
-
* @return array
|
1491 |
Â
* @since 3.2.0
|
Â
|
|
1492 |
Â
*/
|
1493 |
Â
public function get_shipping_packages() {
|
1494 |
Â
$packages = WC()->shipping()->get_packages();
|
@@ -1512,10 +1519,10 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
1512 |
Â
|
1513 |
Â
/**
|
1514 |
Â
* @param WC_Cart $cart
|
1515 |
-
* @param array
|
1516 |
Â
*
|
1517 |
-
* @return array
|
1518 |
Â
* @since 3.2.1
|
Â
|
|
1519 |
Â
*/
|
1520 |
Â
protected function get_display_items_for_cart( $cart, $items = array() ) {
|
1521 |
Â
$incl_tax = wc_stripe_display_prices_including_tax();
|
@@ -1551,10 +1558,10 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
1551 |
Â
|
1552 |
Â
/**
|
1553 |
Â
* @param WC_Order $order
|
1554 |
-
* @param array
|
1555 |
Â
*
|
1556 |
-
* @return array
|
1557 |
Â
* @since 3.2.1
|
Â
|
|
1558 |
Â
*/
|
1559 |
Â
protected function get_display_items_for_order( $order, $items = array() ) {
|
1560 |
Â
foreach ( $order->get_items() as $item ) {
|
@@ -1583,13 +1590,13 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
1583 |
Â
}
|
1584 |
Â
|
1585 |
Â
/**
|
1586 |
-
* @param float
|
1587 |
Â
* @param string $label
|
1588 |
Â
* @param string $type
|
1589 |
-
* @param mixed
|
1590 |
Â
*
|
1591 |
-
* @return array
|
1592 |
Â
* @since 3.2.1
|
Â
|
|
1593 |
Â
*/
|
1594 |
Â
protected function get_display_item_for_cart( $price, $label, $type, ...$args ) {
|
1595 |
Â
return array(
|
@@ -1600,11 +1607,11 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
1600 |
Â
}
|
1601 |
Â
|
1602 |
Â
/**
|
1603 |
-
* @param float
|
1604 |
-
* @param string
|
1605 |
Â
* @param WC_Order $order
|
1606 |
-
* @param string
|
1607 |
-
* @param mixed
|
1608 |
Â
*/
|
1609 |
Â
protected function get_display_item_for_order( $price, $label, $order, $type, ...$args ) {
|
1610 |
Â
return array(
|
@@ -1617,9 +1624,9 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
1617 |
Â
/**
|
1618 |
Â
* @param WC_Product $product
|
1619 |
Â
*
|
1620 |
-
* @return array
|
1621 |
Â
* @since 3.2.1
|
1622 |
Â
*
|
Â
|
|
1623 |
Â
*/
|
1624 |
Â
protected function get_display_item_for_product( $product ) {
|
1625 |
Â
return array(
|
@@ -1631,10 +1638,10 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
1631 |
Â
|
1632 |
Â
/**
|
1633 |
Â
* @param array $methods
|
1634 |
-
* @param
|
1635 |
Â
*
|
1636 |
-
* @return array
|
1637 |
Â
* @since 3.2.1
|
Â
|
|
1638 |
Â
*/
|
1639 |
Â
public function get_formatted_shipping_methods( $methods = array() ) {
|
1640 |
Â
if ( wcs_stripe_active() && WC_Subscriptions_Change_Payment_Gateway::$is_request_to_change_payment ) {
|
@@ -1677,14 +1684,14 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
1677 |
Â
}
|
1678 |
Â
|
1679 |
Â
/**
|
1680 |
-
* @param float
|
1681 |
Â
* @param WC_Shipping_Rate $rate
|
1682 |
-
* @param string
|
1683 |
-
* @param array
|
1684 |
-
* @param bool
|
1685 |
Â
*
|
1686 |
-
* @return array
|
1687 |
Â
* @since 3.2.1
|
Â
|
|
1688 |
Â
*/
|
1689 |
Â
public function get_formatted_shipping_method( $price, $rate, $i, $package, $incl_tax ) {
|
1690 |
Â
$method = array(
|
@@ -1717,9 +1724,9 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
1717 |
Â
}
|
1718 |
Â
|
1719 |
Â
/**
|
1720 |
-
* @param float
|
1721 |
Â
* @param WC_Shipping_Rate $rate
|
1722 |
-
* @param bool
|
1723 |
Â
*
|
1724 |
Â
* @since 3.2.1
|
1725 |
Â
*/
|
@@ -1729,8 +1736,9 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
1729 |
Â
|
1730 |
Â
/**
|
1731 |
Â
* Returns true if a scheduled subscription payment is being processed.
|
1732 |
-
*
|
1733 |
Â
* @since 3.2.3
|
Â
|
|
1734 |
Â
*/
|
1735 |
Â
protected function is_processing_scheduled_payment() {
|
1736 |
Â
return doing_action( 'woocommerce_scheduled_subscription_payment_' . $this->id );
|
@@ -1739,8 +1747,8 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
1739 |
Â
/**
|
1740 |
Â
* @param WC_Stripe_Frontend_Scripts $scripts
|
1741 |
Â
*
|
1742 |
-
* @return bool
|
1743 |
Â
* @since 3.2.5
|
Â
|
|
1744 |
Â
*/
|
1745 |
Â
public function has_enqueued_scripts( $scripts ) {
|
1746 |
Â
return false;
|
@@ -1759,8 +1767,8 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
1759 |
Â
/**
|
1760 |
Â
* @param WC_Subscription $subscription
|
1761 |
Â
*
|
1762 |
-
* @return array
|
1763 |
Â
* @since 3.2.13
|
Â
|
|
1764 |
Â
*/
|
1765 |
Â
protected function process_change_payment_method_request( $subscription ) {
|
1766 |
Â
if ( ! $this->use_saved_source() ) {
|
@@ -1787,7 +1795,7 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
1787 |
Â
|
1788 |
Â
/**
|
1789 |
Â
* @param WC_Subscription $subscription
|
1790 |
-
* @param WC_Order
|
1791 |
Â
*/
|
1792 |
Â
public function update_failing_payment_method( $subscription, $order ) {
|
1793 |
Â
if ( ( $token = $this->get_token( $order->get_meta( WC_Stripe_Constants::PAYMENT_METHOD_TOKEN ), $order->get_customer_id() ) ) ) {
|
@@ -1800,12 +1808,13 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
|
|
1800 |
Â
/**
|
1801 |
Â
* @param array $options
|
1802 |
Â
*
|
1803 |
-
* @return mixed|void
|
1804 |
Â
* @since 3.3.10
|
Â
|
|
1805 |
Â
*/
|
1806 |
Â
public function get_element_options( $options = array() ) {
|
1807 |
Â
$options = array_merge( array( 'locale' => 'auto' ), $options );
|
1808 |
Â
|
1809 |
Â
return apply_filters( 'wc_stripe_get_element_options', $options, $this );
|
1810 |
Â
}
|
Â
|
|
1811 |
Â
}
|
1 |
Â
<?php
|
2 |
+
|
3 |
Â
defined( 'ABSPATH' ) || exit();
|
4 |
Â
|
5 |
Â
if ( ! class_exists( 'WC_Payment_Gateway' ) ) {
|
333 |
Â
*/
|
334 |
Â
public function enqueue_mini_cart_scripts( $scripts ) {
|
335 |
Â
if ( ! wp_script_is( $scripts->get_handle( 'mini-cart' ) ) ) {
|
336 |
+
$scripts->enqueue_script( 'mini-cart',
|
337 |
+
$scripts->assets_url( 'js/frontend/mini-cart.js' ),
|
338 |
+
apply_filters( 'wc_stripe_mini_cart_dependencies', array( $scripts->get_handle( 'wc-stripe' ) ), $scripts ) );
|
339 |
Â
}
|
340 |
Â
$scripts->localize_script( 'mini-cart', $this->get_localized_params(), 'wc_' . $this->id . '_mini_cart_params' );
|
341 |
Â
}
|
432 |
Â
/**
|
433 |
Â
* Save the Stripe data to the order.
|
434 |
Â
*
|
435 |
+
* @param WC_Order $order
|
436 |
Â
* @param \Stripe\Charge $charge
|
437 |
Â
*/
|
438 |
Â
public function save_order_meta( $order, $charge ) {
|
460 |
Â
}
|
461 |
Â
}
|
462 |
Â
/**
|
463 |
+
* @param WC_Order $order
|
464 |
Â
* @param WC_Payment_Gateway_Stripe $this
|
465 |
+
* @param \Stripe\Charge $charge
|
466 |
Â
*
|
467 |
Â
* @since 3.2.7
|
468 |
Â
*/
|
516 |
Â
'result' => 'success',
|
517 |
Â
'redirect' => wc_get_account_endpoint_url( 'payment-methods' ),
|
518 |
Â
);
|
519 |
+
}
|
520 |
+
catch ( Exception $e ) {
|
521 |
Â
wc_add_notice( sprintf( __( 'Error saving payment method. Reason: %s', 'woo-stripe-payment' ), $e->getMessage() ), 'error' );
|
522 |
Â
|
523 |
Â
return array( 'result' => 'error' );
|
554 |
Â
/**
|
555 |
Â
* Captures the charge for the Stripe order.
|
556 |
Â
*
|
557 |
+
* @param float $amount
|
558 |
Â
* @param WC_Order $order
|
559 |
Â
*/
|
560 |
Â
public function capture_charge( $amount, $order ) {
|
568 |
Â
|
569 |
Â
if ( ! is_wp_error( $result ) ) {
|
570 |
Â
remove_action( 'woocommerce_order_status_completed', 'wc_stripe_order_status_completed' );
|
571 |
+
WC_Stripe_Utils::add_balance_transaction_to_order( $result, $order, true );
|
572 |
+
if ( isset( $result->refunds->data[0] ) ) {
|
573 |
+
$balance_transaction = $this->gateway->balanceTransactions->retrieve( $result->refunds->data[0]->balance_transaction );
|
574 |
+
if ( ! is_wp_error( $balance_transaction ) ) {
|
575 |
+
WC_Stripe_Utils::update_balance_transaction( $balance_transaction, $order, true );
|
576 |
+
}
|
577 |
+
}
|
578 |
Â
$order->payment_complete();
|
579 |
Â
if ( $amount != $order->get_total() ) {
|
580 |
Â
$order->set_total( $amount );
|
581 |
Â
$order->save();
|
582 |
Â
}
|
583 |
+
$order->add_order_note( sprintf( __( 'Order amount captured in Stripe. Amount: %s', 'woo-stripe-payment' ),
|
584 |
+
wc_price( $amount, array( 'currency' => $order->get_currency(), ) ) )
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
585 |
Â
);
|
586 |
Â
} else {
|
587 |
Â
$order->add_order_note( sprintf( __( 'Error capturing charge in Stripe. Reason: %s', 'woo-stripe-payment' ), $result->get_error_message() ) );
|
625 |
Â
|
626 |
Â
/**
|
627 |
Â
*
|
628 |
+
* @param string $method_id
|
629 |
Â
* @param \Stripe\Card|array $method_details
|
630 |
Â
*/
|
631 |
Â
public function get_payment_token( $method_id, $method_details = null ) {
|
697 |
Â
* Return true of the customer is using a saved payment method.
|
698 |
Â
*/
|
699 |
Â
public function use_saved_source() {
|
700 |
+
return ( ! empty( $_POST[ $this->payment_type_key ] ) && wc_clean( $_POST[ $this->payment_type_key ] ) === 'saved' ) || $this->payment_method_token
|
701 |
+
|| ( ! empty( $_POST["wc-{$this->id}-payment-token"] ) );
|
702 |
Â
}
|
703 |
Â
|
704 |
Â
/**
|
775 |
Â
|
776 |
Â
/**
|
777 |
Â
*
|
778 |
+
* @param array $item
|
779 |
Â
* @param WC_Payment_Token_Stripe_CC $payment_token
|
780 |
Â
*/
|
781 |
Â
public function payment_methods_list_item( $item, $payment_token ) {
|
795 |
Â
|
796 |
Â
/**
|
797 |
Â
*
|
798 |
+
* @param string $token_id
|
799 |
Â
* @param WC_Payment_Token_Stripe $token
|
800 |
Â
*/
|
801 |
Â
public function delete_payment_method( $token_id, $token ) {
|
868 |
Â
}
|
869 |
Â
|
870 |
Â
/**
|
871 |
+
* @param bool $bool
|
872 |
+
* @param WC_Order $order
|
873 |
Â
* @param WC_Payment_Gateway_Stripe $this
|
874 |
Â
*
|
875 |
Â
* @since 3.3.12
|
907 |
Â
}
|
908 |
Â
|
909 |
Â
/**
|
910 |
+
* @param array $items
|
911 |
Â
* @param WC_Order|null $order
|
912 |
+
* @param string $page
|
913 |
Â
*/
|
914 |
Â
return apply_filters( 'wc_stripe_get_display_items', $items, $order, $page );
|
915 |
Â
}
|
948 |
Â
/**
|
949 |
Â
* Return true if mini-cart checkout is enabled for this gateway
|
950 |
Â
*
|
Â
|
|
951 |
Â
* @since 3.1.8
|
952 |
+
* @return bool
|
953 |
Â
*/
|
954 |
Â
public function mini_cart_enabled() {
|
955 |
Â
return in_array( 'mini_cart', $this->get_option( 'payment_sections', array() ) );
|
963 |
Â
public function banner_checkout_enabled() {
|
964 |
Â
global $wp;
|
965 |
Â
|
966 |
+
return empty( $wp->query_vars['order-pay'] ) && $this->supports( 'wc_stripe_banner_checkout' ) && in_array( 'checkout_banner', $this->get_option( 'payment_sections', array() ) );
|
Â
|
|
967 |
Â
}
|
968 |
Â
|
969 |
Â
/**
|
998 |
Â
* If the payment method has already been saved to the customer
|
999 |
Â
* then simply return true.
|
1000 |
Â
*
|
1001 |
+
* @param string $id
|
1002 |
Â
* @param WC_Order $order
|
1003 |
Â
* @param
|
1004 |
Â
*
|
1048 |
Â
/**
|
1049 |
Â
*
|
1050 |
Â
* @param string $token_id
|
1051 |
+
* @param int $user_id
|
1052 |
Â
*
|
1053 |
Â
* @return null|WC_Payment_Token_Stripe_CC
|
1054 |
Â
*/
|
1065 |
Â
|
1066 |
Â
/**
|
1067 |
Â
*
|
1068 |
+
* @param array $payment_meta
|
1069 |
Â
* @param WC_Subscription $subscription
|
1070 |
Â
*/
|
1071 |
Â
public function subscription_payment_meta( $payment_meta, $subscription ) {
|
1083 |
Â
|
1084 |
Â
/**
|
1085 |
Â
*
|
1086 |
+
* @param float $amount
|
1087 |
Â
* @param WC_Order $order
|
1088 |
Â
*/
|
1089 |
Â
public function scheduled_subscription_payment( $amount, $order ) {
|
1105 |
Â
|
1106 |
Â
if ( $result->complete_payment ) {
|
1107 |
Â
if ( $result->charge->captured ) {
|
1108 |
+
WC_Stripe_Utils::add_balance_transaction_to_order( $result->charge, $order );
|
1109 |
Â
$order->payment_complete( $result->charge->id );
|
1110 |
Â
$order->add_order_note( sprintf( __( 'Recurring payment captured in Stripe. Payment method: %s', 'woo-stripe-payment' ), $order->get_payment_method_title() ) );
|
1111 |
Â
} else {
|
1112 |
+
$order->update_status( apply_filters( 'wc_stripe_authorized_renewal_order_status', 'on-hold', $order, $this ),
|
1113 |
+
sprintf( __( 'Recurring payment authorized in Stripe. Payment method: %s', 'woo-stripe-payment' ), $order->get_payment_method_title() ) );
|
1114 |
Â
}
|
1115 |
Â
} else {
|
1116 |
Â
$order->update_status( 'pending', sprintf( __( 'Customer must manually complete payment for payment method %s', 'woo-stripe-payment' ), $order->get_payment_method_title() ) );
|
1235 |
Â
}
|
1236 |
Â
}
|
1237 |
Â
/**
|
1238 |
+
* @param WC_Order $order
|
1239 |
Â
* @param WC_Payment_Gateway_Stripe $this
|
1240 |
+
* @param null $charge
|
1241 |
Â
*
|
1242 |
Â
* @since 3.2.7
|
1243 |
Â
*/
|
1304 |
Â
|
1305 |
Â
/**
|
1306 |
Â
*
|
1307 |
+
* @param WC_Order $order
|
1308 |
Â
* @param WC_Payment_Gateway_Stripe $gateway
|
1309 |
Â
*/
|
1310 |
Â
public function trigger_post_payment_processes( $order, $gateway ) {
|
1335 |
Â
$order->add_order_note( sprintf( __( 'Pre-order payment for order failed. Reason: %s', 'woo-stripe-payment' ), $result->get_error_message() ) );
|
1336 |
Â
} else {
|
1337 |
Â
if ( $result->complete_payment ) {
|
Â
|
|
1338 |
Â
$this->save_order_meta( $order, $result->charge );
|
1339 |
Â
|
1340 |
Â
if ( $result->charge->captured ) {
|
1341 |
+
WC_Stripe_Utils::add_balance_transaction_to_order( $result->charge, $order );
|
1342 |
Â
$order->payment_complete( $result->charge->id );
|
1343 |
Â
$order->add_order_note( sprintf( __( 'Pre-order payment captured in Stripe. Payment method: %s', 'woo-stripe-payment' ), $order->get_payment_method_title() ) );
|
1344 |
Â
} else {
|
1345 |
+
$order->update_status( apply_filters( 'wc_stripe_authorized_preorder_order_status', 'on-hold', $order, $this ),
|
1346 |
+
sprintf( __( 'Pre-order payment authorized in Stripe. Payment method: %s', 'woo-stripe-payment' ), $order->get_payment_method_title() ) );
|
1347 |
Â
}
|
1348 |
Â
} else {
|
1349 |
Â
$order->update_status( 'pending', sprintf( __( 'Customer must manually complete payment for payment method %s', 'woo-stripe-payment' ), $order->get_payment_method_title() ) );
|
1356 |
Â
* This acts as a lazy conversion
|
1357 |
Â
* method for merchants that have switched to our plugin from other plugins.
|
1358 |
Â
*
|
1359 |
+
* @param string $meta_key
|
1360 |
Â
* @param WC_Order $order
|
1361 |
+
* @param string $context
|
1362 |
Â
*
|
1363 |
Â
* @since 3.1.0
|
1364 |
Â
*/
|
1397 |
Â
* Gateways can override this method to add attributes to the Stripe object before it's
|
1398 |
Â
* sent to Stripe.
|
1399 |
Â
*
|
1400 |
+
* @param array $args
|
1401 |
Â
* @param WC_Order $order
|
1402 |
Â
*/
|
1403 |
Â
public function add_stripe_order_args( &$args, $order ) {
|
1423 |
Â
* @since 3.1.2
|
1424 |
Â
*/
|
1425 |
Â
private function get_payment_section_description() {
|
1426 |
+
return sprintf( __( '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.',
|
1427 |
+
'woo-stripe-payment' ),
|
1428 |
+
$this->get_method_title() );
|
1429 |
Â
}
|
1430 |
Â
|
1431 |
Â
/**
|
1432 |
Â
* Outputs fields required by Google Pay to render the payment wallet.
|
1433 |
Â
*
|
1434 |
Â
* @param string $page
|
1435 |
+
* @param array $data
|
1436 |
Â
*/
|
1437 |
Â
public function output_display_items( $page = 'checkout', $data = array() ) {
|
1438 |
Â
global $wp;
|
1454 |
Â
$data['total_cents'] = wc_stripe_add_number_precision( $order->get_total(), $order->get_currency() );
|
1455 |
Â
$data['currency'] = $order->get_currency();
|
1456 |
Â
$data['pre_order'] = $this->order_contains_pre_order( $order );
|
Â
|
|
1457 |
Â
} else {
|
1458 |
Â
$data['needs_shipping'] = WC()->cart->needs_shipping();
|
1459 |
Â
if ( 'checkout' === $page && is_cart() ) {
|
1472 |
Â
);
|
1473 |
Â
}
|
1474 |
Â
/**
|
1475 |
+
* @param array $data
|
1476 |
+
* @param string $page
|
1477 |
Â
* @param WC_Payment_Gateway_Stripe $this
|
1478 |
Â
*
|
1479 |
Â
* @since 3.1.8
|
1485 |
Â
|
1486 |
Â
/**
|
1487 |
Â
* @param array $deps
|
1488 |
+
* @param $scripts
|
1489 |
Â
*
|
1490 |
Â
* @since 3.1.8
|
1491 |
Â
*/
|
1494 |
Â
}
|
1495 |
Â
|
1496 |
Â
/**
|
Â
|
|
1497 |
Â
* @since 3.2.0
|
1498 |
+
* @return array
|
1499 |
Â
*/
|
1500 |
Â
public function get_shipping_packages() {
|
1501 |
Â
$packages = WC()->shipping()->get_packages();
|
1519 |
Â
|
1520 |
Â
/**
|
1521 |
Â
* @param WC_Cart $cart
|
1522 |
+
* @param array $items
|
1523 |
Â
*
|
Â
|
|
1524 |
Â
* @since 3.2.1
|
1525 |
+
* @return array
|
1526 |
Â
*/
|
1527 |
Â
protected function get_display_items_for_cart( $cart, $items = array() ) {
|
1528 |
Â
$incl_tax = wc_stripe_display_prices_including_tax();
|
1558 |
Â
|
1559 |
Â
/**
|
1560 |
Â
* @param WC_Order $order
|
1561 |
+
* @param array $items
|
1562 |
Â
*
|
Â
|
|
1563 |
Â
* @since 3.2.1
|
1564 |
+
* @return array
|
1565 |
Â
*/
|
1566 |
Â
protected function get_display_items_for_order( $order, $items = array() ) {
|
1567 |
Â
foreach ( $order->get_items() as $item ) {
|
1590 |
Â
}
|
1591 |
Â
|
1592 |
Â
/**
|
1593 |
+
* @param float $price
|
1594 |
Â
* @param string $label
|
1595 |
Â
* @param string $type
|
1596 |
+
* @param mixed ...$args
|
1597 |
Â
*
|
Â
|
|
1598 |
Â
* @since 3.2.1
|
1599 |
+
* @return array
|
1600 |
Â
*/
|
1601 |
Â
protected function get_display_item_for_cart( $price, $label, $type, ...$args ) {
|
1602 |
Â
return array(
|
1607 |
Â
}
|
1608 |
Â
|
1609 |
Â
/**
|
1610 |
+
* @param float $price
|
1611 |
+
* @param string $label
|
1612 |
Â
* @param WC_Order $order
|
1613 |
+
* @param string $type
|
1614 |
+
* @param mixed ...$args
|
1615 |
Â
*/
|
1616 |
Â
protected function get_display_item_for_order( $price, $label, $order, $type, ...$args ) {
|
1617 |
Â
return array(
|
1624 |
Â
/**
|
1625 |
Â
* @param WC_Product $product
|
1626 |
Â
*
|
Â
|
|
1627 |
Â
* @since 3.2.1
|
1628 |
Â
*
|
1629 |
+
* @return array
|
1630 |
Â
*/
|
1631 |
Â
protected function get_display_item_for_product( $product ) {
|
1632 |
Â
return array(
|
1638 |
Â
|
1639 |
Â
/**
|
1640 |
Â
* @param array $methods
|
1641 |
+
* @param $sort
|
1642 |
Â
*
|
Â
|
|
1643 |
Â
* @since 3.2.1
|
1644 |
+
* @return array
|
1645 |
Â
*/
|
1646 |
Â
public function get_formatted_shipping_methods( $methods = array() ) {
|
1647 |
Â
if ( wcs_stripe_active() && WC_Subscriptions_Change_Payment_Gateway::$is_request_to_change_payment ) {
|
1684 |
Â
}
|
1685 |
Â
|
1686 |
Â
/**
|
1687 |
+
* @param float $price
|
1688 |
Â
* @param WC_Shipping_Rate $rate
|
1689 |
+
* @param string $i
|
1690 |
+
* @param array $package
|
1691 |
+
* @param bool $incl_tax
|
1692 |
Â
*
|
Â
|
|
1693 |
Â
* @since 3.2.1
|
1694 |
+
* @return array
|
1695 |
Â
*/
|
1696 |
Â
public function get_formatted_shipping_method( $price, $rate, $i, $package, $incl_tax ) {
|
1697 |
Â
$method = array(
|
1724 |
Â
}
|
1725 |
Â
|
1726 |
Â
/**
|
1727 |
+
* @param float $price
|
1728 |
Â
* @param WC_Shipping_Rate $rate
|
1729 |
+
* @param bool $incl_tax
|
1730 |
Â
*
|
1731 |
Â
* @since 3.2.1
|
1732 |
Â
*/
|
1736 |
Â
|
1737 |
Â
/**
|
1738 |
Â
* Returns true if a scheduled subscription payment is being processed.
|
1739 |
+
*
|
1740 |
Â
* @since 3.2.3
|
1741 |
+
* @return bool
|
1742 |
Â
*/
|
1743 |
Â
protected function is_processing_scheduled_payment() {
|
1744 |
Â
return doing_action( 'woocommerce_scheduled_subscription_payment_' . $this->id );
|
1747 |
Â
/**
|
1748 |
Â
* @param WC_Stripe_Frontend_Scripts $scripts
|
1749 |
Â
*
|
Â
|
|
1750 |
Â
* @since 3.2.5
|
1751 |
+
* @return bool
|
1752 |
Â
*/
|
1753 |
Â
public function has_enqueued_scripts( $scripts ) {
|
1754 |
Â
return false;
|
1767 |
Â
/**
|
1768 |
Â
* @param WC_Subscription $subscription
|
1769 |
Â
*
|
Â
|
|
1770 |
Â
* @since 3.2.13
|
1771 |
+
* @return array
|
1772 |
Â
*/
|
1773 |
Â
protected function process_change_payment_method_request( $subscription ) {
|
1774 |
Â
if ( ! $this->use_saved_source() ) {
|
1795 |
Â
|
1796 |
Â
/**
|
1797 |
Â
* @param WC_Subscription $subscription
|
1798 |
+
* @param WC_Order $order
|
1799 |
Â
*/
|
1800 |
Â
public function update_failing_payment_method( $subscription, $order ) {
|
1801 |
Â
if ( ( $token = $this->get_token( $order->get_meta( WC_Stripe_Constants::PAYMENT_METHOD_TOKEN ), $order->get_customer_id() ) ) ) {
|
1808 |
Â
/**
|
1809 |
Â
* @param array $options
|
1810 |
Â
*
|
Â
|
|
1811 |
Â
* @since 3.3.10
|
1812 |
+
* @return mixed|void
|
1813 |
Â
*/
|
1814 |
Â
public function get_element_options( $options = array() ) {
|
1815 |
Â
$options = array_merge( array( 'locale' => 'auto' ), $options );
|
1816 |
Â
|
1817 |
Â
return apply_filters( 'wc_stripe_get_element_options', $options, $this );
|
1818 |
Â
}
|
1819 |
+
|
1820 |
Â
}
|
includes/abstract/abstract-wc-stripe-payment.php
CHANGED
@@ -1,10 +1,11 @@
|
|
1 |
Â
<?php
|
Â
|
|
2 |
Â
defined( 'ABSPATH' ) || exit();
|
3 |
Â
|
4 |
Â
/**
|
5 |
Â
*
|
6 |
-
* @author PaymentPlugins
|
7 |
Â
* @since 3.1.0
|
Â
|
|
8 |
Â
* @package Stripe/Abstract
|
9 |
Â
*
|
10 |
Â
*/
|
@@ -25,7 +26,7 @@ abstract class WC_Stripe_Payment {
|
|
25 |
Â
/**
|
26 |
Â
*
|
27 |
Â
* @param WC_Payment_Gateway_Stripe $payment_method
|
28 |
-
* @param WC_Stripe_Gateway
|
29 |
Â
*/
|
30 |
Â
public function __construct( $payment_method, $gateway ) {
|
31 |
Â
$this->payment_method = $payment_method;
|
@@ -39,15 +40,17 @@ abstract class WC_Stripe_Payment {
|
|
39 |
Â
/**
|
40 |
Â
* Process the payment for the order.
|
41 |
Â
*
|
42 |
-
* @param WC_Order
|
43 |
Â
* @param WC_Payment_Gateway_Stripe $payment_method
|
44 |
Â
*/
|
45 |
Â
public abstract function process_payment( $order );
|
46 |
Â
|
47 |
Â
/**
|
48 |
Â
*
|
49 |
-
* @param float
|
50 |
Â
* @param WC_Order $order
|
Â
|
|
Â
|
|
51 |
Â
*/
|
52 |
Â
public abstract function capture_charge( $amount, $order );
|
53 |
Â
|
@@ -65,14 +68,14 @@ abstract class WC_Stripe_Payment {
|
|
65 |
Â
|
66 |
Â
/**
|
67 |
Â
*
|
68 |
-
* @param array
|
69 |
Â
* @param WC_Order $order
|
70 |
Â
*/
|
71 |
Â
public abstract function add_order_payment_method( &$args, $order );
|
72 |
Â
|
73 |
Â
/**
|
74 |
Â
*
|
75 |
-
* @param float
|
76 |
Â
* @param WC_Order $order
|
77 |
Â
*/
|
78 |
Â
public abstract function scheduled_subscription_payment( $amount, $order );
|
@@ -93,15 +96,19 @@ abstract class WC_Stripe_Payment {
|
|
93 |
Â
/**
|
94 |
Â
* Perform post payment processes
|
95 |
Â
*
|
96 |
-
* @param WC_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 ),
|
Â
|
|
Â
|
|
Â
|
|
105 |
Â
} else {
|
106 |
Â
if ( $charge->captured ) {
|
107 |
Â
$order->payment_complete( $charge->id );
|
@@ -109,7 +116,10 @@ abstract class WC_Stripe_Payment {
|
|
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' ),
|
Â
|
|
Â
|
|
Â
|
|
113 |
Â
}
|
114 |
Â
|
115 |
Â
/**
|
@@ -121,7 +131,7 @@ abstract class WC_Stripe_Payment {
|
|
121 |
Â
/**
|
122 |
Â
*
|
123 |
Â
* @param WC_Order $order
|
124 |
-
* @param float
|
125 |
Â
*
|
126 |
Â
* @throws Exception
|
127 |
Â
*/
|
@@ -136,7 +146,7 @@ abstract class WC_Stripe_Payment {
|
|
136 |
Â
* @param array
|
137 |
Â
* @param WC_Stripe_Payment
|
138 |
Â
* @param WC_Order $order
|
139 |
-
* @param float
|
140 |
Â
*
|
141 |
Â
* @since 3.2.10
|
142 |
Â
*/
|
@@ -146,21 +156,25 @@ abstract class WC_Stripe_Payment {
|
|
146 |
Â
'metadata' => array(
|
147 |
Â
'order_id' => $order->get_id(),
|
148 |
Â
'created_via' => 'woocommerce'
|
149 |
-
)
|
Â
|
|
150 |
Â
), $this, $order, $amount );
|
151 |
Â
$result = $this->gateway->refunds->mode( wc_stripe_order_mode( $order ) )->create( $args );
|
152 |
Â
if ( ! is_wp_error( $result ) ) {
|
Â
|
|
Â
|
|
153 |
Â
return true;
|
154 |
Â
}
|
155 |
Â
|
156 |
Â
return $result;
|
157 |
-
}
|
Â
|
|
158 |
Â
return new WP_Error( 'refund-error', $e->getMessage() );
|
159 |
Â
}
|
160 |
Â
}
|
161 |
Â
|
162 |
Â
/**
|
163 |
-
* @param WC_Order
|
164 |
Â
* @param WC_Payment_Gateway_Stripe $payment_method
|
165 |
Â
*
|
166 |
Â
* @since 3.3.8
|
@@ -194,7 +208,7 @@ abstract class WC_Stripe_Payment {
|
|
194 |
Â
|
195 |
Â
/**
|
196 |
Â
*
|
197 |
-
* @param array
|
198 |
Â
* @param WC_Order $order
|
199 |
Â
*/
|
200 |
Â
public function add_general_order_args( &$args, $order ) {
|
@@ -208,7 +222,7 @@ abstract class WC_Stripe_Payment {
|
|
208 |
Â
|
209 |
Â
/**
|
210 |
Â
*
|
211 |
-
* @param array
|
212 |
Â
* @param WC_Order $order
|
213 |
Â
*/
|
214 |
Â
public function add_order_metadata( &$args, $order ) {
|
@@ -247,7 +261,7 @@ abstract class WC_Stripe_Payment {
|
|
247 |
Â
|
248 |
Â
/**
|
249 |
Â
*
|
250 |
-
* @param array
|
251 |
Â
* @param WC_Order $order
|
252 |
Â
*/
|
253 |
Â
public function add_order_description( &$args, $order ) {
|
@@ -256,9 +270,9 @@ abstract class WC_Stripe_Payment {
|
|
256 |
Â
|
257 |
Â
/**
|
258 |
Â
*
|
259 |
-
* @param array
|
260 |
Â
* @param WC_Order $order
|
261 |
-
* @param float
|
262 |
Â
*/
|
263 |
Â
public function add_order_amount( &$args, $order, $amount = null ) {
|
264 |
Â
$args['amount'] = wc_stripe_add_number_precision( $amount ? $amount : $order->get_total(), $order->get_currency() );
|
@@ -266,7 +280,7 @@ abstract class WC_Stripe_Payment {
|
|
266 |
Â
|
267 |
Â
/**
|
268 |
Â
*
|
269 |
-
* @param array
|
270 |
Â
* @param WC_Order $order
|
271 |
Â
*/
|
272 |
Â
public function add_order_currency( &$args, $order ) {
|
@@ -275,7 +289,7 @@ abstract class WC_Stripe_Payment {
|
|
275 |
Â
|
276 |
Â
/**
|
277 |
Â
*
|
278 |
-
* @param array
|
279 |
Â
* @param WC_Order $order
|
280 |
Â
*/
|
281 |
Â
public function add_order_shipping_address( &$args, $order ) {
|
@@ -299,7 +313,7 @@ abstract class WC_Stripe_Payment {
|
|
299 |
Â
/**
|
300 |
Â
*
|
301 |
Â
* @param WC_Order $order
|
302 |
-
* @param string
|
303 |
Â
*
|
304 |
Â
* @return string
|
305 |
Â
*/
|
@@ -321,7 +335,7 @@ abstract class WC_Stripe_Payment {
|
|
321 |
Â
$note = sprintf( __( 'Error processing payment. Reason: %s', 'woo-stripe-payment' ), $error->get_error_message() );
|
322 |
Â
|
323 |
Â
/**
|
324 |
-
* @param string
|
325 |
Â
* @param WP_Error $error
|
326 |
Â
*
|
327 |
Â
*/
|
@@ -337,4 +351,5 @@ abstract class WC_Stripe_Payment {
|
|
337 |
Â
public function set_payment_method( $payment_method ) {
|
338 |
Â
$this->payment_method = $payment_method;
|
339 |
Â
}
|
Â
|
|
340 |
Â
}
|
1 |
Â
<?php
|
2 |
+
|
3 |
Â
defined( 'ABSPATH' ) || exit();
|
4 |
Â
|
5 |
Â
/**
|
6 |
Â
*
|
Â
|
|
7 |
Â
* @since 3.1.0
|
8 |
+
* @author PaymentPlugins
|
9 |
Â
* @package Stripe/Abstract
|
10 |
Â
*
|
11 |
Â
*/
|
26 |
Â
/**
|
27 |
Â
*
|
28 |
Â
* @param WC_Payment_Gateway_Stripe $payment_method
|
29 |
+
* @param WC_Stripe_Gateway $gateway
|
30 |
Â
*/
|
31 |
Â
public function __construct( $payment_method, $gateway ) {
|
32 |
Â
$this->payment_method = $payment_method;
|
40 |
Â
/**
|
41 |
Â
* Process the payment for the order.
|
42 |
Â
*
|
43 |
+
* @param WC_Order $order
|
44 |
Â
* @param WC_Payment_Gateway_Stripe $payment_method
|
45 |
Â
*/
|
46 |
Â
public abstract function process_payment( $order );
|
47 |
Â
|
48 |
Â
/**
|
49 |
Â
*
|
50 |
+
* @param float $amount
|
51 |
Â
* @param WC_Order $order
|
52 |
+
*
|
53 |
+
* @return \Stripe\Charge
|
54 |
Â
*/
|
55 |
Â
public abstract function capture_charge( $amount, $order );
|
56 |
Â
|
68 |
Â
|
69 |
Â
/**
|
70 |
Â
*
|
71 |
+
* @param array $args
|
72 |
Â
* @param WC_Order $order
|
73 |
Â
*/
|
74 |
Â
public abstract function add_order_payment_method( &$args, $order );
|
75 |
Â
|
76 |
Â
/**
|
77 |
Â
*
|
78 |
+
* @param float $amount
|
79 |
Â
* @param WC_Order $order
|
80 |
Â
*/
|
81 |
Â
public abstract function scheduled_subscription_payment( $amount, $order );
|
96 |
Â
/**
|
97 |
Â
* Perform post payment processes
|
98 |
Â
*
|
99 |
+
* @param WC_Order $order
|
100 |
Â
* @param \Stripe\Charge $charge
|
101 |
Â
*
|
102 |
Â
* @since 3.1.7
|
103 |
Â
*/
|
104 |
Â
public function payment_complete( $order, $charge ) {
|
105 |
+
WC_Stripe_Utils::add_balance_transaction_to_order( $charge, $order );
|
106 |
Â
$this->payment_method->save_order_meta( $order, $charge );
|
107 |
Â
if ( 'pending' === $charge->status ) {
|
108 |
+
$order->update_status( apply_filters( 'wc_stripe_pending_charge_status', 'on-hold', $order, $this->payment_method ),
|
109 |
+
sprintf( __( 'Charge %1$s is pending. Payment Method: %2$s. Payment will be completed once charge.succeeded webhook received from Stripe.', 'woo-stripe-payment' ),
|
110 |
+
$order->get_transaction_id(),
|
111 |
+
$order->get_payment_method_title() ) );
|
112 |
Â
} else {
|
113 |
Â
if ( $charge->captured ) {
|
114 |
Â
$order->payment_complete( $charge->id );
|
116 |
Â
$order_status = $this->payment_method->get_option( 'order_status' );
|
117 |
Â
$order->update_status( apply_filters( 'wc_stripe_authorized_order_status', 'default' === $order_status ? 'on-hold' : $order_status, $order, $this->payment_method ) );
|
118 |
Â
}
|
119 |
+
$order->add_order_note( sprintf( __( 'Order %1$s successful in Stripe. Charge: %2$s. Payment Method: %3$s', 'woo-stripe-payment' ),
|
120 |
+
$charge->captured ? __( 'charge', 'woo-stripe-payment' ) : __( 'authorization', 'woo-stripe-payment' ),
|
121 |
+
$order->get_transaction_id(),
|
122 |
+
$order->get_payment_method_title() ) );
|
123 |
Â
}
|
124 |
Â
|
125 |
Â
/**
|
131 |
Â
/**
|
132 |
Â
*
|
133 |
Â
* @param WC_Order $order
|
134 |
+
* @param float $amount
|
135 |
Â
*
|
136 |
Â
* @throws Exception
|
137 |
Â
*/
|
146 |
Â
* @param array
|
147 |
Â
* @param WC_Stripe_Payment
|
148 |
Â
* @param WC_Order $order
|
149 |
+
* @param float $amount
|
150 |
Â
*
|
151 |
Â
* @since 3.2.10
|
152 |
Â
*/
|
156 |
Â
'metadata' => array(
|
157 |
Â
'order_id' => $order->get_id(),
|
158 |
Â
'created_via' => 'woocommerce'
|
159 |
+
),
|
160 |
+
'expand' => stripe_wc()->advanced_settings->is_fee_enabled() ? array( 'charge.balance_transaction', 'charge.refunds.data.balance_transaction' ) : array()
|
161 |
Â
), $this, $order, $amount );
|
162 |
Â
$result = $this->gateway->refunds->mode( wc_stripe_order_mode( $order ) )->create( $args );
|
163 |
Â
if ( ! is_wp_error( $result ) ) {
|
164 |
+
WC_Stripe_Utils::add_balance_transaction_to_order( $result->charge, $order, true );
|
165 |
+
|
166 |
Â
return true;
|
167 |
Â
}
|
168 |
Â
|
169 |
Â
return $result;
|
170 |
+
}
|
171 |
+
catch ( Exception $e ) {
|
172 |
Â
return new WP_Error( 'refund-error', $e->getMessage() );
|
173 |
Â
}
|
174 |
Â
}
|
175 |
Â
|
176 |
Â
/**
|
177 |
+
* @param WC_Order $order
|
178 |
Â
* @param WC_Payment_Gateway_Stripe $payment_method
|
179 |
Â
*
|
180 |
Â
* @since 3.3.8
|
208 |
Â
|
209 |
Â
/**
|
210 |
Â
*
|
211 |
+
* @param array $args
|
212 |
Â
* @param WC_Order $order
|
213 |
Â
*/
|
214 |
Â
public function add_general_order_args( &$args, $order ) {
|
222 |
Â
|
223 |
Â
/**
|
224 |
Â
*
|
225 |
+
* @param array $args
|
226 |
Â
* @param WC_Order $order
|
227 |
Â
*/
|
228 |
Â
public function add_order_metadata( &$args, $order ) {
|
261 |
Â
|
262 |
Â
/**
|
263 |
Â
*
|
264 |
+
* @param array $args
|
265 |
Â
* @param WC_Order $order
|
266 |
Â
*/
|
267 |
Â
public function add_order_description( &$args, $order ) {
|
270 |
Â
|
271 |
Â
/**
|
272 |
Â
*
|
273 |
+
* @param array $args
|
274 |
Â
* @param WC_Order $order
|
275 |
+
* @param float $amount
|
276 |
Â
*/
|
277 |
Â
public function add_order_amount( &$args, $order, $amount = null ) {
|
278 |
Â
$args['amount'] = wc_stripe_add_number_precision( $amount ? $amount : $order->get_total(), $order->get_currency() );
|
280 |
Â
|
281 |
Â
/**
|
282 |
Â
*
|
283 |
+
* @param array $args
|
284 |
Â
* @param WC_Order $order
|
285 |
Â
*/
|
286 |
Â
public function add_order_currency( &$args, $order ) {
|
289 |
Â
|
290 |
Â
/**
|
291 |
Â
*
|
292 |
+
* @param array $args
|
293 |
Â
* @param WC_Order $order
|
294 |
Â
*/
|
295 |
Â
public function add_order_shipping_address( &$args, $order ) {
|
313 |
Â
/**
|
314 |
Â
*
|
315 |
Â
* @param WC_Order $order
|
316 |
+
* @param string $type
|
317 |
Â
*
|
318 |
Â
* @return string
|
319 |
Â
*/
|
335 |
Â
$note = sprintf( __( 'Error processing payment. Reason: %s', 'woo-stripe-payment' ), $error->get_error_message() );
|
336 |
Â
|
337 |
Â
/**
|
338 |
+
* @param string $note
|
339 |
Â
* @param WP_Error $error
|
340 |
Â
*
|
341 |
Â
*/
|
351 |
Â
public function set_payment_method( $payment_method ) {
|
352 |
Â
$this->payment_method = $payment_method;
|
353 |
Â
}
|
354 |
+
|
355 |
Â
}
|
includes/abstract/abstract-wc-stripe-rest-controller.php
CHANGED
@@ -54,7 +54,7 @@ abstract class WC_Stripe_Rest_Controller {
|
|
54 |
Â
* @param WP_REST_Request $request
|
55 |
Â
*/
|
56 |
Â
public function admin_permission_check( $request ) {
|
57 |
-
if ( ! current_user_can( '
|
58 |
Â
return new WP_Error( 'permission-error', __( 'You do not have permissions to access this resource.', 'woo-stripe-payment' ), array( 'status' => 403 ) );
|
59 |
Â
}
|
60 |
Â
|
54 |
Â
* @param WP_REST_Request $request
|
55 |
Â
*/
|
56 |
Â
public function admin_permission_check( $request ) {
|
57 |
+
if ( ! current_user_can( 'manage_woocommerce' ) ) {
|
58 |
Â
return new WP_Error( 'permission-error', __( 'You do not have permissions to access this resource.', 'woo-stripe-payment' ), array( 'status' => 403 ) );
|
59 |
Â
}
|
60 |
Â
|
includes/admin/class-wc-stripe-admin-assets.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
Â
<?php
|
Â
|
|
2 |
Â
defined( 'ABSPATH' ) || exit();
|
3 |
Â
|
4 |
Â
/**
|
@@ -62,9 +63,10 @@ class WC_Stripe_Admin_Assets {
|
|
62 |
Â
'wc_stripe_setting_params',
|
63 |
Â
array(
|
64 |
Â
'routes' => array(
|
65 |
-
'apple_domain' => WC_Stripe_Rest_API::
|
66 |
-
'create_webhook' => WC_Stripe_Rest_API::
|
67 |
-
'
|
Â
|
|
68 |
Â
),
|
69 |
Â
'rest_nonce' => wp_create_nonce( 'wp_rest' ),
|
70 |
Â
)
|
@@ -105,6 +107,7 @@ class WC_Stripe_Admin_Assets {
|
|
105 |
Â
global $current_section, $wc_stripe_subsection;
|
106 |
Â
do_action( 'wc_stripe_localize_' . $wc_stripe_subsection . '_settings' );
|
107 |
Â
}
|
Â
|
|
108 |
Â
}
|
109 |
Â
|
110 |
Â
new WC_Stripe_Admin_Assets();
|
1 |
Â
<?php
|
2 |
+
|
3 |
Â
defined( 'ABSPATH' ) || exit();
|
4 |
Â
|
5 |
Â
/**
|
63 |
Â
'wc_stripe_setting_params',
|
64 |
Â
array(
|
65 |
Â
'routes' => array(
|
66 |
+
'apple_domain' => WC_Stripe_Rest_API::get_admin_endpoint( stripe_wc()->rest_api->settings->rest_uri( 'apple-domain' ) ),
|
67 |
+
'create_webhook' => WC_Stripe_Rest_API::get_admin_endpoint( stripe_wc()->rest_api->settings->rest_uri( 'create-webhook' ) ),
|
68 |
+
'delete_webhook' => WC_Stripe_Rest_API::get_admin_endpoint( stripe_wc()->rest_api->settings->rest_uri( 'delete-webhook' ) ),
|
69 |
+
'connection_test' => WC_Stripe_Rest_API::get_admin_endpoint( stripe_wc()->rest_api->settings->rest_uri( 'connection-test' ) ),
|
70 |
Â
),
|
71 |
Â
'rest_nonce' => wp_create_nonce( 'wp_rest' ),
|
72 |
Â
)
|
107 |
Â
global $current_section, $wc_stripe_subsection;
|
108 |
Â
do_action( 'wc_stripe_localize_' . $wc_stripe_subsection . '_settings' );
|
109 |
Â
}
|
110 |
+
|
111 |
Â
}
|
112 |
Â
|
113 |
Â
new WC_Stripe_Admin_Assets();
|
includes/admin/class-wc-stripe-admin-settings.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
Â
<?php
|
Â
|
|
2 |
Â
defined( 'ABSPATH' ) || exit();
|
3 |
Â
|
4 |
Â
/**
|
@@ -13,7 +14,6 @@ class WC_Stripe_Admin_Settings {
|
|
13 |
Â
add_action( 'woocommerce_settings_checkout', array( __CLASS__, 'output' ) );
|
14 |
Â
add_filter( 'wc_stripe_settings_nav_tabs', array( __CLASS__, 'admin_settings_tabs' ), 20 );
|
15 |
Â
add_action( 'woocommerce_update_options_checkout', array( __CLASS__, 'save' ) );
|
16 |
-
add_filter( 'woocommerce_get_settings_email', array( __CLASS__, 'get_email_settings' ), 10, 2 );
|
17 |
Â
}
|
18 |
Â
|
19 |
Â
public static function output() {
|
@@ -81,7 +81,14 @@ class WC_Stripe_Admin_Settings {
|
|
81 |
Â
do_action( 'wc_stripe_settings_before_options_' . $current_section . '_' . $wc_stripe_subsection );
|
82 |
Â
}
|
83 |
Â
|
84 |
-
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
85 |
Â
if ( ! $section_id ) {
|
86 |
Â
$settings[] = array(
|
87 |
Â
'type' => 'title',
|
@@ -92,7 +99,8 @@ class WC_Stripe_Admin_Settings {
|
|
92 |
Â
'title' => __( 'Email Receipt', 'woo-stripe-payment' ),
|
93 |
Â
'id' => 'woocommerce_stripe_email_receipt',
|
94 |
Â
'autoload' => false,
|
95 |
-
'desc' => __( 'If enabled, an email receipt will be sent to the customer by Stripe when the order is processed.',
|
Â
|
|
96 |
Â
);
|
97 |
Â
$settings[] = array(
|
98 |
Â
'type' => 'sectionend',
|
@@ -102,6 +110,7 @@ class WC_Stripe_Admin_Settings {
|
|
102 |
Â
|
103 |
Â
return $settings;
|
104 |
Â
}
|
Â
|
|
105 |
Â
}
|
106 |
Â
|
107 |
Â
WC_Stripe_Admin_Settings::init();
|
1 |
Â
<?php
|
2 |
+
|
3 |
Â
defined( 'ABSPATH' ) || exit();
|
4 |
Â
|
5 |
Â
/**
|
14 |
Â
add_action( 'woocommerce_settings_checkout', array( __CLASS__, 'output' ) );
|
15 |
Â
add_filter( 'wc_stripe_settings_nav_tabs', array( __CLASS__, 'admin_settings_tabs' ), 20 );
|
16 |
Â
add_action( 'woocommerce_update_options_checkout', array( __CLASS__, 'save' ) );
|
Â
|
|
17 |
Â
}
|
18 |
Â
|
19 |
Â
public static function output() {
|
81 |
Â
do_action( 'wc_stripe_settings_before_options_' . $current_section . '_' . $wc_stripe_subsection );
|
82 |
Â
}
|
83 |
Â
|
84 |
+
/**
|
85 |
+
* @param $settings
|
86 |
+
* @param string $section_id
|
87 |
+
*
|
88 |
+
* @return mixed
|
89 |
+
* @deprecated
|
90 |
+
*/
|
91 |
+
public static function get_email_settings( $settings, $section_id = '' ) {
|
92 |
Â
if ( ! $section_id ) {
|
93 |
Â
$settings[] = array(
|
94 |
Â
'type' => 'title',
|
99 |
Â
'title' => __( 'Email Receipt', 'woo-stripe-payment' ),
|
100 |
Â
'id' => 'woocommerce_stripe_email_receipt',
|
101 |
Â
'autoload' => false,
|
102 |
+
'desc' => __( 'If enabled, an email receipt will be sent to the customer by Stripe when the order is processed.',
|
103 |
+
'woo-stripe-payment' ),
|
104 |
Â
);
|
105 |
Â
$settings[] = array(
|
106 |
Â
'type' => 'sectionend',
|
110 |
Â
|
111 |
Â
return $settings;
|
112 |
Â
}
|
113 |
+
|
114 |
Â
}
|
115 |
Â
|
116 |
Â
WC_Stripe_Admin_Settings::init();
|
includes/admin/meta-boxes/class-wc-stripe-admin-meta-box-product-data.php
CHANGED
@@ -57,6 +57,7 @@ class WC_Stripe_Admin_Meta_Box_Product_Data {
|
|
57 |
Â
}
|
58 |
Â
|
59 |
Â
private static function get_payment_gateways() {
|
Â
|
|
60 |
Â
foreach ( self::$_gateways as $gateway ) {
|
61 |
Â
$gateways[ $gateway->id ] = $gateway;
|
62 |
Â
}
|
@@ -93,6 +94,7 @@ class WC_Stripe_Admin_Meta_Box_Product_Data {
|
|
93 |
Â
}
|
94 |
Â
$product->update_meta_data( \WC_Stripe_Constants::PRODUCT_GATEWAY_ORDER, $order );
|
95 |
Â
}
|
Â
|
|
96 |
Â
}
|
97 |
Â
|
98 |
Â
\PaymentPlugins\WC_Stripe_Admin_Meta_Box_Product_Data::init();
|
57 |
Â
}
|
58 |
Â
|
59 |
Â
private static function get_payment_gateways() {
|
60 |
+
$gateways = array();
|
61 |
Â
foreach ( self::$_gateways as $gateway ) {
|
62 |
Â
$gateways[ $gateway->id ] = $gateway;
|
63 |
Â
}
|
94 |
Â
}
|
95 |
Â
$product->update_meta_data( \WC_Stripe_Constants::PRODUCT_GATEWAY_ORDER, $order );
|
96 |
Â
}
|
97 |
+
|
98 |
Â
}
|
99 |
Â
|
100 |
Â
\PaymentPlugins\WC_Stripe_Admin_Meta_Box_Product_Data::init();
|
includes/admin/meta-boxes/class-wc-stripe-admin-order-metaboxes.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
Â
<?php
|
Â
|
|
2 |
Â
defined( 'ABSPATH' ) || exit();
|
3 |
Â
|
4 |
Â
/**
|
@@ -15,7 +16,7 @@ class WC_Stripe_Admin_Order_Metaboxes {
|
|
15 |
Â
|
16 |
Â
/**
|
17 |
Â
*
|
18 |
-
* @param string
|
19 |
Â
* @param WP_Post $post
|
20 |
Â
*/
|
21 |
Â
public static function add_meta_boxes( $post_type, $post ) {
|
@@ -34,6 +35,7 @@ class WC_Stripe_Admin_Order_Metaboxes {
|
|
34 |
Â
$gateway = WC()->payment_gateways()->payment_gateways()[ $payment_method ];
|
35 |
Â
if ( $gateway instanceof WC_Payment_Gateway_Stripe ) {
|
36 |
Â
add_action( 'woocommerce_admin_order_data_after_billing_address', array( __CLASS__, 'charge_data_view' ) );
|
Â
|
|
37 |
Â
}
|
38 |
Â
}
|
39 |
Â
}
|
@@ -55,7 +57,8 @@ class WC_Stripe_Admin_Order_Metaboxes {
|
|
55 |
Â
* @param WC_Order $order
|
56 |
Â
*/
|
57 |
Â
public static function pay_order_section( $order ) {
|
58 |
-
if ( $order->get_type() === 'shop_order'
|
Â
|
|
59 |
Â
'pending',
|
60 |
Â
'auto-draft'
|
61 |
Â
), $order ) ) ) {
|
@@ -91,6 +94,28 @@ class WC_Stripe_Admin_Order_Metaboxes {
|
|
91 |
Â
}
|
92 |
Â
}
|
93 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
94 |
Â
public static function enqueue_scripts() {
|
95 |
Â
wp_enqueue_script( 'wc-stripe-order-metabox', stripe_wc()->assets_url( 'js/admin/meta-boxes-order.js' ), array(
|
96 |
Â
'jquery',
|
@@ -112,6 +137,7 @@ class WC_Stripe_Admin_Order_Metaboxes {
|
|
112 |
Â
)
|
113 |
Â
);
|
114 |
Â
}
|
Â
|
|
115 |
Â
}
|
116 |
Â
|
117 |
Â
WC_Stripe_Admin_Order_Metaboxes::init();
|
1 |
Â
<?php
|
2 |
+
|
3 |
Â
defined( 'ABSPATH' ) || exit();
|
4 |
Â
|
5 |
Â
/**
|
16 |
Â
|
17 |
Â
/**
|
18 |
Â
*
|
19 |
+
* @param string $post_type
|
20 |
Â
* @param WP_Post $post
|
21 |
Â
*/
|
22 |
Â
public static function add_meta_boxes( $post_type, $post ) {
|
35 |
Â
$gateway = WC()->payment_gateways()->payment_gateways()[ $payment_method ];
|
36 |
Â
if ( $gateway instanceof WC_Payment_Gateway_Stripe ) {
|
37 |
Â
add_action( 'woocommerce_admin_order_data_after_billing_address', array( __CLASS__, 'charge_data_view' ) );
|
38 |
+
add_action( 'woocommerce_admin_order_totals_after_total', array( __CLASS__, 'stripe_fee_view' ) );
|
39 |
Â
}
|
40 |
Â
}
|
41 |
Â
}
|
57 |
Â
* @param WC_Order $order
|
58 |
Â
*/
|
59 |
Â
public static function pay_order_section( $order ) {
|
60 |
+
if ( $order->get_type() === 'shop_order'
|
61 |
+
&& $order->has_status( apply_filters( 'wc_stripe_pay_order_statuses', array(
|
62 |
Â
'pending',
|
63 |
Â
'auto-draft'
|
64 |
Â
), $order ) ) ) {
|
94 |
Â
}
|
95 |
Â
}
|
96 |
Â
|
97 |
+
public static function stripe_fee_view( $order_id ) {
|
98 |
+
if ( stripe_wc()->advanced_settings->is_active( 'stripe_fee' ) ) {
|
99 |
+
$order = wc_get_order( $order_id );
|
100 |
+
$fee = WC_Stripe_Utils::display_fee( $order );
|
101 |
+
$net = WC_Stripe_Utils::display_net( $order );
|
102 |
+
if ( $fee && $net ) {
|
103 |
+
?>
|
104 |
+
<tr>
|
105 |
+
<td class="label wc-stripe-fee"><?php esc_html_e( 'Stripe Fee', 'woo-stripe-payment' ) ?>:</td>
|
106 |
+
<td width="1%"></td>
|
107 |
+
<td><?php echo $fee ?></td>
|
108 |
+
</tr>
|
109 |
+
<tr>
|
110 |
+
<td class="label wc-stripe-net"><?php esc_html_e( 'Net payout', 'woo-stripe-payment' ) ?></td>
|
111 |
+
<td width="1%"></td>
|
112 |
+
<td class="total"><?php echo $net ?></td>
|
113 |
+
</tr>
|
114 |
+
<?php
|
115 |
+
}
|
116 |
+
}
|
117 |
+
}
|
118 |
+
|
119 |
Â
public static function enqueue_scripts() {
|
120 |
Â
wp_enqueue_script( 'wc-stripe-order-metabox', stripe_wc()->assets_url( 'js/admin/meta-boxes-order.js' ), array(
|
121 |
Â
'jquery',
|
137 |
Â
)
|
138 |
Â
);
|
139 |
Â
}
|
140 |
+
|
141 |
Â
}
|
142 |
Â
|
143 |
Â
WC_Stripe_Admin_Order_Metaboxes::init();
|
includes/admin/meta-boxes/views/html-order-charge-data.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
Â
<div class="transaction-data">
|
2 |
Â
<h3><?php esc_html_e( 'Transaction Data / Actions', 'woo-stripe-payment' ); ?></h3>
|
3 |
-
<a href="#" class="do-transaction-view"
|
4 |
-
data-order="<?php echo $order->get_id(); ?>"></a>
|
5 |
Â
</div>
|
6 |
Â
<script type="text/template" id="tmpl-wc-stripe-view-transaction">
|
7 |
Â
<div class="wc-backbone-modal">
|
1 |
Â
<div class="transaction-data">
|
2 |
Â
<h3><?php esc_html_e( 'Transaction Data / Actions', 'woo-stripe-payment' ); ?></h3>
|
3 |
+
<a href="#" class="do-stripe-transaction-view"
|
4 |
+
data-order="<?php echo esc_attr($order->get_id()); ?>"></a>
|
5 |
Â
</div>
|
6 |
Â
<script type="text/template" id="tmpl-wc-stripe-view-transaction">
|
7 |
Â
<div class="wc-backbone-modal">
|
includes/admin/settings/class-wc-stripe-advanced-settings.php
ADDED
@@ -0,0 +1,156 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
defined( 'ABSPATH' ) || exit();
|
4 |
+
|
5 |
+
/**
|
6 |
+
* @since 3.3.13
|
7 |
+
*/
|
8 |
+
class WC_Stripe_Advanced_Settings extends WC_Stripe_Settings_API {
|
9 |
+
|
10 |
+
public function __construct() {
|
11 |
+
$this->id = 'stripe_advanced';
|
12 |
+
$this->tab_title = __( 'Advanced Settings', 'woo-stripe-payment' );
|
13 |
+
parent::__construct();
|
14 |
+
}
|
15 |
+
|
16 |
+
public function hooks() {
|
17 |
+
parent::hooks();
|
18 |
+
add_action( 'woocommerce_update_options_checkout_' . $this->id, array( $this, 'process_admin_options' ) );
|
19 |
+
add_filter( 'wc_stripe_settings_nav_tabs', array( $this, 'admin_nav_tab' ) );
|
20 |
+
add_action( 'woocommerce_stripe_settings_checkout_' . $this->id, array( $this, 'admin_options' ) );
|
21 |
+
}
|
22 |
+
|
23 |
+
public function init_form_fields() {
|
24 |
+
$this->form_fields = array(
|
25 |
+
'title' => array(
|
26 |
+
'type' => 'title',
|
27 |
+
'title' => __( 'Advanced Settings', 'woo-stripe-payment' ),
|
28 |
+
),
|
29 |
+
'settings_description' => array(
|
30 |
+
'type' => 'description',
|
31 |
+
'description' => __( 'This section provides advanced settings that allow you to configure functionality that fits your business process.', 'woo-stripe-payment' )
|
32 |
+
),
|
33 |
+
'stripe_fee' => array(
|
34 |
+
'title' => __( 'Display Stripe Fee', 'woo-stripe-payment' ),
|
35 |
+
'type' => 'checkbox',
|
36 |
+
'default' => 'no',
|
37 |
+
'value' => 'yes',
|
38 |
+
'desc_tip' => true,
|
39 |
+
'description' => __( 'If enabled, the Stripe fee will be displayed on the Order Details page. The fee and net payout are displayed in your Stripe account currency.',
|
40 |
+
'woo-stripe-payment' )
|
41 |
+
),
|
42 |
+
'stripe_fee_currency' => array(
|
43 |
+
'title' => __( 'Fee Display Currency', 'woo-stripe-payment' ),
|
44 |
+
'type' => 'checkbox',
|
45 |
+
'default' => 'no',
|
46 |
+
'description' => __( 'If enabled, the Stripe fee and payout will be displayed in the currency of the order. Stripe by default provides the fee and payout in the Stripe account\'s currency.',
|
47 |
+
'woo-stripe-payment' ),
|
48 |
+
'custom_attributes' => array(
|
49 |
+
'data-show-if' => array(
|
50 |
+
'stripe_fee' => true
|
51 |
+
)
|
52 |
+
)
|
53 |
+
),
|
54 |
+
'refund_cancel' => array(
|
55 |
+
'title' => __( 'Refund On Cancel', 'woo-stripe-payment' ),
|
56 |
+
'type' => 'checkbox',
|
57 |
+
'default' => 'no',
|
58 |
+
'value' => 'yes',
|
59 |
+
'desc_tip' => true,
|
60 |
+
'description' => __( 'If enabled, the plugin will process a payment cancellation or refund within Stripe when the order\'s status is set to cancelled.', 'woo-stripe-payment' )
|
61 |
+
),
|
62 |
+
'disputes' => array(
|
63 |
+
'title' => __( 'Dispute Settings', 'woo-stripe-payment' ),
|
64 |
+
'type' => 'title'
|
65 |
+
),
|
66 |
+
'dispute_created' => array(
|
67 |
+
'title' => __( 'Dispute Created', 'woo-stripe-payment' ),
|
68 |
+
'type' => 'checkbox',
|
69 |
+
'default' => 'yes',
|
70 |
+
'description' => __( 'If enabled, the plugin will listen for the <strong>charge.dispute.created</strong> webhook event and set the order\'s status to on-hold by default.',
|
71 |
+
'woo-stripe-payment' )
|
72 |
+
),
|
73 |
+
'dispute_created_status' => array(
|
74 |
+
'title' => __( 'Disputed Created Order Status', 'woo-stripe-payment' ),
|
75 |
+
'type' => 'select',
|
76 |
+
'default' => 'wc-on-hold',
|
77 |
+
'options' => wc_get_order_statuses(),
|
78 |
+
'description' => __( 'The status assigned to an order when a dispute is created.', 'woo-stripe-payment' ),
|
79 |
+
'custom_attributes' => array(
|
80 |
+
'data-show-if' => array(
|
81 |
+
'dispute_created' => true
|
82 |
+
)
|
83 |
+
)
|
84 |
+
),
|
85 |
+
'dispute_closed' => array(
|
86 |
+
'title' => __( 'Dispute Closed', 'woo-stripe-payment' ),
|
87 |
+
'type' => 'checkbox',
|
88 |
+
'default' => 'yes',
|
89 |
+
'description' => __( 'If enabled, the plugin will listen for the <strong>charge.dispute.closed</strong> webhook event and set the order\'s status back to status before the dispute was opened.',
|
90 |
+
'woo-stripe-payment' )
|
91 |
+
),
|
92 |
+
'reviews' => array(
|
93 |
+
'title' => __( 'Review Settings', 'woo-stripe-payment' ),
|
94 |
+
'type' => 'title'
|
95 |
+
),
|
96 |
+
'review_created' => array(
|
97 |
+
'title' => __( 'Review Created', 'woo-stripe-payment' ),
|
98 |
+
'type' => 'checkbox',
|
99 |
+
'default' => 'no',
|
100 |
+
'description' => __( 'If enabled, the plugin will listen for the <strong>review.created</strong> webhook event and set the order\'s status to on-hold by default.',
|
101 |
+
'woo-stripe-payment' )
|
102 |
+
),
|
103 |
+
'review_closed' => array(
|
104 |
+
'title' => __( 'Review Closed', 'woo-stripe-payment' ),
|
105 |
+
'type' => 'checkbox',
|
106 |
+
'default' => 'no',
|
107 |
+
'description' => __( 'If enabled, the plugin will listen for the <strong>review.closed</strong> webhook event and set the order\'s status back to the status before the review was opened.',
|
108 |
+
'woo-stripe-payment' )
|
109 |
+
),
|
110 |
+
'email_title' => array(
|
111 |
+
'type' => 'title',
|
112 |
+
'title' => __( 'Stripe Email Options', 'woo-stripe-payment' )
|
113 |
+
),
|
114 |
+
'email_enabled' => array(
|
115 |
+
'type' => 'checkbox',
|
116 |
+
'title' => __( 'Email Receipt', 'woo-stripe-payment' ),
|
117 |
+
'default' => 'no',
|
118 |
+
'description' => __( 'If enabled, an email receipt will be sent to the customer by Stripe when the order is processed.',
|
119 |
+
'woo-stripe-payment' ),
|
120 |
+
)
|
121 |
+
);
|
122 |
+
}
|
123 |
+
|
124 |
+
public function is_fee_enabled() {
|
125 |
+
return $this->is_active( 'stripe_fee' );
|
126 |
+
}
|
127 |
+
|
128 |
+
public function is_display_order_currency() {
|
129 |
+
return $this->is_active( 'stripe_fee_currency' );
|
130 |
+
}
|
131 |
+
|
132 |
+
public function is_email_receipt_enabled() {
|
133 |
+
return $this->is_active( 'email_enabled' );
|
134 |
+
}
|
135 |
+
|
136 |
+
public function is_refund_cancel_enabled() {
|
137 |
+
return $this->is_active( 'refund_cancel' );
|
138 |
+
}
|
139 |
+
|
140 |
+
public function is_dispute_created_enabled() {
|
141 |
+
return $this->is_active( 'dispute_created' );
|
142 |
+
}
|
143 |
+
|
144 |
+
public function is_dispute_closed_enabled() {
|
145 |
+
return $this->is_active( 'dispute_closed' );
|
146 |
+
}
|
147 |
+
|
148 |
+
public function is_review_opened_enabled() {
|
149 |
+
return $this->is_active( 'review_created' );
|
150 |
+
}
|
151 |
+
|
152 |
+
public function is_review_closed_enabled() {
|
153 |
+
return $this->is_active( 'review_closed' );
|
154 |
+
}
|
155 |
+
|
156 |
+
}
|
includes/admin/settings/class-wc-stripe-api-settings.php
CHANGED
@@ -1,10 +1,11 @@
|
|
1 |
Â
<?php
|
Â
|
|
2 |
Â
defined( 'ABSPATH' ) || exit();
|
3 |
Â
|
4 |
Â
/**
|
5 |
Â
*
|
6 |
-
* @author Payment Plugins
|
7 |
Â
* @since 3.0.0
|
Â
|
|
8 |
Â
* @package Stripe/Classes
|
9 |
Â
*
|
10 |
Â
*/
|
@@ -31,7 +32,8 @@ class WC_Stripe_API_Settings extends WC_Stripe_Settings_API {
|
|
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.',
|
Â
|
|
35 |
Â
),
|
36 |
Â
'mode' => array(
|
37 |
Â
'type' => 'select',
|
@@ -43,7 +45,8 @@ class WC_Stripe_API_Settings extends WC_Stripe_Settings_API {
|
|
43 |
Â
),
|
44 |
Â
'default' => 'test',
|
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.',
|
Â
|
|
47 |
Â
),
|
48 |
Â
'account_id' => array(
|
49 |
Â
'type' => 'paragraph',
|
@@ -109,23 +112,53 @@ class WC_Stripe_API_Settings extends WC_Stripe_Settings_API {
|
|
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 |
-
'
|
Â
|
|
Â
|
|
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',
|
Â
|
|
Â
|
|
Â
|
|
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',
|
Â
|
|
Â
|
|
Â
|
|
129 |
Â
'custom_attributes' => array( 'data-show-if' => array( 'mode' => 'test' ) ),
|
130 |
Â
),
|
131 |
Â
'debug_log' => array(
|
@@ -137,14 +170,29 @@ class WC_Stripe_API_Settings extends WC_Stripe_Settings_API {
|
|
137 |
Â
),
|
138 |
Â
);
|
139 |
Â
if ( $this->get_option( 'account_id' ) ) {
|
140 |
-
$this->form_fields['account_id']['text']
|
141 |
-
$this->form_fields['stripe_connect']['description']
|
142 |
-
|
Â
|
|
Â
|
|
Â
|
|
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 |
Â
|
150 |
Â
public function generate_stripe_connect_html( $key, $data ) {
|
@@ -201,8 +249,11 @@ class WC_Stripe_API_Settings extends WC_Stripe_Settings_API {
|
|
201 |
Â
|
202 |
Â
delete_option( 'wc_stripe_connect_notice' );
|
203 |
Â
|
Â
|
|
Â
|
|
Â
|
|
204 |
Â
/**
|
205 |
-
* @param array
|
206 |
Â
* @param WC_Stripe_API_Settings $this
|
207 |
Â
*
|
208 |
Â
* @since 3.1.6
|
@@ -239,4 +290,63 @@ class WC_Stripe_API_Settings extends WC_Stripe_Settings_API {
|
|
239 |
Â
public function localize_settings() {
|
240 |
Â
return parent::localize_settings(); // TODO: Change the autogenerated stub
|
241 |
Â
}
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
242 |
Â
}
|
1 |
Â
<?php
|
2 |
+
|
3 |
Â
defined( 'ABSPATH' ) || exit();
|
4 |
Â
|
5 |
Â
/**
|
6 |
Â
*
|
Â
|
|
7 |
Â
* @since 3.0.0
|
8 |
+
* @author Payment Plugins
|
9 |
Â
* @package Stripe/Classes
|
10 |
Â
*
|
11 |
Â
*/
|
32 |
Â
),
|
33 |
Â
'test_mode_keys' => array(
|
34 |
Â
'type' => 'description',
|
35 |
+
'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.',
|
36 |
+
'woo-stripe-payment' ),
|
37 |
Â
),
|
38 |
Â
'mode' => array(
|
39 |
Â
'type' => 'select',
|
45 |
Â
),
|
46 |
Â
'default' => 'test',
|
47 |
Â
'desc_tip' => true,
|
48 |
+
'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.',
|
49 |
+
'woo-stripe-payment' ),
|
50 |
Â
),
|
51 |
Â
'account_id' => array(
|
52 |
Â
'type' => 'paragraph',
|
112 |
Â
)
|
113 |
Â
)
|
114 |
Â
),
|
115 |
+
'webhook_button_test' => array(
|
116 |
+
'type' => 'stripe_button',
|
117 |
+
'title' => __( 'Create Webhook', 'woo-stripe-payment' ),
|
118 |
+
'label' => __( 'Create Webhook', 'woo-stripe-payment' ),
|
119 |
+
'class' => 'wc-stripe-create-webhook test-mode button-secondary',
|
120 |
+
'custom_attributes' => array(
|
121 |
+
'data-show-if' => array(
|
122 |
+
'mode' => 'test'
|
123 |
+
)
|
124 |
+
)
|
125 |
+
),
|
126 |
+
'webhook_button_live' => array(
|
127 |
+
'type' => 'stripe_button',
|
128 |
+
'title' => __( 'Create Webhook', 'woo-stripe-payment' ),
|
129 |
+
'label' => __( 'Create Webhook', 'woo-stripe-payment' ),
|
130 |
+
'class' => 'wc-stripe-create-webhook live-mode button-secondary',
|
131 |
+
'custom_attributes' => array(
|
132 |
+
'data-show-if' => array(
|
133 |
+
'mode' => 'live'
|
134 |
+
)
|
135 |
+
)
|
136 |
+
),
|
137 |
Â
'webhook_url' => array(
|
138 |
Â
'type' => 'paragraph',
|
139 |
Â
'title' => __( 'Webhook url', 'woo-stripe-payment' ),
|
140 |
Â
'class' => 'wc-stripe-webhook',
|
141 |
Â
'text' => stripe_wc()->rest_api->webhook->rest_url( 'webhook' ),
|
142 |
+
'desc_tip' => true,
|
143 |
+
'description' => __( '<strong>Important:</strong> the webhook url is called by Stripe when events occur in your account, like a source becomes chargeable. Use the Create Webhook button or add the webhook manually in your Stripe account.',
|
144 |
+
'woo-stripe-payment' ),
|
145 |
Â
),
|
146 |
Â
'webhook_secret_live' => array(
|
147 |
Â
'type' => 'password',
|
148 |
Â
'title' => __( 'Live Webhook Secret', 'woo-stripe-payment' ),
|
149 |
+
'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',
|
150 |
+
'woo-stripe-payment' ),
|
151 |
+
'<a target="_blank" href="https://docs.paymentplugins.com/wc-stripe/config/#/webhooks?id=configure-webhooks">',
|
152 |
+
'</a>' ),
|
153 |
Â
'custom_attributes' => array( 'data-show-if' => array( 'mode' => 'live' ) ),
|
154 |
Â
),
|
155 |
Â
'webhook_secret_test' => array(
|
156 |
Â
'type' => 'password',
|
157 |
Â
'title' => __( 'Test Webhook Secret', 'woo-stripe-payment' ),
|
158 |
+
'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',
|
159 |
+
'woo-stripe-payment' ),
|
160 |
+
'<a target="_blank" href="https://docs.paymentplugins.com/wc-stripe/config/#/webhooks?id=configure-webhooks">',
|
161 |
+
'</a>' ),
|
162 |
Â
'custom_attributes' => array( 'data-show-if' => array( 'mode' => 'test' ) ),
|
163 |
Â
),
|
164 |
Â
'debug_log' => array(
|
170 |
Â
),
|
171 |
Â
);
|
172 |
Â
if ( $this->get_option( 'account_id' ) ) {
|
173 |
+
$this->form_fields['account_id']['text'] = $this->get_option( 'account_id' );
|
174 |
+
$this->form_fields['stripe_connect']['description']
|
175 |
+
= 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.',
|
176 |
+
'woo-stripe-payment' ),
|
177 |
+
'<span class="dashicons dashicons-yes stipe-connect-active"></span>' );
|
178 |
+
$this->form_fields['stripe_connect']['active'] = true;
|
179 |
Â
} else {
|
180 |
Â
unset( $this->form_fields['account_id'] );
|
181 |
Â
// don't show the live connection test unless connect process has been completed.
|
182 |
Â
unset( $this->form_fields['connection_test_live'] );
|
183 |
Â
}
|
184 |
+
|
185 |
+
foreach ( array( 'test', 'live' ) as $mode ) {
|
186 |
+
$webhook_id = $this->get_webhook_id( $mode );
|
187 |
+
if ( $webhook_id ) {
|
188 |
+
$this->form_fields["webhook_button_{$mode}"]['title'] = __( 'Delete Webhook', 'woo-stripe-payment' );
|
189 |
+
$this->form_fields["webhook_button_{$mode}"]['label'] = __( 'Delete Webhook', 'woo-stripe-payment' );
|
190 |
+
$this->form_fields["webhook_button_{$mode}"]['class'] .= ' wc-stripe-delete-webhook';
|
191 |
+
$this->form_fields["webhook_button_{$mode}"]['description'] = sprintf( __( '%1$s Webhook created. ID: %2$s' ),
|
192 |
+
'<span class="dashicons dashicons-yes stripe-webhook-created"></span>',
|
193 |
+
$webhook_id );
|
194 |
+
}
|
195 |
+
}
|
196 |
Â
}
|
197 |
Â
|
198 |
Â
public function generate_stripe_connect_html( $key, $data ) {
|
249 |
Â
|
250 |
Â
delete_option( 'wc_stripe_connect_notice' );
|
251 |
Â
|
252 |
+
// create webhooks
|
253 |
+
$this->create_webhooks();
|
254 |
+
|
255 |
Â
/**
|
256 |
+
* @param array $response
|
257 |
Â
* @param WC_Stripe_API_Settings $this
|
258 |
Â
*
|
259 |
Â
* @since 3.1.6
|
290 |
Â
public function localize_settings() {
|
291 |
Â
return parent::localize_settings(); // TODO: Change the autogenerated stub
|
292 |
Â
}
|
293 |
+
|
294 |
+
public function delete_webhook_settings( $mode ) {
|
295 |
+
unset( $this->settings["webhook_secret_{$mode}"], $this->settings["webhook_id_{$mode}"] );
|
296 |
+
update_option( $this->get_option_key(), $this->settings );
|
297 |
+
}
|
298 |
+
|
299 |
+
/**
|
300 |
+
* @param string $mode
|
301 |
+
* @param array $events
|
302 |
+
*
|
303 |
+
* @since 3.3.13
|
304 |
+
* @return bool|\Stripe\WebhookEndpoint
|
305 |
+
* @throws \Stripe\Exception\ApiErrorException
|
306 |
+
*/
|
307 |
+
public function create_webhook( $mode, $events = array() ) {
|
308 |
+
$client = WC_Stripe_Gateway::load();
|
309 |
+
$url = get_rest_url( null, '/wc-stripe/v1/webhook' );
|
310 |
+
if ( ! in_array( '*', $events ) ) {
|
311 |
+
$events = apply_filters(
|
312 |
+
'wc_stripe_webhook_events',
|
313 |
+
array_values( array_unique( array_merge( array(
|
314 |
+
'charge.failed',
|
315 |
+
'charge.succeeded',
|
316 |
+
'source.chargeable',
|
317 |
+
'payment_intent.succeeded',
|
318 |
+
'charge.refunded',
|
319 |
+
'charge.dispute.created',
|
320 |
+
'charge.dispute.closed',
|
321 |
+
'review.opened',
|
322 |
+
'review.closed'
|
323 |
+
), $events ) ) )
|
324 |
+
);
|
325 |
+
}
|
326 |
+
$webhook = $client->mode( $mode )->webhookEndpoints->create( array(
|
327 |
+
'api_version' => '2020-03-02',
|
328 |
+
'url' => $url,
|
329 |
+
'enabled_events' => $events,
|
330 |
+
) );
|
331 |
+
if ( is_wp_error( $webhook ) ) {
|
332 |
+
wc_stripe_log_error( sprintf( 'Error creating Stripe webhook. Mode: %1$s. Reason: %2$s', $mode, $webhook->get_error_message() ) );
|
333 |
+
} else {
|
334 |
+
$this->settings["webhook_secret_{$mode}"] = $webhook['secret'];
|
335 |
+
$this->settings["webhook_id_{$mode}"] = $webhook['id'];
|
336 |
+
update_option( $this->get_option_key(), $this->settings );
|
337 |
+
}
|
338 |
+
|
339 |
+
return $webhook;;
|
340 |
+
}
|
341 |
+
|
342 |
+
private function create_webhooks() {
|
343 |
+
foreach ( array( 'live', 'test' ) as $mode ) {
|
344 |
+
$this->create_webhook( $mode );
|
345 |
+
}
|
346 |
+
}
|
347 |
+
|
348 |
+
public function get_webhook_id( $mode ) {
|
349 |
+
return $this->get_option( "webhook_id_{$mode}", null );
|
350 |
+
}
|
351 |
+
|
352 |
Â
}
|
includes/class-stripe.php
CHANGED
@@ -1,11 +1,12 @@
|
|
1 |
Â
<?php
|
Â
|
|
2 |
Â
defined( 'ABSPATH' ) || exit();
|
3 |
Â
|
4 |
Â
/**
|
5 |
Â
* Singleton class that handles plugin functionality like class loading.
|
6 |
Â
*
|
7 |
-
* @since
|
8 |
-
* @author
|
9 |
Â
* @package Stripe/Classes
|
10 |
Â
*
|
11 |
Â
*/
|
@@ -25,7 +26,7 @@ class WC_Stripe_Manager {
|
|
25 |
Â
*
|
26 |
Â
* @var string
|
27 |
Â
*/
|
28 |
-
public $version = '3.3.
|
29 |
Â
|
30 |
Â
/**
|
31 |
Â
*
|
@@ -39,6 +40,12 @@ class WC_Stripe_Manager {
|
|
39 |
Â
*/
|
40 |
Â
public $account_settings;
|
41 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
42 |
Â
/**
|
43 |
Â
*
|
44 |
Â
* @var WC_Stripe_Rest_API
|
@@ -119,14 +126,17 @@ class WC_Stripe_Manager {
|
|
119 |
Â
* is installed to prevent conflicts.
|
120 |
Â
*/
|
121 |
Â
if ( ! function_exists( 'wc_stripe' ) ) {
|
122 |
-
if ( ( defined( 'WC_STRIPE_VERSION' ) && version_compare( WC_STRIPE_VERSION, '4.5.4', '<' ) )
|
123 |
-
|
Â
|
|
Â
|
|
Â
|
|
124 |
Â
/**
|
125 |
Â
* Returns the global instance of the WC_Stripe_Manager.
|
126 |
Â
*
|
127 |
Â
* @return WC_Stripe_Manager
|
128 |
-
* @package Stripe/Functions
|
129 |
Â
* @deprecated 3.2.8
|
Â
|
|
130 |
Â
*/
|
131 |
Â
function wc_stripe() {
|
132 |
Â
if ( function_exists( 'wc_deprecated_function' ) ) {
|
@@ -153,6 +163,8 @@ class WC_Stripe_Manager {
|
|
153 |
Â
include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/class-wc-stripe-update.php';
|
154 |
Â
include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/class-wc-stripe-rest-api.php';
|
155 |
Â
include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/class-wc-stripe-gateway.php';
|
Â
|
|
Â
|
|
156 |
Â
|
157 |
Â
if ( is_admin() ) {
|
158 |
Â
include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/admin/class-wc-stripe-admin-menus.php';
|
@@ -232,8 +244,11 @@ class WC_Stripe_Manager {
|
|
232 |
Â
// settings
|
233 |
Â
include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/abstract/abstract-wc-stripe-settings.php';
|
234 |
Â
include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/admin/settings/class-wc-stripe-api-settings.php';
|
Â
|
|
235 |
Â
include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/admin/settings/class-wc-stripe-account-settings.php';
|
236 |
Â
|
Â
|
|
Â
|
|
237 |
Â
// shortcodes
|
238 |
Â
include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/class-wc-stripe-shortcodes.php';
|
239 |
Â
|
@@ -279,14 +294,17 @@ class WC_Stripe_Manager {
|
|
279 |
Â
|
280 |
Â
// allow other plugins to provide their own settings classes.
|
281 |
Â
$setting_classes = apply_filters( 'wc_stripe_setting_classes', array(
|
282 |
-
'api_settings'
|
283 |
-
'account_settings'
|
Â
|
|
284 |
Â
) );
|
285 |
Â
foreach ( $setting_classes as $id => $class_name ) {
|
286 |
Â
if ( class_exists( $class_name ) ) {
|
287 |
Â
$this->{$id} = new $class_name();
|
288 |
Â
}
|
289 |
Â
}
|
Â
|
|
Â
|
|
290 |
Â
}
|
291 |
Â
|
292 |
Â
/**
|
@@ -337,6 +355,7 @@ class WC_Stripe_Manager {
|
|
337 |
Â
|
338 |
Â
/**
|
339 |
Â
* Schedule actions required by the plugin
|
Â
|
|
340 |
Â
* @since 3.1.6
|
341 |
Â
*/
|
342 |
Â
public function scheduled_actions() {
|
@@ -350,8 +369,8 @@ class WC_Stripe_Manager {
|
|
350 |
Â
/**
|
351 |
Â
* @param string $type
|
352 |
Â
*
|
353 |
-
* @return bool
|
354 |
Â
* @since 3.1.9
|
Â
|
|
355 |
Â
*/
|
356 |
Â
public function is_request( $type ) {
|
357 |
Â
if ( ! did_action( 'before_woocommerce_init' ) ) {
|
@@ -364,15 +383,16 @@ class WC_Stripe_Manager {
|
|
364 |
Â
return true;
|
365 |
Â
}
|
366 |
Â
}
|
Â
|
|
367 |
Â
}
|
368 |
Â
|
369 |
Â
/**
|
370 |
Â
* Returns the global instance of the WC_Stripe_Manager. This function replaces
|
371 |
Â
* the wc_stripe function as of version 3.2.8
|
372 |
Â
*
|
Â
|
|
373 |
Â
* @return WC_Stripe_Manager
|
374 |
Â
* @package Stripe/Functions
|
375 |
-
* @since 3.2.8
|
376 |
Â
*/
|
377 |
Â
function stripe_wc() {
|
378 |
Â
return WC_Stripe_Manager::instance();
|
1 |
Â
<?php
|
2 |
+
|
3 |
Â
defined( 'ABSPATH' ) || exit();
|
4 |
Â
|
5 |
Â
/**
|
6 |
Â
* Singleton class that handles plugin functionality like class loading.
|
7 |
Â
*
|
8 |
+
* @since 3.0.0
|
9 |
+
* @author PaymentPlugins
|
10 |
Â
* @package Stripe/Classes
|
11 |
Â
*
|
12 |
Â
*/
|
26 |
Â
*
|
27 |
Â
* @var string
|
28 |
Â
*/
|
29 |
+
public $version = '3.3.13';
|
30 |
Â
|
31 |
Â
/**
|
32 |
Â
*
|
40 |
Â
*/
|
41 |
Â
public $account_settings;
|
42 |
Â
|
43 |
+
/**
|
44 |
+
* @var \WC_Stripe_Advanced_Settings
|
45 |
+
* @since 3.3.13
|
46 |
+
*/
|
47 |
+
public $advanced_settings;
|
48 |
+
|
49 |
Â
/**
|
50 |
Â
*
|
51 |
Â
* @var WC_Stripe_Rest_API
|
126 |
Â
* is installed to prevent conflicts.
|
127 |
Â
*/
|
128 |
Â
if ( ! function_exists( 'wc_stripe' ) ) {
|
129 |
+
if ( ( defined( 'WC_STRIPE_VERSION' ) && version_compare( WC_STRIPE_VERSION, '4.5.4', '<' ) )
|
130 |
+
|| ! in_array( 'woocommerce-gateway-stripe/woocommerce-gateway-stripe.php',
|
131 |
+
(array) get_option( 'active_plugins', array() ),
|
132 |
+
true )
|
133 |
+
&& ! ( is_admin() && ! isset( $_GET['activate'], $_GET['plugin'] ) ) ) {
|
134 |
Â
/**
|
135 |
Â
* Returns the global instance of the WC_Stripe_Manager.
|
136 |
Â
*
|
137 |
Â
* @return WC_Stripe_Manager
|
Â
|
|
138 |
Â
* @deprecated 3.2.8
|
139 |
+
* @package Stripe/Functions
|
140 |
Â
*/
|
141 |
Â
function wc_stripe() {
|
142 |
Â
if ( function_exists( 'wc_deprecated_function' ) ) {
|
163 |
Â
include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/class-wc-stripe-update.php';
|
164 |
Â
include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/class-wc-stripe-rest-api.php';
|
165 |
Â
include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/class-wc-stripe-gateway.php';
|
166 |
+
include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/class-wc-stripe-payment-balance.php';
|
167 |
+
include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/class-wc-stripe-utils.php';
|
168 |
Â
|
169 |
Â
if ( is_admin() ) {
|
170 |
Â
include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/admin/class-wc-stripe-admin-menus.php';
|
244 |
Â
// settings
|
245 |
Â
include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/abstract/abstract-wc-stripe-settings.php';
|
246 |
Â
include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/admin/settings/class-wc-stripe-api-settings.php';
|
247 |
+
include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/admin/settings/class-wc-stripe-advanced-settings.php';
|
248 |
Â
include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/admin/settings/class-wc-stripe-account-settings.php';
|
249 |
Â
|
250 |
+
include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/class-wc-stripe-api-request-filter.php';
|
251 |
+
|
252 |
Â
// shortcodes
|
253 |
Â
include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/class-wc-stripe-shortcodes.php';
|
254 |
Â
|
294 |
Â
|
295 |
Â
// allow other plugins to provide their own settings classes.
|
296 |
Â
$setting_classes = apply_filters( 'wc_stripe_setting_classes', array(
|
297 |
+
'api_settings' => 'WC_Stripe_API_Settings',
|
298 |
+
'account_settings' => 'WC_Stripe_Account_Settings',
|
299 |
+
'advanced_settings' => 'WC_Stripe_Advanced_Settings'
|
300 |
Â
) );
|
301 |
Â
foreach ( $setting_classes as $id => $class_name ) {
|
302 |
Â
if ( class_exists( $class_name ) ) {
|
303 |
Â
$this->{$id} = new $class_name();
|
304 |
Â
}
|
305 |
Â
}
|
306 |
+
|
307 |
+
new WC_Stripe_API_Request_Filter( $this->advanced_settings );
|
308 |
Â
}
|
309 |
Â
|
310 |
Â
/**
|
355 |
Â
|
356 |
Â
/**
|
357 |
Â
* Schedule actions required by the plugin
|
358 |
+
*
|
359 |
Â
* @since 3.1.6
|
360 |
Â
*/
|
361 |
Â
public function scheduled_actions() {
|
369 |
Â
/**
|
370 |
Â
* @param string $type
|
371 |
Â
*
|
Â
|
|
372 |
Â
* @since 3.1.9
|
373 |
+
* @return bool
|
374 |
Â
*/
|
375 |
Â
public function is_request( $type ) {
|
376 |
Â
if ( ! did_action( 'before_woocommerce_init' ) ) {
|
383 |
Â
return true;
|
384 |
Â
}
|
385 |
Â
}
|
386 |
+
|
387 |
Â
}
|
388 |
Â
|
389 |
Â
/**
|
390 |
Â
* Returns the global instance of the WC_Stripe_Manager. This function replaces
|
391 |
Â
* the wc_stripe function as of version 3.2.8
|
392 |
Â
*
|
393 |
+
* @since 3.2.8
|
394 |
Â
* @return WC_Stripe_Manager
|
395 |
Â
* @package Stripe/Functions
|
Â
|
|
396 |
Â
*/
|
397 |
Â
function stripe_wc() {
|
398 |
Â
return WC_Stripe_Manager::instance();
|
includes/class-wc-stripe-api-operation.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
Â
<?php
|
Â
|
|
2 |
Â
defined( 'ABSPATH' ) || exit();
|
3 |
Â
|
4 |
Â
/**
|
@@ -6,9 +7,9 @@ defined( 'ABSPATH' ) || exit();
|
|
6 |
Â
* Allows method chaining so things like mode can
|
7 |
Â
* be set intuitively.
|
8 |
Â
*
|
9 |
-
* @package Stripe/Classes
|
10 |
-
* @author PaymentPlugins
|
11 |
Â
* @since 3.1.6
|
Â
|
|
Â
|
|
12 |
Â
*/
|
13 |
Â
class WC_Stripe_API_Operation {
|
14 |
Â
|
@@ -44,9 +45,9 @@ class WC_Stripe_API_Operation {
|
|
44 |
Â
|
45 |
Â
/**
|
46 |
Â
*
|
47 |
-
* @param WC_Stripe_Gateway
|
48 |
Â
* @param \Stripe\StripeClient $client
|
49 |
-
* @param string
|
50 |
Â
*
|
51 |
Â
* @throws InvalidArgumentException
|
52 |
Â
*/
|
@@ -69,7 +70,7 @@ class WC_Stripe_API_Operation {
|
|
69 |
Â
* This way, all exceptions can be caught gracefully.
|
70 |
Â
*
|
71 |
Â
* @param string $method
|
72 |
-
* @param array
|
73 |
Â
*
|
74 |
Â
* @throws InvalidArgumentException
|
75 |
Â
*/
|
@@ -82,7 +83,7 @@ class WC_Stripe_API_Operation {
|
|
82 |
Â
/**
|
83 |
Â
* Filters arguments before they are sent to the service for an API request.
|
84 |
Â
*
|
85 |
-
* @param array
|
86 |
Â
* @param string $property The name of the service being called.
|
87 |
Â
* @param string $method The method of the service. Ex: create, delete, retrieve
|
88 |
Â
*
|
@@ -91,11 +92,14 @@ class WC_Stripe_API_Operation {
|
|
91 |
Â
$args = apply_filters( 'wc_stripe_api_request_args', $args, $this->property, $method );
|
92 |
Â
|
93 |
Â
return $this->service->{$method}( ...$args );
|
94 |
-
}
|
Â
|
|
95 |
Â
return $this->gateway->get_wp_error( $e, $this->property . '-error' );
|
96 |
-
}
|
Â
|
|
97 |
Â
return new WP_Error( 'stripe-error', $e->getMessage(), $e );
|
98 |
-
}
|
Â
|
|
99 |
Â
return new WP_Error( 'stripe-error', $e->getMessage(), $e );
|
100 |
Â
}
|
101 |
Â
}
|
@@ -115,7 +119,7 @@ class WC_Stripe_API_Operation {
|
|
115 |
Â
/**
|
116 |
Â
* Given an array of arguments, add method defaults to the array of args based on their existance.
|
117 |
Â
*
|
118 |
-
* @param array
|
119 |
Â
* @param string $method
|
120 |
Â
*/
|
121 |
Â
private function parse_args( $args, $method ) {
|
@@ -133,4 +137,5 @@ class WC_Stripe_API_Operation {
|
|
133 |
Â
|
134 |
Â
return $args;
|
135 |
Â
}
|
Â
|
|
136 |
Â
}
|
1 |
Â
<?php
|
2 |
+
|
3 |
Â
defined( 'ABSPATH' ) || exit();
|
4 |
Â
|
5 |
Â
/**
|
7 |
Â
* Allows method chaining so things like mode can
|
8 |
Â
* be set intuitively.
|
9 |
Â
*
|
Â
|
|
Â
|
|
10 |
Â
* @since 3.1.6
|
11 |
+
* @author PaymentPlugins
|
12 |
+
* @package Stripe/Classes
|
13 |
Â
*/
|
14 |
Â
class WC_Stripe_API_Operation {
|
15 |
Â
|
45 |
Â
|
46 |
Â
/**
|
47 |
Â
*
|
48 |
+
* @param WC_Stripe_Gateway $gateway
|
49 |
Â
* @param \Stripe\StripeClient $client
|
50 |
+
* @param string $property
|
51 |
Â
*
|
52 |
Â
* @throws InvalidArgumentException
|
53 |
Â
*/
|
70 |
Â
* This way, all exceptions can be caught gracefully.
|
71 |
Â
*
|
72 |
Â
* @param string $method
|
73 |
+
* @param array $args
|
74 |
Â
*
|
75 |
Â
* @throws InvalidArgumentException
|
76 |
Â
*/
|
83 |
Â
/**
|
84 |
Â
* Filters arguments before they are sent to the service for an API request.
|
85 |
Â
*
|
86 |
+
* @param array $args The array of arguments that will be passed to the service method.
|
87 |
Â
* @param string $property The name of the service being called.
|
88 |
Â
* @param string $method The method of the service. Ex: create, delete, retrieve
|
89 |
Â
*
|
92 |
Â
$args = apply_filters( 'wc_stripe_api_request_args', $args, $this->property, $method );
|
93 |
Â
|
94 |
Â
return $this->service->{$method}( ...$args );
|
95 |
+
}
|
96 |
+
catch ( \Stripe\Exception\ApiErrorException $e ) {
|
97 |
Â
return $this->gateway->get_wp_error( $e, $this->property . '-error' );
|
98 |
+
}
|
99 |
+
catch ( \Stripe\Exception\UnexpectedValueException $e ) {
|
100 |
Â
return new WP_Error( 'stripe-error', $e->getMessage(), $e );
|
101 |
+
}
|
102 |
+
catch ( \Stripe\Exception\InvalidArgumentException $e ) {
|
103 |
Â
return new WP_Error( 'stripe-error', $e->getMessage(), $e );
|
104 |
Â
}
|
105 |
Â
}
|
119 |
Â
/**
|
120 |
Â
* Given an array of arguments, add method defaults to the array of args based on their existance.
|
121 |
Â
*
|
122 |
+
* @param array $args
|
123 |
Â
* @param string $method
|
124 |
Â
*/
|
125 |
Â
private function parse_args( $args, $method ) {
|
137 |
Â
|
138 |
Â
return $args;
|
139 |
Â
}
|
140 |
+
|
141 |
Â
}
|
includes/class-wc-stripe-api-request-filter.php
ADDED
@@ -0,0 +1,47 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
defined( 'ABSPATH' ) || exit();
|
4 |
+
|
5 |
+
/**
|
6 |
+
* @since 3.3.13
|
7 |
+
*/
|
8 |
+
class WC_Stripe_API_Request_Filter {
|
9 |
+
|
10 |
+
private $advanced_settings;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* @param \WC_Stripe_Advanced_Settings $advanced_settings
|
14 |
+
*/
|
15 |
+
public function __construct( $advanced_settings ) {
|
16 |
+
$this->advanced_settings = $advanced_settings;
|
17 |
+
$this->initialize();
|
18 |
+
}
|
19 |
+
|
20 |
+
private function initialize() {
|
21 |
+
if ( $this->advanced_settings->is_fee_enabled() ) {
|
22 |
+
add_filter( 'wc_stripe_payment_intent_args', array( $this, 'expand_balance_transaction' ) );
|
23 |
+
add_filter( 'wc_stripe_payment_intent_confirmation_args', array( $this, 'expand_balance_transaction' ) );
|
24 |
+
add_filter( 'wc_stripe_payment_intent_retrieve_args', array( $this, 'expand_balance_transaction' ) );
|
25 |
+
add_filter( 'wc_stripe_payment_intent_capture_args', array( $this, 'expand_balance_transaction' ) );
|
26 |
+
add_filter( 'wc_stripe_charge_order_args', array( $this, 'expand_balance_transaction_for_charge' ) );
|
27 |
+
}
|
28 |
+
}
|
29 |
+
|
30 |
+
public function expand_balance_transaction( $args ) {
|
31 |
+
if ( ! is_array( $args ) ) {
|
32 |
+
$args = array();
|
33 |
+
}
|
34 |
+
$args['expand'] = isset( $args['expand'] ) ? $args['expand'] : array();
|
35 |
+
$args['expand'][] = 'charges.data.balance_transaction';
|
36 |
+
|
37 |
+
return $args;
|
38 |
+
}
|
39 |
+
|
40 |
+
public function expand_balance_transaction_for_charge( $args ) {
|
41 |
+
$args['expand'] = isset( $args['expand'] ) ? $args['expand'] : array();
|
42 |
+
$args['expand'][] = 'balance_transaction';
|
43 |
+
|
44 |
+
return $args;
|
45 |
+
}
|
46 |
+
|
47 |
+
}
|
includes/class-wc-stripe-constants.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
Â
<?php
|
Â
|
|
2 |
Â
defined( 'ABSPATH' ) || exit();
|
3 |
Â
|
4 |
Â
/**
|
@@ -39,8 +40,8 @@ class WC_Stripe_Constants {
|
|
39 |
Â
|
40 |
Â
/**
|
41 |
Â
*
|
42 |
-
* @since 3.1.3
|
43 |
Â
* @var unknown
|
Â
|
|
44 |
Â
*/
|
45 |
Â
const REDIRECT_HANDLER = 'redirect_handler';
|
46 |
Â
|
@@ -63,4 +64,15 @@ class WC_Stripe_Constants {
|
|
63 |
Â
const REQUIRES_PAYMENT_METHOD = 'requires_payment_method';
|
64 |
Â
|
65 |
Â
const SETUP_INTENT_ID = '_setup_intent_id';
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
66 |
Â
}
|
1 |
Â
<?php
|
2 |
+
|
3 |
Â
defined( 'ABSPATH' ) || exit();
|
4 |
Â
|
5 |
Â
/**
|
40 |
Â
|
41 |
Â
/**
|
42 |
Â
*
|
Â
|
|
43 |
Â
* @var unknown
|
44 |
+
* @since 3.1.3
|
45 |
Â
*/
|
46 |
Â
const REDIRECT_HANDLER = 'redirect_handler';
|
47 |
Â
|
64 |
Â
const REQUIRES_PAYMENT_METHOD = 'requires_payment_method';
|
65 |
Â
|
66 |
Â
const SETUP_INTENT_ID = '_setup_intent_id';
|
67 |
+
|
68 |
+
const BALANCE_TRANSACTION = '_stripe_balance_transaction';
|
69 |
+
|
70 |
+
const STRIPE_FEE = '_stripe_fee';
|
71 |
+
|
72 |
+
const STRIPE_NET = '_stripe_net';
|
73 |
+
|
74 |
+
const STRIPE_CURRENCY = '_stripe_currency';
|
75 |
+
|
76 |
+
const PREV_STATUS = '_stripe_prev_status';
|
77 |
+
|
78 |
Â
}
|
includes/class-wc-stripe-gateway.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
Â
<?php
|
Â
|
|
2 |
Â
defined( 'ABSPATH' ) || exit();
|
3 |
Â
|
4 |
Â
require_once( WC_STRIPE_PLUGIN_FILE_PATH . 'includes/class-wc-stripe-api-operation.php' );
|
@@ -9,61 +10,61 @@ require_once( WC_STRIPE_PLUGIN_FILE_PATH . 'includes/class-wc-stripe-api-operati
|
|
9 |
Â
* @author Payment Plugins
|
10 |
Â
* @package Stripe/Classes
|
11 |
Â
*
|
12 |
-
* @property \Stripe\Service\AccountLinkService
|
13 |
-
* @property \Stripe\Service\AccountService
|
14 |
-
* @property \Stripe\Service\ApplePayDomainService
|
15 |
-
* @property \Stripe\Service\ApplicationFeeService
|
16 |
-
* @property \Stripe\Service\BalanceService
|
17 |
-
* @property \Stripe\Service\BalanceTransactionService
|
18 |
Â
* @property \Stripe\Service\BillingPortal\BillingPortalServiceFactory $billingPortal
|
19 |
-
* @property \Stripe\Service\ChargeService
|
20 |
-
* @property \Stripe\Service\Checkout\CheckoutServiceFactory
|
21 |
-
* @property \Stripe\Service\CountrySpecService
|
22 |
-
* @property \Stripe\Service\CouponService
|
23 |
-
* @property \Stripe\Service\CreditNoteService
|
24 |
-
* @property \Stripe\Service\CustomerService
|
25 |
-
* @property \Stripe\Service\DisputeService
|
26 |
-
* @property \Stripe\Service\EphemeralKeyService
|
27 |
-
* @property \Stripe\Service\EventService
|
28 |
-
* @property \Stripe\Service\ExchangeRateService
|
29 |
-
* @property \Stripe\Service\FileLinkService
|
30 |
-
* @property \Stripe\Service\FileService
|
31 |
-
* @property \Stripe\Service\InvoiceItemService
|
32 |
-
* @property \Stripe\Service\InvoiceService
|
33 |
-
* @property \Stripe\Service\Issuing\IssuingServiceFactory
|
34 |
-
* @property \Stripe\Service\MandateService
|
35 |
-
* @property \Stripe\Service\OrderReturnService
|
36 |
-
* @property \Stripe\Service\OrderService
|
37 |
-
* @property \Stripe\Service\PaymentIntentService
|
38 |
-
* @property \Stripe\Service\PaymentMethodService
|
39 |
-
* @property \Stripe\Service\PayoutService
|
40 |
-
* @property \Stripe\Service\PlanService
|
41 |
-
* @property \Stripe\Service\PriceService
|
42 |
-
* @property \Stripe\Service\ProductService
|
43 |
-
* @property \Stripe\Service\Radar\RadarServiceFactory
|
44 |
-
* @property \Stripe\Service\RefundService
|
45 |
-
* @property \Stripe\Service\Reporting\ReportingServiceFactory
|
46 |
-
* @property \Stripe\Service\ReviewService
|
47 |
-
* @property \Stripe\Service\SetupIntentService
|
48 |
-
* @property \Stripe\Service\Sigma\SigmaServiceFactory
|
49 |
-
* @property \Stripe\Service\SkuService
|
50 |
-
* @property \Stripe\Service\SourceService
|
51 |
-
* @property \Stripe\Service\SubscriptionItemService
|
52 |
-
* @property \Stripe\Service\SubscriptionScheduleService
|
53 |
-
* @property \Stripe\Service\SubscriptionService
|
54 |
-
* @property \Stripe\Service\TaxRateService
|
55 |
-
* @property \Stripe\Service\Terminal\TerminalServiceFactory
|
56 |
-
* @property \Stripe\Service\TokenService
|
57 |
-
* @property \Stripe\Service\TopupService
|
58 |
-
* @property \Stripe\Service\TransferService
|
59 |
-
* @property \Stripe\Service\WebhookEndpointService
|
60 |
Â
*/
|
61 |
Â
class WC_Stripe_Gateway {
|
62 |
Â
|
63 |
Â
/**
|
64 |
Â
*
|
65 |
-
* @since 3.0.5
|
66 |
Â
* @var Stripe mode (test, live)
|
Â
|
|
67 |
Â
*/
|
68 |
Â
private $mode = null;
|
69 |
Â
|
@@ -71,8 +72,8 @@ class WC_Stripe_Gateway {
|
|
71 |
Â
|
72 |
Â
/**
|
73 |
Â
*
|
74 |
-
* @since 3.0.8
|
75 |
Â
* @var string
|
Â
|
|
76 |
Â
*/
|
77 |
Â
private $secret_key = null;
|
78 |
Â
|
@@ -106,8 +107,8 @@ class WC_Stripe_Gateway {
|
|
106 |
Â
* @param string $mode
|
107 |
Â
* @param string $secret_key
|
108 |
Â
*
|
109 |
-
* @return WC_Stripe_Gateway
|
110 |
Â
* @since 3.1.0
|
Â
|
|
111 |
Â
*/
|
112 |
Â
public static function load( $mode = null, $secret_key = null ) {
|
113 |
Â
$class = apply_filters( 'wc_stripe_gateway_class', 'WC_Stripe_Gateway' );
|
@@ -134,7 +135,6 @@ class WC_Stripe_Gateway {
|
|
134 |
Â
*/
|
135 |
Â
public function create_customer( $args, $mode = '' ) {
|
136 |
Â
return $this->customers->create( apply_filters( 'wc_stripe_create_customer_args', $args ), $this->get_api_options( $mode ) );
|
137 |
-
|
138 |
Â
}
|
139 |
Â
|
140 |
Â
public function update_customer( $id, $args, $mode = '' ) {
|
@@ -147,7 +147,7 @@ class WC_Stripe_Gateway {
|
|
147 |
Â
|
148 |
Â
/**
|
149 |
Â
*
|
150 |
-
* @param array
|
151 |
Â
* @param string $mode
|
152 |
Â
*
|
153 |
Â
* @return WP_Error|\Stripe\PaymentIntent
|
@@ -163,8 +163,8 @@ class WC_Stripe_Gateway {
|
|
163 |
Â
/**
|
164 |
Â
*
|
165 |
Â
* @param \Stripe\PaymentIntent $intent
|
166 |
-
* @param array
|
167 |
-
* @param string
|
168 |
Â
*/
|
169 |
Â
public function update_payment_intent( $id, $args, $mode = '' ) {
|
170 |
Â
return $this->paymentIntents->update( $id, $args, $this->get_api_options( $mode ) );
|
@@ -173,8 +173,8 @@ class WC_Stripe_Gateway {
|
|
173 |
Â
/**
|
174 |
Â
*
|
175 |
Â
* @param \Stripe\PaymentIntent $intent
|
176 |
-
* @param array
|
177 |
-
* @param string
|
178 |
Â
*/
|
179 |
Â
public function confirm_payment_intent( $id, $args = array(), $mode = '' ) {
|
180 |
Â
return $this->paymentIntents->confirm( $id, $args, $this->get_api_options( $mode ) );
|
@@ -198,7 +198,7 @@ class WC_Stripe_Gateway {
|
|
198 |
Â
/**
|
199 |
Â
*
|
200 |
Â
* @param \Stripe\PaymentIntent|string $id
|
201 |
-
* @param string
|
202 |
Â
*/
|
203 |
Â
public function cancel_payment_intent( $id, $mode = '' ) {
|
204 |
Â
return $this->paymentIntents->cancel( $id, array(), $this->get_api_options( $mode ) );
|
@@ -241,8 +241,8 @@ class WC_Stripe_Gateway {
|
|
241 |
Â
/**
|
242 |
Â
*
|
243 |
Â
* @param \Stripe\PaymentMethod $payment_method
|
244 |
-
* @param array
|
245 |
-
* @param string
|
246 |
Â
*/
|
247 |
Â
public function attach_payment_method( $id, $args = array(), $mode = '' ) {
|
248 |
Â
return $this->paymentMethods->attach( $id, $args, $this->get_api_options( $mode ) );
|
@@ -255,7 +255,7 @@ class WC_Stripe_Gateway {
|
|
255 |
Â
/**
|
256 |
Â
*
|
257 |
Â
* @param \Stripe\PaymentMethod $payment_method
|
258 |
-
* @param string
|
259 |
Â
*/
|
260 |
Â
public function delete_payment_method( $id, $mode = '' ) {
|
261 |
Â
return $this->paymentMethods->detach( $id, array(), $this->get_api_options( $mode ) );
|
@@ -273,7 +273,7 @@ class WC_Stripe_Gateway {
|
|
273 |
Â
|
274 |
Â
/**
|
275 |
Â
*
|
276 |
-
* @param array
|
277 |
Â
* @param string $mode
|
278 |
Â
*
|
279 |
Â
* @return WP_Error|\Stripe\PaymentMethod
|
@@ -308,7 +308,7 @@ class WC_Stripe_Gateway {
|
|
308 |
Â
|
309 |
Â
/**
|
310 |
Â
*
|
311 |
-
* @param array
|
312 |
Â
* @param string $mode
|
313 |
Â
*
|
314 |
Â
* @return WP_Error|\Stripe\Source
|
@@ -320,7 +320,7 @@ class WC_Stripe_Gateway {
|
|
320 |
Â
/**
|
321 |
Â
*
|
322 |
Â
* @param string $source_id
|
323 |
-
* @param array
|
324 |
Â
* @param string $mode
|
325 |
Â
*
|
326 |
Â
* @since 3.0.2
|
@@ -364,7 +364,7 @@ class WC_Stripe_Gateway {
|
|
364 |
Â
/**
|
365 |
Â
*
|
366 |
Â
* @param \Stripe\ApplePayDomain $domain
|
367 |
-
* @param string
|
368 |
Â
*
|
369 |
Â
* @since 3.1.6
|
370 |
Â
*/
|
@@ -442,7 +442,7 @@ class WC_Stripe_Gateway {
|
|
442 |
Â
|
443 |
Â
/**
|
444 |
Â
* @param string $message
|
445 |
-
* @param mixed
|
446 |
Â
*
|
447 |
Â
* @since 3.3.11
|
448 |
Â
*/
|
@@ -452,7 +452,7 @@ class WC_Stripe_Gateway {
|
|
452 |
Â
/**
|
453 |
Â
*
|
454 |
Â
* @param \Stripe\Exception\ApiErrorException $e
|
455 |
-
* @param string
|
456 |
Â
*
|
457 |
Â
* @since 3.1.1
|
458 |
Â
* @todo use in future version to replace manual returns of WP_Error in each method
|
@@ -466,4 +466,17 @@ class WC_Stripe_Gateway {
|
|
466 |
Â
|
467 |
Â
return new WP_Error( $code, $this->get_error_message( $err ), $err );
|
468 |
Â
}
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
469 |
Â
}
|
1 |
Â
<?php
|
2 |
+
|
3 |
Â
defined( 'ABSPATH' ) || exit();
|
4 |
Â
|
5 |
Â
require_once( WC_STRIPE_PLUGIN_FILE_PATH . 'includes/class-wc-stripe-api-operation.php' );
|
10 |
Â
* @author Payment Plugins
|
11 |
Â
* @package Stripe/Classes
|
12 |
Â
*
|
13 |
+
* @property \Stripe\Service\AccountLinkService $accountLinks
|
14 |
+
* @property \Stripe\Service\AccountService $accounts
|
15 |
+
* @property \Stripe\Service\ApplePayDomainService $applePayDomains
|
16 |
+
* @property \Stripe\Service\ApplicationFeeService $applicationFees
|
17 |
+
* @property \Stripe\Service\BalanceService $balance
|
18 |
+
* @property \Stripe\Service\BalanceTransactionService $balanceTransactions
|
19 |
Â
* @property \Stripe\Service\BillingPortal\BillingPortalServiceFactory $billingPortal
|
20 |
+
* @property \Stripe\Service\ChargeService $charges
|
21 |
+
* @property \Stripe\Service\Checkout\CheckoutServiceFactory $checkout
|
22 |
+
* @property \Stripe\Service\CountrySpecService $countrySpecs
|
23 |
+
* @property \Stripe\Service\CouponService $coupons
|
24 |
+
* @property \Stripe\Service\CreditNoteService $creditNotes
|
25 |
+
* @property \Stripe\Service\CustomerService $customers
|
26 |
+
* @property \Stripe\Service\DisputeService $disputes
|
27 |
+
* @property \Stripe\Service\EphemeralKeyService $ephemeralKeys
|
28 |
+
* @property \Stripe\Service\EventService $events
|
29 |
+
* @property \Stripe\Service\ExchangeRateService $exchangeRates
|
30 |
+
* @property \Stripe\Service\FileLinkService $fileLinks
|
31 |
+
* @property \Stripe\Service\FileService $files
|
32 |
+
* @property \Stripe\Service\InvoiceItemService $invoiceItems
|
33 |
+
* @property \Stripe\Service\InvoiceService $invoices
|
34 |
+
* @property \Stripe\Service\Issuing\IssuingServiceFactory $issuing
|
35 |
+
* @property \Stripe\Service\MandateService $mandates
|
36 |
+
* @property \Stripe\Service\OrderReturnService $orderReturns
|
37 |
+
* @property \Stripe\Service\OrderService $orders
|
38 |
+
* @property \Stripe\Service\PaymentIntentService $paymentIntents
|
39 |
+
* @property \Stripe\Service\PaymentMethodService $paymentMethods
|
40 |
+
* @property \Stripe\Service\PayoutService $payouts
|
41 |
+
* @property \Stripe\Service\PlanService $plans
|
42 |
+
* @property \Stripe\Service\PriceService $prices
|
43 |
+
* @property \Stripe\Service\ProductService $products
|
44 |
+
* @property \Stripe\Service\Radar\RadarServiceFactory $radar
|
45 |
+
* @property \Stripe\Service\RefundService $refunds
|
46 |
+
* @property \Stripe\Service\Reporting\ReportingServiceFactory $reporting
|
47 |
+
* @property \Stripe\Service\ReviewService $reviews
|
48 |
+
* @property \Stripe\Service\SetupIntentService $setupIntents
|
49 |
+
* @property \Stripe\Service\Sigma\SigmaServiceFactory $sigma
|
50 |
+
* @property \Stripe\Service\SkuService $skus
|
51 |
+
* @property \Stripe\Service\SourceService $sources
|
52 |
+
* @property \Stripe\Service\SubscriptionItemService $subscriptionItems
|
53 |
+
* @property \Stripe\Service\SubscriptionScheduleService $subscriptionSchedules
|
54 |
+
* @property \Stripe\Service\SubscriptionService $subscriptions
|
55 |
+
* @property \Stripe\Service\TaxRateService $taxRates
|
56 |
+
* @property \Stripe\Service\Terminal\TerminalServiceFactory $terminal
|
57 |
+
* @property \Stripe\Service\TokenService $tokens
|
58 |
+
* @property \Stripe\Service\TopupService $topups
|
59 |
+
* @property \Stripe\Service\TransferService $transfers
|
60 |
+
* @property \Stripe\Service\WebhookEndpointService $webhookEndpoints
|
61 |
Â
*/
|
62 |
Â
class WC_Stripe_Gateway {
|
63 |
Â
|
64 |
Â
/**
|
65 |
Â
*
|
Â
|
|
66 |
Â
* @var Stripe mode (test, live)
|
67 |
+
* @since 3.0.5
|
68 |
Â
*/
|
69 |
Â
private $mode = null;
|
70 |
Â
|
72 |
Â
|
73 |
Â
/**
|
74 |
Â
*
|
Â
|
|
75 |
Â
* @var string
|
76 |
+
* @since 3.0.8
|
77 |
Â
*/
|
78 |
Â
private $secret_key = null;
|
79 |
Â
|
107 |
Â
* @param string $mode
|
108 |
Â
* @param string $secret_key
|
109 |
Â
*
|
Â
|
|
110 |
Â
* @since 3.1.0
|
111 |
+
* @return WC_Stripe_Gateway
|
112 |
Â
*/
|
113 |
Â
public static function load( $mode = null, $secret_key = null ) {
|
114 |
Â
$class = apply_filters( 'wc_stripe_gateway_class', 'WC_Stripe_Gateway' );
|
135 |
Â
*/
|
136 |
Â
public function create_customer( $args, $mode = '' ) {
|
137 |
Â
return $this->customers->create( apply_filters( 'wc_stripe_create_customer_args', $args ), $this->get_api_options( $mode ) );
|
Â
|
|
138 |
Â
}
|
139 |
Â
|
140 |
Â
public function update_customer( $id, $args, $mode = '' ) {
|
147 |
Â
|
148 |
Â
/**
|
149 |
Â
*
|
150 |
+
* @param array $args
|
151 |
Â
* @param string $mode
|
152 |
Â
*
|
153 |
Â
* @return WP_Error|\Stripe\PaymentIntent
|
163 |
Â
/**
|
164 |
Â
*
|
165 |
Â
* @param \Stripe\PaymentIntent $intent
|
166 |
+
* @param array $args
|
167 |
+
* @param string $mode
|
168 |
Â
*/
|
169 |
Â
public function update_payment_intent( $id, $args, $mode = '' ) {
|
170 |
Â
return $this->paymentIntents->update( $id, $args, $this->get_api_options( $mode ) );
|
173 |
Â
/**
|
174 |
Â
*
|
175 |
Â
* @param \Stripe\PaymentIntent $intent
|
176 |
+
* @param array $args
|
177 |
+
* @param string $mode
|
178 |
Â
*/
|
179 |
Â
public function confirm_payment_intent( $id, $args = array(), $mode = '' ) {
|
180 |
Â
return $this->paymentIntents->confirm( $id, $args, $this->get_api_options( $mode ) );
|
198 |
Â
/**
|
199 |
Â
*
|
200 |
Â
* @param \Stripe\PaymentIntent|string $id
|
201 |
+
* @param string $mode
|
202 |
Â
*/
|
203 |
Â
public function cancel_payment_intent( $id, $mode = '' ) {
|
204 |
Â
return $this->paymentIntents->cancel( $id, array(), $this->get_api_options( $mode ) );
|
241 |
Â
/**
|
242 |
Â
*
|
243 |
Â
* @param \Stripe\PaymentMethod $payment_method
|
244 |
+
* @param array $args
|
245 |
+
* @param string $mode
|
246 |
Â
*/
|
247 |
Â
public function attach_payment_method( $id, $args = array(), $mode = '' ) {
|
248 |
Â
return $this->paymentMethods->attach( $id, $args, $this->get_api_options( $mode ) );
|
255 |
Â
/**
|
256 |
Â
*
|
257 |
Â
* @param \Stripe\PaymentMethod $payment_method
|
258 |
+
* @param string $mode
|
259 |
Â
*/
|
260 |
Â
public function delete_payment_method( $id, $mode = '' ) {
|
261 |
Â
return $this->paymentMethods->detach( $id, array(), $this->get_api_options( $mode ) );
|
273 |
Â
|
274 |
Â
/**
|
275 |
Â
*
|
276 |
+
* @param array $args
|
277 |
Â
* @param string $mode
|
278 |
Â
*
|
279 |
Â
* @return WP_Error|\Stripe\PaymentMethod
|
308 |
Â
|
309 |
Â
/**
|
310 |
Â
*
|
311 |
+
* @param array $args
|
312 |
Â
* @param string $mode
|
313 |
Â
*
|
314 |
Â
* @return WP_Error|\Stripe\Source
|
320 |
Â
/**
|
321 |
Â
*
|
322 |
Â
* @param string $source_id
|
323 |
+
* @param array $args
|
324 |
Â
* @param string $mode
|
325 |
Â
*
|
326 |
Â
* @since 3.0.2
|
364 |
Â
/**
|
365 |
Â
*
|
366 |
Â
* @param \Stripe\ApplePayDomain $domain
|
367 |
+
* @param string $mode
|
368 |
Â
*
|
369 |
Â
* @since 3.1.6
|
370 |
Â
*/
|
442 |
Â
|
443 |
Â
/**
|
444 |
Â
* @param string $message
|
445 |
+
* @param mixed $err
|
446 |
Â
*
|
447 |
Â
* @since 3.3.11
|
448 |
Â
*/
|
452 |
Â
/**
|
453 |
Â
*
|
454 |
Â
* @param \Stripe\Exception\ApiErrorException $e
|
455 |
+
* @param string $code
|
456 |
Â
*
|
457 |
Â
* @since 3.1.1
|
458 |
Â
* @todo use in future version to replace manual returns of WP_Error in each method
|
466 |
Â
|
467 |
Â
return new WP_Error( $code, $this->get_error_message( $err ), $err );
|
468 |
Â
}
|
469 |
+
|
470 |
+
/**
|
471 |
+
* @param $mode
|
472 |
+
*
|
473 |
+
* @since 3.3.13
|
474 |
+
* @return $this
|
475 |
+
*/
|
476 |
+
public function mode( $mode ) {
|
477 |
+
$this->mode = $mode;
|
478 |
+
|
479 |
+
return $this;
|
480 |
+
}
|
481 |
+
|
482 |
Â
}
|
includes/class-wc-stripe-payment-balance.php
ADDED
@@ -0,0 +1,94 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
defined( 'ABSPATH' ) || exit();
|
4 |
+
|
5 |
+
/**
|
6 |
+
* @since 3.1.3
|
7 |
+
*
|
8 |
+
* @property int $fee
|
9 |
+
* @property int $net
|
10 |
+
* @property string $currency
|
11 |
+
*/
|
12 |
+
class WC_Stripe_Payment_Balance {
|
13 |
+
|
14 |
+
private $data = array();
|
15 |
+
|
16 |
+
private $order;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* @param WC_Order $order
|
20 |
+
*/
|
21 |
+
public function __construct( $order ) {
|
22 |
+
$this->order = $order;
|
23 |
+
$this->data = array(
|
24 |
+
'currency' => $order->get_meta( WC_Stripe_Constants::STRIPE_CURRENCY ),
|
25 |
+
'fee' => $order->get_meta( WC_Stripe_Constants::STRIPE_FEE ),
|
26 |
+
'net' => $order->get_meta( WC_Stripe_Constants::STRIPE_NET )
|
27 |
+
);
|
28 |
+
}
|
29 |
+
|
30 |
+
public function __isset( $name ) {
|
31 |
+
return isset( $this->data[ $name ] );
|
32 |
+
}
|
33 |
+
|
34 |
+
public function __set( $name, $value ) {
|
35 |
+
$this->set_prop( $name, $value );
|
36 |
+
}
|
37 |
+
|
38 |
+
public function __get( $name ) {
|
39 |
+
if ( method_exists( $this, 'get_' . $name ) ) {
|
40 |
+
return $this->{'get_' . $name}();
|
41 |
+
}
|
42 |
+
|
43 |
+
return $this->get_prop( $name );
|
44 |
+
}
|
45 |
+
|
46 |
+
private function set_prop( $name, $value ) {
|
47 |
+
$this->data[ $name ] = $value;
|
48 |
+
}
|
49 |
+
|
50 |
+
private function get_prop( $key, $default = '' ) {
|
51 |
+
if ( ! isset( $this->data[ $key ] ) ) {
|
52 |
+
$this->data[ $key ] = $default;
|
53 |
+
}
|
54 |
+
|
55 |
+
return $this->data[ $key ];
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* @return mixed
|
60 |
+
*/
|
61 |
+
public function get_fee() {
|
62 |
+
return $this->get_prop( 'fee', 0 );
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* @return mixed
|
67 |
+
*/
|
68 |
+
public function get_net() {
|
69 |
+
return $this->get_prop( 'net', 0 );
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* @return mixed
|
74 |
+
*/
|
75 |
+
public function get_currency() {
|
76 |
+
return $this->get_prop( 'currency' );
|
77 |
+
}
|
78 |
+
|
79 |
+
public function to_array() {
|
80 |
+
return $this->data;
|
81 |
+
}
|
82 |
+
|
83 |
+
public function update_meta_data( $save = false ) {
|
84 |
+
if ( $this->order ) {
|
85 |
+
$this->order->update_meta_data( WC_Stripe_Constants::STRIPE_CURRENCY, $this->currency );
|
86 |
+
$this->order->update_meta_data( WC_Stripe_Constants::STRIPE_FEE, $this->fee );
|
87 |
+
$this->order->update_meta_data( WC_Stripe_Constants::STRIPE_NET, $this->net );
|
88 |
+
if ( $save ) {
|
89 |
+
$this->order->save();
|
90 |
+
}
|
91 |
+
}
|
92 |
+
}
|
93 |
+
|
94 |
+
}
|
includes/class-wc-stripe-payment-intent.php
CHANGED
@@ -1,14 +1,15 @@
|
|
1 |
Â
<?php
|
Â
|
|
2 |
Â
defined( 'ABSPATH' ) || exit();
|
3 |
Â
|
4 |
Â
require_once( WC_STRIPE_PLUGIN_FILE_PATH . 'includes/abstract/abstract-wc-stripe-payment.php' );
|
5 |
Â
|
6 |
Â
/**
|
7 |
Â
*
|
8 |
-
* @package Stripe/Classes
|
9 |
-
* @author Payment Plugins
|
10 |
Â
* @since 3.1.0
|
11 |
Â
*
|
Â
|
|
Â
|
|
12 |
Â
*/
|
13 |
Â
class WC_Stripe_Payment_Intent extends WC_Stripe_Payment {
|
14 |
Â
|
@@ -25,7 +26,7 @@ class WC_Stripe_Payment_Intent extends WC_Stripe_Payment {
|
|
25 |
Â
if ( $this->can_update_payment_intent( $order ) ) {
|
26 |
Â
$intent = $this->gateway->paymentIntents->update( $intent_id, $this->get_payment_intent_args( $order, false ) );
|
27 |
Â
} else {
|
28 |
-
$intent = $this->gateway->paymentIntents->retrieve( $intent_id );
|
29 |
Â
}
|
30 |
Â
} else {
|
31 |
Â
$intent = $this->gateway->paymentIntents->create( $this->get_payment_intent_args( $order ) );
|
@@ -41,7 +42,7 @@ class WC_Stripe_Payment_Intent extends WC_Stripe_Payment {
|
|
41 |
Â
$order->update_meta_data( WC_Stripe_Constants::PAYMENT_INTENT_ID, $intent->id );
|
42 |
Â
$order->update_meta_data( WC_Stripe_Constants::PAYMENT_METHOD_TOKEN, $intent->payment_method );
|
43 |
Â
$order->update_meta_data( WC_Stripe_Constants::MODE, wc_stripe_mode() );
|
44 |
-
// serialize the
|
45 |
Â
// has changed.
|
46 |
Â
$order->update_meta_data( WC_Stripe_Constants::PAYMENT_INTENT, $intent->jsonSerialize() );
|
47 |
Â
$order->save();
|
@@ -64,6 +65,8 @@ class WC_Stripe_Payment_Intent extends WC_Stripe_Payment {
|
|
64 |
Â
if ( isset( $intent->setup_future_usage, $intent->customer, $charge->payment_method_details ) && 'off_session' === $intent->setup_future_usage ) {
|
65 |
Â
$this->payment_method->save_payment_method( $intent->payment_method, $order, $charge->payment_method_details );
|
66 |
Â
}
|
Â
|
|
Â
|
|
67 |
Â
|
68 |
Â
return (object) array(
|
69 |
Â
'complete_payment' => true,
|
@@ -71,7 +74,7 @@ class WC_Stripe_Payment_Intent extends WC_Stripe_Payment {
|
|
71 |
Â
);
|
72 |
Â
}
|
73 |
Â
if ( in_array( $intent->status, array( 'requires_action', 'requires_payment_method', 'requires_source_action', 'requires_source' ), true ) ) {
|
74 |
-
// If the payment method isn't synchronous, set
|
75 |
Â
// skips the redirect and the payment takes 1 or more days, the payment won't be cancelled
|
76 |
Â
// due to the WooCommerce pending payment status.
|
77 |
Â
if ( ! $this->payment_method->synchronous ) {
|
@@ -106,7 +109,6 @@ class WC_Stripe_Payment_Intent extends WC_Stripe_Payment {
|
|
106 |
Â
$charge = $intent->charges->data[0];
|
107 |
Â
|
108 |
Â
if ( $intent->status === 'succeeded' || $intent->status === 'requires_capture' ) {
|
109 |
-
|
110 |
Â
return (object) array(
|
111 |
Â
'complete_payment' => true,
|
112 |
Â
'charge' => $charge,
|
@@ -211,7 +213,7 @@ class WC_Stripe_Payment_Intent extends WC_Stripe_Payment {
|
|
211 |
Â
$args['confirm'] = false;
|
212 |
Â
}
|
213 |
Â
|
214 |
-
if (
|
215 |
Â
$args['receipt_email'] = $email;
|
216 |
Â
}
|
217 |
Â
|
@@ -219,7 +221,12 @@ class WC_Stripe_Payment_Intent extends WC_Stripe_Payment {
|
|
219 |
Â
$args['customer'] = $customer_id;
|
220 |
Â
}
|
221 |
Â
|
222 |
-
if ( $this->payment_method->should_save_payment_method( $order )
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
223 |
Â
$args['setup_future_usage'] = 'off_session';
|
224 |
Â
}
|
225 |
Â
|
@@ -228,8 +235,8 @@ class WC_Stripe_Payment_Intent extends WC_Stripe_Payment {
|
|
228 |
Â
$this->payment_method->add_stripe_order_args( $args, $order );
|
229 |
Â
|
230 |
Â
/**
|
231 |
-
* @param array
|
232 |
-
* @param WC_Order
|
233 |
Â
* @param WC_Stripe_Payment_Intent $this
|
234 |
Â
*/
|
235 |
Â
return apply_filters( 'wc_stripe_payment_intent_args', $args, $order, $this );
|
@@ -249,16 +256,14 @@ class WC_Stripe_Payment_Intent extends WC_Stripe_Payment {
|
|
249 |
Â
$order->update_meta_data( WC_Stripe_Constants::PAYMENT_INTENT_ID, $payment_intent );
|
250 |
Â
$order->save();
|
251 |
Â
}
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
252 |
Â
|
253 |
-
return $
|
254 |
-
$payment_intent,
|
255 |
-
array(
|
256 |
-
'amount_to_capture' => wc_stripe_add_number_precision(
|
257 |
-
$amount,
|
258 |
-
$order->get_currency()
|
259 |
-
),
|
260 |
-
)
|
261 |
-
);
|
262 |
Â
}
|
263 |
Â
|
264 |
Â
/**
|
@@ -278,7 +283,7 @@ class WC_Stripe_Payment_Intent extends WC_Stripe_Payment {
|
|
278 |
Â
if ( in_array( $payment_intent->status, $statuses ) ) {
|
279 |
Â
return $this->gateway->paymentIntents->mode( wc_stripe_order_mode( $order ) )->cancel( $payment_intent->id );
|
280 |
Â
} elseif ( 'succeeded' === $payment_intent->status ) {
|
281 |
-
return $this->process_refund( $order, $order->get_total() );
|
282 |
Â
}
|
283 |
Â
}
|
284 |
Â
}
|
1 |
Â
<?php
|
2 |
+
|
3 |
Â
defined( 'ABSPATH' ) || exit();
|
4 |
Â
|
5 |
Â
require_once( WC_STRIPE_PLUGIN_FILE_PATH . 'includes/abstract/abstract-wc-stripe-payment.php' );
|
6 |
Â
|
7 |
Â
/**
|
8 |
Â
*
|
Â
|
|
Â
|
|
9 |
Â
* @since 3.1.0
|
10 |
Â
*
|
11 |
+
* @author Payment Plugins
|
12 |
+
* @package Stripe/Classes
|
13 |
Â
*/
|
14 |
Â
class WC_Stripe_Payment_Intent extends WC_Stripe_Payment {
|
15 |
Â
|
26 |
Â
if ( $this->can_update_payment_intent( $order ) ) {
|
27 |
Â
$intent = $this->gateway->paymentIntents->update( $intent_id, $this->get_payment_intent_args( $order, false ) );
|
28 |
Â
} else {
|
29 |
+
$intent = $this->gateway->paymentIntents->retrieve( $intent_id, apply_filters( 'wc_stripe_payment_intent_retrieve_args', null, $order, $intent_id ) );
|
30 |
Â
}
|
31 |
Â
} else {
|
32 |
Â
$intent = $this->gateway->paymentIntents->create( $this->get_payment_intent_args( $order ) );
|
42 |
Â
$order->update_meta_data( WC_Stripe_Constants::PAYMENT_INTENT_ID, $intent->id );
|
43 |
Â
$order->update_meta_data( WC_Stripe_Constants::PAYMENT_METHOD_TOKEN, $intent->payment_method );
|
44 |
Â
$order->update_meta_data( WC_Stripe_Constants::MODE, wc_stripe_mode() );
|
45 |
+
// serialize the intent and save to the order. The intent will be used to analyze if anything
|
46 |
Â
// has changed.
|
47 |
Â
$order->update_meta_data( WC_Stripe_Constants::PAYMENT_INTENT, $intent->jsonSerialize() );
|
48 |
Â
$order->save();
|
65 |
Â
if ( isset( $intent->setup_future_usage, $intent->customer, $charge->payment_method_details ) && 'off_session' === $intent->setup_future_usage ) {
|
66 |
Â
$this->payment_method->save_payment_method( $intent->payment_method, $order, $charge->payment_method_details );
|
67 |
Â
}
|
68 |
+
// remove metadata that's no longer needed
|
69 |
+
$order->delete_meta_data( WC_Stripe_Constants::PAYMENT_INTENT );
|
70 |
Â
|
71 |
Â
return (object) array(
|
72 |
Â
'complete_payment' => true,
|
74 |
Â
);
|
75 |
Â
}
|
76 |
Â
if ( in_array( $intent->status, array( 'requires_action', 'requires_payment_method', 'requires_source_action', 'requires_source' ), true ) ) {
|
77 |
+
// If the payment method isn't synchronous, set its status to on-hold so if the customer
|
78 |
Â
// skips the redirect and the payment takes 1 or more days, the payment won't be cancelled
|
79 |
Â
// due to the WooCommerce pending payment status.
|
80 |
Â
if ( ! $this->payment_method->synchronous ) {
|
109 |
Â
$charge = $intent->charges->data[0];
|
110 |
Â
|
111 |
Â
if ( $intent->status === 'succeeded' || $intent->status === 'requires_capture' ) {
|
Â
|
|
112 |
Â
return (object) array(
|
113 |
Â
'complete_payment' => true,
|
114 |
Â
'charge' => $charge,
|
213 |
Â
$args['confirm'] = false;
|
214 |
Â
}
|
215 |
Â
|
216 |
+
if ( stripe_wc()->advanced_settings->is_email_receipt_enabled() && ( $email = $order->get_billing_email() ) ) {
|
217 |
Â
$args['receipt_email'] = $email;
|
218 |
Â
}
|
219 |
Â
|
221 |
Â
$args['customer'] = $customer_id;
|
222 |
Â
}
|
223 |
Â
|
224 |
+
if ( $this->payment_method->should_save_payment_method( $order )
|
225 |
+
|| ( $this->payment_method->supports( 'add_payment_method' )
|
226 |
+
&& apply_filters( 'wc_stripe_force_save_payment_method',
|
227 |
+
false,
|
228 |
+
$order,
|
229 |
+
$this->payment_method ) ) ) {
|
230 |
Â
$args['setup_future_usage'] = 'off_session';
|
231 |
Â
}
|
232 |
Â
|
235 |
Â
$this->payment_method->add_stripe_order_args( $args, $order );
|
236 |
Â
|
237 |
Â
/**
|
238 |
+
* @param array $args
|
239 |
+
* @param WC_Order $order
|
240 |
Â
* @param WC_Stripe_Payment_Intent $this
|
241 |
Â
*/
|
242 |
Â
return apply_filters( 'wc_stripe_payment_intent_args', $args, $order, $this );
|
256 |
Â
$order->update_meta_data( WC_Stripe_Constants::PAYMENT_INTENT_ID, $payment_intent );
|
257 |
Â
$order->save();
|
258 |
Â
}
|
259 |
+
$params = apply_filters( 'wc_stripe_payment_intent_capture_args', array( 'amount_to_capture' => wc_stripe_add_number_precision( $amount, $order->get_currency() ) ), $amount, $order );
|
260 |
+
|
261 |
+
$result = $this->gateway->mode( wc_stripe_order_mode( $order ) )->paymentIntents->capture( $payment_intent, $params );
|
262 |
+
if ( ! is_wp_error( $result ) ) {
|
263 |
+
return $result->charges->data[0];
|
264 |
+
}
|
265 |
Â
|
266 |
+
return $result;
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
267 |
Â
}
|
268 |
Â
|
269 |
Â
/**
|
283 |
Â
if ( in_array( $payment_intent->status, $statuses ) ) {
|
284 |
Â
return $this->gateway->paymentIntents->mode( wc_stripe_order_mode( $order ) )->cancel( $payment_intent->id );
|
285 |
Â
} elseif ( 'succeeded' === $payment_intent->status ) {
|
286 |
+
return $this->process_refund( $order, $order->get_total() - $order->get_total_refunded() );
|
287 |
Â
}
|
288 |
Â
}
|
289 |
Â
}
|
includes/class-wc-stripe-redirect-handler.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
Â
<?php
|
Â
|
|
2 |
Â
defined( 'ABSPATH' ) || exit();
|
3 |
Â
|
4 |
Â
/**
|
@@ -50,7 +51,11 @@ class WC_Stripe_Redirect_Handler {
|
|
50 |
Â
$redirect = $payment_method->get_return_url( $order );
|
51 |
Â
|
52 |
Â
if ( in_array( $result->status, array( 'requires_action', 'pending' ) ) ) {
|
53 |
-
$
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
54 |
Â
} elseif ( in_array( $result->status, array( 'requires_payment_method', 'failed' ) ) ) {
|
55 |
Â
wc_add_notice( __( 'Payment authorization failed. Please select another payment method.', 'woo-stripe-payment' ), 'error' );
|
56 |
Â
if ( $result instanceof \Stripe\PaymentIntent ) {
|
@@ -91,6 +96,7 @@ class WC_Stripe_Redirect_Handler {
|
|
91 |
Â
add_action( 'woocommerce_cart_emptied', 'wc_stripe_restore_cart_after_product_checkout' );
|
92 |
Â
}
|
93 |
Â
}
|
Â
|
|
94 |
Â
}
|
95 |
Â
|
96 |
Â
WC_Stripe_Redirect_Handler::init();
|
1 |
Â
<?php
|
2 |
+
|
3 |
Â
defined( 'ABSPATH' ) || exit();
|
4 |
Â
|
5 |
Â
/**
|
51 |
Â
$redirect = $payment_method->get_return_url( $order );
|
52 |
Â
|
53 |
Â
if ( in_array( $result->status, array( 'requires_action', 'pending' ) ) ) {
|
54 |
+
if ( $result->status === 'pending' ) {
|
55 |
+
$order->update_status( 'on-hold' );
|
56 |
+
} else {
|
57 |
+
return;
|
58 |
+
}
|
59 |
Â
} elseif ( in_array( $result->status, array( 'requires_payment_method', 'failed' ) ) ) {
|
60 |
Â
wc_add_notice( __( 'Payment authorization failed. Please select another payment method.', 'woo-stripe-payment' ), 'error' );
|
61 |
Â
if ( $result instanceof \Stripe\PaymentIntent ) {
|
96 |
Â
add_action( 'woocommerce_cart_emptied', 'wc_stripe_restore_cart_after_product_checkout' );
|
97 |
Â
}
|
98 |
Â
}
|
99 |
+
|
100 |
Â
}
|
101 |
Â
|
102 |
Â
WC_Stripe_Redirect_Handler::init();
|
includes/class-wc-stripe-rest-api.php
CHANGED
@@ -28,6 +28,7 @@ class WC_Stripe_Rest_API {
|
|
28 |
Â
$this->include_classes();
|
29 |
Â
add_action( 'wc_ajax_wc_stripe_frontend_request', array( $this, 'process_frontend_request' ) );
|
30 |
Â
add_action( 'rest_api_init', array( $this, 'register_routes' ) );
|
Â
|
|
31 |
Â
}
|
32 |
Â
|
33 |
Â
/**
|
@@ -37,7 +38,8 @@ class WC_Stripe_Rest_API {
|
|
37 |
Â
public function __get( $key ) {
|
38 |
Â
$controller = isset( $this->controllers[ $key ] ) ? $this->controllers[ $key ] : '';
|
39 |
Â
if ( empty( $controller ) ) {
|
40 |
-
wc_doing_it_wrong( __FUNCTION__, sprintf( __( '%1$s is an invalid controller name.', 'woo-stripe-payment' ), $key ),
|
Â
|
|
41 |
Â
}
|
42 |
Â
|
43 |
Â
return $controller;
|
@@ -163,17 +165,24 @@ class WC_Stripe_Rest_API {
|
|
163 |
Â
*/
|
164 |
Â
public static function get_endpoint( $path ) {
|
165 |
Â
if ( version_compare( WC()->version, '3.2.0', '<' ) ) {
|
166 |
-
$endpoint = esc_url_raw( apply_filters( 'woocommerce_ajax_get_endpoint',
|
167 |
-
'
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
Â
|
|
173 |
Â
} else {
|
174 |
Â
$endpoint = WC_AJAX::get_endpoint( 'wc_stripe_frontend_request' );
|
175 |
Â
}
|
176 |
Â
|
177 |
Â
return add_query_arg( 'path', '/' . trim( $path, '/' ), $endpoint );
|
178 |
Â
}
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
179 |
Â
}
|
28 |
Â
$this->include_classes();
|
29 |
Â
add_action( 'wc_ajax_wc_stripe_frontend_request', array( $this, 'process_frontend_request' ) );
|
30 |
Â
add_action( 'rest_api_init', array( $this, 'register_routes' ) );
|
31 |
+
add_action( 'wp_ajax_wc_stripe_admin_request', array( $this, 'process_frontend_request' ) );
|
32 |
Â
}
|
33 |
Â
|
34 |
Â
/**
|
38 |
Â
public function __get( $key ) {
|
39 |
Â
$controller = isset( $this->controllers[ $key ] ) ? $this->controllers[ $key ] : '';
|
40 |
Â
if ( empty( $controller ) ) {
|
41 |
+
wc_doing_it_wrong( __FUNCTION__, sprintf( __( '%1$s is an invalid controller name.', 'woo-stripe-payment' ), $key ),
|
42 |
+
stripe_wc()->version );
|
43 |
Â
}
|
44 |
Â
|
45 |
Â
return $controller;
|
165 |
Â
*/
|
166 |
Â
public static function get_endpoint( $path ) {
|
167 |
Â
if ( version_compare( WC()->version, '3.2.0', '<' ) ) {
|
168 |
+
$endpoint = esc_url_raw( apply_filters( 'woocommerce_ajax_get_endpoint',
|
169 |
+
add_query_arg( 'wc-ajax', 'wc_stripe_frontend_request', remove_query_arg( array(
|
170 |
+
'remove_item',
|
171 |
+
'add-to-cart',
|
172 |
+
'added-to-cart',
|
173 |
+
'order_again',
|
174 |
+
'_wpnonce'
|
175 |
+
), home_url( '/', 'relative' ) ) ), 'wc_stripe_frontend_request' ) );
|
176 |
Â
} else {
|
177 |
Â
$endpoint = WC_AJAX::get_endpoint( 'wc_stripe_frontend_request' );
|
178 |
Â
}
|
179 |
Â
|
180 |
Â
return add_query_arg( 'path', '/' . trim( $path, '/' ), $endpoint );
|
181 |
Â
}
|
182 |
+
|
183 |
+
public static function get_admin_endpoint( $path ) {
|
184 |
+
$url = admin_url( 'admin-ajax.php' );
|
185 |
+
|
186 |
+
return add_query_arg( array( 'action' => 'wc_stripe_admin_request', 'path' => '/' . trim( $path, '/' ) ), $url );
|
187 |
+
}
|
188 |
Â
}
|
includes/class-wc-stripe-update.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
Â
<?php
|
Â
|
|
2 |
Â
defined( 'ABSPATH' ) || exit();
|
3 |
Â
|
4 |
Â
/**
|
@@ -10,13 +11,14 @@ defined( 'ABSPATH' ) || exit();
|
|
10 |
Â
class WC_Stripe_Update {
|
11 |
Â
|
12 |
Â
private static $updates = array(
|
13 |
-
'3.0.7'
|
14 |
-
'3.1.0'
|
15 |
-
'3.1.1'
|
16 |
-
'3.1.6'
|
17 |
-
'3.1.7'
|
18 |
-
'3.2.8'
|
19 |
-
|
Â
|
|
20 |
Â
|
21 |
Â
public static function init() {
|
22 |
Â
add_action( 'init', array( __CLASS__, 'update' ) );
|
@@ -64,6 +66,7 @@ class WC_Stripe_Update {
|
|
64 |
Â
|
65 |
Â
return isset( $messages[ $version ] ) ? $messages[ $version ] : false;
|
66 |
Â
}
|
Â
|
|
67 |
Â
}
|
68 |
Â
|
69 |
Â
WC_Stripe_Update::init();
|
1 |
Â
<?php
|
2 |
+
|
3 |
Â
defined( 'ABSPATH' ) || exit();
|
4 |
Â
|
5 |
Â
/**
|
11 |
Â
class WC_Stripe_Update {
|
12 |
Â
|
13 |
Â
private static $updates = array(
|
14 |
+
'3.0.7' => 'update-3.0.7.php',
|
15 |
+
'3.1.0' => 'update-3.1.0.php',
|
16 |
+
'3.1.1' => 'update-3.1.1.php',
|
17 |
+
'3.1.6' => 'update-3.1.6.php',
|
18 |
+
'3.1.7' => 'update-3.1.7.php',
|
19 |
+
'3.2.8' => 'update-3.2.8.php',
|
20 |
+
'3.3.13' => 'update-3.3.13.php'
|
21 |
+
);
|
22 |
Â
|
23 |
Â
public static function init() {
|
24 |
Â
add_action( 'init', array( __CLASS__, 'update' ) );
|
66 |
Â
|
67 |
Â
return isset( $messages[ $version ] ) ? $messages[ $version ] : false;
|
68 |
Â
}
|
69 |
+
|
70 |
Â
}
|
71 |
Â
|
72 |
Â
WC_Stripe_Update::init();
|
includes/class-wc-stripe-utils.php
ADDED
@@ -0,0 +1,108 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @since 3.3.13
|
5 |
+
*/
|
6 |
+
class WC_Stripe_Utils {
|
7 |
+
|
8 |
+
/**
|
9 |
+
* @param WC_Order $data
|
10 |
+
*/
|
11 |
+
public static function display_fee( $order ) {
|
12 |
+
return self::display_amount( 'fee', $order );
|
13 |
+
}
|
14 |
+
|
15 |
+
/**
|
16 |
+
* @param WC_Order $order
|
17 |
+
*
|
18 |
+
* @return string
|
19 |
+
*/
|
20 |
+
public static function display_net( $order ) {
|
21 |
+
return self::display_amount( 'net', $order );
|
22 |
+
}
|
23 |
+
|
24 |
+
/**
|
25 |
+
* @param WC_Order $order
|
26 |
+
*
|
27 |
+
* @return string
|
28 |
+
*/
|
29 |
+
private static function display_amount( $type, $order ) {
|
30 |
+
$payment_balance = self::get_payment_balance( $order );
|
31 |
+
if ( $payment_balance && isset( $payment_balance->{$type}, $payment_balance->currency ) && is_numeric( $payment_balance->{$type} ) ) {
|
32 |
+
if ( $type === 'fee' ) {
|
33 |
+
$amount = - 1 * $payment_balance->fee;
|
34 |
+
} else {
|
35 |
+
$amount = $payment_balance->net;
|
36 |
+
}
|
37 |
+
|
38 |
+
return wc_price( $amount, array( 'currency' => $payment_balance->currency ) );
|
39 |
+
}
|
40 |
+
|
41 |
+
return '';
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* @param \Stripe\Charge $charge
|
46 |
+
* @param \WC_Order $order
|
47 |
+
* @param bool $save
|
48 |
+
*/
|
49 |
+
public static function add_balance_transaction_to_order( $charge, $order, $save = false ) {
|
50 |
+
if ( isset( $charge->balance_transaction ) && is_object( $charge->balance_transaction ) ) {
|
51 |
+
$display_order_currency = stripe_wc()->advanced_settings->is_display_order_currency();
|
52 |
+
$balance_transaction = $charge->balance_transaction;
|
53 |
+
$exchange_rate = $balance_transaction->exchange_rate === null ? 1 : $balance_transaction->exchange_rate;
|
54 |
+
$amount_refunded = $display_order_currency ? $charge->amount_refunded : $charge->amount_refunded * $exchange_rate;
|
55 |
+
// the balance_transaction_net already has the fee deducted from it.
|
56 |
+
$net = $display_order_currency ? $balance_transaction->net / $exchange_rate : $balance_transaction->net;
|
57 |
+
$net = wc_format_decimal( $net - $amount_refunded, 4 );
|
58 |
+
$fee = $display_order_currency ? wc_format_decimal( $balance_transaction->fee / $exchange_rate, 4 ) : $balance_transaction->fee;
|
59 |
+
$currency = $display_order_currency ? $order->get_currency() : strtoupper( $balance_transaction->currency );
|
60 |
+
$payment_balance = new WC_Stripe_Payment_Balance( $order );
|
61 |
+
$payment_balance->currency = $currency;
|
62 |
+
$payment_balance->fee = wc_stripe_remove_number_precision( $fee, $currency, true, 4 );
|
63 |
+
$payment_balance->net = wc_stripe_remove_number_precision( $net, $currency, true, 4 );
|
64 |
+
if ( $charge->refunds->count() > 0 ) {
|
65 |
+
foreach ( $charge->refunds->data as $refund ) {
|
66 |
+
/**
|
67 |
+
* @var \Stripe\Refund $refund
|
68 |
+
*/
|
69 |
+
if ( is_object( $refund->balance_transaction ) ) {
|
70 |
+
self::update_balance_transaction( $refund->balance_transaction, $order, false, $payment_balance );
|
71 |
+
}
|
72 |
+
}
|
73 |
+
}
|
74 |
+
$payment_balance->update_meta_data( $save );
|
75 |
+
}
|
76 |
+
}
|
77 |
+
|
78 |
+
/**
|
79 |
+
* @param \Stripe\BalanceTransaction $balance_transaction
|
80 |
+
* @param \WC_Order $order
|
81 |
+
*/
|
82 |
+
public static function update_balance_transaction( $balance_transaction, $order, $save = false, $payment_balance = null ) {
|
83 |
+
if ( $balance_transaction->reporting_category === 'partial_capture_reversal' ) {
|
84 |
+
$payment_balance = $payment_balance ? $payment_balance : self::get_payment_balance( $order );
|
85 |
+
if ( $payment_balance ) {
|
86 |
+
$exchange_rate = $balance_transaction->exchange_rate === null ? 1 : $balance_transaction->exchange_rate;
|
87 |
+
$display_order_currency = stripe_wc()->advanced_settings->is_display_order_currency() && $payment_balance->currency !== strtoupper( $balance_transaction->currency );
|
88 |
+
$currency = $display_order_currency ? $order->get_currency() : strtoupper( $balance_transaction->currency );
|
89 |
+
// fee is negative here since it's a reversal, that's why for net we subtract and for fee we add.
|
90 |
+
$fee = $display_order_currency ? $balance_transaction->fee / $exchange_rate : $balance_transaction->fee;
|
91 |
+
$fee = wc_stripe_remove_number_precision( $fee, $currency, true, 4 );
|
92 |
+
$payment_balance->net = $payment_balance->net - $fee;
|
93 |
+
$payment_balance->fee = $payment_balance->fee + $fee;
|
94 |
+
$payment_balance->update_meta_data( $save );
|
95 |
+
}
|
96 |
+
}
|
97 |
+
}
|
98 |
+
|
99 |
+
/**
|
100 |
+
* @param WC_Order $order
|
101 |
+
*
|
102 |
+
* @return \WC_Stripe_Payment_Balance|null
|
103 |
+
*/
|
104 |
+
private static function get_payment_balance( $order ) {
|
105 |
+
return new WC_Stripe_Payment_Balance( $order );
|
106 |
+
}
|
107 |
+
|
108 |
+
}
|
includes/controllers/class-wc-stripe-controller-gateway-settings.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
Â
<?php
|
Â
|
|
2 |
Â
defined( 'ABSPATH' ) || exit();
|
3 |
Â
|
4 |
Â
/**
|
@@ -13,26 +14,25 @@ class WC_Stripe_Controller_Gateway_Settings extends WC_Stripe_Rest_Controller {
|
|
13 |
Â
|
14 |
Â
public function register_routes() {
|
15 |
Â
register_rest_route(
|
16 |
-
$this->rest_uri(),
|
17 |
-
'apple-domain',
|
18 |
-
array(
|
19 |
Â
'methods' => WP_REST_Server::CREATABLE,
|
20 |
Â
'callback' => array( $this, 'register_apple_domain' ),
|
21 |
Â
'permission_callback' => array( $this, 'shop_manager_permission_check' )
|
22 |
Â
)
|
23 |
Â
);
|
24 |
-
register_rest_route(
|
25 |
-
$this->rest_uri(),
|
26 |
-
'create-webhook',
|
27 |
Â
array(
|
28 |
Â
'methods' => WP_REST_Server::CREATABLE,
|
29 |
Â
'callback' => array( $this, 'create_webhook' ),
|
30 |
Â
'permission_callback' => array( $this, 'shop_manager_permission_check' )
|
31 |
Â
)
|
32 |
Â
);
|
33 |
-
register_rest_route(
|
34 |
-
|
35 |
-
'
|
Â
|
|
Â
|
|
Â
|
|
36 |
Â
array(
|
37 |
Â
'methods' => WP_REST_Server::CREATABLE,
|
38 |
Â
'callback' => array( $this, 'connection_test' ),
|
@@ -83,7 +83,8 @@ class WC_Stripe_Controller_Gateway_Settings extends WC_Stripe_Rest_Controller {
|
|
83 |
Â
try {
|
84 |
Â
$api_key = wc_stripe_get_secret_key( 'live' );
|
85 |
Â
if ( empty( $api_key ) ) {
|
86 |
-
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.',
|
Â
|
|
87 |
Â
}
|
88 |
Â
// fetch the Apple domains
|
89 |
Â
$registered_domains = $gateway->applePayDomains->mode( 'live' )->all( array( 'limit' => 50 ) );
|
@@ -105,7 +106,8 @@ class WC_Stripe_Controller_Gateway_Settings extends WC_Stripe_Rest_Controller {
|
|
105 |
Â
}
|
106 |
Â
}
|
107 |
Â
}
|
108 |
-
}
|
Â
|
|
109 |
Â
return new WP_Error( 'domain-error', $e->getMessage(), array( 'status' => 200 ) );
|
110 |
Â
}
|
111 |
Â
|
@@ -130,13 +132,12 @@ class WC_Stripe_Controller_Gateway_Settings extends WC_Stripe_Rest_Controller {
|
|
130 |
Â
$url = stripe_wc()->rest_api->webhook->rest_url( 'webhook' );
|
131 |
Â
$api_settings = stripe_wc()->api_settings;
|
132 |
Â
$env = $request->get_param( 'environment' );
|
133 |
-
$gateway =
|
Â
|
|
134 |
Â
// first fetch all webhooks
|
135 |
-
$
|
136 |
-
if ( empty( $
|
137 |
-
return new WP_Error(
|
138 |
-
'webhook-error',
|
139 |
-
__( 'You must configure your secret key before creating webhooks.', 'woo-stripe-payment' ),
|
140 |
Â
array(
|
141 |
Â
'status' => 200,
|
142 |
Â
)
|
@@ -146,44 +147,37 @@ class WC_Stripe_Controller_Gateway_Settings extends WC_Stripe_Rest_Controller {
|
|
146 |
Â
if ( ! is_wp_error( $webhooks ) ) {
|
147 |
Â
// validate that the webhook hasn't already been created.
|
148 |
Â
foreach ( $webhooks->data as $webhook ) {
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
157 |
Â
}
|
158 |
Â
}
|
159 |
Â
}
|
160 |
Â
|
161 |
-
|
162 |
-
$webhook = $gateway->webhookEndpoints->create(
|
163 |
-
array(
|
164 |
-
'url' => $url,
|
165 |
-
'enabled_events' => apply_filters(
|
166 |
-
'wc_stripe_webhook_events',
|
167 |
-
array(
|
168 |
-
'charge.failed',
|
169 |
-
'charge.succeeded',
|
170 |
-
'source.chargeable',
|
171 |
-
'payment_intent.succeeded',
|
172 |
-
)
|
173 |
-
),
|
174 |
-
)
|
175 |
-
);
|
176 |
Â
if ( is_wp_error( $webhook ) ) {
|
177 |
Â
return new WP_Error( $webhook->get_error_code(), $webhook->get_error_message(), array( 'status' => 200 ) );
|
178 |
Â
} else {
|
179 |
-
$api_settings->update_option( "webhook_url_{$env}", $webhook['url'] );
|
180 |
-
$api_settings->update_option( "webhook_secret_{$env}", $webhook['secret'] );
|
181 |
-
$api_settings->update_option( "webhook_id_{$env}", $webhook['id'] );
|
182 |
-
|
183 |
Â
return rest_ensure_response(
|
184 |
Â
array(
|
185 |
Â
'message' => sprintf(
|
186 |
-
__( 'Webhook created in Stripe for %s environment. You can test your webhook by logging in to the Stripe dashboard',
|
Â
|
|
187 |
Â
'live' ==
|
188 |
Â
$env ? __( 'Live', 'woo-stripe-payment' ) : __( 'Test', 'woo-stripe-payment' )
|
189 |
Â
),
|
@@ -193,6 +187,25 @@ class WC_Stripe_Controller_Gateway_Settings extends WC_Stripe_Rest_Controller {
|
|
193 |
Â
}
|
194 |
Â
}
|
195 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
196 |
Â
/**
|
197 |
Â
* Perform a connection test
|
198 |
Â
*
|
@@ -211,10 +224,13 @@ class WC_Stripe_Controller_Gateway_Settings extends WC_Stripe_Rest_Controller {
|
|
211 |
Â
$api_keys = array( $request->get_param( 'secret_key' ), $request->get_param( 'publishable_key' ) );
|
212 |
Â
|
213 |
Â
if ( in_array( null, $api_keys ) ) {
|
214 |
-
throw new Exception( sprintf( __( 'You must enter your API keys or connect the plugin before performing a connection test.',
|
Â
|
|
215 |
Â
}
|
216 |
-
$settings->settings['publishable_key_test'] = $settings->validate_text_field( 'publishable_key_test',
|
217 |
-
|
Â
|
|
Â
|
|
218 |
Â
}
|
219 |
Â
|
220 |
Â
// test the secret key
|
@@ -229,7 +245,19 @@ class WC_Stripe_Controller_Gateway_Settings extends WC_Stripe_Rest_Controller {
|
|
229 |
Â
'https://api.stripe.com/v1/payment_methods',
|
230 |
Â
array(
|
231 |
Â
'headers' => array( 'Content-Type' => 'application/x-www-form-urlencoded' ),
|
232 |
-
'body' => array(
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
233 |
Â
)
|
234 |
Â
);
|
235 |
Â
if ( is_wp_error( $response ) ) {
|
@@ -244,11 +272,14 @@ class WC_Stripe_Controller_Gateway_Settings extends WC_Stripe_Rest_Controller {
|
|
244 |
Â
update_option( $settings->get_option_key(), $settings->settings, 'yes' );
|
245 |
Â
}
|
246 |
Â
ob_get_clean();
|
247 |
-
}
|
Â
|
|
248 |
Â
return new WP_Error( 'connection-failure', $e->getMessage(), array( 'status' => 200 ) );
|
249 |
Â
}
|
250 |
Â
|
251 |
-
return rest_ensure_response( array(
|
Â
|
|
Â
|
|
252 |
Â
}
|
253 |
Â
|
254 |
Â
public function shop_manager_permission_check() {
|
@@ -256,6 +287,8 @@ class WC_Stripe_Controller_Gateway_Settings extends WC_Stripe_Rest_Controller {
|
|
256 |
Â
return true;
|
257 |
Â
}
|
258 |
Â
|
259 |
-
return new WP_Error( 'permission-error', __( 'You do not have permissions to access this resource.', 'woo-stripe-payment' ),
|
Â
|
|
260 |
Â
}
|
Â
|
|
261 |
Â
}
|
1 |
Â
<?php
|
2 |
+
|
3 |
Â
defined( 'ABSPATH' ) || exit();
|
4 |
Â
|
5 |
Â
/**
|
14 |
Â
|
15 |
Â
public function register_routes() {
|
16 |
Â
register_rest_route(
|
17 |
+
$this->rest_uri(), 'apple-domain', array(
|
Â
|
|
Â
|
|
18 |
Â
'methods' => WP_REST_Server::CREATABLE,
|
19 |
Â
'callback' => array( $this, 'register_apple_domain' ),
|
20 |
Â
'permission_callback' => array( $this, 'shop_manager_permission_check' )
|
21 |
Â
)
|
22 |
Â
);
|
23 |
+
register_rest_route( $this->rest_uri(), 'create-webhook',
|
Â
|
|
Â
|
|
24 |
Â
array(
|
25 |
Â
'methods' => WP_REST_Server::CREATABLE,
|
26 |
Â
'callback' => array( $this, 'create_webhook' ),
|
27 |
Â
'permission_callback' => array( $this, 'shop_manager_permission_check' )
|
28 |
Â
)
|
29 |
Â
);
|
30 |
+
register_rest_route( $this->rest_uri(), 'delete-webhook', array(
|
31 |
+
'methods' => WP_REST_Server::CREATABLE,
|
32 |
+
'callback' => array( $this, 'delete_webhook' ),
|
33 |
+
'permission_callback' => array( $this, 'shop_manager_permission_check' )
|
34 |
+
) );
|
35 |
+
register_rest_route( $this->rest_uri(), 'connection-test',
|
36 |
Â
array(
|
37 |
Â
'methods' => WP_REST_Server::CREATABLE,
|
38 |
Â
'callback' => array( $this, 'connection_test' ),
|
83 |
Â
try {
|
84 |
Â
$api_key = wc_stripe_get_secret_key( 'live' );
|
85 |
Â
if ( empty( $api_key ) ) {
|
86 |
+
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.',
|
87 |
+
'woo-stripe-payment' ) );
|
88 |
Â
}
|
89 |
Â
// fetch the Apple domains
|
90 |
Â
$registered_domains = $gateway->applePayDomains->mode( 'live' )->all( array( 'limit' => 50 ) );
|
106 |
Â
}
|
107 |
Â
}
|
108 |
Â
}
|
109 |
+
}
|
110 |
+
catch ( Exception $e ) {
|
111 |
Â
return new WP_Error( 'domain-error', $e->getMessage(), array( 'status' => 200 ) );
|
112 |
Â
}
|
113 |
Â
|
132 |
Â
$url = stripe_wc()->rest_api->webhook->rest_url( 'webhook' );
|
133 |
Â
$api_settings = stripe_wc()->api_settings;
|
134 |
Â
$env = $request->get_param( 'environment' );
|
135 |
+
$gateway = WC_Stripe_Gateway::load( $env );
|
136 |
+
$events = array();
|
137 |
Â
// first fetch all webhooks
|
138 |
+
$secret_key = wc_stripe_get_secret_key( $env );
|
139 |
+
if ( empty( $secret_key ) ) {
|
140 |
+
return new WP_Error( 'webhook-error', __( 'You must configure your secret key before creating webhooks.', 'woo-stripe-payment' ),
|
Â
|
|
Â
|
|
141 |
Â
array(
|
142 |
Â
'status' => 200,
|
143 |
Â
)
|
147 |
Â
if ( ! is_wp_error( $webhooks ) ) {
|
148 |
Â
// validate that the webhook hasn't already been created.
|
149 |
Â
foreach ( $webhooks->data as $webhook ) {
|
150 |
+
/**
|
151 |
+
* @var \Stripe\WebhookEndpoint $webhook
|
152 |
+
*/
|
153 |
+
if ( $webhook->url === $url ) {
|
154 |
+
if ( ! $api_settings->get_option( "webhook_secret_{$env}", null ) ) {
|
155 |
+
// get all of the events for this endpoint so they can be merged with the
|
156 |
+
// new webhook that's created.
|
157 |
+
$events = $webhook->enabled_events;
|
158 |
+
$gateway->webhookEndpoints->delete( $webhook->id );
|
159 |
+
$api_settings->delete_webhook_settings( $env );
|
160 |
+
} else {
|
161 |
+
return new WP_Error( 'webhook-error',
|
162 |
+
__( 'There is already a webhook configured for this site. If you want to delete the webhook, login to your Stripe Dashboard.', 'woo-stripe-payment' ),
|
163 |
+
array(
|
164 |
+
'status' => 200,
|
165 |
+
)
|
166 |
+
);
|
167 |
+
}
|
168 |
Â
}
|
169 |
Â
}
|
170 |
Â
}
|
171 |
Â
|
172 |
+
$webhook = $api_settings->create_webhook( $env, $events );
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
173 |
Â
if ( is_wp_error( $webhook ) ) {
|
174 |
Â
return new WP_Error( $webhook->get_error_code(), $webhook->get_error_message(), array( 'status' => 200 ) );
|
175 |
Â
} else {
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
176 |
Â
return rest_ensure_response(
|
177 |
Â
array(
|
178 |
Â
'message' => sprintf(
|
179 |
+
__( 'Webhook created in Stripe for %s environment. You can test your webhook by logging in to the Stripe dashboard',
|
180 |
+
'woo-stripe-payment' ),
|
181 |
Â
'live' ==
|
182 |
Â
$env ? __( 'Live', 'woo-stripe-payment' ) : __( 'Test', 'woo-stripe-payment' )
|
183 |
Â
),
|
187 |
Â
}
|
188 |
Â
}
|
189 |
Â
|
190 |
+
/**
|
191 |
+
* @param \WP_REST_Request $request
|
192 |
+
*/
|
193 |
+
public function delete_webhook( $request ) {
|
194 |
+
$api_settings = stripe_wc()->api_settings;
|
195 |
+
$mode = $request['mode'];
|
196 |
+
$webhook_id = $api_settings->get_webhook_id( $mode );
|
197 |
+
if ( $webhook_id ) {
|
198 |
+
$client = WC_Stripe_Gateway::load( $mode );
|
199 |
+
$result = $client->webhookEndpoints->delete( $webhook_id );
|
200 |
+
$api_settings->delete_webhook_settings( $mode );
|
201 |
+
if ( is_wp_error( $result ) ) {
|
202 |
+
return new WP_Error( $result->get_error_code(), $result->get_error_message(), array( 'status' => 200 ) );
|
203 |
+
}
|
204 |
+
}
|
205 |
+
|
206 |
+
return rest_ensure_response( array( 'success' => true ) );
|
207 |
+
}
|
208 |
+
|
209 |
Â
/**
|
210 |
Â
* Perform a connection test
|
211 |
Â
*
|
224 |
Â
$api_keys = array( $request->get_param( 'secret_key' ), $request->get_param( 'publishable_key' ) );
|
225 |
Â
|
226 |
Â
if ( in_array( null, $api_keys ) ) {
|
227 |
+
throw new Exception( sprintf( __( 'You must enter your API keys or connect the plugin before performing a connection test.',
|
228 |
+
'woo-stripe-payment' ) ) );
|
229 |
Â
}
|
230 |
+
$settings->settings['publishable_key_test'] = $settings->validate_text_field( 'publishable_key_test',
|
231 |
+
$request->get_param( 'publishable_key' ) );
|
232 |
+
$settings->settings['secret_key_test'] = $settings->validate_password_field( 'secret_key_test',
|
233 |
+
$request->get_param( 'secret_key' ) );
|
234 |
Â
}
|
235 |
Â
|
236 |
Â
// test the secret key
|
245 |
Â
'https://api.stripe.com/v1/payment_methods',
|
246 |
Â
array(
|
247 |
Â
'headers' => array( 'Content-Type' => 'application/x-www-form-urlencoded' ),
|
248 |
+
'body' => array(
|
249 |
+
'key' => wc_stripe_get_publishable_key( $mode ),
|
250 |
+
'type' => 'card',
|
251 |
+
'card' => array(
|
252 |
+
'number' => '4242424242424242',
|
253 |
+
'exp_month' => 12,
|
254 |
+
'exp_year' => 2030,
|
255 |
+
'cvc' => 314
|
256 |
+
),
|
257 |
+
'metadata' => array(
|
258 |
+
'origin' => 'API Settings connection test'
|
259 |
+
)
|
260 |
+
),
|
261 |
Â
)
|
262 |
Â
);
|
263 |
Â
if ( is_wp_error( $response ) ) {
|
272 |
Â
update_option( $settings->get_option_key(), $settings->settings, 'yes' );
|
273 |
Â
}
|
274 |
Â
ob_get_clean();
|
275 |
+
}
|
276 |
+
catch ( Exception $e ) {
|
277 |
Â
return new WP_Error( 'connection-failure', $e->getMessage(), array( 'status' => 200 ) );
|
278 |
Â
}
|
279 |
Â
|
280 |
+
return rest_ensure_response( array(
|
281 |
+
'message' => sprintf( __( 'Connection test to Stripe was successful. Mode: %s.', 'woo-stripe-payment' ), $mode )
|
282 |
+
) );
|
283 |
Â
}
|
284 |
Â
|
285 |
Â
public function shop_manager_permission_check() {
|
287 |
Â
return true;
|
288 |
Â
}
|
289 |
Â
|
290 |
+
return new WP_Error( 'permission-error', __( 'You do not have permissions to access this resource.', 'woo-stripe-payment' ),
|
291 |
+
array( 'status' => 403 ) );
|
292 |
Â
}
|
293 |
+
|
294 |
Â
}
|
includes/controllers/class-wc-stripe-controller-source.php
CHANGED
@@ -55,7 +55,18 @@ class WC_Stripe_Controller_Source extends WC_Stripe_Rest_Controller {
|
|
55 |
Â
throw new Exception( __( 'You do not have permission to update this source.', 'woo-stripe-payment' ) );
|
56 |
Â
}
|
57 |
Â
//update the source
|
58 |
-
$
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
59 |
Â
if ( is_wp_error( $source ) ) {
|
60 |
Â
throw new Exception( __( 'Error updating source.', 'woo-stripe-payment' ) );
|
61 |
Â
}
|
55 |
Â
throw new Exception( __( 'You do not have permission to update this source.', 'woo-stripe-payment' ) );
|
56 |
Â
}
|
57 |
Â
//update the source
|
58 |
+
$updates = $request['updates'];
|
59 |
+
if ( WC()->cart ) {
|
60 |
+
$updates['amount'] = wc_stripe_add_number_precision( WC()->cart->total, strtoupper( $source->currency ) );
|
61 |
+
if ( 'stripe_klarna' === $payment_method->id ) {
|
62 |
+
unset( $updates['source_order']['items'] );
|
63 |
+
/**
|
64 |
+
* @var WC_Payment_Gateway_Stripe_Klarna $payment_method
|
65 |
+
*/
|
66 |
+
$payment_method->add_klarna_line_items_from_cart( $updates, WC()->cart, strtoupper( $source->currency ) );
|
67 |
+
}
|
68 |
+
}
|
69 |
+
$source = $payment_method->payment_object->get_gateway()->sources->update( $request['source_id'], $updates );
|
70 |
Â
if ( is_wp_error( $source ) ) {
|
71 |
Â
throw new Exception( __( 'Error updating source.', 'woo-stripe-payment' ) );
|
72 |
Â
}
|
includes/gateways/class-wc-payment-gateway-stripe-afterpay.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
Â
<?php
|
Â
|
|
2 |
Â
defined( 'ABSPATH' ) || exit();
|
3 |
Â
|
4 |
Â
if ( ! class_exists( 'WC_Payment_Gateway_Stripe_Local_Payment' ) ) {
|
@@ -42,7 +43,7 @@ class WC_Payment_Gateway_Stripe_Afterpay extends WC_Payment_Gateway_Stripe_Local
|
|
42 |
Â
}
|
43 |
Â
|
44 |
Â
public function get_local_payment_settings() {
|
45 |
-
|
46 |
Â
'charge_type' => array(
|
47 |
Â
'type' => 'select',
|
48 |
Â
'title' => __( 'Charge Type', 'woo-stripe-payment' ),
|
@@ -255,6 +256,11 @@ class WC_Payment_Gateway_Stripe_Afterpay extends WC_Payment_Gateway_Stripe_Local
|
|
255 |
Â
'desc_tip' => true
|
256 |
Â
)
|
257 |
Â
), parent::get_local_payment_settings() );
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
258 |
Â
}
|
259 |
Â
|
260 |
Â
public function enqueue_product_scripts( $scripts ) {
|
@@ -377,7 +383,9 @@ class WC_Payment_Gateway_Stripe_Afterpay extends WC_Payment_Gateway_Stripe_Local
|
|
377 |
Â
foreach ( $params as $currency => $param ) {
|
378 |
Â
if ( $param[0] === $country ) {
|
379 |
Â
$desc = sprintf( __( 'Store currency must be %s for Afterpay to show because your Stripe account is registered in %s. This is a requirement of Afterpay.',
|
380 |
-
'woo-stripe-payment' ),
|
Â
|
|
Â
|
|
381 |
Â
break;
|
382 |
Â
}
|
383 |
Â
}
|
@@ -388,9 +396,11 @@ class WC_Payment_Gateway_Stripe_Afterpay extends WC_Payment_Gateway_Stripe_Local
|
|
388 |
Â
|
389 |
Â
public function enqueue_mini_cart_scripts( $scripts ) {
|
390 |
Â
if ( ! wp_script_is( $scripts->get_handle( 'mini-cart' ) ) ) {
|
391 |
-
$scripts->enqueue_script( 'mini-cart',
|
Â
|
|
392 |
Â
apply_filters( 'wc_stripe_mini_cart_dependencies', array( $scripts->get_handle( 'wc-stripe' ) ), $scripts ) );
|
393 |
Â
}
|
394 |
Â
$scripts->localize_script( 'mini-cart', $this->get_localized_params( 'cart' ), 'wc_' . $this->id . '_mini_cart_params' );
|
395 |
Â
}
|
Â
|
|
396 |
Â
}
|
1 |
Â
<?php
|
2 |
+
|
3 |
Â
defined( 'ABSPATH' ) || exit();
|
4 |
Â
|
5 |
Â
if ( ! class_exists( 'WC_Payment_Gateway_Stripe_Local_Payment' ) ) {
|
43 |
Â
}
|
44 |
Â
|
45 |
Â
public function get_local_payment_settings() {
|
46 |
+
$settings = wp_parse_args( array(
|
47 |
Â
'charge_type' => array(
|
48 |
Â
'type' => 'select',
|
49 |
Â
'title' => __( 'Charge Type', 'woo-stripe-payment' ),
|
256 |
Â
'desc_tip' => true
|
257 |
Â
)
|
258 |
Â
), parent::get_local_payment_settings() );
|
259 |
+
|
260 |
+
// @todo maybe add this option back in a future version.
|
261 |
+
unset( $settings['title_text'] );
|
262 |
+
|
263 |
+
return $settings;
|
264 |
Â
}
|
265 |
Â
|
266 |
Â
public function enqueue_product_scripts( $scripts ) {
|
383 |
Â
foreach ( $params as $currency => $param ) {
|
384 |
Â
if ( $param[0] === $country ) {
|
385 |
Â
$desc = sprintf( __( 'Store currency must be %s for Afterpay to show because your Stripe account is registered in %s. This is a requirement of Afterpay.',
|
386 |
+
'woo-stripe-payment' ),
|
387 |
+
$currency,
|
388 |
+
$country );
|
389 |
Â
break;
|
390 |
Â
}
|
391 |
Â
}
|
396 |
Â
|
397 |
Â
public function enqueue_mini_cart_scripts( $scripts ) {
|
398 |
Â
if ( ! wp_script_is( $scripts->get_handle( 'mini-cart' ) ) ) {
|
399 |
+
$scripts->enqueue_script( 'mini-cart',
|
400 |
+
$scripts->assets_url( 'js/frontend/mini-cart.js' ),
|
401 |
Â
apply_filters( 'wc_stripe_mini_cart_dependencies', array( $scripts->get_handle( 'wc-stripe' ) ), $scripts ) );
|
402 |
Â
}
|
403 |
Â
$scripts->localize_script( 'mini-cart', $this->get_localized_params( 'cart' ), 'wc_' . $this->id . '_mini_cart_params' );
|
404 |
Â
}
|
405 |
+
|
406 |
Â
}
|
includes/gateways/class-wc-payment-gateway-stripe-cc.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
Â
<?php
|
Â
|
|
2 |
Â
defined( 'ABSPATH' ) || exit();
|
3 |
Â
|
4 |
Â
/**
|
@@ -90,8 +91,8 @@ class WC_Payment_Gateway_Stripe_CC extends WC_Payment_Gateway_Stripe {
|
|
90 |
Â
}
|
91 |
Â
|
92 |
Â
/**
|
93 |
-
* @return mixed|void
|
94 |
Â
* @since 3.3.0
|
Â
|
|
95 |
Â
*/
|
96 |
Â
public function get_card_custom_field_options() {
|
97 |
Â
$style = $this->get_form_style();
|
@@ -282,6 +283,8 @@ class WC_Payment_Gateway_Stripe_CC extends WC_Payment_Gateway_Stripe {
|
|
282 |
Â
} elseif ( $result ) {
|
283 |
Â
return $result;
|
284 |
Â
}
|
Â
|
|
Â
|
|
285 |
Â
}
|
286 |
Â
}
|
287 |
Â
|
@@ -290,7 +293,7 @@ class WC_Payment_Gateway_Stripe_CC extends WC_Payment_Gateway_Stripe {
|
|
290 |
Â
|
291 |
Â
/**
|
292 |
Â
* @param WC_Order $order
|
293 |
-
* @param string
|
294 |
Â
*
|
295 |
Â
* @return array
|
296 |
Â
*/
|
@@ -311,7 +314,6 @@ class WC_Payment_Gateway_Stripe_CC extends WC_Payment_Gateway_Stripe {
|
|
311 |
Â
);
|
312 |
Â
$this->add_stripe_order_args( $params, $order );
|
313 |
Â
$intent = $this->payment_object->get_gateway()->setupIntents->create( apply_filters( 'wc_stripe_setup_intent_params', $params, $order, $this ) );
|
314 |
-
|
315 |
Â
}
|
316 |
Â
if ( is_wp_error( $intent ) ) {
|
317 |
Â
return $intent;
|
@@ -338,4 +340,5 @@ class WC_Payment_Gateway_Stripe_CC extends WC_Payment_Gateway_Stripe {
|
|
338 |
Â
return false;
|
339 |
Â
}
|
340 |
Â
}
|
Â
|
|
341 |
Â
}
|
1 |
Â
<?php
|
2 |
+
|
3 |
Â
defined( 'ABSPATH' ) || exit();
|
4 |
Â
|
5 |
Â
/**
|
91 |
Â
}
|
92 |
Â
|
93 |
Â
/**
|
Â
|
|
94 |
Â
* @since 3.3.0
|
95 |
+
* @return mixed|void
|
96 |
Â
*/
|
97 |
Â
public function get_card_custom_field_options() {
|
98 |
Â
$style = $this->get_form_style();
|
283 |
Â
} elseif ( $result ) {
|
284 |
Â
return $result;
|
285 |
Â
}
|
286 |
+
} else {
|
287 |
+
$this->payment_method_token = $this->get_saved_source_id();
|
288 |
Â
}
|
289 |
Â
}
|
290 |
Â
|
293 |
Â
|
294 |
Â
/**
|
295 |
Â
* @param WC_Order $order
|
296 |
+
* @param string $payment_method
|
297 |
Â
*
|
298 |
Â
* @return array
|
299 |
Â
*/
|
314 |
Â
);
|
315 |
Â
$this->add_stripe_order_args( $params, $order );
|
316 |
Â
$intent = $this->payment_object->get_gateway()->setupIntents->create( apply_filters( 'wc_stripe_setup_intent_params', $params, $order, $this ) );
|
Â
|
|
317 |
Â
}
|
318 |
Â
if ( is_wp_error( $intent ) ) {
|
319 |
Â
return $intent;
|
340 |
Â
return false;
|
341 |
Â
}
|
342 |
Â
}
|
343 |
+
|
344 |
Â
}
|
includes/gateways/class-wc-payment-gateway-stripe-klarna.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
Â
<?php
|
Â
|
|
2 |
Â
defined( 'ABSPATH' ) || exit();
|
3 |
Â
|
4 |
Â
if ( ! class_exists( 'WC_Payment_Gateway_Stripe_Local_Payment' ) ) {
|
@@ -6,14 +7,14 @@ if ( ! class_exists( 'WC_Payment_Gateway_Stripe_Local_Payment' ) ) {
|
|
6 |
Â
}
|
7 |
Â
|
8 |
Â
/**
|
9 |
-
*
|
10 |
-
* @package Stripe/Gateways
|
11 |
-
* @author PaymentPlugins
|
12 |
Â
*
|
13 |
Â
*/
|
14 |
Â
class WC_Payment_Gateway_Stripe_Klarna extends WC_Payment_Gateway_Stripe_Local_Payment {
|
15 |
Â
|
16 |
-
|
Â
|
|
Â
|
|
17 |
Â
|
18 |
Â
public function __construct() {
|
19 |
Â
$this->local_payment_type = 'klarna';
|
@@ -21,13 +22,12 @@ class WC_Payment_Gateway_Stripe_Klarna extends WC_Payment_Gateway_Stripe_Local_P
|
|
21 |
Â
$this->countries = $this->limited_countries = array( 'US', 'AT', 'FI', 'DE', 'NL', 'DK', 'NO', 'SE', 'GB', 'BE', 'ES', 'IT' );
|
22 |
Â
$this->id = 'stripe_klarna';
|
23 |
Â
$this->tab_title = __( 'Klarna', 'woo-stripe-payment' );
|
24 |
-
$this->template_name = 'local-payment.php';
|
25 |
Â
$this->token_type = 'Stripe_Local';
|
26 |
Â
$this->method_title = __( 'Klarna', 'woo-stripe-payment' );
|
27 |
Â
$this->method_description = __( 'Klarna gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
|
28 |
Â
parent::__construct();
|
Â
|
|
29 |
Â
$this->icon = stripe_wc()->assets_url( 'img/' . $this->get_option( 'icon' ) . '.svg' );
|
30 |
-
$this->template_name = 'klarna.php';
|
31 |
Â
}
|
32 |
Â
|
33 |
Â
public function get_required_parameters() {
|
@@ -44,7 +44,7 @@ class WC_Payment_Gateway_Stripe_Klarna extends WC_Payment_Gateway_Stripe_Local_P
|
|
44 |
Â
/**
|
45 |
Â
* @param string $currency
|
46 |
Â
* @param string $billing_country
|
47 |
-
* @param float
|
48 |
Â
*
|
49 |
Â
* @return bool
|
50 |
Â
*/
|
@@ -58,22 +58,56 @@ class WC_Payment_Gateway_Stripe_Klarna extends WC_Payment_Gateway_Stripe_Local_P
|
|
58 |
Â
return false;
|
59 |
Â
}
|
60 |
Â
|
61 |
-
public function
|
62 |
-
|
63 |
-
'
|
64 |
-
|
65 |
-
|
Â
|
|
66 |
Â
}
|
67 |
Â
|
68 |
-
|
69 |
-
|
70 |
-
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
71 |
Â
}
|
72 |
Â
|
73 |
Â
public function get_local_payment_settings() {
|
74 |
Â
return wp_parse_args(
|
75 |
Â
array(
|
76 |
-
'charge_type'
|
77 |
Â
'type' => 'select',
|
78 |
Â
'title' => __( 'Charge Type', 'woo-stripe-payment' ),
|
79 |
Â
'default' => 'capture',
|
@@ -83,9 +117,10 @@ class WC_Payment_Gateway_Stripe_Klarna extends WC_Payment_Gateway_Stripe_Local_P
|
|
83 |
Â
'authorize' => __( 'Authorize', 'woo-stripe-payment' ),
|
84 |
Â
),
|
85 |
Â
'desc_tip' => true,
|
86 |
-
'description' => __( 'This option determines whether the customer\'s funds are captured immediately or authorized and can be captured at a later date.',
|
Â
|
|
87 |
Â
),
|
88 |
-
'icon'
|
89 |
Â
'title' => __( 'Icon', 'woo-stripe-payment' ),
|
90 |
Â
'type' => 'select',
|
91 |
Â
'options' => array(
|
@@ -95,286 +130,10 @@ class WC_Payment_Gateway_Stripe_Klarna extends WC_Payment_Gateway_Stripe_Local_P
|
|
95 |
Â
'default' => 'klarna_pink',
|
96 |
Â
'desc_tip' => true,
|
97 |
Â
'description' => __( 'This is the icon style that appears next to the gateway on the checkout page.', 'woo-stripe-payment' ),
|
98 |
-
),
|
99 |
-
'payment_categories' => array(
|
100 |
-
'title' => __( 'Payment Categories', 'woo-stripe-payment' ),
|
101 |
-
'type' => 'multiselect',
|
102 |
-
'class' => 'wc-enhanced-select',
|
103 |
-
'options' => $this->get_payment_categories(),
|
104 |
-
'default' => array_keys( $this->get_payment_categories() ),
|
105 |
-
'desc_tip' => true,
|
106 |
-
'description' => __(
|
107 |
-
'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.',
|
108 |
-
'woo-stripe-payment'
|
109 |
-
),
|
110 |
-
),
|
111 |
-
'label_translation' => array(
|
112 |
-
'title' => __( 'Use Stripe translation', 'woo-stripe-payment' ),
|
113 |
-
'type' => 'checkbox',
|
114 |
-
'default' => 'yes',
|
115 |
-
'desc_tip' => true,
|
116 |
-
'description' => __( 'If enabled, the payment option labels will use the Stripe translated text.', 'woo-stripe-payment' )
|
117 |
Â
)
|
118 |
Â
),
|
119 |
Â
parent::get_local_payment_settings()
|
120 |
Â
);
|
121 |
Â
}
|
122 |
Â
|
123 |
-
public function get_update_source_args( $order ) {
|
124 |
-
$args = array_merge( parent::get_update_source_args( $order ), $this->get_source_args( $order ) );
|
125 |
-
unset( $args['type'], $args['currency'], $args['statement_descriptor'], $args['redirect'], $args['klarna']['product'], $args['klarna']['locale'], $args['klarna']['custom_payment_methods'] );
|
126 |
-
|
127 |
-
return $args;
|
128 |
-
}
|
129 |
-
|
130 |
-
/**
|
131 |
-
* @return array
|
132 |
-
* @since 3.2.8
|
133 |
-
*/
|
134 |
-
public function get_klarna_args() {
|
135 |
-
global $wp;
|
136 |
-
if ( ! empty( $wp->query_vars['order-pay'] ) ) {
|
137 |
-
$details = wc_get_order( absint( $wp->query_vars['order-pay'] ) );
|
138 |
-
$currency = $details->get_currency();
|
139 |
-
$total = $details->get_total();
|
140 |
-
$needs_shipping = $details->needs_shipping_address();
|
141 |
-
} else {
|
142 |
-
$details = WC()->customer;
|
143 |
-
$currency = get_woocommerce_currency();
|
144 |
-
$total = WC()->cart->total;
|
145 |
-
$needs_shipping = WC()->cart->needs_shipping();
|
146 |
-
}
|
147 |
-
$args = array(
|
148 |
-
'type' => $this->local_payment_type,
|
149 |
-
'amount' => wc_stripe_add_number_precision( $total, $currency ),
|
150 |
-
'currency' => $currency,
|
151 |
-
//'statement_descriptor' => sprintf( __( 'Order %s', 'woo-stripe-payment' ), $order->get_order_number() ),
|
152 |
-
'owner' => array(
|
153 |
-
'name' => sprintf( '%s %s', $details->get_billing_first_name(), $details->get_billing_last_name() ),
|
154 |
-
'email' => $details->get_billing_email(),
|
155 |
-
'address' => array(
|
156 |
-
'city' => $details->get_billing_city(),
|
157 |
-
'country' => $details->get_billing_country(),
|
158 |
-
'line1' => $details->get_billing_address_1(),
|
159 |
-
'line2' => $details->get_billing_address_2(),
|
160 |
-
'postal_code' => $details->get_billing_postcode(),
|
161 |
-
'state' => $details->get_billing_state(),
|
162 |
-
)
|
163 |
-
),
|
164 |
-
'klarna' => array(
|
165 |
-
'product' => 'payment',
|
166 |
-
'purchase_country' => $details->get_billing_country(),
|
167 |
-
'first_name' => $details->get_billing_first_name(),
|
168 |
-
'last_name' => $details->get_billing_last_name(),
|
169 |
-
),
|
170 |
-
);
|
171 |
-
if ( 'US' === $details->get_billing_country() ) {
|
172 |
-
$args['klarna']['custom_payment_methods'] = 'payin4,installments';
|
173 |
-
}
|
174 |
-
$args['source_order'] = array();
|
175 |
-
|
176 |
-
if ( ( $locale = get_locale() ) ) {
|
177 |
-
if ( $locale == 'fi' ) {
|
178 |
-
$locale = 'fi-FI';
|
179 |
-
}
|
180 |
-
$args['klarna']['locale'] = str_replace( '_', '-', substr( $locale, 0, 5 ) );
|
181 |
-
}
|
182 |
-
|
183 |
-
if ( $needs_shipping ) {
|
184 |
-
$args['klarna']['shipping_first_name'] = $details->get_shipping_first_name();
|
185 |
-
$args['klarna']['shipping_last_name'] = $details->get_shipping_last_name();
|
186 |
-
$args['source_order']['shipping']['address'] = array(
|
187 |
-
'city' => $details->get_shipping_city(),
|
188 |
-
'country' => $details->get_shipping_country(),
|
189 |
-
'line1' => $details->get_shipping_address_1(),
|
190 |
-
'line2' => $details->get_shipping_address_2(),
|
191 |
-
'postal_code' => $details->get_shipping_postcode(),
|
192 |
-
'state' => $details->get_shipping_state(),
|
193 |
-
);
|
194 |
-
}
|
195 |
-
|
196 |
-
if ( $details instanceof WC_Order ) {
|
197 |
-
$this->add_klarna_line_items_from_order( $args, $details, $currency );
|
198 |
-
} else {
|
199 |
-
$this->add_klarna_line_items_from_cart( $args, WC()->cart, $currency );
|
200 |
-
}
|
201 |
-
|
202 |
-
return apply_filters( 'wc_stripe_get_klarna_args', $args, $this );
|
203 |
-
}
|
204 |
-
|
205 |
-
/**
|
206 |
-
* @param array $args
|
207 |
-
* @param WC_Cart $cart
|
208 |
-
* @param string $currency
|
209 |
-
*
|
210 |
-
* @since 3.2.15
|
211 |
-
*/
|
212 |
-
private function add_klarna_line_items_from_cart( &$args, $cart, $currency ) {
|
213 |
-
foreach ( $cart->get_cart_contents() as $item ) {
|
214 |
-
/**
|
215 |
-
*
|
216 |
-
* @var WC_Order_Item_Product $item
|
217 |
-
*/
|
218 |
-
$args['source_order']['items'][] = array(
|
219 |
-
'type' => 'sku',
|
220 |
-
'amount' => wc_stripe_add_number_precision( $item['line_subtotal'], $currency ),
|
221 |
-
'currency' => $currency,
|
222 |
-
'quantity' => $item['quantity'],
|
223 |
-
'description' => $item['data']->get_name(),
|
224 |
-
);
|
225 |
-
}
|
226 |
-
// shipping
|
227 |
-
if ( $cart->shipping_total ) {
|
228 |
-
$args['source_order']['items'][] = array(
|
229 |
-
'type' => 'shipping',
|
230 |
-
'amount' => wc_stripe_add_number_precision( $cart->shipping_total, $currency ),
|
231 |
-
'currency' => $currency,
|
232 |
-
'quantity' => 1,
|
233 |
-
'description' => __( 'Shipping', 'woo-stripe-payment' ),
|
234 |
-
);
|
235 |
-
}
|
236 |
-
// discount
|
237 |
-
if ( $cart->discount_cart ) {
|
238 |
-
$args['source_order']['items'][] = array(
|
239 |
-
'type' => 'discount',
|
240 |
-
'amount' => - 1 * wc_stripe_add_number_precision( $cart->discount_cart, $currency ),
|
241 |
-
'currency' => $currency,
|
242 |
-
'quantity' => 1,
|
243 |
-
'description' => __( 'Discount', 'woo-stripe-payment' ),
|
244 |
-
);
|
245 |
-
}
|
246 |
-
// fees
|
247 |
-
if ( 0 < $cart->fee_total ) {
|
248 |
-
$args['source_order']['items'][] = array(
|
249 |
-
'type' => 'sku',
|
250 |
-
'amount' => wc_stripe_add_number_precision( $cart->fee_total, $currency ),
|
251 |
-
'currency' => $currency,
|
252 |
-
'quantity' => 1,
|
253 |
-
'description' => __( 'Fee total', 'woo-stripe-payment' ),
|
254 |
-
);
|
255 |
-
}
|
256 |
-
// tax
|
257 |
-
if ( 0 < $cart->get_total_tax() ) {
|
258 |
-
$args['source_order']['items'][] = array(
|
259 |
-
'type' => 'tax',
|
260 |
-
'amount' => wc_stripe_add_number_precision( $cart->get_total_tax(), $currency ),
|
261 |
-
'description' => __( 'Tax', 'woo-stripe-payment' ),
|
262 |
-
'quantity' => 1,
|
263 |
-
'currency' => $currency,
|
264 |
-
);
|
265 |
-
}
|
266 |
-
}
|
267 |
-
|
268 |
-
/**
|
269 |
-
* @param array $args
|
270 |
-
* @param WC_Order $order
|
271 |
-
* @param string $currency
|
272 |
-
*/
|
273 |
-
private function add_klarna_line_items_from_order( &$args, $order, $currency ) {
|
274 |
-
foreach ( $order->get_items( 'line_item' ) as $item ) {
|
275 |
-
/**
|
276 |
-
*
|
277 |
-
* @var WC_Order_Item_Product $item
|
278 |
-
*/
|
279 |
-
$args['source_order']['items'][] = array(
|
280 |
-
'type' => 'sku',
|
281 |
-
'amount' => wc_stripe_add_number_precision( $item->get_subtotal(), $currency ),
|
282 |
-
'currency' => $order->get_currency(),
|
283 |
-
'quantity' => $item->get_quantity(),
|
284 |
-
'description' => $item->get_name(),
|
285 |
-
);
|
286 |
-
}
|
287 |
-
// shipping
|
288 |
-
if ( 0 < $order->get_shipping_total() ) {
|
289 |
-
$args['source_order']['items'][] = array(
|
290 |
-
'type' => 'shipping',
|
291 |
-
'amount' => wc_stripe_add_number_precision( $order->get_shipping_total(), $currency ),
|
292 |
-
'currency' => $order->get_currency(),
|
293 |
-
'quantity' => 1,
|
294 |
-
'description' => __( 'Shipping', 'woo-stripe-payment' ),
|
295 |
-
);
|
296 |
-
}
|
297 |
-
// discount
|
298 |
-
if ( 0 < $order->get_discount_total() ) {
|
299 |
-
$args['source_order']['items'][] = array(
|
300 |
-
'type' => 'discount',
|
301 |
-
'amount' => - 1 * wc_stripe_add_number_precision( $order->get_discount_total(), $currency ),
|
302 |
-
'currency' => $order->get_currency(),
|
303 |
-
'quantity' => 1,
|
304 |
-
'description' => __( 'Discount', 'woo-stripe-payment' ),
|
305 |
-
);
|
306 |
-
}
|
307 |
-
// fees
|
308 |
-
if ( $order->get_fees() ) {
|
309 |
-
$fee_total = 0;
|
310 |
-
foreach ( $order->get_fees() as $fee ) {
|
311 |
-
$fee_total += wc_stripe_add_number_precision( $fee->get_total(), $currency );
|
312 |
-
}
|
313 |
-
$args['source_order']['items'][] = array(
|
314 |
-
'type' => 'sku',
|
315 |
-
'amount' => $fee_total,
|
316 |
-
'currency' => $order->get_currency(),
|
317 |
-
'quantity' => 1,
|
318 |
-
'description' => __( 'Fee', 'woo-stripe-payment' ),
|
319 |
-
);
|
320 |
-
}
|
321 |
-
// tax
|
322 |
-
if ( 0 < $order->get_total_tax() ) {
|
323 |
-
$args['source_order']['items'][] = array(
|
324 |
-
'type' => 'tax',
|
325 |
-
'amount' => wc_stripe_add_number_precision( $order->get_total_tax() ),
|
326 |
-
'description' => __( 'Tax', 'woo-stripe-payment' ),
|
327 |
-
'quantity' => 1,
|
328 |
-
'currency' => $order->get_currency(),
|
329 |
-
);
|
330 |
-
}
|
331 |
-
}
|
332 |
-
|
333 |
-
/**
|
334 |
-
*
|
335 |
-
* {@inheritDoc}
|
336 |
-
*
|
337 |
-
* @see WC_Payment_Gateway_Stripe_Local_Payment::get_source_redirect_url()
|
338 |
-
*/
|
339 |
-
public function get_source_redirect_url( $source, $order ) {
|
340 |
-
$order->update_status( 'on-hold' );
|
341 |
-
|
342 |
-
return $order->get_checkout_order_received_url();
|
343 |
-
}
|
344 |
-
|
345 |
-
/**
|
346 |
-
*
|
347 |
-
* @return mixed
|
348 |
-
*/
|
349 |
-
public function get_payment_categories() {
|
350 |
-
return apply_filters(
|
351 |
-
'wc_stripe_klarna_payment_categries',
|
352 |
-
array(
|
353 |
-
'pay_now' => __( 'Pay Now', 'woo-stripe-payment' ),
|
354 |
-
'pay_later' => __( 'Pay Later', 'woo-stripe-payment' ),
|
355 |
-
'pay_over_time' => __( 'Pay Over Time', 'woo-stripe-payment' ),
|
356 |
-
)
|
357 |
-
);
|
358 |
-
}
|
359 |
-
|
360 |
-
/**
|
361 |
-
*
|
362 |
-
* {@inheritDoc}
|
363 |
-
*
|
364 |
-
* @see WC_Payment_Gateway_Stripe_Local_Payment::get_payment_description()
|
365 |
-
*/
|
366 |
-
public function get_payment_description() {
|
367 |
-
return '<p>' .
|
368 |
-
sprintf( __( 'Click %1$shere%2$s for Klarna test payment methods.', 'woo-stripe-payment' ), '<a target="_blank" href="https://stripe.com/docs/sources/klarna#testing-klarna-payments">', '</a>' ) .
|
369 |
-
'</p>' . parent::get_payment_description();
|
370 |
-
}
|
371 |
-
|
372 |
-
public function get_localized_params() {
|
373 |
-
$params = parent::get_localized_params();
|
374 |
-
$params['messages']['klarna_error'] = __( 'Your purchase is not approved.', 'woo-stripe-payment' );
|
375 |
-
$params['klarna_loader'] = '<div class="wc-stripe-klarna-loader"><div></div><div></div><div></div></div>';
|
376 |
-
$params['translate'] = $this->is_active( 'label_translation' );
|
377 |
-
|
378 |
-
return $params;
|
379 |
-
}
|
380 |
Â
}
|
1 |
Â
<?php
|
2 |
+
|
3 |
Â
defined( 'ABSPATH' ) || exit();
|
4 |
Â
|
5 |
Â
if ( ! class_exists( 'WC_Payment_Gateway_Stripe_Local_Payment' ) ) {
|
7 |
Â
}
|
8 |
Â
|
9 |
Â
/**
|
10 |
+
* Class WC_Payment_Gateway_Stripe_Klarna
|
Â
|
|
Â
|
|
11 |
Â
*
|
12 |
Â
*/
|
13 |
Â
class WC_Payment_Gateway_Stripe_Klarna extends WC_Payment_Gateway_Stripe_Local_Payment {
|
14 |
Â
|
15 |
+
protected $payment_method_type = 'klarna';
|
16 |
+
|
17 |
+
use WC_Stripe_Local_Payment_Intent_Trait;
|
18 |
Â
|
19 |
Â
public function __construct() {
|
20 |
Â
$this->local_payment_type = 'klarna';
|
22 |
Â
$this->countries = $this->limited_countries = array( 'US', 'AT', 'FI', 'DE', 'NL', 'DK', 'NO', 'SE', 'GB', 'BE', 'ES', 'IT' );
|
23 |
Â
$this->id = 'stripe_klarna';
|
24 |
Â
$this->tab_title = __( 'Klarna', 'woo-stripe-payment' );
|
Â
|
|
25 |
Â
$this->token_type = 'Stripe_Local';
|
26 |
Â
$this->method_title = __( 'Klarna', 'woo-stripe-payment' );
|
27 |
Â
$this->method_description = __( 'Klarna gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
|
28 |
Â
parent::__construct();
|
29 |
+
$this->template_name = 'klarna-v2.php';
|
30 |
Â
$this->icon = stripe_wc()->assets_url( 'img/' . $this->get_option( 'icon' ) . '.svg' );
|
Â
|
|
31 |
Â
}
|
32 |
Â
|
33 |
Â
public function get_required_parameters() {
|
44 |
Â
/**
|
45 |
Â
* @param string $currency
|
46 |
Â
* @param string $billing_country
|
47 |
+
* @param float $total
|
48 |
Â
*
|
49 |
Â
* @return bool
|
50 |
Â
*/
|
58 |
Â
return false;
|
59 |
Â
}
|
60 |
Â
|
61 |
+
public function add_stripe_order_args( &$args, $order ) {
|
62 |
+
$args['payment_method_options'] = array(
|
63 |
+
'klarna' => array(
|
64 |
+
'preferred_locale' => $this->get_formatted_locale_from_order( $order )
|
65 |
+
)
|
66 |
+
);
|
67 |
Â
}
|
68 |
Â
|
69 |
+
/**
|
70 |
+
* Returns a formatted locale based on the billing country for the order.
|
71 |
+
*
|
72 |
+
* @param WC_Order $order
|
73 |
+
*
|
74 |
+
* @return string
|
75 |
+
*/
|
76 |
+
private function get_formatted_locale_from_order( $order ) {
|
77 |
+
$country = $order->get_billing_country();
|
78 |
+
switch ( $country ) {
|
79 |
+
case 'US':
|
80 |
+
$locale = 'en-US';
|
81 |
+
break;
|
82 |
+
case 'GB':
|
83 |
+
$locale = 'en-GB';
|
84 |
+
break;
|
85 |
+
case 'AT':
|
86 |
+
$locale = 'de-AT';
|
87 |
+
break;
|
88 |
+
case 'BE':
|
89 |
+
$locale = 'fr-BE';
|
90 |
+
break;
|
91 |
+
case 'DK':
|
92 |
+
$locale = 'da-DK';
|
93 |
+
break;
|
94 |
+
case 'NO':
|
95 |
+
$locale = 'nb-NO';
|
96 |
+
break;
|
97 |
+
case 'SE':
|
98 |
+
$locale = 'sv-SE';
|
99 |
+
break;
|
100 |
+
default:
|
101 |
+
$locale = strtolower( $country ) . '-' . strtoupper( $country );
|
102 |
+
}
|
103 |
+
|
104 |
+
return $locale;
|
105 |
Â
}
|
106 |
Â
|
107 |
Â
public function get_local_payment_settings() {
|
108 |
Â
return wp_parse_args(
|
109 |
Â
array(
|
110 |
+
'charge_type' => array(
|
111 |
Â
'type' => 'select',
|
112 |
Â
'title' => __( 'Charge Type', 'woo-stripe-payment' ),
|
113 |
Â
'default' => 'capture',
|
117 |
Â
'authorize' => __( 'Authorize', 'woo-stripe-payment' ),
|
118 |
Â
),
|
119 |
Â
'desc_tip' => true,
|
120 |
+
'description' => __( 'This option determines whether the customer\'s funds are captured immediately or authorized and can be captured at a later date.',
|
121 |
+
'woo-stripe-payment' ),
|
122 |
Â
),
|
123 |
+
'icon' => array(
|
124 |
Â
'title' => __( 'Icon', 'woo-stripe-payment' ),
|
125 |
Â
'type' => 'select',
|
126 |
Â
'options' => array(
|
130 |
Â
'default' => 'klarna_pink',
|
131 |
Â
'desc_tip' => true,
|
132 |
Â
'description' => __( 'This is the icon style that appears next to the gateway on the checkout page.', 'woo-stripe-payment' ),
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
133 |
Â
)
|
134 |
Â
),
|
135 |
Â
parent::get_local_payment_settings()
|
136 |
Â
);
|
137 |
Â
}
|
138 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
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Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
139 |
Â
}
|
includes/gateways/settings/ach-settings.php
CHANGED
@@ -1,9 +1,13 @@
|
|
1 |
Â
<?php
|
Â
|
|
2 |
Â
return array(
|
3 |
Â
'desc' => array(
|
4 |
Â
'type' => 'description',
|
5 |
Â
'description' => sprintf( '<div>%s</div>', __( 'For US customers only.', 'woo-stripe-payment' ) ) .
|
6 |
-
sprintf( '<p>%s</p>',
|
Â
|
|
Â
|
|
Â
|
|
7 |
Â
),
|
8 |
Â
'enabled' => array(
|
9 |
Â
'title' => __( 'Enabled', 'woo-stripe-payment' ),
|
@@ -103,6 +107,16 @@ return array(
|
|
103 |
Â
'desc_tip' => true,
|
104 |
Â
'description' => __( 'This option allows you to customize how the credit card will display for your customers on orders, subscriptions, etc.' ),
|
105 |
Â
),
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
106 |
Â
'fee' => array(
|
107 |
Â
'title' => __( 'ACH Fee', 'woo-stripe-payment' ),
|
108 |
Â
'type' => 'ach_fee',
|
1 |
Â
<?php
|
2 |
+
|
3 |
Â
return array(
|
4 |
Â
'desc' => array(
|
5 |
Â
'type' => 'description',
|
6 |
Â
'description' => sprintf( '<div>%s</div>', __( 'For US customers only.', 'woo-stripe-payment' ) ) .
|
7 |
+
sprintf( '<p>%s</p>',
|
8 |
+
sprintf( __( 'Read through our %1$sdocumentation%2$s to configure ACH payments', 'woo-stripe-payment' ),
|
9 |
+
'<a target="_blank" href="https://docs.paymentplugins.com/wc-stripe/config/#/stripe_ach">',
|
10 |
+
'</a>' ) ),
|
11 |
Â
),
|
12 |
Â
'enabled' => array(
|
13 |
Â
'title' => __( 'Enabled', 'woo-stripe-payment' ),
|
107 |
Â
'desc_tip' => true,
|
108 |
Â
'description' => __( 'This option allows you to customize how the credit card will display for your customers on orders, subscriptions, etc.' ),
|
109 |
Â
),
|
110 |
+
'order_status' => array(
|
111 |
+
'type' => 'select',
|
112 |
+
'title' => __( 'Order Status', 'woo-stripe-payment' ),
|
113 |
+
'default' => 'default',
|
114 |
+
'class' => 'wc-enhanced-select',
|
115 |
+
'options' => array_merge( array( 'default' => __( 'Default', 'woo-stripe-payment' ) ), wc_get_order_statuses() ),
|
116 |
+
'tool_tip' => true,
|
117 |
+
'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.',
|
118 |
+
'woo-stripe-payment' ),
|
119 |
+
),
|
120 |
Â
'fee' => array(
|
121 |
Â
'title' => __( 'ACH Fee', 'woo-stripe-payment' ),
|
122 |
Â
'type' => 'ach_fee',
|
includes/traits/wc-stripe-payment-traits.php
CHANGED
@@ -1,10 +1,11 @@
|
|
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 {
|
@@ -28,7 +29,7 @@ trait WC_Stripe_Payment_Intent_Trait {
|
|
28 |
Â
/**
|
29 |
Â
*
|
30 |
Â
* @param \Stripe\PaymentIntent $intent
|
31 |
-
* @param WC_Order
|
32 |
Â
*/
|
33 |
Â
public function get_payment_intent_checkout_url( $intent, $order, $type = 'intent' ) {
|
34 |
Â
global $wp;
|
@@ -53,17 +54,18 @@ trait WC_Stripe_Payment_Intent_Trait {
|
|
53 |
Â
|
54 |
Â
/**
|
55 |
Â
* @param \Stripe\PaymentIntent $intent
|
56 |
-
* @param WC_Order
|
57 |
Â
*/
|
58 |
Â
public function get_payment_intent_confirmation_args( $intent, $order ) {
|
59 |
Â
return array();
|
60 |
Â
}
|
Â
|
|
61 |
Â
}
|
62 |
Â
|
63 |
Â
/**
|
64 |
Â
*
|
65 |
-
* @author Payment Plugins
|
66 |
Â
* @since 3.1.0
|
Â
|
|
67 |
Â
* @package Stripe/Trait
|
68 |
Â
*/
|
69 |
Â
trait WC_Stripe_Payment_Charge_Trait {
|
@@ -71,12 +73,13 @@ trait WC_Stripe_Payment_Charge_Trait {
|
|
71 |
Â
public function get_payment_object() {
|
72 |
Â
return WC_Stripe_Payment_Factory::load( 'charge', $this, WC_Stripe_Gateway::load() );
|
73 |
Â
}
|
Â
|
|
74 |
Â
}
|
75 |
Â
|
76 |
Â
/**
|
77 |
Â
*
|
78 |
-
* @author Payment Plugins
|
79 |
Â
* @since 3.1.0
|
Â
|
|
80 |
Â
* @package Stripe/Trait
|
81 |
Â
*/
|
82 |
Â
trait WC_Stripe_Local_Payment_Charge_Trait {
|
@@ -84,12 +87,13 @@ trait WC_Stripe_Local_Payment_Charge_Trait {
|
|
84 |
Â
public function get_payment_object() {
|
85 |
Â
return WC_Stripe_Payment_Factory::load( 'local_charge', $this, WC_Stripe_Gateway::load() );
|
86 |
Â
}
|
Â
|
|
87 |
Â
}
|
88 |
Â
|
89 |
Â
/**
|
90 |
Â
*
|
91 |
-
* @author Payment Plugins
|
92 |
Â
* @since 3.1.0
|
Â
|
|
93 |
Â
* @package Stripe/Trait
|
94 |
Â
*
|
95 |
Â
*/
|
@@ -100,7 +104,7 @@ trait WC_Stripe_Local_Payment_Intent_Trait {
|
|
100 |
Â
/**
|
101 |
Â
*
|
102 |
Â
* @param \Stripe\PaymentIntent $secret
|
103 |
-
* @param WC_Order
|
104 |
Â
*/
|
105 |
Â
public function get_payment_intent_checkout_url( $intent, $order, $type = 'intent' ) {
|
106 |
Â
// rand is used to generate some random entropy so that window hash events are triggered.
|
@@ -133,11 +137,12 @@ trait WC_Stripe_Local_Payment_Intent_Trait {
|
|
133 |
Â
|
134 |
Â
/**
|
135 |
Â
* @param \Stripe\PaymentIntent $intent
|
136 |
-
* @param WC_Order
|
137 |
Â
*/
|
138 |
Â
public function get_payment_intent_confirmation_args( $intent, $order ) {
|
139 |
Â
return array(
|
140 |
Â
'return_url' => $this->get_local_payment_return_url( $order )
|
141 |
Â
);
|
142 |
Â
}
|
Â
|
|
143 |
Â
}
|
1 |
Â
<?php
|
2 |
+
|
3 |
Â
defined( 'ABSPATH' ) || exit();
|
4 |
Â
|
5 |
Â
/**
|
6 |
Â
*
|
Â
|
|
7 |
Â
* @since 3.1.0
|
8 |
+
* @author Payment Plugins
|
9 |
Â
* @package Stripe/Trait
|
10 |
Â
*/
|
11 |
Â
trait WC_Stripe_Payment_Intent_Trait {
|
29 |
Â
/**
|
30 |
Â
*
|
31 |
Â
* @param \Stripe\PaymentIntent $intent
|
32 |
+
* @param WC_Order $order
|
33 |
Â
*/
|
34 |
Â
public function get_payment_intent_checkout_url( $intent, $order, $type = 'intent' ) {
|
35 |
Â
global $wp;
|
54 |
Â
|
55 |
Â
/**
|
56 |
Â
* @param \Stripe\PaymentIntent $intent
|
57 |
+
* @param WC_Order $order
|
58 |
Â
*/
|
59 |
Â
public function get_payment_intent_confirmation_args( $intent, $order ) {
|
60 |
Â
return array();
|
61 |
Â
}
|
62 |
+
|
63 |
Â
}
|
64 |
Â
|
65 |
Â
/**
|
66 |
Â
*
|
Â
|
|
67 |
Â
* @since 3.1.0
|
68 |
+
* @author Payment Plugins
|
69 |
Â
* @package Stripe/Trait
|
70 |
Â
*/
|
71 |
Â
trait WC_Stripe_Payment_Charge_Trait {
|
73 |
Â
public function get_payment_object() {
|
74 |
Â
return WC_Stripe_Payment_Factory::load( 'charge', $this, WC_Stripe_Gateway::load() );
|
75 |
Â
}
|
76 |
+
|
77 |
Â
}
|
78 |
Â
|
79 |
Â
/**
|
80 |
Â
*
|
Â
|
|
81 |
Â
* @since 3.1.0
|
82 |
+
* @author Payment Plugins
|
83 |
Â
* @package Stripe/Trait
|
84 |
Â
*/
|
85 |
Â
trait WC_Stripe_Local_Payment_Charge_Trait {
|
87 |
Â
public function get_payment_object() {
|
88 |
Â
return WC_Stripe_Payment_Factory::load( 'local_charge', $this, WC_Stripe_Gateway::load() );
|
89 |
Â
}
|
90 |
+
|
91 |
Â
}
|
92 |
Â
|
93 |
Â
/**
|
94 |
Â
*
|
Â
|
|
95 |
Â
* @since 3.1.0
|
96 |
+
* @author Payment Plugins
|
97 |
Â
* @package Stripe/Trait
|
98 |
Â
*
|
99 |
Â
*/
|
104 |
Â
/**
|
105 |
Â
*
|
106 |
Â
* @param \Stripe\PaymentIntent $secret
|
107 |
+
* @param WC_Order $order
|
108 |
Â
*/
|
109 |
Â
public function get_payment_intent_checkout_url( $intent, $order, $type = 'intent' ) {
|
110 |
Â
// rand is used to generate some random entropy so that window hash events are triggered.
|
137 |
Â
|
138 |
Â
/**
|
139 |
Â
* @param \Stripe\PaymentIntent $intent
|
140 |
+
* @param WC_Order $order
|
141 |
Â
*/
|
142 |
Â
public function get_payment_intent_confirmation_args( $intent, $order ) {
|
143 |
Â
return array(
|
144 |
Â
'return_url' => $this->get_local_payment_return_url( $order )
|
145 |
Â
);
|
146 |
Â
}
|
147 |
+
|
148 |
Â
}
|
includes/traits/wc-stripe-settings-trait.php
CHANGED
@@ -1,11 +1,12 @@
|
|
1 |
Â
<?php
|
Â
|
|
2 |
Â
defined( 'ABSPATH' ) || exit();
|
3 |
Â
|
4 |
Â
/**
|
5 |
Â
*
|
6 |
-
* @author Payment Plugins
|
7 |
Â
* @since 3.1.0
|
8 |
Â
*
|
Â
|
|
9 |
Â
*/
|
10 |
Â
trait WC_Stripe_Settings_Trait {
|
11 |
Â
|
@@ -20,7 +21,7 @@ trait WC_Stripe_Settings_Trait {
|
|
20 |
Â
}
|
21 |
Â
|
22 |
Â
public function is_active( $key ) {
|
23 |
-
return $this->get_option( $key )
|
24 |
Â
}
|
25 |
Â
|
26 |
Â
public function admin_options() {
|
@@ -198,7 +199,8 @@ trait WC_Stripe_Settings_Trait {
|
|
198 |
Â
if ( ! in_array( $this->get_field_type( $field ), $skip_types ) && ! $skip ) {
|
199 |
Â
try {
|
200 |
Â
$this->settings[ $key ] = $this->get_field_value( $key, $field, $post_data );
|
201 |
-
}
|
Â
|
|
202 |
Â
$this->add_error( $e->getMessage() );
|
203 |
Â
}
|
204 |
Â
}
|
@@ -214,4 +216,5 @@ trait WC_Stripe_Settings_Trait {
|
|
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 |
Â
}
|
1 |
Â
<?php
|
2 |
+
|
3 |
Â
defined( 'ABSPATH' ) || exit();
|
4 |
Â
|
5 |
Â
/**
|
6 |
Â
*
|
Â
|
|
7 |
Â
* @since 3.1.0
|
8 |
Â
*
|
9 |
+
* @author Payment Plugins
|
10 |
Â
*/
|
11 |
Â
trait WC_Stripe_Settings_Trait {
|
12 |
Â
|
21 |
Â
}
|
22 |
Â
|
23 |
Â
public function is_active( $key ) {
|
24 |
+
return wc_string_to_bool( $this->get_option( $key ) );
|
25 |
Â
}
|
26 |
Â
|
27 |
Â
public function admin_options() {
|
199 |
Â
if ( ! in_array( $this->get_field_type( $field ), $skip_types ) && ! $skip ) {
|
200 |
Â
try {
|
201 |
Â
$this->settings[ $key ] = $this->get_field_value( $key, $field, $post_data );
|
202 |
+
}
|
203 |
+
catch ( Exception $e ) {
|
204 |
Â
$this->add_error( $e->getMessage() );
|
205 |
Â
}
|
206 |
Â
}
|
216 |
Â
public function validate_multi_select_countries_field( $key, $value ) {
|
217 |
Â
return is_array( $value ) ? array_map( 'wc_clean', array_map( 'stripslashes', $value ) ) : '';
|
218 |
Â
}
|
219 |
+
|
220 |
Â
}
|
includes/updates/update-3.3.13.php
ADDED
@@ -0,0 +1,79 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
defined( 'ABSPATH' ) || exit();
|
4 |
+
|
5 |
+
/**
|
6 |
+
* @param \WC_Settings_API $settings
|
7 |
+
* @param $key
|
8 |
+
* @param $value
|
9 |
+
*/
|
10 |
+
function wc_stripe_update_option_3_3_13( $settings, $key, $value ) {
|
11 |
+
if ( method_exists( $settings, 'update_option' ) ) {
|
12 |
+
$settings->update_option( $key, $value );
|
13 |
+
} else {
|
14 |
+
$settings->settings[ $key ] = $value;
|
15 |
+
update_option( $settings->get_option_key(), $settings->settings );
|
16 |
+
}
|
17 |
+
}
|
18 |
+
|
19 |
+
// transfer email option to the advanced settings
|
20 |
+
wc_stripe_update_option_3_3_13( stripe_wc()->advanced_settings, 'email_enabled', get_option( 'woocommerce_stripe_email_receipt', 'no' ) );
|
21 |
+
delete_option( 'woocommerce_stripe_email_receipt' );
|
22 |
+
|
23 |
+
// Add the webhook ID to the plugin so the webhook can be updated with the new events
|
24 |
+
/**
|
25 |
+
* @var \WC_Stripe_API_Settings $settings
|
26 |
+
*/
|
27 |
+
$settings = stripe_wc()->api_settings;
|
28 |
+
$client = WC_Stripe_Gateway::load();
|
29 |
+
$url = get_rest_url( null, '/wc-stripe/v1/webhook' );
|
30 |
+
|
31 |
+
foreach ( array( 'live', 'test' ) as $mode ) {
|
32 |
+
$webhook_id = $settings->get_webhook_id( $mode );
|
33 |
+
if ( ! $webhook_id ) {
|
34 |
+
//webhook ID isn't in settings so fetch webhooks and find this plugin's webhook.
|
35 |
+
// Once found, add it to the API Settings
|
36 |
+
$webhooks = $client->mode( $mode )->webhookEndpoints->all( array( 'limit' => 50 ) );
|
37 |
+
if ( ! is_wp_error( $webhooks ) ) {
|
38 |
+
foreach ( $webhooks->data as $webhook ) {
|
39 |
+
/**
|
40 |
+
* @var \Stripe\WebhookEndpoint $webhook
|
41 |
+
*/
|
42 |
+
if ( $webhook->url === $url ) {
|
43 |
+
wc_stripe_update_option_3_3_13( $settings, "webhook_id_{$mode}", $webhook->id );
|
44 |
+
$webhook_id = $webhook->id;
|
45 |
+
wc_stripe_log_info( sprintf( 'Webhook %1$s saved in settings. Mode: %2$s', $webhook_id, $mode ) );
|
46 |
+
break;
|
47 |
+
}
|
48 |
+
}
|
49 |
+
} else {
|
50 |
+
wc_stripe_log_error( sprintf( 'Error fetching webhooks during version 3.1.3 update. Reason: %s', $webhooks->get_error_message() ) );
|
51 |
+
}
|
52 |
+
}
|
53 |
+
|
54 |
+
if ( $webhook_id ) {
|
55 |
+
// update the webhook with all the new events
|
56 |
+
$webhook = $client->mode( $mode )->webhookEndpoints->retrieve( $webhook_id );
|
57 |
+
if ( ! is_wp_error( $webhook ) ) {
|
58 |
+
if ( ! in_array( '*', $webhook->enabled_events ) ) {
|
59 |
+
$webhook = $client->mode( $mode )->webhookEndpoints->update( $webhook_id, array(
|
60 |
+
'url' => $url,
|
61 |
+
'enabled_events' => array_values( array_unique( array_merge( array(
|
62 |
+
'charge.failed',
|
63 |
+
'charge.succeeded',
|
64 |
+
'source.chargeable',
|
65 |
+
'payment_intent.succeeded',
|
66 |
+
'charge.refunded',
|
67 |
+
'charge.dispute.created',
|
68 |
+
'charge.dispute.closed',
|
69 |
+
'review.opened',
|
70 |
+
'review.closed'
|
71 |
+
), $webhook->enabled_events ) ) )
|
72 |
+
) );
|
73 |
+
if ( is_wp_error( $webhook ) ) {
|
74 |
+
wc_stripe_log_error( sprintf( 'Error updating Stripe webhook. Mode: %1$s. Reason: %2$s', $mode, $webhook->get_error_message() ) );
|
75 |
+
}
|
76 |
+
}
|
77 |
+
}
|
78 |
+
}
|
79 |
+
}
|
includes/wc-stripe-functions.php
CHANGED
@@ -1,10 +1,11 @@
|
|
1 |
Â
<?php
|
Â
|
|
2 |
Â
defined( 'ABSPATH' ) || exit();
|
3 |
Â
|
4 |
Â
/**
|
5 |
Â
*
|
6 |
Â
* @param string $template_name
|
7 |
-
* @param array
|
8 |
Â
*
|
9 |
Â
* @since 3.0.0
|
10 |
Â
* @package Stripe/Functions
|
@@ -20,10 +21,10 @@ function wc_stripe_get_template( $template_name, $args = array() ) {
|
|
20 |
Â
* Wrapper for wc_get_template_html that returns Stripe specififc templates in an html string.
|
21 |
Â
*
|
22 |
Â
* @param string $template_name
|
23 |
-
* @param array
|
24 |
Â
*
|
25 |
-
* @return string
|
26 |
Â
* @since 3.0.0
|
Â
|
|
27 |
Â
* @package Stripe/Functions
|
28 |
Â
*/
|
29 |
Â
function wc_stripe_get_template_html( $template_name, $args = array() ) {
|
@@ -115,8 +116,8 @@ function wc_stripe_get_publishable_key( $mode = '' ) {
|
|
115 |
Â
/**
|
116 |
Â
* Return the merchant's Stripe account.
|
117 |
Â
*
|
118 |
-
* @return string
|
119 |
Â
* @since 3.1.4
|
Â
|
|
120 |
Â
* @package Stripe/Functions
|
121 |
Â
*/
|
122 |
Â
function wc_stripe_get_account_id() {
|
@@ -126,11 +127,11 @@ function wc_stripe_get_account_id() {
|
|
126 |
Â
/**
|
127 |
Â
* Return the stripe customer ID
|
128 |
Â
*
|
129 |
-
* @param int
|
130 |
Â
* @param string $mode
|
131 |
Â
*
|
132 |
-
* @package Stripe/Functions
|
133 |
Â
* @since 3.0.0
|
Â
|
|
134 |
Â
*/
|
135 |
Â
function wc_stripe_get_customer_id( $user_id = '', $mode = '' ) {
|
136 |
Â
$mode = empty( $mode ) ? wc_stripe_mode() : $mode;
|
@@ -143,7 +144,7 @@ function wc_stripe_get_customer_id( $user_id = '', $mode = '' ) {
|
|
143 |
Â
|
144 |
Â
/**
|
145 |
Â
* @param string
|
146 |
-
* @param int
|
147 |
Â
* @param string $mode
|
148 |
Â
*
|
149 |
Â
* @since 3.2.12
|
@@ -154,7 +155,7 @@ function wc_stripe_get_customer_id( $user_id = '', $mode = '' ) {
|
|
154 |
Â
/**
|
155 |
Â
*
|
156 |
Â
* @param string $customer_id
|
157 |
-
* @param int
|
158 |
Â
* @param string $mode
|
159 |
Â
*
|
160 |
Â
* @package Stripe/Functions
|
@@ -166,9 +167,9 @@ function wc_stripe_save_customer( $customer_id, $user_id, $mode = '' ) {
|
|
166 |
Â
}
|
167 |
Â
|
168 |
Â
/**
|
169 |
-
* @param int
|
170 |
Â
* @param string $mode
|
171 |
-
* @param bool
|
172 |
Â
*
|
173 |
Â
* @since 3.2.13
|
174 |
Â
*/
|
@@ -179,7 +180,7 @@ function wc_stripe_delete_customer( $user_id, $mode = '', $global = false ) {
|
|
179 |
Â
|
180 |
Â
/**
|
181 |
Â
*
|
182 |
-
* @param int
|
183 |
Â
* @param WC_Payment_Token $token
|
184 |
Â
*
|
185 |
Â
* @since 3.0.0
|
@@ -195,7 +196,7 @@ function wc_stripe_woocommerce_payment_token_deleted( $token_id, $token ) {
|
|
195 |
Â
/**
|
196 |
Â
* Log the provided message in the WC logs directory.
|
197 |
Â
*
|
198 |
-
* @param int
|
199 |
Â
* @param string $message
|
200 |
Â
*
|
201 |
Â
* @since 3.0.0
|
@@ -212,8 +213,8 @@ function wc_stripe_log( $level, $message ) {
|
|
212 |
Â
*
|
213 |
Â
* @param string $message
|
214 |
Â
*
|
215 |
-
* @package Stripe/Functions
|
216 |
Â
* @since 3.0.0
|
Â
|
|
217 |
Â
*/
|
218 |
Â
function wc_stripe_log_error( $message ) {
|
219 |
Â
wc_stripe_log( WC_Log_Levels::ERROR, $message );
|
@@ -223,8 +224,8 @@ function wc_stripe_log_error( $message ) {
|
|
223 |
Â
*
|
224 |
Â
* @param string $message
|
225 |
Â
*
|
226 |
-
* @package Stripe/Functions
|
227 |
Â
* @since 3.0.0
|
Â
|
|
228 |
Â
*/
|
229 |
Â
function wc_stripe_log_info( $message ) {
|
230 |
Â
wc_stripe_log( WC_Log_Levels::INFO, $message );
|
@@ -236,8 +237,8 @@ function wc_stripe_log_info( $message ) {
|
|
236 |
Â
*
|
237 |
Â
* @param WC_Order|int $order
|
238 |
Â
*
|
239 |
-
* @package Stripe/Functions
|
240 |
Â
* @since 3.0.0
|
Â
|
|
241 |
Â
*/
|
242 |
Â
function wc_stripe_order_mode( $order ) {
|
243 |
Â
if ( is_object( $order ) ) {
|
@@ -251,8 +252,8 @@ function wc_stripe_order_mode( $order ) {
|
|
251 |
Â
*
|
252 |
Â
* @param array $gateways
|
253 |
Â
*
|
254 |
-
* @package Stripe\Functions
|
255 |
Â
* @since 3.0.0
|
Â
|
|
256 |
Â
*/
|
257 |
Â
function wc_stripe_payment_gateways( $gateways ) {
|
258 |
Â
return array_merge( $gateways, stripe_wc()->payment_gateways() );
|
@@ -261,27 +262,29 @@ function wc_stripe_payment_gateways( $gateways ) {
|
|
261 |
Â
/**
|
262 |
Â
* Cancel the Stripe charge
|
263 |
Â
*
|
264 |
-
* @param int
|
265 |
Â
* @param WC_Order $order
|
266 |
Â
*
|
267 |
Â
* @package Stripe/Functions
|
268 |
Â
*/
|
269 |
Â
function wc_stripe_order_cancelled( $order_id, $order ) {
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
Â
|
|
276 |
Â
|
277 |
-
|
278 |
-
|
Â
|
|
279 |
Â
}
|
280 |
Â
}
|
281 |
Â
|
282 |
Â
/**
|
283 |
Â
*
|
284 |
-
* @param int
|
285 |
Â
* @param WC_Order $order
|
286 |
Â
*
|
287 |
Â
* @since 3.0.0
|
@@ -304,8 +307,8 @@ function wc_stripe_order_status_completed( $order_id, $order ) {
|
|
304 |
Â
*
|
305 |
Â
* @param [] $address
|
306 |
Â
*
|
307 |
-
* @throws Exception
|
308 |
Â
* @since 3.0.0
|
Â
|
|
309 |
Â
* @package Stripe/Functions
|
310 |
Â
*/
|
311 |
Â
function wc_stripe_update_customer_location( $address ) {
|
@@ -348,8 +351,8 @@ function wc_stripe_update_customer_location( $address ) {
|
|
348 |
Â
*
|
349 |
Â
* @param [] $methods
|
350 |
Â
*
|
351 |
-
* @package Stripe/Functions
|
352 |
Â
* @since 3.0.0
|
Â
|
|
353 |
Â
*/
|
354 |
Â
function wc_stripe_update_shipping_methods( $methods ) {
|
355 |
Â
$chosen_shipping_methods = WC()->session->get( 'chosen_shipping_methods', array() );
|
@@ -366,9 +369,9 @@ function wc_stripe_update_shipping_methods( $methods ) {
|
|
366 |
Â
*
|
367 |
Â
* @param array $packages
|
368 |
Â
*
|
Â
|
|
369 |
Â
* @return boolean
|
370 |
Â
* @package Stripe/Functions
|
371 |
-
* @since 3.0.0
|
372 |
Â
*/
|
373 |
Â
function wc_stripe_shipping_address_serviceable( $packages = array() ) {
|
374 |
Â
if ( $packages ) {
|
@@ -384,12 +387,12 @@ function wc_stripe_shipping_address_serviceable( $packages = array() ) {
|
|
384 |
Â
|
385 |
Â
/**
|
386 |
Â
*
|
387 |
-
* @param string
|
388 |
Â
* @param WC_Order $order
|
389 |
Â
*
|
390 |
-
* @package Stripe/Functions
|
391 |
Â
* @since 3.0.0
|
392 |
Â
* @deprecated
|
Â
|
|
393 |
Â
*/
|
394 |
Â
function wc_stripe_get_display_items( $page = 'cart', $order = null ) {
|
395 |
Â
wc_deprecated_function( 'wc_stripe_get_display_items', '3.1.0', 'WC_Payment_Gateway_Stripe::get_display_items()' );
|
@@ -400,12 +403,12 @@ function wc_stripe_get_display_items( $page = 'cart', $order = null ) {
|
|
400 |
Â
/**
|
401 |
Â
*
|
402 |
Â
* @param WC_Order $order
|
403 |
-
* @param array
|
404 |
Â
*
|
405 |
-
* @return mixed
|
406 |
-
* @package Stripe/Functions
|
407 |
Â
* @since 3.0.0
|
Â
|
|
408 |
Â
* @deprecated
|
Â
|
|
409 |
Â
*/
|
410 |
Â
function wc_stripe_get_shipping_options( $order = null, $packages = array() ) {
|
411 |
Â
$methods = array();
|
@@ -450,7 +453,7 @@ function wc_stripe_get_shipping_options( $order = null, $packages = array() ) {
|
|
450 |
Â
|
451 |
Â
/**
|
452 |
Â
*
|
453 |
-
* @param array
|
454 |
Â
* @param WC_Order $orer
|
455 |
Â
*/
|
456 |
Â
return apply_filters( 'wc_stripe_get_shipping_options', $methods, $order );
|
@@ -469,8 +472,8 @@ function wc_stripe_set_checkout_error() {
|
|
469 |
Â
*
|
470 |
Â
* @param string $template_name
|
471 |
Â
*
|
472 |
-
* @package Stripe/Functions
|
473 |
Â
* @since 3.0.0
|
Â
|
|
474 |
Â
*/
|
475 |
Â
function wc_stripe_output_checkout_error( $template_name ) {
|
476 |
Â
if ( $template_name === 'notices/error.php' && is_ajax() ) {
|
@@ -503,7 +506,7 @@ function wc_stripe_add_allowed_html( $tags, $context ) {
|
|
503 |
Â
* payment method title as the gateway title. This method saves the payment method title in
|
504 |
Â
* a human readable format suitable for the frontend.
|
505 |
Â
*
|
506 |
-
* @param int
|
507 |
Â
* @param WP_Post $post
|
508 |
Â
*
|
509 |
Â
* @package Stripe/Functions
|
@@ -531,8 +534,8 @@ function wc_stripe_process_shop_subscription_meta( $post_id, $post ) {
|
|
531 |
Â
*
|
532 |
Â
* @param WC_Payment_Gateway[] $gateways
|
533 |
Â
*
|
534 |
-
* @package Stripe/Functions
|
535 |
Â
* @since 3.0.0
|
Â
|
|
536 |
Â
*/
|
537 |
Â
function wc_stripe_available_payment_gateways( $gateways ) {
|
538 |
Â
global $wp;
|
@@ -551,9 +554,9 @@ function wc_stripe_available_payment_gateways( $gateways ) {
|
|
551 |
Â
|
552 |
Â
/**
|
553 |
Â
*
|
Â
|
|
554 |
Â
* @return array
|
555 |
Â
* @package Stripe/Functions
|
556 |
-
* @since 3.0.0
|
557 |
Â
*/
|
558 |
Â
function wc_stripe_get_local_payment_params() {
|
559 |
Â
global $wp;
|
@@ -576,9 +579,9 @@ function wc_stripe_get_local_payment_params() {
|
|
576 |
Â
*
|
577 |
Â
* @param array $gateways
|
578 |
Â
*
|
Â
|
|
579 |
Â
* @return WC_Payment_Gateway[]
|
580 |
Â
* @package Stripe/Functions
|
581 |
-
* @since 3.0.0
|
582 |
Â
*/
|
583 |
Â
function wc_stripe_get_available_local_gateways( $gateways ) {
|
584 |
Â
foreach ( $gateways as $gateway ) {
|
@@ -596,8 +599,8 @@ function wc_stripe_get_available_local_gateways( $gateways ) {
|
|
596 |
Â
*
|
597 |
Â
* @param string|int $key
|
598 |
Â
*
|
599 |
-
* @package Stripe/Functions
|
600 |
Â
* @since 3.0.0
|
Â
|
|
601 |
Â
*/
|
602 |
Â
function wc_stripe_set_idempotency_key( $key ) {
|
603 |
Â
global $wc_stripe_idempotency_key;
|
@@ -606,9 +609,9 @@ function wc_stripe_set_idempotency_key( $key ) {
|
|
606 |
Â
|
607 |
Â
/**
|
608 |
Â
*
|
Â
|
|
609 |
Â
* @return mixed
|
610 |
Â
* @package Stripe/Functions
|
611 |
-
* @since 3.0.0
|
612 |
Â
*/
|
613 |
Â
function wc_stripe_get_idempotency_key() {
|
614 |
Â
global $wc_stripe_idempotency_key;
|
@@ -620,8 +623,8 @@ function wc_stripe_get_idempotency_key() {
|
|
620 |
Â
*
|
621 |
Â
* @param array $options
|
622 |
Â
*
|
623 |
-
* @return array
|
624 |
Â
* @since 3.0.0
|
Â
|
|
625 |
Â
* @package Stripe/Functions
|
626 |
Â
*/
|
627 |
Â
function wc_stripe_api_options( $options ) {
|
@@ -635,19 +638,19 @@ function wc_stripe_api_options( $options ) {
|
|
635 |
Â
|
636 |
Â
/**
|
637 |
Â
*
|
638 |
-
* @param string
|
639 |
-
* @param int
|
640 |
Â
* @param WC_Order $order
|
641 |
Â
*
|
642 |
-
* @package Stripe/Functions
|
643 |
Â
* @since 3.0.0
|
644 |
Â
* <br/><strong>3.1.7</strong> - default $order argument of null added to prevent errors when 3rd party plugins trigger
|
645 |
Â
* action woocommerce_payment_complete_order_status and don't pass three arguments.
|
Â
|
|
646 |
Â
*/
|
647 |
Â
function wc_stripe_payment_complete_order_status( $order_status, $order_id, $order = null ) {
|
648 |
Â
if ( is_checkout() && $order && $order->get_payment_method() ) {
|
649 |
Â
$gateway = WC()->payment_gateways()->payment_gateways()[ $order->get_payment_method() ];
|
650 |
-
if ( $gateway instanceof WC_Payment_Gateway_Stripe && 'default' !== $gateway->get_option( 'order_status' ) ) {
|
651 |
Â
$order_status = $gateway->get_option( 'order_status' );
|
652 |
Â
}
|
653 |
Â
}
|
@@ -659,13 +662,13 @@ function wc_stripe_payment_complete_order_status( $order_status, $order_id, $ord
|
|
659 |
Â
* Converts the amount to cents.
|
660 |
Â
* Stripe processes all requests in cents.
|
661 |
Â
*
|
662 |
-
* @param float
|
663 |
Â
* @param string $currency
|
664 |
Â
* @param string $round
|
665 |
Â
*
|
Â
|
|
666 |
Â
* @return number
|
667 |
Â
* @package Stripe/Functions
|
668 |
-
* @since 3.0.0
|
669 |
Â
*/
|
670 |
Â
function wc_stripe_add_number_precision( $value, $currency = '', $round = true ) {
|
671 |
Â
if ( ! is_numeric( $value ) ) {
|
@@ -695,27 +698,27 @@ function wc_stripe_add_number_precision( $value, $currency = '', $round = true )
|
|
695 |
Â
/**
|
696 |
Â
* Remove precision from a number.
|
697 |
Â
*
|
698 |
-
* @param
|
699 |
Â
* @param string $currency
|
700 |
-
* @param bool
|
701 |
Â
*
|
702 |
Â
* @since 3.2.10
|
703 |
Â
*/
|
704 |
-
function wc_stripe_remove_number_precision( $value, $currency = '', $round = true ) {
|
705 |
Â
$currency = empty( $currency ) ? get_woocommerce_currency() : $currency;
|
706 |
Â
$currencies = wc_stripe_get_currencies();
|
707 |
Â
$exp = isset( $currencies[ $currency ] ) ? $currencies[ $currency ] : 2;
|
708 |
Â
$number = $value / pow( 10, $exp );
|
709 |
Â
|
710 |
-
return $round ? round( $number, wc_get_price_decimals() ) : $number;
|
711 |
Â
}
|
712 |
Â
|
713 |
Â
/**
|
714 |
Â
* Return an array of credit card forms.
|
715 |
Â
*
|
Â
|
|
716 |
Â
* @return mixed
|
717 |
Â
* @package Stripe/Functions
|
718 |
-
* @since 3.0.0
|
719 |
Â
*/
|
720 |
Â
function wc_stripe_get_custom_forms() {
|
721 |
Â
return apply_filters(
|
@@ -894,12 +897,15 @@ function wc_stripe_pre_orders_active() {
|
|
894 |
Â
*
|
895 |
Â
* @param string $source_id
|
896 |
Â
*
|
897 |
-
* @package Stripe/Functions
|
898 |
Â
* @since 3.0.5
|
Â
|
|
899 |
Â
*/
|
900 |
Â
function wc_stripe_get_order_from_source_id( $source_id ) {
|
901 |
Â
global $wpdb;
|
902 |
-
$order_id
|
Â
|
|
Â
|
|
Â
|
|
903 |
Â
|
904 |
Â
return wc_get_order( $order_id );
|
905 |
Â
}
|
@@ -908,13 +914,16 @@ function wc_stripe_get_order_from_source_id( $source_id ) {
|
|
908 |
Â
*
|
909 |
Â
* @param string $transaction_id
|
910 |
Â
*
|
911 |
-
* @return WC_Order|WC_Refund|boolean|WC_Order_Refund
|
912 |
Â
* @since 3.0.5
|
Â
|
|
913 |
Â
* @package Stripe/Functions
|
914 |
Â
*/
|
915 |
Â
function wc_stripe_get_order_from_transaction( $transaction_id ) {
|
916 |
Â
global $wpdb;
|
917 |
-
$order_id
|
Â
|
|
Â
|
|
Â
|
|
918 |
Â
|
919 |
Â
return wc_get_order( $order_id );
|
920 |
Â
}
|
@@ -925,13 +934,13 @@ function wc_stripe_get_order_from_transaction( $transaction_id ) {
|
|
925 |
Â
* to the cart.
|
926 |
Â
*
|
927 |
Â
* @param WC_Cart $cart
|
928 |
-
* @param bool
|
929 |
Â
*
|
930 |
-
* @
|
931 |
Â
* @todo Maybe empty cart silently so actions are not triggered that cause session data to be removed
|
932 |
Â
* from 3rd party plugins.
|
933 |
Â
*
|
934 |
-
* @
|
935 |
Â
*/
|
936 |
Â
function wc_stripe_stash_cart( $cart, $product_cart = true ) {
|
937 |
Â
$data = WC()->session->get( 'wc_stripe_cart', array() );
|
@@ -954,10 +963,10 @@ function wc_stripe_stash_cart( $cart, $product_cart = true ) {
|
|
954 |
Â
/**
|
955 |
Â
*
|
956 |
Â
* @param WC_Cart $cart
|
957 |
-
* @param array
|
958 |
Â
*
|
959 |
-
* @package Stripe/Functions
|
960 |
Â
* @since 3.0.6
|
Â
|
|
961 |
Â
*/
|
962 |
Â
function wc_stripe_stash_product_cart( $cart, $params = array() ) {
|
963 |
Â
$data = WC()->session->get( 'wc_stripe_cart', array() );
|
@@ -971,8 +980,8 @@ function wc_stripe_stash_product_cart( $cart, $params = array() ) {
|
|
971 |
Â
*
|
972 |
Â
* @param WC_Cart $cart
|
973 |
Â
*
|
974 |
-
* @package Stripe/Functions
|
975 |
Â
* @since 3.0.6
|
Â
|
|
976 |
Â
*/
|
977 |
Â
function wc_stripe_restore_cart( $cart ) {
|
978 |
Â
$data = WC()->session->get( 'wc_stripe_cart', array( 'cart' => array() ) );
|
@@ -999,11 +1008,11 @@ function wc_stripe_restore_cart_after_product_checkout() {
|
|
999 |
Â
/**
|
1000 |
Â
*
|
1001 |
Â
* @param WC_Payment_Token[] $tokens
|
1002 |
-
* @param int
|
1003 |
-
* @param string
|
1004 |
Â
*
|
1005 |
-
* @return WC_Payment_Token[]
|
1006 |
Â
* @since 3.1.0
|
Â
|
|
1007 |
Â
* @package Stripe/Functions
|
1008 |
Â
*/
|
1009 |
Â
function wc_stripe_get_customer_payment_tokens( $tokens, $user_id, $gateway_id ) {
|
@@ -1023,8 +1032,8 @@ function wc_stripe_get_customer_payment_tokens( $tokens, $user_id, $gateway_id )
|
|
1023 |
Â
*
|
1024 |
Â
* @param array $labels
|
1025 |
Â
*
|
1026 |
-
* @return string
|
1027 |
Â
* @since 3.1.0
|
Â
|
|
1028 |
Â
* @package Stripe/Functions
|
1029 |
Â
*/
|
1030 |
Â
function wc_stripe_credit_card_labels( $labels ) {
|
@@ -1063,28 +1072,44 @@ function wc_stripe_get_error_messages() {
|
|
1063 |
Â
'expired_card' => __( 'The card has expired. Check the expiration date or use a different card.', 'woo-stripe-payment' ),
|
1064 |
Â
'card_declined' => __( 'The card has been declined.', 'woo-stripe-payment' ),
|
1065 |
Â
'invalid_expiry_year_past' => __( 'Your card\'s expiration year is in the past.', 'woo-stripe-payment' ),
|
1066 |
-
'account_number_invalid' => __( '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.',
|
Â
|
|
1067 |
Â
'amount_too_large' => __( 'The specified amount is greater than the maximum amount allowed. Use a lower amount and try again.', 'woo-stripe-payment' ),
|
1068 |
Â
'amount_too_small' => __( 'The specified amount is less than the minimum amount allowed. Use a higher amount and try again.', 'woo-stripe-payment' ),
|
1069 |
-
'authentication_required' => __( '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.',
|
1070 |
-
|
Â
|
|
Â
|
|
1071 |
Â
'bank_account_declined' => __( 'The bank account provided can not be used to charge, either because it is not verified yet or it is not supported.', 'woo-stripe-payment' ),
|
1072 |
-
'bank_account_exists' => __( '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.',
|
Â
|
|
1073 |
Â
'bank_account_unusable' => __( 'The bank account provided cannot be used for payouts. A different bank account must be used.', 'woo-stripe-payment' ),
|
1074 |
Â
'bank_account_unverified' => __( 'Your Connect platform is attempting to share an unverified bank account with a connected account.', 'woo-stripe-payment' ),
|
1075 |
-
'bank_account_verification_failed' => __( '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.',
|
1076 |
-
|
Â
|
|
Â
|
|
1077 |
Â
'charge_already_captured' => __( 'The charge you\'re attempting to capture has already been captured. Update the request with an uncaptured charge ID.', 'woo-stripe-payment' ),
|
1078 |
-
'charge_already_refunded' => __( '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.',
|
1079 |
-
|
1080 |
-
'
|
1081 |
-
|
1082 |
-
'
|
1083 |
-
|
1084 |
-
'
|
1085 |
-
|
1086 |
-
'
|
1087 |
-
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
1088 |
Â
'postal_code_invalid' => __( 'The ZIP code provided was incorrect.', 'woo-stripe-payment' ),
|
1089 |
Â
'processing_error' => __( 'An error occurred while processing the card. Try again later or with a different payment method.', 'woo-stripe-payment' ),
|
1090 |
Â
'card_not_supported' => __( 'The card does not support this type of purchase.', 'woo-stripe-payment' ),
|
@@ -1101,7 +1126,8 @@ function wc_stripe_get_error_messages() {
|
|
1101 |
Â
'empty_element_ideal' => __( 'Please select a bank before proceeding', 'woo-stripe-payment' ),
|
1102 |
Â
'incomplete_iban' => __( 'The IBAN you entered is incomplete.', 'woo-stripe-payment' ),
|
1103 |
Â
'incomplete_boleto_tax_id' => __( 'Please enter a valid CPF / CNPJ', 'woo-stripe-payment' ),
|
1104 |
-
'test_mode_live_card' => __( 'Your card was declined. Your request was in test mode, but you used a real credit card. Only test cards can be used in test mode.',
|
Â
|
|
1105 |
Â
)
|
1106 |
Â
);
|
1107 |
Â
}
|
@@ -1110,9 +1136,9 @@ function wc_stripe_get_error_messages() {
|
|
1110 |
Â
* Return an array of Stripe currencies where the value of each
|
1111 |
Â
* currency is the curency multiplier.
|
1112 |
Â
*
|
Â
|
|
1113 |
Â
* @return mixed
|
1114 |
Â
* @package Stripe/Functions
|
1115 |
-
* @since 3.1.2
|
1116 |
Â
*/
|
1117 |
Â
function wc_stripe_get_currencies() {
|
1118 |
Â
return apply_filters(
|
@@ -1150,7 +1176,7 @@ function wc_stripe_get_currencies() {
|
|
1150 |
Â
* Allows 3rd parties to
|
1151 |
Â
* convert the order_id from the metadata of the Stripe object.
|
1152 |
Â
*
|
1153 |
-
* @param int
|
1154 |
Â
* @param \Stripe\ApiResource $object
|
1155 |
Â
*
|
1156 |
Â
* @since 3.1.3
|
@@ -1162,6 +1188,7 @@ function wc_stripe_filter_order_id( $order_id, $object ) {
|
|
1162 |
Â
|
1163 |
Â
/**
|
1164 |
Â
* Removes order locks that have expired so the options table does not get cluttered with transients.
|
Â
|
|
1165 |
Â
* @since 3.1.6
|
1166 |
Â
* @package Stripe/Functions
|
1167 |
Â
*/
|
@@ -1182,8 +1209,9 @@ function wc_stripe_remove_order_locks() {
|
|
1182 |
Â
|
1183 |
Â
/**
|
1184 |
Â
* Returns an array of checkout fields needed to complete an order.
|
1185 |
-
*
|
1186 |
Â
* @since 3.1.8
|
Â
|
|
1187 |
Â
*/
|
1188 |
Â
function wc_stripe_get_checkout_fields() {
|
1189 |
Â
global $wp;
|
@@ -1227,9 +1255,9 @@ function wc_stripe_get_checkout_fields() {
|
|
1227 |
Â
* @param string $state
|
1228 |
Â
* @param string $country
|
1229 |
Â
*
|
Â
|
|
1230 |
Â
* @return string
|
1231 |
Â
*
|
1232 |
-
* @since 3.2.1
|
1233 |
Â
*/
|
1234 |
Â
function wc_stripe_filter_address_state( $state, $country ) {
|
1235 |
Â
$states = WC()->countries ? WC()->countries->get_states( $country ) : array();
|
1 |
Â
<?php
|
2 |
+
|
3 |
Â
defined( 'ABSPATH' ) || exit();
|
4 |
Â
|
5 |
Â
/**
|
6 |
Â
*
|
7 |
Â
* @param string $template_name
|
8 |
+
* @param array $args
|
9 |
Â
*
|
10 |
Â
* @since 3.0.0
|
11 |
Â
* @package Stripe/Functions
|
21 |
Â
* Wrapper for wc_get_template_html that returns Stripe specififc templates in an html string.
|
22 |
Â
*
|
23 |
Â
* @param string $template_name
|
24 |
+
* @param array $args
|
25 |
Â
*
|
Â
|
|
26 |
Â
* @since 3.0.0
|
27 |
+
* @return string
|
28 |
Â
* @package Stripe/Functions
|
29 |
Â
*/
|
30 |
Â
function wc_stripe_get_template_html( $template_name, $args = array() ) {
|
116 |
Â
/**
|
117 |
Â
* Return the merchant's Stripe account.
|
118 |
Â
*
|
Â
|
|
119 |
Â
* @since 3.1.4
|
120 |
+
* @return string
|
121 |
Â
* @package Stripe/Functions
|
122 |
Â
*/
|
123 |
Â
function wc_stripe_get_account_id() {
|
127 |
Â
/**
|
128 |
Â
* Return the stripe customer ID
|
129 |
Â
*
|
130 |
+
* @param int $user_id
|
131 |
Â
* @param string $mode
|
132 |
Â
*
|
Â
|
|
133 |
Â
* @since 3.0.0
|
134 |
+
* @package Stripe/Functions
|
135 |
Â
*/
|
136 |
Â
function wc_stripe_get_customer_id( $user_id = '', $mode = '' ) {
|
137 |
Â
$mode = empty( $mode ) ? wc_stripe_mode() : $mode;
|
144 |
Â
|
145 |
Â
/**
|
146 |
Â
* @param string
|
147 |
+
* @param int $user_id
|
148 |
Â
* @param string $mode
|
149 |
Â
*
|
150 |
Â
* @since 3.2.12
|
155 |
Â
/**
|
156 |
Â
*
|
157 |
Â
* @param string $customer_id
|
158 |
+
* @param int $user_id
|
159 |
Â
* @param string $mode
|
160 |
Â
*
|
161 |
Â
* @package Stripe/Functions
|
167 |
Â
}
|
168 |
Â
|
169 |
Â
/**
|
170 |
+
* @param int $user_id
|
171 |
Â
* @param string $mode
|
172 |
+
* @param bool $global
|
173 |
Â
*
|
174 |
Â
* @since 3.2.13
|
175 |
Â
*/
|
180 |
Â
|
181 |
Â
/**
|
182 |
Â
*
|
183 |
+
* @param int $token_id
|
184 |
Â
* @param WC_Payment_Token $token
|
185 |
Â
*
|
186 |
Â
* @since 3.0.0
|
196 |
Â
/**
|
197 |
Â
* Log the provided message in the WC logs directory.
|
198 |
Â
*
|
199 |
+
* @param int $level
|
200 |
Â
* @param string $message
|
201 |
Â
*
|
202 |
Â
* @since 3.0.0
|
213 |
Â
*
|
214 |
Â
* @param string $message
|
215 |
Â
*
|
Â
|
|
216 |
Â
* @since 3.0.0
|
217 |
+
* @package Stripe/Functions
|
218 |
Â
*/
|
219 |
Â
function wc_stripe_log_error( $message ) {
|
220 |
Â
wc_stripe_log( WC_Log_Levels::ERROR, $message );
|
224 |
Â
*
|
225 |
Â
* @param string $message
|
226 |
Â
*
|
Â
|
|
227 |
Â
* @since 3.0.0
|
228 |
+
* @package Stripe/Functions
|
229 |
Â
*/
|
230 |
Â
function wc_stripe_log_info( $message ) {
|
231 |
Â
wc_stripe_log( WC_Log_Levels::INFO, $message );
|
237 |
Â
*
|
238 |
Â
* @param WC_Order|int $order
|
239 |
Â
*
|
Â
|
|
240 |
Â
* @since 3.0.0
|
241 |
+
* @package Stripe/Functions
|
242 |
Â
*/
|
243 |
Â
function wc_stripe_order_mode( $order ) {
|
244 |
Â
if ( is_object( $order ) ) {
|
252 |
Â
*
|
253 |
Â
* @param array $gateways
|
254 |
Â
*
|
Â
|
|
255 |
Â
* @since 3.0.0
|
256 |
+
* @package Stripe\Functions
|
257 |
Â
*/
|
258 |
Â
function wc_stripe_payment_gateways( $gateways ) {
|
259 |
Â
return array_merge( $gateways, stripe_wc()->payment_gateways() );
|
262 |
Â
/**
|
263 |
Â
* Cancel the Stripe charge
|
264 |
Â
*
|
265 |
+
* @param int $order_id
|
266 |
Â
* @param WC_Order $order
|
267 |
Â
*
|
268 |
Â
* @package Stripe/Functions
|
269 |
Â
*/
|
270 |
Â
function wc_stripe_order_cancelled( $order_id, $order ) {
|
271 |
+
if ( stripe_wc()->advanced_settings->is_refund_cancel_enabled() ) {
|
272 |
+
$gateways = WC()->payment_gateways()->payment_gateways();
|
273 |
+
/**
|
274 |
+
*
|
275 |
+
* @var WC_Payment_Gateway_Stripe $gateway
|
276 |
+
*/
|
277 |
+
$gateway = isset( $gateways[ $order->get_payment_method() ] ) ? $gateways[ $order->get_payment_method() ] : null;
|
278 |
Â
|
279 |
+
if ( $gateway && $gateway instanceof WC_Payment_Gateway_Stripe ) {
|
280 |
+
$gateway->void_charge( $order );
|
281 |
+
}
|
282 |
Â
}
|
283 |
Â
}
|
284 |
Â
|
285 |
Â
/**
|
286 |
Â
*
|
287 |
+
* @param int $order_id
|
288 |
Â
* @param WC_Order $order
|
289 |
Â
*
|
290 |
Â
* @since 3.0.0
|
307 |
Â
*
|
308 |
Â
* @param [] $address
|
309 |
Â
*
|
Â
|
|
310 |
Â
* @since 3.0.0
|
311 |
+
* @throws Exception
|
312 |
Â
* @package Stripe/Functions
|
313 |
Â
*/
|
314 |
Â
function wc_stripe_update_customer_location( $address ) {
|
351 |
Â
*
|
352 |
Â
* @param [] $methods
|
353 |
Â
*
|
Â
|
|
354 |
Â
* @since 3.0.0
|
355 |
+
* @package Stripe/Functions
|
356 |
Â
*/
|
357 |
Â
function wc_stripe_update_shipping_methods( $methods ) {
|
358 |
Â
$chosen_shipping_methods = WC()->session->get( 'chosen_shipping_methods', array() );
|
369 |
Â
*
|
370 |
Â
* @param array $packages
|
371 |
Â
*
|
372 |
+
* @since 3.0.0
|
373 |
Â
* @return boolean
|
374 |
Â
* @package Stripe/Functions
|
Â
|
|
375 |
Â
*/
|
376 |
Â
function wc_stripe_shipping_address_serviceable( $packages = array() ) {
|
377 |
Â
if ( $packages ) {
|
387 |
Â
|
388 |
Â
/**
|
389 |
Â
*
|
390 |
+
* @param string $page
|
391 |
Â
* @param WC_Order $order
|
392 |
Â
*
|
Â
|
|
393 |
Â
* @since 3.0.0
|
394 |
Â
* @deprecated
|
395 |
+
* @package Stripe/Functions
|
396 |
Â
*/
|
397 |
Â
function wc_stripe_get_display_items( $page = 'cart', $order = null ) {
|
398 |
Â
wc_deprecated_function( 'wc_stripe_get_display_items', '3.1.0', 'WC_Payment_Gateway_Stripe::get_display_items()' );
|
403 |
Â
/**
|
404 |
Â
*
|
405 |
Â
* @param WC_Order $order
|
406 |
+
* @param array $packages
|
407 |
Â
*
|
Â
|
|
Â
|
|
408 |
Â
* @since 3.0.0
|
409 |
+
* @return mixed
|
410 |
Â
* @deprecated
|
411 |
+
* @package Stripe/Functions
|
412 |
Â
*/
|
413 |
Â
function wc_stripe_get_shipping_options( $order = null, $packages = array() ) {
|
414 |
Â
$methods = array();
|
453 |
Â
|
454 |
Â
/**
|
455 |
Â
*
|
456 |
+
* @param array $methods
|
457 |
Â
* @param WC_Order $orer
|
458 |
Â
*/
|
459 |
Â
return apply_filters( 'wc_stripe_get_shipping_options', $methods, $order );
|
472 |
Â
*
|
473 |
Â
* @param string $template_name
|
474 |
Â
*
|
Â
|
|
475 |
Â
* @since 3.0.0
|
476 |
+
* @package Stripe/Functions
|
477 |
Â
*/
|
478 |
Â
function wc_stripe_output_checkout_error( $template_name ) {
|
479 |
Â
if ( $template_name === 'notices/error.php' && is_ajax() ) {
|
506 |
Â
* payment method title as the gateway title. This method saves the payment method title in
|
507 |
Â
* a human readable format suitable for the frontend.
|
508 |
Â
*
|
509 |
+
* @param int $post_id
|
510 |
Â
* @param WP_Post $post
|
511 |
Â
*
|
512 |
Â
* @package Stripe/Functions
|
534 |
Â
*
|
535 |
Â
* @param WC_Payment_Gateway[] $gateways
|
536 |
Â
*
|
Â
|
|
537 |
Â
* @since 3.0.0
|
538 |
+
* @package Stripe/Functions
|
539 |
Â
*/
|
540 |
Â
function wc_stripe_available_payment_gateways( $gateways ) {
|
541 |
Â
global $wp;
|
554 |
Â
|
555 |
Â
/**
|
556 |
Â
*
|
557 |
+
* @since 3.0.0
|
558 |
Â
* @return array
|
559 |
Â
* @package Stripe/Functions
|
Â
|
|
560 |
Â
*/
|
561 |
Â
function wc_stripe_get_local_payment_params() {
|
562 |
Â
global $wp;
|
579 |
Â
*
|
580 |
Â
* @param array $gateways
|
581 |
Â
*
|
582 |
+
* @since 3.0.0
|
583 |
Â
* @return WC_Payment_Gateway[]
|
584 |
Â
* @package Stripe/Functions
|
Â
|
|
585 |
Â
*/
|
586 |
Â
function wc_stripe_get_available_local_gateways( $gateways ) {
|
587 |
Â
foreach ( $gateways as $gateway ) {
|
599 |
Â
*
|
600 |
Â
* @param string|int $key
|
601 |
Â
*
|
Â
|
|
602 |
Â
* @since 3.0.0
|
603 |
+
* @package Stripe/Functions
|
604 |
Â
*/
|
605 |
Â
function wc_stripe_set_idempotency_key( $key ) {
|
606 |
Â
global $wc_stripe_idempotency_key;
|
609 |
Â
|
610 |
Â
/**
|
611 |
Â
*
|
612 |
+
* @since 3.0.0
|
613 |
Â
* @return mixed
|
614 |
Â
* @package Stripe/Functions
|
Â
|
|
615 |
Â
*/
|
616 |
Â
function wc_stripe_get_idempotency_key() {
|
617 |
Â
global $wc_stripe_idempotency_key;
|
623 |
Â
*
|
624 |
Â
* @param array $options
|
625 |
Â
*
|
Â
|
|
626 |
Â
* @since 3.0.0
|
627 |
+
* @return array
|
628 |
Â
* @package Stripe/Functions
|
629 |
Â
*/
|
630 |
Â
function wc_stripe_api_options( $options ) {
|
638 |
Â
|
639 |
Â
/**
|
640 |
Â
*
|
641 |
+
* @param string $order_status
|
642 |
+
* @param int $order_id
|
643 |
Â
* @param WC_Order $order
|
644 |
Â
*
|
Â
|
|
645 |
Â
* @since 3.0.0
|
646 |
Â
* <br/><strong>3.1.7</strong> - default $order argument of null added to prevent errors when 3rd party plugins trigger
|
647 |
Â
* action woocommerce_payment_complete_order_status and don't pass three arguments.
|
648 |
+
* @package Stripe/Functions
|
649 |
Â
*/
|
650 |
Â
function wc_stripe_payment_complete_order_status( $order_status, $order_id, $order = null ) {
|
651 |
Â
if ( is_checkout() && $order && $order->get_payment_method() ) {
|
652 |
Â
$gateway = WC()->payment_gateways()->payment_gateways()[ $order->get_payment_method() ];
|
653 |
+
if ( $gateway instanceof WC_Payment_Gateway_Stripe && 'default' !== $gateway->get_option( 'order_status', 'default' ) ) {
|
654 |
Â
$order_status = $gateway->get_option( 'order_status' );
|
655 |
Â
}
|
656 |
Â
}
|
662 |
Â
* Converts the amount to cents.
|
663 |
Â
* Stripe processes all requests in cents.
|
664 |
Â
*
|
665 |
+
* @param float $value
|
666 |
Â
* @param string $currency
|
667 |
Â
* @param string $round
|
668 |
Â
*
|
669 |
+
* @since 3.0.0
|
670 |
Â
* @return number
|
671 |
Â
* @package Stripe/Functions
|
Â
|
|
672 |
Â
*/
|
673 |
Â
function wc_stripe_add_number_precision( $value, $currency = '', $round = true ) {
|
674 |
Â
if ( ! is_numeric( $value ) ) {
|
698 |
Â
/**
|
699 |
Â
* Remove precision from a number.
|
700 |
Â
*
|
701 |
+
* @param $value
|
702 |
Â
* @param string $currency
|
703 |
+
* @param bool $round
|
704 |
Â
*
|
705 |
Â
* @since 3.2.10
|
706 |
Â
*/
|
707 |
+
function wc_stripe_remove_number_precision( $value, $currency = '', $round = true, $dp = null ) {
|
708 |
Â
$currency = empty( $currency ) ? get_woocommerce_currency() : $currency;
|
709 |
Â
$currencies = wc_stripe_get_currencies();
|
710 |
Â
$exp = isset( $currencies[ $currency ] ) ? $currencies[ $currency ] : 2;
|
711 |
Â
$number = $value / pow( 10, $exp );
|
712 |
Â
|
713 |
+
return $round ? round( $number, $dp === null ? wc_get_price_decimals() : $dp ) : $number;
|
714 |
Â
}
|
715 |
Â
|
716 |
Â
/**
|
717 |
Â
* Return an array of credit card forms.
|
718 |
Â
*
|
719 |
+
* @since 3.0.0
|
720 |
Â
* @return mixed
|
721 |
Â
* @package Stripe/Functions
|
Â
|
|
722 |
Â
*/
|
723 |
Â
function wc_stripe_get_custom_forms() {
|
724 |
Â
return apply_filters(
|
897 |
Â
*
|
898 |
Â
* @param string $source_id
|
899 |
Â
*
|
Â
|
|
900 |
Â
* @since 3.0.5
|
901 |
+
* @package Stripe/Functions
|
902 |
Â
*/
|
903 |
Â
function wc_stripe_get_order_from_source_id( $source_id ) {
|
904 |
Â
global $wpdb;
|
905 |
+
$order_id
|
906 |
+
= $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} AS posts LEFT JOIN {$wpdb->postmeta} AS meta ON posts.ID = meta.post_id WHERE meta.meta_key = %s AND meta.meta_value = %s LIMIT 1",
|
907 |
+
WC_Stripe_Constants::SOURCE_ID,
|
908 |
+
$source_id ) );
|
909 |
Â
|
910 |
Â
return wc_get_order( $order_id );
|
911 |
Â
}
|
914 |
Â
*
|
915 |
Â
* @param string $transaction_id
|
916 |
Â
*
|
Â
|
|
917 |
Â
* @since 3.0.5
|
918 |
+
* @return WC_Order|WC_Refund|boolean|WC_Order_Refund
|
919 |
Â
* @package Stripe/Functions
|
920 |
Â
*/
|
921 |
Â
function wc_stripe_get_order_from_transaction( $transaction_id ) {
|
922 |
Â
global $wpdb;
|
923 |
+
$order_id
|
924 |
+
= $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} AS posts LEFT JOIN {$wpdb->postmeta} AS meta ON posts.ID = meta.post_id WHERE meta.meta_key = %s AND meta.meta_value = %s LIMIT 1",
|
925 |
+
'_transaction_id',
|
926 |
+
$transaction_id ) );
|
927 |
Â
|
928 |
Â
return wc_get_order( $order_id );
|
929 |
Â
}
|
934 |
Â
* to the cart.
|
935 |
Â
*
|
936 |
Â
* @param WC_Cart $cart
|
937 |
+
* @param bool $product_cart
|
938 |
Â
*
|
939 |
+
* @since 3.0.6
|
940 |
Â
* @todo Maybe empty cart silently so actions are not triggered that cause session data to be removed
|
941 |
Â
* from 3rd party plugins.
|
942 |
Â
*
|
943 |
+
* @package Stripe/Functions
|
944 |
Â
*/
|
945 |
Â
function wc_stripe_stash_cart( $cart, $product_cart = true ) {
|
946 |
Â
$data = WC()->session->get( 'wc_stripe_cart', array() );
|
963 |
Â
/**
|
964 |
Â
*
|
965 |
Â
* @param WC_Cart $cart
|
966 |
+
* @param array $params
|
967 |
Â
*
|
Â
|
|
968 |
Â
* @since 3.0.6
|
969 |
+
* @package Stripe/Functions
|
970 |
Â
*/
|
971 |
Â
function wc_stripe_stash_product_cart( $cart, $params = array() ) {
|
972 |
Â
$data = WC()->session->get( 'wc_stripe_cart', array() );
|
980 |
Â
*
|
981 |
Â
* @param WC_Cart $cart
|
982 |
Â
*
|
Â
|
|
983 |
Â
* @since 3.0.6
|
984 |
+
* @package Stripe/Functions
|
985 |
Â
*/
|
986 |
Â
function wc_stripe_restore_cart( $cart ) {
|
987 |
Â
$data = WC()->session->get( 'wc_stripe_cart', array( 'cart' => array() ) );
|
1008 |
Â
/**
|
1009 |
Â
*
|
1010 |
Â
* @param WC_Payment_Token[] $tokens
|
1011 |
+
* @param int $user_id
|
1012 |
+
* @param string $gateway_id
|
1013 |
Â
*
|
Â
|
|
1014 |
Â
* @since 3.1.0
|
1015 |
+
* @return WC_Payment_Token[]
|
1016 |
Â
* @package Stripe/Functions
|
1017 |
Â
*/
|
1018 |
Â
function wc_stripe_get_customer_payment_tokens( $tokens, $user_id, $gateway_id ) {
|
1032 |
Â
*
|
1033 |
Â
* @param array $labels
|
1034 |
Â
*
|
Â
|
|
1035 |
Â
* @since 3.1.0
|
1036 |
+
* @return string
|
1037 |
Â
* @package Stripe/Functions
|
1038 |
Â
*/
|
1039 |
Â
function wc_stripe_credit_card_labels( $labels ) {
|
1072 |
Â
'expired_card' => __( 'The card has expired. Check the expiration date or use a different card.', 'woo-stripe-payment' ),
|
1073 |
Â
'card_declined' => __( 'The card has been declined.', 'woo-stripe-payment' ),
|
1074 |
Â
'invalid_expiry_year_past' => __( 'Your card\'s expiration year is in the past.', 'woo-stripe-payment' ),
|
1075 |
+
'account_number_invalid' => __( '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.',
|
1076 |
+
'woo-stripe-payment' ),
|
1077 |
Â
'amount_too_large' => __( 'The specified amount is greater than the maximum amount allowed. Use a lower amount and try again.', 'woo-stripe-payment' ),
|
1078 |
Â
'amount_too_small' => __( 'The specified amount is less than the minimum amount allowed. Use a higher amount and try again.', 'woo-stripe-payment' ),
|
1079 |
+
'authentication_required' => __( '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.',
|
1080 |
+
'woo-stripe-payment' ),
|
1081 |
+
'balance_insufficient' => __( '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.',
|
1082 |
+
'woo-stripe-payment' ),
|
1083 |
Â
'bank_account_declined' => __( 'The bank account provided can not be used to charge, either because it is not verified yet or it is not supported.', 'woo-stripe-payment' ),
|
1084 |
+
'bank_account_exists' => __( '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.',
|
1085 |
+
'woo-stripe-payment' ),
|
1086 |
Â
'bank_account_unusable' => __( 'The bank account provided cannot be used for payouts. A different bank account must be used.', 'woo-stripe-payment' ),
|
1087 |
Â
'bank_account_unverified' => __( 'Your Connect platform is attempting to share an unverified bank account with a connected account.', 'woo-stripe-payment' ),
|
1088 |
+
'bank_account_verification_failed' => __( '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.',
|
1089 |
+
'woo-stripe-payment' ),
|
1090 |
+
'card_decline_rate_limit_exceeded' => __( '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.',
|
1091 |
+
'woo-stripe-payment' ),
|
1092 |
Â
'charge_already_captured' => __( 'The charge you\'re attempting to capture has already been captured. Update the request with an uncaptured charge ID.', 'woo-stripe-payment' ),
|
1093 |
+
'charge_already_refunded' => __( '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.',
|
1094 |
+
'woo-stripe-payment' ),
|
1095 |
+
'charge_disputed' => __( 'The charge you\'re attempting to refund has been charged back. Check the disputes documentation to learn how to respond to the dispute.',
|
1096 |
+
'woo-stripe-payment' ),
|
1097 |
+
'charge_exceeds_source_limit' => __( '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.',
|
1098 |
+
'woo-stripe-payment' ),
|
1099 |
+
'charge_expired_for_capture' => __( 'The charge cannot be captured as the authorization has expired. Auth and capture charges must be captured within seven days.',
|
1100 |
+
'woo-stripe-payment' ),
|
1101 |
+
'charge_invalid_parameter' => __( '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.',
|
1102 |
+
'woo-stripe-payment' ),
|
1103 |
+
'email_invalid' => __( 'The email address is invalid (e.g., not properly formatted). Check that the email address is properly formatted and only includes allowed characters.',
|
1104 |
+
'woo-stripe-payment' ),
|
1105 |
+
'idempotency_key_in_use' => __( 'The idempotency key provided is currently being used in another request. This occurs if your integration is making duplicate requests simultaneously.',
|
1106 |
+
'woo-stripe-payment' ),
|
1107 |
+
'invalid_charge_amount' => __( '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.',
|
1108 |
+
'woo-stripe-payment' ),
|
1109 |
+
'invalid_source_usage' => __( '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.',
|
1110 |
+
'woo-stripe-payment' ),
|
1111 |
+
'missing' => __( '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.',
|
1112 |
+
'woo-stripe-payment' ),
|
1113 |
Â
'postal_code_invalid' => __( 'The ZIP code provided was incorrect.', 'woo-stripe-payment' ),
|
1114 |
Â
'processing_error' => __( 'An error occurred while processing the card. Try again later or with a different payment method.', 'woo-stripe-payment' ),
|
1115 |
Â
'card_not_supported' => __( 'The card does not support this type of purchase.', 'woo-stripe-payment' ),
|
1126 |
Â
'empty_element_ideal' => __( 'Please select a bank before proceeding', 'woo-stripe-payment' ),
|
1127 |
Â
'incomplete_iban' => __( 'The IBAN you entered is incomplete.', 'woo-stripe-payment' ),
|
1128 |
Â
'incomplete_boleto_tax_id' => __( 'Please enter a valid CPF / CNPJ', 'woo-stripe-payment' ),
|
1129 |
+
'test_mode_live_card' => __( 'Your card was declined. Your request was in test mode, but you used a real credit card. Only test cards can be used in test mode.',
|
1130 |
+
'woo-stripe-payment' )
|
1131 |
Â
)
|
1132 |
Â
);
|
1133 |
Â
}
|
1136 |
Â
* Return an array of Stripe currencies where the value of each
|
1137 |
Â
* currency is the curency multiplier.
|
1138 |
Â
*
|
1139 |
+
* @since 3.1.2
|
1140 |
Â
* @return mixed
|
1141 |
Â
* @package Stripe/Functions
|
Â
|
|
1142 |
Â
*/
|
1143 |
Â
function wc_stripe_get_currencies() {
|
1144 |
Â
return apply_filters(
|
1176 |
Â
* Allows 3rd parties to
|
1177 |
Â
* convert the order_id from the metadata of the Stripe object.
|
1178 |
Â
*
|
1179 |
+
* @param int $order_id
|
1180 |
Â
* @param \Stripe\ApiResource $object
|
1181 |
Â
*
|
1182 |
Â
* @since 3.1.3
|
1188 |
Â
|
1189 |
Â
/**
|
1190 |
Â
* Removes order locks that have expired so the options table does not get cluttered with transients.
|
1191 |
+
*
|
1192 |
Â
* @since 3.1.6
|
1193 |
Â
* @package Stripe/Functions
|
1194 |
Â
*/
|
1209 |
Â
|
1210 |
Â
/**
|
1211 |
Â
* Returns an array of checkout fields needed to complete an order.
|
1212 |
+
*
|
1213 |
Â
* @since 3.1.8
|
1214 |
+
* @return array
|
1215 |
Â
*/
|
1216 |
Â
function wc_stripe_get_checkout_fields() {
|
1217 |
Â
global $wp;
|
1255 |
Â
* @param string $state
|
1256 |
Â
* @param string $country
|
1257 |
Â
*
|
1258 |
+
* @since 3.2.1
|
1259 |
Â
* @return string
|
1260 |
Â
*
|
Â
|
|
1261 |
Â
*/
|
1262 |
Â
function wc_stripe_filter_address_state( $state, $country ) {
|
1263 |
Â
$states = WC()->countries ? WC()->countries->get_states( $country ) : array();
|
includes/wc-stripe-hooks.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
Â
<?php
|
Â
|
|
2 |
Â
defined( 'ABSPATH' ) || exit();
|
3 |
Â
|
4 |
Â
/**
|
@@ -9,6 +10,7 @@ add_action( 'woocommerce_order_status_cancelled', 'wc_stripe_order_cancelled', 1
|
|
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 |
Â
add_action( 'wc_stripe_retry_source_chargeable', 'wc_stripe_retry_source_chargeable' );
|
Â
|
|
12 |
Â
/**
|
13 |
Â
* * Webhook Actions ***
|
14 |
Â
*/
|
@@ -17,6 +19,10 @@ add_action( 'wc_stripe_webhook_charge_succeeded', 'wc_stripe_process_charge_succ
|
|
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
|
1 |
Â
<?php
|
2 |
+
|
3 |
Â
defined( 'ABSPATH' ) || exit();
|
4 |
Â
|
5 |
Â
/**
|
10 |
Â
add_action( 'woocommerce_order_status_completed', 'wc_stripe_order_status_completed', 10, 2 );
|
11 |
Â
add_action( 'wc_stripe_remove_order_locks', 'wc_stripe_remove_order_locks' );
|
12 |
Â
add_action( 'wc_stripe_retry_source_chargeable', 'wc_stripe_retry_source_chargeable' );
|
13 |
+
|
14 |
Â
/**
|
15 |
Â
* * Webhook Actions ***
|
16 |
Â
*/
|
19 |
Â
add_action( 'wc_stripe_webhook_charge_failed', 'wc_stripe_process_charge_failed', 10, 2 );
|
20 |
Â
add_action( 'wc_stripe_webhook_payment_intent_succeeded', 'wc_stripe_process_payment_intent_succeeded', 10, 2 );
|
21 |
Â
add_action( 'wc_stripe_webhook_charge_refunded', 'wc_stripe_process_create_refund' );
|
22 |
+
add_action( 'wc_stripe_webhook_charge_dispute_created', 'wc_stripe_charge_dispute_created', 10, 1 );
|
23 |
+
add_action( 'wc_stripe_webhook_charge_dispute_closed', 'wc_stripe_charge_dispute_closed', 10, 1 );
|
24 |
+
add_action( 'wc_stripe_webhook_review_opened', 'wc_stripe_review_opened', 10, 1 );
|
25 |
+
add_action( 'wc_stripe_webhook_review_closed', 'wc_stripe_review_closed', 10, 1 );
|
26 |
Â
|
27 |
Â
/**
|
28 |
Â
* Filters
|
includes/wc-stripe-webhook-functions.php
CHANGED
@@ -1,17 +1,17 @@
|
|
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
|
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 |
Â
if ( isset( $source->metadata['order_id'] ) ) {
|
16 |
Â
$order = wc_get_order( wc_stripe_filter_order_id( $source->metadata['order_id'], $source ) );
|
17 |
Â
} else {
|
@@ -59,7 +59,7 @@ function wc_stripe_process_source_chargeable( $source, $request ) {
|
|
59 |
Â
/**
|
60 |
Â
* When the charge has succeeded, the order should be completed.
|
61 |
Â
*
|
62 |
-
* @param \Stripe\Charge
|
63 |
Â
* @param WP_REST_Request $request
|
64 |
Â
*
|
65 |
Â
* @since 3.0.5
|
@@ -89,12 +89,18 @@ function wc_stripe_process_charge_succeeded( $charge, $request ) {
|
|
89 |
Â
* after the source is chargeable.
|
90 |
Â
*/
|
91 |
Â
if ( $payment_method instanceof WC_Payment_Gateway_Stripe && ! $payment_method->synchronous ) {
|
92 |
-
|
93 |
Â
// If the order's charge status is not equal to charge status from Stripe, then complete_payment.
|
94 |
Â
if ( $order->get_meta( WC_Stripe_Constants::CHARGE_STATUS ) != $charge->status ) {
|
95 |
Â
// want to prevent plugin from processing capture_charge since charge has already been captured.
|
96 |
Â
remove_action( 'woocommerce_order_status_completed', 'wc_stripe_order_status_completed' );
|
97 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
98 |
Â
// call payment complete so shipping, emails, etc are triggered.
|
99 |
Â
$payment_method->payment_object->payment_complete( $order, $charge );
|
100 |
Â
$order->add_order_note( __( 'Charge.succeeded webhook received. Payment has been completed.', 'woo-stripe-payment' ) );
|
@@ -105,7 +111,7 @@ function wc_stripe_process_charge_succeeded( $charge, $request ) {
|
|
105 |
Â
/**
|
106 |
Â
*
|
107 |
Â
* @param \Stripe\PaymentIntent $intent
|
108 |
-
* @param WP_REST_Request
|
109 |
Â
*
|
110 |
Â
* @since 3.1.0
|
111 |
Â
* @package Stripe/Functions
|
@@ -144,7 +150,7 @@ function wc_stripe_process_payment_intent_succeeded( $intent, $request ) {
|
|
144 |
Â
|
145 |
Â
/**
|
146 |
Â
*
|
147 |
-
* @param \Stripe\Charge
|
148 |
Â
* @param WP_REST_Request $request
|
149 |
Â
*
|
150 |
Â
* @since 3.1.1
|
@@ -222,19 +228,28 @@ function wc_stripe_process_create_refund( $charge ) {
|
|
222 |
Â
|
223 |
Â
// Update the refund in Stripe with metadata
|
224 |
Â
if ( ! is_wp_error( $result ) ) {
|
Â
|
|
225 |
Â
$order->add_order_note( sprintf( __( 'Order refunded in Stripe. Amount: %s', 'woo-stripe-payment' ), $result->get_formatted_refund_amount() ) );
|
226 |
-
|
227 |
Â
'metadata' => array(
|
228 |
Â
'order_id' => $order->get_id(),
|
229 |
Â
'created_via' => 'stripe_dashboard'
|
230 |
Â
)
|
231 |
Â
) );
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
232 |
Â
} else {
|
233 |
Â
throw new Exception( $result->get_error_message() );
|
234 |
Â
}
|
235 |
Â
}
|
236 |
Â
}
|
237 |
-
}
|
Â
|
|
238 |
Â
wc_stripe_log_error( sprintf( 'Error processing refund webhook. Error: %s', $e->getMessage() ) );
|
239 |
Â
}
|
240 |
Â
}
|
@@ -251,3 +266,92 @@ function wc_stripe_retry_source_chargeable( $source_id ) {
|
|
251 |
Â
wc_stripe_process_source_chargeable( $source, null );
|
252 |
Â
}
|
253 |
Â
}
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
Â
<?php
|
2 |
+
|
3 |
Â
defined( 'ABSPATH' ) || exit();
|
4 |
Â
|
5 |
Â
/**
|
6 |
Â
* Processes the charge via webhooks for local payment methods like P24, EPS, etc.
|
7 |
Â
*
|
8 |
+
* @param \Stripe\Source $source
|
9 |
Â
* @param WP_REST_Request $request
|
10 |
Â
*
|
11 |
Â
* @since 3.0.0
|
12 |
Â
* @package Stripe/Functions
|
13 |
Â
*/
|
14 |
Â
function wc_stripe_process_source_chargeable( $source, $request ) {
|
Â
|
|
15 |
Â
if ( isset( $source->metadata['order_id'] ) ) {
|
16 |
Â
$order = wc_get_order( wc_stripe_filter_order_id( $source->metadata['order_id'], $source ) );
|
17 |
Â
} else {
|
59 |
Â
/**
|
60 |
Â
* When the charge has succeeded, the order should be completed.
|
61 |
Â
*
|
62 |
+
* @param \Stripe\Charge $charge
|
63 |
Â
* @param WP_REST_Request $request
|
64 |
Â
*
|
65 |
Â
* @since 3.0.5
|
89 |
Â
* after the source is chargeable.
|
90 |
Â
*/
|
91 |
Â
if ( $payment_method instanceof WC_Payment_Gateway_Stripe && ! $payment_method->synchronous ) {
|
Â
|
|
92 |
Â
// If the order's charge status is not equal to charge status from Stripe, then complete_payment.
|
93 |
Â
if ( $order->get_meta( WC_Stripe_Constants::CHARGE_STATUS ) != $charge->status ) {
|
94 |
Â
// want to prevent plugin from processing capture_charge since charge has already been captured.
|
95 |
Â
remove_action( 'woocommerce_order_status_completed', 'wc_stripe_order_status_completed' );
|
96 |
Â
|
97 |
+
if ( stripe_wc()->advanced_settings->is_fee_enabled() ) {
|
98 |
+
// retrieve the balance transaction
|
99 |
+
$balance_transaction = WC_Stripe_Gateway::load()->mode( wc_stripe_order_mode( $order ) )->balanceTransactions->retrieve( $charge->balance_transaction );
|
100 |
+
if ( ! is_wp_error( $balance_transaction ) ) {
|
101 |
+
$charge->balance_transaction = $balance_transaction;
|
102 |
+
}
|
103 |
+
}
|
104 |
Â
// call payment complete so shipping, emails, etc are triggered.
|
105 |
Â
$payment_method->payment_object->payment_complete( $order, $charge );
|
106 |
Â
$order->add_order_note( __( 'Charge.succeeded webhook received. Payment has been completed.', 'woo-stripe-payment' ) );
|
111 |
Â
/**
|
112 |
Â
*
|
113 |
Â
* @param \Stripe\PaymentIntent $intent
|
114 |
+
* @param WP_REST_Request $request
|
115 |
Â
*
|
116 |
Â
* @since 3.1.0
|
117 |
Â
* @package Stripe/Functions
|
150 |
Â
|
151 |
Â
/**
|
152 |
Â
*
|
153 |
+
* @param \Stripe\Charge $charge
|
154 |
Â
* @param WP_REST_Request $request
|
155 |
Â
*
|
156 |
Â
* @since 3.1.1
|
228 |
Â
|
229 |
Â
// Update the refund in Stripe with metadata
|
230 |
Â
if ( ! is_wp_error( $result ) ) {
|
231 |
+
$client = WC_Stripe_Gateway::load( $mode );
|
232 |
Â
$order->add_order_note( sprintf( __( 'Order refunded in Stripe. Amount: %s', 'woo-stripe-payment' ), $result->get_formatted_refund_amount() ) );
|
233 |
+
$client->refunds->update( $refund->id, array(
|
234 |
Â
'metadata' => array(
|
235 |
Â
'order_id' => $order->get_id(),
|
236 |
Â
'created_via' => 'stripe_dashboard'
|
237 |
Â
)
|
238 |
Â
) );
|
239 |
+
if ( stripe_wc()->advanced_settings->is_fee_enabled() ) {
|
240 |
+
// retrieve the charge but with expanded objects so fee and net can be calculated.
|
241 |
+
$charge = $client->charges->retrieve( $charge->id, array( 'expand' => array( 'balance_transaction', 'refunds.data.balance_transaction' ) ) );
|
242 |
+
if ( ! is_wp_error( $charge ) ) {
|
243 |
+
WC_Stripe_Utils::add_balance_transaction_to_order( $charge, $order, true );
|
244 |
+
}
|
245 |
+
}
|
246 |
Â
} else {
|
247 |
Â
throw new Exception( $result->get_error_message() );
|
248 |
Â
}
|
249 |
Â
}
|
250 |
Â
}
|
251 |
+
}
|
252 |
+
catch ( Exception $e ) {
|
253 |
Â
wc_stripe_log_error( sprintf( 'Error processing refund webhook. Error: %s', $e->getMessage() ) );
|
254 |
Â
}
|
255 |
Â
}
|
266 |
Â
wc_stripe_process_source_chargeable( $source, null );
|
267 |
Â
}
|
268 |
Â
}
|
269 |
+
|
270 |
+
/**
|
271 |
+
* @param Stripe\Dispute $dispute
|
272 |
+
*/
|
273 |
+
function wc_stripe_charge_dispute_created( $dispute ) {
|
274 |
+
if ( stripe_wc()->advanced_settings->is_dispute_created_enabled() ) {
|
275 |
+
$order = wc_stripe_get_order_from_transaction( $dispute->charge );
|
276 |
+
if ( ! $order ) {
|
277 |
+
wc_stripe_log_info( sprintf( 'No order found for charge %s. Dispute %s', $dispute->charge, $dispute->id ) );
|
278 |
+
} else {
|
279 |
+
$current_status = $order->get_status();
|
280 |
+
$message = sprintf( __( 'A dispute has been created for charge %1$s. Dispute status: %2$s.', 'woo-stripe-payment' ), $dispute->charge, strtoupper( $dispute->status ) );
|
281 |
+
$order->update_status( apply_filters( 'wc_stripe_dispute_created_order_status', stripe_wc()->advanced_settings->get_option( 'dispute_created_status', 'on-hold' ), $dispute, $order ),
|
282 |
+
$message );
|
283 |
+
|
284 |
+
// update the dispute with metadata that can be used later
|
285 |
+
WC_Stripe_Gateway::load( wc_stripe_order_mode( $order ) )->disputes->update( $dispute->id, array(
|
286 |
+
'metadata' => array(
|
287 |
+
'order_id' => $order->get_id(),
|
288 |
+
'prev_order_status' => $current_status
|
289 |
+
)
|
290 |
+
) );
|
291 |
+
// @todo send an email to the admin so they know a dispute was created
|
292 |
+
}
|
293 |
+
}
|
294 |
+
}
|
295 |
+
|
296 |
+
/**
|
297 |
+
* @param Stripe\Dispute $dispute
|
298 |
+
*/
|
299 |
+
function wc_stripe_charge_dispute_closed( $dispute ) {
|
300 |
+
if ( stripe_wc()->advanced_settings->is_dispute_closed_enabled() ) {
|
301 |
+
if ( isset( $dispute->metadata['order_id'] ) ) {
|
302 |
+
$order = wc_get_order( absint( $dispute->metadata['order_id'] ) );
|
303 |
+
} else {
|
304 |
+
$order = wc_stripe_get_order_from_transaction( $dispute->charge );
|
305 |
+
}
|
306 |
+
if ( ! $order ) {
|
307 |
+
return wc_stripe_log_info( sprintf( 'No order found for charge %s. Dispute %s', $dispute->charge, $dispute->id ) );
|
308 |
+
}
|
309 |
+
$message = sprintf( __( 'Dispute %1$s has been closed. Result: %2$s.', 'woo-stripe-payment' ), $dispute->id, $dispute->status );
|
310 |
+
switch ( $dispute->status ) {
|
311 |
+
case 'won':
|
312 |
+
//set the order's status back to what it was before the dispute
|
313 |
+
if ( isset( $dispute->metadata['prev_order_status'] ) ) {
|
314 |
+
$status = $dispute->metadata['prev_order_status'];
|
315 |
+
} else {
|
316 |
+
$status = $order->needs_processing() ? 'processing' : 'completed';
|
317 |
+
}
|
318 |
+
$order->update_status( $dispute->metadata['prev_order_status'], $message );
|
319 |
+
break;
|
320 |
+
case 'lost':
|
321 |
+
$order->update_status( apply_filters( 'wc_stripe_dispute_closed_order_status', 'failed', $dispute, $order ), $message );
|
322 |
+
}
|
323 |
+
}
|
324 |
+
}
|
325 |
+
|
326 |
+
/**
|
327 |
+
* @param Stripe\Review $review
|
328 |
+
*/
|
329 |
+
function wc_stripe_review_opened( $review ) {
|
330 |
+
if ( stripe_wc()->advanced_settings->is_review_opened_enabled() ) {
|
331 |
+
$order = wc_stripe_get_order_from_transaction( $review->charge );
|
332 |
+
if ( $order ) {
|
333 |
+
$status = $order->get_status();
|
334 |
+
$order->update_meta_data( WC_Stripe_Constants::PREV_STATUS, $status );
|
335 |
+
$message = sprintf( __( 'A review has been opened for charge %1$s. Reason: %2$s.', 'woo-stripe-payment' ), $review->charge, strtoupper( $review->reason ) );
|
336 |
+
$order->update_status( apply_filters( 'wc_stripe_review_opened_order_status', 'on-hold', $review, $order ), $message );
|
337 |
+
}
|
338 |
+
}
|
339 |
+
}
|
340 |
+
|
341 |
+
/**
|
342 |
+
* @param Stripe\Review $review
|
343 |
+
*/
|
344 |
+
function wc_stripe_review_closed( $review ) {
|
345 |
+
if ( stripe_wc()->advanced_settings->is_review_closed_enabled() ) {
|
346 |
+
$order = wc_stripe_get_order_from_transaction( $review->charge );
|
347 |
+
if ( $order ) {
|
348 |
+
$status = $order->get_meta( WC_Stripe_Constants::PREV_STATUS );
|
349 |
+
if ( ! $status ) {
|
350 |
+
$status = $order->needs_processing() ? 'processing' : 'completed';
|
351 |
+
}
|
352 |
+
$order->delete_meta_data( WC_Stripe_Constants::PREV_STATUS );
|
353 |
+
$message = sprintf( __( 'A review has been closed for charge %1$s. Reason: %2$s.', 'woo-stripe-payment' ), $review->charge, strtoupper( $review->reason ) );
|
354 |
+
$order->update_status( $status, $message );
|
355 |
+
}
|
356 |
+
}
|
357 |
+
}
|
packages/blocks/assets/js/payment-methods/local-payment/klarna.js
ADDED
@@ -0,0 +1,48 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
import {registerPaymentMethod} from '@woocommerce/blocks-registry';
|
2 |
+
import {getSettings, isTestMode} from "../util";
|
3 |
+
import {LocalPaymentIntentContent} from './local-payment-method';
|
4 |
+
import {PaymentMethodLabel, PaymentMethod} from "../../components/checkout";
|
5 |
+
import {canMakePayment} from "./local-payment-method";
|
6 |
+
import {__} from "@wordpress/i18n";
|
7 |
+
|
8 |
+
const getData = getSettings('stripe_klarna_data');
|
9 |
+
|
10 |
+
const KlarnaPaymentMethod = (props) => {
|
11 |
+
return (
|
12 |
+
<>
|
13 |
+
{isTestMode() &&
|
14 |
+
<div className="wc-stripe-klarna__testmode">
|
15 |
+
<label>{__('Test mode sms', 'woo-stripe-payment')}:</label> <span>123456</span>
|
16 |
+
</div>}
|
17 |
+
<LocalPaymentIntentContent {...props}/>
|
18 |
+
</>
|
19 |
+
)
|
20 |
+
}
|
21 |
+
|
22 |
+
if (getData()) {
|
23 |
+
registerPaymentMethod({
|
24 |
+
name: getData('name'),
|
25 |
+
label: <PaymentMethodLabel
|
26 |
+
title={getData('title')}
|
27 |
+
paymentMethod={getData('name')}
|
28 |
+
icons={getData('icon')}/>,
|
29 |
+
ariaLabel: 'Klarna',
|
30 |
+
placeOrderButtonLabel: getData('placeOrderButtonLabel'),
|
31 |
+
canMakePayment: canMakePayment(getData, ({settings, billingData, cartTotals}) => {
|
32 |
+
const {country} = billingData;
|
33 |
+
const {currency_code: currency} = cartTotals;
|
34 |
+
const requiredParams = settings('requiredParams');
|
35 |
+
return [currency] in requiredParams && requiredParams[currency].includes(country);
|
36 |
+
}),
|
37 |
+
content: <PaymentMethod
|
38 |
+
content={KlarnaPaymentMethod}
|
39 |
+
getData={getData}
|
40 |
+
confirmationMethod={'confirmKlarnaPayment'}/>,
|
41 |
+
edit: <PaymentMethod content={LocalPaymentIntentContent} getData={getData}/>,
|
42 |
+
supports: {
|
43 |
+
showSavedCards: false,
|
44 |
+
showSaveOption: false,
|
45 |
+
features: getData('features')
|
46 |
+
}
|
47 |
+
})
|
48 |
+
}
|
packages/blocks/assets/js/payment-methods/local-payment/klarna/categories.js
DELETED
@@ -1,39 +0,0 @@
|
|
1 |
-
import {useEffect} from '@wordpress/element';
|
2 |
-
import RadioControlAccordion from "../../../components/checkout/radio-control-accordion";
|
3 |
-
|
4 |
-
export const KlarnaPaymentCategories = ({source, categories, onChange, selected}) => {
|
5 |
-
return (
|
6 |
-
<div className={'wc-stripe-blocks-klarna-container'}>
|
7 |
-
<ul>
|
8 |
-
{categories.map(category => {
|
9 |
-
return <KlarnaPaymentCategory
|
10 |
-
source={source}
|
11 |
-
key={category.type}
|
12 |
-
category={category}
|
13 |
-
onChange={onChange}
|
14 |
-
selected={selected}/>
|
15 |
-
})}
|
16 |
-
</ul>
|
17 |
-
</div>
|
18 |
-
);
|
19 |
-
}
|
20 |
-
|
21 |
-
const KlarnaPaymentCategory = ({source, category, selected, onChange}) => {
|
22 |
-
const checked = category.type === selected;
|
23 |
-
useEffect(() => {
|
24 |
-
Klarna.Payments.load({
|
25 |
-
container: `#klarna-category-${category.type}`,
|
26 |
-
payment_method_category: category.type
|
27 |
-
});
|
28 |
-
}, [source]);
|
29 |
-
const option = {
|
30 |
-
label: category.label,
|
31 |
-
value: category.type,
|
32 |
-
content: (<div id={`klarna-category-${category.type}`}></div>)
|
33 |
-
}
|
34 |
-
return (
|
35 |
-
<li className='wc-stripe-blocks-klarna__category' key={category.type}>
|
36 |
-
<RadioControlAccordion option={option} checked={checked} onChange={onChange}/>
|
37 |
-
</li>
|
38 |
-
)
|
39 |
-
}
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
packages/blocks/assets/js/payment-methods/local-payment/klarna/hooks/index.js
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
export * from './use-create-source';
|
2 |
-
export * from './use-process-payment';
|
Â
|
|
Â
|
packages/blocks/assets/js/payment-methods/local-payment/klarna/hooks/use-create-source.js
DELETED
@@ -1,241 +0,0 @@
|
|
1 |
-
import {useEffect, useState, useRef, useCallback} from '@wordpress/element';
|
2 |
-
import {useStripe} from "@stripe/react-stripe-js";
|
3 |
-
import {useStripeError} from "../../../hooks";
|
4 |
-
import {getDefaultSourceArgs, getRoute, isAddressValid, StripeError, storeInCache, getFromCache} from "../../../util";
|
5 |
-
import apiFetch from "@wordpress/api-fetch";
|
6 |
-
|
7 |
-
export const useCreateSource = (
|
8 |
-
{
|
9 |
-
getData,
|
10 |
-
billing,
|
11 |
-
shippingData,
|
12 |
-
}) => {
|
13 |
-
const stripe = useStripe();
|
14 |
-
const [error, setError] = useStripeError();
|
15 |
-
const abortController = useRef(new AbortController());
|
16 |
-
const currentSourceArgs = useRef({});
|
17 |
-
const oldSourceArgs = useRef({});
|
18 |
-
const [isLoading, setIsLoading] = useState(false);
|
19 |
-
const [source, setSource] = useState(false);
|
20 |
-
const {billingData, cartTotal, cartTotalItems, currency} = billing;
|
21 |
-
const isCheckoutValid = useCallback(({billingData, shippingData}) => {
|
22 |
-
const {needsShipping, shippingAddress} = shippingData;
|
23 |
-
if (isAddressValid(billingData)) {
|
24 |
-
if (needsShipping) {
|
25 |
-
return isAddressValid(shippingAddress);
|
26 |
-
}
|
27 |
-
return true;
|
28 |
-
}
|
29 |
-
return false;
|
30 |
-
}, []);
|
31 |
-
const getLineItems = useCallback((cartTotalItems, currency) => {
|
32 |
-
const items = [];
|
33 |
-
cartTotalItems.forEach(item => {
|
34 |
-
items.push({
|
35 |
-
amount: item.value,
|
36 |
-
currency,
|
37 |
-
description: item.label,
|
38 |
-
quantity: 1
|
39 |
-
});
|
40 |
-
});
|
41 |
-
return items;
|
42 |
-
}, []);
|
43 |
-
|
44 |
-
const getSourceArgs = useCallback(({cartTotal, cartTotalItems, billingData, currency, shippingData}) => {
|
45 |
-
const {first_name, last_name, country} = billingData;
|
46 |
-
const {needsShipping, shippingAddress} = shippingData;
|
47 |
-
let args = getDefaultSourceArgs({
|
48 |
-
type: getData('paymentType'),
|
49 |
-
amount: cartTotal.value,
|
50 |
-
billingData,
|
51 |
-
currency: currency.code,
|
52 |
-
returnUrl: getData('returnUrl')
|
53 |
-
});
|
54 |
-
args = {
|
55 |
-
...args, ...{
|
56 |
-
source_order: {
|
57 |
-
items: getLineItems(cartTotalItems, currency.code)
|
58 |
-
},
|
59 |
-
klarna: {
|
60 |
-
locale: getData('locale'),
|
61 |
-
product: 'payment',
|
62 |
-
purchase_country: country,
|
63 |
-
first_name,
|
64 |
-
last_name
|
65 |
-
}
|
66 |
-
}
|
67 |
-
}
|
68 |
-
if (country == 'US') {
|
69 |
-
args.klarna.custom_payment_methods = 'payin4,installments';
|
70 |
-
}
|
71 |
-
if (needsShipping) {
|
72 |
-
args.klarna = {
|
73 |
-
...args.klarna, ...{
|
74 |
-
shipping_first_name: shippingAddress.first_name,
|
75 |
-
shipping_last_name: shippingAddress.last_name
|
76 |
-
}
|
77 |
-
}
|
78 |
-
args.source_order.shipping = {
|
79 |
-
address: {
|
80 |
-
city: shippingAddress.city || '',
|
81 |
-
country: shippingAddress.country || '',
|
82 |
-
line1: shippingAddress.address_1 || '',
|
83 |
-
line2: shippingAddress.address_2 || '',
|
84 |
-
postal_code: shippingAddress.postcode || '',
|
85 |
-
state: shippingAddress.state || ''
|
86 |
-
}
|
87 |
-
}
|
88 |
-
}
|
89 |
-
oldSourceArgs.current = currentSourceArgs.current;
|
90 |
-
currentSourceArgs.current = args;
|
91 |
-
return args;
|
92 |
-
}, []);
|
93 |
-
const filterUpdateSourceArgs = (args) => {
|
94 |
-
return ['type', 'currency', 'statement_descriptor', 'redirect', 'klarna.product', 'klarna.locale', 'klarna.custom_payment_methods'].reduce((obj, k) => {
|
95 |
-
if (k.indexOf('.') > -1) {
|
96 |
-
let keys = k.split('.');
|
97 |
-
let obj2 = keys.slice(0, keys.length - 1).reduce((obj, k) => {
|
98 |
-
return obj[k];
|
99 |
-
}, obj);
|
100 |
-
k = keys[keys.length - 1];
|
101 |
-
delete obj2[k];
|
102 |
-
return obj;
|
103 |
-
}
|
104 |
-
delete obj[k];
|
105 |
-
return obj;
|
106 |
-
}, args);
|
107 |
-
}
|
108 |
-
|
109 |
-
const compareSourceArgs = useCallback((args, args2) => {
|
110 |
-
const getArgs = (args1, args2, key = false) => {
|
111 |
-
let newArgs = {};
|
112 |
-
if (args1 && typeof args1 === 'object' && !Array.isArray(args1)) {
|
113 |
-
for (let key of Object.keys(args1)) {
|
114 |
-
if (typeof args1[key] === 'object' && !Array.isArray(args1[key])) {
|
115 |
-
newArgs[key] = getArgs(args1[key], args2[key]);
|
116 |
-
} else {
|
117 |
-
newArgs[key] = args2[key];
|
118 |
-
}
|
119 |
-
}
|
120 |
-
} else {
|
121 |
-
newArgs = args1;
|
122 |
-
}
|
123 |
-
|
124 |
-
return newArgs;
|
125 |
-
}
|
126 |
-
const newArgs = getArgs(args, args2);
|
127 |
-
return JSON.stringify(args) == JSON.stringify(newArgs);
|
128 |
-
}, []);
|
129 |
-
const createSource = useCallback(async (
|
130 |
-
{
|
131 |
-
billingData,
|
132 |
-
shippingData,
|
133 |
-
cartTotal,
|
134 |
-
cartTotalItems,
|
135 |
-
currency,
|
136 |
-
}) => {
|
137 |
-
let args = getSourceArgs({
|
138 |
-
cartTotal,
|
139 |
-
cartTotalItems,
|
140 |
-
billingData,
|
141 |
-
currency,
|
142 |
-
shippingData
|
143 |
-
});
|
144 |
-
try {
|
145 |
-
let result = await stripe.createSource(args);
|
146 |
-
if (result.error) {
|
147 |
-
throw new StripeError(result.error);
|
148 |
-
}
|
149 |
-
storeInCache('klarna:source', {[currency.code]: {source: result.source, args: currentSourceArgs.current}});
|
150 |
-
setSource(result.source);
|
151 |
-
} catch (err) {
|
152 |
-
console.log(err);
|
153 |
-
setError(err.error);
|
154 |
-
}
|
155 |
-
}, [stripe]);
|
156 |
-
|
157 |
-
const updateSource = useCallback(async ({source, updates, currency}) => {
|
158 |
-
|
159 |
-
const data = {
|
160 |
-
updates,
|
161 |
-
source_id: source.id,
|
162 |
-
client_secret: source.client_secret,
|
163 |
-
payment_method: getData('name')
|
164 |
-
};
|
165 |
-
try {
|
166 |
-
abortController.current.abort();
|
167 |
-
abortController.current = new AbortController();
|
168 |
-
let result = await apiFetch({
|
169 |
-
url: getRoute('update/source'),
|
170 |
-
method: 'POST',
|
171 |
-
data,
|
172 |
-
signal: abortController.current.signal
|
173 |
-
});
|
174 |
-
if (result.source) {
|
175 |
-
storeInCache('klarna:source', {[currency]: {source, args: currentSourceArgs.current}});
|
176 |
-
setSource(result.source);
|
177 |
-
}
|
178 |
-
} catch (err) {
|
179 |
-
console.log('update aborted');
|
180 |
-
}
|
181 |
-
}, []);
|
182 |
-
|
183 |
-
// Create the source if the required data is available
|
184 |
-
useEffect(() => {
|
185 |
-
if (!source) {
|
186 |
-
if (getFromCache('klarna:source')?.[currency.code]) {
|
187 |
-
const {source, args} = getFromCache('klarna:source')[currency.code];
|
188 |
-
currentSourceArgs.current = args;
|
189 |
-
setSource(source);
|
190 |
-
} else {
|
191 |
-
if (stripe && isCheckoutValid({billingData, shippingData})) {
|
192 |
-
setIsLoading(true);
|
193 |
-
createSource({
|
194 |
-
billingData,
|
195 |
-
shippingData,
|
196 |
-
cartTotal,
|
197 |
-
cartTotalItems,
|
198 |
-
currency
|
199 |
-
}).then(() => setIsLoading(false));
|
200 |
-
}
|
201 |
-
}
|
202 |
-
}
|
203 |
-
}, [
|
204 |
-
stripe,
|
205 |
-
source?.id,
|
206 |
-
createSource,
|
207 |
-
billingData,
|
208 |
-
cartTotal.value,
|
209 |
-
shippingData,
|
210 |
-
setIsLoading,
|
211 |
-
cartTotalItems,
|
212 |
-
currency.code
|
213 |
-
]);
|
214 |
-
|
215 |
-
// update the source if data has changed and the source exists
|
216 |
-
useEffect(() => {
|
217 |
-
if (stripe && source) {
|
218 |
-
// perform a comparison to see if the source needs to be updated
|
219 |
-
const updates = filterUpdateSourceArgs(getSourceArgs({
|
220 |
-
billingData,
|
221 |
-
cartTotal,
|
222 |
-
cartTotalItems,
|
223 |
-
currency,
|
224 |
-
shippingData
|
225 |
-
}));
|
226 |
-
if (!compareSourceArgs(updates, oldSourceArgs.current)) {
|
227 |
-
updateSource({source, updates, currency: currency.code});
|
228 |
-
}
|
229 |
-
}
|
230 |
-
}, [
|
231 |
-
stripe,
|
232 |
-
source?.id,
|
233 |
-
billingData,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
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
packages/blocks/assets/js/payment-methods/local-payment/klarna/hooks/use-process-payment.js
DELETED
@@ -1,43 +0,0 @@
|
|
1 |
-
import {useEffect} from '@wordpress/element';
|
2 |
-
import {ensureErrorResponse, ensureSuccessResponse, deleteFromCache} from "../../../util";
|
3 |
-
import {__} from "@wordpress/i18n";
|
4 |
-
|
5 |
-
export const useProcessPayment = (
|
6 |
-
{
|
7 |
-
payment_method,
|
8 |
-
source_id,
|
9 |
-
paymentCategory,
|
10 |
-
onPaymentProcessing,
|
11 |
-
responseTypes
|
12 |
-
}) => {
|
13 |
-
useEffect(() => {
|
14 |
-
const unsubscribe = onPaymentProcessing(() => {
|
15 |
-
return new Promise(resolve => {
|
16 |
-
// authorize the Klarna payment
|
17 |
-
Klarna.Payments.authorize({
|
18 |
-
payment_method_category: paymentCategory
|
19 |
-
}, (response) => {
|
20 |
-
if (response.approved) {
|
21 |
-
deleteFromCache('klarna:source');
|
22 |
-
// add the source to the response
|
23 |
-
resolve(ensureSuccessResponse(responseTypes, {
|
24 |
-
meta: {
|
25 |
-
paymentMethodData: {
|
26 |
-
[`${payment_method}_token_key`]: source_id
|
27 |
-
}
|
28 |
-
}
|
29 |
-
}));
|
30 |
-
} else {
|
31 |
-
resolve(ensureErrorResponse(responseTypes, response.error || __('Your purchase is not approved.', 'woo-stripe-payment')));
|
32 |
-
}
|
33 |
-
});
|
34 |
-
});
|
35 |
-
});
|
36 |
-
return () => unsubscribe();
|
37 |
-
}, [
|
38 |
-
source_id,
|
39 |
-
paymentCategory,
|
40 |
-
onPaymentProcessing
|
41 |
-
]
|
42 |
-
);
|
43 |
-
}
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
packages/blocks/assets/js/payment-methods/local-payment/klarna/index.js
DELETED
@@ -1,140 +0,0 @@
|
|
1 |
-
import {useEffect, useState} from '@wordpress/element';
|
2 |
-
import {registerPaymentMethod} from '@woocommerce/blocks-registry';
|
3 |
-
import {__} from '@wordpress/i18n';
|
4 |
-
import {useProcessCheckoutError} from '../../hooks';
|
5 |
-
import {
|
6 |
-
getSettings,
|
7 |
-
initStripe,
|
8 |
-
isTestMode
|
9 |
-
} from "../../util";
|
10 |
-
import {PaymentMethodLabel, PaymentMethod} from "../../../components/checkout";
|
11 |
-
import {canMakePayment} from "../local-payment-method";
|
12 |
-
import {Elements} from "@stripe/react-stripe-js";
|
13 |
-
import {KlarnaPaymentCategories} from "./categories";
|
14 |
-
import {KlarnaLoader} from "./loader";
|
15 |
-
import {useCreateSource, useProcessPayment} from "./hooks";
|
16 |
-
import './styles.scss';
|
17 |
-
|
18 |
-
const getData = getSettings('stripe_klarna_data');
|
19 |
-
|
20 |
-
const KlarnaContainer = (props) => {
|
21 |
-
return (
|
22 |
-
<Elements stripe={initStripe}>
|
23 |
-
<KlarnaPaymentMethod {...props}/>
|
24 |
-
</Elements>
|
25 |
-
);
|
26 |
-
}
|
27 |
-
|
28 |
-
const KlarnaPaymentMethod = (
|
29 |
-
{
|
30 |
-
getData,
|
31 |
-
billing,
|
32 |
-
shippingData,
|
33 |
-
emitResponse,
|
34 |
-
eventRegistration
|
35 |
-
}) => {
|
36 |
-
const {responseTypes} = emitResponse;
|
37 |
-
const {onPaymentProcessing, onCheckoutAfterProcessingWithError} = eventRegistration;
|
38 |
-
const [selected, setSelected] = useState('');
|
39 |
-
const [klarnaInitialized, setKlarnaInitialized] = useState(false);
|
40 |
-
const getCategoriesFromSource = (source) => {
|
41 |
-
const paymentMethodCategories = source.klarna.payment_method_categories.split(',');
|
42 |
-
const categories = [];
|
43 |
-
for (let type of Object.keys(getData('categories'))) {
|
44 |
-
if (paymentMethodCategories.includes(type)) {
|
45 |
-
categories.push({type, label: getData('categories')[type]});
|
46 |
-
}
|
47 |
-
}
|
48 |
-
return categories;
|
49 |
-
}
|
50 |
-
|
51 |
-
const {source, isLoading} = useCreateSource({
|
52 |
-
getData,
|
53 |
-
billing,
|
54 |
-
shippingData
|
55 |
-
});
|
56 |
-
|
57 |
-
useProcessPayment({
|
58 |
-
payment_method: getData('name'),
|
59 |
-
source_id: source.id,
|
60 |
-
paymentCategory: selected,
|
61 |
-
onPaymentProcessing,
|
62 |
-
responseTypes
|
63 |
-
});
|
64 |
-
|
65 |
-
useProcessCheckoutError({responseTypes, subscriber: onCheckoutAfterProcessingWithError});
|
66 |
-
|
67 |
-
useEffect(() => {
|
68 |
-
if (!selected && source) {
|
69 |
-
const categories = getCategoriesFromSource(source);
|
70 |
-
if (categories.length) {
|
71 |
-
setSelected(categories.shift().type);
|
72 |
-
}
|
73 |
-
|
74 |
-
}
|
75 |
-
}, [source]);
|
76 |
-
|
77 |
-
useEffect(() => {
|
78 |
-
if (source) {
|
79 |
-
Klarna.Payments.init({
|
80 |
-
client_token: source.klarna.client_token
|
81 |
-
});
|
82 |
-
setKlarnaInitialized(true);
|
83 |
-
}
|
84 |
-
}, [source?.id]);
|
85 |
-
|
86 |
-
if (source && klarnaInitialized) {
|
87 |
-
const categories = getCategoriesFromSource(source);
|
88 |
-
return (
|
89 |
-
<>
|
90 |
-
{isTestMode() &&
|
91 |
-
<div className="wc-stripe-klarna__testmode">
|
92 |
-
<label>{__('Test mode sms', 'woo-stripe-payment')}:</label> <span>123456</span>
|
93 |
-
</div>}
|
94 |
-
<KlarnaPaymentCategories
|
95 |
-
source={source}
|
96 |
-
categories={categories}
|
97 |
-
selected={!selected && categories.length > 0 ? categories[0].type : selected}
|
98 |
-
onChange={setSelected}/>
|
99 |
-
</>
|
100 |
-
)
|
101 |
-
} else {
|
102 |
-
if (isLoading) {
|
103 |
-
return <KlarnaLoader/>
|
104 |
-
}
|
105 |
-
}
|
106 |
-
return (
|
107 |
-
<div className='wc-stripe-blocks-klarna__notice'>
|
108 |
-
{__('Please fill out all required fields before paying with Klarna.', 'woo-stripe-payment')}
|
109 |
-
</div>
|
110 |
-
);
|
111 |
-
}
|
112 |
-
|
113 |
-
if (getData()) {
|
114 |
-
registerPaymentMethod({
|
115 |
-
name: getData('name'),
|
116 |
-
label: <PaymentMethodLabel
|
117 |
-
title={getData('title')}
|
118 |
-
paymentMethod={getData('name')}
|
119 |
-
icons={getData('icon')}/>,
|
120 |
-
ariaLabel: 'Klarna',
|
121 |
-
placeOrderButtonLabel: getData('placeOrderButtonLabel'),
|
122 |
-
canMakePayment: canMakePayment(getData, ({settings, billingData, cartTotals}) => {
|
123 |
-
const {country} = billingData;
|
124 |
-
const {currency_code: currency} = cartTotals;
|
125 |
-
const requiredParams = settings('requiredParams');
|
126 |
-
return [currency] in requiredParams && requiredParams[currency].includes(country);
|
127 |
-
}),
|
128 |
-
content: <PaymentMethod
|
129 |
-
getData={getData}
|
130 |
-
content={KlarnaContainer}/>,
|
131 |
-
edit: <PaymentMethod
|
132 |
-
getData={getData}
|
133 |
-
content={KlarnaContainer}/>,
|
134 |
-
supports: {
|
135 |
-
showSavedCards: false,
|
136 |
-
showSaveOption: false,
|
137 |
-
features: getData('features')
|
138 |
-
}
|
139 |
-
})
|
140 |
-
}
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
packages/blocks/assets/js/payment-methods/local-payment/klarna/loader.js
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
export const KlarnaLoader = () => {
|
2 |
-
return (
|
3 |
-
<div className="wc-stripe-klarna-loader">
|
4 |
-
<div></div>
|
5 |
-
<div></div>
|
6 |
-
<div></div>
|
7 |
-
</div>
|
8 |
-
)
|
9 |
-
}
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
packages/blocks/assets/js/payment-methods/local-payment/klarna/styles.scss
DELETED
@@ -1,67 +0,0 @@
|
|
1 |
-
.wc-stripe-klarna-loader {
|
2 |
-
display: flex;
|
3 |
-
justify-content: center;
|
4 |
-
position: relative;
|
5 |
-
width: 100%;
|
6 |
-
height: 30px;
|
7 |
-
box-sizing: border-box;
|
8 |
-
transform: scale(.65);
|
9 |
-
|
10 |
-
div {
|
11 |
-
box-sizing: border-box;
|
12 |
-
display: block;
|
13 |
-
position: absolute;
|
14 |
-
box-sizing: border-box;
|
15 |
-
width: 30px;
|
16 |
-
height: 30px;
|
17 |
-
border: 3px solid #000;
|
18 |
-
border-radius: 50%;
|
19 |
-
animation: klarna-payments-loader 1.3s cubic-bezier(0.5, 0, 0.5, 1) infinite;
|
20 |
-
border-color: #000 transparent transparent transparent;
|
21 |
-
|
22 |
-
&:nth-child(1) {
|
23 |
-
animation-delay: -0.45s;
|
24 |
-
}
|
25 |
-
|
26 |
-
&:nth-child(2) {
|
27 |
-
animation-delay: -0.3s;
|
28 |
-
}
|
29 |
-
|
30 |
-
&:nth-child(3) {
|
31 |
-
animation-delay: -0.15s;
|
32 |
-
}
|
33 |
-
}
|
34 |
-
}
|
35 |
-
|
36 |
-
@keyframes klarna-payments-loader {
|
37 |
-
0% {
|
38 |
-
transform: rotate(0deg);
|
39 |
-
}
|
40 |
-
100% {
|
41 |
-
transform: rotate(360deg);
|
42 |
-
}
|
43 |
-
}
|
44 |
-
|
45 |
-
.wc-stripe-blocks-klarna-container {
|
46 |
-
ul {
|
47 |
-
list-style: none;
|
48 |
-
margin: 0;
|
49 |
-
padding: 0;
|
50 |
-
}
|
51 |
-
|
52 |
-
.wc-stripe-blocks-radio-accordion {
|
53 |
-
.wc-stripe-blocks-radio-accordion__content {
|
54 |
-
display: none;
|
55 |
-
|
56 |
-
&.wc-stripe-blocks-radio-accordion__content-visible {
|
57 |
-
display: block;
|
58 |
-
}
|
59 |
-
}
|
60 |
-
}
|
61 |
-
}
|
62 |
-
|
63 |
-
.wc-stripe-klarna__testmode {
|
64 |
-
label {
|
65 |
-
display: inline-block;
|
66 |
-
}
|
67 |
-
}
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
packages/blocks/assets/js/payment-methods/local-payment/styles.scss
CHANGED
@@ -189,3 +189,9 @@
|
|
189 |
Â
}
|
190 |
Â
}
|
191 |
Â
}
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
189 |
Â
}
|
190 |
Â
}
|
191 |
Â
}
|
192 |
+
|
193 |
+
.wc-stripe-klarna__testmode {
|
194 |
+
label {
|
195 |
+
display: inline-block;
|
196 |
+
}
|
197 |
+
}
|
packages/blocks/build/commons.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
Â
/*! For license information please see commons.js.LICENSE.txt */
|
2 |
-
(self.webpackChunkwc_stripe_name_=self.webpackChunkwc_stripe_name_||[]).push([[351],{7228:e=>{e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}},2858:e=>{e.exports=function(e){if(Array.isArray(e))return e}},3646:(e,t,n)=>{var r=n(7228);e.exports=function(e){if(Array.isArray(e))return r(e)}},1506:e=>{e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},8926:e=>{function t(e,t,n,r,a,o,i){try{var c=e[o](i),s=c.value}catch(e){return void n(e)}c.done?t(s):Promise.resolve(s).then(r,a)}e.exports=function(e){return function(){var n=this,r=arguments;return new Promise((function(a,o){var i=e.apply(n,r);function c(e){t(i,a,o,c,s,"next",e)}function s(e){t(i,a,o,c,s,"throw",e)}c(void 0)}))}}},4575:e=>{e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},9100:(e,t,n)=>{var r=n(9489),a=n(7067);function o(t,n,i){return a()?e.exports=o=Reflect.construct:e.exports=o=function(e,t,n){var a=[null];a.push.apply(a,t);var o=new(Function.bind.apply(e,a));return n&&r(o,n.prototype),o},o.apply(null,arguments)}e.exports=o},3913:e=>{function t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}},9713:e=>{e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},7154:e=>{function t(){return e.exports=t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},t.apply(this,arguments)}e.exports=t},9754:e=>{function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},t(n)}e.exports=t},2205:(e,t,n)=>{var r=n(9489);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}},5318:e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}}},430:e=>{e.exports=function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}},7067:e=>{e.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}},6860:e=>{e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},3884:e=>{e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,a=!1,o=void 0;try{for(var i,c=e[Symbol.iterator]();!(r=(i=c.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(a)throw o}}return n}}},521:e=>{e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},8206:e=>{e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},6479:(e,t,n)=>{var r=n(7316);e.exports=function(e,t){if(null==e)return{};var n,a,o=r(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}},7316:e=>{e.exports=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}},8585:(e,t,n)=>{var r=n(8),a=n(1506);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?a(e):t}},9489:e=>{function t(n,r){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(n,r)}e.exports=t},3038:(e,t,n)=>{var r=n(2858),a=n(3884),o=n(379),i=n(521);e.exports=function(e,t){return r(e)||a(e,t)||o(e,t)||i()}},319:(e,t,n)=>{var r=n(3646),a=n(6860),o=n(379),i=n(8206);e.exports=function(e){return r(e)||a(e)||o(e)||i()}},8:e=>{function t(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=t=function(e){return typeof e}:e.exports=t=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(n)}e.exports=t},379:(e,t,n)=>{var r=n(7228);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}},5957:(e,t,n)=>{var r=n(9754),a=n(9489),o=n(430),i=n(9100);function c(t){var n="function"==typeof Map?new Map:void 0;return e.exports=c=function(e){if(null===e||!o(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return i(e,arguments,r(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),a(t,e)},c(t)}e.exports=c},6664:function(e,t,n){!function(e,t){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,a=!1,o=void 0;try{for(var i,c=e[Symbol.iterator]();!(r=(i=c.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(a)throw o}}return n}}(e,t)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;function i(){}function c(){}c.resetWarningCache=i;var s,u=(function(e){e.exports=function(){function e(e,t,n,r,a,o){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==o){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:c,resetWarningCache:i};return n.PropTypes=n,n}()}(s={exports:{}},s.exports),s.exports),l=function(e){return null!==e&&"object"===n(e)},p="[object Object]",d=function e(t,n){if(!l(t)||!l(n))return t===n;var r=Array.isArray(t);if(r!==Array.isArray(n))return!1;var a=Object.prototype.toString.call(t)===p;if(a!==(Object.prototype.toString.call(n)===p))return!1;if(!a&&!r)return!1;var o=Object.keys(t),i=Object.keys(n);if(o.length!==i.length)return!1;for(var c={},s=0;s<o.length;s+=1)c[o[s]]=!0;for(var u=0;u<i.length;u+=1)c[i[u]]=!0;var d=Object.keys(c);if(d.length!==o.length)return!1;var f=t,m=n;return d.every((function(t){return e(f[t],m[t])}))},f=function(e){var n=t.useRef(e);return t.useEffect((function(){n.current=e}),[e]),n.current},m=function(e){if(null===e||l(t=e)&&"function"==typeof t.elements&&"function"==typeof t.createToken&&"function"==typeof t.createPaymentMethod&&"function"==typeof t.confirmCardPayment)return e;var t;throw new Error("Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.")},y=function(e){if(function(e){return l(e)&&"function"==typeof e.then}(e))return{tag:"async",stripePromise:Promise.resolve(e).then(m)};var t=m(e);return null===t?{tag:"empty"}:{tag:"sync",stripe:t}},g=t.createContext(null);g.displayName="ElementsContext";var v=function(e){var n=e.stripe,r=e.options,o=e.children,i=t.useRef(!1),c=t.useRef(!0),s=t.useMemo((function(){return y(n)}),[n]),u=a(t.useState((function(){return{stripe:null,elements:null}})),2),l=u[0],p=u[1],m=f(n),v=f(r);return null!==m&&(m!==n&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it."),d(r,v)||console.warn("Unsupported prop change on Elements: You cannot change the `options` prop after setting the `stripe` prop.")),i.current||("sync"===s.tag&&(i.current=!0,p({stripe:s.stripe,elements:s.stripe.elements(r)})),"async"===s.tag&&(i.current=!0,s.stripePromise.then((function(e){e&&c.current&&p({stripe:e,elements:e.elements(r)})})))),t.useEffect((function(){return function(){c.current=!1}}),[]),t.useEffect((function(){var e=l.stripe;e&&e._registerWrapper&&e._registerWrapper({name:"react-stripe-js",version:"1.4.0"})}),[l.stripe]),t.createElement(g.Provider,{value:l},o)};v.propTypes={stripe:u.any,options:u.object};var h=function(e){return function(e,t){if(!e)throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(t," in an <Elements> provider."));return e}(t.useContext(g),e)},b=function(e){return(0,e.children)(h("mounts <ElementsConsumer>"))};b.propTypes={children:u.func.isRequired};var P=function(e){var n=t.useRef(e);return t.useEffect((function(){n.current=e}),[e]),function(){n.current&&n.current.apply(n,arguments)}},E=function(e){return l(e)?(e.paymentRequest,r(e,["paymentRequest"])):{}},O=function(){},S=function(e,n){var r,a="".concat((r=e).charAt(0).toUpperCase()+r.slice(1),"Element"),o=n?function(e){h("mounts <".concat(a,">"));var n=e.id,r=e.className;return t.createElement("div",{id:n,className:r})}:function(n){var r=n.id,o=n.className,i=n.options,c=void 0===i?{}:i,s=n.onBlur,u=void 0===s?O:s,l=n.onFocus,p=void 0===l?O:l,f=n.onReady,m=void 0===f?O:f,y=n.onChange,g=void 0===y?O:y,v=n.onEscape,b=void 0===v?O:v,S=n.onClick,_=void 0===S?O:S,w=h("mounts <".concat(a,">")).elements,C=t.useRef(null),k=t.useRef(null),M=P(m),j=P(u),D=P(p),R=P(_),x=P(g),A=P(b);t.useLayoutEffect((function(){if(null==C.current&&w&&null!=k.current){var t=w.create(e,c);C.current=t,t.mount(k.current),t.on("ready",(function(){return M(t)})),t.on("change",x),t.on("blur",j),t.on("focus",D),t.on("escape",A),t.on("click",R)}}));var I=t.useRef(c);return t.useEffect((function(){I.current&&I.current.paymentRequest!==c.paymentRequest&&console.warn("Unsupported prop change: options.paymentRequest is not a customizable property.");var e=E(c);0===Object.keys(e).length||d(e,E(I.current))||C.current&&(C.current.update(e),I.current=c)}),[c]),t.useLayoutEffect((function(){return function(){C.current&&C.current.destroy()}}),[]),t.createElement("div",{id:r,className:o,ref:k})};return o.propTypes={id:u.string,className:u.string,onChange:u.func,onBlur:u.func,onFocus:u.func,onReady:u.func,onClick:u.func,options:u.object},o.displayName=a,o.__elementType=e,o},_="undefined"==typeof window,w=S("auBankAccount",_),C=S("card",_),k=S("cardNumber",_),M=S("cardExpiry",_),j=S("cardCvc",_),D=S("fpxBank",_),R=S("iban",_),x=S("idealBank",_),A=S("p24Bank",_),I=S("epsBank",_),L=S("paymentRequestButton",_),T=S("afterpayClearpayMessage",_);e.AfterpayClearpayMessageElement=T,e.AuBankAccountElement=w,e.CardCvcElement=j,e.CardElement=C,e.CardExpiryElement=M,e.CardNumberElement=k,e.Elements=v,e.ElementsConsumer=b,e.EpsBankElement=I,e.FpxBankElement=D,e.IbanElement=R,e.IdealBankElement=x,e.P24BankElement=A,e.PaymentRequestButtonElement=L,e.useElements=function(){return h("calls useElements()").elements},e.useStripe=function(){return h("calls useStripe()").stripe},Object.defineProperty(e,"__esModule",{value:!0})}(t,n(3804))},4465:(e,t,n)=>{"use strict";n.r(t),n.d(t,{loadStripe:()=>l});var r="https://js.stripe.com/v3",a=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,o="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",i=null,c=function(e,t,n){if(null===e)return null;var r=e.apply(void 0,t);return function(e,t){e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",version:"1.12.1",startTime:t})}(r,n),r},s=Promise.resolve().then((function(){return e=null,null!==i?i:i=new Promise((function(t,n){if("undefined"!=typeof window)if(window.Stripe&&e&&console.warn(o),window.Stripe)t(window.Stripe);else try{var i=function(){for(var e=document.querySelectorAll('script[src^="'.concat(r,'"]')),t=0;t<e.length;t++){var n=e[t];if(a.test(n.src))return n}return null}();i&&e?console.warn(o):i||(i=function(e){var t=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",n=document.createElement("script");n.src="".concat(r).concat(t);var a=document.head||document.body;if(!a)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return a.appendChild(n),n}(e)),i.addEventListener("load",(function(){window.Stripe?t(window.Stripe):n(new Error("Stripe.js not available"))})),i.addEventListener("error",(function(){n(new Error("Failed to load Stripe.js"))}))}catch(e){return void n(e)}else t(null)}));var e})),u=!1;s.catch((function(e){u||console.warn(e)}));var l=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];u=!0;var r=Date.now();return s.then((function(e){return c(e,t,r)}))}},8149:(e,t,n)=>{var r=n(3027),a=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.SavePaymentMethod=void 0;var o=a(n(4184));n(1127),t.SavePaymentMethod=function(e){var t=e.label,n=e.onChange,a=e.checked;return r.createElement("div",{className:"wc-stripe-save-payment-method"},r.createElement("label",null,r.createElement("input",{type:"checkbox",onChange:function(e){return n(e.target.checked)}}),r.createElement("svg",{className:(0,o.default)("wc-stripe-components-checkbox__mark",{checked:a}),"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 20"},r.createElement("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}))),r.createElement("span",null,t))}},3187:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(2029);Object.keys(r).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===r[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}}))}));var a=n(8149);Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===a[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}}))}));var o=n(8744);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))}));var i=n(4901);Object.keys(i).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===i[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}}))}))},2029:(e,t,n)=>{var r=n(3027),a=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.PaymentMethodLabel=void 0;var o=a(n(6479));n(7776),t.PaymentMethodLabel=function(e){var t=e.title,n=e.icons,a=e.paymentMethod,i=(0,o.default)(e,["title","icons","paymentMethod"]).components,c=i.PaymentMethodLabel,s=i.PaymentMethodIcons;return Array.isArray(n)||(n=[n]),r.createElement("span",{className:"wc-stripe-label-container ".concat(a)},r.createElement(c,{text:t}),r.createElement(s,{icons:n,align:"left"}))}},4901:(e,t,n)=>{var r=n(3027),a=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.PaymentMethod=void 0;var o=a(n(9713)),i=a(n(6479)),c=n(3027);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.PaymentMethod=function(e){var t=e.getData,n=e.content,a=(0,i.default)(e,["getData","content"]),o=n,s=t("description"),p=(0,c.useRef)(null);return(0,c.useEffect)((function(){p.current&&0==p.current.childNodes.length&&p.current.classList.add("no-content")})),r.createElement(r.Fragment,null,s&&r.createElement(l,{desc:s,payment_method:t("name")}),r.createElement("div",{ref:p,className:"wc-stripe-blocks-payment-method-content"},r.createElement(o,u(u({},a),{},{getData:t}))))};var l=function(e){var t=e.desc,n=e.payment_method;return r.createElement("div",{className:"wc-stripe-blocks-payment-method__desc ".concat(n)},r.createElement("p",null,t))}},6630:(e,t,n)=>{var r=n(3027),a=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.RadioControlAccordion=void 0;var o=a(n(8744)),i=a(n(4184)),c=function(e){var t=e.option,n=e.checked,a=e.onChange,c=t.label,s=t.value;return r.createElement("div",{className:"wc-stripe-blocks-radio-accordion"},r.createElement(o.default,{checked:n,onChange:a,value:s,label:c}),r.createElement("div",{className:(0,i.default)("wc-stripe-blocks-radio-accordion__content",{"wc-stripe-blocks-radio-accordion__content-visible":n})},t.content))};t.RadioControlAccordion=c;var s=c;t.default=s},8744:(e,t,n)=>{var r=n(3027),a=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.RadioControlOption=void 0;var o=a(n(4184)),i=function(e){var t=e.checked,n=e.onChange,a=e.value,i=e.label;return r.createElement("label",{className:(0,o.default)("wc-stripe-blocks-radio-control__option",{"wc-stripe-blocks-radio-control__option-checked":t})},r.createElement("input",{className:"wc-stripe-blocks-radio-control__input",type:"radio",value:a,checked:t,onChange:function(e){return n(e.target.value)}}),r.createElement("div",{className:"wc-stripe-blocks-radio-control__label"},r.createElement("span",null,i)))};t.RadioControlOption=i;var c=i;t.default=c},7260:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(1293);Object.keys(r).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===r[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}}))}));var a=n(7150);Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===a[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}}))}));var o=n(5201);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))}))},1293:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.useCreateLinkToken=void 0;var a=r(n(7015)),o=r(n(8926)),i=r(n(3038)),c=n(3027),s=r(n(7606)),u=n(1134);t.useCreateLinkToken=function(e){var t=e.setValidationError,n=(0,c.useState)(!1),r=(0,i.default)(n,2),l=r[0],p=r[1],d=(0,c.useCallback)((0,o.default)(a.default.mark((function e(){var n;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,s.default)({url:(0,u.getRoute)("create/linkToken"),method:"POST",data:{}});case 3:(n=e.sent).token&&((0,u.storeInCache)("linkToken",n.token),p(n.token)),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),t(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])}))),[]);return(0,c.useEffect)((function(){if(!l){var e=(0,u.getFromCache)("linkToken");e?p(e):d()}}),[l,p]),l}},7150:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.useInitializePlaid=void 0;var a=n(3027),o=r(n(2810)),i=n(1134);t.useInitializePlaid=function(e){var t=e.getData,n=e.linkToken,r=(0,a.useRef)(null),c=(0,a.useRef)(null),s=(0,a.useCallback)((function(){return new Promise((function(e,t){c.current={resolve:e,reject:t},r.current.open()}))}),[]);return(0,a.useEffect)((function(){n&&(r.current=o.default.create({clientName:t("clientName"),env:t("plaidEnvironment"),product:["auth"],token:n,selectAccount:!0,countryCodes:["US"],onSuccess:function(e,t){c.current.resolve({publicToken:e,metaData:t})},onExit:function(e){c.current.reject(!!e&&(0,i.getErrorMessage)(e.error_message))}}))}),[n]),s}},5201:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.useProcessPayment=void 0;var a=r(n(7015)),o=r(n(9713)),i=r(n(8926)),c=n(3027),s=n(1134);t.useProcessPayment=function(e){var t=e.openLinkPopup,n=e.onPaymentProcessing,r=e.responseTypes,u=e.paymentMethod;(0,c.useEffect)((function(){var e=n((0,i.default)(a.default.mark((function e(){var n,i,c,l;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t();case 3:return i=e.sent,c=i.publicToken,l=i.metaData,(0,s.deleteFromCache)("linkToken"),e.abrupt("return",(0,s.ensureSuccessResponse)(r,{meta:{paymentMethodData:(n={},(0,o.default)(n,"".concat(u,"_token_key"),c),(0,o.default)(n,"".concat(u,"_metadata"),JSON.stringify(l)),n)}}));case 9:return e.prev=9,e.t0=e.catch(0),e.abrupt("return",(0,s.ensureErrorResponse)(r,e.t0));case 12:case"end":return e.stop()}}),e,null,[[0,9]])}))));return function(){return e()}}),[n,r,t])}},5605:(e,t,n)=>{n(4836),n(4888)},4888:(e,t,n)=>{var r=n(3027),a=n(5318),o=a(n(3038)),i=a(n(6479)),c=n(3027),s=n(4222),u=n(1134),l=n(3187),p=a(n(1065)),d=n(7260),f=n(3636),m=n(3163),y=(0,u.getSettings)("stripe_ach_data"),g=function(e){var t=e.getData,n=e.eventRegistration,a=e.components,s=e.emitResponse,l=e.onSubmit,p=((0,i.default)(e,["getData","eventRegistration","components","emitResponse","onSubmit"]),s.responseTypes),m=n.onPaymentProcessing,y=n.onCheckoutAfterProcessingWithError,g=a.ValidationInputError,h=(0,c.useState)(!1),b=(0,o.default)(h,2),P=b[0],E=b[1],O=(0,d.useCreateLinkToken)({setValidationError:E});(0,f.useProcessCheckoutError)({responseTypes:p,subscriber:y});var S=(0,d.useInitializePlaid)({getData:t,linkToken:O,onSubmit:l});return(0,d.useProcessPayment)({openLinkPopup:S,onPaymentProcessing:m,responseTypes:p,paymentMethod:t("name")}),r.createElement(r.Fragment,null,u.isTestMode&&r.createElement(v,null),P&&r.createElement(g,{errorMessage:P}))},v=function(){return r.createElement("div",{className:"wc-stripe-blocks-ach__creds"},r.createElement("label",{className:"wc-stripe-blocks-ach__creds-label"},(0,m.__)("Test Credentials","woo-stripe-payment")),r.createElement("div",{className:"wc-stripe-blocks-ach__username"},r.createElement("div",null,r.createElement("strong",null,(0,m.__)("username","woo-stripe-payment")),": user_good"),r.createElement("div",null,r.createElement("strong",null,(0,m.__)("password","woo-stripe-payment")),": pass_good"),r.createElement("div",null,r.createElement("strong",null,(0,m.__)("pin","woo-stripe-payment")),": credential_good")))};(0,s.registerPaymentMethod)({name:y("name"),label:r.createElement(l.PaymentMethodLabel,{title:y("title"),paymentMethod:y("name"),icons:y("icons")}),ariaLabel:"ACH Payment",canMakePayment:function(e){return"USD"===e.cartTotals.currency_code},content:r.createElement(l.PaymentMethod,{getData:y,content:g}),savedTokenComponent:r.createElement(p.default,{getData:y}),edit:r.createElement(g,{getData:y}),placeOrderButtonLabel:y("placeOrderButtonLabel"),supports:{showSavedCards:y("showSavedCards"),showSaveOption:!1,features:y("features")}})},3846:(e,t,n)=>{n(85),n(660)},660:(e,t,n)=>{var r=n(3027),a=n(5318),o=a(n(3038)),i=a(n(6479)),c=n(3027),s=n(4222),u=n(1134),l=n(6664),p=a(n(7082)),d=n(3636),f=(0,u.getSettings)("stripe_applepay_data"),m=function(e){return r.createElement(p.default,null,r.createElement("div",{className:"wc-stripe-apple-pay-container"},r.createElement(l.Elements,{stripe:u.initStripe},r.createElement(y,e))))},y=function(e){var t=e.getData,n=e.onClick,a=e.onClose,s=e.billing,u=e.shippingData,p=e.eventRegistration,f=e.emitResponse,m=e.onSubmit,y=e.activePaymentMethod,g=((0,i.default)(e,["getData","onClick","onClose","billing","shippingData","eventRegistration","emitResponse","onSubmit","activePaymentMethod"]),p.onPaymentProcessing),v=f.responseTypes,h=f.noticeContexts,b=(0,l.useStripe)(),P=(0,d.useStripeError)(),E=(0,o.default)(P,1)[0],O=(0,d.useExportedValues)();(0,d.useExpressBreakpointWidth)({payment_method:t("name"),width:300});var S=(0,d.useProcessPaymentIntent)({getData:t,billing:s,shippingData:u,onPaymentProcessing:g,emitResponse:f,error:E,onSubmit:m,activePaymentMethod:y,exportedValues:O}).setPaymentMethod;(0,d.useAfterProcessingPayment)({getData:t,eventRegistration:p,responseTypes:v,activePaymentMethod:y,messageContext:h.EXPRESS_PAYMENTS});var _=(0,d.usePaymentRequest)({getData:t,onClose:a,stripe:b,billing:s,shippingData:u,eventRegistration:p,setPaymentMethod:S,exportedValues:O,canPay:function(e){return null!=e&&e.applePay}}).paymentRequest,w=(0,c.useCallback)((function(){_&&(n(),_.show())}),[_,n]);return _?r.createElement("button",{className:"apple-pay-button ".concat(t("buttonStyle")),style:{"-apple-pay-button-type":t("buttonType")},onClick:w}):null},g=function(e){var t=e.getData;return(0,i.default)(e,["getData"]),r.createElement("div",{className:"apple-pay-block-editor"},r.createElement("img",{src:t("editorIcon")}))};(0,s.registerExpressPaymentMethod)({name:f("name"),canMakePayment:function(e){var t=e.cartTotals;if((0,i.default)(e,["cartTotals"]),f("isAdmin"))return!0;var n=t.currency_code,r=t.total_price;return(0,u.canMakePayment)({country:f("countryCode"),currency:n.toLowerCase(),total:{label:f("totalLabel"),amount:parseInt(r)}},(function(e){return null!=e&&e.applePay}))},content:r.createElement(m,{getData:f}),edit:r.createElement(g,{getData:f}),supports:{showSavedCards:f("showSavedCards"),showSaveOption:f("showSaveOption"),features:f("features")}})},7354:(e,t,n)=>{var r=n(3027);n(3110);var a=n(1134),o=n(6664),i=n(3163),c=function(e){var t=e.CardIcon,n=e.options,a=e.onChange;return r.createElement("div",{className:"wc-stripe-bootstrap-form"},r.createElement("div",{className:"row"},r.createElement("div",{className:"col-md-6 mb-3"},r.createElement(o.CardNumberElement,{className:"md-form md-outline stripe-input",options:n.cardNumber,onChange:a(o.CardNumberElement)}),r.createElement("label",{htmlFor:"stripe-card-number"},(0,i.__)("Card Number","woo-stripe-payment")),t),r.createElement("div",{className:"col-md-3 mb-3"},r.createElement(o.CardExpiryElement,{className:"md-form md-outline stripe-input",options:n.cardExpiry,onChange:a(o.CardExpiryElement)}),r.createElement("label",{htmlFor:"stripe-exp"},(0,i.__)("Exp","woo-stripe-payment"))),r.createElement("div",{className:"col-md-3 mb-3"},r.createElement(o.CardCvcElement,{className:"md-form md-outline stripe-input",options:n.cardCvc,onChange:a(o.CardCvcElement)}),r.createElement("label",{htmlFor:"stripe-cvv"},(0,i.__)("CVV","woo-stripe-payment")))))};(0,a.registerCreditCardForm)({id:"bootstrap",breakpoint:475,component:r.createElement(c,null)})},3329:(e,t,n)=>{var r=n(3027),a=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(9713)),i=a(n(3038)),c=n(1134),s=n(3027),u=n(6664),l=n(3163),p=n(3636);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var m={focus:"focused",empty:"empty",invalid:"invalid"},y=function(e){var t=e.type,n=e.src;return t?r.createElement("img",{className:"wc-stripe-card ".concat(t),src:n}):null};t.default=function(e){var t=e.getData,n=e.onChange,a=(0,s.useState)(""),o=(0,i.default)(a,2),d=o[0],g=o[1],v=(0,s.useRef)([]),h=(0,s.useState)(null),b=(0,i.default)(h,2),P=b[0],E=b[1],O=(0,u.useElements)(),S=t("customForm"),_=(0,c.getCreditCardForm)(S),w=_.component,C=void 0===w?null:w,k=_.breakpoint,M=void 0===k?475:k,j=t("postalCodeEnabled"),D={};["cardNumber","cardExpiry","cardCvc"].forEach((function(e){D[e]=f(f({classes:m},t("cardOptions")),t("customFieldOptions")[e])}));var R=(0,s.useCallback)((function(e){v.current.includes(e)||v.current.push(e)}),[]);(0,p.useBreakpointWidth)({name:"creditCardForm",width:M,node:P,className:"small-form"});var x=(0,s.useCallback)((function(e){for(var n=0,r=Object.keys(t("cards"));n<r.length;n++){var a=r[n];if(a===e)return t("cards")[a]}return""}),[]);return C?r.createElement("div",{className:"wc-stripe-custom-form ".concat(S),ref:E},(0,s.cloneElement)(C,{postalCodeEnabled:j,options:D,onChange:function(e){return R(e),function(t){if(n(t),"cardNumber"===t.elementType&&("unknown"===t.brand?g(""):g(t.brand)),t.complete){var r=v.current.indexOf(e);if(v.current[r+1]){var a=v.current[r+1];O.getElement(a).focus()}}}},CardIcon:r.createElement(y,{type:d,src:x(d)})})):r.createElement("div",{className:"wc-stripe-custom-form-error"},r.createElement("p",null,(0,l.sprintf)((0,l.__)("%s is not a valid blocks Stripe custom form. Please choose another custom form option in the Credit Card Settings.","woo-stripe-payment"),t("customFormLabels")[S])))}},6835:(e,t,n)=>{var r=n(3027);n(8356);var a=n(1134),o=n(6664),i=n(3163),c=n(3027),s=function(e){var t=e.CardIcon,n=e.options,a=e.onChange;return(0,c.useEffect)((function(){}),[]),r.createElement("div",{className:"wc-stripe-simple-form"},r.createElement("div",{className:"row"},r.createElement("div",{className:"field"},r.createElement("div",{className:"field-item"},r.createElement(o.CardNumberElement,{id:"stripe-card-number",className:"input empty",options:n.cardNumber,onChange:a(o.CardNumberElement)}),r.createElement("label",{htmlFor:"stripe-card-number","data-tid":""},(0,i.__)("Card Number","woo-stripe-payment")),r.createElement("div",{className:"baseline"}),t))),r.createElement("div",{className:"row"},r.createElement("div",{className:"field half-width"},r.createElement("div",{className:"field-item"},r.createElement(o.CardExpiryElement,{id:"stripe-exp",className:"input empty",options:n.cardExpiry,onChange:a(o.CardExpiryElement)}),r.createElement("label",{htmlFor:"stripe-exp","data-tid":""},(0,i.__)("Expiration","woo-stripe-payment")),r.createElement("div",{className:"baseline"}))),r.createElement("div",{className:"field half-width cvc"},r.createElement("div",{className:"field-item"},r.createElement(o.CardCvcElement,{id:"stripe-cvv",className:"input empty",options:n.cardCvc,onChange:a(o.CardCvcElement)}),r.createElement("label",{htmlFor:"stripe-cvv","data-tid":""},(0,i.__)("CVV","woo-stripe-payment")),r.createElement("div",{className:"baseline"})))))};(0,a.registerCreditCardForm)({id:"simple",component:r.createElement(s,null),breakpoint:375})},9775:(e,t,n)=>{var r=n(3027),a=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(9713)),i=n(6664),c=n(1134),s=n(3027);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.default=function(e){var t=e.getData,n=e.billing,a=e.onChange,o=(0,s.useMemo)((function(){var e;return l(l({},{value:{postalCode:null==n||null===(e=n.billingData)||void 0===e?void 0:e.postcode},hidePostalCode:(0,c.isFieldRequired)("postcode"),iconStyle:"default"}),t("cardOptions"))}),[n.billingData]);return r.createElement("div",{className:"wc-stripe-inline-form"},r.createElement(i.CardElement,{options:o,onChange:a}))}},627:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),n(5773);var r=n(7205);Object.keys(r).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===r[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}}))})),n(7354),n(6835)},7205:(e,t,n)=>{var r=n(3027),a=n(5318),o=a(n(3038)),i=n(3027),c=n(4222),s=n(1134),u=n(6664),l=n(3187),p=a(n(1065)),d=a(n(3329)),f=a(n(9775)),m=n(3636),y=(0,s.getSettings)("stripe_cc_data"),g=function(e){return(0,s.isUserLoggedIn)(e)&&y("saveCardEnabled")&&!(0,s.cartContainsSubscription)()&&!(0,s.cartContainsPreOrder)()},v=function(e){var t=(0,i.useState)(!1),n=(0,o.default)(t,2),a=n[0],c=n[1];if((0,i.useEffect)((function(){s.initStripe.catch((function(e){c(e)}))}),[c]),a)throw new Error(a);return r.createElement(u.Elements,{stripe:s.initStripe},r.createElement(h,e))},h=function(e){var t=e.getData,n=e.billing,a=e.shippingData,c=e.emitResponse,s=e.eventRegistration,p=e.activePaymentMethod,y=(0,m.useStripeError)(),v=(0,o.default)(y,2),h=v[0],b=v[1],P=(0,i.useState)(!1),E=(0,o.default)(P,2),O=E[0],S=E[1],_=s.onPaymentProcessing,w=(0,u.useStripe)(),C=(0,u.useElements)(),k=(0,i.useCallback)((function(){var e=t("customFormActive")?u.CardNumberElement:u.CardElement;return{card:C.getElement(e)}}),[w,C]),M=(0,m.useSetupIntent)({getData:t,cartTotal:n.cartTotal,setError:b}),j=M.setupIntent,D=M.removeSetupIntent;(0,m.useProcessPaymentIntent)({getData:t,billing:n,shippingData:a,emitResponse:c,error:h,onPaymentProcessing:_,savePaymentMethod:O,setupIntent:j,removeSetupIntent:D,getPaymentMethodArgs:k,activePaymentMethod:p}),(0,m.useAfterProcessingPayment)({getData:t,eventRegistration:s,responseTypes:c.responseTypes,activePaymentMethod:p,savePaymentMethod:O});var R=t("customFormActive")?d.default:f.default;return r.createElement("div",{className:"wc-stripe-card-container"},r.createElement(R,{getData:t,billing:n,onChange:function(e){e.error?b(e.error):b(!1)}}),g(n.customerId)&&r.createElement(l.SavePaymentMethod,{label:t("savePaymentMethodLabel"),onChange:function(e){return S(e)},checked:O}))};(0,c.registerPaymentMethod)({name:y("name"),label:r.createElement(l.PaymentMethodLabel,{title:y("title"),paymentMethod:y("name"),icons:y("icons")}),ariaLabel:"Credit Cards",canMakePayment:function(){return s.initStripe},content:r.createElement(l.PaymentMethod,{content:v,getData:y}),savedTokenComponent:r.createElement(p.default,{getData:y}),edit:r.createElement(l.PaymentMethod,{content:v,getData:y}),supports:{showSavedCards:y("showSavedCards"),showSaveOption:!1,features:y("features")}})},7082:(e,t,n)=>{var r=n(3027),a=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(4575)),i=a(n(3913)),c=a(n(2205)),s=a(n(8585)),u=a(n(9754));var l=function(e){(0,c.default)(l,e);var t,n,a=(t=l,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=(0,u.default)(t);if(n){var a=(0,u.default)(this).constructor;e=Reflect.construct(r,arguments,a)}else e=r.apply(this,arguments);return(0,s.default)(this,e)});function l(e){var t;return(0,o.default)(this,l),(t=a.call(this,e)).state={hasError:!1,error:null,errorInfo:null},t}return(0,i.default)(l,[{key:"componentDidCatch",value:function(e,t){this.setState({hasError:!0,error:e,errorInfo:t})}},{key:"render",value:function(){return this.state.hasError?r.createElement(r.Fragment,null,this.state.error&&r.createElement("div",{className:"wc-stripe-block-error"},this.state.error.toString()),this.state.errorInfo&&r.createElement("div",{className:"wc-stripe-block-error"},this.state.errorInfo.componentStack)):this.props.children}}]),l}(n(3027).Component);t.default=l},5212:(e,t,n)=>{var r=n(3027),a=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(3038)),i=a(n(6479)),c=n(3027),s=n(5516),u=n(3636),l=(0,n(1134).getSettings)("stripeGeneralData")().publishableKey;t.default=function(e){var t=e.getData,n=e.setErrorMessage,a=e.billing,p=e.shippingData,d=e.canMakePayment,f=e.checkoutStatus,m=e.eventRegistration,y=e.activePaymentMethod,g=e.onClick,v=e.onClose,h=(0,i.default)(e,["getData","setErrorMessage","billing","shippingData","canMakePayment","checkoutStatus","eventRegistration","activePaymentMethod","onClick","onClose"]),b={merchantId:t("merchantId"),merchantName:t("merchantName")},P=(0,u.useStripeError)(),E=(0,o.default)(P,2),O=E[0],S=(E[1],(0,c.useRef)()),_=h.onSubmit,w=h.emitResponse,C=m.onPaymentProcessing,k=(0,u.useExportedValues)(),M="long"===t("buttonStyle").buttonType?390:300,j=(0,u.useProcessPaymentIntent)({getData:t,billing:a,shippingData:p,onPaymentProcessing:C,emitResponse:w,error:O,exportedValues:k,onSubmit:_,checkoutStatus:f,activePaymentMethod:y}).setPaymentMethod,D=(0,s.usePaymentRequest)({getData:t,publishableKey:l,merchantInfo:b,billing:a,shippingData:p}),R=(0,s.usePaymentsClient)({merchantInfo:b,paymentRequest:D,billing:a,shippingData:p,eventRegistration:m,canMakePayment:d,setErrorMessage:n,onSubmit:_,setPaymentMethod:j,exportedValues:k,onClick:g,onClose:v,getData:t}),x=R.button,A=R.removeButton;return(0,u.useExpressBreakpointWidth)({payment_method:t("name"),width:M}),(0,c.useEffect)((function(){x&&(A(S.current),S.current.append(x))}),[x]),r.createElement("div",{className:"wc-stripe-gpay-button-container",ref:S})}},3097:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BASE_PAYMENT_REQUEST=t.BASE_PAYMENT_METHOD=void 0,t.BASE_PAYMENT_METHOD={type:"CARD",parameters:{allowedAuthMethods:["PAN_ONLY"],allowedCardNetworks:["AMEX","DISCOVER","INTERAC","JCB","MASTERCARD","VISA"],assuranceDetailsRequired:!0}},t.BASE_PAYMENT_REQUEST={apiVersion:2,apiVersionMinor:0}},5516:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(1674);Object.keys(r).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===r[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}}))}));var a=n(1735);Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===a[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}}))}));var o=n(9808);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))}))},9808:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.useErrorMessage=void 0;var a=r(n(3038)),o=n(3027);t.useErrorMessage=function(){var e=(0,o.useState)(!1),t=(0,a.default)(e,2);return{errorMessage:t[0],setErrorMessage:t[1]}}},1735:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.usePaymentRequest=void 0;var a=r(n(319)),o=r(n(9713)),i=n(3027),c=n(3097),s=n(1134),u=n(8664);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.usePaymentRequest=function(e){var t=e.getData,n=e.publishableKey,r=e.merchantInfo,o=e.billing,l=e.shippingData,d=o.billingData,f=l.shippingRates,m=t(),y=m.processingCountry,g=m.totalPriceLabel;return(0,i.useMemo)((function(){var e=p(p({},{emailRequired:(0,s.isEmpty)(d.email),merchantInfo:r,allowedPaymentMethods:[p(p({},{type:"CARD",tokenizationSpecification:{type:"PAYMENT_GATEWAY",parameters:{gateway:"stripe","stripe:version":"2018-10-31","stripe:publishableKey":n}}}),c.BASE_PAYMENT_METHOD)],shippingAddressRequired:l.needsShipping,transactionInfo:(0,u.getTransactionInfo)({billing:o,processingCountry:y,totalPriceLabel:g}),callbackIntents:["PAYMENT_AUTHORIZATION"]}),c.BASE_PAYMENT_REQUEST);if(e.allowedPaymentMethods[0].parameters.billingAddressRequired=!0,e.allowedPaymentMethods[0].parameters.billingAddressParameters={format:"FULL",phoneNumberRequired:(0,s.isFieldRequired)("phone",d.country)&&(0,s.isEmpty)(d.phone)},e.shippingAddressRequired){e.callbackIntents=[].concat((0,a.default)(e.callbackIntents),["SHIPPING_ADDRESS","SHIPPING_OPTION"]),e.shippingOptionRequired=!0;var t=(0,u.getShippingOptionParameters)(f);t.shippingOptions.length>0&&(e=p(p({},e),{},{shippingOptionParameters:t}))}return e}),[o.cartTotal,o.cartTotalItems,d,l])}},1674:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.usePaymentsClient=void 0;var a=r(n(319)),o=r(n(9713)),i=r(n(7015)),c=r(n(8926)),s=r(n(3038)),u=n(3027),l=r(n(4306)),p=n(1134),d=n(6664),f=n(8664),m=n(3163),y=n(3636);function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.usePaymentsClient=function(e){var t=e.merchantInfo,n=e.paymentRequest,r=e.billing,g=e.shippingData,h=e.eventRegistration,b=e.canMakePayment,P=e.setErrorMessage,E=e.setPaymentMethod,O=e.exportedValues,S=e.onClick,_=e.onClose,w=e.getData,C=w().environment,k=(0,u.useState)(),M=(0,s.default)(k,2),j=M[0],D=M[1],R=(0,u.useState)(null),x=(0,s.default)(R,2),A=x[0],I=x[1],L=(0,u.useRef)(r),T=(0,u.useRef)(g),N=(0,d.useStripe)(),B=(0,y.usePaymentEvents)({billing:r,shippingData:g,eventRegistration:h}).addPaymentEvent;(0,u.useEffect)((function(){L.current=r,T.current=g}));var F=(0,u.useCallback)((function(e){var t,n;if(null!=e&&null!==(t=e.paymentMethodData)&&void 0!==t&&null!==(n=t.info)&&void 0!==n&&n.billingAddress){var r,a=e.paymentMethodData.info.billingAddress;(0,p.isAddressValid)(L.current.billingData,["phone","email"])&&(0,p.isEmpty)(null===(r=L.current.billingData)||void 0===r?void 0:r.phone)&&(a={phoneNumber:a.phoneNumber}),O.billingData=L.current.billingData=(0,f.toCartAddress)(a,{email:e.email})}null!=e&&e.shippingAddress&&(O.shippingAddress=(0,f.toCartAddress)(e.shippingAddress))}),[O,n]),q=(0,u.useCallback)((function(e){for(;e.firstChild;)e.removeChild(e.firstChild)}),[A]),X=(0,u.useCallback)((0,c.default)(i.default.mark((function e(){var t,r,a;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return S(),e.prev=1,e.next=4,j.loadPaymentData(n);case 4:return t=e.sent,F(t),r=JSON.parse(t.paymentMethodData.tokenizationData.token),e.next=9,N.createPaymentMethod({type:"card",card:{token:r.id},billing_details:(0,p.getBillingDetailsFromAddress)(L.current.billingData)});case 9:if(!(a=e.sent).error){e.next=12;break}throw new p.StripeError(a.error);case 12:E(a.paymentMethod.id),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(1),"CANCELED"===(null===e.t0||void 0===e.t0?void 0:e.t0.statusCode)?_():(console.log((0,p.getErrorMessage)(e.t0)),P((0,p.getErrorMessage)(e.t0)));case 18:case"end":return e.stop()}}),e,null,[[1,15]])}))),[N,j,S]),V=(0,u.useCallback)((0,c.default)(i.default.mark((function e(){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!j||A||!N){e.next=5;break}return e.next=4,b;case 4:I(j.createButton(v({onClick:X},w("buttonStyle"))));case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.log(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])}))),[N,A,j,X]),U=(0,u.useMemo)((function(){var e={environment:C,merchantInfo:t,paymentDataCallbacks:{onPaymentAuthorized:function(){return Promise.resolve({transactionState:"SUCCESS"})}}};return n.shippingAddressRequired&&(e.paymentDataCallbacks.onPaymentDataChanged=function(e){return new Promise((function(t,n){var r,i=T.current,c=e.shippingAddress,s=e.shippingOptionData,u=(0,f.toCartAddress)(c),d=(0,p.getSelectedShippingOption)(s.id),y=(0,l.default)((0,p.getIntermediateAddress)(i.shippingAddress),u),g=(0,l.default)(i.selectedRates,(0,o.default)({},d[1],d[0]));B("onShippingChanged",(function(e,n){var r=n.billing,a=n.shipping;t(e?(0,f.getPaymentRequestUpdate)({billing:r,shippingData:{needsShipping:!0,shippingRates:a.shippingRates},processingCountry:w("processingCountry"),totalPriceLabel:w("totalPriceLabel")}):{error:{reason:"SHIPPING_ADDRESS_UNSERVICEABLE",message:(0,m.__)("Your shipping address is not serviceable.","woo-stripe-payment"),intent:"SHIPPING_ADDRESS"}})}),y&&g),T.current.setShippingAddress(v(v({},T.current.shippingAddress),u)),"shipping_option_unselected"!==s.id&&(r=T.current).setSelectedRates.apply(r,(0,a.default)(d))}))}),e}),[n]);return(0,u.useEffect)((function(){D(new google.payments.api.PaymentsClient(U))}),[U]),(0,u.useEffect)((function(){V()}),[V]),{button:A,removeButton:q}}},5341:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),n(9509);var r=n(9031);Object.keys(r).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===r[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}}))}))},9031:(e,t,n)=>{var r=n(3027),a=n(5318),o=a(n(7154)),i=a(n(6479)),c=a(n(9713)),s=n(4222),u=n(1134),l=n(5516),p=a(n(5212)),d=n(3097),f=a(n(3905)),m=n(6664);function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach((function(t){(0,c.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var v,h,b=(0,u.getSettings)("stripe_googlepay_data"),P=(v=new f.default.payments.api.PaymentsClient({environment:b("environment"),merchantInfo:{merchantId:b("merchantId"),merchantName:b("merchantName")}}),h=g(g({},d.BASE_PAYMENT_REQUEST),{},{allowedPaymentMethods:[d.BASE_PAYMENT_METHOD]}),v.isReadyToPay(h).then((function(){return!0})).catch((function(e){return console.log(e),!1}))),E=function(e){var t=e.getData,n=e.components,a=(0,i.default)(e,["getData","components"]),c=n.ValidationInputError,s=(0,l.useErrorMessage)(),d=s.errorMessage,f=s.setErrorMessage;return r.createElement("div",{className:"wc-stripe-gpay-container"},r.createElement(m.Elements,{stripe:u.initStripe},r.createElement(p.default,(0,o.default)({getData:t,canMakePayment:P,setErrorMessage:f},a)),d&&r.createElement(c,{errorMessage:d})))},O=function(e){var t,n=e.getData,a=((0,i.default)(e,["getData"]),n("buttonStyle").buttonType),o=(null===(t=n("editorIcons"))||void 0===t?void 0:t[a])||"long";return r.createElement("div",{className:"gpay-block-editor ".concat(a)},r.createElement("img",{src:o}))};(0,s.registerExpressPaymentMethod)({name:b("name"),canMakePayment:function(){return b("isAdmin")?!(0,u.isCartPage)()||b("cartCheckoutEnabled"):!((0,u.isCartPage)()&&!b("cartCheckoutEnabled"))&&u.initStripe.then((function(e){return e.error?e:P}))},content:r.createElement(E,{getData:b}),edit:r.createElement(O,{getData:b}),supports:{showSavedCards:b("showSavedCards"),showSaveOption:b("showSaveOption"),features:b("features")}})},8664:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.toCartAddress=t.getShippingOptions=t.getShippingOptionParameters=t.getPaymentRequestUpdate=t.getTransactionInfo=void 0;var a=r(n(319)),o=n(1134),i=((0,n(2492).getSetting)("stripeGeneralData"),function(e){var t=e.billing,n=e.processingCountry,r=e.totalPriceLabel,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ESTIMATED",i=t.cartTotal,s=t.cartTotalItems,u=t.currency,l={countryCode:n,currencyCode:u.code,totalPriceStatus:a,totalPrice:(0,o.removeNumberPrecision)(i.value,u.minorUnit).toString(),displayItems:c(s,u.minorUnit),totalPriceLabel:r};return l});t.getTransactionInfo=i,t.getPaymentRequestUpdate=function(e){var t=e.billing,n=e.shippingData,r=e.processingCountry,a=e.totalPriceLabel,o=n.needsShipping,c=n.shippingRates,u={newTransactionInfo:i({billing:t,processingCountry:r,totalPriceLabel:a},"FINAL")};return o&&(u.newShippingOptionParameters=s(c)),u};var c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=[],r=["total_tax","total_shipping"];return e.forEach((function(e){(0<e.value||e.key&&r.includes(e.key))&&n.push({label:e.label,type:"LINE_ITEM",price:(0,o.removeNumberPrecision)(e.value,t).toString()})})),n},s=function(e){var t=u(e),n=t.map((function(e){return e.id})).slice(0,1).shift();return e.forEach((function(e,t){e.shipping_rates.forEach((function(e){e.selected&&(n=(0,o.getShippingOptionId)(t,e.rate_id))}))})),{shippingOptions:t,defaultSelectedOptionId:n}};t.getShippingOptionParameters=s;var u=function(e){var t=[];return e.forEach((function(e,n){var r=e.shipping_rates.map((function(e){var t=document.createElement("textarea");t.innerHTML=e.name;var r=(0,o.formatPrice)(e.price,e.currency_code);return{id:(0,o.getShippingOptionId)(n,e.rate_id),label:t.value,description:"".concat(r)}}));t=[].concat((0,a.default)(t),(0,a.default)(r))})),t};t.getShippingOptions=u;var l=(0,o.toCartAddress)({name:function(e,t){return e.first_name=t.split(" ").slice(0,-1).join(" "),e.last_name=t.split(" ").pop(),e},countryCode:"country",address1:"address_1",address2:"address_2",locality:"city",administrativeArea:"state",postalCode:"postcode",email:"email",phoneNumber:"phone"});t.toCartAddress=l},3636:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(4332);Object.keys(r).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===r[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}}))}));var a=n(1261);Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===a[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}}))}));var o=n(6107);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))}));var i=n(2715);Object.keys(i).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===i[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}}))}));var c=n(2343);Object.keys(c).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===c[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return c[e]}}))}));var s=n(1500);Object.keys(s).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===s[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}}))}));var u=n(6095);Object.keys(u).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===u[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return u[e]}}))}));var l=n(5554);Object.keys(l).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===l[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return l[e]}}))}));var p=n(3893);Object.keys(p).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===p[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return p[e]}}))}))},1261:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.useAfterProcessingPayment=void 0;var a=r(n(7015)),o=r(n(8926)),i=n(3027),c=n(6664),s=n(1134),u=n(3893);t.useAfterProcessingPayment=function(e){var t=e.getData,n=e.eventRegistration,r=e.responseTypes,l=e.activePaymentMethod,p=e.savePaymentMethod,d=void 0!==p&&p,f=e.messageContext,m=void 0===f?null:f,y=(0,c.useStripe)(),g=n.onCheckoutAfterProcessingWithSuccess,v=n.onCheckoutAfterProcessingWithError;(0,u.useProcessCheckoutError)({responseTypes:r,subscriber:v,messageContext:m}),(0,i.useEffect)((function(){var e=g(function(){var e=(0,o.default)(a.default.mark((function e(n){var o;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=n.redirectUrl,t("name")!==l){e.next=5;break}return e.next=4,(0,s.handleCardAction)({redirectUrl:o,responseTypes:r,stripe:y,getData:t,savePaymentMethod:d});case 4:return e.abrupt("return",e.sent);case 5:return e.abrupt("return",null);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());return function(){return e()}}),[y,r,g,l,d])}},5554:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.useExpressBreakpointWidth=t.useBreakpointWidth=void 0;var a=r(n(3038)),o=n(3027),i=n(1134),c=function(e){var t=e.name,n=e.width,r=e.node,c=e.className,s=(0,o.useState)(window.innerWidth),u=(0,a.default)(s,2),l=u[0],p=u[1],d=(0,o.useCallback)((function(e){var t=(0,i.getFromCache)(e);return t?parseInt(t):0}),[]),f=(0,o.useCallback)((function(e,t){return(0,i.storeInCache)(e,t)}),[]);(0,o.useEffect)((function(){var e="function"==typeof r?r():r;if(e){var a=d(t);(!a||n>a)&&f(t,n),e.clientWidth<n?e.classList.add(c):e.clientWidth>a&&e.classList.remove(c)}}),[l,r]),(0,o.useEffect)((function(){var e=function(){return p(window.innerWidth)};return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}}))};t.useBreakpointWidth=c,t.useExpressBreakpointWidth=function(e){var t=e.payment_method,n=e.width,r=(0,o.useCallback)((function(){var e=document.getElementById("express-payment-method-".concat(t));return e?e.parentNode:null}),[]);c({name:"expressMaxWidth",width:n,node:r,className:"wc-stripe-express__sm"})}},2343:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useExportedValues=void 0;var r=n(3027);t.useExportedValues=function(){return(0,r.useRef)({}).current}},6095:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.usePaymentEvents=void 0;var a=r(n(9713)),o=r(n(3038)),i=n(3027),c=n(1134);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){(0,a.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.usePaymentEvents=function(e){var t=e.billing,n=e.shippingData,r=e.eventRegistration,s=r.onShippingRateSuccess,l=r.onShippingRateFail,p=r.onShippingRateSelectSuccess,d=(0,i.useRef)(t),f=(0,i.useRef)(n),m=(0,i.useState)(null),y=(0,o.default)(m,2),g=y[0],v=y[1],h=(0,i.useState)({onShippingChanged:!1}),b=(0,o.default)(h,2),P=b[0],E=b[1],O=(0,i.useCallback)((function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];n?v((0,a.default)({},e,t)):E(u(u({},P),{},(0,a.default)({},e,t)))}),[P,E]),S=(0,i.useCallback)((function(e){P[e]&&(delete P[e],E(P))}),[P]),_=(0,i.useCallback)((function(){var e=f.current,t=d.current;if(P.onShippingChanged&&!e.isSelectingRate&&!e.shippingRatesLoading){var n=P.onShippingChanged,r=!0;(0,c.hasShippingRates)(e.shippingRates)||(r=!1),n(r,{billing:t,shipping:e}),S("onShippingChanged")}}),[P,S]);return(0,i.useEffect)((function(){d.current=t,f.current=n})),(0,i.useEffect)((function(){g&&g.onShippingChanged&&(g.onShippingChanged(!0,{billing:d.current,shipping:f.current}),v(null))}),[g]),(0,i.useEffect)((function(){var e=s(_),t=p(_),n=l((function(e){e.hasInvalidAddress,e.hasError,P.onShippingChanged&&((0,P.onShippingChanged)(!1),S("onShippingChanged"))}));return function(){e(),n(),t()}}),[P,s,l,p]),{addPaymentEvent:O,removePaymentEvent:S}}},1500:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.usePaymentRequest=void 0;var a=r(n(319)),o=r(n(9713)),i=r(n(3038)),c=n(3027),s=n(6095),u=n(1134),l=r(n(4306));function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var f=(0,u.toCartAddress)();t.usePaymentRequest=function(e){var t=e.getData,n=e.onClose,r=e.stripe,o=e.billing,p=e.shippingData,m=e.eventRegistration,y=e.setPaymentMethod,g=e.exportedValues,v=e.canPay,h=(0,s.usePaymentEvents)({billing:o,shippingData:p,eventRegistration:m}).addPaymentEvent,b=(p.shippingAddress,p.needsShipping),P=p.shippingRates,E=o.billingData,O=o.cartTotalItems,S=o.currency,_=o.cartTotal,w=(0,c.useState)(null),C=(0,i.default)(w,2),k=C[0],M=C[1],j=(0,c.useRef)({}),D=(0,c.useRef)(p),R=(0,c.useRef)(o);(0,c.useEffect)((function(){D.current=p,R.current=o}),[p]),(0,c.useEffect)((function(){if(r){var e={country:t("countryCode"),currency:null==S?void 0:S.code.toLowerCase(),total:{amount:_.value,label:_.label,pending:!0},requestPayerName:!0,requestPayerEmail:(0,u.isFieldRequired)("email",E.country),requestPayerPhone:(0,u.isFieldRequired)("phone",E.country),requestShipping:b,displayItems:(0,u.getDisplayItems)(O,S)};e.requestShipping&&(e.shippingOptions=(0,u.getShippingOptions)(P)),j.current=e;var n=r.paymentRequest(j.current);n.canMakePayment().then((function(e){v(e)?M(n):M(null)}))}}),[r,_.value,E.country,P,O,S.code]),(0,c.useEffect)((function(){k&&(j.current.requestShipping&&(k.on("shippingaddresschange",A),k.on("shippingoptionchange",I)),k.on("cancel",n),k.on("paymentmethod",L))}),[k,A,n,L]);var x=(0,c.useCallback)((function(e){return function(t,n){var r=n.billing,a=n.shipping,o=r.cartTotal,i=r.cartTotalItems,c=r.currency,s=a.shippingRates;t?e.updateWith({status:"success",total:{amount:o.value,label:o.label,pending:!1},displayItems:(0,u.getDisplayItems)(i,c),shippingOptions:(0,u.getShippingOptions)(s)}):e.updateWith({status:"invalid_shipping_address"})}}),[]),A=(0,c.useCallback)((function(e){var t=e.shippingAddress,n=D.current,r=f(t);n.setShippingAddress(d(d({},n.shippingAddress),r));var a=(0,l.default)((0,u.getIntermediateAddress)(n.shippingAddress),r);h("onShippingChanged",x(e),a)}),[h]),I=(0,c.useCallback)((function(e){var t=e.shippingOption,n=D.current;n.setSelectedRates.apply(n,(0,a.default)((0,u.getSelectedShippingOption)(t.id))),h("onShippingChanged",x(e))}),[h]),L=(0,c.useCallback)((function(e){var t=e.paymentMethod,n=e.payerName,r=void 0===n?null:n,a=e.payerEmail,o=void 0===a?null:a,i=e.payerPhone,c={payerName:r,payerEmail:o,payerPhone:void 0===i?null:i};null!=t&&t.billing_details.address&&(c=f(t.billing_details.address,c)),g.billingData=c,e.shippingAddress&&(g.shippingAddress=f(e.shippingAddress)),y(t.id),e.complete("success")}),[]);return{paymentRequest:k}}},3893:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useProcessCheckoutError=void 0;var r=n(3027);t.useProcessCheckoutError=function(e){var t=e.responseTypes,n=e.subscriber,a=e.messageContext,o=void 0===a?null:a;(0,r.useEffect)((function(){var e=n((function(e){var n;return null!=e&&null!==(n=e.processingResponse.paymentDetails)&&void 0!==n&&n.stripeErrorMessage?{type:t.ERROR,message:e.processingResponse.paymentDetails.stripeErrorMessage,messageContext:o}:null}));return function(){return e()}}),[t,n])}},4332:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.useProcessPaymentIntent=void 0;var a=r(n(7015)),o=r(n(8926)),i=r(n(9713)),c=r(n(3038)),s=n(3027),u=n(6664),l=n(1134);function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){(0,i.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.useProcessPaymentIntent=function(e){var t=e.getData,n=e.billing,r=e.shippingData,p=e.onPaymentProcessing,f=e.emitResponse,m=e.error,y=e.onSubmit,g=e.activePaymentMethod,v=e.paymentType,h=void 0===v?"card":v,b=e.setupIntent,P=void 0===b?null:b,E=e.removeSetupIntent,O=void 0===E?null:E,S=e.savePaymentMethod,_=void 0!==S&&S,w=e.exportedValues,C=void 0===w?{}:w,k=e.getPaymentMethodArgs,M=void 0===k?function(){return{}}:k,j=n.billingData,D=r.shippingAddress,R=f.responseTypes,x=(0,s.useState)(null),A=(0,c.default)(x,2),I=A[0],L=A[1],T=(0,u.useStripe)(),N=(0,s.useRef)(M);(0,s.useEffect)((function(){N.current=M}),[M]);var B=(0,s.useCallback)((function(){return d(d({},{type:h,billing_details:(0,l.getBillingDetailsFromAddress)(null!=C&&C.billingData?C.billingData:j)}),N.current())}),[j,h,M]),F=(0,s.useCallback)((function(e,n){var r,a={meta:{paymentMethodData:(r={},(0,i.default)(r,"".concat(t("name"),"_token_key"),e),(0,i.default)(r,"".concat(t("name"),"_save_source_key"),n),r)}};return null!=C&&C.billingData&&(a.meta.billingData=C.billingData),null!=C&&C.shippingAddress&&(a.meta.shippingData={address:C.shippingAddress}),a}),[j,D]);return(0,s.useEffect)((function(){I&&"string"==typeof I&&y()}),[I,y]),(0,s.useEffect)((function(){var e=p((0,o.default)(a.default.mark((function e(){var n,r;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(g===t("name")){e.next=2;break}return e.abrupt("return",null);case 2:if(n=null,r=null,e.prev=3,!m){e.next=6;break}throw new l.StripeError(m);case 6:if(!P){e.next=16;break}return e.next=9,T.confirmCardSetup(P.client_secret,{payment_method:B()});case 9:if(!(n=e.sent).error){e.next=12;break}throw new l.StripeError(n.error);case 12:r=n.setupIntent.payment_method,O(),e.next=26;break;case 16:if(!I){e.next=20;break}r=I,e.next=26;break;case 20:return e.next=22,T.createPaymentMethod(B());case 22:if(!(n=e.sent).error){e.next=25;break}throw new l.StripeError(n.error);case 25:r=n.paymentMethod.id;case 26:return e.abrupt("return",(0,l.ensureSuccessResponse)(R,F(r,_)));case 29:return e.prev=29,e.t0=e.catch(3),console.log(e.t0),L(null),e.abrupt("return",(0,l.ensureErrorResponse)(R,e.t0.error));case 34:case"end":return e.stop()}}),e,null,[[3,29]])}))));return function(){return e()}}),[I,j,p,T,P,g,_]),{setPaymentMethod:L}}},6107:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.useSetupIntent=void 0;var a=r(n(7015)),o=r(n(8926)),i=r(n(3038)),c=n(3027),s=r(n(7606)),u=n(1134);t.useSetupIntent=function(e){var t=e.cartTotal,n=e.setError,r=(0,c.useState)((0,u.getFromCache)("setupIntent")),l=(0,i.default)(r,2),p=l[0],d=l[1];(0,c.useEffect)((function(){var e=function(){var e=(0,o.default)(a.default.mark((function e(){var t;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!p){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,(0,s.default)({url:(0,u.getRoute)("create/setup_intent"),method:"POST"});case 4:(t=e.sent).code?n(t.message):((0,u.storeInCache)("setupIntent",t.intent),d(t.intent));case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();(0,u.cartContainsPreOrder)()||(0,u.cartContainsSubscription)()&&0==t.value?p||e():d(null)}),[t.value]);var f=(0,c.useCallback)((function(){(0,u.deleteFromCache)("setupIntent")}),[t.value]);return{setupIntent:p,removeSetupIntent:f}}},2715:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.useStripeError=void 0;var a=r(n(3038)),o=n(3027);t.useStripeError=function(){var e=(0,o.useState)(!1),t=(0,a.default)(e,2);return[t[0],t[1]]}},6480:(e,t,n)=>{var r=n(3027),a=n(5318),o=a(n(6479)),i=a(n(9713)),c=a(n(3038)),s=n(3027),u=n(4222),l=n(1134),p=n(3539),d=n(3187),f=n(6664),m=n(3163);function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach((function(t){(0,i.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var v,h=(0,l.getSettings)("stripe_afterpay_data"),b=function(e){var t=e.getData,n=(0,s.useState)({amount:t("cartTotal"),currency:t("currency"),isEligible:t("msgOptions").isEligible}),a=(0,c.default)(n,2),o=a[0],i=a[1],u={locale:"auto"};return"GBP"!==o.currency||["fr-FR","it-IT","es-ES"].includes(t("locale"))||(u.locale="en-GB"),v=i,r.createElement(f.Elements,{stripe:l.initStripe,options:u},r.createElement("div",{className:"wc-stripe-blocks-afterpay__label"},r.createElement(f.AfterpayClearpayMessageElement,{options:g(g({},t("msgOptions")),{amount:o.amount,currency:o.currency,isEligible:o.isEligible})})))},P=function(e){var t=e.content,n=e.billing,a=e.shippingData,i=(0,o.default)(e,["content","billing","shippingData"]),c=t,u=n.cartTotal,l=n.currency,p=a.needsShipping;return(0,s.useEffect)((function(){v({amount:u.value,currency:l.code,isEligible:p})}),[u.value,l.code,p]),r.createElement(r.Fragment,null,p&&r.createElement("div",{className:"wc-stripe-blocks-payment-method-content"},r.createElement("div",{className:"wc-stripe-blocks-afterpay-offsite__container"},r.createElement("div",{className:"wc-stripe-blocks-afterpay__offsite"},r.createElement("img",{src:h("offSiteSrc")}),r.createElement("p",null,(0,m.sprintf)((0,m.__)('After clicking "%s", you will be redirected to Afterpay to complete your purchase securely.',"woo-stripe-payment"),h("placeOrderButtonLabel"))))),r.createElement(c,g(g({},i),{},{billing:n,shippingData:a}))))};h()&&(0,u.registerPaymentMethod)({name:h("name"),label:r.createElement(b,{getData:h}),ariaLabel:(0,m.__)("Afterpay","woo-stripe-payment"),placeOrderButtonLabel:h("placeOrderButtonLabel"),canMakePayment:(0,p.canMakePayment)(h,(function(e){var t=e.settings,n=e.cartTotals,r=e.cartNeedsShipping,a=n.currency_code,o=n.currency_minor_unit,i=n.total_price,c=t("requiredParams"),s=t("accountCountry"),u=!!c[a]&&c[a];v&&v({amount:parseInt(n.total_price),currency:a,isEligible:r});var l=parseInt(i)/Math.pow(10,o),p=s===(null==u?void 0:u[0])&&r&&l>(null==u?void 0:u[1])&&l<(null==u?void 0:u[2]);return!p&&!t("hideIneligible")||p})),content:r.createElement(P,{content:p.LocalPaymentIntentContent,getData:h,confirmationMethod:"confirmAfterpayClearpayPayment"}),edit:r.createElement(d.PaymentMethod,{content:p.LocalPaymentIntentContent,getData:h}),supports:{showSavedCards:!1,showSaveOption:!1,features:h("features")}})},39:(e,t,n)=>{var r=n(3027),a=n(4222),o=n(1134),i=n(3539),c=n(2029),s=n(3187),u=(0,o.getSettings)("stripe_alipay_data");u()&&(0,a.registerPaymentMethod)({name:u("name"),label:r.createElement(c.PaymentMethodLabel,{title:u("title"),paymentMethod:u("name"),icons:u("icon")}),ariaLabel:"Alipay",placeOrderButtonLabel:u("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(u),content:r.createElement(s.PaymentMethod,{content:i.LocalPaymentSourceContent,getData:u}),edit:r.createElement(s.PaymentMethod,{content:i.LocalPaymentSourceContent,getData:u}),supports:{showSavedCards:!1,showSaveOption:!1,features:u("features")}})},8641:(e,t,n)=>{var r=n(3027),a=n(4222),o=n(1134),i=n(3539),c=n(3187),s=(0,o.getSettings)("stripe_bancontact_data");s()&&(0,a.registerPaymentMethod)({name:s("name"),label:r.createElement(c.PaymentMethodLabel,{title:s("title"),paymentMethod:s("name"),icons:s("icon")}),ariaLabel:"Bancontact",placeOrderButtonLabel:s("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(s),content:r.createElement(c.PaymentMethod,{content:i.LocalPaymentSourceContent,getData:s}),edit:r.createElement(c.PaymentMethod,{content:i.LocalPaymentSourceContent,getData:s}),supports:{showSavedCards:!1,showSaveOption:!1,features:s("features")}})},5176:(e,t,n)=>{var r=n(3027),a=n(4222),o=n(1134),i=n(3539),c=n(3187),s=n(6664),u=(0,o.getSettings)("stripe_becs_data");u()&&(0,a.registerPaymentMethod)({name:u("name"),label:r.createElement(c.PaymentMethodLabel,{title:u("title"),paymentMethod:u("name"),icons:u("icon")}),ariaLabel:"BECS",placeOrderButtonLabel:u("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(u),content:r.createElement(c.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:u,confirmationMethod:"confirmAuBecsDebitPayment",component:s.AuBankAccountElement}),edit:r.createElement(c.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:u}),supports:{showSavedCards:!1,showSaveOption:!1,features:u("features")}})},4990:(e,t,n)=>{var r=n(3027),a=n(5318),o=a(n(7154)),i=a(n(9713)),c=a(n(3038)),s=a(n(6479)),u=n(3027),l=n(3163),p=n(4222),d=a(n(4184)),f=n(1134),m=n(3539),y=n(3187);function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){(0,i.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var h=(0,f.getSettings)("stripe_boleto_data");h()&&(0,p.registerPaymentMethod)({name:h("name"),label:r.createElement(y.PaymentMethodLabel,{title:h("title"),paymentMethod:h("name"),icons:h("icon")}),ariaLabel:"Boleto",placeOrderButtonLabel:h("placeOrderButtonLabel"),canMakePayment:(0,m.canMakePayment)(h),content:r.createElement(y.PaymentMethod,{content:function(e){var t=e.eventRegistration,n=(0,s.default)(e,["eventRegistration"]),a=(0,u.useState)(""),i=(0,c.default)(a,2),p=i[0],y=i[1],g=(0,u.useState)(!1),h=(0,c.default)(g,2),b=h[0],P=h[1],E=t.onPaymentProcessing,O=(0,u.useCallback)((function(){return{boleto:{tax_id:p}}}),[p]);return(0,u.useEffect)((function(){var e=E((function(){return!!p||(0,f.ensureErrorResponse)(n.emitResponse.responseTypes,(0,l.__)("Please enter a valid CPF/CNPJ value","woo-stripe-payment"))}));return function(){return e()}}),[E,p]),r.createElement(r.Fragment,null,r.createElement("div",{className:(0,d.default)("wc-block-components-text-input",{"is-active":b||p})},r.createElement("input",{type:"text",id:"wc-stripe-boleto-tax_id",onChange:function(e){return y(e.target.value)},onFocus:function(){return P(!0)},onBlur:function(){return P(!1)}}),r.createElement("label",{htmlFor:"wc-stripe-boleto-tax_id"},(0,l.__)(" CPF / CNPJ"," woo-stripe-payment"))),(0,f.isTestMode)()&&r.createElement("div",{className:"wc-stripe-boleto__description"},r.createElement("p",null,(0,l.__)("Test mode values","woo-stripe-payment")),r.createElement("div",null,r.createElement("label",null,"CPF:"),"Â ",r.createElement("span",null,"000.000.000-00")),r.createElement("div",null,r.createElement("label",null,"CNPJ:"),"Â ",r.createElement("span",null,"00.000.000/0000-00"))),!(0,f.isTestMode)()&&r.createElement("div",{className:"wc-stripe-boleto__description"},r.createElement("p",null,(0,l.__)("Accepted formats","woo-stripe-payment")),r.createElement("div",null,r.createElement("label",null,"CPF:"),"Â ",r.createElement("span",null,(0,l.__)("XXX.XXX.XXX-XX or XXXXXXXXXXX","woo-stripe-payment"))),r.createElement("div",null,r.createElement("label",null,"CNPJ:"),"Â ",r.createElement("span",null,(0,l.__)("XX.XXX.XXX/XXXX-XX or XXXXXXXXXXXXXX","woo-stripe-payment")))),r.createElement(m.LocalPaymentIntentContent,(0,o.default)({callback:O},v(v({},n),{eventRegistration:t}))))},getData:h,confirmationMethod:"confirmBoletoPayment"}),edit:r.createElement(y.PaymentMethod,{content:m.LocalPaymentIntentContent,getData:h}),supports:{showSavedCards:!1,showSaveOption:!1,features:h("features")}})},4494:(e,t,n)=>{var r=n(3027),a=n(4222),o=n(1134),i=n(3539),c=n(3187),s=(0,o.getSettings)("stripe_eps_data");s()&&(0,a.registerPaymentMethod)({name:s("name"),label:r.createElement(c.PaymentMethodLabel,{title:s("title"),paymentMethod:s("name"),icons:s("icon")}),ariaLabel:"EPS",placeOrderButtonLabel:s("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(s),content:r.createElement(c.PaymentMethod,{content:i.LocalPaymentSourceContent,getData:s}),edit:r.createElement(c.PaymentMethod,{content:i.LocalPaymentSourceContent,getData:s}),supports:{showSavedCards:!1,showSaveOption:!1,features:s("features")}})},4031:(e,t,n)=>{var r=n(3027),a=n(4222),o=n(1134),i=n(3539),c=n(3187),s=n(6664),u=(0,o.getSettings)("stripe_fpx_data");u()&&(0,a.registerPaymentMethod)({name:u("name"),label:r.createElement(c.PaymentMethodLabel,{title:u("title"),paymentMethod:u("name"),icons:u("icon")}),ariaLabel:"FPX",placeOrderButtonLabel:u("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(u),content:r.createElement(c.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:u,confirmationMethod:"confirmIdealPayment",component:s.FpxBankElement}),edit:r.createElement(c.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:u}),supports:{showSavedCards:!1,showSaveOption:!1,features:u("features")}})},3817:(e,t,n)=>{var r=n(3027),a=n(4222),o=n(1134),i=n(3539),c=n(3187),s=(0,o.getSettings)("stripe_giropay_data");s()&&(0,a.registerPaymentMethod)({name:s("name"),label:r.createElement(c.PaymentMethodLabel,{title:s("title"),paymentMethod:s("name"),icons:s("icon")}),ariaLabel:"Giropay",placeOrderButtonLabel:s("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(s),content:r.createElement(c.PaymentMethod,{content:i.LocalPaymentSourceContent,getData:s}),edit:r.createElement(c.PaymentMethod,{content:i.LocalPaymentSourceContent,getData:s}),supports:{showSavedCards:!1,showSaveOption:!1,features:s("features")}})},3140:(e,t,n)=>{var r=n(3027),a=n(4222),o=n(1134),i=n(3539),c=n(3187),s=(0,o.getSettings)("stripe_grabpay_data");s()&&(0,a.registerPaymentMethod)({name:s("name"),label:r.createElement(c.PaymentMethodLabel,{title:s("title"),paymentMethod:s("name"),icons:s("icon")}),ariaLabel:"GrabPay",placeOrderButtonLabel:s("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(s),content:r.createElement(c.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:s,confirmationMethod:"confirmGrabPayPayment"}),edit:r.createElement(c.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:s}),supports:{showSavedCards:!1,showSaveOption:!1,features:s("features")}})},8522:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(3160);Object.keys(r).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===r[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}}))}));var a=n(3994);Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===a[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}}))}));var o=n(878);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))}))},3160:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.useAfterProcessLocalPayment=void 0;var a=r(n(7015)),o=r(n(9713)),i=r(n(6479)),c=r(n(8926)),s=n(3027),u=n(6664),l=n(1134);function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.useAfterProcessLocalPayment=function(e){var t=e.getData,n=e.billingData,r=e.eventRegistration,o=e.responseTypes,p=e.activePaymentMethod,f=e.confirmationMethod,m=e.getPaymentMethodArgs,y=void 0===m?function(){return{}}:m,g=(0,u.useStripe)(),v=r.onCheckoutAfterProcessingWithSuccess,h=r.onCheckoutAfterProcessingWithError,b=(0,s.useRef)(n),P=(0,s.useRef)(y);(0,s.useEffect)((function(){b.current=n}),[n]),(0,s.useEffect)((function(){P.current=y}),[y]),(0,s.useEffect)((function(){var e=v(function(){var e=(0,c.default)(a.default.mark((function e(n){var r,c,s,u,m,y,v;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.redirectUrl,t("name")!==p){e.next=18;break}if(e.prev=2,!(c=r.match(/#response=(.+)/))){e.next=12;break}return s=JSON.parse(window.atob(decodeURIComponent(c[1]))),u=s.client_secret,m=s.return_url,y=(0,i.default)(s,["client_secret","return_url"]),e.next=8,g[f](u,{payment_method:d({billing_details:(0,l.getBillingDetailsFromAddress)(b.current)},P.current()),return_url:m});case 8:if(!(v=e.sent).error){e.next=11;break}throw new l.StripeError(v.error);case 11:window.location=decodeURI(y.order_received_url);case 12:e.next=18;break;case 14:return e.prev=14,e.t0=e.catch(2),console.log(e.t0),e.abrupt("return",(0,l.ensureErrorResponse)(o,e.t0.error));case 18:case"end":return e.stop()}}),e,null,[[2,14]])})));return function(t){return e.apply(this,arguments)}}());return function(){return e()}}),[g,v,h])}},878:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.useCreateSource=void 0;var a=r(n(7015)),o=r(n(8926)),i=r(n(9713)),c=r(n(3038)),s=n(3027),u=n(1134),l=n(6664),p=n(3163);t.useCreateSource=function(e){var t=e.getData,n=e.billing,r=e.shippingAddress,d=e.onPaymentProcessing,f=e.responseTypes,m=e.getSourceArgs,y=void 0!==m&&m,g=e.element,v=void 0!==g&&g,h=(0,s.useState)(!1),b=(0,c.default)(h,2),P=b[0],E=b[1],O=(0,s.useState)(!1),S=(0,c.default)(O,2),_=S[0],w=S[1],C=(0,s.useRef)({billing:n,shippingAddress:r}),k=(0,l.useStripe)(),M=(0,l.useElements)();(0,s.useEffect)((function(){C.current={billing:n,shippingAddress:r}}));var j=(0,s.useCallback)((function(){var e=C.current.billing,n=e.cartTotal,r=e.currency,a=e.billingData,o=(0,u.getDefaultSourceArgs)({type:t("paymentType"),amount:n.value,billingData:a,currency:r.code,returnUrl:t("returnUrl")});return y&&(o=y(o,{billingData:a})),o}),[]),D=(0,s.useCallback)((function(e){return{meta:{paymentMethodData:(0,i.default)({},"".concat(t("name"),"_token_key"),e)}}}),[]);return(0,s.useEffect)((function(){var e=d((0,o.default)(a.default.mark((function e(){var t;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!P){e.next=2;break}return e.abrupt("return",(0,u.ensureSuccessResponse)(f,D(P.id)));case 2:if(e.prev=2,!v){e.next=11;break}if(_){e.next=6;break}throw(0,p.__)("Please enter your payment info before proceeding.","woo-stripe-payment");case 6:return e.next=8,k.createSource(M.getElement(v),j());case 8:t=e.sent,e.next=14;break;case 11:return e.next=13,k.createSource(j());case 13:t=e.sent;case 14:if(!t.error){e.next=16;break}throw new u.StripeError(t.error);case 16:return E(t.source),e.abrupt("return",(0,u.ensureSuccessResponse)(f,D(t.source.id)));case 20:return e.prev=20,e.t0=e.catch(2),console.log(e.t0),e.abrupt("return",(0,u.ensureErrorResponse)(f,e.t0.error||e.t0));case 24:case"end":return e.stop()}}),e,null,[[2,20]])}))));return function(){return e()}}),[P,d,k,f,v,_,w]),{setIsValid:w}}},3994:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.useValidateCheckout=void 0;var a=r(n(3038)),o=n(3027),i=n(1134),c=n(3163);t.useValidateCheckout=function(e){var t=e.subscriber,n=e.responseTypes,r=e.component,s=void 0===r?null:r,u=e.msg,l=void 0===u?(0,c.__)("Please enter your payment info before proceeding.","woo-stripe-payment"):u,p=(0,o.useState)(!1),d=(0,a.default)(p,2),f=d[0],m=d[1];return(0,o.useEffect)((function(){var e=t((function(){return!(s&&!f)||(0,i.ensureErrorResponse)(n,l)}));return function(){return e()}}),[t,f,m,n,s]),{isValid:f,setIsValid:m}}},9474:(e,t,n)=>{var r=n(3027),a=n(4222),o=n(1134),i=n(3539),c=n(3187),s=n(6664),u=(0,o.getSettings)("stripe_ideal_data");u()&&(0,a.registerPaymentMethod)({name:u("name"),label:r.createElement(c.PaymentMethodLabel,{title:u("title"),paymentMethod:u("name"),icons:u("icon")}),ariaLabel:"Ideal",placeOrderButtonLabel:u("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(u),content:r.createElement(c.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:u,confirmationMethod:"confirmIdealPayment",component:s.IdealBankElement}),edit:r.createElement(c.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:u}),supports:{showSavedCards:!1,showSaveOption:!1,features:u("features")}})},9738:(e,t,n)=>{n(7156),n(9474),n(3868),n(8641),n(3817),n(4494),n(4784),n(1192),n(7894),n(3766),n(4031),n(5176),n(3140),n(39),n(6480),n(4990),n(5748)},6867:(e,t,n)=>{var r=n(3027),a=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.KlarnaPaymentCategories=void 0;var o=n(3027),i=a(n(6630));t.KlarnaPaymentCategories=function(e){var t=e.source,n=e.categories,a=e.onChange,o=e.selected;return r.createElement("div",{className:"wc-stripe-blocks-klarna-container"},r.createElement("ul",null,n.map((function(e){return r.createElement(c,{source:t,key:e.type,category:e,onChange:a,selected:o})}))))};var c=function(e){var t=e.source,n=e.category,a=e.selected,c=e.onChange,s=n.type===a;(0,o.useEffect)((function(){Klarna.Payments.load({container:"#klarna-category-".concat(n.type),payment_method_category:n.type})}),[t]);var u={label:n.label,value:n.type,content:r.createElement("div",{id:"klarna-category-".concat(n.type)})};return r.createElement("li",{className:"wc-stripe-blocks-klarna__category",key:n.type},r.createElement(i.default,{option:u,checked:s,onChange:c}))}},6028:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(8092);Object.keys(r).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===r[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}}))}));var a=n(437);Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===a[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}}))}))},8092:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.useCreateSource=void 0;var a=r(n(7015)),o=r(n(8926)),i=r(n(8)),c=r(n(9713)),s=r(n(3038)),u=n(3027),l=n(6664),p=n(3636),d=n(1134),f=r(n(7606));function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){(0,c.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.useCreateSource=function(e){var t=e.getData,n=e.billing,r=e.shippingData,m=(0,l.useStripe)(),g=(0,p.useStripeError)(),v=(0,s.default)(g,2),h=(v[0],v[1]),b=(0,u.useRef)(new AbortController),P=(0,u.useRef)({}),E=(0,u.useRef)({}),O=(0,u.useState)(!1),S=(0,s.default)(O,2),_=S[0],w=S[1],C=(0,u.useState)(!1),k=(0,s.default)(C,2),M=k[0],j=k[1],D=n.billingData,R=n.cartTotal,x=n.cartTotalItems,A=n.currency,I=(0,u.useCallback)((function(e){var t=e.billingData,n=e.shippingData,r=n.needsShipping,a=n.shippingAddress;return!!(0,d.isAddressValid)(t)&&(!r||(0,d.isAddressValid)(a))}),[]),L=(0,u.useCallback)((function(e,t){var n=[];return e.forEach((function(e){n.push({amount:e.value,currency:t,description:e.label,quantity:1})})),n}),[]),T=(0,u.useCallback)((function(e){var n=e.cartTotal,r=e.cartTotalItems,a=e.billingData,o=e.currency,i=e.shippingData,c=a.first_name,s=a.last_name,u=a.country,l=i.needsShipping,p=i.shippingAddress,f=(0,d.getDefaultSourceArgs)({type:t("paymentType"),amount:n.value,billingData:a,currency:o.code,returnUrl:t("returnUrl")});return f=y(y({},f),{source_order:{items:L(r,o.code)},klarna:{locale:t("locale"),product:"payment",purchase_country:u,first_name:c,last_name:s}}),"US"==u&&(f.klarna.custom_payment_methods="payin4,installments"),l&&(f.klarna=y(y({},f.klarna),{shipping_first_name:p.first_name,shipping_last_name:p.last_name}),f.source_order.shipping={address:{city:p.city||"",country:p.country||"",line1:p.address_1||"",line2:p.address_2||"",postal_code:p.postcode||"",state:p.state||""}}),E.current=P.current,P.current=f,f}),[]),N=(0,u.useCallback)((function(e,t){var n=function e(t,n){var r={};if(t&&"object"===(0,i.default)(t)&&!Array.isArray(t))for(var a=0,o=Object.keys(t);a<o.length;a++){var c=o[a];"object"!==(0,i.default)(t[c])||Array.isArray(t[c])?r[c]=n[c]:r[c]=e(t[c],n[c])}else r=t;return r}(e,t);return JSON.stringify(e)==JSON.stringify(n)}),[]),B=(0,u.useCallback)(function(){var e=(0,o.default)(a.default.mark((function e(t){var n,r,o,i,s,u,l;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.billingData,r=t.shippingData,o=t.cartTotal,i=t.cartTotalItems,s=t.currency,u=T({cartTotal:o,cartTotalItems:i,billingData:n,currency:s,shippingData:r}),e.prev=2,e.next=5,m.createSource(u);case 5:if(!(l=e.sent).error){e.next=8;break}throw new d.StripeError(l.error);case 8:(0,d.storeInCache)("klarna:source",(0,c.default)({},s.code,{source:l.source,args:P.current})),j(l.source),e.next=16;break;case 12:e.prev=12,e.t0=e.catch(2),console.log(e.t0),h(e.t0.error);case 16:case"end":return e.stop()}}),e,null,[[2,12]])})));return function(t){return e.apply(this,arguments)}}(),[m]),F=(0,u.useCallback)(function(){var e=(0,o.default)(a.default.mark((function e(n){var r,o,i,s,u;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.source,o=n.updates,i=n.currency,s={updates:o,source_id:r.id,client_secret:r.client_secret,payment_method:t("name")},e.prev=2,b.current.abort(),b.current=new AbortController,e.next=7,(0,f.default)({url:(0,d.getRoute)("update/source"),method:"POST",data:s,signal:b.current.signal});case 7:(u=e.sent).source&&((0,d.storeInCache)("klarna:source",(0,c.default)({},i,{source:r,args:P.current})),j(u.source)),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(2),console.log("update aborted");case 14:case"end":return e.stop()}}),e,null,[[2,11]])})));return function(t){return e.apply(this,arguments)}}(),[]);return(0,u.useEffect)((function(){var e;if(!M)if(null!==(e=(0,d.getFromCache)("klarna:source"))&&void 0!==e&&e[A.code]){var t=(0,d.getFromCache)("klarna:source")[A.code],n=t.source,a=t.args;P.current=a,j(n)}else m&&I({billingData:D,shippingData:r})&&(w(!0),B({billingData:D,shippingData:r,cartTotal:R,cartTotalItems:x,currency:A}).then((function(){return w(!1)})))}),[m,null==M?void 0:M.id,B,D,R.value,r,w,x,A.code]),(0,u.useEffect)((function(){if(m&&M){var e=(t=T({billingData:D,cartTotal:R,cartTotalItems:x,currency:A,shippingData:r}),["type","currency","statement_descriptor","redirect","klarna.product","klarna.locale","klarna.custom_payment_methods"].reduce((function(e,t){if(t.indexOf(".")>-1){var n=t.split(".");return delete n.slice(0,n.length-1).reduce((function(e,t){return e[t]}),e)[t=n[n.length-1]],e}return delete e[t],e}),t));N(e,E.current)||F({source:M,updates:e,currency:A.code})}var t}),[m,null==M?void 0:M.id,D,R.value,x,r,A.code]),{source:M,setSource:j,isLoading:_}}},437:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.useProcessPayment=void 0;var a=r(n(9713)),o=n(3027),i=n(1134),c=n(3163);t.useProcessPayment=function(e){var t=e.payment_method,n=e.source_id,r=e.paymentCategory,s=e.onPaymentProcessing,u=e.responseTypes;(0,o.useEffect)((function(){var e=s((function(){return new Promise((function(e){Klarna.Payments.authorize({payment_method_category:r},(function(r){r.approved?((0,i.deleteFromCache)("klarna:source"),e((0,i.ensureSuccessResponse)(u,{meta:{paymentMethodData:(0,a.default)({},"".concat(t,"_token_key"),n)}}))):e((0,i.ensureErrorResponse)(u,r.error||(0,c.__)("Your purchase is not approved.","woo-stripe-payment")))}))}))}));return function(){return e()}}),[n,r,s])}},7156:(e,t,n)=>{var r=n(3027),a=n(5318)(n(3038)),o=n(3027),i=n(4222),c=n(3163),s=n(3636),u=n(1134),l=n(3187),p=n(3539),d=n(6664),f=n(6867),m=n(8567),y=n(6028);n(1530);var g=(0,u.getSettings)("stripe_klarna_data"),v=function(e){return r.createElement(d.Elements,{stripe:u.initStripe},r.createElement(h,e))},h=function(e){var t=e.getData,n=e.billing,i=e.shippingData,l=e.emitResponse,p=e.eventRegistration,d=l.responseTypes,g=p.onPaymentProcessing,v=p.onCheckoutAfterProcessingWithError,h=(0,o.useState)(""),b=(0,a.default)(h,2),P=b[0],E=b[1],O=(0,o.useState)(!1),S=(0,a.default)(O,2),_=S[0],w=S[1],C=function(e){for(var n=e.klarna.payment_method_categories.split(","),r=[],a=0,o=Object.keys(t("categories"));a<o.length;a++){var i=o[a];n.includes(i)&&r.push({type:i,label:t("categories")[i]})}return r},k=(0,y.useCreateSource)({getData:t,billing:n,shippingData:i}),M=k.source,j=k.isLoading;if((0,y.useProcessPayment)({payment_method:t("name"),source_id:M.id,paymentCategory:P,onPaymentProcessing:g,responseTypes:d}),(0,s.useProcessCheckoutError)({responseTypes:d,subscriber:v}),(0,o.useEffect)((function(){if(!P&&M){var e=C(M);e.length&&E(e.shift().type)}}),[M]),(0,o.useEffect)((function(){M&&(Klarna.Payments.init({client_token:M.klarna.client_token}),w(!0))}),[null==M?void 0:M.id]),M&&_){var D=C(M);return r.createElement(r.Fragment,null,(0,u.isTestMode)()&&r.createElement("div",{className:"wc-stripe-klarna__testmode"},r.createElement("label",null,(0,c.__)("Test mode sms","woo-stripe-payment"),":"),"Â ",r.createElement("span",null,"123456")),r.createElement(f.KlarnaPaymentCategories,{source:M,categories:D,selected:!P&&D.length>0?D[0].type:P,onChange:E}))}return j?r.createElement(m.KlarnaLoader,null):r.createElement("div",{className:"wc-stripe-blocks-klarna__notice"},(0,c.__)("Please fill out all required fields before paying with Klarna.","woo-stripe-payment"))};g()&&(0,i.registerPaymentMethod)({name:g("name"),label:r.createElement(l.PaymentMethodLabel,{title:g("title"),paymentMethod:g("name"),icons:g("icon")}),ariaLabel:"Klarna",placeOrderButtonLabel:g("placeOrderButtonLabel"),canMakePayment:(0,p.canMakePayment)(g,(function(e){var t=e.settings,n=e.billingData,r=e.cartTotals,a=n.country,o=r.currency_code,i=t("requiredParams");return[o]in i&&i[o].includes(a)})),content:r.createElement(l.PaymentMethod,{getData:g,content:v}),edit:r.createElement(l.PaymentMethod,{getData:g,content:v}),supports:{showSavedCards:!1,showSaveOption:!1,features:g("features")}})},8567:(e,t,n)=>{var r=n(3027);Object.defineProperty(t,"__esModule",{value:!0}),t.KlarnaLoader=void 0,t.KlarnaLoader=function(){return r.createElement("div",{className:"wc-stripe-klarna-loader"},r.createElement("div",null),r.createElement("div",null),r.createElement("div",null))}},3539:(e,t,n)=>{var r=n(3027),a=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.LocalPaymentSourceContent=t.LocalPaymentIntentContent=t.canMakePayment=void 0;var o=a(n(7154)),i=a(n(9713)),c=a(n(6479)),s=n(3027),u=n(6664),l=n(1134),p=n(8522),d=n(3636);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){(0,i.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.canMakePayment=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return function(n){var r=n.billingData,a=n.cartTotals,o=(0,c.default)(n,["billingData","cartTotals"]),i=a.currency_code,s=r.country,u=e("countries"),p=e("allowedCountries"),d=e("features"),f=!1;if(e("isAdmin"))f=!0;else{if((0,l.cartContainsSubscription)()&&!d.includes("subscriptions"))return!1;if((0,l.cartContainsPreOrder)()&&!d.includes("pre-orders"))return!1;e("currencies").includes(i)&&(f="all_except"===p?!e("exceptCountries").includes(s):"specific"===p?e("specificCountries").includes(s):!(u.length>0)||u.includes(s)),t&&f&&(f=t(m({settings:e,billingData:r,cartTotals:a},o)))}return f}},t.LocalPaymentIntentContent=function(e){return r.createElement(u.Elements,{stripe:l.initStripe},r.createElement(g,e))},t.LocalPaymentSourceContent=function(e){return r.createElement(u.Elements,{stripe:l.initStripe},r.createElement(y,e))};var y=function(e){var t=e.getData,n=e.billing,a=e.shippingData,o=e.emitResponse,i=e.eventRegistration,c=e.getSourceArgs,s=void 0!==c&&c,u=e.element,l=void 0!==u&&u,d=a.shippingAddress,f=i.onPaymentProcessing,m=(i.onCheckoutAfterProcessingWithError,o.responseTypes),y=(o.noticeContexts,(0,p.useCreateSource)({getData:t,billing:n,shippingAddress:d,onPaymentProcessing:f,responseTypes:m,getSourceArgs:s,element:l}).setIsValid);return l?r.createElement(v,{name:t("name"),options:t("elementOptions"),onChange:function(e){y(e.complete)},element:l}):null},g=function(e){var t=e.getData,n=e.billing,a=e.emitResponse,o=e.eventRegistration,c=e.activePaymentMethod,l=e.confirmationMethod,f=void 0===l?null:l,m=e.component,y=void 0===m?null:m,g=e.callback,h=void 0===g?null:g,b=(0,u.useElements)(),P=n.billingData,E=o.onPaymentProcessing,O=o.onCheckoutAfterProcessingWithError,S=a.responseTypes,_=a.noticeContexts,w=(0,s.useCallback)((function(){return y?(0,i.default)({},t("paymentType"),b.getElement(y)):h?h():{}}),[b,h]),C=(0,p.useValidateCheckout)({subscriber:E,responseTypes:S,component:y}).setIsValid;return(0,p.useAfterProcessLocalPayment)({getData:t,billingData:P,eventRegistration:o,responseTypes:S,activePaymentMethod:c,confirmationMethod:f,getPaymentMethodArgs:w}),(0,d.useProcessCheckoutError)({responseTypes:S,subscriber:O,messageContext:_.PAYMENT}),y?r.createElement(v,{name:t("name"),options:t("elementOptions"),onChange:function(e){return C(!e.empty)},element:y,callback:h}):null},v=function(e){var t=e.name,n=e.onChange,a=e.element,i=e.options,s=(0,c.default)(e,["name","onChange","element","options"]),u=a;return r.createElement("div",{className:"wc-stripe-local-payment-container ".concat(t," ").concat(u.displayName)},r.createElement(u,(0,o.default)({options:i,onChange:n},s)))}},4784:(e,t,n)=>{var r=n(3027),a=n(4222),o=n(1134),i=n(3539),c=n(3187),s=(0,o.getSettings)("stripe_multibanco_data");s()&&(0,a.registerPaymentMethod)({name:s("name"),label:r.createElement(c.PaymentMethodLabel,{title:s("title"),paymentMethod:s("name"),icons:s("icon")}),ariaLabel:"MultiBanco",placeOrderButtonLabel:s("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(s),content:r.createElement(c.PaymentMethod,{content:i.LocalPaymentSourceContent,getData:s}),edit:r.createElement(c.PaymentMethod,{content:i.LocalPaymentSourceContent,getData:s}),supports:{showSavedCards:!1,showSaveOption:!1,features:s("features")}})},5748:(e,t,n)=>{var r=n(3027),a=n(4222),o=n(1134),i=n(3539),c=n(3187),s=(n(6664),(0,o.getSettings)("stripe_oxxo_data"));s()&&(0,a.registerPaymentMethod)({name:s("name"),label:r.createElement(c.PaymentMethodLabel,{title:s("title"),paymentMethod:s("name"),icons:s("icon")}),ariaLabel:"OXXO",placeOrderButtonLabel:s("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(s),content:r.createElement(c.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:s,confirmationMethod:"confirmOxxoPayment"}),edit:r.createElement(c.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:s}),supports:{showSavedCards:!1,showSaveOption:!1,features:s("features")}})},3868:(e,t,n)=>{var r=n(3027),a=n(4222),o=n(1134),i=n(3539),c=n(3187),s=n(6664),u=(0,o.getSettings)("stripe_p24_data");u()&&(0,a.registerPaymentMethod)({name:u("name"),label:r.createElement(c.PaymentMethodLabel,{title:u("title"),paymentMethod:u("name"),icons:u("icon")}),ariaLabel:"P24",placeOrderButtonLabel:u("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(u),content:r.createElement(c.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:u,confirmationMethod:"confirmP24Payment",component:s.P24BankElement}),edit:r.createElement(c.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:u}),supports:{showSavedCards:!1,showSaveOption:!1,features:u("features")}})},1192:(e,t,n)=>{var r=n(3027),a=n(5318),o=a(n(9713)),i=a(n(6479)),c=n(4222),s=n(1134),u=n(3539),l=n(3187),p=n(6664);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var m,y=(0,s.getSettings)("stripe_sepa_data"),g=(m=l.PaymentMethod,function(e){var t=e.getData,n=(0,i.default)(e,["getData"]);return r.createElement(r.Fragment,null,r.createElement(m,f(f({},n),{},{getData:t})),r.createElement("div",{className:"wc-stripe-blocks-sepa__mandate"},t("mandate")))});y()&&(0,c.registerPaymentMethod)({name:y("name"),label:r.createElement(l.PaymentMethodLabel,{title:y("title"),paymentMethod:y("name"),icons:y("icon")}),ariaLabel:"SEPA",placeOrderButtonLabel:y("placeOrderButtonLabel"),canMakePayment:(0,u.canMakePayment)(y),content:r.createElement(g,{content:u.LocalPaymentSourceContent,getData:y,element:p.IbanElement,getSourceArgs:function(e,t){var n=t.billingData;return e.mandate={notification_method:n.email?"email":"manual",interval:(0,s.cartContainsSubscription)()||(0,s.cartContainsPreOrder)()?"scheduled":"one_time"},"scheduled"===e.mandate.interval&&delete e.amount,e}}),edit:r.createElement(u.LocalPaymentSourceContent,{getData:y}),supports:{showSavedCards:!1,showSaveOption:!1,features:y("features")}})},7894:(e,t,n)=>{var r=n(3027),a=n(5318)(n(9713)),o=n(4222),i=n(1134),c=n(3539),s=n(3187);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){(0,a.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var p=(0,i.getSettings)("stripe_sofort_data");p()&&(0,o.registerPaymentMethod)({name:p("name"),label:r.createElement(s.PaymentMethodLabel,{title:p("title"),paymentMethod:p("name"),icons:p("icon")}),ariaLabel:"Sofort",placeOrderButtonLabel:p("placeOrderButtonLabel"),canMakePayment:(0,c.canMakePayment)(p),content:r.createElement(s.PaymentMethod,{content:c.LocalPaymentSourceContent,getData:p,getSourceArgs:function(e,t){var n=t.billingData;return l(l({},e),{},{sofort:{country:n.country}})}}),edit:r.createElement(s.PaymentMethod,{content:c.LocalPaymentSourceContent,getData:p}),supports:{showSavedCards:!1,showSaveOption:!1,features:p("features")}})},3766:(e,t,n)=>{var r=n(3027),a=n(5318),o=a(n(7015)),i=a(n(8926)),c=a(n(9713)),s=a(n(3038)),u=n(3027),l=n(4222),p=n(1134),d=n(3187),f=n(3539),m=n(6664),y=n(8522),g=n(3163),v=n(3636),h=(0,p.getSettings)("stripe_wechat_data"),b=function(e){return r.createElement(m.Elements,{stripe:p.initStripe},r.createElement(P,e))},P=function(e){var t=e.getData,n=e.billing,a=(e.shippingData,e.emitResponse),o=e.eventRegistration,i=e.components,c=parseInt(t("qrSize")),s=a.responseTypes,l=o.onPaymentProcessing,d=o.onCheckoutAfterProcessingWithSuccess,f=i.ValidationInputError,m=(0,y.useValidateCheckout)({subscriber:o.onPaymentProcessing,responseTypes:a.responseTypes,msg:(0,g.__)("Please scan your QR code to continue with payment.","woo-stripe-payment")}),v=(m.isValid,m.setIsValid),h=O({getData:t,billing:n,responseTypes:s,subscriber:l}),b=h.source,P=h.error,S=h.deleteSourceFromStorage;return(0,u.useEffect)((function(){var e=d((function(){return S(),(0,p.ensureSuccessResponse)(s)}));return function(){return e()}}),[b,d,S]),(0,u.useEffect)((function(){b&&v(!0)}),[b]),b?r.createElement(E,{text:b.wechat.qr_code_url,width:c,height:c}):P?r.createElement("div",{className:"wechat-validation-error"},r.createElement(f,{errorMessage:(0,p.getErrorMessage)(P)})):(0,p.isAddressValid)(n.billingData)?null:(0,g.__)("Please fill out all the required fields in order to complete the WeChat payment.","woo-stripe-payment")},E=function(e){var t=e.text,n=e.width,a=void 0===n?128:n,o=e.height,i=void 0===o?128:o,c=e.colorDark,s=void 0===c?"#424770":c,l=e.colorLight,d=void 0===l?"#f8fbfd":l,f=e.correctLevel,m=void 0===f?QRCode.CorrectLevel.H:f,y=(0,u.useRef)();return(0,u.useEffect)((function(){new QRCode(y.current,{text:t,width:a,height:i,colorDark:s,colorLight:d,correctLevel:m})}),[y]),r.createElement(r.Fragment,null,r.createElement("div",{id:"wc-stripe-block-qrcode",ref:y}),(0,p.isTestMode)()&&r.createElement("p",null,(0,g.__)("Test mode: Click the Place Order button to proceed.","woo-stripe-payment")),!(0,p.isTestMode)()&&r.createElement("p",null,(0,g.__)("Scan the QR code using your WeChat app. Once scanned click the Place Order button.","woo-stripe-payment")))},O=function(e){var t=e.getData,n=e.billing,r=e.responseTypes,a=e.subscriber,l=(0,m.useStripe)(),d=(0,v.useStripeError)(),f=(0,s.default)(d,2),y=f[0],g=f[1],h=(0,u.useState)((0,p.getFromCache)("wechat:source")),b=(0,s.default)(h,2),P=b[0],E=b[1],O=(0,u.useRef)(null),S=n.cartTotal,_=n.billingData,w=n.currency;(0,u.useEffect)((function(){var e=a((function(){return(0,p.ensureSuccessResponse)(r,{meta:{paymentMethodData:(0,c.default)({},"".concat(t("name"),"_token_key"),P.id)}})}));return function(){return e()}}),[P,a]);var C=(0,u.useCallback)((0,i.default)(o.default.mark((function e(){var n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,y||!(0,p.isAddressValid)(_)){e.next=9;break}return e.next=4,l.createSource((0,p.getDefaultSourceArgs)({type:t("paymentType"),amount:S.value,billingData:_,currency:w.code,returnUrl:t("returnUrl")}));case 4:if(!(n=e.sent).error){e.next=7;break}throw new p.StripeError(n.error);case 7:E(n.source),(0,p.storeInCache)("wechat:source",n.source);case 9:e.next=15;break;case 11:e.prev=11,e.t0=e.catch(0),console.log("error: ",e.t0),g(e.t0.error);case 15:case"end":return e.stop()}}),e,null,[[0,11]])}))),[l,P,S.value,_,w,y]),k=(0,u.useCallback)((function(){(0,p.deleteFromCache)("wechat:source")}),[]);return(0,u.useEffect)((function(){l&&!P&&(clearTimeout(O.current),O.current=setTimeout(C,1e3))}),[l,P,C]),{source:P,setSource:E,error:y,deleteSourceFromStorage:k}};h()&&(0,l.registerPaymentMethod)({name:h("name"),label:r.createElement(d.PaymentMethodLabel,{title:h("title"),paymentMethod:h("name"),icons:h("icon")}),ariaLabel:"WeChat",canMakePayment:(0,f.canMakePayment)(h),content:r.createElement(d.PaymentMethod,{content:b,getData:h}),edit:r.createElement(d.PaymentMethod,{content:b,getData:h}),supports:{showSavedCards:!1,showSaveOption:!1,features:h("features")}})},5180:(e,t,n)=>{n(3139),n(3726)},3726:(e,t,n)=>{var r=n(3027),a=n(5318),o=a(n(3038)),i=a(n(6479)),c=n(3027),s=n(4222),u=n(1134),l=n(3636),p=n(6664),d=(0,u.getSettings)("stripe_payment_request_data"),f=function(e){return r.createElement("div",{className:"wc-stripe-payment-request-container"},r.createElement(p.Elements,{stripe:u.initStripe},r.createElement(m,e)))},m=function(e){var t=e.getData,n=e.onClick,a=e.onClose,s=e.billing,u=e.shippingData,d=e.eventRegistration,f=e.emitResponse,m=e.onSubmit,y=e.activePaymentMethod,g=((0,i.default)(e,["getData","onClick","onClose","billing","shippingData","eventRegistration","emitResponse","onSubmit","activePaymentMethod"]),d.onPaymentProcessing),v=f.responseTypes,h=f.noticeContexts,b=(0,p.useStripe)(),P=(0,l.useStripeError)(),E=(0,o.default)(P,1)[0],O=(0,l.useExportedValues)();(0,l.useExpressBreakpointWidth)({payment_method:t("name"),width:300});var S=(0,l.useProcessPaymentIntent)({getData:t,billing:s,shippingData:u,onPaymentProcessing:g,emitResponse:f,error:E,onSubmit:m,activePaymentMethod:y,exportedValues:O}).setPaymentMethod;(0,l.useAfterProcessingPayment)({getData:t,eventRegistration:d,responseTypes:v,activePaymentMethod:y,messageContext:h.EXPRESS_PAYMENTS});var _=(0,l.usePaymentRequest)({getData:t,onClose:a,stripe:b,billing:s,shippingData:u,eventRegistration:d,setPaymentMethod:S,exportedValues:O,canPay:function(e){return null!=e&&!e.applePay}}).paymentRequest,w=(0,c.useMemo)((function(){return{paymentRequest:_,style:{paymentRequestButton:t("paymentRequestButton")}}}),[_]);return _?r.createElement(p.PaymentRequestButtonElement,{options:w,onClick:n}):null},y=function(e){e.getData,(0,i.default)(e,["getData"]);var t=(0,c.useRef)();return(0,c.useEffect)((function(){var e=window.devicePixelRatio;t.current.width=20*e,t.current.height=20*e;var n=t.current.getContext("2d");n.scale(e,e),n.beginPath(),n.arc(10,10,10,0,2*Math.PI),n.fillStyle="#986fff",n.fill()})),r.createElement("div",{className:"payment-request-block-editor"},r.createElement("div",{className:"icon-container"},r.createElement("span",null,"Buy now"),r.createElement("canvas",{className:"PaymentRequestButton-icon",ref:t}),r.createElement("i",{className:"payment-request-arrow"})))};(0,s.registerExpressPaymentMethod)({name:d("name"),canMakePayment:function(e){var t=e.cartTotals;if(d("isAdmin"))return!0;var n=t.currency_code,r=t.total_price;return(0,u.canMakePayment)({country:d("countryCode"),currency:n.toLowerCase(),total:{label:d("totalLabel"),amount:parseInt(r)}},(function(e){return null!=e&&!e.applePay}))},content:r.createElement(f,{getData:d}),edit:r.createElement(y,{getData:d}),supports:{showSavedCards:d("showSavedCards"),showSaveOption:d("showSaveOption"),features:d("features")}})},1065:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(7015)),o=r(n(8926)),i=n(3027),c=n(1134);t.default=function(e){var t=e.eventRegistration,n=e.emitResponse,r=e.getData,s=t.onCheckoutAfterProcessingWithSuccess,u=n.responseTypes,l=(0,i.useCallback)(function(){var e=(0,o.default)(a.default.mark((function e(t){var n,o;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.redirectUrl,e.next=3,c.initStripe;case 3:return o=e.sent,e.next=6,(0,c.handleCardAction)({redirectUrl:n,getData:r,stripe:o,responseTypes:u});case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[s]);return(0,i.useEffect)((function(){var e=s(l);return function(){return e()}}),[s]),null}},1134:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.isCheckoutPage=t.isCartPage=t.versionCompare=t.deleteFromCache=t.getFromCache=t.storeInCache=t.isTestMode=t.getDefaultSourceArgs=t.cartContainsSubscription=t.cartContainsPreOrder=t.getLocalPaymentMethods=t.registerLocalPaymentMethod=t.canMakePayment=t.getDisplayItems=t.getShippingOptionId=t.getShippingOptions=t.formatPrice=t.filterEmptyValues=t.getIntermediateAddress=t.toCartAddress=t.handleCardAction=t.isUserLoggedIn=t.hasShippingRates=t.getSelectedShippingOption=t.isFieldRequired=t.getLocaleFields=t.isAddressValid=t.removeNumberPrecision=t.isEmpty=t.StripeError=t.getSettings=t.getBillingDetailsFromAddress=t.getErrorMessage=t.ensureErrorResponse=t.ensureSuccessResponse=t.getRoute=t.getCreditCardForm=t.registerCreditCardForm=t.initStripe=void 0;var a=r(n(319)),o=r(n(7015)),i=r(n(8926)),c=r(n(3038)),s=r(n(8)),u=r(n(4575)),l=r(n(2205)),p=r(n(8585)),d=r(n(9754)),f=r(n(5957)),m=r(n(9713)),y=r(n(6479)),g=n(4465),v=n(2492),h=r(n(7606)),b=n(8419);function P(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return E(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?E(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,c=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){c=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(c)throw o}}}}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function S(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach((function(t){(0,m.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var _=(0,v.getSetting)("stripeGeneralData"),w=_.publishableKey,C=_.account,k=(0,v.getSetting)("stripeErrorMessages"),M=(0,v.getSetting)("countryLocale",{}),j=/^([\w]+)\:(.+)$/,D=(0,v.getSetting)("stripeGeneralData").routes,R={},x=[],A={recipient:function(e,t){return e.first_name=t.split(" ").slice(0,-1).join(" "),e.last_name=t.split(" ").pop(),e},payerName:function(e,t){return e.first_name=t.split(" ").slice(0,-1).join(" "),e.last_name=t.split(" ").pop(),e},country:"country",addressLine:function(e,t){return t[0]&&(e.address_1=t[0]),t[1]&&(e.address_2=t[1]),e},line1:"address_1",line2:"address_2",city:"city",region:"state",state:"state",postalCode:"postcode",postal_code:"postcode",payerEmail:"email",payerPhone:"phone"},I=new Promise((function(e,t){(0,g.loadStripe)(w,C?{stripeAccount:C}:{}).then((function(t){e(t)})).catch((function(t){e({error:t})}))}));t.initStripe=I,t.registerCreditCardForm=function(e){var t=e.id,n=(0,y.default)(e,["id"]);R[t]=n},t.getCreditCardForm=function(e){return R.hasOwnProperty(e)?R[e]:{}};var L=function(e){return null!=D&&D[e]?D[e]:console.log("".concat(e," is not a valid route"))};t.getRoute=L;var T=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return S({type:e.SUCCESS},t)};t.ensureSuccessResponse=T;var N=function(e,t){return{type:e.ERROR,message:B(t)}};t.ensureErrorResponse=N;var B=function(e){return"string"==typeof e?e:null!=e&&e.code&&null!=k&&k[e.code]?k[e.code]:null!=e&&e.statusCode?null!=k&&k[e.statusCode]?k[e.statusCode]:e.statusMessage:e.message};t.getErrorMessage=B;var F=function(e){var t={name:"".concat(e.first_name," ").concat(e.last_name),address:{city:e.city||null,country:e.country||null,line1:e.address_1||null,line2:e.address_2||null,postal_code:e.postcode||null,state:e.state||null}};return null!=e&&e.phone&&(t.phone=e.phone),null!=e&&e.email&&(t.email=e.email),t};t.getBillingDetailsFromAddress=F,t.getSettings=function(e){return function(t){return t?(0,v.getSetting)(e)[t]:(0,v.getSetting)(e)}};var q=function(e){(0,l.default)(a,e);var t,n,r=(t=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=(0,d.default)(t);if(n){var a=(0,d.default)(this).constructor;e=Reflect.construct(r,arguments,a)}else e=r.apply(this,arguments);return(0,p.default)(this,e)});function a(e){var t;return(0,u.default)(this,a),(t=r.call(this,e.message)).error=e,t}return a}((0,f.default)(Error));t.StripeError=q;var X=function(e){return"string"==typeof e?0==e.length||""==e:Array.isArray(e)?0==array.length:"object"!==(0,s.default)(e)||0==Object.keys(e).length};t.isEmpty=X,t.removeNumberPrecision=function(e,t){return e/Math.pow(10,t)},t.isAddressValid=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=V(e.country),r=0,a=Object.entries(e);r<a.length;r++){var o=(0,c.default)(a[r],2),i=o[0],s=o[1];if(!t.includes(i)&&null!=n&&n[i]&&n[i].required&&X(s))return!1}return!0};var V=function(e){var t=S({},M.default);return e&&null!=M&&M[e]&&(t=Object.entries(M[e]).reduce((function(e,t){var n=(0,c.default)(t,2),r=n[0],a=n[1];return e[r]=S(S({},e[r]),a),e}),t),["phone","email"].forEach((function(e){var n=document.getElementById(e);n&&(t[e]={required:n.required})}))),t};t.getLocaleFields=V,t.isFieldRequired=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=V(t);return[e]in n&&n[e].required},t.getSelectedShippingOption=function(e){var t=e.match(j);if(t){var n=t[1];return[t[2],n]}return[]},t.hasShippingRates=function(e){return e.map((function(e){return e.shipping_rates.length>0})).filter(Boolean).length>0},t.isUserLoggedIn=function(e){return e>0};var U=function(){var e=(0,i.default)(o.default.mark((function e(t,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,h.default)({url:D["sync/intent"],method:"POST",data:{order_id:t,client_secret:n}});case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.log(e.t0);case 8:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(t,n){return e.apply(this,arguments)}}(),W=function(){var e=(0,i.default)(o.default.mark((function e(t){var n,r,a,i,c,s,u,l,p,d,f,y,g,v;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.redirectUrl,r=t.responseTypes,a=t.stripe,i=t.getData,c=t.savePaymentMethod,s=void 0!==c&&c,e.prev=1,!(u=n.match(/#response=(.+)/))){e.next=20;break}return l=JSON.parse(window.atob(decodeURIComponent(u[1]))),p=l.client_secret,d=l.order_id,f=l.order_key,e.next=7,a.handleCardAction(p);case 7:if(!(y=e.sent).error){e.next=11;break}return U(d,p),e.abrupt("return",N(r,y.error));case 11:return g=(0,m.default)({order_id:d,order_key:f},"".concat(i("name"),"_save_source_key"),s),e.next=14,(0,h.default)({url:L("process/payment"),method:"POST",data:g});case 14:if(!(v=e.sent).messages){e.next=17;break}return e.abrupt("return",N(r,v.messages));case 17:return e.abrupt("return",T(r,{redirectUrl:v.redirect}));case 20:return e.abrupt("return",T(r));case 21:e.next=27;break;case 23:return e.prev=23,e.t0=e.catch(1),console.log(e.t0),e.abrupt("return",N(r,e.t0));case 27:case"end":return e.stop()}}),e,null,[[1,23]])})));return function(t){return e.apply(this,arguments)}}();t.handleCardAction=W,t.toCartAddress=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:A;return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={};t=S(S({},t),Y(n));for(var a=0,o=Object.entries(e);a<o.length;a++){var i,s=(0,c.default)(o[a],2),u=s[0],l=s[1];null!==(i=t)&&void 0!==i&&i[u]&&("function"==typeof l?l(r,t[u]):r[l]=t[u])}return r}},t.getIntermediateAddress=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["city","postcode","state","country"],r={},a=P(n);try{for(a.s();!(t=a.n()).done;){var o=t.value;r[o]=e[o]}}catch(e){a.e(e)}finally{a.f()}return r};var Y=function(e){return Object.keys(e).filter((function(t){return Boolean(e[t])})).reduce((function(t,n){return S(S({},t),{},(0,m.default)({},n,e[n]))}),{})};t.filterEmptyValues=Y;var G=function(e,t){var n,r=(0,b.getCurrency)(t),a=r.prefix,o=r.suffix,i=r.decimalSeparator,c=r.minorUnit,s=r.thousandSeparator;if(""==e||void 0===e)return e;e="string"==typeof e?parseInt(e,10):e;var u="",l=(e=(e/=Math.pow(10,c)).toString().replace(".",i)).indexOf(i);l<0?c>0&&(e+="".concat(i).concat(new Array(c+1).join("0"))):(u=e.substr(l+1)).length<c&&(e+=new Array(c-u.length+1).join("0"));var p=e.match(new RegExp("(\\d+)\\".concat(i,"(\\d+)")));return p&&(e=p[1],u=p[2]),e=e.replace(new RegExp("\\B(?=(\\d{3})+(?!\\d))","g"),"".concat(s)),a+(e=(null===(n=u)||void 0===n?void 0:n.length)>0?e+i+u:e)+o};t.formatPrice=G,t.getShippingOptions=function(e){var t=[];return e.forEach((function(e,n){e.shipping_rates.sort((function(e){return e.selected?-1:1}));var r=e.shipping_rates.map((function(e){var t=document.createElement("textarea");return t.innerHTML=e.name,G(e.price,e.currency_code),{id:K(n,e.rate_id),label:t.value,amount:parseInt(e.price,10)}}));t=[].concat((0,a.default)(t),(0,a.default)(r))})),t};var K=function(e,t){return"".concat(e,":").concat(t)};t.getShippingOptionId=K,t.getDisplayItems=function(e,t){t.minorUnit;var n=[],r=["total_tax","total_shipping"];return e.forEach((function(e){(0<e.value||e.key&&r.includes(e.key))&&n.push({label:e.label,pending:!1,amount:e.value})})),n};var H={};t.canMakePayment=function(e,t){var n=e.country,r=e.currency,a=e.total;return new Promise((function(e,o){var i=[n,r,a.amount].reduce((function(e,t){return"".concat(e,"-").concat(t)}));return r?i in H?e(H[i]):I.then((function(c){if(c.error)return o(c.error);c.paymentRequest({country:n,currency:r,total:a}).canMakePayment().then((function(n){return H[i]=t(n),e(H[i])}))})).catch(o):e(!1)}))},t.registerLocalPaymentMethod=function(e){x.push(e)},t.getLocalPaymentMethods=function(){return x},t.cartContainsPreOrder=function(){var e=(0,v.getSetting)("stripePaymentData");return e&&e.pre_order},t.cartContainsSubscription=function(){var e=(0,v.getSetting)("stripePaymentData");return e&&e.subscription},t.getDefaultSourceArgs=function(e){var t=e.type,n=e.amount,r=e.billingData,a=e.currency,o=e.returnUrl;return{type:t,amount:n,currency:a,owner:F(r),redirect:{return_url:o}}},t.isTestMode=function(){return"test"===(0,v.getSetting)("stripeGeneralData").mode};var J=function(e){return"".concat("stripe:").concat(e)};t.storeInCache=function(e,t){var n=Math.floor((new Date).getTime()/1e3)+900;"sessionStorage"in window&&sessionStorage.setItem(J(e),JSON.stringify({value:t,exp:n}))},t.getFromCache=function(e){if("sessionStorage"in window)try{var t=JSON.parse(sessionStorage.getItem(J(e)));if(t){var n=t.value,r=t.exp;if(!(Math.floor((new Date).getTime()/1e3)>r))return n;z(J(e))}}catch(e){}return null};var z=function(e){"sessionStorage"in window&&sessionStorage.removeItem(J(e))};t.deleteFromCache=z,t.versionCompare=function(e,t,n){switch(n){case"<":return e<t;case">":return e>t;case"<=":return e<=t;case">=":return e>=t;case"=":return e==t}return!1},t.isCartPage=function(){return"cart"===(0,v.getSetting)("stripeGeneralData").page},t.isCheckoutPage=function(){return"checkout"===(0,v.getSetting)("stripeGeneralData").page}},4184:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function a(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var o=typeof n;if("string"===o||"number"===o)e.push(n);else if(Array.isArray(n)&&n.length){var i=a.apply(null,n);i&&e.push(i)}else if("object"===o)for(var c in n)r.call(n,c)&&n[c]&&e.push(c)}}return e.join(" ")}e.exports?(a.default=a,e.exports=a):void 0===(n=function(){return a}.apply(t,[]))||(e.exports=n)}()},1127:()=>{},7776:()=>{},4836:()=>{},85:()=>{},3110:()=>{},8356:()=>{},5773:()=>{},9509:()=>{},1530:()=>{},3139:()=>{}}]);
|
3 |
Â
//# sourceMappingURL=commons.js.map
|
1 |
Â
/*! For license information please see commons.js.LICENSE.txt */
|
2 |
+
(self.webpackChunkwc_stripe_name_=self.webpackChunkwc_stripe_name_||[]).push([[351],{7228:e=>{e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}},2858:e=>{e.exports=function(e){if(Array.isArray(e))return e}},3646:(e,t,n)=>{var r=n(7228);e.exports=function(e){if(Array.isArray(e))return r(e)}},1506:e=>{e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},8926:e=>{function t(e,t,n,r,a,o,i){try{var c=e[o](i),s=c.value}catch(e){return void n(e)}c.done?t(s):Promise.resolve(s).then(r,a)}e.exports=function(e){return function(){var n=this,r=arguments;return new Promise((function(a,o){var i=e.apply(n,r);function c(e){t(i,a,o,c,s,"next",e)}function s(e){t(i,a,o,c,s,"throw",e)}c(void 0)}))}}},4575:e=>{e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},9100:(e,t,n)=>{var r=n(9489),a=n(7067);function o(t,n,i){return a()?e.exports=o=Reflect.construct:e.exports=o=function(e,t,n){var a=[null];a.push.apply(a,t);var o=new(Function.bind.apply(e,a));return n&&r(o,n.prototype),o},o.apply(null,arguments)}e.exports=o},3913:e=>{function t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}},9713:e=>{e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},7154:e=>{function t(){return e.exports=t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},t.apply(this,arguments)}e.exports=t},9754:e=>{function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},t(n)}e.exports=t},2205:(e,t,n)=>{var r=n(9489);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}},5318:e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}}},430:e=>{e.exports=function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}},7067:e=>{e.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}},6860:e=>{e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},3884:e=>{e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,a=!1,o=void 0;try{for(var i,c=e[Symbol.iterator]();!(r=(i=c.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(a)throw o}}return n}}},521:e=>{e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},8206:e=>{e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},6479:(e,t,n)=>{var r=n(7316);e.exports=function(e,t){if(null==e)return{};var n,a,o=r(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}},7316:e=>{e.exports=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}},8585:(e,t,n)=>{var r=n(8),a=n(1506);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?a(e):t}},9489:e=>{function t(n,r){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(n,r)}e.exports=t},3038:(e,t,n)=>{var r=n(2858),a=n(3884),o=n(379),i=n(521);e.exports=function(e,t){return r(e)||a(e,t)||o(e,t)||i()}},319:(e,t,n)=>{var r=n(3646),a=n(6860),o=n(379),i=n(8206);e.exports=function(e){return r(e)||a(e)||o(e)||i()}},8:e=>{function t(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=t=function(e){return typeof e}:e.exports=t=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(n)}e.exports=t},379:(e,t,n)=>{var r=n(7228);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}},5957:(e,t,n)=>{var r=n(9754),a=n(9489),o=n(430),i=n(9100);function c(t){var n="function"==typeof Map?new Map:void 0;return e.exports=c=function(e){if(null===e||!o(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return i(e,arguments,r(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),a(t,e)},c(t)}e.exports=c},6664:function(e,t,n){!function(e,t){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,a=!1,o=void 0;try{for(var i,c=e[Symbol.iterator]();!(r=(i=c.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(a)throw o}}return n}}(e,t)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;function i(){}function c(){}c.resetWarningCache=i;var s,u=(function(e){e.exports=function(){function e(e,t,n,r,a,o){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==o){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:c,resetWarningCache:i};return n.PropTypes=n,n}()}(s={exports:{}},s.exports),s.exports),l=function(e){return null!==e&&"object"===n(e)},p="[object Object]",d=function e(t,n){if(!l(t)||!l(n))return t===n;var r=Array.isArray(t);if(r!==Array.isArray(n))return!1;var a=Object.prototype.toString.call(t)===p;if(a!==(Object.prototype.toString.call(n)===p))return!1;if(!a&&!r)return!1;var o=Object.keys(t),i=Object.keys(n);if(o.length!==i.length)return!1;for(var c={},s=0;s<o.length;s+=1)c[o[s]]=!0;for(var u=0;u<i.length;u+=1)c[i[u]]=!0;var d=Object.keys(c);if(d.length!==o.length)return!1;var f=t,m=n;return d.every((function(t){return e(f[t],m[t])}))},f=function(e){var n=t.useRef(e);return t.useEffect((function(){n.current=e}),[e]),n.current},m=function(e){if(null===e||l(t=e)&&"function"==typeof t.elements&&"function"==typeof t.createToken&&"function"==typeof t.createPaymentMethod&&"function"==typeof t.confirmCardPayment)return e;var t;throw new Error("Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.")},y=function(e){if(function(e){return l(e)&&"function"==typeof e.then}(e))return{tag:"async",stripePromise:Promise.resolve(e).then(m)};var t=m(e);return null===t?{tag:"empty"}:{tag:"sync",stripe:t}},g=t.createContext(null);g.displayName="ElementsContext";var v=function(e){var n=e.stripe,r=e.options,o=e.children,i=t.useRef(!1),c=t.useRef(!0),s=t.useMemo((function(){return y(n)}),[n]),u=a(t.useState((function(){return{stripe:null,elements:null}})),2),l=u[0],p=u[1],m=f(n),v=f(r);return null!==m&&(m!==n&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it."),d(r,v)||console.warn("Unsupported prop change on Elements: You cannot change the `options` prop after setting the `stripe` prop.")),i.current||("sync"===s.tag&&(i.current=!0,p({stripe:s.stripe,elements:s.stripe.elements(r)})),"async"===s.tag&&(i.current=!0,s.stripePromise.then((function(e){e&&c.current&&p({stripe:e,elements:e.elements(r)})})))),t.useEffect((function(){return function(){c.current=!1}}),[]),t.useEffect((function(){var e=l.stripe;e&&e._registerWrapper&&e._registerWrapper({name:"react-stripe-js",version:"1.4.0"})}),[l.stripe]),t.createElement(g.Provider,{value:l},o)};v.propTypes={stripe:u.any,options:u.object};var h=function(e){return function(e,t){if(!e)throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(t," in an <Elements> provider."));return e}(t.useContext(g),e)},b=function(e){return(0,e.children)(h("mounts <ElementsConsumer>"))};b.propTypes={children:u.func.isRequired};var P=function(e){var n=t.useRef(e);return t.useEffect((function(){n.current=e}),[e]),function(){n.current&&n.current.apply(n,arguments)}},E=function(e){return l(e)?(e.paymentRequest,r(e,["paymentRequest"])):{}},O=function(){},S=function(e,n){var r,a="".concat((r=e).charAt(0).toUpperCase()+r.slice(1),"Element"),o=n?function(e){h("mounts <".concat(a,">"));var n=e.id,r=e.className;return t.createElement("div",{id:n,className:r})}:function(n){var r=n.id,o=n.className,i=n.options,c=void 0===i?{}:i,s=n.onBlur,u=void 0===s?O:s,l=n.onFocus,p=void 0===l?O:l,f=n.onReady,m=void 0===f?O:f,y=n.onChange,g=void 0===y?O:y,v=n.onEscape,b=void 0===v?O:v,S=n.onClick,w=void 0===S?O:S,_=h("mounts <".concat(a,">")).elements,C=t.useRef(null),M=t.useRef(null),k=P(m),j=P(u),D=P(p),R=P(w),x=P(g),A=P(b);t.useLayoutEffect((function(){if(null==C.current&&_&&null!=M.current){var t=_.create(e,c);C.current=t,t.mount(M.current),t.on("ready",(function(){return k(t)})),t.on("change",x),t.on("blur",j),t.on("focus",D),t.on("escape",A),t.on("click",R)}}));var I=t.useRef(c);return t.useEffect((function(){I.current&&I.current.paymentRequest!==c.paymentRequest&&console.warn("Unsupported prop change: options.paymentRequest is not a customizable property.");var e=E(c);0===Object.keys(e).length||d(e,E(I.current))||C.current&&(C.current.update(e),I.current=c)}),[c]),t.useLayoutEffect((function(){return function(){C.current&&C.current.destroy()}}),[]),t.createElement("div",{id:r,className:o,ref:M})};return o.propTypes={id:u.string,className:u.string,onChange:u.func,onBlur:u.func,onFocus:u.func,onReady:u.func,onClick:u.func,options:u.object},o.displayName=a,o.__elementType=e,o},w="undefined"==typeof window,_=S("auBankAccount",w),C=S("card",w),M=S("cardNumber",w),k=S("cardExpiry",w),j=S("cardCvc",w),D=S("fpxBank",w),R=S("iban",w),x=S("idealBank",w),A=S("p24Bank",w),I=S("epsBank",w),L=S("paymentRequestButton",w),T=S("afterpayClearpayMessage",w);e.AfterpayClearpayMessageElement=T,e.AuBankAccountElement=_,e.CardCvcElement=j,e.CardElement=C,e.CardExpiryElement=k,e.CardNumberElement=M,e.Elements=v,e.ElementsConsumer=b,e.EpsBankElement=I,e.FpxBankElement=D,e.IbanElement=R,e.IdealBankElement=x,e.P24BankElement=A,e.PaymentRequestButtonElement=L,e.useElements=function(){return h("calls useElements()").elements},e.useStripe=function(){return h("calls useStripe()").stripe},Object.defineProperty(e,"__esModule",{value:!0})}(t,n(3804))},4465:(e,t,n)=>{"use strict";n.r(t),n.d(t,{loadStripe:()=>l});var r="https://js.stripe.com/v3",a=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,o="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",i=null,c=function(e,t,n){if(null===e)return null;var r=e.apply(void 0,t);return function(e,t){e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",version:"1.12.1",startTime:t})}(r,n),r},s=Promise.resolve().then((function(){return e=null,null!==i?i:i=new Promise((function(t,n){if("undefined"!=typeof window)if(window.Stripe&&e&&console.warn(o),window.Stripe)t(window.Stripe);else try{var i=function(){for(var e=document.querySelectorAll('script[src^="'.concat(r,'"]')),t=0;t<e.length;t++){var n=e[t];if(a.test(n.src))return n}return null}();i&&e?console.warn(o):i||(i=function(e){var t=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",n=document.createElement("script");n.src="".concat(r).concat(t);var a=document.head||document.body;if(!a)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return a.appendChild(n),n}(e)),i.addEventListener("load",(function(){window.Stripe?t(window.Stripe):n(new Error("Stripe.js not available"))})),i.addEventListener("error",(function(){n(new Error("Failed to load Stripe.js"))}))}catch(e){return void n(e)}else t(null)}));var e})),u=!1;s.catch((function(e){u||console.warn(e)}));var l=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];u=!0;var r=Date.now();return s.then((function(e){return c(e,t,r)}))}},8149:(e,t,n)=>{var r=n(3027),a=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.SavePaymentMethod=void 0;var o=a(n(4184));n(1127),t.SavePaymentMethod=function(e){var t=e.label,n=e.onChange,a=e.checked;return r.createElement("div",{className:"wc-stripe-save-payment-method"},r.createElement("label",null,r.createElement("input",{type:"checkbox",onChange:function(e){return n(e.target.checked)}}),r.createElement("svg",{className:(0,o.default)("wc-stripe-components-checkbox__mark",{checked:a}),"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 20"},r.createElement("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}))),r.createElement("span",null,t))}},3187:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(2029);Object.keys(r).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===r[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}}))}));var a=n(8149);Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===a[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}}))}));var o=n(8744);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))}));var i=n(4901);Object.keys(i).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===i[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}}))}))},2029:(e,t,n)=>{var r=n(3027),a=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.PaymentMethodLabel=void 0;var o=a(n(6479));n(7776),t.PaymentMethodLabel=function(e){var t=e.title,n=e.icons,a=e.paymentMethod,i=(0,o.default)(e,["title","icons","paymentMethod"]).components,c=i.PaymentMethodLabel,s=i.PaymentMethodIcons;return Array.isArray(n)||(n=[n]),r.createElement("span",{className:"wc-stripe-label-container ".concat(a)},r.createElement(c,{text:t}),r.createElement(s,{icons:n,align:"left"}))}},4901:(e,t,n)=>{var r=n(3027),a=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.PaymentMethod=void 0;var o=a(n(9713)),i=a(n(6479)),c=n(3027);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.PaymentMethod=function(e){var t=e.getData,n=e.content,a=(0,i.default)(e,["getData","content"]),o=n,s=t("description"),p=(0,c.useRef)(null);return(0,c.useEffect)((function(){p.current&&0==p.current.childNodes.length&&p.current.classList.add("no-content")})),r.createElement(r.Fragment,null,s&&r.createElement(l,{desc:s,payment_method:t("name")}),r.createElement("div",{ref:p,className:"wc-stripe-blocks-payment-method-content"},r.createElement(o,u(u({},a),{},{getData:t}))))};var l=function(e){var t=e.desc,n=e.payment_method;return r.createElement("div",{className:"wc-stripe-blocks-payment-method__desc ".concat(n)},r.createElement("p",null,t))}},8744:(e,t,n)=>{var r=n(3027),a=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.RadioControlOption=void 0;var o=a(n(4184)),i=function(e){var t=e.checked,n=e.onChange,a=e.value,i=e.label;return r.createElement("label",{className:(0,o.default)("wc-stripe-blocks-radio-control__option",{"wc-stripe-blocks-radio-control__option-checked":t})},r.createElement("input",{className:"wc-stripe-blocks-radio-control__input",type:"radio",value:a,checked:t,onChange:function(e){return n(e.target.value)}}),r.createElement("div",{className:"wc-stripe-blocks-radio-control__label"},r.createElement("span",null,i)))};t.RadioControlOption=i;var c=i;t.default=c},7260:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(1293);Object.keys(r).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===r[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}}))}));var a=n(7150);Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===a[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}}))}));var o=n(5201);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))}))},1293:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.useCreateLinkToken=void 0;var a=r(n(7015)),o=r(n(8926)),i=r(n(3038)),c=n(3027),s=r(n(7606)),u=n(1134);t.useCreateLinkToken=function(e){var t=e.setValidationError,n=(0,c.useState)(!1),r=(0,i.default)(n,2),l=r[0],p=r[1],d=(0,c.useCallback)((0,o.default)(a.default.mark((function e(){var n;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,s.default)({url:(0,u.getRoute)("create/linkToken"),method:"POST",data:{}});case 3:(n=e.sent).token&&((0,u.storeInCache)("linkToken",n.token),p(n.token)),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),t(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])}))),[]);return(0,c.useEffect)((function(){if(!l){var e=(0,u.getFromCache)("linkToken");e?p(e):d()}}),[l,p]),l}},7150:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.useInitializePlaid=void 0;var a=n(3027),o=r(n(2810)),i=n(1134);t.useInitializePlaid=function(e){var t=e.getData,n=e.linkToken,r=(0,a.useRef)(null),c=(0,a.useRef)(null),s=(0,a.useCallback)((function(){return new Promise((function(e,t){c.current={resolve:e,reject:t},r.current.open()}))}),[]);return(0,a.useEffect)((function(){n&&(r.current=o.default.create({clientName:t("clientName"),env:t("plaidEnvironment"),product:["auth"],token:n,selectAccount:!0,countryCodes:["US"],onSuccess:function(e,t){c.current.resolve({publicToken:e,metaData:t})},onExit:function(e){c.current.reject(!!e&&(0,i.getErrorMessage)(e.error_message))}}))}),[n]),s}},5201:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.useProcessPayment=void 0;var a=r(n(7015)),o=r(n(9713)),i=r(n(8926)),c=n(3027),s=n(1134);t.useProcessPayment=function(e){var t=e.openLinkPopup,n=e.onPaymentProcessing,r=e.responseTypes,u=e.paymentMethod;(0,c.useEffect)((function(){var e=n((0,i.default)(a.default.mark((function e(){var n,i,c,l;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t();case 3:return i=e.sent,c=i.publicToken,l=i.metaData,(0,s.deleteFromCache)("linkToken"),e.abrupt("return",(0,s.ensureSuccessResponse)(r,{meta:{paymentMethodData:(n={},(0,o.default)(n,"".concat(u,"_token_key"),c),(0,o.default)(n,"".concat(u,"_metadata"),JSON.stringify(l)),n)}}));case 9:return e.prev=9,e.t0=e.catch(0),e.abrupt("return",(0,s.ensureErrorResponse)(r,e.t0));case 12:case"end":return e.stop()}}),e,null,[[0,9]])}))));return function(){return e()}}),[n,r,t])}},5605:(e,t,n)=>{n(4836),n(4888)},4888:(e,t,n)=>{var r=n(3027),a=n(5318),o=a(n(3038)),i=a(n(6479)),c=n(3027),s=n(4222),u=n(1134),l=n(3187),p=a(n(1065)),d=n(7260),f=n(3636),m=n(3163),y=(0,u.getSettings)("stripe_ach_data"),g=function(e){var t=e.getData,n=e.eventRegistration,a=e.components,s=e.emitResponse,l=e.onSubmit,p=((0,i.default)(e,["getData","eventRegistration","components","emitResponse","onSubmit"]),s.responseTypes),m=n.onPaymentProcessing,y=n.onCheckoutAfterProcessingWithError,g=a.ValidationInputError,h=(0,c.useState)(!1),b=(0,o.default)(h,2),P=b[0],E=b[1],O=(0,d.useCreateLinkToken)({setValidationError:E});(0,f.useProcessCheckoutError)({responseTypes:p,subscriber:y});var S=(0,d.useInitializePlaid)({getData:t,linkToken:O,onSubmit:l});return(0,d.useProcessPayment)({openLinkPopup:S,onPaymentProcessing:m,responseTypes:p,paymentMethod:t("name")}),r.createElement(r.Fragment,null,u.isTestMode&&r.createElement(v,null),P&&r.createElement(g,{errorMessage:P}))},v=function(){return r.createElement("div",{className:"wc-stripe-blocks-ach__creds"},r.createElement("label",{className:"wc-stripe-blocks-ach__creds-label"},(0,m.__)("Test Credentials","woo-stripe-payment")),r.createElement("div",{className:"wc-stripe-blocks-ach__username"},r.createElement("div",null,r.createElement("strong",null,(0,m.__)("username","woo-stripe-payment")),": user_good"),r.createElement("div",null,r.createElement("strong",null,(0,m.__)("password","woo-stripe-payment")),": pass_good"),r.createElement("div",null,r.createElement("strong",null,(0,m.__)("pin","woo-stripe-payment")),": credential_good")))};(0,s.registerPaymentMethod)({name:y("name"),label:r.createElement(l.PaymentMethodLabel,{title:y("title"),paymentMethod:y("name"),icons:y("icons")}),ariaLabel:"ACH Payment",canMakePayment:function(e){return"USD"===e.cartTotals.currency_code},content:r.createElement(l.PaymentMethod,{getData:y,content:g}),savedTokenComponent:r.createElement(p.default,{getData:y}),edit:r.createElement(g,{getData:y}),placeOrderButtonLabel:y("placeOrderButtonLabel"),supports:{showSavedCards:y("showSavedCards"),showSaveOption:!1,features:y("features")}})},3846:(e,t,n)=>{n(85),n(660)},660:(e,t,n)=>{var r=n(3027),a=n(5318),o=a(n(3038)),i=a(n(6479)),c=n(3027),s=n(4222),u=n(1134),l=n(6664),p=a(n(7082)),d=n(3636),f=(0,u.getSettings)("stripe_applepay_data"),m=function(e){return r.createElement(p.default,null,r.createElement("div",{className:"wc-stripe-apple-pay-container"},r.createElement(l.Elements,{stripe:u.initStripe},r.createElement(y,e))))},y=function(e){var t=e.getData,n=e.onClick,a=e.onClose,s=e.billing,u=e.shippingData,p=e.eventRegistration,f=e.emitResponse,m=e.onSubmit,y=e.activePaymentMethod,g=((0,i.default)(e,["getData","onClick","onClose","billing","shippingData","eventRegistration","emitResponse","onSubmit","activePaymentMethod"]),p.onPaymentProcessing),v=f.responseTypes,h=f.noticeContexts,b=(0,l.useStripe)(),P=(0,d.useStripeError)(),E=(0,o.default)(P,1)[0],O=(0,d.useExportedValues)();(0,d.useExpressBreakpointWidth)({payment_method:t("name"),width:300});var S=(0,d.useProcessPaymentIntent)({getData:t,billing:s,shippingData:u,onPaymentProcessing:g,emitResponse:f,error:E,onSubmit:m,activePaymentMethod:y,exportedValues:O}).setPaymentMethod;(0,d.useAfterProcessingPayment)({getData:t,eventRegistration:p,responseTypes:v,activePaymentMethod:y,messageContext:h.EXPRESS_PAYMENTS});var w=(0,d.usePaymentRequest)({getData:t,onClose:a,stripe:b,billing:s,shippingData:u,eventRegistration:p,setPaymentMethod:S,exportedValues:O,canPay:function(e){return null!=e&&e.applePay}}).paymentRequest,_=(0,c.useCallback)((function(){w&&(n(),w.show())}),[w,n]);return w?r.createElement("button",{className:"apple-pay-button ".concat(t("buttonStyle")),style:{"-apple-pay-button-type":t("buttonType")},onClick:_}):null},g=function(e){var t=e.getData;return(0,i.default)(e,["getData"]),r.createElement("div",{className:"apple-pay-block-editor"},r.createElement("img",{src:t("editorIcon")}))};(0,s.registerExpressPaymentMethod)({name:f("name"),canMakePayment:function(e){var t=e.cartTotals;if((0,i.default)(e,["cartTotals"]),f("isAdmin"))return!0;var n=t.currency_code,r=t.total_price;return(0,u.canMakePayment)({country:f("countryCode"),currency:n.toLowerCase(),total:{label:f("totalLabel"),amount:parseInt(r)}},(function(e){return null!=e&&e.applePay}))},content:r.createElement(m,{getData:f}),edit:r.createElement(g,{getData:f}),supports:{showSavedCards:f("showSavedCards"),showSaveOption:f("showSaveOption"),features:f("features")}})},7354:(e,t,n)=>{var r=n(3027);n(3110);var a=n(1134),o=n(6664),i=n(3163),c=function(e){var t=e.CardIcon,n=e.options,a=e.onChange;return r.createElement("div",{className:"wc-stripe-bootstrap-form"},r.createElement("div",{className:"row"},r.createElement("div",{className:"col-md-6 mb-3"},r.createElement(o.CardNumberElement,{className:"md-form md-outline stripe-input",options:n.cardNumber,onChange:a(o.CardNumberElement)}),r.createElement("label",{htmlFor:"stripe-card-number"},(0,i.__)("Card Number","woo-stripe-payment")),t),r.createElement("div",{className:"col-md-3 mb-3"},r.createElement(o.CardExpiryElement,{className:"md-form md-outline stripe-input",options:n.cardExpiry,onChange:a(o.CardExpiryElement)}),r.createElement("label",{htmlFor:"stripe-exp"},(0,i.__)("Exp","woo-stripe-payment"))),r.createElement("div",{className:"col-md-3 mb-3"},r.createElement(o.CardCvcElement,{className:"md-form md-outline stripe-input",options:n.cardCvc,onChange:a(o.CardCvcElement)}),r.createElement("label",{htmlFor:"stripe-cvv"},(0,i.__)("CVV","woo-stripe-payment")))))};(0,a.registerCreditCardForm)({id:"bootstrap",breakpoint:475,component:r.createElement(c,null)})},3329:(e,t,n)=>{var r=n(3027),a=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(9713)),i=a(n(3038)),c=n(1134),s=n(3027),u=n(6664),l=n(3163),p=n(3636);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var m={focus:"focused",empty:"empty",invalid:"invalid"},y=function(e){var t=e.type,n=e.src;return t?r.createElement("img",{className:"wc-stripe-card ".concat(t),src:n}):null};t.default=function(e){var t=e.getData,n=e.onChange,a=(0,s.useState)(""),o=(0,i.default)(a,2),d=o[0],g=o[1],v=(0,s.useRef)([]),h=(0,s.useState)(null),b=(0,i.default)(h,2),P=b[0],E=b[1],O=(0,u.useElements)(),S=t("customForm"),w=(0,c.getCreditCardForm)(S),_=w.component,C=void 0===_?null:_,M=w.breakpoint,k=void 0===M?475:M,j=t("postalCodeEnabled"),D={};["cardNumber","cardExpiry","cardCvc"].forEach((function(e){D[e]=f(f({classes:m},t("cardOptions")),t("customFieldOptions")[e])}));var R=(0,s.useCallback)((function(e){v.current.includes(e)||v.current.push(e)}),[]);(0,p.useBreakpointWidth)({name:"creditCardForm",width:k,node:P,className:"small-form"});var x=(0,s.useCallback)((function(e){for(var n=0,r=Object.keys(t("cards"));n<r.length;n++){var a=r[n];if(a===e)return t("cards")[a]}return""}),[]);return C?r.createElement("div",{className:"wc-stripe-custom-form ".concat(S),ref:E},(0,s.cloneElement)(C,{postalCodeEnabled:j,options:D,onChange:function(e){return R(e),function(t){if(n(t),"cardNumber"===t.elementType&&("unknown"===t.brand?g(""):g(t.brand)),t.complete){var r=v.current.indexOf(e);if(v.current[r+1]){var a=v.current[r+1];O.getElement(a).focus()}}}},CardIcon:r.createElement(y,{type:d,src:x(d)})})):r.createElement("div",{className:"wc-stripe-custom-form-error"},r.createElement("p",null,(0,l.sprintf)((0,l.__)("%s is not a valid blocks Stripe custom form. Please choose another custom form option in the Credit Card Settings.","woo-stripe-payment"),t("customFormLabels")[S])))}},6835:(e,t,n)=>{var r=n(3027);n(8356);var a=n(1134),o=n(6664),i=n(3163),c=n(3027),s=function(e){var t=e.CardIcon,n=e.options,a=e.onChange;return(0,c.useEffect)((function(){}),[]),r.createElement("div",{className:"wc-stripe-simple-form"},r.createElement("div",{className:"row"},r.createElement("div",{className:"field"},r.createElement("div",{className:"field-item"},r.createElement(o.CardNumberElement,{id:"stripe-card-number",className:"input empty",options:n.cardNumber,onChange:a(o.CardNumberElement)}),r.createElement("label",{htmlFor:"stripe-card-number","data-tid":""},(0,i.__)("Card Number","woo-stripe-payment")),r.createElement("div",{className:"baseline"}),t))),r.createElement("div",{className:"row"},r.createElement("div",{className:"field half-width"},r.createElement("div",{className:"field-item"},r.createElement(o.CardExpiryElement,{id:"stripe-exp",className:"input empty",options:n.cardExpiry,onChange:a(o.CardExpiryElement)}),r.createElement("label",{htmlFor:"stripe-exp","data-tid":""},(0,i.__)("Expiration","woo-stripe-payment")),r.createElement("div",{className:"baseline"}))),r.createElement("div",{className:"field half-width cvc"},r.createElement("div",{className:"field-item"},r.createElement(o.CardCvcElement,{id:"stripe-cvv",className:"input empty",options:n.cardCvc,onChange:a(o.CardCvcElement)}),r.createElement("label",{htmlFor:"stripe-cvv","data-tid":""},(0,i.__)("CVV","woo-stripe-payment")),r.createElement("div",{className:"baseline"})))))};(0,a.registerCreditCardForm)({id:"simple",component:r.createElement(s,null),breakpoint:375})},9775:(e,t,n)=>{var r=n(3027),a=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(9713)),i=n(6664),c=n(1134),s=n(3027);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.default=function(e){var t=e.getData,n=e.billing,a=e.onChange,o=(0,s.useMemo)((function(){var e;return l(l({},{value:{postalCode:null==n||null===(e=n.billingData)||void 0===e?void 0:e.postcode},hidePostalCode:(0,c.isFieldRequired)("postcode"),iconStyle:"default"}),t("cardOptions"))}),[n.billingData]);return r.createElement("div",{className:"wc-stripe-inline-form"},r.createElement(i.CardElement,{options:o,onChange:a}))}},627:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),n(5773);var r=n(7205);Object.keys(r).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===r[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}}))})),n(7354),n(6835)},7205:(e,t,n)=>{var r=n(3027),a=n(5318),o=a(n(3038)),i=n(3027),c=n(4222),s=n(1134),u=n(6664),l=n(3187),p=a(n(1065)),d=a(n(3329)),f=a(n(9775)),m=n(3636),y=(0,s.getSettings)("stripe_cc_data"),g=function(e){return(0,s.isUserLoggedIn)(e)&&y("saveCardEnabled")&&!(0,s.cartContainsSubscription)()&&!(0,s.cartContainsPreOrder)()},v=function(e){var t=(0,i.useState)(!1),n=(0,o.default)(t,2),a=n[0],c=n[1];if((0,i.useEffect)((function(){s.initStripe.catch((function(e){c(e)}))}),[c]),a)throw new Error(a);return r.createElement(u.Elements,{stripe:s.initStripe},r.createElement(h,e))},h=function(e){var t=e.getData,n=e.billing,a=e.shippingData,c=e.emitResponse,s=e.eventRegistration,p=e.activePaymentMethod,y=(0,m.useStripeError)(),v=(0,o.default)(y,2),h=v[0],b=v[1],P=(0,i.useState)(!1),E=(0,o.default)(P,2),O=E[0],S=E[1],w=s.onPaymentProcessing,_=(0,u.useStripe)(),C=(0,u.useElements)(),M=(0,i.useCallback)((function(){var e=t("customFormActive")?u.CardNumberElement:u.CardElement;return{card:C.getElement(e)}}),[_,C]),k=(0,m.useSetupIntent)({getData:t,cartTotal:n.cartTotal,setError:b}),j=k.setupIntent,D=k.removeSetupIntent;(0,m.useProcessPaymentIntent)({getData:t,billing:n,shippingData:a,emitResponse:c,error:h,onPaymentProcessing:w,savePaymentMethod:O,setupIntent:j,removeSetupIntent:D,getPaymentMethodArgs:M,activePaymentMethod:p}),(0,m.useAfterProcessingPayment)({getData:t,eventRegistration:s,responseTypes:c.responseTypes,activePaymentMethod:p,savePaymentMethod:O});var R=t("customFormActive")?d.default:f.default;return r.createElement("div",{className:"wc-stripe-card-container"},r.createElement(R,{getData:t,billing:n,onChange:function(e){e.error?b(e.error):b(!1)}}),g(n.customerId)&&r.createElement(l.SavePaymentMethod,{label:t("savePaymentMethodLabel"),onChange:function(e){return S(e)},checked:O}))};(0,c.registerPaymentMethod)({name:y("name"),label:r.createElement(l.PaymentMethodLabel,{title:y("title"),paymentMethod:y("name"),icons:y("icons")}),ariaLabel:"Credit Cards",canMakePayment:function(){return s.initStripe},content:r.createElement(l.PaymentMethod,{content:v,getData:y}),savedTokenComponent:r.createElement(p.default,{getData:y}),edit:r.createElement(l.PaymentMethod,{content:v,getData:y}),supports:{showSavedCards:y("showSavedCards"),showSaveOption:!1,features:y("features")}})},7082:(e,t,n)=>{var r=n(3027),a=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(4575)),i=a(n(3913)),c=a(n(2205)),s=a(n(8585)),u=a(n(9754));var l=function(e){(0,c.default)(l,e);var t,n,a=(t=l,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=(0,u.default)(t);if(n){var a=(0,u.default)(this).constructor;e=Reflect.construct(r,arguments,a)}else e=r.apply(this,arguments);return(0,s.default)(this,e)});function l(e){var t;return(0,o.default)(this,l),(t=a.call(this,e)).state={hasError:!1,error:null,errorInfo:null},t}return(0,i.default)(l,[{key:"componentDidCatch",value:function(e,t){this.setState({hasError:!0,error:e,errorInfo:t})}},{key:"render",value:function(){return this.state.hasError?r.createElement(r.Fragment,null,this.state.error&&r.createElement("div",{className:"wc-stripe-block-error"},this.state.error.toString()),this.state.errorInfo&&r.createElement("div",{className:"wc-stripe-block-error"},this.state.errorInfo.componentStack)):this.props.children}}]),l}(n(3027).Component);t.default=l},5212:(e,t,n)=>{var r=n(3027),a=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(3038)),i=a(n(6479)),c=n(3027),s=n(5516),u=n(3636),l=(0,n(1134).getSettings)("stripeGeneralData")().publishableKey;t.default=function(e){var t=e.getData,n=e.setErrorMessage,a=e.billing,p=e.shippingData,d=e.canMakePayment,f=e.checkoutStatus,m=e.eventRegistration,y=e.activePaymentMethod,g=e.onClick,v=e.onClose,h=(0,i.default)(e,["getData","setErrorMessage","billing","shippingData","canMakePayment","checkoutStatus","eventRegistration","activePaymentMethod","onClick","onClose"]),b={merchantId:t("merchantId"),merchantName:t("merchantName")},P=(0,u.useStripeError)(),E=(0,o.default)(P,2),O=E[0],S=(E[1],(0,c.useRef)()),w=h.onSubmit,_=h.emitResponse,C=m.onPaymentProcessing,M=(0,u.useExportedValues)(),k="long"===t("buttonStyle").buttonType?390:300,j=(0,u.useProcessPaymentIntent)({getData:t,billing:a,shippingData:p,onPaymentProcessing:C,emitResponse:_,error:O,exportedValues:M,onSubmit:w,checkoutStatus:f,activePaymentMethod:y}).setPaymentMethod,D=(0,s.usePaymentRequest)({getData:t,publishableKey:l,merchantInfo:b,billing:a,shippingData:p}),R=(0,s.usePaymentsClient)({merchantInfo:b,paymentRequest:D,billing:a,shippingData:p,eventRegistration:m,canMakePayment:d,setErrorMessage:n,onSubmit:w,setPaymentMethod:j,exportedValues:M,onClick:g,onClose:v,getData:t}),x=R.button,A=R.removeButton;return(0,u.useExpressBreakpointWidth)({payment_method:t("name"),width:k}),(0,c.useEffect)((function(){x&&(A(S.current),S.current.append(x))}),[x]),r.createElement("div",{className:"wc-stripe-gpay-button-container",ref:S})}},3097:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BASE_PAYMENT_REQUEST=t.BASE_PAYMENT_METHOD=void 0,t.BASE_PAYMENT_METHOD={type:"CARD",parameters:{allowedAuthMethods:["PAN_ONLY"],allowedCardNetworks:["AMEX","DISCOVER","INTERAC","JCB","MASTERCARD","VISA"],assuranceDetailsRequired:!0}},t.BASE_PAYMENT_REQUEST={apiVersion:2,apiVersionMinor:0}},5516:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(1674);Object.keys(r).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===r[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}}))}));var a=n(1735);Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===a[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}}))}));var o=n(9808);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))}))},9808:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.useErrorMessage=void 0;var a=r(n(3038)),o=n(3027);t.useErrorMessage=function(){var e=(0,o.useState)(!1),t=(0,a.default)(e,2);return{errorMessage:t[0],setErrorMessage:t[1]}}},1735:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.usePaymentRequest=void 0;var a=r(n(319)),o=r(n(9713)),i=n(3027),c=n(3097),s=n(1134),u=n(8664);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.usePaymentRequest=function(e){var t=e.getData,n=e.publishableKey,r=e.merchantInfo,o=e.billing,l=e.shippingData,d=o.billingData,f=l.shippingRates,m=t(),y=m.processingCountry,g=m.totalPriceLabel;return(0,i.useMemo)((function(){var e=p(p({},{emailRequired:(0,s.isEmpty)(d.email),merchantInfo:r,allowedPaymentMethods:[p(p({},{type:"CARD",tokenizationSpecification:{type:"PAYMENT_GATEWAY",parameters:{gateway:"stripe","stripe:version":"2018-10-31","stripe:publishableKey":n}}}),c.BASE_PAYMENT_METHOD)],shippingAddressRequired:l.needsShipping,transactionInfo:(0,u.getTransactionInfo)({billing:o,processingCountry:y,totalPriceLabel:g}),callbackIntents:["PAYMENT_AUTHORIZATION"]}),c.BASE_PAYMENT_REQUEST);if(e.allowedPaymentMethods[0].parameters.billingAddressRequired=!0,e.allowedPaymentMethods[0].parameters.billingAddressParameters={format:"FULL",phoneNumberRequired:(0,s.isFieldRequired)("phone",d.country)&&(0,s.isEmpty)(d.phone)},e.shippingAddressRequired){e.callbackIntents=[].concat((0,a.default)(e.callbackIntents),["SHIPPING_ADDRESS","SHIPPING_OPTION"]),e.shippingOptionRequired=!0;var t=(0,u.getShippingOptionParameters)(f);t.shippingOptions.length>0&&(e=p(p({},e),{},{shippingOptionParameters:t}))}return e}),[o.cartTotal,o.cartTotalItems,d,l])}},1674:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.usePaymentsClient=void 0;var a=r(n(319)),o=r(n(9713)),i=r(n(7015)),c=r(n(8926)),s=r(n(3038)),u=n(3027),l=r(n(4306)),p=n(1134),d=n(6664),f=n(8664),m=n(3163),y=n(3636);function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.usePaymentsClient=function(e){var t=e.merchantInfo,n=e.paymentRequest,r=e.billing,g=e.shippingData,h=e.eventRegistration,b=e.canMakePayment,P=e.setErrorMessage,E=e.setPaymentMethod,O=e.exportedValues,S=e.onClick,w=e.onClose,_=e.getData,C=_().environment,M=(0,u.useState)(),k=(0,s.default)(M,2),j=k[0],D=k[1],R=(0,u.useState)(null),x=(0,s.default)(R,2),A=x[0],I=x[1],L=(0,u.useRef)(r),T=(0,u.useRef)(g),N=(0,d.useStripe)(),B=(0,y.usePaymentEvents)({billing:r,shippingData:g,eventRegistration:h}).addPaymentEvent;(0,u.useEffect)((function(){L.current=r,T.current=g}));var F=(0,u.useCallback)((function(e){var t,n;if(null!=e&&null!==(t=e.paymentMethodData)&&void 0!==t&&null!==(n=t.info)&&void 0!==n&&n.billingAddress){var r,a=e.paymentMethodData.info.billingAddress;(0,p.isAddressValid)(L.current.billingData,["phone","email"])&&(0,p.isEmpty)(null===(r=L.current.billingData)||void 0===r?void 0:r.phone)&&(a={phoneNumber:a.phoneNumber}),O.billingData=L.current.billingData=(0,f.toCartAddress)(a,{email:e.email})}null!=e&&e.shippingAddress&&(O.shippingAddress=(0,f.toCartAddress)(e.shippingAddress))}),[O,n]),q=(0,u.useCallback)((function(e){for(;e.firstChild;)e.removeChild(e.firstChild)}),[A]),X=(0,u.useCallback)((0,c.default)(i.default.mark((function e(){var t,r,a;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return S(),e.prev=1,e.next=4,j.loadPaymentData(n);case 4:return t=e.sent,F(t),r=JSON.parse(t.paymentMethodData.tokenizationData.token),e.next=9,N.createPaymentMethod({type:"card",card:{token:r.id},billing_details:(0,p.getBillingDetailsFromAddress)(L.current.billingData)});case 9:if(!(a=e.sent).error){e.next=12;break}throw new p.StripeError(a.error);case 12:E(a.paymentMethod.id),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(1),"CANCELED"===(null===e.t0||void 0===e.t0?void 0:e.t0.statusCode)?w():(console.log((0,p.getErrorMessage)(e.t0)),P((0,p.getErrorMessage)(e.t0)));case 18:case"end":return e.stop()}}),e,null,[[1,15]])}))),[N,j,S]),V=(0,u.useCallback)((0,c.default)(i.default.mark((function e(){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!j||A||!N){e.next=5;break}return e.next=4,b;case 4:I(j.createButton(v({onClick:X},_("buttonStyle"))));case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.log(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])}))),[N,A,j,X]),U=(0,u.useMemo)((function(){var e={environment:C,merchantInfo:t,paymentDataCallbacks:{onPaymentAuthorized:function(){return Promise.resolve({transactionState:"SUCCESS"})}}};return n.shippingAddressRequired&&(e.paymentDataCallbacks.onPaymentDataChanged=function(e){return new Promise((function(t,n){var r,i=T.current,c=e.shippingAddress,s=e.shippingOptionData,u=(0,f.toCartAddress)(c),d=(0,p.getSelectedShippingOption)(s.id),y=(0,l.default)((0,p.getIntermediateAddress)(i.shippingAddress),u),g=(0,l.default)(i.selectedRates,(0,o.default)({},d[1],d[0]));B("onShippingChanged",(function(e,n){var r=n.billing,a=n.shipping;t(e?(0,f.getPaymentRequestUpdate)({billing:r,shippingData:{needsShipping:!0,shippingRates:a.shippingRates},processingCountry:_("processingCountry"),totalPriceLabel:_("totalPriceLabel")}):{error:{reason:"SHIPPING_ADDRESS_UNSERVICEABLE",message:(0,m.__)("Your shipping address is not serviceable.","woo-stripe-payment"),intent:"SHIPPING_ADDRESS"}})}),y&&g),T.current.setShippingAddress(v(v({},T.current.shippingAddress),u)),"shipping_option_unselected"!==s.id&&(r=T.current).setSelectedRates.apply(r,(0,a.default)(d))}))}),e}),[n]);return(0,u.useEffect)((function(){D(new google.payments.api.PaymentsClient(U))}),[U]),(0,u.useEffect)((function(){V()}),[V]),{button:A,removeButton:q}}},5341:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),n(9509);var r=n(9031);Object.keys(r).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===r[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}}))}))},9031:(e,t,n)=>{var r=n(3027),a=n(5318),o=a(n(7154)),i=a(n(6479)),c=a(n(9713)),s=n(4222),u=n(1134),l=n(5516),p=a(n(5212)),d=n(3097),f=a(n(3905)),m=n(6664);function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach((function(t){(0,c.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var v,h,b=(0,u.getSettings)("stripe_googlepay_data"),P=(v=new f.default.payments.api.PaymentsClient({environment:b("environment"),merchantInfo:{merchantId:b("merchantId"),merchantName:b("merchantName")}}),h=g(g({},d.BASE_PAYMENT_REQUEST),{},{allowedPaymentMethods:[d.BASE_PAYMENT_METHOD]}),v.isReadyToPay(h).then((function(){return!0})).catch((function(e){return console.log(e),!1}))),E=function(e){var t=e.getData,n=e.components,a=(0,i.default)(e,["getData","components"]),c=n.ValidationInputError,s=(0,l.useErrorMessage)(),d=s.errorMessage,f=s.setErrorMessage;return r.createElement("div",{className:"wc-stripe-gpay-container"},r.createElement(m.Elements,{stripe:u.initStripe},r.createElement(p.default,(0,o.default)({getData:t,canMakePayment:P,setErrorMessage:f},a)),d&&r.createElement(c,{errorMessage:d})))},O=function(e){var t,n=e.getData,a=((0,i.default)(e,["getData"]),n("buttonStyle").buttonType),o=(null===(t=n("editorIcons"))||void 0===t?void 0:t[a])||"long";return r.createElement("div",{className:"gpay-block-editor ".concat(a)},r.createElement("img",{src:o}))};(0,s.registerExpressPaymentMethod)({name:b("name"),canMakePayment:function(){return b("isAdmin")?!(0,u.isCartPage)()||b("cartCheckoutEnabled"):!((0,u.isCartPage)()&&!b("cartCheckoutEnabled"))&&u.initStripe.then((function(e){return e.error?e:P}))},content:r.createElement(E,{getData:b}),edit:r.createElement(O,{getData:b}),supports:{showSavedCards:b("showSavedCards"),showSaveOption:b("showSaveOption"),features:b("features")}})},8664:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.toCartAddress=t.getShippingOptions=t.getShippingOptionParameters=t.getPaymentRequestUpdate=t.getTransactionInfo=void 0;var a=r(n(319)),o=n(1134),i=((0,n(2492).getSetting)("stripeGeneralData"),function(e){var t=e.billing,n=e.processingCountry,r=e.totalPriceLabel,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ESTIMATED",i=t.cartTotal,s=t.cartTotalItems,u=t.currency,l={countryCode:n,currencyCode:u.code,totalPriceStatus:a,totalPrice:(0,o.removeNumberPrecision)(i.value,u.minorUnit).toString(),displayItems:c(s,u.minorUnit),totalPriceLabel:r};return l});t.getTransactionInfo=i,t.getPaymentRequestUpdate=function(e){var t=e.billing,n=e.shippingData,r=e.processingCountry,a=e.totalPriceLabel,o=n.needsShipping,c=n.shippingRates,u={newTransactionInfo:i({billing:t,processingCountry:r,totalPriceLabel:a},"FINAL")};return o&&(u.newShippingOptionParameters=s(c)),u};var c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=[],r=["total_tax","total_shipping"];return e.forEach((function(e){(0<e.value||e.key&&r.includes(e.key))&&n.push({label:e.label,type:"LINE_ITEM",price:(0,o.removeNumberPrecision)(e.value,t).toString()})})),n},s=function(e){var t=u(e),n=t.map((function(e){return e.id})).slice(0,1).shift();return e.forEach((function(e,t){e.shipping_rates.forEach((function(e){e.selected&&(n=(0,o.getShippingOptionId)(t,e.rate_id))}))})),{shippingOptions:t,defaultSelectedOptionId:n}};t.getShippingOptionParameters=s;var u=function(e){var t=[];return e.forEach((function(e,n){var r=e.shipping_rates.map((function(e){var t=document.createElement("textarea");t.innerHTML=e.name;var r=(0,o.formatPrice)(e.price,e.currency_code);return{id:(0,o.getShippingOptionId)(n,e.rate_id),label:t.value,description:"".concat(r)}}));t=[].concat((0,a.default)(t),(0,a.default)(r))})),t};t.getShippingOptions=u;var l=(0,o.toCartAddress)({name:function(e,t){return e.first_name=t.split(" ").slice(0,-1).join(" "),e.last_name=t.split(" ").pop(),e},countryCode:"country",address1:"address_1",address2:"address_2",locality:"city",administrativeArea:"state",postalCode:"postcode",email:"email",phoneNumber:"phone"});t.toCartAddress=l},3636:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(4332);Object.keys(r).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===r[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}}))}));var a=n(1261);Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===a[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}}))}));var o=n(6107);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))}));var i=n(2715);Object.keys(i).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===i[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}}))}));var c=n(2343);Object.keys(c).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===c[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return c[e]}}))}));var s=n(1500);Object.keys(s).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===s[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}}))}));var u=n(6095);Object.keys(u).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===u[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return u[e]}}))}));var l=n(5554);Object.keys(l).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===l[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return l[e]}}))}));var p=n(3893);Object.keys(p).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===p[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return p[e]}}))}))},1261:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.useAfterProcessingPayment=void 0;var a=r(n(7015)),o=r(n(8926)),i=n(3027),c=n(6664),s=n(1134),u=n(3893);t.useAfterProcessingPayment=function(e){var t=e.getData,n=e.eventRegistration,r=e.responseTypes,l=e.activePaymentMethod,p=e.savePaymentMethod,d=void 0!==p&&p,f=e.messageContext,m=void 0===f?null:f,y=(0,c.useStripe)(),g=n.onCheckoutAfterProcessingWithSuccess,v=n.onCheckoutAfterProcessingWithError;(0,u.useProcessCheckoutError)({responseTypes:r,subscriber:v,messageContext:m}),(0,i.useEffect)((function(){var e=g(function(){var e=(0,o.default)(a.default.mark((function e(n){var o;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=n.redirectUrl,t("name")!==l){e.next=5;break}return e.next=4,(0,s.handleCardAction)({redirectUrl:o,responseTypes:r,stripe:y,getData:t,savePaymentMethod:d});case 4:return e.abrupt("return",e.sent);case 5:return e.abrupt("return",null);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());return function(){return e()}}),[y,r,g,l,d])}},5554:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.useExpressBreakpointWidth=t.useBreakpointWidth=void 0;var a=r(n(3038)),o=n(3027),i=n(1134),c=function(e){var t=e.name,n=e.width,r=e.node,c=e.className,s=(0,o.useState)(window.innerWidth),u=(0,a.default)(s,2),l=u[0],p=u[1],d=(0,o.useCallback)((function(e){var t=(0,i.getFromCache)(e);return t?parseInt(t):0}),[]),f=(0,o.useCallback)((function(e,t){return(0,i.storeInCache)(e,t)}),[]);(0,o.useEffect)((function(){var e="function"==typeof r?r():r;if(e){var a=d(t);(!a||n>a)&&f(t,n),e.clientWidth<n?e.classList.add(c):e.clientWidth>a&&e.classList.remove(c)}}),[l,r]),(0,o.useEffect)((function(){var e=function(){return p(window.innerWidth)};return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}}))};t.useBreakpointWidth=c,t.useExpressBreakpointWidth=function(e){var t=e.payment_method,n=e.width,r=(0,o.useCallback)((function(){var e=document.getElementById("express-payment-method-".concat(t));return e?e.parentNode:null}),[]);c({name:"expressMaxWidth",width:n,node:r,className:"wc-stripe-express__sm"})}},2343:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useExportedValues=void 0;var r=n(3027);t.useExportedValues=function(){return(0,r.useRef)({}).current}},6095:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.usePaymentEvents=void 0;var a=r(n(9713)),o=r(n(3038)),i=n(3027),c=n(1134);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){(0,a.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.usePaymentEvents=function(e){var t=e.billing,n=e.shippingData,r=e.eventRegistration,s=r.onShippingRateSuccess,l=r.onShippingRateFail,p=r.onShippingRateSelectSuccess,d=(0,i.useRef)(t),f=(0,i.useRef)(n),m=(0,i.useState)(null),y=(0,o.default)(m,2),g=y[0],v=y[1],h=(0,i.useState)({onShippingChanged:!1}),b=(0,o.default)(h,2),P=b[0],E=b[1],O=(0,i.useCallback)((function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];n?v((0,a.default)({},e,t)):E(u(u({},P),{},(0,a.default)({},e,t)))}),[P,E]),S=(0,i.useCallback)((function(e){P[e]&&(delete P[e],E(P))}),[P]),w=(0,i.useCallback)((function(){var e=f.current,t=d.current;if(P.onShippingChanged&&!e.isSelectingRate&&!e.shippingRatesLoading){var n=P.onShippingChanged,r=!0;(0,c.hasShippingRates)(e.shippingRates)||(r=!1),n(r,{billing:t,shipping:e}),S("onShippingChanged")}}),[P,S]);return(0,i.useEffect)((function(){d.current=t,f.current=n})),(0,i.useEffect)((function(){g&&g.onShippingChanged&&(g.onShippingChanged(!0,{billing:d.current,shipping:f.current}),v(null))}),[g]),(0,i.useEffect)((function(){var e=s(w),t=p(w),n=l((function(e){e.hasInvalidAddress,e.hasError,P.onShippingChanged&&((0,P.onShippingChanged)(!1),S("onShippingChanged"))}));return function(){e(),n(),t()}}),[P,s,l,p]),{addPaymentEvent:O,removePaymentEvent:S}}},1500:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.usePaymentRequest=void 0;var a=r(n(319)),o=r(n(9713)),i=r(n(3038)),c=n(3027),s=n(6095),u=n(1134),l=r(n(4306));function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var f=(0,u.toCartAddress)();t.usePaymentRequest=function(e){var t=e.getData,n=e.onClose,r=e.stripe,o=e.billing,p=e.shippingData,m=e.eventRegistration,y=e.setPaymentMethod,g=e.exportedValues,v=e.canPay,h=(0,s.usePaymentEvents)({billing:o,shippingData:p,eventRegistration:m}).addPaymentEvent,b=(p.shippingAddress,p.needsShipping),P=p.shippingRates,E=o.billingData,O=o.cartTotalItems,S=o.currency,w=o.cartTotal,_=(0,c.useState)(null),C=(0,i.default)(_,2),M=C[0],k=C[1],j=(0,c.useRef)({}),D=(0,c.useRef)(p),R=(0,c.useRef)(o);(0,c.useEffect)((function(){D.current=p,R.current=o}),[p]),(0,c.useEffect)((function(){if(r){var e={country:t("countryCode"),currency:null==S?void 0:S.code.toLowerCase(),total:{amount:w.value,label:w.label,pending:!0},requestPayerName:!0,requestPayerEmail:(0,u.isFieldRequired)("email",E.country),requestPayerPhone:(0,u.isFieldRequired)("phone",E.country),requestShipping:b,displayItems:(0,u.getDisplayItems)(O,S)};e.requestShipping&&(e.shippingOptions=(0,u.getShippingOptions)(P)),j.current=e;var n=r.paymentRequest(j.current);n.canMakePayment().then((function(e){v(e)?k(n):k(null)}))}}),[r,w.value,E.country,P,O,S.code]),(0,c.useEffect)((function(){M&&(j.current.requestShipping&&(M.on("shippingaddresschange",A),M.on("shippingoptionchange",I)),M.on("cancel",n),M.on("paymentmethod",L))}),[M,A,n,L]);var x=(0,c.useCallback)((function(e){return function(t,n){var r=n.billing,a=n.shipping,o=r.cartTotal,i=r.cartTotalItems,c=r.currency,s=a.shippingRates;t?e.updateWith({status:"success",total:{amount:o.value,label:o.label,pending:!1},displayItems:(0,u.getDisplayItems)(i,c),shippingOptions:(0,u.getShippingOptions)(s)}):e.updateWith({status:"invalid_shipping_address"})}}),[]),A=(0,c.useCallback)((function(e){var t=e.shippingAddress,n=D.current,r=f(t);n.setShippingAddress(d(d({},n.shippingAddress),r));var a=(0,l.default)((0,u.getIntermediateAddress)(n.shippingAddress),r);h("onShippingChanged",x(e),a)}),[h]),I=(0,c.useCallback)((function(e){var t=e.shippingOption,n=D.current;n.setSelectedRates.apply(n,(0,a.default)((0,u.getSelectedShippingOption)(t.id))),h("onShippingChanged",x(e))}),[h]),L=(0,c.useCallback)((function(e){var t=e.paymentMethod,n=e.payerName,r=void 0===n?null:n,a=e.payerEmail,o=void 0===a?null:a,i=e.payerPhone,c={payerName:r,payerEmail:o,payerPhone:void 0===i?null:i};null!=t&&t.billing_details.address&&(c=f(t.billing_details.address,c)),g.billingData=c,e.shippingAddress&&(g.shippingAddress=f(e.shippingAddress)),y(t.id),e.complete("success")}),[]);return{paymentRequest:M}}},3893:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useProcessCheckoutError=void 0;var r=n(3027);t.useProcessCheckoutError=function(e){var t=e.responseTypes,n=e.subscriber,a=e.messageContext,o=void 0===a?null:a;(0,r.useEffect)((function(){var e=n((function(e){var n;return null!=e&&null!==(n=e.processingResponse.paymentDetails)&&void 0!==n&&n.stripeErrorMessage?{type:t.ERROR,message:e.processingResponse.paymentDetails.stripeErrorMessage,messageContext:o}:null}));return function(){return e()}}),[t,n])}},4332:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.useProcessPaymentIntent=void 0;var a=r(n(7015)),o=r(n(8926)),i=r(n(9713)),c=r(n(3038)),s=n(3027),u=n(6664),l=n(1134);function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){(0,i.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.useProcessPaymentIntent=function(e){var t=e.getData,n=e.billing,r=e.shippingData,p=e.onPaymentProcessing,f=e.emitResponse,m=e.error,y=e.onSubmit,g=e.activePaymentMethod,v=e.paymentType,h=void 0===v?"card":v,b=e.setupIntent,P=void 0===b?null:b,E=e.removeSetupIntent,O=void 0===E?null:E,S=e.savePaymentMethod,w=void 0!==S&&S,_=e.exportedValues,C=void 0===_?{}:_,M=e.getPaymentMethodArgs,k=void 0===M?function(){return{}}:M,j=n.billingData,D=r.shippingAddress,R=f.responseTypes,x=(0,s.useState)(null),A=(0,c.default)(x,2),I=A[0],L=A[1],T=(0,u.useStripe)(),N=(0,s.useRef)(k);(0,s.useEffect)((function(){N.current=k}),[k]);var B=(0,s.useCallback)((function(){return d(d({},{type:h,billing_details:(0,l.getBillingDetailsFromAddress)(null!=C&&C.billingData?C.billingData:j)}),N.current())}),[j,h,k]),F=(0,s.useCallback)((function(e,n){var r,a={meta:{paymentMethodData:(r={},(0,i.default)(r,"".concat(t("name"),"_token_key"),e),(0,i.default)(r,"".concat(t("name"),"_save_source_key"),n),r)}};return null!=C&&C.billingData&&(a.meta.billingData=C.billingData),null!=C&&C.shippingAddress&&(a.meta.shippingData={address:C.shippingAddress}),a}),[j,D]);return(0,s.useEffect)((function(){I&&"string"==typeof I&&y()}),[I,y]),(0,s.useEffect)((function(){var e=p((0,o.default)(a.default.mark((function e(){var n,r;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(g===t("name")){e.next=2;break}return e.abrupt("return",null);case 2:if(n=null,r=null,e.prev=3,!m){e.next=6;break}throw new l.StripeError(m);case 6:if(!P){e.next=16;break}return e.next=9,T.confirmCardSetup(P.client_secret,{payment_method:B()});case 9:if(!(n=e.sent).error){e.next=12;break}throw new l.StripeError(n.error);case 12:r=n.setupIntent.payment_method,O(),e.next=26;break;case 16:if(!I){e.next=20;break}r=I,e.next=26;break;case 20:return e.next=22,T.createPaymentMethod(B());case 22:if(!(n=e.sent).error){e.next=25;break}throw new l.StripeError(n.error);case 25:r=n.paymentMethod.id;case 26:return e.abrupt("return",(0,l.ensureSuccessResponse)(R,F(r,w)));case 29:return e.prev=29,e.t0=e.catch(3),console.log(e.t0),L(null),e.abrupt("return",(0,l.ensureErrorResponse)(R,e.t0.error));case 34:case"end":return e.stop()}}),e,null,[[3,29]])}))));return function(){return e()}}),[I,j,p,T,P,g,w]),{setPaymentMethod:L}}},6107:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.useSetupIntent=void 0;var a=r(n(7015)),o=r(n(8926)),i=r(n(3038)),c=n(3027),s=r(n(7606)),u=n(1134);t.useSetupIntent=function(e){var t=e.cartTotal,n=e.setError,r=(0,c.useState)((0,u.getFromCache)("setupIntent")),l=(0,i.default)(r,2),p=l[0],d=l[1];(0,c.useEffect)((function(){var e=function(){var e=(0,o.default)(a.default.mark((function e(){var t;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!p){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,(0,s.default)({url:(0,u.getRoute)("create/setup_intent"),method:"POST"});case 4:(t=e.sent).code?n(t.message):((0,u.storeInCache)("setupIntent",t.intent),d(t.intent));case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();(0,u.cartContainsPreOrder)()||(0,u.cartContainsSubscription)()&&0==t.value?p||e():d(null)}),[t.value]);var f=(0,c.useCallback)((function(){(0,u.deleteFromCache)("setupIntent")}),[t.value]);return{setupIntent:p,removeSetupIntent:f}}},2715:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.useStripeError=void 0;var a=r(n(3038)),o=n(3027);t.useStripeError=function(){var e=(0,o.useState)(!1),t=(0,a.default)(e,2);return[t[0],t[1]]}},6480:(e,t,n)=>{var r=n(3027),a=n(5318),o=a(n(6479)),i=a(n(9713)),c=a(n(3038)),s=n(3027),u=n(4222),l=n(1134),p=n(3539),d=n(3187),f=n(6664),m=n(3163);function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach((function(t){(0,i.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var v,h=(0,l.getSettings)("stripe_afterpay_data"),b=function(e){var t=e.getData,n=(0,s.useState)({amount:t("cartTotal"),currency:t("currency"),isEligible:t("msgOptions").isEligible}),a=(0,c.default)(n,2),o=a[0],i=a[1],u={locale:"auto"};return"GBP"!==o.currency||["fr-FR","it-IT","es-ES"].includes(t("locale"))||(u.locale="en-GB"),v=i,r.createElement(f.Elements,{stripe:l.initStripe,options:u},r.createElement("div",{className:"wc-stripe-blocks-afterpay__label"},r.createElement(f.AfterpayClearpayMessageElement,{options:g(g({},t("msgOptions")),{amount:o.amount,currency:o.currency,isEligible:o.isEligible})})))},P=function(e){var t=e.content,n=e.billing,a=e.shippingData,i=(0,o.default)(e,["content","billing","shippingData"]),c=t,u=n.cartTotal,l=n.currency,p=a.needsShipping;return(0,s.useEffect)((function(){v({amount:u.value,currency:l.code,isEligible:p})}),[u.value,l.code,p]),r.createElement(r.Fragment,null,p&&r.createElement("div",{className:"wc-stripe-blocks-payment-method-content"},r.createElement("div",{className:"wc-stripe-blocks-afterpay-offsite__container"},r.createElement("div",{className:"wc-stripe-blocks-afterpay__offsite"},r.createElement("img",{src:h("offSiteSrc")}),r.createElement("p",null,(0,m.sprintf)((0,m.__)('After clicking "%s", you will be redirected to Afterpay to complete your purchase securely.',"woo-stripe-payment"),h("placeOrderButtonLabel"))))),r.createElement(c,g(g({},i),{},{billing:n,shippingData:a}))))};h()&&(0,u.registerPaymentMethod)({name:h("name"),label:r.createElement(b,{getData:h}),ariaLabel:(0,m.__)("Afterpay","woo-stripe-payment"),placeOrderButtonLabel:h("placeOrderButtonLabel"),canMakePayment:(0,p.canMakePayment)(h,(function(e){var t=e.settings,n=e.cartTotals,r=e.cartNeedsShipping,a=n.currency_code,o=n.currency_minor_unit,i=n.total_price,c=t("requiredParams"),s=t("accountCountry"),u=!!c[a]&&c[a];v&&v({amount:parseInt(n.total_price),currency:a,isEligible:r});var l=parseInt(i)/Math.pow(10,o),p=s===(null==u?void 0:u[0])&&r&&l>(null==u?void 0:u[1])&&l<(null==u?void 0:u[2]);return!p&&!t("hideIneligible")||p})),content:r.createElement(P,{content:p.LocalPaymentIntentContent,getData:h,confirmationMethod:"confirmAfterpayClearpayPayment"}),edit:r.createElement(d.PaymentMethod,{content:p.LocalPaymentIntentContent,getData:h}),supports:{showSavedCards:!1,showSaveOption:!1,features:h("features")}})},39:(e,t,n)=>{var r=n(3027),a=n(4222),o=n(1134),i=n(3539),c=n(2029),s=n(3187),u=(0,o.getSettings)("stripe_alipay_data");u()&&(0,a.registerPaymentMethod)({name:u("name"),label:r.createElement(c.PaymentMethodLabel,{title:u("title"),paymentMethod:u("name"),icons:u("icon")}),ariaLabel:"Alipay",placeOrderButtonLabel:u("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(u),content:r.createElement(s.PaymentMethod,{content:i.LocalPaymentSourceContent,getData:u}),edit:r.createElement(s.PaymentMethod,{content:i.LocalPaymentSourceContent,getData:u}),supports:{showSavedCards:!1,showSaveOption:!1,features:u("features")}})},8641:(e,t,n)=>{var r=n(3027),a=n(4222),o=n(1134),i=n(3539),c=n(3187),s=(0,o.getSettings)("stripe_bancontact_data");s()&&(0,a.registerPaymentMethod)({name:s("name"),label:r.createElement(c.PaymentMethodLabel,{title:s("title"),paymentMethod:s("name"),icons:s("icon")}),ariaLabel:"Bancontact",placeOrderButtonLabel:s("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(s),content:r.createElement(c.PaymentMethod,{content:i.LocalPaymentSourceContent,getData:s}),edit:r.createElement(c.PaymentMethod,{content:i.LocalPaymentSourceContent,getData:s}),supports:{showSavedCards:!1,showSaveOption:!1,features:s("features")}})},5176:(e,t,n)=>{var r=n(3027),a=n(4222),o=n(1134),i=n(3539),c=n(3187),s=n(6664),u=(0,o.getSettings)("stripe_becs_data");u()&&(0,a.registerPaymentMethod)({name:u("name"),label:r.createElement(c.PaymentMethodLabel,{title:u("title"),paymentMethod:u("name"),icons:u("icon")}),ariaLabel:"BECS",placeOrderButtonLabel:u("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(u),content:r.createElement(c.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:u,confirmationMethod:"confirmAuBecsDebitPayment",component:s.AuBankAccountElement}),edit:r.createElement(c.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:u}),supports:{showSavedCards:!1,showSaveOption:!1,features:u("features")}})},4990:(e,t,n)=>{var r=n(3027),a=n(5318),o=a(n(7154)),i=a(n(9713)),c=a(n(3038)),s=a(n(6479)),u=n(3027),l=n(3163),p=n(4222),d=a(n(4184)),f=n(1134),m=n(3539),y=n(3187);function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){(0,i.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var h=(0,f.getSettings)("stripe_boleto_data");h()&&(0,p.registerPaymentMethod)({name:h("name"),label:r.createElement(y.PaymentMethodLabel,{title:h("title"),paymentMethod:h("name"),icons:h("icon")}),ariaLabel:"Boleto",placeOrderButtonLabel:h("placeOrderButtonLabel"),canMakePayment:(0,m.canMakePayment)(h),content:r.createElement(y.PaymentMethod,{content:function(e){var t=e.eventRegistration,n=(0,s.default)(e,["eventRegistration"]),a=(0,u.useState)(""),i=(0,c.default)(a,2),p=i[0],y=i[1],g=(0,u.useState)(!1),h=(0,c.default)(g,2),b=h[0],P=h[1],E=t.onPaymentProcessing,O=(0,u.useCallback)((function(){return{boleto:{tax_id:p}}}),[p]);return(0,u.useEffect)((function(){var e=E((function(){return!!p||(0,f.ensureErrorResponse)(n.emitResponse.responseTypes,(0,l.__)("Please enter a valid CPF/CNPJ value","woo-stripe-payment"))}));return function(){return e()}}),[E,p]),r.createElement(r.Fragment,null,r.createElement("div",{className:(0,d.default)("wc-block-components-text-input",{"is-active":b||p})},r.createElement("input",{type:"text",id:"wc-stripe-boleto-tax_id",onChange:function(e){return y(e.target.value)},onFocus:function(){return P(!0)},onBlur:function(){return P(!1)}}),r.createElement("label",{htmlFor:"wc-stripe-boleto-tax_id"},(0,l.__)(" CPF / CNPJ"," woo-stripe-payment"))),(0,f.isTestMode)()&&r.createElement("div",{className:"wc-stripe-boleto__description"},r.createElement("p",null,(0,l.__)("Test mode values","woo-stripe-payment")),r.createElement("div",null,r.createElement("label",null,"CPF:"),"Â ",r.createElement("span",null,"000.000.000-00")),r.createElement("div",null,r.createElement("label",null,"CNPJ:"),"Â ",r.createElement("span",null,"00.000.000/0000-00"))),!(0,f.isTestMode)()&&r.createElement("div",{className:"wc-stripe-boleto__description"},r.createElement("p",null,(0,l.__)("Accepted formats","woo-stripe-payment")),r.createElement("div",null,r.createElement("label",null,"CPF:"),"Â ",r.createElement("span",null,(0,l.__)("XXX.XXX.XXX-XX or XXXXXXXXXXX","woo-stripe-payment"))),r.createElement("div",null,r.createElement("label",null,"CNPJ:"),"Â ",r.createElement("span",null,(0,l.__)("XX.XXX.XXX/XXXX-XX or XXXXXXXXXXXXXX","woo-stripe-payment")))),r.createElement(m.LocalPaymentIntentContent,(0,o.default)({callback:O},v(v({},n),{eventRegistration:t}))))},getData:h,confirmationMethod:"confirmBoletoPayment"}),edit:r.createElement(y.PaymentMethod,{content:m.LocalPaymentIntentContent,getData:h}),supports:{showSavedCards:!1,showSaveOption:!1,features:h("features")}})},4494:(e,t,n)=>{var r=n(3027),a=n(4222),o=n(1134),i=n(3539),c=n(3187),s=(0,o.getSettings)("stripe_eps_data");s()&&(0,a.registerPaymentMethod)({name:s("name"),label:r.createElement(c.PaymentMethodLabel,{title:s("title"),paymentMethod:s("name"),icons:s("icon")}),ariaLabel:"EPS",placeOrderButtonLabel:s("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(s),content:r.createElement(c.PaymentMethod,{content:i.LocalPaymentSourceContent,getData:s}),edit:r.createElement(c.PaymentMethod,{content:i.LocalPaymentSourceContent,getData:s}),supports:{showSavedCards:!1,showSaveOption:!1,features:s("features")}})},4031:(e,t,n)=>{var r=n(3027),a=n(4222),o=n(1134),i=n(3539),c=n(3187),s=n(6664),u=(0,o.getSettings)("stripe_fpx_data");u()&&(0,a.registerPaymentMethod)({name:u("name"),label:r.createElement(c.PaymentMethodLabel,{title:u("title"),paymentMethod:u("name"),icons:u("icon")}),ariaLabel:"FPX",placeOrderButtonLabel:u("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(u),content:r.createElement(c.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:u,confirmationMethod:"confirmIdealPayment",component:s.FpxBankElement}),edit:r.createElement(c.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:u}),supports:{showSavedCards:!1,showSaveOption:!1,features:u("features")}})},3817:(e,t,n)=>{var r=n(3027),a=n(4222),o=n(1134),i=n(3539),c=n(3187),s=(0,o.getSettings)("stripe_giropay_data");s()&&(0,a.registerPaymentMethod)({name:s("name"),label:r.createElement(c.PaymentMethodLabel,{title:s("title"),paymentMethod:s("name"),icons:s("icon")}),ariaLabel:"Giropay",placeOrderButtonLabel:s("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(s),content:r.createElement(c.PaymentMethod,{content:i.LocalPaymentSourceContent,getData:s}),edit:r.createElement(c.PaymentMethod,{content:i.LocalPaymentSourceContent,getData:s}),supports:{showSavedCards:!1,showSaveOption:!1,features:s("features")}})},3140:(e,t,n)=>{var r=n(3027),a=n(4222),o=n(1134),i=n(3539),c=n(3187),s=(0,o.getSettings)("stripe_grabpay_data");s()&&(0,a.registerPaymentMethod)({name:s("name"),label:r.createElement(c.PaymentMethodLabel,{title:s("title"),paymentMethod:s("name"),icons:s("icon")}),ariaLabel:"GrabPay",placeOrderButtonLabel:s("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(s),content:r.createElement(c.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:s,confirmationMethod:"confirmGrabPayPayment"}),edit:r.createElement(c.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:s}),supports:{showSavedCards:!1,showSaveOption:!1,features:s("features")}})},8522:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(3160);Object.keys(r).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===r[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}}))}));var a=n(3994);Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===a[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}}))}));var o=n(878);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))}))},3160:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.useAfterProcessLocalPayment=void 0;var a=r(n(7015)),o=r(n(9713)),i=r(n(6479)),c=r(n(8926)),s=n(3027),u=n(6664),l=n(1134);function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.useAfterProcessLocalPayment=function(e){var t=e.getData,n=e.billingData,r=e.eventRegistration,o=e.responseTypes,p=e.activePaymentMethod,f=e.confirmationMethod,m=e.getPaymentMethodArgs,y=void 0===m?function(){return{}}:m,g=(0,u.useStripe)(),v=r.onCheckoutAfterProcessingWithSuccess,h=r.onCheckoutAfterProcessingWithError,b=(0,s.useRef)(n),P=(0,s.useRef)(y);(0,s.useEffect)((function(){b.current=n}),[n]),(0,s.useEffect)((function(){P.current=y}),[y]),(0,s.useEffect)((function(){var e=v(function(){var e=(0,c.default)(a.default.mark((function e(n){var r,c,s,u,m,y,v;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.redirectUrl,t("name")!==p){e.next=18;break}if(e.prev=2,!(c=r.match(/#response=(.+)/))){e.next=12;break}return s=JSON.parse(window.atob(decodeURIComponent(c[1]))),u=s.client_secret,m=s.return_url,y=(0,i.default)(s,["client_secret","return_url"]),e.next=8,g[f](u,{payment_method:d({billing_details:(0,l.getBillingDetailsFromAddress)(b.current)},P.current()),return_url:m});case 8:if(!(v=e.sent).error){e.next=11;break}throw new l.StripeError(v.error);case 11:window.location=decodeURI(y.order_received_url);case 12:e.next=18;break;case 14:return e.prev=14,e.t0=e.catch(2),console.log(e.t0),e.abrupt("return",(0,l.ensureErrorResponse)(o,e.t0.error));case 18:case"end":return e.stop()}}),e,null,[[2,14]])})));return function(t){return e.apply(this,arguments)}}());return function(){return e()}}),[g,v,h])}},878:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.useCreateSource=void 0;var a=r(n(7015)),o=r(n(8926)),i=r(n(9713)),c=r(n(3038)),s=n(3027),u=n(1134),l=n(6664),p=n(3163);t.useCreateSource=function(e){var t=e.getData,n=e.billing,r=e.shippingAddress,d=e.onPaymentProcessing,f=e.responseTypes,m=e.getSourceArgs,y=void 0!==m&&m,g=e.element,v=void 0!==g&&g,h=(0,s.useState)(!1),b=(0,c.default)(h,2),P=b[0],E=b[1],O=(0,s.useState)(!1),S=(0,c.default)(O,2),w=S[0],_=S[1],C=(0,s.useRef)({billing:n,shippingAddress:r}),M=(0,l.useStripe)(),k=(0,l.useElements)();(0,s.useEffect)((function(){C.current={billing:n,shippingAddress:r}}));var j=(0,s.useCallback)((function(){var e=C.current.billing,n=e.cartTotal,r=e.currency,a=e.billingData,o=(0,u.getDefaultSourceArgs)({type:t("paymentType"),amount:n.value,billingData:a,currency:r.code,returnUrl:t("returnUrl")});return y&&(o=y(o,{billingData:a})),o}),[]),D=(0,s.useCallback)((function(e){return{meta:{paymentMethodData:(0,i.default)({},"".concat(t("name"),"_token_key"),e)}}}),[]);return(0,s.useEffect)((function(){var e=d((0,o.default)(a.default.mark((function e(){var t;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!P){e.next=2;break}return e.abrupt("return",(0,u.ensureSuccessResponse)(f,D(P.id)));case 2:if(e.prev=2,!v){e.next=11;break}if(w){e.next=6;break}throw(0,p.__)("Please enter your payment info before proceeding.","woo-stripe-payment");case 6:return e.next=8,M.createSource(k.getElement(v),j());case 8:t=e.sent,e.next=14;break;case 11:return e.next=13,M.createSource(j());case 13:t=e.sent;case 14:if(!t.error){e.next=16;break}throw new u.StripeError(t.error);case 16:return E(t.source),e.abrupt("return",(0,u.ensureSuccessResponse)(f,D(t.source.id)));case 20:return e.prev=20,e.t0=e.catch(2),console.log(e.t0),e.abrupt("return",(0,u.ensureErrorResponse)(f,e.t0.error||e.t0));case 24:case"end":return e.stop()}}),e,null,[[2,20]])}))));return function(){return e()}}),[P,d,M,f,v,w,_]),{setIsValid:_}}},3994:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.useValidateCheckout=void 0;var a=r(n(3038)),o=n(3027),i=n(1134),c=n(3163);t.useValidateCheckout=function(e){var t=e.subscriber,n=e.responseTypes,r=e.component,s=void 0===r?null:r,u=e.msg,l=void 0===u?(0,c.__)("Please enter your payment info before proceeding.","woo-stripe-payment"):u,p=(0,o.useState)(!1),d=(0,a.default)(p,2),f=d[0],m=d[1];return(0,o.useEffect)((function(){var e=t((function(){return!(s&&!f)||(0,i.ensureErrorResponse)(n,l)}));return function(){return e()}}),[t,f,m,n,s]),{isValid:f,setIsValid:m}}},9474:(e,t,n)=>{var r=n(3027),a=n(4222),o=n(1134),i=n(3539),c=n(3187),s=n(6664),u=(0,o.getSettings)("stripe_ideal_data");u()&&(0,a.registerPaymentMethod)({name:u("name"),label:r.createElement(c.PaymentMethodLabel,{title:u("title"),paymentMethod:u("name"),icons:u("icon")}),ariaLabel:"Ideal",placeOrderButtonLabel:u("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(u),content:r.createElement(c.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:u,confirmationMethod:"confirmIdealPayment",component:s.IdealBankElement}),edit:r.createElement(c.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:u}),supports:{showSavedCards:!1,showSaveOption:!1,features:u("features")}})},9738:(e,t,n)=>{n(5142),n(9474),n(3868),n(8641),n(3817),n(4494),n(4784),n(1192),n(7894),n(3766),n(4031),n(5176),n(3140),n(39),n(6480),n(4990),n(5748)},5142:(e,t,n)=>{var r=n(3027),a=n(4222),o=n(1134),i=n(3539),c=n(3187),s=n(3163),u=(0,o.getSettings)("stripe_klarna_data");u()&&(0,a.registerPaymentMethod)({name:u("name"),label:r.createElement(c.PaymentMethodLabel,{title:u("title"),paymentMethod:u("name"),icons:u("icon")}),ariaLabel:"Klarna",placeOrderButtonLabel:u("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(u,(function(e){var t=e.settings,n=e.billingData,r=e.cartTotals,a=n.country,o=r.currency_code,i=t("requiredParams");return[o]in i&&i[o].includes(a)})),content:r.createElement(c.PaymentMethod,{content:function(e){return r.createElement(r.Fragment,null,(0,o.isTestMode)()&&r.createElement("div",{className:"wc-stripe-klarna__testmode"},r.createElement("label",null,(0,s.__)("Test mode sms","woo-stripe-payment"),":"),"Â ",r.createElement("span",null,"123456")),r.createElement(i.LocalPaymentIntentContent,e))},getData:u,confirmationMethod:"confirmKlarnaPayment"}),edit:r.createElement(c.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:u}),supports:{showSavedCards:!1,showSaveOption:!1,features:u("features")}})},3539:(e,t,n)=>{var r=n(3027),a=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.LocalPaymentSourceContent=t.LocalPaymentIntentContent=t.canMakePayment=void 0;var o=a(n(7154)),i=a(n(9713)),c=a(n(6479)),s=n(3027),u=n(6664),l=n(1134),p=n(8522),d=n(3636);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){(0,i.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.canMakePayment=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return function(n){var r=n.billingData,a=n.cartTotals,o=(0,c.default)(n,["billingData","cartTotals"]),i=a.currency_code,s=r.country,u=e("countries"),p=e("allowedCountries"),d=e("features"),f=!1;if(e("isAdmin"))f=!0;else{if((0,l.cartContainsSubscription)()&&!d.includes("subscriptions"))return!1;if((0,l.cartContainsPreOrder)()&&!d.includes("pre-orders"))return!1;e("currencies").includes(i)&&(f="all_except"===p?!e("exceptCountries").includes(s):"specific"===p?e("specificCountries").includes(s):!(u.length>0)||u.includes(s)),t&&f&&(f=t(m({settings:e,billingData:r,cartTotals:a},o)))}return f}},t.LocalPaymentIntentContent=function(e){return r.createElement(u.Elements,{stripe:l.initStripe},r.createElement(g,e))},t.LocalPaymentSourceContent=function(e){return r.createElement(u.Elements,{stripe:l.initStripe},r.createElement(y,e))};var y=function(e){var t=e.getData,n=e.billing,a=e.shippingData,o=e.emitResponse,i=e.eventRegistration,c=e.getSourceArgs,s=void 0!==c&&c,u=e.element,l=void 0!==u&&u,d=a.shippingAddress,f=i.onPaymentProcessing,m=(i.onCheckoutAfterProcessingWithError,o.responseTypes),y=(o.noticeContexts,(0,p.useCreateSource)({getData:t,billing:n,shippingAddress:d,onPaymentProcessing:f,responseTypes:m,getSourceArgs:s,element:l}).setIsValid);return l?r.createElement(v,{name:t("name"),options:t("elementOptions"),onChange:function(e){y(e.complete)},element:l}):null},g=function(e){var t=e.getData,n=e.billing,a=e.emitResponse,o=e.eventRegistration,c=e.activePaymentMethod,l=e.confirmationMethod,f=void 0===l?null:l,m=e.component,y=void 0===m?null:m,g=e.callback,h=void 0===g?null:g,b=(0,u.useElements)(),P=n.billingData,E=o.onPaymentProcessing,O=o.onCheckoutAfterProcessingWithError,S=a.responseTypes,w=a.noticeContexts,_=(0,s.useCallback)((function(){return y?(0,i.default)({},t("paymentType"),b.getElement(y)):h?h():{}}),[b,h]),C=(0,p.useValidateCheckout)({subscriber:E,responseTypes:S,component:y}).setIsValid;return(0,p.useAfterProcessLocalPayment)({getData:t,billingData:P,eventRegistration:o,responseTypes:S,activePaymentMethod:c,confirmationMethod:f,getPaymentMethodArgs:_}),(0,d.useProcessCheckoutError)({responseTypes:S,subscriber:O,messageContext:w.PAYMENT}),y?r.createElement(v,{name:t("name"),options:t("elementOptions"),onChange:function(e){return C(!e.empty)},element:y,callback:h}):null},v=function(e){var t=e.name,n=e.onChange,a=e.element,i=e.options,s=(0,c.default)(e,["name","onChange","element","options"]),u=a;return r.createElement("div",{className:"wc-stripe-local-payment-container ".concat(t," ").concat(u.displayName)},r.createElement(u,(0,o.default)({options:i,onChange:n},s)))}},4784:(e,t,n)=>{var r=n(3027),a=n(4222),o=n(1134),i=n(3539),c=n(3187),s=(0,o.getSettings)("stripe_multibanco_data");s()&&(0,a.registerPaymentMethod)({name:s("name"),label:r.createElement(c.PaymentMethodLabel,{title:s("title"),paymentMethod:s("name"),icons:s("icon")}),ariaLabel:"MultiBanco",placeOrderButtonLabel:s("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(s),content:r.createElement(c.PaymentMethod,{content:i.LocalPaymentSourceContent,getData:s}),edit:r.createElement(c.PaymentMethod,{content:i.LocalPaymentSourceContent,getData:s}),supports:{showSavedCards:!1,showSaveOption:!1,features:s("features")}})},5748:(e,t,n)=>{var r=n(3027),a=n(4222),o=n(1134),i=n(3539),c=n(3187),s=(n(6664),(0,o.getSettings)("stripe_oxxo_data"));s()&&(0,a.registerPaymentMethod)({name:s("name"),label:r.createElement(c.PaymentMethodLabel,{title:s("title"),paymentMethod:s("name"),icons:s("icon")}),ariaLabel:"OXXO",placeOrderButtonLabel:s("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(s),content:r.createElement(c.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:s,confirmationMethod:"confirmOxxoPayment"}),edit:r.createElement(c.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:s}),supports:{showSavedCards:!1,showSaveOption:!1,features:s("features")}})},3868:(e,t,n)=>{var r=n(3027),a=n(4222),o=n(1134),i=n(3539),c=n(3187),s=n(6664),u=(0,o.getSettings)("stripe_p24_data");u()&&(0,a.registerPaymentMethod)({name:u("name"),label:r.createElement(c.PaymentMethodLabel,{title:u("title"),paymentMethod:u("name"),icons:u("icon")}),ariaLabel:"P24",placeOrderButtonLabel:u("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(u),content:r.createElement(c.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:u,confirmationMethod:"confirmP24Payment",component:s.P24BankElement}),edit:r.createElement(c.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:u}),supports:{showSavedCards:!1,showSaveOption:!1,features:u("features")}})},1192:(e,t,n)=>{var r=n(3027),a=n(5318),o=a(n(9713)),i=a(n(6479)),c=n(4222),s=n(1134),u=n(3539),l=n(3187),p=n(6664);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var m,y=(0,s.getSettings)("stripe_sepa_data"),g=(m=l.PaymentMethod,function(e){var t=e.getData,n=(0,i.default)(e,["getData"]);return r.createElement(r.Fragment,null,r.createElement(m,f(f({},n),{},{getData:t})),r.createElement("div",{className:"wc-stripe-blocks-sepa__mandate"},t("mandate")))});y()&&(0,c.registerPaymentMethod)({name:y("name"),label:r.createElement(l.PaymentMethodLabel,{title:y("title"),paymentMethod:y("name"),icons:y("icon")}),ariaLabel:"SEPA",placeOrderButtonLabel:y("placeOrderButtonLabel"),canMakePayment:(0,u.canMakePayment)(y),content:r.createElement(g,{content:u.LocalPaymentSourceContent,getData:y,element:p.IbanElement,getSourceArgs:function(e,t){var n=t.billingData;return e.mandate={notification_method:n.email?"email":"manual",interval:(0,s.cartContainsSubscription)()||(0,s.cartContainsPreOrder)()?"scheduled":"one_time"},"scheduled"===e.mandate.interval&&delete e.amount,e}}),edit:r.createElement(u.LocalPaymentSourceContent,{getData:y}),supports:{showSavedCards:!1,showSaveOption:!1,features:y("features")}})},7894:(e,t,n)=>{var r=n(3027),a=n(5318)(n(9713)),o=n(4222),i=n(1134),c=n(3539),s=n(3187);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){(0,a.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var p=(0,i.getSettings)("stripe_sofort_data");p()&&(0,o.registerPaymentMethod)({name:p("name"),label:r.createElement(s.PaymentMethodLabel,{title:p("title"),paymentMethod:p("name"),icons:p("icon")}),ariaLabel:"Sofort",placeOrderButtonLabel:p("placeOrderButtonLabel"),canMakePayment:(0,c.canMakePayment)(p),content:r.createElement(s.PaymentMethod,{content:c.LocalPaymentSourceContent,getData:p,getSourceArgs:function(e,t){var n=t.billingData;return l(l({},e),{},{sofort:{country:n.country}})}}),edit:r.createElement(s.PaymentMethod,{content:c.LocalPaymentSourceContent,getData:p}),supports:{showSavedCards:!1,showSaveOption:!1,features:p("features")}})},3766:(e,t,n)=>{var r=n(3027),a=n(5318),o=a(n(7015)),i=a(n(8926)),c=a(n(9713)),s=a(n(3038)),u=n(3027),l=n(4222),p=n(1134),d=n(3187),f=n(3539),m=n(6664),y=n(8522),g=n(3163),v=n(3636),h=(0,p.getSettings)("stripe_wechat_data"),b=function(e){return r.createElement(m.Elements,{stripe:p.initStripe},r.createElement(P,e))},P=function(e){var t=e.getData,n=e.billing,a=(e.shippingData,e.emitResponse),o=e.eventRegistration,i=e.components,c=parseInt(t("qrSize")),s=a.responseTypes,l=o.onPaymentProcessing,d=o.onCheckoutAfterProcessingWithSuccess,f=i.ValidationInputError,m=(0,y.useValidateCheckout)({subscriber:o.onPaymentProcessing,responseTypes:a.responseTypes,msg:(0,g.__)("Please scan your QR code to continue with payment.","woo-stripe-payment")}),v=(m.isValid,m.setIsValid),h=O({getData:t,billing:n,responseTypes:s,subscriber:l}),b=h.source,P=h.error,S=h.deleteSourceFromStorage;return(0,u.useEffect)((function(){var e=d((function(){return S(),(0,p.ensureSuccessResponse)(s)}));return function(){return e()}}),[b,d,S]),(0,u.useEffect)((function(){b&&v(!0)}),[b]),b?r.createElement(E,{text:b.wechat.qr_code_url,width:c,height:c}):P?r.createElement("div",{className:"wechat-validation-error"},r.createElement(f,{errorMessage:(0,p.getErrorMessage)(P)})):(0,p.isAddressValid)(n.billingData)?null:(0,g.__)("Please fill out all the required fields in order to complete the WeChat payment.","woo-stripe-payment")},E=function(e){var t=e.text,n=e.width,a=void 0===n?128:n,o=e.height,i=void 0===o?128:o,c=e.colorDark,s=void 0===c?"#424770":c,l=e.colorLight,d=void 0===l?"#f8fbfd":l,f=e.correctLevel,m=void 0===f?QRCode.CorrectLevel.H:f,y=(0,u.useRef)();return(0,u.useEffect)((function(){new QRCode(y.current,{text:t,width:a,height:i,colorDark:s,colorLight:d,correctLevel:m})}),[y]),r.createElement(r.Fragment,null,r.createElement("div",{id:"wc-stripe-block-qrcode",ref:y}),(0,p.isTestMode)()&&r.createElement("p",null,(0,g.__)("Test mode: Click the Place Order button to proceed.","woo-stripe-payment")),!(0,p.isTestMode)()&&r.createElement("p",null,(0,g.__)("Scan the QR code using your WeChat app. Once scanned click the Place Order button.","woo-stripe-payment")))},O=function(e){var t=e.getData,n=e.billing,r=e.responseTypes,a=e.subscriber,l=(0,m.useStripe)(),d=(0,v.useStripeError)(),f=(0,s.default)(d,2),y=f[0],g=f[1],h=(0,u.useState)((0,p.getFromCache)("wechat:source")),b=(0,s.default)(h,2),P=b[0],E=b[1],O=(0,u.useRef)(null),S=n.cartTotal,w=n.billingData,_=n.currency;(0,u.useEffect)((function(){var e=a((function(){return(0,p.ensureSuccessResponse)(r,{meta:{paymentMethodData:(0,c.default)({},"".concat(t("name"),"_token_key"),P.id)}})}));return function(){return e()}}),[P,a]);var C=(0,u.useCallback)((0,i.default)(o.default.mark((function e(){var n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,y||!(0,p.isAddressValid)(w)){e.next=9;break}return e.next=4,l.createSource((0,p.getDefaultSourceArgs)({type:t("paymentType"),amount:S.value,billingData:w,currency:_.code,returnUrl:t("returnUrl")}));case 4:if(!(n=e.sent).error){e.next=7;break}throw new p.StripeError(n.error);case 7:E(n.source),(0,p.storeInCache)("wechat:source",n.source);case 9:e.next=15;break;case 11:e.prev=11,e.t0=e.catch(0),console.log("error: ",e.t0),g(e.t0.error);case 15:case"end":return e.stop()}}),e,null,[[0,11]])}))),[l,P,S.value,w,_,y]),M=(0,u.useCallback)((function(){(0,p.deleteFromCache)("wechat:source")}),[]);return(0,u.useEffect)((function(){l&&!P&&(clearTimeout(O.current),O.current=setTimeout(C,1e3))}),[l,P,C]),{source:P,setSource:E,error:y,deleteSourceFromStorage:M}};h()&&(0,l.registerPaymentMethod)({name:h("name"),label:r.createElement(d.PaymentMethodLabel,{title:h("title"),paymentMethod:h("name"),icons:h("icon")}),ariaLabel:"WeChat",canMakePayment:(0,f.canMakePayment)(h),content:r.createElement(d.PaymentMethod,{content:b,getData:h}),edit:r.createElement(d.PaymentMethod,{content:b,getData:h}),supports:{showSavedCards:!1,showSaveOption:!1,features:h("features")}})},5180:(e,t,n)=>{n(3139),n(3726)},3726:(e,t,n)=>{var r=n(3027),a=n(5318),o=a(n(3038)),i=a(n(6479)),c=n(3027),s=n(4222),u=n(1134),l=n(3636),p=n(6664),d=(0,u.getSettings)("stripe_payment_request_data"),f=function(e){return r.createElement("div",{className:"wc-stripe-payment-request-container"},r.createElement(p.Elements,{stripe:u.initStripe},r.createElement(m,e)))},m=function(e){var t=e.getData,n=e.onClick,a=e.onClose,s=e.billing,u=e.shippingData,d=e.eventRegistration,f=e.emitResponse,m=e.onSubmit,y=e.activePaymentMethod,g=((0,i.default)(e,["getData","onClick","onClose","billing","shippingData","eventRegistration","emitResponse","onSubmit","activePaymentMethod"]),d.onPaymentProcessing),v=f.responseTypes,h=f.noticeContexts,b=(0,p.useStripe)(),P=(0,l.useStripeError)(),E=(0,o.default)(P,1)[0],O=(0,l.useExportedValues)();(0,l.useExpressBreakpointWidth)({payment_method:t("name"),width:300});var S=(0,l.useProcessPaymentIntent)({getData:t,billing:s,shippingData:u,onPaymentProcessing:g,emitResponse:f,error:E,onSubmit:m,activePaymentMethod:y,exportedValues:O}).setPaymentMethod;(0,l.useAfterProcessingPayment)({getData:t,eventRegistration:d,responseTypes:v,activePaymentMethod:y,messageContext:h.EXPRESS_PAYMENTS});var w=(0,l.usePaymentRequest)({getData:t,onClose:a,stripe:b,billing:s,shippingData:u,eventRegistration:d,setPaymentMethod:S,exportedValues:O,canPay:function(e){return null!=e&&!e.applePay}}).paymentRequest,_=(0,c.useMemo)((function(){return{paymentRequest:w,style:{paymentRequestButton:t("paymentRequestButton")}}}),[w]);return w?r.createElement(p.PaymentRequestButtonElement,{options:_,onClick:n}):null},y=function(e){e.getData,(0,i.default)(e,["getData"]);var t=(0,c.useRef)();return(0,c.useEffect)((function(){var e=window.devicePixelRatio;t.current.width=20*e,t.current.height=20*e;var n=t.current.getContext("2d");n.scale(e,e),n.beginPath(),n.arc(10,10,10,0,2*Math.PI),n.fillStyle="#986fff",n.fill()})),r.createElement("div",{className:"payment-request-block-editor"},r.createElement("div",{className:"icon-container"},r.createElement("span",null,"Buy now"),r.createElement("canvas",{className:"PaymentRequestButton-icon",ref:t}),r.createElement("i",{className:"payment-request-arrow"})))};(0,s.registerExpressPaymentMethod)({name:d("name"),canMakePayment:function(e){var t=e.cartTotals;if(d("isAdmin"))return!0;var n=t.currency_code,r=t.total_price;return(0,u.canMakePayment)({country:d("countryCode"),currency:n.toLowerCase(),total:{label:d("totalLabel"),amount:parseInt(r)}},(function(e){return null!=e&&!e.applePay}))},content:r.createElement(f,{getData:d}),edit:r.createElement(y,{getData:d}),supports:{showSavedCards:d("showSavedCards"),showSaveOption:d("showSaveOption"),features:d("features")}})},1065:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(7015)),o=r(n(8926)),i=n(3027),c=n(1134);t.default=function(e){var t=e.eventRegistration,n=e.emitResponse,r=e.getData,s=t.onCheckoutAfterProcessingWithSuccess,u=n.responseTypes,l=(0,i.useCallback)(function(){var e=(0,o.default)(a.default.mark((function e(t){var n,o;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.redirectUrl,e.next=3,c.initStripe;case 3:return o=e.sent,e.next=6,(0,c.handleCardAction)({redirectUrl:n,getData:r,stripe:o,responseTypes:u});case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[s]);return(0,i.useEffect)((function(){var e=s(l);return function(){return e()}}),[s]),null}},1134:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.isCheckoutPage=t.isCartPage=t.versionCompare=t.deleteFromCache=t.getFromCache=t.storeInCache=t.isTestMode=t.getDefaultSourceArgs=t.cartContainsSubscription=t.cartContainsPreOrder=t.getLocalPaymentMethods=t.registerLocalPaymentMethod=t.canMakePayment=t.getDisplayItems=t.getShippingOptionId=t.getShippingOptions=t.formatPrice=t.filterEmptyValues=t.getIntermediateAddress=t.toCartAddress=t.handleCardAction=t.isUserLoggedIn=t.hasShippingRates=t.getSelectedShippingOption=t.isFieldRequired=t.getLocaleFields=t.isAddressValid=t.removeNumberPrecision=t.isEmpty=t.StripeError=t.getSettings=t.getBillingDetailsFromAddress=t.getErrorMessage=t.ensureErrorResponse=t.ensureSuccessResponse=t.getRoute=t.getCreditCardForm=t.registerCreditCardForm=t.initStripe=void 0;var a=r(n(319)),o=r(n(7015)),i=r(n(8926)),c=r(n(3038)),s=r(n(8)),u=r(n(4575)),l=r(n(2205)),p=r(n(8585)),d=r(n(9754)),f=r(n(5957)),m=r(n(9713)),y=r(n(6479)),g=n(4465),v=n(2492),h=r(n(7606)),b=n(8419);function P(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return E(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?E(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,c=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){c=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(c)throw o}}}}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function S(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach((function(t){(0,m.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var w=(0,v.getSetting)("stripeGeneralData"),_=w.publishableKey,C=w.account,M=(0,v.getSetting)("stripeErrorMessages"),k=(0,v.getSetting)("countryLocale",{}),j=/^([\w]+)\:(.+)$/,D=(0,v.getSetting)("stripeGeneralData").routes,R={},x=[],A={recipient:function(e,t){return e.first_name=t.split(" ").slice(0,-1).join(" "),e.last_name=t.split(" ").pop(),e},payerName:function(e,t){return e.first_name=t.split(" ").slice(0,-1).join(" "),e.last_name=t.split(" ").pop(),e},country:"country",addressLine:function(e,t){return t[0]&&(e.address_1=t[0]),t[1]&&(e.address_2=t[1]),e},line1:"address_1",line2:"address_2",city:"city",region:"state",state:"state",postalCode:"postcode",postal_code:"postcode",payerEmail:"email",payerPhone:"phone"},I=new Promise((function(e,t){(0,g.loadStripe)(_,C?{stripeAccount:C}:{}).then((function(t){e(t)})).catch((function(t){e({error:t})}))}));t.initStripe=I,t.registerCreditCardForm=function(e){var t=e.id,n=(0,y.default)(e,["id"]);R[t]=n},t.getCreditCardForm=function(e){return R.hasOwnProperty(e)?R[e]:{}};var L=function(e){return null!=D&&D[e]?D[e]:console.log("".concat(e," is not a valid route"))};t.getRoute=L;var T=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return S({type:e.SUCCESS},t)};t.ensureSuccessResponse=T;var N=function(e,t){return{type:e.ERROR,message:B(t)}};t.ensureErrorResponse=N;var B=function(e){return"string"==typeof e?e:null!=e&&e.code&&null!=M&&M[e.code]?M[e.code]:null!=e&&e.statusCode?null!=M&&M[e.statusCode]?M[e.statusCode]:e.statusMessage:e.message};t.getErrorMessage=B;var F=function(e){var t={name:"".concat(e.first_name," ").concat(e.last_name),address:{city:e.city||null,country:e.country||null,line1:e.address_1||null,line2:e.address_2||null,postal_code:e.postcode||null,state:e.state||null}};return null!=e&&e.phone&&(t.phone=e.phone),null!=e&&e.email&&(t.email=e.email),t};t.getBillingDetailsFromAddress=F,t.getSettings=function(e){return function(t){return t?(0,v.getSetting)(e)[t]:(0,v.getSetting)(e)}};var q=function(e){(0,l.default)(a,e);var t,n,r=(t=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=(0,d.default)(t);if(n){var a=(0,d.default)(this).constructor;e=Reflect.construct(r,arguments,a)}else e=r.apply(this,arguments);return(0,p.default)(this,e)});function a(e){var t;return(0,u.default)(this,a),(t=r.call(this,e.message)).error=e,t}return a}((0,f.default)(Error));t.StripeError=q;var X=function(e){return"string"==typeof e?0==e.length||""==e:Array.isArray(e)?0==array.length:"object"!==(0,s.default)(e)||0==Object.keys(e).length};t.isEmpty=X,t.removeNumberPrecision=function(e,t){return e/Math.pow(10,t)},t.isAddressValid=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=V(e.country),r=0,a=Object.entries(e);r<a.length;r++){var o=(0,c.default)(a[r],2),i=o[0],s=o[1];if(!t.includes(i)&&null!=n&&n[i]&&n[i].required&&X(s))return!1}return!0};var V=function(e){var t=S({},k.default);return e&&null!=k&&k[e]&&(t=Object.entries(k[e]).reduce((function(e,t){var n=(0,c.default)(t,2),r=n[0],a=n[1];return e[r]=S(S({},e[r]),a),e}),t),["phone","email"].forEach((function(e){var n=document.getElementById(e);n&&(t[e]={required:n.required})}))),t};t.getLocaleFields=V,t.isFieldRequired=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=V(t);return[e]in n&&n[e].required},t.getSelectedShippingOption=function(e){var t=e.match(j);if(t){var n=t[1];return[t[2],n]}return[]},t.hasShippingRates=function(e){return e.map((function(e){return e.shipping_rates.length>0})).filter(Boolean).length>0},t.isUserLoggedIn=function(e){return e>0};var U=function(){var e=(0,i.default)(o.default.mark((function e(t,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,h.default)({url:D["sync/intent"],method:"POST",data:{order_id:t,client_secret:n}});case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.log(e.t0);case 8:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(t,n){return e.apply(this,arguments)}}(),W=function(){var e=(0,i.default)(o.default.mark((function e(t){var n,r,a,i,c,s,u,l,p,d,f,y,g,v;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.redirectUrl,r=t.responseTypes,a=t.stripe,i=t.getData,c=t.savePaymentMethod,s=void 0!==c&&c,e.prev=1,!(u=n.match(/#response=(.+)/))){e.next=20;break}return l=JSON.parse(window.atob(decodeURIComponent(u[1]))),p=l.client_secret,d=l.order_id,f=l.order_key,e.next=7,a.handleCardAction(p);case 7:if(!(y=e.sent).error){e.next=11;break}return U(d,p),e.abrupt("return",N(r,y.error));case 11:return g=(0,m.default)({order_id:d,order_key:f},"".concat(i("name"),"_save_source_key"),s),e.next=14,(0,h.default)({url:L("process/payment"),method:"POST",data:g});case 14:if(!(v=e.sent).messages){e.next=17;break}return e.abrupt("return",N(r,v.messages));case 17:return e.abrupt("return",T(r,{redirectUrl:v.redirect}));case 20:return e.abrupt("return",T(r));case 21:e.next=27;break;case 23:return e.prev=23,e.t0=e.catch(1),console.log(e.t0),e.abrupt("return",N(r,e.t0));case 27:case"end":return e.stop()}}),e,null,[[1,23]])})));return function(t){return e.apply(this,arguments)}}();t.handleCardAction=W,t.toCartAddress=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:A;return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={};t=S(S({},t),Y(n));for(var a=0,o=Object.entries(e);a<o.length;a++){var i,s=(0,c.default)(o[a],2),u=s[0],l=s[1];null!==(i=t)&&void 0!==i&&i[u]&&("function"==typeof l?l(r,t[u]):r[l]=t[u])}return r}},t.getIntermediateAddress=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["city","postcode","state","country"],r={},a=P(n);try{for(a.s();!(t=a.n()).done;){var o=t.value;r[o]=e[o]}}catch(e){a.e(e)}finally{a.f()}return r};var Y=function(e){return Object.keys(e).filter((function(t){return Boolean(e[t])})).reduce((function(t,n){return S(S({},t),{},(0,m.default)({},n,e[n]))}),{})};t.filterEmptyValues=Y;var G=function(e,t){var n,r=(0,b.getCurrency)(t),a=r.prefix,o=r.suffix,i=r.decimalSeparator,c=r.minorUnit,s=r.thousandSeparator;if(""==e||void 0===e)return e;e="string"==typeof e?parseInt(e,10):e;var u="",l=(e=(e/=Math.pow(10,c)).toString().replace(".",i)).indexOf(i);l<0?c>0&&(e+="".concat(i).concat(new Array(c+1).join("0"))):(u=e.substr(l+1)).length<c&&(e+=new Array(c-u.length+1).join("0"));var p=e.match(new RegExp("(\\d+)\\".concat(i,"(\\d+)")));return p&&(e=p[1],u=p[2]),e=e.replace(new RegExp("\\B(?=(\\d{3})+(?!\\d))","g"),"".concat(s)),a+(e=(null===(n=u)||void 0===n?void 0:n.length)>0?e+i+u:e)+o};t.formatPrice=G,t.getShippingOptions=function(e){var t=[];return e.forEach((function(e,n){e.shipping_rates.sort((function(e){return e.selected?-1:1}));var r=e.shipping_rates.map((function(e){var t=document.createElement("textarea");return t.innerHTML=e.name,G(e.price,e.currency_code),{id:H(n,e.rate_id),label:t.value,amount:parseInt(e.price,10)}}));t=[].concat((0,a.default)(t),(0,a.default)(r))})),t};var H=function(e,t){return"".concat(e,":").concat(t)};t.getShippingOptionId=H,t.getDisplayItems=function(e,t){t.minorUnit;var n=[],r=["total_tax","total_shipping"];return e.forEach((function(e){(0<e.value||e.key&&r.includes(e.key))&&n.push({label:e.label,pending:!1,amount:e.value})})),n};var z={};t.canMakePayment=function(e,t){var n=e.country,r=e.currency,a=e.total;return new Promise((function(e,o){var i=[n,r,a.amount].reduce((function(e,t){return"".concat(e,"-").concat(t)}));return r?i in z?e(z[i]):I.then((function(c){if(c.error)return o(c.error);c.paymentRequest({country:n,currency:r,total:a}).canMakePayment().then((function(n){return z[i]=t(n),e(z[i])}))})).catch(o):e(!1)}))},t.registerLocalPaymentMethod=function(e){x.push(e)},t.getLocalPaymentMethods=function(){return x},t.cartContainsPreOrder=function(){var e=(0,v.getSetting)("stripePaymentData");return e&&e.pre_order},t.cartContainsSubscription=function(){var e=(0,v.getSetting)("stripePaymentData");return e&&e.subscription},t.getDefaultSourceArgs=function(e){var t=e.type,n=e.amount,r=e.billingData,a=e.currency,o=e.returnUrl;return{type:t,amount:n,currency:a,owner:F(r),redirect:{return_url:o}}},t.isTestMode=function(){return"test"===(0,v.getSetting)("stripeGeneralData").mode};var J=function(e){return"".concat("stripe:").concat(e)};t.storeInCache=function(e,t){var n=Math.floor((new Date).getTime()/1e3)+900;"sessionStorage"in window&&sessionStorage.setItem(J(e),JSON.stringify({value:t,exp:n}))},t.getFromCache=function(e){if("sessionStorage"in window)try{var t=JSON.parse(sessionStorage.getItem(J(e)));if(t){var n=t.value,r=t.exp;if(!(Math.floor((new Date).getTime()/1e3)>r))return n;Q(J(e))}}catch(e){}return null};var Q=function(e){"sessionStorage"in window&&sessionStorage.removeItem(J(e))};t.deleteFromCache=Q,t.versionCompare=function(e,t,n){switch(n){case"<":return e<t;case">":return e>t;case"<=":return e<=t;case">=":return e>=t;case"=":return e==t}return!1},t.isCartPage=function(){return"cart"===(0,v.getSetting)("stripeGeneralData").page},t.isCheckoutPage=function(){return"checkout"===(0,v.getSetting)("stripeGeneralData").page}},4184:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function a(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var o=typeof n;if("string"===o||"number"===o)e.push(n);else if(Array.isArray(n)&&n.length){var i=a.apply(null,n);i&&e.push(i)}else if("object"===o)for(var c in n)r.call(n,c)&&n[c]&&e.push(c)}}return e.join(" ")}e.exports?(a.default=a,e.exports=a):void 0===(n=function(){return a}.apply(t,[]))||(e.exports=n)}()},1127:()=>{},7776:()=>{},4836:()=>{},85:()=>{},3110:()=>{},8356:()=>{},5773:()=>{},9509:()=>{},3139:()=>{}}]);
|
3 |
Â
//# sourceMappingURL=commons.js.map
|
packages/blocks/build/commons.js.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"sources":["webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/arrayLikeToArray.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/arrayWithHoles.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/assertThisInitialized.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/asyncToGenerator.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/classCallCheck.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/construct.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/createClass.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/defineProperty.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/extends.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/getPrototypeOf.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/inherits.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/interopRequireDefault.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/isNativeFunction.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/iterableToArray.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/nonIterableRest.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/nonIterableSpread.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/objectWithoutProperties.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/setPrototypeOf.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/slicedToArray.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/toConsumableArray.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/typeof.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/wrapNativeSuper.js","webpack://wc_stripe.[name]/./node_modules/@stripe/react-stripe-js/dist/react-stripe.umd.js","webpack://wc_stripe.[name]/./node_modules/@stripe/stripe-js/dist/stripe.esm.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/components/checkout/checkbox/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/components/checkout/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/components/checkout/payment-method-label/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/components/checkout/payment-method/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/components/checkout/radio-control-accordion/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/components/checkout/radio-option/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/ach/hooks/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/ach/hooks/use-create-link-token.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/ach/hooks/use-initialize-plaid.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/ach/hooks/use-process-payment.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/ach/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/ach/payment-method.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/applepay/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/applepay/payment-method.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/credit-card/components/bootstrap/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/credit-card/components/custom-card-form.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/credit-card/components/simple/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/credit-card/components/stripe-card-form.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/credit-card/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/credit-card/payment-method.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/error-boundary.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/googlepay/button.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/googlepay/constants.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/googlepay/hooks/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/googlepay/hooks/use-error-message.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/googlepay/hooks/use-payment-request.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/googlepay/hooks/use-payments-client.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/googlepay/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/googlepay/payment-method.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/googlepay/util.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/hooks/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/hooks/use-after-process-payment.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/hooks/use-breakpoint-width.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/hooks/use-exported-values.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/hooks/use-payment-events.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/hooks/use-payment-request.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/hooks/use-process-checkout-error.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/hooks/use-process-payment-intent.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/hooks/use-setup-intent.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/hooks/use-stripe-error.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/afterpay.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/alipay.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/bancontact.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/becs.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/boleto.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/eps.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/fpx.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/giropay.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/grabpay.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/hooks/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/hooks/use-after-process-local-payment.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/hooks/use-create-source.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/hooks/use-validate-checkout.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/ideal.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/klarna/categories.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/klarna/hooks/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/klarna/hooks/use-create-source.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/klarna/hooks/use-process-payment.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/klarna/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/klarna/loader.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/local-payment-method.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/multibanco.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/oxxo.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/p24.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/sepa.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/sofort.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/wechat.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/payment-request/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/payment-request/payment-method.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/saved-card-component.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/util.js","webpack://wc_stripe.[name]/./node_modules/classnames/index.js"],"names":["module","exports","arr","len","length","i","arr2","Array","isArray","arrayLikeToArray","self","ReferenceError","asyncGeneratorStep","gen","resolve","reject","_next","_throw","key","arg","info","value","error","done","Promise","then","fn","this","args","arguments","apply","err","undefined","instance","Constructor","TypeError","setPrototypeOf","isNativeReflectConstruct","_construct","Parent","Class","Reflect","construct","a","push","Function","bind","prototype","_defineProperties","target","props","descriptor","enumerable","configurable","writable","Object","defineProperty","protoProps","staticProps","obj","_extends","assign","source","hasOwnProperty","call","_getPrototypeOf","o","getPrototypeOf","__proto__","subClass","superClass","create","constructor","__esModule","toString","indexOf","sham","Proxy","Date","e","iter","Symbol","iterator","from","_arr","_n","_d","_e","_s","_i","next","objectWithoutPropertiesLoose","excluded","getOwnPropertySymbols","sourceSymbolKeys","propertyIsEnumerable","sourceKeys","keys","_typeof","assertThisInitialized","_setPrototypeOf","p","arrayWithHoles","iterableToArrayLimit","unsupportedIterableToArray","nonIterableRest","arrayWithoutHoles","iterableToArray","nonIterableSpread","minLen","n","slice","name","test","isNativeFunction","_wrapNativeSuper","_cache","Map","has","get","set","Wrapper","React","_objectWithoutProperties","_objectWithoutPropertiesLoose","_slicedToArray","_arrayWithHoles","_iterableToArrayLimit","_arrayLikeToArray","_unsupportedIterableToArray","_nonIterableRest","emptyFunction","emptyFunctionWithReset","resetWarningCache","propTypes","shim","propName","componentName","location","propFullName","secret","Error","getShim","isRequired","ReactPropTypes","array","bool","func","number","object","string","symbol","any","arrayOf","element","elementType","instanceOf","node","objectOf","oneOf","oneOfType","shape","exact","checkPropTypes","PropTypes","factoryWithThrowingShims","isUnknownObject","raw","PLAIN_OBJECT_STR","isEqual","left","right","leftArray","leftPlainObject","leftKeys","rightKeys","keySet","allKeys","l","r","every","usePrevious","ref","useRef","useEffect","current","validateStripe","maybeStripe","elements","createToken","createPaymentMethod","confirmCardPayment","parseStripeProp","isPromise","tag","stripePromise","stripe","ElementsContext","createContext","displayName","Elements","_ref","rawStripeProp","options","children","_final","isMounted","parsed","useMemo","_React$useState2","useState","ctx","setContext","prevStripe","prevOptions","console","warn","anyStripe","_registerWrapper","version","createElement","Provider","useElementsContextWithUseCase","useCaseMessage","useCase","concat","parseElementsContext","useContext","ElementsConsumer","_ref2","useCallbackReference","cb","extractUpdateableOptions","paymentRequest","noop","createElementComponent","type","isServer","str","charAt","toUpperCase","Element","id","className","_ref$options","_ref$onBlur","onBlur","_ref$onFocus","onFocus","_ref$onReady","onReady","_ref$onChange","onChange","_ref$onEscape","onEscape","_ref$onClick","onClick","elementRef","domNode","callOnReady","callOnBlur","callOnFocus","callOnClick","callOnChange","callOnEscape","useLayoutEffect","mount","on","updateableOptions","update","destroy","__elementType","window","AuBankAccountElement","CardElement","CardNumberElement","CardExpiryElement","CardCvcElement","FpxBankElement","IbanElement","IdealBankElement","P24BankElement","EpsBankElement","PaymentRequestButtonElement","AfterpayClearpayMessageElement","useElements","useStripe","factory","V3_URL","V3_URL_REGEX","EXISTING_SCRIPT_MESSAGE","initStripe","startTime","registerWrapper","stripePromise$1","params","Stripe","script","scripts","document","querySelectorAll","src","findScript","queryString","advancedFraudSignals","headOrBody","head","body","appendChild","injectScript","addEventListener","loadCalled","loadStripe","_len","_key","now","label","checked","aria-hidden","xmlns","viewBox","d","title","icons","paymentMethod","components","Label","PaymentMethodLabel","Icons","PaymentMethodIcons","text","align","getData","content","Content","desc","el","childNodes","classList","add","Description","payment_method","RadioControlAccordion","option","RadioControlOption","event","setValidationError","linkToken","setLinkToken","useCallback","url","getRoute","method","data","response","token","storeInCache","getFromCache","linkHandler","resolvePopup","openLinkPopup","open","Plaid","clientName","env","product","selectAccount","countryCodes","onSuccess","publicToken","metaData","onExit","getErrorMessage","error_message","onPaymentProcessing","responseTypes","unsubscribe","result","deleteFromCache","ensureSuccessResponse","meta","paymentMethodData","JSON","stringify","ensureErrorResponse","getSettings","ACHPaymentContent","eventRegistration","emitResponse","onSubmit","onCheckoutAfterProcessingWithError","ValidationInputError","validationError","useCreateLinkToken","useProcessCheckoutError","subscriber","useInitializePlaid","useProcessPayment","isTestMode","ACHTestModeCredentials","errorMessage","__","registerPaymentMethod","ariaLabel","canMakePayment","cartTotals","currency_code","PaymentMethod","savedTokenComponent","edit","placeOrderButtonLabel","supports","showSavedCards","showSaveOption","features","ApplePayContent","ApplePayButton","onClose","billing","shippingData","activePaymentMethod","noticeContexts","useStripeError","exportedValues","useExportedValues","useExpressBreakpointWidth","width","setPaymentMethod","useProcessPaymentIntent","useAfterProcessingPayment","messageContext","EXPRESS_PAYMENTS","usePaymentRequest","canPay","applePay","handleClick","show","style","ApplePayEdit","registerExpressPaymentMethod","currency","total_price","country","toLowerCase","total","amount","parseInt","Bootstrap","CardIcon","htmlFor","registerCreditCardForm","breakpoint","component","classes","focus","empty","invalid","eventChange","cardType","setCardType","elementOrder","container","setContainer","getCreditCardForm","CardForm","postalCodeEnabled","forEach","setElementOrder","includes","useBreakpointWidth","getCardIconSrc","cloneElement","brand","complete","idx","nextElement","getElement","sprintf","SimpleForm","data-tid","cardOptions","postalCode","billingData","postcode","hidePostalCode","isFieldRequired","iconStyle","displaySaveCard","customerId","isUserLoggedIn","cartContainsSubscription","cartContainsPreOrder","CreditCardContent","setError","catch","CreditCardElement","savePaymentMethod","setSavePaymentMethod","getPaymentMethodArgs","elType","card","useSetupIntent","cartTotal","setupIntent","removeSetupIntent","Tag","CustomCardForm","StripeCardForm","SavePaymentMethod","state","hasError","errorInfo","setState","componentStack","Component","publishableKey","setErrorMessage","checkoutStatus","merchantInfo","merchantId","merchantName","buttonContainer","buttonType","usePaymentsClient","button","removeButton","append","parameters","allowedAuthMethods","allowedCardNetworks","assuranceDetailsRequired","apiVersion","apiVersionMinor","shippingRates","processingCountry","totalPriceLabel","emailRequired","isEmpty","email","allowedPaymentMethods","tokenizationSpecification","gateway","BASE_PAYMENT_METHOD","shippingAddressRequired","needsShipping","transactionInfo","getTransactionInfo","callbackIntents","BASE_PAYMENT_REQUEST","billingAddressRequired","billingAddressParameters","format","phoneNumberRequired","phone","shippingOptionRequired","shippingOptionParameters","getShippingOptionParameters","shippingOptions","cartTotalItems","environment","paymentsClient","setPaymentsClient","setButton","currentBilling","currentShipping","addPaymentEvent","usePaymentEvents","setAddressData","paymentData","billingAddress","isAddressValid","phoneNumber","toCartAddress","shippingAddress","parentElement","firstChild","removeChild","loadPaymentData","parse","tokenizationData","billing_details","getBillingDetailsFromAddress","StripeError","statusCode","log","createButton","paymentOptions","paymentDataCallbacks","onPaymentAuthorized","transactionState","onPaymentDataChanged","shipping","address","shippingOptionData","intermediateAddress","selectedRates","getSelectedShippingOption","addressEqual","getIntermediateAddress","shippingEqual","success","getPaymentRequestUpdate","reason","message","intent","setShippingAddress","setSelectedRates","google","payments","api","PaymentsClient","isReadyToPayRequest","isReadyToPay","GooglePayContent","useErrorMessage","GooglePayEdit","isCartPage","getSetting","status","countryCode","currencyCode","code","totalPriceStatus","totalPrice","removeNumberPrecision","minorUnit","displayItems","getDisplayItems","newTransactionInfo","newShippingOptionParameters","unit","items","item","price","getShippingOptions","defaultSelectedOptionId","map","shift","shippingPackage","shipping_rates","rate","selected","getShippingOptionId","rate_id","rates","txt","innerHTML","formatPrice","description","first_name","split","join","last_name","pop","address1","address2","locality","administrativeArea","onCheckoutAfterProcessingWithSuccess","unsubscribeAfterProcessingWithSuccess","redirectUrl","handleCardAction","innerWidth","windowWidth","setWindowWith","getMaxWidth","maxWidth","setMaxWidth","clientWidth","remove","handleResize","removeEventListener","getElementById","parentNode","onShippingRateSuccess","onShippingRateFail","onShippingRateSelectSuccess","handler","setHandler","onShippingChanged","paymentEvents","setPaymentEvent","execute","removePaymentEvent","isSelectingRate","shippingRatesLoading","hasShippingRates","unsubscribeShippingRateSuccess","unsubscribeShippingRateSelectSuccess","unsubscribeShippingRateFail","hasInvalidAddress","setPaymentRequest","paymentRequestOptions","pending","requestPayerName","requestPayerEmail","requestPayerPhone","requestShipping","onShippingAddressChange","onShippingOptionChange","onPaymentMethodReceived","updatePaymentEvent","updateWith","shippingOption","paymentResponse","payerName","payerEmail","payerPhone","processingResponse","paymentDetails","stripeErrorMessage","ERROR","paymentType","currentPaymentMethodArgs","getCreatePaymentMethodArgs","getSuccessResponse","paymentMethodId","unsubscribeProcessingPayment","confirmCardSetup","client_secret","setSetupIntent","createSetupIntent","variablesHandler","isEligible","variables","setVariables","locale","AfterpayPaymentMethod","settings","cartNeedsShipping","currency_minor_unit","requiredParams","accountCountry","requiredParamObj","available","LocalPaymentIntentContent","confirmationMethod","LocalPaymentSourceContent","taxId","setTaxId","isActive","setIsActive","callback","boleto","tax_id","currentBillingData","match","atob","decodeURIComponent","return_url","order","decodeURI","order_received_url","getSourceArgs","setSource","isValid","setIsValid","currentValues","getSourceArgsInternal","getDefaultSourceArgs","returnUrl","getSuccessData","sourceId","createSource","msg","categories","category","KlarnaPaymentCategory","Klarna","Payments","load","payment_method_category","abortController","AbortController","currentSourceArgs","oldSourceArgs","isLoading","setIsLoading","isCheckoutValid","getLineItems","quantity","source_order","klarna","purchase_country","custom_payment_methods","shipping_first_name","shipping_last_name","city","line1","address_1","line2","address_2","postal_code","compareSourceArgs","args2","newArgs","getArgs","args1","updateSource","updates","source_id","abort","signal","reduce","k","paymentCategory","authorize","approved","KlarnaContainer","KlarnaPaymentMethod","setSelected","klarnaInitialized","setKlarnaInitialized","getCategoriesFromSource","paymentMethodCategories","payment_method_categories","useCreateSource","init","client_token","KlarnaPaymentCategories","KlarnaLoader","countries","LocalPaymentIntentMethod","LocalPaymentSourceMethod","LocalPaymentElementContainer","useValidateCheckout","useAfterProcessLocalPayment","PAYMENT","SepaPaymentMethod","mandate","notification_method","interval","sofort","WeChatComponent","WeChatPaymentMethod","size","deleteSourceFromStorage","QRCodeComponent","wechat","qr_code_url","height","colorDark","colorLight","correctLevel","QRCode","CorrectLevel","H","createSourceTimeoutId","clearTimeout","setTimeout","PaymentRequestContent","PaymentRequestButton","paymentRequestButton","PaymentRequestEdit","canvas","scale","devicePixelRatio","getContext","beginPath","arc","Math","PI","fillStyle","fill","handleSuccessResult","unsubscribeOnCheckoutAfterProcessingWithSuccess","account","messages","countryLocale","SHIPPING_OPTION_REGEX","routes","creditCardForms","localPaymentMethods","PAYMENT_REQUEST_ADDRESS_MAPPINGS","recipient","addressLine","region","stripeAccount","route","SUCCESS","statusMessage","exclude","fields","getLocaleFields","entries","required","localeFields","default","field","packageIdx","filter","Boolean","syncPaymentIntentWithOrder","order_id","order_key","redirect","address_mappings","cartAddress","filterEmptyValues","cartKey","values","getCurrency","prefix","suffix","decimalSeparator","thousandSeparator","fractional","index","replace","substr","RegExp","sort","packageId","rateId","cartItems","pre_order","subscription","owner","mode","getCacheKey","exp","floor","getTime","sessionStorage","setItem","getItem","removeItem","ver1","ver2","compare","page","hasOwn","classNames","argType","inner"],"mappings":";8FAUAA,EAA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AAWP,EAAYr4B,K,qCAIhB,SAAC64B,EAAMC,EAAMC,GACvC,OAAQA,GACJ,IAAK,IACD,OAAOF,EAAOC,EAClB,IAAK,IACD,OAAOD,EAAOC,EAClB,IAAK,KACD,OAAOD,GAAQC,EACnB,IAAK,KACD,OAAOD,GAAQC,EACnB,IAAK,IACD,OAAOD,GAAQC,EAEvB,OAAO,G,aAGe,iBAA+C,UAAzC,IAAAvT,YAAW,qBAAqByT,M,iBAElC,iBAA+C,cAAzC,IAAAzT,YAAW,qBAAqByT,O,aCngBpE,OAOC,WACA,aAEA,IAAIC,EAAS,GAAGp2B,eAEhB,SAASq2B,IAGR,IAFA,IAAI/d,EAAU,GAELhc,EAAI,EAAGA,EAAIwB,UAAUzB,OAAQC,IAAK,CAC1C,IAAIc,EAAMU,UAAUxB,GACpB,GAAKc,EAAL,CAEA,IAAIk5B,SAAiBl5B,EAErB,GAAgB,WAAZk5B,GAAoC,WAAZA,EAC3Bhe,EAAQzZ,KAAKzB,QACP,GAAIZ,MAAMC,QAAQW,IAAQA,EAAIf,OAAQ,CAC5C,IAAIk6B,EAAQF,EAAWt4B,MAAM,KAAMX,GAC/Bm5B,GACHje,EAAQzZ,KAAK03B,QAER,GAAgB,WAAZD,EACV,IAAK,IAAIn5B,KAAOC,EACXg5B,EAAOn2B,KAAK7C,EAAKD,IAAQC,EAAID,IAChCmb,EAAQzZ,KAAK1B,IAMjB,OAAOmb,EAAQsM,KAAK,KAGgB3oB,EAAOC,SAC3Cm6B,EAAW7C,QAAU6C,EACrBp6B,EAAOC,QAAUm6B,QAKhB,KAFwB,EAAF,WACtB,OAAOA,GACP,QAFoB,OAEpB,aAxCH,I","file":"commons.js","sourcesContent":["function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}\n\nmodule.exports = _arrayLikeToArray;","function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nmodule.exports = _arrayWithHoles;","var arrayLikeToArray = require(\"./arrayLikeToArray\");\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return arrayLikeToArray(arr);\n}\n\nmodule.exports = _arrayWithoutHoles;","function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nmodule.exports = _assertThisInitialized;","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nfunction _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}\n\nmodule.exports = _asyncToGenerator;","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck;","var setPrototypeOf = require(\"./setPrototypeOf\");\n\nvar isNativeReflectConstruct = require(\"./isNativeReflectConstruct\");\n\nfunction _construct(Parent, args, Class) {\n if (isNativeReflectConstruct()) {\n module.exports = _construct = Reflect.construct;\n } else {\n module.exports = _construct = function _construct(Parent, args, Class) {\n var a = [null];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n }\n\n return _construct.apply(null, arguments);\n}\n\nmodule.exports = _construct;","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nmodule.exports = _createClass;","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty;","function _extends() {\n module.exports = _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nmodule.exports = _extends;","function _getPrototypeOf(o) {\n module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nmodule.exports = _getPrototypeOf;","var setPrototypeOf = require(\"./setPrototypeOf\");\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}\n\nmodule.exports = _inherits;","function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\n\nmodule.exports = _interopRequireDefault;","function _isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n}\n\nmodule.exports = _isNativeFunction;","function _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nmodule.exports = _isNativeReflectConstruct;","function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter);\n}\n\nmodule.exports = _iterableToArray;","function _iterableToArrayLimit(arr, i) {\n if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nmodule.exports = _iterableToArrayLimit;","function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nmodule.exports = _nonIterableRest;","function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nmodule.exports = _nonIterableSpread;","var objectWithoutPropertiesLoose = require(\"./objectWithoutPropertiesLoose\");\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nmodule.exports = _objectWithoutProperties;","function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nmodule.exports = _objectWithoutPropertiesLoose;","var _typeof = require(\"@babel/runtime/helpers/typeof\");\n\nvar assertThisInitialized = require(\"./assertThisInitialized\");\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return assertThisInitialized(self);\n}\n\nmodule.exports = _possibleConstructorReturn;","function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nmodule.exports = _setPrototypeOf;","var arrayWithHoles = require(\"./arrayWithHoles\");\n\nvar iterableToArrayLimit = require(\"./iterableToArrayLimit\");\n\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray\");\n\nvar nonIterableRest = require(\"./nonIterableRest\");\n\nfunction _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}\n\nmodule.exports = _slicedToArray;","var arrayWithoutHoles = require(\"./arrayWithoutHoles\");\n\nvar iterableToArray = require(\"./iterableToArray\");\n\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray\");\n\nvar nonIterableSpread = require(\"./nonIterableSpread\");\n\nfunction _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}\n\nmodule.exports = _toConsumableArray;","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;","var arrayLikeToArray = require(\"./arrayLikeToArray\");\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}\n\nmodule.exports = _unsupportedIterableToArray;","var getPrototypeOf = require(\"./getPrototypeOf\");\n\nvar setPrototypeOf = require(\"./setPrototypeOf\");\n\nvar isNativeFunction = require(\"./isNativeFunction\");\n\nvar construct = require(\"./construct\");\n\nfunction _wrapNativeSuper(Class) {\n var _cache = typeof Map === \"function\" ? new Map() : undefined;\n\n module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !isNativeFunction(Class)) return Class;\n\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n\n _cache.set(Class, Wrapper);\n }\n\n function Wrapper() {\n return construct(Class, arguments, getPrototypeOf(this).constructor);\n }\n\n Wrapper.prototype = Object.create(Class.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n return setPrototypeOf(Wrapper, Class);\n };\n\n return _wrapNativeSuper(Class);\n}\n\nmodule.exports = _wrapNativeSuper;","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :\n typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) :\n (global = global || self, factory(global.ReactStripe = {}, global.React));\n}(this, (function (exports, React) { 'use strict';\n\n React = React && Object.prototype.hasOwnProperty.call(React, 'default') ? React['default'] : React;\n\n function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n }\n\n function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n }\n\n function _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n }\n\n function _slicedToArray(arr, i) {\n return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();\n }\n\n function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n }\n\n function _iterableToArrayLimit(arr, i) {\n if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n }\n\n function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n }\n\n function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n }\n\n function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }\n\n function createCommonjsModule(fn, module) {\n \treturn module = { exports: {} }, fn(module, module.exports), module.exports;\n }\n\n /**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n var ReactPropTypesSecret_1 = ReactPropTypesSecret;\n\n function emptyFunction() {}\n\n function emptyFunctionWithReset() {}\n\n emptyFunctionWithReset.resetWarningCache = emptyFunction;\n\n var factoryWithThrowingShims = function () {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret_1) {\n // It is still safe when called from React.\n return;\n }\n\n var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types');\n err.name = 'Invariant Violation';\n throw err;\n }\n shim.isRequired = shim;\n\n function getShim() {\n return shim;\n }\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n\n var ReactPropTypes = {\n array: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n ReactPropTypes.PropTypes = ReactPropTypes;\n return ReactPropTypes;\n };\n\n var propTypes = createCommonjsModule(function (module) {\n /**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = factoryWithThrowingShims();\n }\n });\n\n var isUnknownObject = function isUnknownObject(raw) {\n return raw !== null && _typeof(raw) === 'object';\n };\n var isPromise = function isPromise(raw) {\n return isUnknownObject(raw) && typeof raw.then === 'function';\n }; // We are using types to enforce the `stripe` prop in this lib,\n // but in an untyped integration `stripe` could be anything, so we need\n // to do some sanity validation to prevent type errors.\n\n var isStripe = function isStripe(raw) {\n return isUnknownObject(raw) && typeof raw.elements === 'function' && typeof raw.createToken === 'function' && typeof raw.createPaymentMethod === 'function' && typeof raw.confirmCardPayment === 'function';\n };\n\n var PLAIN_OBJECT_STR = '[object Object]';\n var isEqual = function isEqual(left, right) {\n if (!isUnknownObject(left) || !isUnknownObject(right)) {\n return left === right;\n }\n\n var leftArray = Array.isArray(left);\n var rightArray = Array.isArray(right);\n if (leftArray !== rightArray) return false;\n var leftPlainObject = Object.prototype.toString.call(left) === PLAIN_OBJECT_STR;\n var rightPlainObject = Object.prototype.toString.call(right) === PLAIN_OBJECT_STR;\n if (leftPlainObject !== rightPlainObject) return false;\n if (!leftPlainObject && !leftArray) return false;\n var leftKeys = Object.keys(left);\n var rightKeys = Object.keys(right);\n if (leftKeys.length !== rightKeys.length) return false;\n var keySet = {};\n\n for (var i = 0; i < leftKeys.length; i += 1) {\n keySet[leftKeys[i]] = true;\n }\n\n for (var _i = 0; _i < rightKeys.length; _i += 1) {\n keySet[rightKeys[_i]] = true;\n }\n\n var allKeys = Object.keys(keySet);\n\n if (allKeys.length !== leftKeys.length) {\n return false;\n }\n\n var l = left;\n var r = right;\n\n var pred = function pred(key) {\n return isEqual(l[key], r[key]);\n };\n\n return allKeys.every(pred);\n };\n\n var usePrevious = function usePrevious(value) {\n var ref = React.useRef(value);\n React.useEffect(function () {\n ref.current = value;\n }, [value]);\n return ref.current;\n };\n\n var INVALID_STRIPE_ERROR = 'Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.'; // We are using types to enforce the `stripe` prop in this lib, but in a real\n // integration `stripe` could be anything, so we need to do some sanity\n // validation to prevent type errors.\n\n var validateStripe = function validateStripe(maybeStripe) {\n if (maybeStripe === null || isStripe(maybeStripe)) {\n return maybeStripe;\n }\n\n throw new Error(INVALID_STRIPE_ERROR);\n };\n\n var parseStripeProp = function parseStripeProp(raw) {\n if (isPromise(raw)) {\n return {\n tag: 'async',\n stripePromise: Promise.resolve(raw).then(validateStripe)\n };\n }\n\n var stripe = validateStripe(raw);\n\n if (stripe === null) {\n return {\n tag: 'empty'\n };\n }\n\n return {\n tag: 'sync',\n stripe: stripe\n };\n };\n\n var ElementsContext = /*#__PURE__*/React.createContext(null);\n ElementsContext.displayName = 'ElementsContext';\n var parseElementsContext = function parseElementsContext(ctx, useCase) {\n if (!ctx) {\n throw new Error(\"Could not find Elements context; You need to wrap the part of your app that \".concat(useCase, \" in an <Elements> provider.\"));\n }\n\n return ctx;\n };\n /**\n * The `Elements` provider allows you to use [Element components](https://stripe.com/docs/stripe-js/react#element-components) and access the [Stripe object](https://stripe.com/docs/js/initializing) in any nested component.\n * Render an `Elements` provider at the root of your React app so that it is available everywhere you need it.\n *\n * To use the `Elements` provider, call `loadStripe` from `@stripe/stripe-js` with your publishable key.\n * The `loadStripe` function will asynchronously load the Stripe.js script and initialize a `Stripe` object.\n * Pass the returned `Promise` to `Elements`.\n *\n * @docs https://stripe.com/docs/stripe-js/react#elements-provider\n */\n\n var Elements = function Elements(_ref) {\n var rawStripeProp = _ref.stripe,\n options = _ref.options,\n children = _ref.children;\n\n var _final = React.useRef(false);\n\n var isMounted = React.useRef(true);\n var parsed = React.useMemo(function () {\n return parseStripeProp(rawStripeProp);\n }, [rawStripeProp]);\n\n var _React$useState = React.useState(function () {\n return {\n stripe: null,\n elements: null\n };\n }),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n ctx = _React$useState2[0],\n setContext = _React$useState2[1];\n\n var prevStripe = usePrevious(rawStripeProp);\n var prevOptions = usePrevious(options);\n\n if (prevStripe !== null) {\n if (prevStripe !== rawStripeProp) {\n console.warn('Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.');\n }\n\n if (!isEqual(options, prevOptions)) {\n console.warn('Unsupported prop change on Elements: You cannot change the `options` prop after setting the `stripe` prop.');\n }\n }\n\n if (!_final.current) {\n if (parsed.tag === 'sync') {\n _final.current = true;\n setContext({\n stripe: parsed.stripe,\n elements: parsed.stripe.elements(options)\n });\n }\n\n if (parsed.tag === 'async') {\n _final.current = true;\n parsed.stripePromise.then(function (stripe) {\n if (stripe && isMounted.current) {\n // Only update Elements context if the component is still mounted\n // and stripe is not null. We allow stripe to be null to make\n // handling SSR easier.\n setContext({\n stripe: stripe,\n elements: stripe.elements(options)\n });\n }\n });\n }\n }\n\n React.useEffect(function () {\n return function () {\n isMounted.current = false;\n };\n }, []);\n React.useEffect(function () {\n var anyStripe = ctx.stripe;\n\n if (!anyStripe || !anyStripe._registerWrapper) {\n return;\n }\n\n anyStripe._registerWrapper({\n name: 'react-stripe-js',\n version: \"1.4.0\"\n });\n }, [ctx.stripe]);\n return /*#__PURE__*/React.createElement(ElementsContext.Provider, {\n value: ctx\n }, children);\n };\n Elements.propTypes = {\n stripe: propTypes.any,\n options: propTypes.object\n };\n var useElementsContextWithUseCase = function useElementsContextWithUseCase(useCaseMessage) {\n var ctx = React.useContext(ElementsContext);\n return parseElementsContext(ctx, useCaseMessage);\n };\n /**\n * @docs https://stripe.com/docs/stripe-js/react#useelements-hook\n */\n\n var useElements = function useElements() {\n var _useElementsContextWi = useElementsContextWithUseCase('calls useElements()'),\n elements = _useElementsContextWi.elements;\n\n return elements;\n };\n /**\n * @docs https://stripe.com/docs/stripe-js/react#usestripe-hook\n */\n\n var useStripe = function useStripe() {\n var _useElementsContextWi2 = useElementsContextWithUseCase('calls useStripe()'),\n stripe = _useElementsContextWi2.stripe;\n\n return stripe;\n };\n /**\n * @docs https://stripe.com/docs/stripe-js/react#elements-consumer\n */\n\n var ElementsConsumer = function ElementsConsumer(_ref2) {\n var children = _ref2.children;\n var ctx = useElementsContextWithUseCase('mounts <ElementsConsumer>'); // Assert to satisfy the busted React.FC return type (it should be ReactNode)\n\n return children(ctx);\n };\n ElementsConsumer.propTypes = {\n children: propTypes.func.isRequired\n };\n\n var useCallbackReference = function useCallbackReference(cb) {\n var ref = React.useRef(cb);\n React.useEffect(function () {\n ref.current = cb;\n }, [cb]);\n return function () {\n if (ref.current) {\n ref.current.apply(ref, arguments);\n }\n };\n };\n\n var extractUpdateableOptions = function extractUpdateableOptions(options) {\n if (!isUnknownObject(options)) {\n return {};\n }\n\n var _ = options.paymentRequest,\n rest = _objectWithoutProperties(options, [\"paymentRequest\"]);\n\n return rest;\n };\n\n var noop = function noop() {};\n\n var capitalized = function capitalized(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n };\n\n var createElementComponent = function createElementComponent(type, isServer) {\n var displayName = \"\".concat(capitalized(type), \"Element\");\n\n var ClientElement = function ClientElement(_ref) {\n var id = _ref.id,\n className = _ref.className,\n _ref$options = _ref.options,\n options = _ref$options === void 0 ? {} : _ref$options,\n _ref$onBlur = _ref.onBlur,\n onBlur = _ref$onBlur === void 0 ? noop : _ref$onBlur,\n _ref$onFocus = _ref.onFocus,\n onFocus = _ref$onFocus === void 0 ? noop : _ref$onFocus,\n _ref$onReady = _ref.onReady,\n onReady = _ref$onReady === void 0 ? noop : _ref$onReady,\n _ref$onChange = _ref.onChange,\n onChange = _ref$onChange === void 0 ? noop : _ref$onChange,\n _ref$onEscape = _ref.onEscape,\n onEscape = _ref$onEscape === void 0 ? noop : _ref$onEscape,\n _ref$onClick = _ref.onClick,\n onClick = _ref$onClick === void 0 ? noop : _ref$onClick;\n\n var _useElementsContextWi = useElementsContextWithUseCase(\"mounts <\".concat(displayName, \">\")),\n elements = _useElementsContextWi.elements;\n\n var elementRef = React.useRef(null);\n var domNode = React.useRef(null);\n var callOnReady = useCallbackReference(onReady);\n var callOnBlur = useCallbackReference(onBlur);\n var callOnFocus = useCallbackReference(onFocus);\n var callOnClick = useCallbackReference(onClick);\n var callOnChange = useCallbackReference(onChange);\n var callOnEscape = useCallbackReference(onEscape);\n React.useLayoutEffect(function () {\n if (elementRef.current == null && elements && domNode.current != null) {\n var element = elements.create(type, options);\n elementRef.current = element;\n element.mount(domNode.current);\n element.on('ready', function () {\n return callOnReady(element);\n });\n element.on('change', callOnChange);\n element.on('blur', callOnBlur);\n element.on('focus', callOnFocus);\n element.on('escape', callOnEscape); // Users can pass an an onClick prop on any Element component\n // just as they could listen for the `click` event on any Element,\n // but only the PaymentRequestButton will actually trigger the event.\n\n element.on('click', callOnClick);\n }\n });\n var prevOptions = React.useRef(options);\n React.useEffect(function () {\n if (prevOptions.current && prevOptions.current.paymentRequest !== options.paymentRequest) {\n console.warn('Unsupported prop change: options.paymentRequest is not a customizable property.');\n }\n\n var updateableOptions = extractUpdateableOptions(options);\n\n if (Object.keys(updateableOptions).length !== 0 && !isEqual(updateableOptions, extractUpdateableOptions(prevOptions.current))) {\n if (elementRef.current) {\n elementRef.current.update(updateableOptions);\n prevOptions.current = options;\n }\n }\n }, [options]);\n React.useLayoutEffect(function () {\n return function () {\n if (elementRef.current) {\n elementRef.current.destroy();\n }\n };\n }, []);\n return /*#__PURE__*/React.createElement(\"div\", {\n id: id,\n className: className,\n ref: domNode\n });\n }; // Only render the Element wrapper in a server environment.\n\n\n var ServerElement = function ServerElement(props) {\n // Validate that we are in the right context by calling useElementsContextWithUseCase.\n useElementsContextWithUseCase(\"mounts <\".concat(displayName, \">\"));\n var id = props.id,\n className = props.className;\n return /*#__PURE__*/React.createElement(\"div\", {\n id: id,\n className: className\n });\n };\n\n var Element = isServer ? ServerElement : ClientElement;\n Element.propTypes = {\n id: propTypes.string,\n className: propTypes.string,\n onChange: propTypes.func,\n onBlur: propTypes.func,\n onFocus: propTypes.func,\n onReady: propTypes.func,\n onClick: propTypes.func,\n options: propTypes.object\n };\n Element.displayName = displayName;\n Element.__elementType = type;\n return Element;\n };\n\n var isServer = typeof window === 'undefined';\n /**\n * Requires beta access:\n * Contact [Stripe support](https://support.stripe.com/) for more information.\n *\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var AuBankAccountElement = createElementComponent('auBankAccount', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var CardElement = createElementComponent('card', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var CardNumberElement = createElementComponent('cardNumber', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var CardExpiryElement = createElementComponent('cardExpiry', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var CardCvcElement = createElementComponent('cardCvc', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var FpxBankElement = createElementComponent('fpxBank', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var IbanElement = createElementComponent('iban', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var IdealBankElement = createElementComponent('idealBank', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var P24BankElement = createElementComponent('p24Bank', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var EpsBankElement = createElementComponent('epsBank', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var PaymentRequestButtonElement = createElementComponent('paymentRequestButton', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var AfterpayClearpayMessageElement = createElementComponent('afterpayClearpayMessage', isServer);\n\n exports.AfterpayClearpayMessageElement = AfterpayClearpayMessageElement;\n exports.AuBankAccountElement = AuBankAccountElement;\n exports.CardCvcElement = CardCvcElement;\n exports.CardElement = CardElement;\n exports.CardExpiryElement = CardExpiryElement;\n exports.CardNumberElement = CardNumberElement;\n exports.Elements = Elements;\n exports.ElementsConsumer = ElementsConsumer;\n exports.EpsBankElement = EpsBankElement;\n exports.FpxBankElement = FpxBankElement;\n exports.IbanElement = IbanElement;\n exports.IdealBankElement = IdealBankElement;\n exports.P24BankElement = P24BankElement;\n exports.PaymentRequestButtonElement = PaymentRequestButtonElement;\n exports.useElements = useElements;\n exports.useStripe = useStripe;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n","var V3_URL = 'https://js.stripe.com/v3';\nvar V3_URL_REGEX = /^https:\\/\\/js\\.stripe\\.com\\/v3\\/?(\\?.*)?$/;\nvar EXISTING_SCRIPT_MESSAGE = 'loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used';\nvar findScript = function findScript() {\n var scripts = document.querySelectorAll(\"script[src^=\\\"\".concat(V3_URL, \"\\\"]\"));\n\n for (var i = 0; i < scripts.length; i++) {\n var script = scripts[i];\n\n if (!V3_URL_REGEX.test(script.src)) {\n continue;\n }\n\n return script;\n }\n\n return null;\n};\n\nvar injectScript = function injectScript(params) {\n var queryString = params && !params.advancedFraudSignals ? '?advancedFraudSignals=false' : '';\n var script = document.createElement('script');\n script.src = \"\".concat(V3_URL).concat(queryString);\n var headOrBody = document.head || document.body;\n\n if (!headOrBody) {\n throw new Error('Expected document.body not to be null. Stripe.js requires a <body> element.');\n }\n\n headOrBody.appendChild(script);\n return script;\n};\n\nvar registerWrapper = function registerWrapper(stripe, startTime) {\n if (!stripe || !stripe._registerWrapper) {\n return;\n }\n\n stripe._registerWrapper({\n name: 'stripe-js',\n version: \"1.12.1\",\n startTime: startTime\n });\n};\n\nvar stripePromise = null;\nvar loadScript = function loadScript(params) {\n // Ensure that we only attempt to load Stripe.js at most once\n if (stripePromise !== null) {\n return stripePromise;\n }\n\n stripePromise = new Promise(function (resolve, reject) {\n if (typeof window === 'undefined') {\n // Resolve to null when imported server side. This makes the module\n // safe to import in an isomorphic code base.\n resolve(null);\n return;\n }\n\n if (window.Stripe && params) {\n console.warn(EXISTING_SCRIPT_MESSAGE);\n }\n\n if (window.Stripe) {\n resolve(window.Stripe);\n return;\n }\n\n try {\n var script = findScript();\n\n if (script && params) {\n console.warn(EXISTING_SCRIPT_MESSAGE);\n } else if (!script) {\n script = injectScript(params);\n }\n\n script.addEventListener('load', function () {\n if (window.Stripe) {\n resolve(window.Stripe);\n } else {\n reject(new Error('Stripe.js not available'));\n }\n });\n script.addEventListener('error', function () {\n reject(new Error('Failed to load Stripe.js'));\n });\n } catch (error) {\n reject(error);\n return;\n }\n });\n return stripePromise;\n};\nvar initStripe = function initStripe(maybeStripe, args, startTime) {\n if (maybeStripe === null) {\n return null;\n }\n\n var stripe = maybeStripe.apply(undefined, args);\n registerWrapper(stripe, startTime);\n return stripe;\n};\n\n// own script injection.\n\nvar stripePromise$1 = Promise.resolve().then(function () {\n return loadScript(null);\n});\nvar loadCalled = false;\nstripePromise$1[\"catch\"](function (err) {\n if (!loadCalled) {\n console.warn(err);\n }\n});\nvar loadStripe = function loadStripe() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n loadCalled = true;\n var startTime = Date.now();\n return stripePromise$1.then(function (maybeStripe) {\n return initStripe(maybeStripe, args, startTime);\n });\n};\n\nexport { loadStripe };\n","import classNames from 'classnames';\r\nimport './styles.scss';\r\n\r\nexport const SavePaymentMethod = ({label, onChange, checked}) => {\r\n return (\r\n <div className='wc-stripe-save-payment-method'>\r\n <label>\r\n <input type='checkbox' onChange={(e) => onChange(e.target.checked)}/>\r\n <svg\r\n className={classNames('wc-stripe-components-checkbox__mark', {checked: checked})}\r\n aria-hidden=\"true\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n viewBox=\"0 0 24 20\">\r\n <path d=\"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z\"/>\r\n </svg>\r\n </label>\r\n <span>{label}</span>\r\n </div>\r\n )\r\n}","export * from './payment-method-label';\r\nexport * from './checkbox';\r\nexport * from './radio-option';\r\nexport * from './payment-method';","import './style.scss';\r\n\r\nexport const PaymentMethodLabel = ({title, icons, paymentMethod, ...props}) => {\r\n const {PaymentMethodLabel: Label, PaymentMethodIcons: Icons} = props.components;\r\n if (!Array.isArray(icons)) {\r\n icons = [icons];\r\n }\r\n return (\r\n <span className={`wc-stripe-label-container ${paymentMethod}`}>\r\n <Label text={title}/>\r\n <Icons icons={icons} align='left'/>\r\n </span>\r\n )\r\n}","import {useEffect, useRef} from '@wordpress/element';\r\n\r\nexport const PaymentMethod = ({getData, content, ...props}) => {\r\n const Content = content;\r\n const desc = getData('description');\r\n const el = useRef(null);\r\n useEffect(() => {\r\n if (el.current && el.current.childNodes.length == 0) {\r\n el.current.classList.add('no-content');\r\n }\r\n });\r\n return (\r\n <>\r\n {desc && <Description desc={desc} payment_method={getData('name')}/>}\r\n <div ref={el} className='wc-stripe-blocks-payment-method-content'>\r\n <Content {...{...props, getData}}/>\r\n </div>\r\n </>);\r\n}\r\n\r\nconst Description = ({desc, payment_method}) => {\r\n return (\r\n <div className={`wc-stripe-blocks-payment-method__desc ${payment_method}`}>\r\n <p>{desc}</p>\r\n </div>\r\n )\r\n}","import RadioControlOption from '../radio-option';\r\nimport classnames from 'classnames';\r\n\r\nexport const RadioControlAccordion = ({option, checked, onChange}) => {\r\n const {label, value} = option;\r\n return (\r\n <div className='wc-stripe-blocks-radio-accordion'>\r\n <RadioControlOption checked={checked} onChange={onChange} value={value} label={label}/>\r\n <div\r\n className={classnames('wc-stripe-blocks-radio-accordion__content', {\r\n 'wc-stripe-blocks-radio-accordion__content-visible': checked\r\n })}>\r\n {option.content}\r\n </div>\r\n </div>\r\n\r\n )\r\n}\r\n\r\nexport default RadioControlAccordion;","import classnames from 'classnames';\r\n\r\nexport const RadioControlOption = ({checked, onChange, value, label}) => {\r\n return (\r\n <label\r\n className={classnames('wc-stripe-blocks-radio-control__option', {\r\n 'wc-stripe-blocks-radio-control__option-checked': checked\r\n })}>\r\n <input\r\n className='wc-stripe-blocks-radio-control__input'\r\n type='radio'\r\n value={value}\r\n checked={checked}\r\n onChange={(event) => onChange(event.target.value)}/>\r\n <div className='wc-stripe-blocks-radio-control__label'>\r\n <span>{label}</span>\r\n </div>\r\n </label>\r\n )\r\n}\r\n\r\nexport default RadioControlOption;","export * from './use-create-link-token';\r\nexport * from './use-initialize-plaid';\r\nexport * from './use-process-payment';","import {useEffect, useState, useCallback} from '@wordpress/element';\r\nimport apiFetch from '@wordpress/api-fetch';\r\nimport {getRoute, getFromCache, storeInCache} from '../../util';\r\n\r\nexport const useCreateLinkToken = (\r\n {\r\n setValidationError\r\n }) => {\r\n const [linkToken, setLinkToken] = useState(false);\r\n\r\n const createToken = useCallback(async () => {\r\n try {\r\n const response = await apiFetch({\r\n url: getRoute('create/linkToken'),\r\n method: 'POST',\r\n data: {}\r\n });\r\n if (response.token) {\r\n storeInCache('linkToken', response.token);\r\n setLinkToken(response.token);\r\n }\r\n } catch (err) {\r\n setValidationError(err);\r\n }\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (!linkToken) {\r\n const token = getFromCache('linkToken');\r\n if (token) {\r\n // cached token exist so use it\r\n setLinkToken(token);\r\n } else {\r\n // create the Plaid Link token\r\n createToken();\r\n }\r\n }\r\n }, [\r\n linkToken,\r\n setLinkToken\r\n ]);\r\n return linkToken;\r\n}","import {useState, useEffect, useRef, useCallback} from '@wordpress/element';\r\nimport Plaid from '@plaid';\r\nimport {getErrorMessage} from \"../../util\";\r\n\r\nexport const useInitializePlaid = (\r\n {\r\n getData,\r\n linkToken\r\n }) => {\r\n const linkHandler = useRef(null);\r\n const resolvePopup = useRef(null);\r\n const openLinkPopup = useCallback(() => new Promise((resolve, reject) => {\r\n resolvePopup.current = {resolve, reject};\r\n linkHandler.current.open();\r\n }), []);\r\n\r\n // if the token exists, initialize Plaid's link handler\r\n useEffect(() => {\r\n if (linkToken) {\r\n linkHandler.current = Plaid.create({\r\n clientName: getData('clientName'),\r\n env: getData('plaidEnvironment'),\r\n product: ['auth'],\r\n token: linkToken,\r\n selectAccount: true,\r\n countryCodes: ['US'],\r\n onSuccess: (publicToken, metaData) => {\r\n resolvePopup.current.resolve({publicToken, metaData});\r\n },\r\n onExit: (err) => {\r\n resolvePopup.current.reject(err ? getErrorMessage(err.error_message) : false);\r\n }\r\n });\r\n }\r\n }, [linkToken]);\r\n\r\n return openLinkPopup;\r\n}","import {useEffect, useCallback} from '@wordpress/element';\r\nimport {ensureSuccessResponse, ensureErrorResponse, deleteFromCache} from \"../../util\";\r\n\r\nexport const useProcessPayment = (\r\n {\r\n openLinkPopup,\r\n onPaymentProcessing,\r\n responseTypes,\r\n paymentMethod\r\n\r\n }) => {\r\n\r\n useEffect(() => {\r\n const unsubscribe = onPaymentProcessing(async () => {\r\n try {\r\n // open the Plaid popup\r\n const result = await openLinkPopup();\r\n const {publicToken, metaData} = result;\r\n // remove the cached link token.\r\n deleteFromCache('linkToken');\r\n return ensureSuccessResponse(responseTypes, {\r\n meta: {\r\n paymentMethodData: {\r\n [`${paymentMethod}_token_key`]: publicToken,\r\n [`${paymentMethod}_metadata`]: JSON.stringify(metaData)\r\n }\r\n }\r\n });\r\n } catch (err) {\r\n return ensureErrorResponse(responseTypes, err);\r\n }\r\n });\r\n return () => unsubscribe();\r\n }, [\r\n onPaymentProcessing,\r\n responseTypes,\r\n openLinkPopup\r\n ]);\r\n}","import './styles.scss';\r\nimport './payment-method'","import {useState} from '@wordpress/element';\r\nimport {registerPaymentMethod} from '@woocommerce/blocks-registry';\r\nimport {getSettings, isTestMode} from '../util';\r\nimport {PaymentMethodLabel, PaymentMethod} from '../../components/checkout';\r\nimport SavedCardComponent from '../saved-card-component';\r\nimport {useCreateLinkToken, useInitializePlaid, useProcessPayment} from './hooks';\r\nimport {useProcessCheckoutError} from \"../hooks\";\r\nimport {__} from '@wordpress/i18n';\r\n\r\nconst getData = getSettings('stripe_ach_data');\r\n\r\nconst ACHPaymentContent = (\r\n {\r\n getData,\r\n eventRegistration,\r\n components,\r\n emitResponse,\r\n onSubmit,\r\n ...props\r\n }) => {\r\n const {responseTypes} = emitResponse;\r\n const {onPaymentProcessing, onCheckoutAfterProcessingWithError} = eventRegistration;\r\n const {ValidationInputError} = components;\r\n const [validationError, setValidationError] = useState(false);\r\n\r\n const linkToken = useCreateLinkToken({setValidationError});\r\n\r\n useProcessCheckoutError({\r\n responseTypes,\r\n subscriber: onCheckoutAfterProcessingWithError\r\n });\r\n\r\n const openLinkPopup = useInitializePlaid({\r\n getData,\r\n linkToken,\r\n onSubmit\r\n });\r\n\r\n useProcessPayment({\r\n openLinkPopup,\r\n onPaymentProcessing,\r\n responseTypes,\r\n paymentMethod: getData('name')\r\n });\r\n return (\r\n <>\r\n {isTestMode && <ACHTestModeCredentials/>}\r\n {validationError && <ValidationInputError errorMessage={validationError}/>}\r\n </>\r\n )\r\n}\r\n\r\nconst ACHTestModeCredentials = () => {\r\n return (\r\n <div className='wc-stripe-blocks-ach__creds'>\r\n <label className='wc-stripe-blocks-ach__creds-label'>{__('Test Credentials', 'woo-stripe-payment')}</label>\r\n <div className='wc-stripe-blocks-ach__username'>\r\n <div>\r\n <strong>{__('username', 'woo-stripe-payment')}</strong>: user_good\r\n </div>\r\n <div>\r\n <strong>{__('password', 'woo-stripe-payment')}</strong>: pass_good\r\n </div>\r\n <div>\r\n <strong>{__('pin', 'woo-stripe-payment')}</strong>: credential_good\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n\r\nregisterPaymentMethod({\r\n name: getData('name'),\r\n label: <PaymentMethodLabel title={getData('title')}\r\n paymentMethod={getData('name')}\r\n icons={getData('icons')}/>,\r\n ariaLabel: 'ACH Payment',\r\n canMakePayment: ({cartTotals}) => cartTotals.currency_code === 'USD',\r\n content: <PaymentMethod\r\n getData={getData}\r\n content={ACHPaymentContent}/>,\r\n savedTokenComponent: <SavedCardComponent getData={getData}/>,\r\n edit: <ACHPaymentContent getData={getData}/>,\r\n placeOrderButtonLabel: getData('placeOrderButtonLabel'),\r\n supports: {\r\n showSavedCards: getData('showSavedCards'),\r\n showSaveOption: false,\r\n features: getData('features')\r\n }\r\n})","import './style.scss';\r\n\r\nimport './payment-method';","import {useCallback} from '@wordpress/element';\r\nimport {registerExpressPaymentMethod} from '@woocommerce/blocks-registry';\r\nimport {getSettings, initStripe as loadStripe, canMakePayment} from \"../util\";\r\nimport {Elements, PaymentRequestButtonElement, useStripe} from \"@stripe/react-stripe-js\";\r\nimport ErrorBoundary from \"../error-boundary\";\r\nimport {\r\n usePaymentRequest,\r\n useProcessPaymentIntent,\r\n useExportedValues,\r\n useAfterProcessingPayment,\r\n useStripeError,\r\n useExpressBreakpointWidth\r\n} from '../hooks';\r\n\r\nconst getData = getSettings('stripe_applepay_data');\r\n\r\nconst ApplePayContent = (props) => {\r\n return (\r\n <ErrorBoundary>\r\n <div className='wc-stripe-apple-pay-container'>\r\n <Elements stripe={loadStripe}>\r\n <ApplePayButton {...props}/>\r\n </Elements>\r\n </div>\r\n </ErrorBoundary>\r\n );\r\n}\r\n\r\nconst ApplePayButton = (\r\n {\r\n getData,\r\n onClick,\r\n onClose,\r\n billing,\r\n shippingData,\r\n eventRegistration,\r\n emitResponse,\r\n onSubmit,\r\n activePaymentMethod,\r\n ...props\r\n }) => {\r\n const {onPaymentProcessing} = eventRegistration;\r\n const {responseTypes, noticeContexts} = emitResponse;\r\n const stripe = useStripe();\r\n const [error] = useStripeError();\r\n const canPay = (result) => result != null && result.applePay;\r\n const exportedValues = useExportedValues();\r\n useExpressBreakpointWidth({payment_method: getData('name'), width: 300});\r\n const {setPaymentMethod} = useProcessPaymentIntent({\r\n getData,\r\n billing,\r\n shippingData,\r\n onPaymentProcessing,\r\n emitResponse,\r\n error,\r\n onSubmit,\r\n activePaymentMethod,\r\n exportedValues\r\n });\r\n useAfterProcessingPayment({\r\n getData,\r\n eventRegistration,\r\n responseTypes,\r\n activePaymentMethod,\r\n messageContext: noticeContexts.EXPRESS_PAYMENTS\r\n });\r\n const {paymentRequest} = usePaymentRequest({\r\n getData,\r\n onClose,\r\n stripe,\r\n billing,\r\n shippingData,\r\n eventRegistration,\r\n setPaymentMethod,\r\n exportedValues,\r\n canPay\r\n });\r\n\r\n const handleClick = useCallback(() => {\r\n if (paymentRequest) {\r\n onClick();\r\n paymentRequest.show();\r\n }\r\n }, [paymentRequest, onClick]);\r\n\r\n if (paymentRequest) {\r\n return (\r\n <button\r\n className={`apple-pay-button ${getData('buttonStyle')}`}\r\n style={{\r\n '-apple-pay-button-type': getData('buttonType')\r\n }}\r\n onClick={handleClick}/>\r\n\r\n )\r\n }\r\n return null;\r\n}\r\n\r\nconst ApplePayEdit = ({getData, ...props}) => {\r\n return (\r\n <div className={'apple-pay-block-editor'}>\r\n <img src={getData('editorIcon')}/>\r\n </div>\r\n )\r\n}\r\n\r\nregisterExpressPaymentMethod({\r\n name: getData('name'),\r\n canMakePayment: ({cartTotals, ...props}) => {\r\n if (getData('isAdmin')) {\r\n return true;\r\n }\r\n const {currency_code: currency, total_price} = cartTotals;\r\n return canMakePayment({\r\n country: getData('countryCode'),\r\n currency: currency.toLowerCase(),\r\n total: {\r\n label: getData('totalLabel'),\r\n amount: parseInt(total_price)\r\n }\r\n }, (result) => result != null && result.applePay);\r\n },\r\n content: <ApplePayContent getData={getData}/>,\r\n edit: <ApplePayEdit getData={getData}/>,\r\n supports: {\r\n showSavedCards: getData('showSavedCards'),\r\n showSaveOption: getData('showSaveOption'),\r\n features: getData('features')\r\n }\r\n})","import './style.scss';\r\nimport {registerCreditCardForm} from \"@paymentplugins/stripe/util\";\r\nimport {CardNumberElement, CardExpiryElement, CardCvcElement} from '@stripe/react-stripe-js';\r\nimport {__} from \"@wordpress/i18n\";\r\n\r\nconst Bootstrap = ({CardIcon, options, onChange}) => {\r\n return (\r\n <div className='wc-stripe-bootstrap-form'>\r\n <div className='row'>\r\n <div className='col-md-6 mb-3'>\r\n <CardNumberElement className='md-form md-outline stripe-input' options={options['cardNumber']}\r\n onChange={onChange(CardNumberElement)}/>\r\n <label htmlFor=\"stripe-card-number\">{__('Card Number', 'woo-stripe-payment')}</label>\r\n {CardIcon}\r\n </div>\r\n <div className='col-md-3 mb-3'>\r\n <CardExpiryElement className='md-form md-outline stripe-input' options={options['cardExpiry']}\r\n onChange={onChange(CardExpiryElement)}/>\r\n <label htmlFor=\"stripe-exp\">{__('Exp', 'woo-stripe-payment')}</label>\r\n </div>\r\n <div className='col-md-3 mb-3'>\r\n <CardCvcElement className=\"md-form md-outline stripe-input\" options={options['cardCvc']}\r\n onChange={onChange(CardCvcElement)}/>\r\n <label htmlFor=\"stripe-cvv\">{__('CVV', 'woo-stripe-payment')}</label>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nregisterCreditCardForm({\r\n id: 'bootstrap',\r\n breakpoint: 475,\r\n component: <Bootstrap/>\r\n})","import {getCreditCardForm} from \"../../util\";\r\nimport {cloneElement, useRef, useCallback, useEffect, useState} from '@wordpress/element';\r\nimport {useElements, CardNumberElement, CardExpiryElement, CardCvcElement} from '@stripe/react-stripe-js';\r\nimport {sprintf, __} from '@wordpress/i18n';\r\nimport {useBreakpointWidth} from \"../../hooks\";\r\n\r\nconst classes = {\r\n focus: 'focused',\r\n empty: 'empty',\r\n invalid: 'invalid'\r\n}\r\n\r\nconst CustomCardForm = (\r\n {\r\n getData,\r\n onChange: eventChange\r\n }) => {\r\n const [cardType, setCardType] = useState('');\r\n const elementOrder = useRef([]);\r\n const [container, setContainer] = useState(null);\r\n const elements = useElements();\r\n const id = getData('customForm');\r\n const {component: CardForm = null, breakpoint = 475} = getCreditCardForm(id);\r\n const postalCodeEnabled = getData('postalCodeEnabled');\r\n const options = {};\r\n ['cardNumber', 'cardExpiry', 'cardCvc'].forEach(type => {\r\n options[type] = {\r\n classes,\r\n ...getData('cardOptions'),\r\n ...getData('customFieldOptions')[type],\r\n }\r\n });\r\n const onChange = (element) => {\r\n setElementOrder(element);\r\n return (event) => {\r\n eventChange(event);\r\n if (event.elementType === 'cardNumber') {\r\n if (event.brand === 'unknown') {\r\n setCardType('');\r\n } else {\r\n setCardType(event.brand);\r\n }\r\n }\r\n if (event.complete) {\r\n const idx = elementOrder.current.indexOf(element);\r\n if (elementOrder.current[idx + 1]) {\r\n const nextElement = elementOrder.current[idx + 1];\r\n elements.getElement(nextElement).focus();\r\n }\r\n }\r\n }\r\n }\r\n const setElementOrder = useCallback((element) => {\r\n if (!elementOrder.current.includes(element)) {\r\n elementOrder.current.push(element);\r\n }\r\n }, []);\r\n\r\n useBreakpointWidth({name: 'creditCardForm', width: breakpoint, node: container, className: 'small-form'});\r\n\r\n const getCardIconSrc = useCallback((type) => {\r\n for (let id of Object.keys(getData('cards'))) {\r\n if (id === type) {\r\n return getData('cards')[id];\r\n }\r\n }\r\n return '';\r\n }, []);\r\n\r\n if (!CardForm) {\r\n return (\r\n <div className='wc-stripe-custom-form-error'>\r\n <p>{sprintf(__('%s is not a valid blocks Stripe custom form. Please choose another custom form option in the Credit Card Settings.', 'woo-stripe-payment'), getData('customFormLabels')[id])}</p>\r\n </div>\r\n )\r\n }\r\n return (\r\n <div className={`wc-stripe-custom-form ${id}`} ref={setContainer}>\r\n {cloneElement(CardForm, {\r\n postalCodeEnabled,\r\n options,\r\n onChange,\r\n CardIcon: <CardIcon type={cardType} src={getCardIconSrc(cardType)}/>\r\n })}\r\n </div>\r\n )\r\n\r\n}\r\n\r\nconst CardIcon = ({type, src}) => {\r\n if (type) {\r\n return <img className={`wc-stripe-card ${type}`} src={src}/>\r\n }\r\n return null;\r\n}\r\n\r\nexport default CustomCardForm;\r\n","import './style.scss';\r\nimport {registerCreditCardForm} from \"@paymentplugins/stripe/util\";\r\nimport {CardNumberElement, CardExpiryElement, CardCvcElement} from '@stripe/react-stripe-js';\r\nimport {__} from \"@wordpress/i18n\";\r\nimport {useEffect, useCallback, useRef} from '@wordpress/element';\r\n\r\nconst SimpleForm = ({CardIcon, options, onChange}) => {\r\n useEffect(() => {\r\n }, []);\r\n return (\r\n <div className='wc-stripe-simple-form'>\r\n <div className=\"row\">\r\n <div className=\"field\">\r\n <div className='field-item'>\r\n <CardNumberElement id=\"stripe-card-number\" className=\"input empty\"\r\n options={options['cardNumber']}\r\n onChange={onChange(CardNumberElement)}/>\r\n <label htmlFor=\"stripe-card-number\"\r\n data-tid=\"\">{__('Card Number', 'woo-stripe-payment')}</label>\r\n <div className=\"baseline\"></div>\r\n {CardIcon}\r\n </div>\r\n </div>\r\n </div>\r\n <div className=\"row\">\r\n <div className=\"field half-width\">\r\n <div className='field-item'>\r\n <CardExpiryElement id=\"stripe-exp\" className=\"input empty\" options={options['cardExpiry']}\r\n onChange={onChange(CardExpiryElement)}/>\r\n <label htmlFor=\"stripe-exp\"\r\n data-tid=\"\">{__('Expiration', 'woo-stripe-payment')}</label>\r\n <div className=\"baseline\"></div>\r\n </div>\r\n </div>\r\n <div className=\"field half-width cvc\">\r\n <div className='field-item'>\r\n <CardCvcElement id=\"stripe-cvv\" className=\"input empty\" options={options['cardCvc']}\r\n onChange={onChange(CardCvcElement)}/>\r\n <label htmlFor=\"stripe-cvv\"\r\n data-tid=\"\">{__('CVV', 'woo-stripe-payment')}</label>\r\n <div className=\"baseline\"></div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nregisterCreditCardForm({\r\n id: 'simple',\r\n component: <SimpleForm/>,\r\n breakpoint: 375\r\n})","import {CardElement} from \"@stripe/react-stripe-js\";\r\nimport {isFieldRequired} from \"../../util\";\r\nimport {useMemo} from '@wordpress/element';\r\n\r\nconst StripeCardForm = ({getData, billing, onChange}) => {\r\n const cardOptions = useMemo(() => {\r\n return {\r\n ...{\r\n value: {\r\n postalCode: billing?.billingData?.postcode\r\n },\r\n hidePostalCode: isFieldRequired('postcode'),\r\n iconStyle: 'default'\r\n }, ...getData('cardOptions')\r\n };\r\n }, [billing.billingData]);\r\n return (\r\n <div className='wc-stripe-inline-form'>\r\n <CardElement options={cardOptions} onChange={onChange}/>\r\n </div>\r\n )\r\n}\r\n\r\nexport default StripeCardForm;","import './style.scss';\r\n\r\nexport * from './payment-method';\r\n\r\nimport './components/bootstrap';\r\nimport './components/simple';\r\n","import {useEffect, useState, useCallback, useMemo} from '@wordpress/element';\r\nimport {registerPaymentMethod} from '@woocommerce/blocks-registry';\r\nimport {\r\n initStripe as loadStripe,\r\n getSettings,\r\n isUserLoggedIn,\r\n cartContainsSubscription,\r\n cartContainsPreOrder\r\n} from '../util';\r\nimport {Elements, CardElement, useStripe, useElements, CardNumberElement} from '@stripe/react-stripe-js';\r\nimport {PaymentMethodLabel, PaymentMethod, SavePaymentMethod} from '../../components/checkout';\r\nimport SavedCardComponent from '../saved-card-component';\r\nimport CustomCardForm from './components/custom-card-form';\r\nimport StripeCardForm from \"./components/stripe-card-form\";\r\nimport {\r\n useProcessPaymentIntent,\r\n useAfterProcessingPayment,\r\n useSetupIntent,\r\n useStripeError\r\n} from \"../hooks\";\r\n\r\nconst getData = getSettings('stripe_cc_data');\r\n\r\nconst displaySaveCard = (customerId) => {\r\n return isUserLoggedIn(customerId) && getData('saveCardEnabled') &&\r\n !cartContainsSubscription() && !cartContainsPreOrder()\r\n}\r\n\r\nconst CreditCardContent = (props) => {\r\n const [error, setError] = useState(false);\r\n useEffect(() => {\r\n loadStripe.catch(error => {\r\n setError(error);\r\n })\r\n }, [setError]);\r\n if (error) {\r\n throw new Error(error);\r\n }\r\n return (\r\n <Elements stripe={loadStripe}>\r\n <CreditCardElement {...props}/>\r\n </Elements>\r\n );\r\n};\r\n\r\nconst CreditCardElement = (\r\n {\r\n getData,\r\n billing,\r\n shippingData,\r\n emitResponse,\r\n eventRegistration,\r\n activePaymentMethod\r\n }) => {\r\n const [error, setError] = useStripeError();\r\n const [savePaymentMethod, setSavePaymentMethod] = useState(false);\r\n const onSavePaymentMethod = (checked) => setSavePaymentMethod(checked);\r\n const {onPaymentProcessing} = eventRegistration;\r\n const stripe = useStripe();\r\n const elements = useElements();\r\n const getPaymentMethodArgs = useCallback(() => {\r\n const elType = getData('customFormActive') ? CardNumberElement : CardElement;\r\n return {card: elements.getElement(elType)};\r\n }, [stripe, elements]);\r\n\r\n const {setupIntent, removeSetupIntent} = useSetupIntent({\r\n getData,\r\n cartTotal: billing.cartTotal,\r\n setError\r\n })\r\n\r\n useProcessPaymentIntent({\r\n getData,\r\n billing,\r\n shippingData,\r\n emitResponse,\r\n error,\r\n onPaymentProcessing,\r\n savePaymentMethod,\r\n setupIntent,\r\n removeSetupIntent,\r\n getPaymentMethodArgs,\r\n activePaymentMethod\r\n });\r\n useAfterProcessingPayment({\r\n getData,\r\n eventRegistration,\r\n responseTypes: emitResponse.responseTypes,\r\n activePaymentMethod,\r\n savePaymentMethod\r\n });\r\n\r\n const onChange = (event) => {\r\n if (event.error) {\r\n setError(event.error);\r\n } else {\r\n setError(false);\r\n }\r\n }\r\n const Tag = getData('customFormActive') ? CustomCardForm : StripeCardForm;\r\n return (\r\n <div className='wc-stripe-card-container'>\r\n <Tag {...{getData, billing, onChange}}/>\r\n {displaySaveCard(billing.customerId) &&\r\n <SavePaymentMethod label={getData('savePaymentMethodLabel')}\r\n onChange={onSavePaymentMethod}\r\n checked={savePaymentMethod}/>}\r\n </div>\r\n );\r\n}\r\n\r\nregisterPaymentMethod({\r\n name: getData('name'),\r\n label: <PaymentMethodLabel\r\n title={getData('title')}\r\n paymentMethod={getData('name')}\r\n icons={getData('icons')}/>,\r\n ariaLabel: 'Credit Cards',\r\n canMakePayment: () => loadStripe,\r\n content: <PaymentMethod content={CreditCardContent} getData={getData}/>,\r\n savedTokenComponent: <SavedCardComponent getData={getData}/>,\r\n edit: <PaymentMethod content={CreditCardContent} getData={getData}/>,\r\n supports: {\r\n showSavedCards: getData('showSavedCards'),\r\n showSaveOption: false,\r\n features: getData('features')\r\n }\r\n})","import {Component} from '@wordpress/element';\r\n\r\nclass ErrorBoundary extends Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {hasError: false, error: null, errorInfo: null};\r\n }\r\n\r\n componentDidCatch(error, errorInfo) {\r\n this.setState({\r\n hasError: true,\r\n error,\r\n errorInfo\r\n })\r\n }\r\n\r\n render() {\r\n if (this.state.hasError) {\r\n return (\r\n <>\r\n {this.state.error && <div className='wc-stripe-block-error'>{this.state.error.toString()}</div>}\r\n {this.state.errorInfo &&\r\n <div className='wc-stripe-block-error'>{this.state.errorInfo.componentStack}</div>}\r\n </>\r\n )\r\n }\r\n return this.props.children;\r\n }\r\n}\r\n\r\nexport default ErrorBoundary;","import {useRef, useEffect} from '@wordpress/element';\r\nimport {usePaymentsClient, usePaymentRequest} from './hooks';\r\nimport {\r\n useProcessPaymentIntent,\r\n useStripeError,\r\n useExportedValues,\r\n useExpressBreakpointWidth\r\n} from '../hooks';\r\nimport {getSettings} from '@paymentplugins/stripe/util';\r\n\r\nconst {publishableKey} = getSettings('stripeGeneralData')();\r\n\r\nconst GooglePayButton = (\r\n {\r\n getData,\r\n setErrorMessage,\r\n billing,\r\n shippingData,\r\n canMakePayment,\r\n checkoutStatus,\r\n eventRegistration,\r\n activePaymentMethod,\r\n onClick,\r\n onClose,\r\n ...props\r\n }) => {\r\n const merchantInfo = {\r\n merchantId: getData('merchantId'),\r\n merchantName: getData('merchantName')\r\n };\r\n const [error, setError] = useStripeError();\r\n const buttonContainer = useRef();\r\n const {onSubmit, emitResponse} = props;\r\n const {onPaymentProcessing} = eventRegistration;\r\n const exportedValues = useExportedValues();\r\n const width = getData('buttonStyle').buttonType === 'long' ? 390 : 300;\r\n const {setPaymentMethod} = useProcessPaymentIntent({\r\n getData,\r\n billing,\r\n shippingData,\r\n onPaymentProcessing,\r\n emitResponse,\r\n error,\r\n exportedValues,\r\n onSubmit,\r\n checkoutStatus,\r\n activePaymentMethod\r\n });\r\n\r\n const paymentRequest = usePaymentRequest({\r\n getData,\r\n publishableKey,\r\n merchantInfo,\r\n billing,\r\n shippingData\r\n })\r\n\r\n const {button, removeButton} = usePaymentsClient({\r\n merchantInfo,\r\n paymentRequest,\r\n billing,\r\n shippingData,\r\n eventRegistration,\r\n canMakePayment,\r\n setErrorMessage,\r\n onSubmit,\r\n setPaymentMethod,\r\n exportedValues,\r\n onClick,\r\n onClose,\r\n getData\r\n });\r\n\r\n useExpressBreakpointWidth({payment_method: getData('name'), width});\r\n\r\n useEffect(() => {\r\n if (button) {\r\n // prevent button duplicates\r\n removeButton(buttonContainer.current);\r\n buttonContainer.current.append(button);\r\n }\r\n }, [button]);\r\n\r\n return (\r\n <div className='wc-stripe-gpay-button-container' ref={buttonContainer}></div>\r\n )\r\n}\r\n\r\nexport default GooglePayButton;","export const BASE_PAYMENT_METHOD = {\r\n type: 'CARD',\r\n parameters: {\r\n allowedAuthMethods: [\"PAN_ONLY\"],\r\n allowedCardNetworks: [\"AMEX\", \"DISCOVER\", \"INTERAC\", \"JCB\", \"MASTERCARD\", \"VISA\"],\r\n assuranceDetailsRequired: true\r\n }\r\n};\r\n\r\nexport const BASE_PAYMENT_REQUEST = {\r\n apiVersion: 2,\r\n apiVersionMinor: 0\r\n}","export * from './use-payments-client';\r\nexport * from './use-payment-request';\r\nexport * from './use-error-message';","import {useState} from '@wordpress/element';\r\n\r\nexport const useErrorMessage = () => {\r\n const [errorMessage, setErrorMessage] = useState(false);\r\n return {errorMessage, setErrorMessage};\r\n}","import {useState, useEffect, useMemo} from '@wordpress/element';\r\nimport {BASE_PAYMENT_REQUEST, BASE_PAYMENT_METHOD} from \"../constants\";\r\nimport {isEmpty, isFieldRequired} from \"../../util\";\r\nimport {getTransactionInfo, getShippingOptionParameters} from \"../util\";\r\n\r\nexport const usePaymentRequest = ({getData, publishableKey, merchantInfo, billing, shippingData}) => {\r\n const {billingData} = billing;\r\n const {shippingRates} = shippingData;\r\n const {processingCountry, totalPriceLabel} = getData();\r\n\r\n const paymentRequest = useMemo(() => {\r\n let options = {\r\n ...{\r\n emailRequired: isEmpty(billingData.email),\r\n merchantInfo,\r\n allowedPaymentMethods: [{\r\n ...{\r\n type: 'CARD',\r\n tokenizationSpecification: {\r\n type: \"PAYMENT_GATEWAY\",\r\n parameters: {\r\n gateway: 'stripe',\r\n \"stripe:version\": \"2018-10-31\",\r\n \"stripe:publishableKey\": publishableKey\r\n }\r\n }\r\n }, ...BASE_PAYMENT_METHOD\r\n }],\r\n shippingAddressRequired: shippingData.needsShipping,\r\n transactionInfo: getTransactionInfo({\r\n billing,\r\n processingCountry,\r\n totalPriceLabel\r\n }),\r\n callbackIntents: ['PAYMENT_AUTHORIZATION']\r\n }, ...BASE_PAYMENT_REQUEST\r\n };\r\n options.allowedPaymentMethods[0].parameters.billingAddressRequired = true;\r\n options.allowedPaymentMethods[0].parameters.billingAddressParameters = {\r\n format: 'FULL',\r\n phoneNumberRequired: isFieldRequired('phone', billingData.country) && isEmpty(billingData.phone)\r\n };\r\n if (options.shippingAddressRequired) {\r\n options.callbackIntents = [...options.callbackIntents, ...['SHIPPING_ADDRESS', 'SHIPPING_OPTION']];\r\n options.shippingOptionRequired = true;\r\n const shippingOptionParameters = getShippingOptionParameters(shippingRates);\r\n if (shippingOptionParameters.shippingOptions.length > 0) {\r\n options = {...options, shippingOptionParameters};\r\n }\r\n }\r\n return options;\r\n }, [\r\n billing.cartTotal,\r\n billing.cartTotalItems,\r\n billingData,\r\n shippingData\r\n ]);\r\n return paymentRequest;\r\n}","import {useState, useEffect, useCallback, useMemo, useRef} from '@wordpress/element';\r\nimport isShallowEqual from \"@wordpress/is-shallow-equal\";\r\nimport {\r\n getErrorMessage,\r\n getSelectedShippingOption,\r\n getBillingDetailsFromAddress,\r\n isAddressValid,\r\n isEmpty,\r\n StripeError,\r\n getIntermediateAddress\r\n} from \"../../util\";\r\nimport {useStripe} from \"@stripe/react-stripe-js\";\r\nimport {getPaymentRequestUpdate, toCartAddress} from \"../util\";\r\nimport {__} from \"@wordpress/i18n\";\r\nimport {usePaymentEvents} from \"../../hooks\";\r\n\r\nexport const usePaymentsClient = (\r\n {\r\n merchantInfo,\r\n paymentRequest,\r\n billing,\r\n shippingData,\r\n eventRegistration,\r\n canMakePayment,\r\n setErrorMessage,\r\n setPaymentMethod,\r\n exportedValues,\r\n onClick,\r\n onClose,\r\n getData\r\n }) => {\r\n const {environment} = getData();\r\n const [paymentsClient, setPaymentsClient] = useState();\r\n const [button, setButton] = useState(null);\r\n const currentBilling = useRef(billing);\r\n const currentShipping = useRef(shippingData);\r\n const stripe = useStripe();\r\n const {addPaymentEvent} = usePaymentEvents({\r\n billing,\r\n shippingData,\r\n eventRegistration\r\n });\r\n useEffect(() => {\r\n currentBilling.current = billing;\r\n currentShipping.current = shippingData;\r\n });\r\n\r\n const setAddressData = useCallback((paymentData) => {\r\n if (paymentData?.paymentMethodData?.info?.billingAddress) {\r\n let billingAddress = paymentData.paymentMethodData.info.billingAddress;\r\n if (isAddressValid(currentBilling.current.billingData, ['phone', 'email']) && isEmpty(currentBilling.current.billingData?.phone)) {\r\n billingAddress = {phoneNumber: billingAddress.phoneNumber};\r\n }\r\n exportedValues.billingData = currentBilling.current.billingData = toCartAddress(billingAddress, {email: paymentData.email});\r\n }\r\n if (paymentData?.shippingAddress) {\r\n exportedValues.shippingAddress = toCartAddress(paymentData.shippingAddress);\r\n }\r\n }, [exportedValues, paymentRequest]);\r\n\r\n const removeButton = useCallback((parentElement) => {\r\n while (parentElement.firstChild) {\r\n parentElement.removeChild(parentElement.firstChild);\r\n }\r\n }, [button]);\r\n const handleClick = useCallback(async () => {\r\n onClick();\r\n try {\r\n let paymentData = await paymentsClient.loadPaymentData(paymentRequest);\r\n\r\n // set the address data so it can be used during the checkout process\r\n setAddressData(paymentData);\r\n\r\n const data = JSON.parse(paymentData.paymentMethodData.tokenizationData.token);\r\n\r\n let result = await stripe.createPaymentMethod({\r\n type: 'card',\r\n card: {token: data.id},\r\n billing_details: getBillingDetailsFromAddress(currentBilling.current.billingData)\r\n });\r\n\r\n if (result.error) {\r\n throw new StripeError(result.error);\r\n }\r\n\r\n setPaymentMethod(result.paymentMethod.id);\r\n } catch (err) {\r\n if (err?.statusCode === \"CANCELED\") {\r\n onClose();\r\n } else {\r\n console.log(getErrorMessage(err));\r\n setErrorMessage(getErrorMessage(err));\r\n }\r\n }\r\n }, [\r\n stripe,\r\n paymentsClient,\r\n onClick\r\n ]);\r\n\r\n const createButton = useCallback(async () => {\r\n try {\r\n if (paymentsClient && !button && stripe) {\r\n await canMakePayment;\r\n setButton(paymentsClient.createButton({\r\n onClick: handleClick,\r\n ...getData('buttonStyle')\r\n }));\r\n }\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }, [\r\n stripe,\r\n button,\r\n paymentsClient,\r\n handleClick\r\n ]);\r\n\r\n const paymentOptions = useMemo(() => {\r\n let options = {\r\n environment,\r\n merchantInfo,\r\n paymentDataCallbacks: {\r\n onPaymentAuthorized: () => Promise.resolve({transactionState: \"SUCCESS\"})\r\n }\r\n }\r\n if (paymentRequest.shippingAddressRequired) {\r\n options.paymentDataCallbacks.onPaymentDataChanged = (paymentData) => {\r\n return new Promise((resolve, reject) => {\r\n const shipping = currentShipping.current;\r\n const {shippingAddress: address, shippingOptionData} = paymentData;\r\n const intermediateAddress = toCartAddress(address);\r\n // pass the Promise resolve to a ref so it persists beyond the re-render\r\n const selectedRates = getSelectedShippingOption(shippingOptionData.id);\r\n const addressEqual = isShallowEqual(getIntermediateAddress(shipping.shippingAddress), intermediateAddress);\r\n const shippingEqual = isShallowEqual(shipping.selectedRates, {\r\n [selectedRates[1]]: selectedRates[0]\r\n });\r\n addPaymentEvent('onShippingChanged', (success, {billing, shipping}) => {\r\n if (success) {\r\n resolve(getPaymentRequestUpdate({\r\n billing,\r\n shippingData: {\r\n needsShipping: true,\r\n shippingRates: shipping.shippingRates\r\n },\r\n processingCountry: getData('processingCountry'),\r\n totalPriceLabel: getData('totalPriceLabel')\r\n }))\r\n } else {\r\n resolve({\r\n error: {\r\n reason: 'SHIPPING_ADDRESS_UNSERVICEABLE',\r\n message: __('Your shipping address is not serviceable.', 'woo-stripe-payment'),\r\n intent: 'SHIPPING_ADDRESS'\r\n }\r\n });\r\n }\r\n }, addressEqual && shippingEqual);\r\n currentShipping.current.setShippingAddress({...currentShipping.current.shippingAddress, ...intermediateAddress});\r\n if (shippingOptionData.id !== 'shipping_option_unselected') {\r\n currentShipping.current.setSelectedRates(...selectedRates);\r\n }\r\n })\r\n }\r\n }\r\n return options;\r\n }, [paymentRequest]);\r\n\r\n useEffect(() => {\r\n setPaymentsClient(new google.payments.api.PaymentsClient(paymentOptions));\r\n }, [paymentOptions]);\r\n\r\n useEffect(() => {\r\n createButton();\r\n }, [createButton])\r\n\r\n return {\r\n button,\r\n removeButton\r\n };\r\n}","import './style.scss';\r\n\r\nexport * from './payment-method';","import {registerExpressPaymentMethod} from '@woocommerce/blocks-registry';\r\nimport {getSettings, initStripe as loadStripe, isCartPage} from '../util';\r\nimport {useErrorMessage} from \"./hooks\";\r\nimport GooglePayButton from './button';\r\nimport {BASE_PAYMENT_METHOD, BASE_PAYMENT_REQUEST} from './constants';\r\nimport google from '@googlepay';\r\nimport {Elements} from \"@stripe/react-stripe-js\";\r\n\r\nconst getData = getSettings('stripe_googlepay_data');\r\n\r\nconst canMakePayment = (() => {\r\n const paymentsClient = new google.payments.api.PaymentsClient({\r\n environment: getData('environment'),\r\n merchantInfo: {\r\n merchantId: getData('merchantId'),\r\n merchantName: getData('merchantName')\r\n }\r\n });\r\n const isReadyToPayRequest = {...BASE_PAYMENT_REQUEST, allowedPaymentMethods: [BASE_PAYMENT_METHOD]};\r\n return paymentsClient.isReadyToPay(isReadyToPayRequest).then(() => {\r\n return true;\r\n }).catch(err => {\r\n console.log(err);\r\n return false;\r\n })\r\n})();\r\n\r\nconst GooglePayContent = ({getData, components, ...props}) => {\r\n const {ValidationInputError} = components;\r\n const {errorMessage, setErrorMessage} = useErrorMessage();\r\n return (\r\n <div className='wc-stripe-gpay-container'>\r\n <Elements stripe={loadStripe}>\r\n <GooglePayButton getData={getData}\r\n canMakePayment={canMakePayment}\r\n setErrorMessage={setErrorMessage}\r\n {...props}/>\r\n {errorMessage && <ValidationInputError errorMessage={errorMessage}/>}\r\n </Elements>\r\n </div>\r\n )\r\n}\r\n\r\nconst GooglePayEdit = ({getData, ...props}) => {\r\n const buttonType = getData('buttonStyle').buttonType;\r\n const src = getData('editorIcons')?.[buttonType] || 'long';\r\n return (\r\n <div className={`gpay-block-editor ${buttonType}`}>\r\n <img src={src}/>\r\n </div>\r\n )\r\n}\r\n\r\nregisterExpressPaymentMethod({\r\n name: getData('name'),\r\n canMakePayment: () => {\r\n if (getData('isAdmin')) {\r\n if (isCartPage()) {\r\n return getData('cartCheckoutEnabled');\r\n }\r\n return true;\r\n }\r\n if (isCartPage() && !getData('cartCheckoutEnabled')) {\r\n return false;\r\n }\r\n return loadStripe.then(stripe => {\r\n if (stripe.error) {\r\n return stripe;\r\n }\r\n return canMakePayment;\r\n });\r\n },\r\n content: <GooglePayContent getData={getData}/>,\r\n edit: <GooglePayEdit getData={getData}/>,\r\n supports: {\r\n showSavedCards: getData('showSavedCards'),\r\n showSaveOption: getData('showSaveOption'),\r\n features: getData('features')\r\n }\r\n})","import {getShippingOptionId, removeNumberPrecision, toCartAddress as mapAddressToCartAddress} from \"../util\";\r\nimport {formatPrice} from '../util';\r\nimport {getSetting} from '@woocommerce/settings'\r\n\r\nconst generalData = getSetting('stripeGeneralData');\r\n\r\nconst ADDRESS_MAPPINGS = {\r\n name: (address, name) => {\r\n address.first_name = name.split(' ').slice(0, -1).join(' ');\r\n address.last_name = name.split(' ').pop();\r\n return address;\r\n },\r\n countryCode: 'country',\r\n address1: 'address_1',\r\n address2: 'address_2',\r\n locality: 'city',\r\n administrativeArea: 'state',\r\n postalCode: 'postcode',\r\n email: 'email',\r\n phoneNumber: 'phone'\r\n}\r\n\r\nexport const getTransactionInfo = ({billing, processingCountry, totalPriceLabel}, status = 'ESTIMATED') => {\r\n const {cartTotal, cartTotalItems, currency} = billing;\r\n const transactionInfo = {\r\n countryCode: processingCountry,\r\n currencyCode: currency.code,\r\n totalPriceStatus: status,\r\n totalPrice: removeNumberPrecision(cartTotal.value, currency.minorUnit).toString(),\r\n displayItems: getDisplayItems(cartTotalItems, currency.minorUnit),\r\n totalPriceLabel\r\n }\r\n return transactionInfo;\r\n}\r\n\r\nexport const getPaymentRequestUpdate = ({billing, shippingData, processingCountry, totalPriceLabel}) => {\r\n const {needsShipping, shippingRates} = shippingData;\r\n let update = {\r\n newTransactionInfo: getTransactionInfo({\r\n billing, processingCountry, totalPriceLabel\r\n }, 'FINAL')\r\n }\r\n if (needsShipping) {\r\n update.newShippingOptionParameters = getShippingOptionParameters(shippingRates);\r\n }\r\n return update;\r\n}\r\n\r\n/**\r\n * Return an array of line item objects\r\n * @param cartTotalItems\r\n * @param unit\r\n * @returns {[]}\r\n */\r\nconst getDisplayItems = (cartTotalItems, unit = 2) => {\r\n let items = [];\r\n const keys = ['total_tax', 'total_shipping'];\r\n cartTotalItems.forEach(item => {\r\n if (0 < item.value || (item.key && keys.includes(item.key))) {\r\n items.push({\r\n label: item.label,\r\n type: 'LINE_ITEM',\r\n price: removeNumberPrecision(item.value, unit).toString()\r\n });\r\n }\r\n })\r\n return items;\r\n}\r\n\r\nexport const getShippingOptionParameters = (shippingRates) => {\r\n const shippingOptions = getShippingOptions(shippingRates);\r\n const shippingOptionIds = shippingOptions.map(option => option.id);\r\n let defaultSelectedOptionId = shippingOptionIds.slice(0, 1).shift();\r\n shippingRates.forEach((shippingPackage, idx) => {\r\n shippingPackage.shipping_rates.forEach(rate => {\r\n if (rate.selected) {\r\n defaultSelectedOptionId = getShippingOptionId(idx, rate.rate_id);\r\n }\r\n });\r\n });\r\n return {\r\n shippingOptions,\r\n defaultSelectedOptionId,\r\n }\r\n}\r\n\r\n//id label description\r\nexport const getShippingOptions = (shippingRates) => {\r\n let options = [];\r\n shippingRates.forEach((shippingPackage, idx) => {\r\n let rates = shippingPackage.shipping_rates.map(rate => {\r\n let txt = document.createElement('textarea');\r\n txt.innerHTML = rate.name;\r\n let price = formatPrice(rate.price, rate.currency_code);\r\n return {\r\n id: getShippingOptionId(idx, rate.rate_id),\r\n label: txt.value,\r\n description: `${price}`\r\n }\r\n });\r\n options = [...options, ...rates];\r\n });\r\n return options;\r\n}\r\n\r\nexport const toCartAddress = mapAddressToCartAddress(ADDRESS_MAPPINGS);\r\n","export * from './use-process-payment-intent';\r\nexport * from './use-after-process-payment';\r\nexport * from './use-setup-intent';\r\nexport * from './use-stripe-error';\r\nexport * from './use-exported-values';\r\nexport * from './use-payment-request';\r\nexport * from './use-payment-events';\r\nexport * from './use-breakpoint-width';\r\nexport * from './use-process-checkout-error'","import {useEffect} from '@wordpress/element'\r\nimport {useStripe} from \"@stripe/react-stripe-js\";\r\nimport {handleCardAction} from \"../util\";\r\nimport {useProcessCheckoutError} from \"./use-process-checkout-error\";\r\n\r\nexport const useAfterProcessingPayment = (\r\n {\r\n getData,\r\n eventRegistration,\r\n responseTypes,\r\n activePaymentMethod,\r\n savePaymentMethod = false,\r\n messageContext = null\r\n }) => {\r\n const stripe = useStripe();\r\n const {onCheckoutAfterProcessingWithSuccess, onCheckoutAfterProcessingWithError} = eventRegistration;\r\n useProcessCheckoutError({\r\n responseTypes,\r\n subscriber: onCheckoutAfterProcessingWithError,\r\n messageContext\r\n });\r\n useEffect(() => {\r\n let unsubscribeAfterProcessingWithSuccess = onCheckoutAfterProcessingWithSuccess(async ({redirectUrl}) => {\r\n if (getData('name') === activePaymentMethod) {\r\n //check if response is in redirect. If so, open modal\r\n return await handleCardAction({\r\n redirectUrl,\r\n responseTypes,\r\n stripe,\r\n getData,\r\n savePaymentMethod\r\n });\r\n }\r\n return null;\r\n })\r\n return () => unsubscribeAfterProcessingWithSuccess()\r\n }, [\r\n stripe,\r\n responseTypes,\r\n onCheckoutAfterProcessingWithSuccess,\r\n activePaymentMethod,\r\n savePaymentMethod\r\n ]);\r\n}","import {useState, useEffect, useCallback} from '@wordpress/element';\r\nimport {storeInCache, getFromCache} from \"../util\";\r\n\r\nexport const useBreakpointWidth = (\r\n {\r\n name,\r\n width,\r\n node,\r\n className\r\n }) => {\r\n const [windowWidth, setWindowWith] = useState(window.innerWidth);\r\n const getMaxWidth = useCallback((name) => {\r\n const maxWidth = getFromCache(name);\r\n return maxWidth ? parseInt(maxWidth) : 0;\r\n }, []);\r\n const setMaxWidth = useCallback((name, width) => storeInCache(name, width), []);\r\n\r\n useEffect(() => {\r\n const el = typeof node === 'function' ? node() : node;\r\n\r\n if (el) {\r\n const maxWidth = getMaxWidth(name);\r\n if (!maxWidth || width > maxWidth) {\r\n setMaxWidth(name, width);\r\n }\r\n if (el.clientWidth < width) {\r\n el.classList.add(className);\r\n } else {\r\n if (el.clientWidth > maxWidth) {\r\n el.classList.remove(className);\r\n }\r\n }\r\n }\r\n }, [windowWidth, node]);\r\n useEffect(() => {\r\n const handleResize = () => setWindowWith(window.innerWidth);\r\n window.addEventListener('resize', handleResize);\r\n return () => window.removeEventListener('resize', handleResize);\r\n });\r\n}\r\n\r\nexport const useExpressBreakpointWidth = (\r\n {\r\n payment_method,\r\n width\r\n }) => {\r\n const node = useCallback(() => {\r\n const el = document.getElementById(`express-payment-method-${payment_method}`);\r\n return el ? el.parentNode : null;\r\n }, []);\r\n useBreakpointWidth({\r\n name: 'expressMaxWidth',\r\n width,\r\n node,\r\n className: 'wc-stripe-express__sm'\r\n });\r\n\r\n}","import {useRef} from '@wordpress/element';\r\n\r\nexport const useExportedValues = () => {\r\n const exportedValues = useRef({});\r\n return exportedValues.current;\r\n}","import {useEffect, useCallback, useRef, useState} from '@wordpress/element';\r\nimport {hasShippingRates} from '../util';\r\n\r\nexport const usePaymentEvents = (\r\n {\r\n billing,\r\n shippingData,\r\n eventRegistration\r\n }) => {\r\n const {onShippingRateSuccess, onShippingRateFail, onShippingRateSelectSuccess} = eventRegistration;\r\n const currentBilling = useRef(billing);\r\n const currentShipping = useRef(shippingData);\r\n const [handler, setHandler] = useState(null);\r\n const [paymentEvents, setPaymentEvent] = useState({\r\n onShippingChanged: false\r\n });\r\n const addPaymentEvent = useCallback((name, handler, execute = false) => {\r\n if (execute) {\r\n setHandler({[name]: handler});\r\n } else {\r\n setPaymentEvent({...paymentEvents, [name]: handler});\r\n }\r\n }, [paymentEvents, setPaymentEvent]);\r\n const removePaymentEvent = useCallback((name) => {\r\n if (paymentEvents[name]) {\r\n delete paymentEvents[name];\r\n setPaymentEvent(paymentEvents);\r\n }\r\n }, [paymentEvents]);\r\n\r\n const onShippingChanged = useCallback(() => {\r\n const shipping = currentShipping.current;\r\n const billing = currentBilling.current;\r\n if (paymentEvents.onShippingChanged && !shipping.isSelectingRate && !shipping.shippingRatesLoading) {\r\n const handler = paymentEvents.onShippingChanged;\r\n let success = true;\r\n if (!hasShippingRates(shipping.shippingRates)) {\r\n success = false;\r\n }\r\n handler(success, {\r\n billing,\r\n shipping\r\n });\r\n removePaymentEvent('onShippingChanged');\r\n }\r\n }, [paymentEvents, removePaymentEvent]);\r\n\r\n useEffect(() => {\r\n currentBilling.current = billing;\r\n currentShipping.current = shippingData;\r\n });\r\n\r\n useEffect(() => {\r\n if (handler) {\r\n if (handler.onShippingChanged) {\r\n handler.onShippingChanged(true, {\r\n billing: currentBilling.current,\r\n shipping: currentShipping.current\r\n })\r\n setHandler(null);\r\n }\r\n }\r\n }, [handler]);\r\n\r\n useEffect(() => {\r\n const unsubscribeShippingRateSuccess = onShippingRateSuccess(onShippingChanged);\r\n const unsubscribeShippingRateSelectSuccess = onShippingRateSelectSuccess(onShippingChanged);\r\n const unsubscribeShippingRateFail = onShippingRateFail(({hasInvalidAddress, hasError}) => {\r\n if (paymentEvents.onShippingChanged) {\r\n const handler = paymentEvents.onShippingChanged;\r\n handler(false);\r\n removePaymentEvent('onShippingChanged');\r\n }\r\n });\r\n\r\n return () => {\r\n unsubscribeShippingRateSuccess();\r\n unsubscribeShippingRateFail();\r\n unsubscribeShippingRateSelectSuccess();\r\n }\r\n }, [\r\n paymentEvents,\r\n onShippingRateSuccess,\r\n onShippingRateFail,\r\n onShippingRateSelectSuccess\r\n ]);\r\n\r\n return {addPaymentEvent, removePaymentEvent};\r\n}","import {useState, useEffect, useRef, useCallback} from '@wordpress/element';\r\nimport {usePaymentEvents} from './use-payment-events';\r\nimport {getIntermediateAddress} from '../util';\r\nimport isShallowEqual from '@wordpress/is-shallow-equal';\r\nimport {\r\n getDisplayItems,\r\n getShippingOptions,\r\n getSelectedShippingOption,\r\n isFieldRequired,\r\n toCartAddress as mapToCartAddress\r\n} from \"../util\";\r\n\r\nconst toCartAddress = mapToCartAddress();\r\n\r\nexport const usePaymentRequest = (\r\n {\r\n getData,\r\n onClose,\r\n stripe,\r\n billing,\r\n shippingData,\r\n eventRegistration,\r\n setPaymentMethod,\r\n exportedValues,\r\n canPay\r\n }) => {\r\n const {addPaymentEvent} = usePaymentEvents({\r\n billing,\r\n shippingData,\r\n eventRegistration\r\n });\r\n const {shippingAddress, needsShipping, shippingRates} = shippingData;\r\n const {billingData, cartTotalItems, currency, cartTotal} = billing;\r\n const [paymentRequest, setPaymentRequest] = useState(null);\r\n const paymentRequestOptions = useRef({});\r\n const currentShipping = useRef(shippingData)\r\n const currentBilling = useRef(billing);\r\n\r\n useEffect(() => {\r\n currentShipping.current = shippingData;\r\n currentBilling.current = billing;\r\n }, [shippingData]);\r\n\r\n useEffect(() => {\r\n if (stripe) {\r\n const options = {\r\n country: getData('countryCode'),\r\n currency: currency?.code.toLowerCase(),\r\n total: {\r\n amount: cartTotal.value,\r\n label: cartTotal.label,\r\n pending: true\r\n },\r\n requestPayerName: true,\r\n requestPayerEmail: isFieldRequired('email', billingData.country),\r\n requestPayerPhone: isFieldRequired('phone', billingData.country),\r\n requestShipping: needsShipping,\r\n displayItems: getDisplayItems(cartTotalItems, currency)\r\n }\r\n if (options.requestShipping) {\r\n options.shippingOptions = getShippingOptions(shippingRates);\r\n }\r\n paymentRequestOptions.current = options;\r\n const paymentRequest = stripe.paymentRequest(paymentRequestOptions.current);\r\n paymentRequest.canMakePayment().then(result => {\r\n if (canPay(result)) {\r\n setPaymentRequest(paymentRequest);\r\n } else {\r\n setPaymentRequest(null);\r\n }\r\n });\r\n }\r\n }, [\r\n stripe,\r\n cartTotal.value,\r\n billingData.country,\r\n shippingRates,\r\n cartTotalItems,\r\n currency.code\r\n ]);\r\n\r\n useEffect(() => {\r\n if (paymentRequest) {\r\n if (paymentRequestOptions.current.requestShipping) {\r\n paymentRequest.on('shippingaddresschange', onShippingAddressChange);\r\n paymentRequest.on('shippingoptionchange', onShippingOptionChange);\r\n }\r\n paymentRequest.on('cancel', onClose);\r\n paymentRequest.on('paymentmethod', onPaymentMethodReceived);\r\n }\r\n }, [\r\n paymentRequest,\r\n onShippingAddressChange,\r\n onClose,\r\n onPaymentMethodReceived\r\n ]);\r\n\r\n const updatePaymentEvent = useCallback((event) => (success, {billing, shipping}) => {\r\n const {cartTotal, cartTotalItems, currency} = billing;\r\n const {shippingRates} = shipping;\r\n if (success) {\r\n event.updateWith({\r\n status: 'success',\r\n total: {\r\n amount: cartTotal.value,\r\n label: cartTotal.label,\r\n pending: false\r\n },\r\n displayItems: getDisplayItems(cartTotalItems, currency),\r\n shippingOptions: getShippingOptions(shippingRates)\r\n });\r\n } else {\r\n event.updateWith({status: 'invalid_shipping_address'});\r\n }\r\n }, []);\r\n\r\n const onShippingAddressChange = useCallback(event => {\r\n const {shippingAddress} = event;\r\n const shipping = currentShipping.current;\r\n const intermediateAddress = toCartAddress(shippingAddress);\r\n shipping.setShippingAddress({...shipping.shippingAddress, ...intermediateAddress});\r\n const addressEqual = isShallowEqual(getIntermediateAddress(shipping.shippingAddress), intermediateAddress);\r\n addPaymentEvent('onShippingChanged', updatePaymentEvent(event), addressEqual);\r\n }, [addPaymentEvent]);\r\n\r\n const onShippingOptionChange = useCallback(event => {\r\n const {shippingOption} = event;\r\n const shipping = currentShipping.current;\r\n shipping.setSelectedRates(...getSelectedShippingOption(shippingOption.id));\r\n addPaymentEvent('onShippingChanged', updatePaymentEvent(event));\r\n }, [addPaymentEvent]);\r\n\r\n const onPaymentMethodReceived = useCallback((paymentResponse) => {\r\n const {paymentMethod, payerName = null, payerEmail = null, payerPhone = null} = paymentResponse;\r\n // set address data\r\n let billingData = {payerName, payerEmail, payerPhone};\r\n if (paymentMethod?.billing_details.address) {\r\n billingData = toCartAddress(paymentMethod.billing_details.address, billingData);\r\n }\r\n exportedValues.billingData = billingData;\r\n\r\n if (paymentResponse.shippingAddress) {\r\n exportedValues.shippingAddress = toCartAddress(paymentResponse.shippingAddress);\r\n }\r\n\r\n // set payment method\r\n setPaymentMethod(paymentMethod.id);\r\n paymentResponse.complete(\"success\");\r\n }, []);\r\n\r\n return {paymentRequest};\r\n}","import {useEffect} from '@wordpress/element';\r\n\r\nexport const useProcessCheckoutError = (\r\n {\r\n responseTypes,\r\n subscriber,\r\n messageContext = null\r\n }) => {\r\n useEffect(() => {\r\n const unsubscribe = subscriber((data) => {\r\n if (data?.processingResponse.paymentDetails?.stripeErrorMessage) {\r\n return {\r\n type: responseTypes.ERROR,\r\n message: data.processingResponse.paymentDetails.stripeErrorMessage,\r\n messageContext\r\n };\r\n }\r\n return null;\r\n });\r\n return () => unsubscribe();\r\n }, [responseTypes, subscriber]);\r\n}","import {useEffect, useState, useCallback, useRef} from '@wordpress/element';\r\nimport {useStripe} from '@stripe/react-stripe-js';\r\nimport {\r\n ensureSuccessResponse,\r\n ensureErrorResponse,\r\n getBillingDetailsFromAddress,\r\n StripeError\r\n} from '../util';\r\n\r\nexport const useProcessPaymentIntent = (\r\n {\r\n getData,\r\n billing,\r\n shippingData,\r\n onPaymentProcessing,\r\n emitResponse,\r\n error,\r\n onSubmit,\r\n activePaymentMethod,\r\n paymentType = 'card',\r\n setupIntent = null,\r\n removeSetupIntent = null,\r\n savePaymentMethod = false,\r\n exportedValues = {},\r\n getPaymentMethodArgs = () => ({})\r\n }) => {\r\n const {billingData} = billing;\r\n const {shippingAddress} = shippingData;\r\n const {responseTypes} = emitResponse;\r\n const [paymentMethod, setPaymentMethod] = useState(null);\r\n const stripe = useStripe();\r\n const currentPaymentMethodArgs = useRef(getPaymentMethodArgs);\r\n\r\n useEffect(() => {\r\n currentPaymentMethodArgs.current = getPaymentMethodArgs;\r\n }, [getPaymentMethodArgs]);\r\n\r\n const getCreatePaymentMethodArgs = useCallback(() => {\r\n const args = {\r\n type: paymentType,\r\n billing_details: getBillingDetailsFromAddress(exportedValues?.billingData ? exportedValues.billingData : billingData)\r\n }\r\n return {...args, ...currentPaymentMethodArgs.current()};\r\n }, [billingData, paymentType, getPaymentMethodArgs]);\r\n\r\n const getSuccessResponse = useCallback((paymentMethodId, savePaymentMethod) => {\r\n const response = {\r\n meta: {\r\n paymentMethodData: {\r\n [`${getData('name')}_token_key`]: paymentMethodId,\r\n [`${getData('name')}_save_source_key`]: savePaymentMethod\r\n }\r\n }\r\n }\r\n if (exportedValues?.billingData) {\r\n response.meta.billingData = exportedValues.billingData;\r\n }\r\n if (exportedValues?.shippingAddress) {\r\n response.meta.shippingData = {address: exportedValues.shippingAddress};\r\n }\r\n return response;\r\n }, [billingData, shippingAddress]);\r\n\r\n useEffect(() => {\r\n if (paymentMethod && typeof paymentMethod === 'string') {\r\n onSubmit();\r\n }\r\n }, [paymentMethod, onSubmit]);\r\n\r\n useEffect(() => {\r\n const unsubscribeProcessingPayment = onPaymentProcessing(async () => {\r\n if (activePaymentMethod !== getData('name')) {\r\n return null;\r\n }\r\n let [result, paymentMethodId] = [null, null];\r\n try {\r\n if (error) {\r\n throw new StripeError(error);\r\n }\r\n if (setupIntent) {\r\n result = await stripe.confirmCardSetup(setupIntent.client_secret, {\r\n payment_method: getCreatePaymentMethodArgs()\r\n });\r\n if (result.error) {\r\n throw new StripeError(result.error);\r\n }\r\n paymentMethodId = result.setupIntent.payment_method;\r\n removeSetupIntent();\r\n } else {\r\n // payment method has already been created.\r\n if (paymentMethod) {\r\n paymentMethodId = paymentMethod;\r\n } else {\r\n //create the payment method\r\n result = await stripe.createPaymentMethod(getCreatePaymentMethodArgs());\r\n if (result.error) {\r\n throw new StripeError(result.error);\r\n }\r\n paymentMethodId = result.paymentMethod.id;\r\n }\r\n }\r\n return ensureSuccessResponse(responseTypes, getSuccessResponse(paymentMethodId, savePaymentMethod));\r\n } catch (e) {\r\n console.log(e);\r\n setPaymentMethod(null);\r\n return ensureErrorResponse(responseTypes, e.error);\r\n }\r\n\r\n });\r\n return () => unsubscribeProcessingPayment();\r\n }, [\r\n paymentMethod,\r\n billingData,\r\n onPaymentProcessing,\r\n stripe,\r\n setupIntent,\r\n activePaymentMethod,\r\n savePaymentMethod\r\n ]);\r\n return {setPaymentMethod};\r\n}","import {useEffect, useState, useCallback} from '@wordpress/element';\r\nimport apiFetch from \"@wordpress/api-fetch\";\r\nimport {\r\n getSettings,\r\n getRoute,\r\n cartContainsPreOrder,\r\n cartContainsSubscription,\r\n getFromCache,\r\n storeInCache,\r\n deleteFromCache\r\n} from '../util';\r\n\r\nexport const useSetupIntent = (\r\n {\r\n cartTotal,\r\n setError\r\n }) => {\r\n const [setupIntent, setSetupIntent] = useState(getFromCache('setupIntent'));\r\n\r\n useEffect(() => {\r\n const createSetupIntent = async () => {\r\n if (setupIntent) {\r\n return;\r\n }\r\n // only create intent under certain conditions\r\n let result = await apiFetch({\r\n url: getRoute('create/setup_intent'),\r\n method: 'POST'\r\n });\r\n if (result.code) {\r\n setError(result.message);\r\n } else {\r\n storeInCache('setupIntent', result.intent);\r\n setSetupIntent(result.intent);\r\n }\r\n }\r\n if (cartContainsPreOrder() || (cartContainsSubscription() && cartTotal.value == 0)) {\r\n if (!setupIntent) {\r\n createSetupIntent();\r\n }\r\n } else {\r\n setSetupIntent(null);\r\n }\r\n }, [cartTotal.value]);\r\n const removeSetupIntent = useCallback(() => {\r\n deleteFromCache('setupIntent');\r\n }, [cartTotal.value]);\r\n return {setupIntent, removeSetupIntent};\r\n}","import {useState} from '@wordpress/element'\r\n\r\nexport const useStripeError = () => {\r\n const [error, setError] = useState(false);\r\n return [error, setError];\r\n}","import {useState, useEffect} from '@wordpress/element';\r\nimport {registerPaymentMethod} from '@woocommerce/blocks-registry';\r\nimport {getSettings, initStripe} from \"../util\";\r\nimport {LocalPaymentIntentContent} from './local-payment-method';\r\nimport {PaymentMethod} from \"../../components/checkout\";\r\nimport {canMakePayment} from \"./local-payment-method\";\r\nimport {AfterpayClearpayMessageElement, Elements} from \"@stripe/react-stripe-js\";\r\nimport {sprintf, __} from '@wordpress/i18n';\r\n\r\nconst getData = getSettings('stripe_afterpay_data');\r\nlet variablesHandler;\r\nconst setVariablesHandler = (handler) => {\r\n variablesHandler = handler;\r\n}\r\nconst PaymentMethodLabel = ({getData}) => {\r\n const [variables, setVariables] = useState({\r\n amount: getData('cartTotal'),\r\n currency: getData('currency'),\r\n isEligible: getData('msgOptions').isEligible\r\n });\r\n const options = {\r\n locale: 'auto'\r\n }\r\n if (variables.currency === 'GBP' && !['fr-FR', 'it-IT', 'es-ES'].includes(getData('locale'))) {\r\n options.locale = 'en-GB';\r\n }\r\n setVariablesHandler(setVariables);\r\n return (\r\n <Elements stripe={initStripe} options={options}>\r\n <div className='wc-stripe-blocks-afterpay__label'>\r\n <AfterpayClearpayMessageElement options={{\r\n ...getData('msgOptions'),\r\n ...{\r\n amount: variables.amount,\r\n currency: variables.currency,\r\n isEligible: variables.isEligible\r\n }\r\n }}/>\r\n </div>\r\n </Elements>\r\n );\r\n}\r\n\r\nconst AfterpayPaymentMethod = ({content, billing, shippingData, ...props}) => {\r\n const Content = content;\r\n const {cartTotal, currency} = billing;\r\n const {needsShipping} = shippingData\r\n useEffect(() => {\r\n variablesHandler({\r\n amount: cartTotal.value,\r\n currency: currency.code,\r\n isEligible: needsShipping\r\n });\r\n }, [\r\n cartTotal.value,\r\n currency.code,\r\n needsShipping\r\n ]);\r\n return (\r\n <>\r\n {needsShipping &&\r\n <div className='wc-stripe-blocks-payment-method-content'>\r\n <div className=\"wc-stripe-blocks-afterpay-offsite__container\">\r\n <div className=\"wc-stripe-blocks-afterpay__offsite\">\r\n <img src={getData('offSiteSrc')}/>\r\n <p>{sprintf(__('After clicking \"%s\", you will be redirected to Afterpay to complete your purchase securely.', 'woo-stripe-payment'), getData('placeOrderButtonLabel'))}</p>\r\n </div>\r\n </div>\r\n <Content {...{...props, billing, shippingData}}/>\r\n </div>}\r\n </>\r\n );\r\n}\r\n\r\nif (getData()) {\r\n registerPaymentMethod({\r\n name: getData('name'),\r\n label: <PaymentMethodLabel\r\n getData={getData}/>,\r\n ariaLabel: __('Afterpay', 'woo-stripe-payment'),\r\n placeOrderButtonLabel: getData('placeOrderButtonLabel'),\r\n canMakePayment: canMakePayment(getData, ({settings, cartTotals, cartNeedsShipping}) => {\r\n const {currency_code: currency, currency_minor_unit, total_price} = cartTotals;\r\n const requiredParams = settings('requiredParams');\r\n const accountCountry = settings('accountCountry');\r\n const requiredParamObj = requiredParams[currency] ? requiredParams[currency] : false;\r\n if (variablesHandler) {\r\n variablesHandler({\r\n amount: parseInt(cartTotals.total_price),\r\n currency,\r\n isEligible: cartNeedsShipping\r\n });\r\n }\r\n const total = parseInt(total_price) / 10 ** currency_minor_unit;\r\n const available = accountCountry === requiredParamObj?.[0] && cartNeedsShipping && (total > requiredParamObj?.[1] && total < requiredParamObj?.[2]);\r\n if (!available && !settings('hideIneligible')) {\r\n return true;\r\n }\r\n return available;\r\n }),\r\n content: <AfterpayPaymentMethod\r\n content={LocalPaymentIntentContent}\r\n getData={getData}\r\n confirmationMethod={'confirmAfterpayClearpayPayment'}/>,\r\n edit: <PaymentMethod content={LocalPaymentIntentContent} getData={getData}/>,\r\n supports: {\r\n showSavedCards: false,\r\n showSaveOption: false,\r\n features: getData('features')\r\n }\r\n })\r\n}","import {registerPaymentMethod} from '@woocommerce/blocks-registry';\r\nimport {getSettings} from \"../util\";\r\nimport {LocalPaymentSourceContent} from './local-payment-method';\r\nimport {PaymentMethodLabel} from \"../../components/checkout/payment-method-label\";\r\nimport {canMakePayment} from \"./local-payment-method\";\r\nimport {PaymentMethod} from \"../../components/checkout\";\r\n\r\nconst getData = getSettings('stripe_alipay_data');\r\n\r\nif (getData()) {\r\n registerPaymentMethod({\r\n name: getData('name'),\r\n label: <PaymentMethodLabel\r\n title={getData('title')}\r\n paymentMethod={getData('name')}\r\n icons={getData('icon')}/>,\r\n ariaLabel: 'Alipay',\r\n placeOrderButtonLabel: getData('placeOrderButtonLabel'),\r\n canMakePayment: canMakePayment(getData),\r\n content: <PaymentMethod\r\n content={LocalPaymentSourceContent}\r\n getData={getData}/>,\r\n edit: <PaymentMethod\r\n content={LocalPaymentSourceContent}\r\n getData={getData}/>,\r\n supports: {\r\n showSavedCards: false,\r\n showSaveOption: false,\r\n features: getData('features')\r\n }\r\n })\r\n}\r\n","import {registerPaymentMethod} from '@woocommerce/blocks-registry';\r\nimport {getSettings} from \"../util\";\r\nimport {LocalPaymentSourceContent} from './local-payment-method';\r\nimport {PaymentMethodLabel, PaymentMethod} from \"../../components/checkout\";\r\nimport {canMakePayment} from \"./local-payment-method\";\r\n\r\nconst getData = getSettings('stripe_bancontact_data');\r\n\r\nif (getData()) {\r\n registerPaymentMethod({\r\n name: getData('name'),\r\n label: <PaymentMethodLabel\r\n title={getData('title')}\r\n paymentMethod={getData('name')}\r\n icons={getData('icon')}/>,\r\n ariaLabel: 'Bancontact',\r\n placeOrderButtonLabel: getData('placeOrderButtonLabel'),\r\n canMakePayment: canMakePayment(getData),\r\n content: <PaymentMethod\r\n content={LocalPaymentSourceContent}\r\n getData={getData}/>,\r\n edit: <PaymentMethod\r\n content={LocalPaymentSourceContent}\r\n getData={getData}/>,\r\n supports: {\r\n showSavedCards: false,\r\n showSaveOption: false,\r\n features: getData('features')\r\n }\r\n })\r\n}","import {registerPaymentMethod} from '@woocommerce/blocks-registry';\r\nimport {getSettings} from \"../util\";\r\nimport {LocalPaymentIntentContent} from './local-payment-method';\r\nimport {PaymentMethodLabel, PaymentMethod} from \"../../components/checkout\";\r\nimport {canMakePayment} from \"./local-payment-method\";\r\nimport {AuBankAccountElement} from \"@stripe/react-stripe-js\";\r\n\r\nconst getData = getSettings('stripe_becs_data');\r\n\r\nif (getData()) {\r\n registerPaymentMethod({\r\n name: getData('name'),\r\n label: <PaymentMethodLabel\r\n title={getData('title')}\r\n paymentMethod={getData('name')}\r\n icons={getData('icon')}/>,\r\n ariaLabel: 'BECS',\r\n placeOrderButtonLabel: getData('placeOrderButtonLabel'),\r\n canMakePayment: canMakePayment(getData),\r\n content: <PaymentMethod\r\n content={LocalPaymentIntentContent}\r\n getData={getData}\r\n confirmationMethod={'confirmAuBecsDebitPayment'}\r\n component={AuBankAccountElement}/>,\r\n edit: <PaymentMethod content={LocalPaymentIntentContent} getData={getData}/>,\r\n supports: {\r\n showSavedCards: false,\r\n showSaveOption: false,\r\n features: getData('features')\r\n }\r\n })\r\n}","import {useState, useEffect, useCallback} from '@wordpress/element';\r\nimport {__} from '@wordpress/i18n';\r\nimport {registerPaymentMethod} from '@woocommerce/blocks-registry';\r\nimport classnames from 'classnames';\r\nimport {ensureErrorResponse, getSettings, isTestMode} from \"../util\";\r\nimport {LocalPaymentIntentContent} from './local-payment-method';\r\nimport {PaymentMethodLabel, PaymentMethod} from \"../../components/checkout\";\r\nimport {canMakePayment} from \"./local-payment-method\";\r\n\r\nconst getData = getSettings('stripe_boleto_data');\r\n\r\nconst BoletoPaymentMethodContainer = ({eventRegistration, ...props}) => {\r\n const [taxId, setTaxId] = useState('');\r\n const [isActive, setIsActive] = useState(false);\r\n const {onPaymentProcessing} = eventRegistration;\r\n const callback = useCallback(() => {\r\n return {\r\n boleto: {\r\n tax_id: taxId\r\n }\r\n };\r\n }, [taxId]);\r\n\r\n useEffect(() => {\r\n const unsubscribe = onPaymentProcessing(() => {\r\n if (!taxId) {\r\n return ensureErrorResponse(props.emitResponse.responseTypes, __('Please enter a valid CPF/CNPJ value', 'woo-stripe-payment'));\r\n }\r\n return true;\r\n })\r\n return () => unsubscribe();\r\n }, [onPaymentProcessing, taxId]);\r\n return (\r\n <>\r\n <div className={classnames('wc-block-components-text-input', {\r\n 'is-active': isActive || taxId\r\n })}>\r\n <input\r\n type='text'\r\n id='wc-stripe-boleto-tax_id'\r\n onChange={(e) => setTaxId(e.target.value)}\r\n onFocus={() => setIsActive(true)}\r\n onBlur={() => setIsActive(false)}/>\r\n <label htmlFor='wc-stripe-boleto-tax_id'>{__(' CPF / CNPJ', ' woo-stripe-payment')}</label>\r\n </div>\r\n {isTestMode() &&\r\n <div className='wc-stripe-boleto__description'>\r\n <p>{__('Test mode values', 'woo-stripe-payment')}</p>\r\n <div>\r\n <label>CPF:</label> <span>000.000.000-00</span>\r\n </div>\r\n <div>\r\n <label>CNPJ:</label> <span>00.000.000/0000-00</span>\r\n </div>\r\n </div>}\r\n {!isTestMode() &&\r\n <div className=\"wc-stripe-boleto__description\">\r\n <p>{__('Accepted formats', 'woo-stripe-payment')}</p>\r\n <div>\r\n <label>CPF:</label> \r\n <span>{__('XXX.XXX.XXX-XX or XXXXXXXXXXX', 'woo-stripe-payment')}</span>\r\n </div>\r\n <div>\r\n <label>CNPJ:</label> \r\n <span>{__('XX.XXX.XXX/XXXX-XX or XXXXXXXXXXXXXX', 'woo-stripe-payment')}</span>\r\n </div>\r\n </div>}\r\n <LocalPaymentIntentContent callback={callback} {...{...props, ...{eventRegistration}}}/>\r\n </>\r\n )\r\n}\r\n\r\nif (getData()) {\r\n registerPaymentMethod({\r\n name: getData('name'),\r\n label: <PaymentMethodLabel\r\n title={getData('title')}\r\n paymentMethod={getData('name')}\r\n icons={getData('icon')}/>,\r\n ariaLabel: 'Boleto',\r\n placeOrderButtonLabel: getData('placeOrderButtonLabel'),\r\n canMakePayment: canMakePayment(getData),\r\n content: <PaymentMethod\r\n content={BoletoPaymentMethodContainer}\r\n getData={getData}\r\n confirmationMethod={'confirmBoletoPayment'}/>,\r\n edit: <PaymentMethod content={LocalPaymentIntentContent} getData={getData}/>,\r\n supports: {\r\n showSavedCards: false,\r\n showSaveOption: false,\r\n features: getData('features')\r\n }\r\n })\r\n}","import {registerPaymentMethod} from '@woocommerce/blocks-registry';\r\nimport {getSettings} from \"../util\";\r\nimport {LocalPaymentSourceContent} from './local-payment-method';\r\nimport {PaymentMethodLabel, PaymentMethod} from \"../../components/checkout\";\r\nimport {canMakePayment} from \"./local-payment-method\";\r\n\r\nconst getData = getSettings('stripe_eps_data');\r\n\r\nif (getData()) {\r\n registerPaymentMethod({\r\n name: getData('name'),\r\n label: <PaymentMethodLabel\r\n title={getData('title')}\r\n paymentMethod={getData('name')}\r\n icons={getData('icon')}/>,\r\n ariaLabel: 'EPS',\r\n placeOrderButtonLabel: getData('placeOrderButtonLabel'),\r\n canMakePayment: canMakePayment(getData),\r\n content: <PaymentMethod content={LocalPaymentSourceContent} getData={getData}/>,\r\n edit: <PaymentMethod content={LocalPaymentSourceContent} getData={getData}/>,\r\n supports: {\r\n showSavedCards: false,\r\n showSaveOption: false,\r\n features: getData('features')\r\n }\r\n })\r\n}","import {registerPaymentMethod} from '@woocommerce/blocks-registry';\r\nimport {getSettings} from \"../util\";\r\nimport {LocalPaymentIntentContent} from './local-payment-method';\r\nimport {PaymentMethodLabel, PaymentMethod} from \"../../components/checkout\";\r\nimport {canMakePayment} from \"./local-payment-method\";\r\nimport {FpxBankElement} from \"@stripe/react-stripe-js\";\r\n\r\nconst getData = getSettings('stripe_fpx_data');\r\n\r\nif (getData()) {\r\n registerPaymentMethod({\r\n name: getData('name'),\r\n label: <PaymentMethodLabel\r\n title={getData('title')}\r\n paymentMethod={getData('name')}\r\n icons={getData('icon')}/>,\r\n ariaLabel: 'FPX',\r\n placeOrderButtonLabel: getData('placeOrderButtonLabel'),\r\n canMakePayment: canMakePayment(getData),\r\n content: <PaymentMethod\r\n content={LocalPaymentIntentContent}\r\n getData={getData}\r\n confirmationMethod={'confirmIdealPayment'}\r\n component={FpxBankElement}/>,\r\n edit: <PaymentMethod content={LocalPaymentIntentContent} getData={getData}/>,\r\n supports: {\r\n showSavedCards: false,\r\n showSaveOption: false,\r\n features: getData('features')\r\n }\r\n })\r\n}","import {registerPaymentMethod} from '@woocommerce/blocks-registry';\r\nimport {getSettings} from \"../util\";\r\nimport {LocalPaymentSourceContent} from './local-payment-method';\r\nimport {PaymentMethodLabel, PaymentMethod} from \"../../components/checkout\";\r\nimport {canMakePayment} from \"./local-payment-method\";\r\n\r\nconst getData = getSettings('stripe_giropay_data');\r\n\r\nif (getData()) {\r\n registerPaymentMethod({\r\n name: getData('name'),\r\n label: <PaymentMethodLabel\r\n title={getData('title')}\r\n paymentMethod={getData('name')}\r\n icons={getData('icon')}/>,\r\n ariaLabel: 'Giropay',\r\n placeOrderButtonLabel: getData('placeOrderButtonLabel'),\r\n canMakePayment: canMakePayment(getData),\r\n content: <PaymentMethod content={LocalPaymentSourceContent} getData={getData}/>,\r\n edit: <PaymentMethod content={LocalPaymentSourceContent} getData={getData}/>,\r\n supports: {\r\n showSavedCards: false,\r\n showSaveOption: false,\r\n features: getData('features')\r\n }\r\n })\r\n}","import {registerPaymentMethod} from '@woocommerce/blocks-registry';\r\nimport {getSettings} from \"../util\";\r\nimport {LocalPaymentIntentContent} from './local-payment-method';\r\nimport {PaymentMethodLabel, PaymentMethod} from \"../../components/checkout\";\r\nimport {canMakePayment} from \"./local-payment-method\";\r\n\r\nconst getData = getSettings('stripe_grabpay_data');\r\n\r\nif (getData()) {\r\n registerPaymentMethod({\r\n name: getData('name'),\r\n label: <PaymentMethodLabel\r\n title={getData('title')}\r\n paymentMethod={getData('name')}\r\n icons={getData('icon')}/>,\r\n ariaLabel: 'GrabPay',\r\n placeOrderButtonLabel: getData('placeOrderButtonLabel'),\r\n canMakePayment: canMakePayment(getData),\r\n content: <PaymentMethod\r\n content={LocalPaymentIntentContent}\r\n getData={getData}\r\n confirmationMethod={'confirmGrabPayPayment'}/>,\r\n edit: <PaymentMethod content={LocalPaymentIntentContent} getData={getData}/>,\r\n supports: {\r\n showSavedCards: false,\r\n showSaveOption: false,\r\n features: getData('features')\r\n }\r\n })\r\n}","export * from './use-after-process-local-payment';\r\nexport * from './use-validate-checkout';\r\nexport * from './use-create-source';","import {useEffect, useRef} from '@wordpress/element';\r\nimport {useStripe} from \"@stripe/react-stripe-js\";\r\nimport {ensureErrorResponse, getBillingDetailsFromAddress, StripeError} from \"../../util\";\r\n\r\nexport const useAfterProcessLocalPayment = (\r\n {\r\n getData,\r\n billingData,\r\n eventRegistration,\r\n responseTypes,\r\n activePaymentMethod,\r\n confirmationMethod,\r\n getPaymentMethodArgs = () => ({})\r\n }\r\n) => {\r\n const stripe = useStripe();\r\n const {onCheckoutAfterProcessingWithSuccess, onCheckoutAfterProcessingWithError} = eventRegistration;\r\n const currentBillingData = useRef(billingData);\r\n const currentPaymentMethodArgs = useRef(getPaymentMethodArgs);\r\n useEffect(() => {\r\n currentBillingData.current = billingData;\r\n }, [billingData]);\r\n\r\n useEffect(() => {\r\n currentPaymentMethodArgs.current = getPaymentMethodArgs;\r\n }, [getPaymentMethodArgs]);\r\n\r\n useEffect(() => {\r\n const unsubscribeAfterProcessingWithSuccess = onCheckoutAfterProcessingWithSuccess(async ({redirectUrl}) => {\r\n if (getData('name') === activePaymentMethod) {\r\n try {\r\n let match = redirectUrl.match(/#response=(.+)/);\r\n if (match) {\r\n let {client_secret, return_url, ...order} = JSON.parse(window.atob(decodeURIComponent(match[1])));\r\n let result = await stripe[confirmationMethod](client_secret, {\r\n payment_method: {\r\n billing_details: getBillingDetailsFromAddress(currentBillingData.current),\r\n ...currentPaymentMethodArgs.current()\r\n },\r\n return_url\r\n });\r\n if (result.error) {\r\n throw new StripeError(result.error);\r\n }\r\n window.location = decodeURI(order.order_received_url);\r\n }\r\n } catch (e) {\r\n console.log(e);\r\n return ensureErrorResponse(responseTypes, e.error);\r\n }\r\n }\r\n })\r\n return () => unsubscribeAfterProcessingWithSuccess();\r\n }, [\r\n stripe,\r\n onCheckoutAfterProcessingWithSuccess,\r\n onCheckoutAfterProcessingWithError\r\n ]);\r\n}","import {useState, useEffect, useRef, useCallback} from '@wordpress/element';\r\nimport {\r\n getDefaultSourceArgs,\r\n ensureSuccessResponse,\r\n ensureErrorResponse,\r\n StripeError\r\n} from \"../../util\";\r\nimport {useStripe, useElements} from \"@stripe/react-stripe-js\";\r\nimport {__} from '@wordpress/i18n';\r\n\r\nexport const useCreateSource = (\r\n {\r\n getData,\r\n billing,\r\n shippingAddress,\r\n onPaymentProcessing,\r\n responseTypes,\r\n getSourceArgs = false,\r\n element = false\r\n }) => {\r\n const [source, setSource] = useState(false);\r\n const [isValid, setIsValid] = useState(false);\r\n const currentValues = useRef({\r\n billing,\r\n shippingAddress,\r\n });\r\n const stripe = useStripe();\r\n const elements = useElements();\r\n useEffect(() => {\r\n currentValues.current = {\r\n billing,\r\n shippingAddress\r\n }\r\n });\r\n\r\n const getSourceArgsInternal = useCallback(() => {\r\n const {billing} = currentValues.current;\r\n const {cartTotal, currency, billingData} = billing;\r\n let args = getDefaultSourceArgs({\r\n type: getData('paymentType'),\r\n amount: cartTotal.value,\r\n billingData,\r\n currency: currency.code,\r\n returnUrl: getData('returnUrl')\r\n });\r\n if (getSourceArgs) {\r\n args = getSourceArgs(args, {billingData});\r\n }\r\n return args;\r\n }, []);\r\n\r\n const getSuccessData = useCallback((sourceId) => {\r\n return {\r\n meta: {\r\n paymentMethodData: {\r\n [`${getData('name')}_token_key`]: sourceId\r\n }\r\n }\r\n }\r\n }, []);\r\n\r\n useEffect(() => {\r\n const unsubscribe = onPaymentProcessing(async () => {\r\n if (source) {\r\n return ensureSuccessResponse(responseTypes, getSuccessData(source.id));\r\n }\r\n // create the source\r\n try {\r\n let result;\r\n if (element) {\r\n // validate the element\r\n if (!isValid) {\r\n throw __('Please enter your payment info before proceeding.', 'woo-stripe-payment');\r\n }\r\n result = await stripe.createSource(elements.getElement(element), getSourceArgsInternal());\r\n } else {\r\n result = await stripe.createSource(getSourceArgsInternal());\r\n }\r\n if (result.error) {\r\n throw new StripeError(result.error);\r\n }\r\n setSource(result.source);\r\n return ensureSuccessResponse(responseTypes, getSuccessData(result.source.id));\r\n } catch (err) {\r\n console.log(err);\r\n return ensureErrorResponse(responseTypes, err.error || err);\r\n }\r\n });\r\n return () => unsubscribe();\r\n }, [\r\n source,\r\n onPaymentProcessing,\r\n stripe,\r\n responseTypes,\r\n element,\r\n isValid,\r\n setIsValid\r\n ]);\r\n return {setIsValid};\r\n}","import {useEffect, useRef, useState} from '@wordpress/element';\r\nimport {ensureErrorResponse} from \"../../util\";\r\nimport {__} from \"@wordpress/i18n\";\r\n\r\nexport const useValidateCheckout = (\r\n {\r\n subscriber,\r\n responseTypes,\r\n component = null,\r\n msg = __('Please enter your payment info before proceeding.', 'woo-stripe-payment')\r\n }) => {\r\n const [isValid, setIsValid] = useState(false);\r\n\r\n useEffect(() => {\r\n const unsubscribe = subscriber(() => {\r\n if (component && !isValid) {\r\n return ensureErrorResponse(responseTypes, msg);\r\n }\r\n return true;\r\n });\r\n return () => unsubscribe();\r\n }, [\r\n subscriber,\r\n isValid,\r\n setIsValid,\r\n responseTypes,\r\n component\r\n ]);\r\n return {isValid, setIsValid};\r\n}","import {registerPaymentMethod} from '@woocommerce/blocks-registry';\r\nimport {getSettings} from \"../util\";\r\nimport {LocalPaymentIntentContent} from './local-payment-method';\r\nimport {PaymentMethodLabel, PaymentMethod} from \"../../components/checkout\";\r\nimport {canMakePayment} from \"./local-payment-method\";\r\nimport {IdealBankElement} from \"@stripe/react-stripe-js\";\r\n\r\nconst getData = getSettings('stripe_ideal_data');\r\n\r\nif (getData()) {\r\n registerPaymentMethod({\r\n name: getData('name'),\r\n label: <PaymentMethodLabel\r\n title={getData('title')}\r\n paymentMethod={getData('name')}\r\n icons={getData('icon')}/>,\r\n ariaLabel: 'Ideal',\r\n placeOrderButtonLabel: getData('placeOrderButtonLabel'),\r\n canMakePayment: canMakePayment(getData),\r\n content: <PaymentMethod\r\n content={LocalPaymentIntentContent}\r\n getData={getData}\r\n confirmationMethod={'confirmIdealPayment'}\r\n component={IdealBankElement}/>,\r\n edit: <PaymentMethod content={LocalPaymentIntentContent} getData={getData}/>,\r\n supports: {\r\n showSavedCards: false,\r\n showSaveOption: false,\r\n features: getData('features')\r\n }\r\n })\r\n}","import './klarna';\r\nimport './ideal';\r\nimport './p24';\r\nimport './bancontact';\r\nimport './giropay';\r\nimport './eps';\r\nimport './multibanco';\r\nimport './sepa';\r\nimport './sofort';\r\nimport './wechat';\r\nimport './fpx';\r\nimport './becs';\r\nimport './grabpay';\r\nimport './alipay'\r\nimport './afterpay';\r\nimport './boleto';\r\nimport './oxxo';","import {useEffect} from '@wordpress/element';\r\nimport RadioControlAccordion from \"../../../components/checkout/radio-control-accordion\";\r\n\r\nexport const KlarnaPaymentCategories = ({source, categories, onChange, selected}) => {\r\n return (\r\n <div className={'wc-stripe-blocks-klarna-container'}>\r\n <ul>\r\n {categories.map(category => {\r\n return <KlarnaPaymentCategory\r\n source={source}\r\n key={category.type}\r\n category={category}\r\n onChange={onChange}\r\n selected={selected}/>\r\n })}\r\n </ul>\r\n </div>\r\n );\r\n}\r\n\r\nconst KlarnaPaymentCategory = ({source, category, selected, onChange}) => {\r\n const checked = category.type === selected;\r\n useEffect(() => {\r\n Klarna.Payments.load({\r\n container: `#klarna-category-${category.type}`,\r\n payment_method_category: category.type\r\n });\r\n }, [source]);\r\n const option = {\r\n label: category.label,\r\n value: category.type,\r\n content: (<div id={`klarna-category-${category.type}`}></div>)\r\n }\r\n return (\r\n <li className='wc-stripe-blocks-klarna__category' key={category.type}>\r\n <RadioControlAccordion option={option} checked={checked} onChange={onChange}/>\r\n </li>\r\n )\r\n}","export * from './use-create-source';\r\nexport * from './use-process-payment';","import {useEffect, useState, useRef, useCallback} from '@wordpress/element';\r\nimport {useStripe} from \"@stripe/react-stripe-js\";\r\nimport {useStripeError} from \"../../../hooks\";\r\nimport {getDefaultSourceArgs, getRoute, isAddressValid, StripeError, storeInCache, getFromCache} from \"../../../util\";\r\nimport apiFetch from \"@wordpress/api-fetch\";\r\n\r\nexport const useCreateSource = (\r\n {\r\n getData,\r\n billing,\r\n shippingData,\r\n }) => {\r\n const stripe = useStripe();\r\n const [error, setError] = useStripeError();\r\n const abortController = useRef(new AbortController());\r\n const currentSourceArgs = useRef({});\r\n const oldSourceArgs = useRef({});\r\n const [isLoading, setIsLoading] = useState(false);\r\n const [source, setSource] = useState(false);\r\n const {billingData, cartTotal, cartTotalItems, currency} = billing;\r\n const isCheckoutValid = useCallback(({billingData, shippingData}) => {\r\n const {needsShipping, shippingAddress} = shippingData;\r\n if (isAddressValid(billingData)) {\r\n if (needsShipping) {\r\n return isAddressValid(shippingAddress);\r\n }\r\n return true;\r\n }\r\n return false;\r\n }, []);\r\n const getLineItems = useCallback((cartTotalItems, currency) => {\r\n const items = [];\r\n cartTotalItems.forEach(item => {\r\n items.push({\r\n amount: item.value,\r\n currency,\r\n description: item.label,\r\n quantity: 1\r\n });\r\n });\r\n return items;\r\n }, []);\r\n\r\n const getSourceArgs = useCallback(({cartTotal, cartTotalItems, billingData, currency, shippingData}) => {\r\n const {first_name, last_name, country} = billingData;\r\n const {needsShipping, shippingAddress} = shippingData;\r\n let args = getDefaultSourceArgs({\r\n type: getData('paymentType'),\r\n amount: cartTotal.value,\r\n billingData,\r\n currency: currency.code,\r\n returnUrl: getData('returnUrl')\r\n });\r\n args = {\r\n ...args, ...{\r\n source_order: {\r\n items: getLineItems(cartTotalItems, currency.code)\r\n },\r\n klarna: {\r\n locale: getData('locale'),\r\n product: 'payment',\r\n purchase_country: country,\r\n first_name,\r\n last_name\r\n }\r\n }\r\n }\r\n if (country == 'US') {\r\n args.klarna.custom_payment_methods = 'payin4,installments';\r\n }\r\n if (needsShipping) {\r\n args.klarna = {\r\n ...args.klarna, ...{\r\n shipping_first_name: shippingAddress.first_name,\r\n shipping_last_name: shippingAddress.last_name\r\n }\r\n }\r\n args.source_order.shipping = {\r\n address: {\r\n city: shippingAddress.city || '',\r\n country: shippingAddress.country || '',\r\n line1: shippingAddress.address_1 || '',\r\n line2: shippingAddress.address_2 || '',\r\n postal_code: shippingAddress.postcode || '',\r\n state: shippingAddress.state || ''\r\n }\r\n }\r\n }\r\n oldSourceArgs.current = currentSourceArgs.current;\r\n currentSourceArgs.current = args;\r\n return args;\r\n }, []);\r\n const filterUpdateSourceArgs = (args) => {\r\n return ['type', 'currency', 'statement_descriptor', 'redirect', 'klarna.product', 'klarna.locale', 'klarna.custom_payment_methods'].reduce((obj, k) => {\r\n if (k.indexOf('.') > -1) {\r\n let keys = k.split('.');\r\n let obj2 = keys.slice(0, keys.length - 1).reduce((obj, k) => {\r\n return obj[k];\r\n }, obj);\r\n k = keys[keys.length - 1];\r\n delete obj2[k];\r\n return obj;\r\n }\r\n delete obj[k];\r\n return obj;\r\n }, args);\r\n }\r\n\r\n const compareSourceArgs = useCallback((args, args2) => {\r\n const getArgs = (args1, args2, key = false) => {\r\n let newArgs = {};\r\n if (args1 && typeof args1 === 'object' && !Array.isArray(args1)) {\r\n for (let key of Object.keys(args1)) {\r\n if (typeof args1[key] === 'object' && !Array.isArray(args1[key])) {\r\n newArgs[key] = getArgs(args1[key], args2[key]);\r\n } else {\r\n newArgs[key] = args2[key];\r\n }\r\n }\r\n } else {\r\n newArgs = args1;\r\n }\r\n\r\n return newArgs;\r\n }\r\n const newArgs = getArgs(args, args2);\r\n return JSON.stringify(args) == JSON.stringify(newArgs);\r\n }, []);\r\n const createSource = useCallback(async (\r\n {\r\n billingData,\r\n shippingData,\r\n cartTotal,\r\n cartTotalItems,\r\n currency,\r\n }) => {\r\n let args = getSourceArgs({\r\n cartTotal,\r\n cartTotalItems,\r\n billingData,\r\n currency,\r\n shippingData\r\n });\r\n try {\r\n let result = await stripe.createSource(args);\r\n if (result.error) {\r\n throw new StripeError(result.error);\r\n }\r\n storeInCache('klarna:source', {[currency.code]: {source: result.source, args: currentSourceArgs.current}});\r\n setSource(result.source);\r\n } catch (err) {\r\n console.log(err);\r\n setError(err.error);\r\n }\r\n }, [stripe]);\r\n\r\n const updateSource = useCallback(async ({source, updates, currency}) => {\r\n\r\n const data = {\r\n updates,\r\n source_id: source.id,\r\n client_secret: source.client_secret,\r\n payment_method: getData('name')\r\n };\r\n try {\r\n abortController.current.abort();\r\n abortController.current = new AbortController();\r\n let result = await apiFetch({\r\n url: getRoute('update/source'),\r\n method: 'POST',\r\n data,\r\n signal: abortController.current.signal\r\n });\r\n if (result.source) {\r\n storeInCache('klarna:source', {[currency]: {source, args: currentSourceArgs.current}});\r\n setSource(result.source);\r\n }\r\n } catch (err) {\r\n console.log('update aborted');\r\n }\r\n }, []);\r\n\r\n // Create the source if the required data is available\r\n useEffect(() => {\r\n if (!source) {\r\n if (getFromCache('klarna:source')?.[currency.code]) {\r\n const {source, args} = getFromCache('klarna:source')[currency.code];\r\n currentSourceArgs.current = args;\r\n setSource(source);\r\n } else {\r\n if (stripe && isCheckoutValid({billingData, shippingData})) {\r\n setIsLoading(true);\r\n createSource({\r\n billingData,\r\n shippingData,\r\n cartTotal,\r\n cartTotalItems,\r\n currency\r\n }).then(() => setIsLoading(false));\r\n }\r\n }\r\n }\r\n }, [\r\n stripe,\r\n source?.id,\r\n createSource,\r\n billingData,\r\n cartTotal.value,\r\n shippingData,\r\n setIsLoading,\r\n cartTotalItems,\r\n currency.code\r\n ]);\r\n\r\n // update the source if data has changed and the source exists\r\n useEffect(() => {\r\n if (stripe && source) {\r\n // perform a comparison to see if the source needs to be updated\r\n const updates = filterUpdateSourceArgs(getSourceArgs({\r\n billingData,\r\n cartTotal,\r\n cartTotalItems,\r\n currency,\r\n shippingData\r\n }));\r\n if (!compareSourceArgs(updates, oldSourceArgs.current)) {\r\n updateSource({source, updates, currency: currency.code});\r\n }\r\n }\r\n }, [\r\n stripe,\r\n source?.id,\r\n billingData,\r\n cartTotal.value,\r\n cartTotalItems,\r\n shippingData,\r\n currency.code\r\n ]);\r\n\r\n return {source, setSource, isLoading};\r\n}","import {useEffect} from '@wordpress/element';\r\nimport {ensureErrorResponse, ensureSuccessResponse, deleteFromCache} from \"../../../util\";\r\nimport {__} from \"@wordpress/i18n\";\r\n\r\nexport const useProcessPayment = (\r\n {\r\n payment_method,\r\n source_id,\r\n paymentCategory,\r\n onPaymentProcessing,\r\n responseTypes\r\n }) => {\r\n useEffect(() => {\r\n const unsubscribe = onPaymentProcessing(() => {\r\n return new Promise(resolve => {\r\n // authorize the Klarna payment\r\n Klarna.Payments.authorize({\r\n payment_method_category: paymentCategory\r\n }, (response) => {\r\n if (response.approved) {\r\n deleteFromCache('klarna:source');\r\n // add the source to the response\r\n resolve(ensureSuccessResponse(responseTypes, {\r\n meta: {\r\n paymentMethodData: {\r\n [`${payment_method}_token_key`]: source_id\r\n }\r\n }\r\n }));\r\n } else {\r\n resolve(ensureErrorResponse(responseTypes, response.error || __('Your purchase is not approved.', 'woo-stripe-payment')));\r\n }\r\n });\r\n });\r\n });\r\n return () => unsubscribe();\r\n }, [\r\n source_id,\r\n paymentCategory,\r\n onPaymentProcessing\r\n ]\r\n );\r\n}","import {useEffect, useState} from '@wordpress/element';\r\nimport {registerPaymentMethod} from '@woocommerce/blocks-registry';\r\nimport {__} from '@wordpress/i18n';\r\nimport {useProcessCheckoutError} from '../../hooks';\r\nimport {\r\n getSettings,\r\n initStripe,\r\n isTestMode\r\n} from \"../../util\";\r\nimport {PaymentMethodLabel, PaymentMethod} from \"../../../components/checkout\";\r\nimport {canMakePayment} from \"../local-payment-method\";\r\nimport {Elements} from \"@stripe/react-stripe-js\";\r\nimport {KlarnaPaymentCategories} from \"./categories\";\r\nimport {KlarnaLoader} from \"./loader\";\r\nimport {useCreateSource, useProcessPayment} from \"./hooks\";\r\nimport './styles.scss';\r\n\r\nconst getData = getSettings('stripe_klarna_data');\r\n\r\nconst KlarnaContainer = (props) => {\r\n return (\r\n <Elements stripe={initStripe}>\r\n <KlarnaPaymentMethod {...props}/>\r\n </Elements>\r\n );\r\n}\r\n\r\nconst KlarnaPaymentMethod = (\r\n {\r\n getData,\r\n billing,\r\n shippingData,\r\n emitResponse,\r\n eventRegistration\r\n }) => {\r\n const {responseTypes} = emitResponse;\r\n const {onPaymentProcessing, onCheckoutAfterProcessingWithError} = eventRegistration;\r\n const [selected, setSelected] = useState('');\r\n const [klarnaInitialized, setKlarnaInitialized] = useState(false);\r\n const getCategoriesFromSource = (source) => {\r\n const paymentMethodCategories = source.klarna.payment_method_categories.split(',');\r\n const categories = [];\r\n for (let type of Object.keys(getData('categories'))) {\r\n if (paymentMethodCategories.includes(type)) {\r\n categories.push({type, label: getData('categories')[type]});\r\n }\r\n }\r\n return categories;\r\n }\r\n\r\n const {source, isLoading} = useCreateSource({\r\n getData,\r\n billing,\r\n shippingData\r\n });\r\n\r\n useProcessPayment({\r\n payment_method: getData('name'),\r\n source_id: source.id,\r\n paymentCategory: selected,\r\n onPaymentProcessing,\r\n responseTypes\r\n });\r\n\r\n useProcessCheckoutError({responseTypes, subscriber: onCheckoutAfterProcessingWithError});\r\n\r\n useEffect(() => {\r\n if (!selected && source) {\r\n const categories = getCategoriesFromSource(source);\r\n if (categories.length) {\r\n setSelected(categories.shift().type);\r\n }\r\n\r\n }\r\n }, [source]);\r\n\r\n useEffect(() => {\r\n if (source) {\r\n Klarna.Payments.init({\r\n client_token: source.klarna.client_token\r\n });\r\n setKlarnaInitialized(true);\r\n }\r\n }, [source?.id]);\r\n\r\n if (source && klarnaInitialized) {\r\n const categories = getCategoriesFromSource(source);\r\n return (\r\n <>\r\n {isTestMode() &&\r\n <div className=\"wc-stripe-klarna__testmode\">\r\n <label>{__('Test mode sms', 'woo-stripe-payment')}:</label> <span>123456</span>\r\n </div>}\r\n <KlarnaPaymentCategories\r\n source={source}\r\n categories={categories}\r\n selected={!selected && categories.length > 0 ? categories[0].type : selected}\r\n onChange={setSelected}/>\r\n </>\r\n )\r\n } else {\r\n if (isLoading) {\r\n return <KlarnaLoader/>\r\n }\r\n }\r\n return (\r\n <div className='wc-stripe-blocks-klarna__notice'>\r\n {__('Please fill out all required fields before paying with Klarna.', 'woo-stripe-payment')}\r\n </div>\r\n );\r\n}\r\n\r\nif (getData()) {\r\n registerPaymentMethod({\r\n name: getData('name'),\r\n label: <PaymentMethodLabel\r\n title={getData('title')}\r\n paymentMethod={getData('name')}\r\n icons={getData('icon')}/>,\r\n ariaLabel: 'Klarna',\r\n placeOrderButtonLabel: getData('placeOrderButtonLabel'),\r\n canMakePayment: canMakePayment(getData, ({settings, billingData, cartTotals}) => {\r\n const {country} = billingData;\r\n const {currency_code: currency} = cartTotals;\r\n const requiredParams = settings('requiredParams');\r\n return [currency] in requiredParams && requiredParams[currency].includes(country);\r\n }),\r\n content: <PaymentMethod\r\n getData={getData}\r\n content={KlarnaContainer}/>,\r\n edit: <PaymentMethod\r\n getData={getData}\r\n content={KlarnaContainer}/>,\r\n supports: {\r\n showSavedCards: false,\r\n showSaveOption: false,\r\n features: getData('features')\r\n }\r\n })\r\n}\r\n","export const KlarnaLoader = () => {\r\n return (\r\n <div className=\"wc-stripe-klarna-loader\">\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n </div>\r\n )\r\n}","import {useCallback} from '@wordpress/element';\r\nimport {useElements, Elements} from \"@stripe/react-stripe-js\";\r\nimport {initStripe as loadStripe, cartContainsSubscription, cartContainsPreOrder} from '../util'\r\nimport {useAfterProcessLocalPayment, useValidateCheckout, useCreateSource} from \"./hooks\";\r\nimport {useProcessCheckoutError} from \"../hooks\";\r\n\r\n/**\r\n * Return true if the local payment method can be used.\r\n * @param settings\r\n * @returns {function({billingData: *, [p: string]: *}): *}\r\n */\r\nexport const canMakePayment = (settings, callback = false) => ({billingData, cartTotals, ...props}) => {\r\n const {currency_code} = cartTotals;\r\n const {country} = billingData;\r\n const countries = settings('countries');\r\n const type = settings('allowedCountries');\r\n const supports = settings('features');\r\n let canMakePayment = false;\r\n if (settings('isAdmin')) {\r\n canMakePayment = true;\r\n } else {\r\n // Check if there are any subscriptions or pre-orders in the cart.\r\n if (cartContainsSubscription() && !supports.includes('subscriptions')) {\r\n return false;\r\n } else if (cartContainsPreOrder() && !supports.includes('pre-orders')) {\r\n return false;\r\n }\r\n if (settings('currencies').includes(currency_code)) {\r\n if (type === 'all_except') {\r\n canMakePayment = !settings('exceptCountries').includes(country);\r\n } else if (type === 'specific') {\r\n canMakePayment = settings('specificCountries').includes(country);\r\n } else {\r\n canMakePayment = countries.length > 0 ? countries.includes(country) : true;\r\n }\r\n }\r\n if (callback && canMakePayment) {\r\n canMakePayment = callback({settings, billingData, cartTotals, ...props});\r\n }\r\n }\r\n return canMakePayment;\r\n}\r\n\r\nexport const LocalPaymentIntentContent = (props) => {\r\n return (\r\n <Elements stripe={loadStripe}>\r\n <LocalPaymentIntentMethod {...props}/>\r\n </Elements>\r\n )\r\n}\r\n\r\nexport const LocalPaymentSourceContent = (props) => {\r\n return (\r\n <Elements stripe={loadStripe}>\r\n <LocalPaymentSourceMethod {...props}/>\r\n </Elements>\r\n )\r\n}\r\n\r\nconst LocalPaymentSourceMethod = (\r\n {\r\n getData,\r\n billing,\r\n shippingData,\r\n emitResponse,\r\n eventRegistration,\r\n getSourceArgs = false,\r\n element = false\r\n }) => {\r\n const {shippingAddress} = shippingData;\r\n const {onPaymentProcessing, onCheckoutAfterProcessingWithError} = eventRegistration;\r\n const {responseTypes, noticeContexts} = emitResponse;\r\n const onChange = (event) => {\r\n setIsValid(event.complete);\r\n }\r\n const {setIsValid} = useCreateSource({\r\n getData,\r\n billing,\r\n shippingAddress,\r\n onPaymentProcessing,\r\n responseTypes,\r\n getSourceArgs,\r\n element\r\n });\r\n\r\n if (element) {\r\n return (\r\n <LocalPaymentElementContainer\r\n name={getData('name')}\r\n options={getData('elementOptions')}\r\n onChange={onChange}\r\n element={element}/>\r\n )\r\n }\r\n return null;\r\n}\r\n\r\nconst LocalPaymentIntentMethod = (\r\n {\r\n getData,\r\n billing,\r\n emitResponse,\r\n eventRegistration,\r\n activePaymentMethod,\r\n confirmationMethod = null,\r\n component = null,\r\n callback = null\r\n }) => {\r\n const elements = useElements();\r\n const {billingData} = billing;\r\n const {onPaymentProcessing, onCheckoutAfterProcessingWithError} = eventRegistration;\r\n const {responseTypes, noticeContexts} = emitResponse;\r\n const getPaymentMethodArgs = useCallback(() => {\r\n if (component) {\r\n return {\r\n [getData('paymentType')]: elements.getElement(component)\r\n }\r\n } else if (callback) {\r\n return callback();\r\n }\r\n return {};\r\n }, [\r\n elements,\r\n callback\r\n ]);\r\n const {setIsValid} = useValidateCheckout({\r\n subscriber: onPaymentProcessing,\r\n responseTypes,\r\n component\r\n }\r\n );\r\n\r\n useAfterProcessLocalPayment({\r\n getData,\r\n billingData,\r\n eventRegistration,\r\n responseTypes,\r\n activePaymentMethod,\r\n confirmationMethod,\r\n getPaymentMethodArgs\r\n });\r\n useProcessCheckoutError({\r\n responseTypes,\r\n subscriber: onCheckoutAfterProcessingWithError,\r\n messageContext: noticeContexts.PAYMENT\r\n });\r\n if (component) {\r\n const onChange = (event) => setIsValid(!event.empty)\r\n return (\r\n <LocalPaymentElementContainer\r\n name={getData('name')}\r\n options={getData('elementOptions')}\r\n onChange={onChange}\r\n element={component}\r\n callback={callback}/>\r\n )\r\n }\r\n return null;\r\n}\r\n\r\nconst LocalPaymentElementContainer = ({name, onChange, element, options, ...props}) => {\r\n const Tag = element;\r\n return (\r\n <div className={`wc-stripe-local-payment-container ${name} ${Tag.displayName}`}>\r\n <Tag options={options} onChange={onChange} {...props}/>\r\n </div>\r\n )\r\n}","import {registerPaymentMethod} from '@woocommerce/blocks-registry';\r\nimport {getSettings} from \"../util\";\r\nimport {LocalPaymentSourceContent} from './local-payment-method';\r\nimport {PaymentMethodLabel, PaymentMethod} from \"../../components/checkout\";\r\nimport {canMakePayment} from \"./local-payment-method\";\r\n\r\nconst getData = getSettings('stripe_multibanco_data');\r\n\r\nif (getData()) {\r\n registerPaymentMethod({\r\n name: getData('name'),\r\n label: <PaymentMethodLabel\r\n title={getData('title')}\r\n paymentMethod={getData('name')}\r\n icons={getData('icon')}/>,\r\n ariaLabel: 'MultiBanco',\r\n placeOrderButtonLabel: getData('placeOrderButtonLabel'),\r\n canMakePayment: canMakePayment(getData),\r\n content: <PaymentMethod content={LocalPaymentSourceContent} getData={getData}/>,\r\n edit: <PaymentMethod content={LocalPaymentSourceContent} getData={getData}/>,\r\n supports: {\r\n showSavedCards: false,\r\n showSaveOption: false,\r\n features: getData('features')\r\n }\r\n })\r\n}\r\n","import {registerPaymentMethod} from '@woocommerce/blocks-registry';\r\nimport {getSettings} from \"../util\";\r\nimport {LocalPaymentIntentContent} from './local-payment-method';\r\nimport {PaymentMethodLabel, PaymentMethod} from \"../../components/checkout\";\r\nimport {canMakePayment} from \"./local-payment-method\";\r\nimport {IdealBankElement} from \"@stripe/react-stripe-js\";\r\n\r\nconst getData = getSettings('stripe_oxxo_data');\r\n\r\nif (getData()) {\r\n registerPaymentMethod({\r\n name: getData('name'),\r\n label: <PaymentMethodLabel\r\n title={getData('title')}\r\n paymentMethod={getData('name')}\r\n icons={getData('icon')}/>,\r\n ariaLabel: 'OXXO',\r\n placeOrderButtonLabel: getData('placeOrderButtonLabel'),\r\n canMakePayment: canMakePayment(getData),\r\n content: <PaymentMethod\r\n content={LocalPaymentIntentContent}\r\n getData={getData}\r\n confirmationMethod={'confirmOxxoPayment'}/>,\r\n edit: <PaymentMethod content={LocalPaymentIntentContent} getData={getData}/>,\r\n supports: {\r\n showSavedCards: false,\r\n showSaveOption: false,\r\n features: getData('features')\r\n }\r\n })\r\n}","import {registerPaymentMethod} from '@woocommerce/blocks-registry';\r\nimport {getSettings} from \"../util\";\r\nimport {LocalPaymentIntentContent} from './local-payment-method';\r\nimport {PaymentMethodLabel, PaymentMethod} from \"../../components/checkout\";\r\nimport {canMakePayment} from \"./local-payment-method\";\r\nimport {P24BankElement} from \"@stripe/react-stripe-js\";\r\n\r\nconst getData = getSettings('stripe_p24_data');\r\n\r\nif (getData()) {\r\n registerPaymentMethod({\r\n name: getData('name'),\r\n label: <PaymentMethodLabel\r\n title={getData('title')}\r\n paymentMethod={getData('name')}\r\n icons={getData('icon')}/>,\r\n ariaLabel: 'P24',\r\n placeOrderButtonLabel: getData('placeOrderButtonLabel'),\r\n canMakePayment: canMakePayment(getData),\r\n content: <PaymentMethod\r\n content={LocalPaymentIntentContent}\r\n getData={getData}\r\n confirmationMethod={'confirmP24Payment'}\r\n component={P24BankElement}/>,\r\n edit: <PaymentMethod content={LocalPaymentIntentContent} getData={getData}/>,\r\n supports: {\r\n showSavedCards: false,\r\n showSaveOption: false,\r\n features: getData('features')\r\n }\r\n })\r\n}\r\n","import {registerPaymentMethod} from '@woocommerce/blocks-registry';\r\nimport {getSettings, cartContainsPreOrder, cartContainsSubscription} from \"../util\";\r\nimport {LocalPaymentSourceContent} from './local-payment-method';\r\nimport {PaymentMethodLabel, PaymentMethod} from \"../../components/checkout\";\r\nimport {canMakePayment} from \"./local-payment-method\";\r\nimport {IbanElement} from \"@stripe/react-stripe-js\";\r\n\r\nconst getData = getSettings('stripe_sepa_data');\r\n\r\nconst getSourceArgs = (args, {billingData}) => {\r\n args.mandate = {\r\n notification_method: billingData.email ? 'email' : 'manual',\r\n interval: cartContainsSubscription() || cartContainsPreOrder() ? 'scheduled' : 'one_time'\r\n }\r\n if (args.mandate.interval === 'scheduled') {\r\n delete args.amount;\r\n }\r\n return args;\r\n}\r\n\r\nconst LocalPaymentMethod = (PaymentMethod) => ({getData, ...props}) => {\r\n return (\r\n <>\r\n <PaymentMethod {...{...props, getData}}/>\r\n <div className={'wc-stripe-blocks-sepa__mandate'}>\r\n {getData('mandate')}\r\n </div>\r\n </>\r\n )\r\n}\r\n\r\nconst SepaPaymentMethod = LocalPaymentMethod(PaymentMethod);\r\n\r\nif (getData()) {\r\n registerPaymentMethod({\r\n name: getData('name'),\r\n label: <PaymentMethodLabel\r\n title={getData('title')}\r\n paymentMethod={getData('name')}\r\n icons={getData('icon')}/>,\r\n ariaLabel: 'SEPA',\r\n placeOrderButtonLabel: getData('placeOrderButtonLabel'),\r\n canMakePayment: canMakePayment(getData),\r\n content: <SepaPaymentMethod\r\n content={LocalPaymentSourceContent}\r\n getData={getData}\r\n element={IbanElement}\r\n getSourceArgs={getSourceArgs}/>,\r\n edit: <LocalPaymentSourceContent getData={getData}/>,\r\n supports: {\r\n showSavedCards: false,\r\n showSaveOption: false,\r\n features: getData('features')\r\n }\r\n })\r\n}","import {registerPaymentMethod} from '@woocommerce/blocks-registry';\r\nimport {getSettings} from \"../util\";\r\nimport {LocalPaymentSourceContent} from './local-payment-method';\r\nimport {PaymentMethodLabel, PaymentMethod} from \"../../components/checkout\";\r\nimport {canMakePayment} from \"./local-payment-method\";\r\n\r\nconst getData = getSettings('stripe_sofort_data');\r\n\r\nconst getSourceArgs = (args, {billingData}) => {\r\n return {...args, sofort: {country: billingData.country}};\r\n}\r\n\r\nif (getData()) {\r\n registerPaymentMethod({\r\n name: getData('name'),\r\n label: <PaymentMethodLabel\r\n title={getData('title')}\r\n paymentMethod={getData('name')}\r\n icons={getData('icon')}/>,\r\n ariaLabel: 'Sofort',\r\n placeOrderButtonLabel: getData('placeOrderButtonLabel'),\r\n canMakePayment: canMakePayment(getData),\r\n content: <PaymentMethod\r\n content={LocalPaymentSourceContent}\r\n getData={getData}\r\n getSourceArgs={getSourceArgs}/>,\r\n edit: <PaymentMethod content={LocalPaymentSourceContent} getData={getData}/>,\r\n supports: {\r\n showSavedCards: false,\r\n showSaveOption: false,\r\n features: getData('features')\r\n }\r\n })\r\n}\r\n","import {useEffect, useRef, useState, useCallback} from '@wordpress/element';\r\nimport {registerPaymentMethod} from '@woocommerce/blocks-registry';\r\nimport {\r\n getSettings,\r\n initStripe as loadStripe,\r\n getDefaultSourceArgs,\r\n isAddressValid,\r\n StripeError,\r\n isTestMode,\r\n ensureSuccessResponse,\r\n getErrorMessage,\r\n storeInCache,\r\n getFromCache,\r\n deleteFromCache\r\n} from \"../util\";\r\nimport {PaymentMethodLabel, PaymentMethod} from \"../../components/checkout\";\r\nimport {canMakePayment} from \"./local-payment-method\";\r\nimport {Elements} from \"@stripe/react-stripe-js\";\r\nimport {useValidateCheckout} from \"./hooks\";\r\nimport {__} from '@wordpress/i18n';\r\n//import QRCode from 'QRCode';\r\nimport {useStripe} from \"@stripe/react-stripe-js\";\r\nimport {useStripeError} from \"../hooks\";\r\n\r\nconst getData = getSettings('stripe_wechat_data');\r\n\r\nconst WeChatComponent = (props) => {\r\n return (\r\n <Elements stripe={loadStripe}>\r\n <WeChatPaymentMethod {...props}/>\r\n </Elements>\r\n )\r\n}\r\n\r\nconst WeChatPaymentMethod = (\r\n {\r\n getData,\r\n billing,\r\n shippingData,\r\n emitResponse,\r\n eventRegistration,\r\n components\r\n }) => {\r\n const size = parseInt(getData('qrSize'));\r\n const {responseTypes} = emitResponse;\r\n const {onPaymentProcessing, onCheckoutAfterProcessingWithSuccess} = eventRegistration;\r\n const {ValidationInputError} = components;\r\n const {isValid, setIsValid} = useValidateCheckout({\r\n subscriber: eventRegistration.onPaymentProcessing,\r\n responseTypes: emitResponse.responseTypes,\r\n msg: __('Please scan your QR code to continue with payment.', 'woo-stripe-payment')\r\n });\r\n\r\n const {source, error, deleteSourceFromStorage} = useCreateSource({\r\n getData,\r\n billing,\r\n responseTypes,\r\n subscriber: onPaymentProcessing\r\n })\r\n\r\n /**\r\n * delete the source from storage once payment is successful.\r\n * If test mode, redirect to the Stripe test url.\r\n * If live mode, redirect to the return Url.\r\n */\r\n useEffect(() => {\r\n const unsubscribe = onCheckoutAfterProcessingWithSuccess(() => {\r\n deleteSourceFromStorage();\r\n return ensureSuccessResponse(responseTypes);\r\n });\r\n return () => unsubscribe();\r\n }, [\r\n source,\r\n onCheckoutAfterProcessingWithSuccess,\r\n deleteSourceFromStorage\r\n ]);\r\n\r\n useEffect(() => {\r\n if (source) {\r\n setIsValid(true);\r\n }\r\n }, [source]);\r\n\r\n if (source) {\r\n return (\r\n <QRCodeComponent text={source.wechat.qr_code_url} width={size} height={size}/>\r\n );\r\n } else if (error) {\r\n return (\r\n <div className='wechat-validation-error'>\r\n <ValidationInputError errorMessage={getErrorMessage(error)}/>\r\n </div>\r\n );\r\n } else {\r\n // if billing address is not valid\r\n if (!isAddressValid(billing.billingData)) {\r\n return __('Please fill out all the required fields in order to complete the WeChat payment.', 'woo-stripe-payment');\r\n }\r\n }\r\n return null;\r\n}\r\n\r\nconst QRCodeComponent = (\r\n {\r\n text,\r\n width = 128,\r\n height = 128,\r\n colorDark = '#424770',\r\n colorLight = '#f8fbfd',\r\n correctLevel = QRCode.CorrectLevel.H\r\n }) => {\r\n const el = useRef();\r\n useEffect(() => {\r\n new QRCode(el.current, {\r\n text,\r\n width,\r\n height,\r\n colorDark,\r\n colorLight,\r\n correctLevel\r\n })\r\n }, [el]);\r\n return (\r\n <>\r\n <div id='wc-stripe-block-qrcode' ref={el}></div>\r\n {isTestMode() && <p>\r\n {__('Test mode: Click the Place Order button to proceed.', 'woo-stripe-payment')}\r\n </p>}\r\n {!isTestMode() && <p>\r\n {__('Scan the QR code using your WeChat app. Once scanned click the Place Order button.', 'woo-stripe-payment')}\r\n </p>}\r\n </>\r\n )\r\n}\r\n\r\nconst useCreateSource = (\r\n {\r\n getData,\r\n billing,\r\n responseTypes,\r\n subscriber\r\n }) => {\r\n const stripe = useStripe();\r\n const [error, setError] = useStripeError();\r\n const [source, setSource] = useState(getFromCache('wechat:source'));\r\n const createSourceTimeoutId = useRef(null);\r\n const {cartTotal, billingData, currency} = billing;\r\n\r\n useEffect(() => {\r\n const unsubscribe = subscriber(() => {\r\n return ensureSuccessResponse(responseTypes, {\r\n meta: {\r\n paymentMethodData: {\r\n [`${getData('name')}_token_key`]: source.id\r\n }\r\n }\r\n })\r\n });\r\n return () => unsubscribe();\r\n }, [source, subscriber]);\r\n\r\n const createSource = useCallback(async () => {\r\n // validate the billing fields. If valid, create the source.\r\n try {\r\n if (!error && isAddressValid(billingData)) {\r\n let result = await stripe.createSource(getDefaultSourceArgs({\r\n type: getData('paymentType'),\r\n amount: cartTotal.value,\r\n billingData,\r\n currency: currency.code,\r\n returnUrl: getData('returnUrl')\r\n }));\r\n if (result.error) {\r\n throw new StripeError(result.error);\r\n }\r\n setSource(result.source);\r\n storeInCache('wechat:source', result.source);\r\n }\r\n } catch (err) {\r\n console.log('error: ', err);\r\n setError(err.error);\r\n }\r\n }, [\r\n stripe,\r\n source,\r\n cartTotal.value,\r\n billingData,\r\n currency,\r\n error\r\n ]);\r\n const deleteSourceFromStorage = useCallback(() => {\r\n deleteFromCache('wechat:source');\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (stripe && !source) {\r\n // if there is an existing request, cancel it.\r\n clearTimeout(createSourceTimeoutId.current);\r\n createSourceTimeoutId.current = setTimeout(createSource, 1000);\r\n }\r\n }, [\r\n stripe,\r\n source,\r\n createSource\r\n ]);\r\n\r\n return {source, setSource, error, deleteSourceFromStorage};\r\n}\r\n\r\n\r\nif (getData()) {\r\n registerPaymentMethod({\r\n name: getData('name'),\r\n label: <PaymentMethodLabel\r\n title={getData('title')}\r\n paymentMethod={getData('name')}\r\n icons={getData('icon')}/>,\r\n ariaLabel: 'WeChat',\r\n canMakePayment: canMakePayment(getData),\r\n content: <PaymentMethod content={WeChatComponent} getData={getData}/>,\r\n edit: <PaymentMethod content={WeChatComponent} getData={getData}/>,\r\n supports: {\r\n showSavedCards: false,\r\n showSaveOption: false,\r\n features: getData('features')\r\n }\r\n })\r\n}\r\n","import './style.scss';\r\n\r\nimport './payment-method';","import {useMemo, useEffect, useRef} from '@wordpress/element';\r\nimport {registerExpressPaymentMethod} from '@woocommerce/blocks-registry';\r\nimport {getSettings, initStripe as loadStripe, canMakePayment} from \"../util\";\r\nimport {useBreakpointWidth, useExpressBreakpointWidth} from '../hooks';\r\nimport {Elements, PaymentRequestButtonElement, useStripe} from \"@stripe/react-stripe-js\";\r\nimport {\r\n usePaymentRequest,\r\n useProcessPaymentIntent,\r\n useExportedValues,\r\n useAfterProcessingPayment,\r\n useStripeError\r\n} from '../hooks';\r\n\r\nconst getData = getSettings('stripe_payment_request_data');\r\n\r\nconst PaymentRequestContent = (props) => {\r\n return (\r\n <div className='wc-stripe-payment-request-container'>\r\n <Elements stripe={loadStripe}>\r\n <PaymentRequestButton {...props}/>\r\n </Elements>\r\n </div>\r\n );\r\n}\r\n\r\nconst PaymentRequestButton = (\r\n {\r\n getData,\r\n onClick,\r\n onClose,\r\n billing,\r\n shippingData,\r\n eventRegistration,\r\n emitResponse,\r\n onSubmit,\r\n activePaymentMethod,\r\n ...props\r\n }) => {\r\n const {onPaymentProcessing} = eventRegistration;\r\n const {responseTypes, noticeContexts} = emitResponse;\r\n const stripe = useStripe();\r\n const [error] = useStripeError();\r\n const canPay = (result) => result != null && !result.applePay;\r\n const exportedValues = useExportedValues();\r\n useExpressBreakpointWidth({payment_method: getData('name'), width: 300});\r\n const {setPaymentMethod} = useProcessPaymentIntent({\r\n getData,\r\n billing,\r\n shippingData,\r\n onPaymentProcessing,\r\n emitResponse,\r\n error,\r\n onSubmit,\r\n activePaymentMethod,\r\n exportedValues\r\n });\r\n useAfterProcessingPayment({\r\n getData,\r\n eventRegistration,\r\n responseTypes,\r\n activePaymentMethod,\r\n messageContext: noticeContexts.EXPRESS_PAYMENTS\r\n });\r\n const {paymentRequest} = usePaymentRequest({\r\n getData,\r\n onClose,\r\n stripe,\r\n billing,\r\n shippingData,\r\n eventRegistration,\r\n setPaymentMethod,\r\n exportedValues,\r\n canPay\r\n });\r\n\r\n const options = useMemo(() => {\r\n return {\r\n paymentRequest,\r\n style: {\r\n paymentRequestButton: getData('paymentRequestButton')\r\n }\r\n }\r\n }, [paymentRequest]);\r\n\r\n if (paymentRequest) {\r\n return (\r\n <PaymentRequestButtonElement options={options} onClick={onClick}/>\r\n )\r\n }\r\n return null;\r\n}\r\n\r\nconst PaymentRequestEdit = ({getData, ...props}) => {\r\n const canvas = useRef();\r\n useEffect(() => {\r\n const scale = window.devicePixelRatio;\r\n canvas.current.width = 20 * scale;\r\n canvas.current.height = 20 * scale;\r\n let ctx = canvas.current.getContext('2d');\r\n ctx.scale(scale, scale);\r\n ctx.beginPath();\r\n ctx.arc(10, 10, 10, 0, 2 * Math.PI);\r\n ctx.fillStyle = '#986fff';\r\n ctx.fill();\r\n });\r\n return (\r\n <div className='payment-request-block-editor'>\r\n <div className={'icon-container'}>\r\n <span>Buy now</span>\r\n <canvas className='PaymentRequestButton-icon' ref={canvas}/>\r\n <i className={'payment-request-arrow'}></i>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nregisterExpressPaymentMethod({\r\n name: getData('name'),\r\n canMakePayment: ({cartTotals}) => {\r\n if (getData('isAdmin')) {\r\n return true;\r\n }\r\n const {currency_code: currency, total_price} = cartTotals;\r\n return canMakePayment({\r\n country: getData('countryCode'),\r\n currency: currency.toLowerCase(),\r\n total: {\r\n label: getData('totalLabel'),\r\n amount: parseInt(total_price)\r\n }\r\n }, (result) => result != null && !result.applePay);\r\n },\r\n content: <PaymentRequestContent getData={getData}/>,\r\n edit: <PaymentRequestEdit getData={getData}/>,\r\n supports: {\r\n showSavedCards: getData('showSavedCards'),\r\n showSaveOption: getData('showSaveOption'),\r\n features: getData('features')\r\n }\r\n});","import {useEffect, useCallback} from '@wordpress/element';\r\nimport {initStripe as loadStripe, getSettings, handleCardAction} from '@paymentplugins/stripe/util';\r\n\r\nconst SavedCardComponent = (\r\n {\r\n eventRegistration,\r\n emitResponse,\r\n getData\r\n }) => {\r\n const {onCheckoutAfterProcessingWithSuccess} = eventRegistration;\r\n const {responseTypes} = emitResponse;\r\n const handleSuccessResult = useCallback(async ({redirectUrl}) => {\r\n const stripe = await loadStripe;\r\n return await handleCardAction({redirectUrl, getData, stripe, responseTypes});\r\n }, [onCheckoutAfterProcessingWithSuccess]);\r\n\r\n useEffect(() => {\r\n const unsubscribeOnCheckoutAfterProcessingWithSuccess = onCheckoutAfterProcessingWithSuccess(handleSuccessResult);\r\n return () => unsubscribeOnCheckoutAfterProcessingWithSuccess();\r\n }, [\r\n onCheckoutAfterProcessingWithSuccess\r\n ]);\r\n return null;\r\n}\r\n\r\nexport default SavedCardComponent;\r\n","import {loadStripe} from '@stripe/stripe-js';\r\nimport {getSetting} from '@woocommerce/settings'\r\nimport apiFetch from \"@wordpress/api-fetch\";\r\nimport {getCurrency, formatPrice as wcFormatPrice} from '@woocommerce/price-format';\r\n\r\nconst {publishableKey, account} = getSetting('stripeGeneralData');\r\nconst messages = getSetting('stripeErrorMessages');\r\nconst countryLocale = getSetting('countryLocale', {});\r\n\r\nconst SHIPPING_OPTION_REGEX = /^([\\w]+)\\:(.+)$/;\r\n\r\nconst routes = getSetting('stripeGeneralData').routes;\r\n\r\nconst creditCardForms = {};\r\n\r\nconst localPaymentMethods = [];\r\n\r\nconst CACHE_PREFIX = 'stripe:';\r\n\r\nconst PAYMENT_REQUEST_ADDRESS_MAPPINGS = {\r\n recipient: (address, name) => {\r\n address.first_name = name.split(' ').slice(0, -1).join(' ');\r\n address.last_name = name.split(' ').pop();\r\n return address;\r\n },\r\n payerName: (address, name) => {\r\n address.first_name = name.split(' ').slice(0, -1).join(' ');\r\n address.last_name = name.split(' ').pop();\r\n return address;\r\n },\r\n country: 'country',\r\n addressLine: (address, value) => {\r\n if (value[0]) {\r\n address.address_1 = value[0];\r\n }\r\n if (value[1]) {\r\n address.address_2 = value[1];\r\n }\r\n return address;\r\n },\r\n line1: 'address_1',\r\n line2: 'address_2',\r\n city: 'city',\r\n region: 'state',\r\n state: 'state',\r\n postalCode: 'postcode',\r\n postal_code: 'postcode',\r\n payerEmail: 'email',\r\n payerPhone: 'phone'\r\n}\r\n\r\nexport const initStripe = new Promise((resolve, reject) => {\r\n loadStripe(publishableKey, (() => account ? {stripeAccount: account} : {})()).then(stripe => {\r\n resolve(stripe);\r\n }).catch(err => {\r\n resolve({error: err});\r\n });\r\n});\r\n\r\nexport const registerCreditCardForm = ({id, ...props}) => {\r\n creditCardForms[id] = props;\r\n}\r\n\r\nexport const getCreditCardForm = (id) => {\r\n return creditCardForms.hasOwnProperty(id) ? creditCardForms[id] : {};\r\n}\r\n\r\nexport const getRoute = (route) => {\r\n return routes?.[route] ? routes[route] : console.log(`${route} is not a valid route`);\r\n}\r\n\r\nexport const ensureSuccessResponse = (responseTypes, data = {}) => {\r\n return {type: responseTypes.SUCCESS, ...data};\r\n}\r\n\r\n/**\r\n * Returns a formatted error object used by observers\r\n * @param responseTypes\r\n * @param error\r\n * @returns {{type: *, message: *}}\r\n */\r\nexport const ensureErrorResponse = (responseTypes, error) => {\r\n return {type: responseTypes.ERROR, message: getErrorMessage(error)}\r\n};\r\n\r\n/**\r\n * Return a customized error message.\r\n * @param error\r\n */\r\nexport const getErrorMessage = (error) => {\r\n if (typeof error == 'string') {\r\n return error;\r\n }\r\n if (error?.code && messages?.[error.code]) {\r\n return messages[error.code];\r\n }\r\n if (error?.statusCode) {\r\n return messages?.[error.statusCode] ? messages[error.statusCode] : error.statusMessage;\r\n }\r\n return error.message;\r\n}\r\n\r\n/**\r\n * Return a Stripe formatted billing_details object from a WC address\r\n * @param billingAddress\r\n */\r\nexport const getBillingDetailsFromAddress = (billingAddress) => {\r\n let billing_details = {\r\n name: `${billingAddress.first_name} ${billingAddress.last_name}`,\r\n address: {\r\n city: billingAddress.city || null,\r\n country: billingAddress.country || null,\r\n line1: billingAddress.address_1 || null,\r\n line2: billingAddress.address_2 || null,\r\n postal_code: billingAddress.postcode || null,\r\n state: billingAddress.state || null\r\n }\r\n }\r\n if (billingAddress?.phone) {\r\n billing_details.phone = billingAddress.phone;\r\n }\r\n if (billingAddress?.email) {\r\n billing_details.email = billingAddress.email;\r\n }\r\n return billing_details;\r\n}\r\n\r\nexport const getSettings = (name) => (key) => {\r\n if (key) {\r\n return getSetting(name)[key];\r\n }\r\n return getSetting(name);\r\n}\r\n\r\nexport class StripeError extends Error {\r\n constructor(error) {\r\n super(error.message);\r\n this.error = error;\r\n }\r\n}\r\n\r\n/**\r\n * Returns true if the provided value is empty.\r\n * @param value\r\n * @returns {boolean}\r\n */\r\nexport const isEmpty = (value) => {\r\n if (typeof value === 'string') {\r\n return value.length == 0 || value == '';\r\n }\r\n if (Array.isArray(value)) {\r\n return array.length == 0;\r\n }\r\n if (typeof value === 'object') {\r\n return Object.keys(value).length == 0;\r\n }\r\n if (typeof value === 'undefined') {\r\n return true;\r\n }\r\n return true;\r\n}\r\n\r\nexport const removeNumberPrecision = (value, unit) => {\r\n return value / 10 ** unit;\r\n}\r\n\r\n/**\r\n *\r\n * @param address\r\n * @param country\r\n */\r\nexport const isAddressValid = (address, exclude = []) => {\r\n const fields = getLocaleFields(address.country);\r\n for (const [key, value] of Object.entries(address)) {\r\n if (!exclude.includes(key) && fields?.[key] && fields[key].required) {\r\n if (isEmpty(value)) {\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n}\r\n\r\nexport const getLocaleFields = (country) => {\r\n let localeFields = {...countryLocale.default};\r\n if (country && countryLocale?.[country]) {\r\n localeFields = Object.entries(countryLocale[country]).reduce((locale, [key, value]) => {\r\n locale[key] = {...locale[key], ...value}\r\n return locale;\r\n }, localeFields);\r\n ['phone', 'email'].forEach(key => {\r\n let node = document.getElementById(key);\r\n if (node) {\r\n localeFields[key] = {required: node.required};\r\n }\r\n });\r\n }\r\n return localeFields;\r\n}\r\n\r\n/**\r\n * Return true if the field is required by the cart\r\n * @param field\r\n * @param country\r\n * @returns {boolean|*}\r\n */\r\nexport const isFieldRequired = (field, country = false) => {\r\n const fields = getLocaleFields(country);\r\n return [field] in fields && fields[field].required;\r\n}\r\n\r\nexport const getSelectedShippingOption = (id) => {\r\n const result = id.match(SHIPPING_OPTION_REGEX);\r\n if (result) {\r\n const {1: packageIdx, 2: rate} = result;\r\n return [rate, packageIdx];\r\n }\r\n return [];\r\n}\r\n\r\nexport const hasShippingRates = (shippingRates) => {\r\n return shippingRates.map(rate => {\r\n return rate.shipping_rates.length > 0;\r\n }).filter(Boolean).length > 0;\r\n}\r\n\r\n/**\r\n * Return true if the customer is logged in.\r\n * @param customerId\r\n * @returns {boolean}\r\n */\r\nexport const isUserLoggedIn = (customerId) => {\r\n return customerId > 0;\r\n}\r\n\r\nconst syncPaymentIntentWithOrder = async (order_id, client_secret) => {\r\n try {\r\n await apiFetch({\r\n url: routes['sync/intent'],\r\n method: 'POST',\r\n data: {order_id, client_secret}\r\n })\r\n } catch (error) {\r\n console.log(error);\r\n }\r\n}\r\n\r\nexport const handleCardAction = async (\r\n {\r\n redirectUrl,\r\n responseTypes,\r\n stripe,\r\n getData,\r\n savePaymentMethod = false\r\n }) => {\r\n try {\r\n let match = redirectUrl.match(/#response=(.+)/)\r\n if (match) {\r\n let {client_secret, order_id, order_key} = JSON.parse(window.atob(decodeURIComponent(match[1])));\r\n let result = await stripe.handleCardAction(client_secret);\r\n if (result.error) {\r\n syncPaymentIntentWithOrder(order_id, client_secret);\r\n return ensureErrorResponse(responseTypes, result.error);\r\n }\r\n // success so finish processing order then redirect to thank you page\r\n let data = {order_id, order_key, [`${getData('name')}_save_source_key`]: savePaymentMethod};\r\n let response = await apiFetch({\r\n url: getRoute('process/payment'),\r\n method: 'POST',\r\n data\r\n })\r\n if (response.messages) {\r\n return ensureErrorResponse(responseTypes, response.messages);\r\n }\r\n return ensureSuccessResponse(responseTypes, {\r\n redirectUrl: response.redirect\r\n });\r\n } else {\r\n return ensureSuccessResponse(responseTypes);\r\n }\r\n } catch (err) {\r\n console.log(err);\r\n return ensureErrorResponse(responseTypes, err);\r\n }\r\n}\r\n\r\n/**\r\n * Convert a payment wallet address to a WC cart address.\r\n * @param address_mappings\r\n * @returns {function(*, *=): {}}\r\n */\r\nexport const toCartAddress = (address_mappings = PAYMENT_REQUEST_ADDRESS_MAPPINGS) => (address, args = {}) => {\r\n const cartAddress = {};\r\n address = {...address, ...filterEmptyValues(args)};\r\n for (let [key, cartKey] of Object.entries(address_mappings)) {\r\n if (address?.[key]) {\r\n if (typeof cartKey === 'function') {\r\n cartKey(cartAddress, address[key]);\r\n } else {\r\n cartAddress[cartKey] = address[key];\r\n }\r\n }\r\n }\r\n return cartAddress;\r\n}\r\n\r\n/**\r\n * Given a WC formatted address, return only the intermediate address values\r\n * @param address\r\n * @param fields\r\n */\r\nexport const getIntermediateAddress = (address, fields = ['city', 'postcode', 'state', 'country']) => {\r\n const intermediateAddress = {};\r\n for (let key of fields) {\r\n intermediateAddress[key] = address[key];\r\n }\r\n return intermediateAddress;\r\n}\r\n\r\n/**\r\n *\r\n * @param values\r\n * @returns {{}|{[p: string]: *}}\r\n */\r\nexport const filterEmptyValues = (values) => {\r\n return Object.keys(values).filter(key => Boolean(values[key])).reduce((obj, key) => ({\r\n ...obj,\r\n [key]: values[key]\r\n }), {});\r\n}\r\n\r\nexport const formatPrice = (price, currencyCode) => {\r\n const {prefix, suffix, decimalSeparator, minorUnit, thousandSeparator} = getCurrency(currencyCode);\r\n if (price == '' || price === undefined) {\r\n return price;\r\n }\r\n\r\n price = typeof price === 'string' ? parseInt(price, 10) : price;\r\n price = price / 10 ** minorUnit;\r\n price = price.toString().replace('.', decimalSeparator);\r\n let fractional = '';\r\n const index = price.indexOf(decimalSeparator);\r\n if (index < 0) {\r\n if (minorUnit > 0) {\r\n price += `${decimalSeparator}${new Array(minorUnit + 1).join('0')}`;\r\n }\r\n } else {\r\n fractional = price.substr(index + 1);\r\n if (fractional.length < minorUnit) {\r\n price += new Array(minorUnit - fractional.length + 1).join('0');\r\n }\r\n }\r\n\r\n // separate out price and decimals so thousands separator can be added.\r\n const match = price.match(new RegExp(`(\\\\d+)\\\\${decimalSeparator}(\\\\d+)`));\r\n if (match) {\r\n ({1: price, 2: fractional} = match);\r\n }\r\n price = price.replace(new RegExp(`\\\\B(?=(\\\\d{3})+(?!\\\\d))`, 'g'), `${thousandSeparator}`);\r\n price = fractional?.length > 0 ? price + decimalSeparator + fractional : price;\r\n price = prefix + price + suffix;\r\n return price;\r\n}\r\n\r\nexport const getShippingOptions = (shippingRates) => {\r\n let options = [];\r\n shippingRates.forEach((shippingPackage, idx) => {\r\n // sort by selected rate\r\n shippingPackage.shipping_rates.sort((rate) => {\r\n return rate.selected ? -1 : 1;\r\n });\r\n let rates = shippingPackage.shipping_rates.map(rate => {\r\n let txt = document.createElement('textarea');\r\n txt.innerHTML = rate.name;\r\n let price = formatPrice(rate.price, rate.currency_code);\r\n return {\r\n id: getShippingOptionId(idx, rate.rate_id),\r\n label: txt.value,\r\n //detail: `${price}`,\r\n amount: parseInt(rate.price, 10)\r\n }\r\n });\r\n options = [...options, ...rates];\r\n });\r\n return options;\r\n}\r\n\r\nexport const getShippingOptionId = (packageId, rateId) => `${packageId}:${rateId}`\r\n\r\nexport const getDisplayItems = (cartItems, {minorUnit}) => {\r\n let items = [];\r\n const keys = ['total_tax', 'total_shipping'];\r\n cartItems.forEach(item => {\r\n if (0 < item.value || (item.key && keys.includes(item.key))) {\r\n items.push({\r\n label: item.label,\r\n pending: false,\r\n amount: item.value\r\n });\r\n }\r\n })\r\n return items;\r\n}\r\n\r\nconst canPay = {};\r\n\r\nexport const canMakePayment = ({country, currency, total}, callback) => {\r\n return new Promise((resolve, reject) => {\r\n const key = [country, currency, total.amount].reduce((key, value) => `${key}-${value}`);\r\n if (!currency) {\r\n return resolve(false);\r\n }\r\n if (key in canPay) {\r\n return resolve(canPay[key]);\r\n }\r\n return initStripe.then(stripe => {\r\n if (stripe.error) {\r\n return reject(stripe.error);\r\n }\r\n const request = stripe.paymentRequest({\r\n country,\r\n currency,\r\n total\r\n });\r\n request.canMakePayment().then(result => {\r\n canPay[key] = callback(result);\r\n return resolve(canPay[key]);\r\n });\r\n }).catch(reject);\r\n });\r\n};\r\n\r\nexport const registerLocalPaymentMethod = (paymentMethod) => {\r\n localPaymentMethods.push(paymentMethod);\r\n}\r\n\r\nexport const getLocalPaymentMethods = () => localPaymentMethods;\r\n\r\nexport const cartContainsPreOrder = () => {\r\n const data = getSetting('stripePaymentData');\r\n return data && data.pre_order;\r\n}\r\n\r\nexport const cartContainsSubscription = () => {\r\n const data = getSetting('stripePaymentData');\r\n return data && data.subscription;\r\n}\r\n\r\nexport const getDefaultSourceArgs = ({type, amount, billingData, currency, returnUrl}) => {\r\n return {\r\n type,\r\n amount,\r\n currency,\r\n owner: getBillingDetailsFromAddress(billingData),\r\n redirect: {\r\n return_url: returnUrl\r\n }\r\n }\r\n}\r\n\r\nexport const isTestMode = () => {\r\n return getSetting('stripeGeneralData').mode === 'test';\r\n}\r\n\r\nconst getCacheKey = (key) => `${CACHE_PREFIX}${key}`;\r\n\r\nexport const storeInCache = (key, value) => {\r\n const exp = Math.floor(new Date().getTime() / 1000) + (60 * 15);\r\n if ('sessionStorage' in window) {\r\n sessionStorage.setItem(getCacheKey(key), JSON.stringify({value, exp}));\r\n }\r\n}\r\n\r\nexport const getFromCache = (key) => {\r\n if ('sessionStorage' in window) {\r\n try {\r\n const item = JSON.parse(sessionStorage.getItem(getCacheKey(key)));\r\n if (item) {\r\n const {value, exp} = item;\r\n if (Math.floor(new Date().getTime() / 1000) > exp) {\r\n deleteFromCache(getCacheKey(key));\r\n } else {\r\n return value;\r\n }\r\n }\r\n } catch (err) {\r\n }\r\n }\r\n return null;\r\n}\r\n\r\nexport const deleteFromCache = (key) => {\r\n if ('sessionStorage' in window) {\r\n sessionStorage.removeItem(getCacheKey(key));\r\n }\r\n}\r\n\r\nexport const versionCompare = (ver1, ver2, compare) => {\r\n switch (compare) {\r\n case '<':\r\n return ver1 < ver2;\r\n case '>':\r\n return ver1 > ver2;\r\n case '<=':\r\n return ver1 <= ver2;\r\n case '>=':\r\n return ver1 >= ver2;\r\n case '=':\r\n return ver1 == ver2;\r\n }\r\n return false;\r\n}\r\n\r\nexport const isCartPage = () => getSetting('stripeGeneralData').page === 'cart';\r\n\r\nexport const isCheckoutPage = () => getSetting('stripeGeneralData').page === 'checkout';","/*!\n Copyright (c) 2017 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg) && arg.length) {\n\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\tif (inner) {\n\t\t\t\t\tclasses.push(inner);\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n"],"sourceRoot":""}
|
1 |
+
{"version":3,"sources":["webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/arrayLikeToArray.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/arrayWithHoles.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/assertThisInitialized.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/asyncToGenerator.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/classCallCheck.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/construct.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/createClass.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/defineProperty.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/extends.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/getPrototypeOf.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/inherits.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/interopRequireDefault.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/isNativeFunction.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/iterableToArray.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/nonIterableRest.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/nonIterableSpread.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/objectWithoutProperties.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/setPrototypeOf.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/slicedToArray.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/toConsumableArray.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/typeof.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/wrapNativeSuper.js","webpack://wc_stripe.[name]/./node_modules/@stripe/react-stripe-js/dist/react-stripe.umd.js","webpack://wc_stripe.[name]/./node_modules/@stripe/stripe-js/dist/stripe.esm.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/components/checkout/checkbox/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/components/checkout/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/components/checkout/payment-method-label/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/components/checkout/payment-method/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/components/checkout/radio-option/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/ach/hooks/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/ach/hooks/use-create-link-token.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/ach/hooks/use-initialize-plaid.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/ach/hooks/use-process-payment.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/ach/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/ach/payment-method.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/applepay/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/applepay/payment-method.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/credit-card/components/bootstrap/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/credit-card/components/custom-card-form.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/credit-card/components/simple/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/credit-card/components/stripe-card-form.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/credit-card/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/credit-card/payment-method.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/error-boundary.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/googlepay/button.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/googlepay/constants.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/googlepay/hooks/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/googlepay/hooks/use-error-message.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/googlepay/hooks/use-payment-request.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/googlepay/hooks/use-payments-client.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/googlepay/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/googlepay/payment-method.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/googlepay/util.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/hooks/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/hooks/use-after-process-payment.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/hooks/use-breakpoint-width.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/hooks/use-exported-values.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/hooks/use-payment-events.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/hooks/use-payment-request.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/hooks/use-process-checkout-error.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/hooks/use-process-payment-intent.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/hooks/use-setup-intent.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/hooks/use-stripe-error.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/afterpay.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/alipay.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/bancontact.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/becs.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/boleto.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/eps.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/fpx.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/giropay.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/grabpay.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/hooks/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/hooks/use-after-process-local-payment.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/hooks/use-create-source.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/hooks/use-validate-checkout.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/ideal.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/klarna.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/local-payment-method.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/multibanco.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/oxxo.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/p24.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/sepa.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/sofort.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/wechat.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/payment-request/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/payment-request/payment-method.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/saved-card-component.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/util.js","webpack://wc_stripe.[name]/./node_modules/classnames/index.js"],"names":["module","exports","arr","len","length","i","arr2","Array","isArray","arrayLikeToArray","self","ReferenceError","asyncGeneratorStep","gen","resolve","reject","_next","_throw","key","arg","info","value","error","done","Promise","then","fn","this","args","arguments","apply","err","undefined","instance","Constructor","TypeError","setPrototypeOf","isNativeReflectConstruct","_construct","Parent","Class","Reflect","construct","a","push","Function","bind","prototype","_defineProperties","target","props","descriptor","enumerable","configurable","writable","Object","defineProperty","protoProps","staticProps","obj","_extends","assign","source","hasOwnProperty","call","_getPrototypeOf","o","getPrototypeOf","__proto__","subClass","superClass","create","constructor","__esModule","toString","indexOf","sham","Proxy","Date","e","iter","Symbol","iterator","from","_arr","_n","_d","_e","_s","_i","next","objectWithoutPropertiesLoose","excluded","getOwnPropertySymbols","sourceSymbolKeys","propertyIsEnumerable","sourceKeys","keys","_typeof","assertThisInitialized","_setPrototypeOf","p","arrayWithHoles","iterableToArrayLimit","unsupportedIterableToArray","nonIterableRest","arrayWithoutHoles","iterableToArray","nonIterableSpread","minLen","n","slice","name","test","isNativeFunction","_wrapNativeSuper","_cache","Map","has","get","set","Wrapper","React","_objectWithoutProperties","_objectWithoutPropertiesLoose","_slicedToArray","_arrayWithHoles","_iterableToArrayLimit","_arrayLikeToArray","_unsupportedIterableToArray","_nonIterableRest","emptyFunction","emptyFunctionWithReset","resetWarningCache","propTypes","shim","propName","componentName","location","propFullName","secret","Error","getShim","isRequired","ReactPropTypes","array","bool","func","number","object","string","symbol","any","arrayOf","element","elementType","instanceOf","node","objectOf","oneOf","oneOfType","shape","exact","checkPropTypes","PropTypes","factoryWithThrowingShims","isUnknownObject","raw","PLAIN_OBJECT_STR","isEqual","left","right","leftArray","leftPlainObject","leftKeys","rightKeys","keySet","allKeys","l","r","every","usePrevious","ref","useRef","useEffect","current","validateStripe","maybeStripe","elements","createToken","createPaymentMethod","confirmCardPayment","parseStripeProp","isPromise","tag","stripePromise","stripe","ElementsContext","createContext","displayName","Elements","_ref","rawStripeProp","options","children","_final","isMounted","parsed","useMemo","_React$useState2","useState","ctx","setContext","prevStripe","prevOptions","console","warn","anyStripe","_registerWrapper","version","createElement","Provider","useElementsContextWithUseCase","useCaseMessage","useCase","concat","parseElementsContext","useContext","ElementsConsumer","_ref2","useCallbackReference","cb","extractUpdateableOptions","paymentRequest","noop","createElementComponent","type","isServer","str","charAt","toUpperCase","Element","id","className","_ref$options","_ref$onBlur","onBlur","_ref$onFocus","onFocus","_ref$onReady","onReady","_ref$onChange","onChange","_ref$onEscape","onEscape","_ref$onClick","onClick","elementRef","domNode","callOnReady","callOnBlur","callOnFocus","callOnClick","callOnChange","callOnEscape","useLayoutEffect","mount","on","updateableOptions","update","destroy","__elementType","window","AuBankAccountElement","CardElement","CardNumberElement","CardExpiryElement","CardCvcElement","FpxBankElement","IbanElement","IdealBankElement","P24BankElement","EpsBankElement","PaymentRequestButtonElement","AfterpayClearpayMessageElement","useElements","useStripe","factory","V3_URL","V3_URL_REGEX","EXISTING_SCRIPT_MESSAGE","initStripe","startTime","registerWrapper","stripePromise$1","params","Stripe","script","scripts","document","querySelectorAll","src","findScript","queryString","advancedFraudSignals","headOrBody","head","body","appendChild","injectScript","addEventListener","loadCalled","loadStripe","_len","_key","now","label","checked","aria-hidden","xmlns","viewBox","d","title","icons","paymentMethod","components","Label","PaymentMethodLabel","Icons","PaymentMethodIcons","text","align","getData","content","Content","desc","el","childNodes","classList","add","Description","payment_method","RadioControlOption","event","setValidationError","linkToken","setLinkToken","useCallback","url","getRoute","method","data","response","token","storeInCache","getFromCache","linkHandler","resolvePopup","openLinkPopup","open","Plaid","clientName","env","product","selectAccount","countryCodes","onSuccess","publicToken","metaData","onExit","getErrorMessage","error_message","onPaymentProcessing","responseTypes","unsubscribe","result","deleteFromCache","ensureSuccessResponse","meta","paymentMethodData","JSON","stringify","ensureErrorResponse","getSettings","ACHPaymentContent","eventRegistration","emitResponse","onSubmit","onCheckoutAfterProcessingWithError","ValidationInputError","validationError","useCreateLinkToken","useProcessCheckoutError","subscriber","useInitializePlaid","useProcessPayment","isTestMode","ACHTestModeCredentials","errorMessage","__","registerPaymentMethod","ariaLabel","canMakePayment","cartTotals","currency_code","PaymentMethod","savedTokenComponent","edit","placeOrderButtonLabel","supports","showSavedCards","showSaveOption","features","ApplePayContent","ApplePayButton","onClose","billing","shippingData","activePaymentMethod","noticeContexts","useStripeError","exportedValues","useExportedValues","useExpressBreakpointWidth","width","setPaymentMethod","useProcessPaymentIntent","useAfterProcessingPayment","messageContext","EXPRESS_PAYMENTS","usePaymentRequest","canPay","applePay","handleClick","show","style","ApplePayEdit","registerExpressPaymentMethod","currency","total_price","country","toLowerCase","total","amount","parseInt","Bootstrap","CardIcon","htmlFor","registerCreditCardForm","breakpoint","component","classes","focus","empty","invalid","eventChange","cardType","setCardType","elementOrder","container","setContainer","getCreditCardForm","CardForm","postalCodeEnabled","forEach","setElementOrder","includes","useBreakpointWidth","getCardIconSrc","cloneElement","brand","complete","idx","nextElement","getElement","sprintf","SimpleForm","data-tid","cardOptions","postalCode","billingData","postcode","hidePostalCode","isFieldRequired","iconStyle","displaySaveCard","customerId","isUserLoggedIn","cartContainsSubscription","cartContainsPreOrder","CreditCardContent","setError","catch","CreditCardElement","savePaymentMethod","setSavePaymentMethod","getPaymentMethodArgs","elType","card","useSetupIntent","cartTotal","setupIntent","removeSetupIntent","Tag","CustomCardForm","StripeCardForm","SavePaymentMethod","state","hasError","errorInfo","setState","componentStack","Component","publishableKey","setErrorMessage","checkoutStatus","merchantInfo","merchantId","merchantName","buttonContainer","buttonType","usePaymentsClient","button","removeButton","append","parameters","allowedAuthMethods","allowedCardNetworks","assuranceDetailsRequired","apiVersion","apiVersionMinor","shippingRates","processingCountry","totalPriceLabel","emailRequired","isEmpty","email","allowedPaymentMethods","tokenizationSpecification","gateway","BASE_PAYMENT_METHOD","shippingAddressRequired","needsShipping","transactionInfo","getTransactionInfo","callbackIntents","BASE_PAYMENT_REQUEST","billingAddressRequired","billingAddressParameters","format","phoneNumberRequired","phone","shippingOptionRequired","shippingOptionParameters","getShippingOptionParameters","shippingOptions","cartTotalItems","environment","paymentsClient","setPaymentsClient","setButton","currentBilling","currentShipping","addPaymentEvent","usePaymentEvents","setAddressData","paymentData","billingAddress","isAddressValid","phoneNumber","toCartAddress","shippingAddress","parentElement","firstChild","removeChild","loadPaymentData","parse","tokenizationData","billing_details","getBillingDetailsFromAddress","StripeError","statusCode","log","createButton","paymentOptions","paymentDataCallbacks","onPaymentAuthorized","transactionState","onPaymentDataChanged","shipping","address","shippingOptionData","intermediateAddress","selectedRates","getSelectedShippingOption","addressEqual","getIntermediateAddress","shippingEqual","success","getPaymentRequestUpdate","reason","message","intent","setShippingAddress","setSelectedRates","google","payments","api","PaymentsClient","isReadyToPayRequest","isReadyToPay","GooglePayContent","useErrorMessage","GooglePayEdit","isCartPage","getSetting","status","countryCode","currencyCode","code","totalPriceStatus","totalPrice","removeNumberPrecision","minorUnit","displayItems","getDisplayItems","newTransactionInfo","newShippingOptionParameters","unit","items","item","price","getShippingOptions","defaultSelectedOptionId","map","option","shift","shippingPackage","shipping_rates","rate","selected","getShippingOptionId","rate_id","rates","txt","innerHTML","formatPrice","description","first_name","split","join","last_name","pop","address1","address2","locality","administrativeArea","onCheckoutAfterProcessingWithSuccess","unsubscribeAfterProcessingWithSuccess","redirectUrl","handleCardAction","innerWidth","windowWidth","setWindowWith","getMaxWidth","maxWidth","setMaxWidth","clientWidth","remove","handleResize","removeEventListener","getElementById","parentNode","onShippingRateSuccess","onShippingRateFail","onShippingRateSelectSuccess","handler","setHandler","onShippingChanged","paymentEvents","setPaymentEvent","execute","removePaymentEvent","isSelectingRate","shippingRatesLoading","hasShippingRates","unsubscribeShippingRateSuccess","unsubscribeShippingRateSelectSuccess","unsubscribeShippingRateFail","hasInvalidAddress","setPaymentRequest","paymentRequestOptions","pending","requestPayerName","requestPayerEmail","requestPayerPhone","requestShipping","onShippingAddressChange","onShippingOptionChange","onPaymentMethodReceived","updatePaymentEvent","updateWith","shippingOption","paymentResponse","payerName","payerEmail","payerPhone","processingResponse","paymentDetails","stripeErrorMessage","ERROR","paymentType","currentPaymentMethodArgs","getCreatePaymentMethodArgs","getSuccessResponse","paymentMethodId","unsubscribeProcessingPayment","confirmCardSetup","client_secret","setSetupIntent","createSetupIntent","variablesHandler","isEligible","variables","setVariables","locale","AfterpayPaymentMethod","settings","cartNeedsShipping","currency_minor_unit","requiredParams","accountCountry","requiredParamObj","available","LocalPaymentIntentContent","confirmationMethod","LocalPaymentSourceContent","taxId","setTaxId","isActive","setIsActive","callback","boleto","tax_id","currentBillingData","match","atob","decodeURIComponent","return_url","order","decodeURI","order_received_url","getSourceArgs","setSource","isValid","setIsValid","currentValues","getSourceArgsInternal","getDefaultSourceArgs","returnUrl","getSuccessData","sourceId","createSource","msg","countries","LocalPaymentIntentMethod","LocalPaymentSourceMethod","useCreateSource","LocalPaymentElementContainer","useValidateCheckout","useAfterProcessLocalPayment","PAYMENT","SepaPaymentMethod","mandate","notification_method","interval","sofort","WeChatComponent","WeChatPaymentMethod","size","deleteSourceFromStorage","QRCodeComponent","wechat","qr_code_url","height","colorDark","colorLight","correctLevel","QRCode","CorrectLevel","H","createSourceTimeoutId","clearTimeout","setTimeout","PaymentRequestContent","PaymentRequestButton","paymentRequestButton","PaymentRequestEdit","canvas","scale","devicePixelRatio","getContext","beginPath","arc","Math","PI","fillStyle","fill","handleSuccessResult","unsubscribeOnCheckoutAfterProcessingWithSuccess","account","messages","countryLocale","SHIPPING_OPTION_REGEX","routes","creditCardForms","localPaymentMethods","PAYMENT_REQUEST_ADDRESS_MAPPINGS","recipient","addressLine","address_1","address_2","line1","line2","city","region","postal_code","stripeAccount","route","SUCCESS","statusMessage","exclude","fields","getLocaleFields","entries","required","localeFields","default","reduce","field","packageIdx","filter","Boolean","syncPaymentIntentWithOrder","order_id","order_key","redirect","address_mappings","cartAddress","filterEmptyValues","cartKey","values","getCurrency","prefix","suffix","decimalSeparator","thousandSeparator","fractional","index","replace","substr","RegExp","sort","packageId","rateId","cartItems","pre_order","subscription","owner","mode","getCacheKey","exp","floor","getTime","sessionStorage","setItem","getItem","removeItem","ver1","ver2","compare","page","hasOwn","classNames","argType","inner"],"mappings":";8FAUAA,EAAOC,QAVP,SAA2BC,EAAKC,IACnB,MAAPA,GAAeA,EAAMD,EAAIE,UAAQD,EAAMD,EAAIE,QAE/C,IAAK,IAAIC,EAAI,EAAGC,EAAO,IAAIC,MAAMJ,GAAME,EAAIF,EAAKE,IAC9CC,EAAKD,GAAKH,EAAIG,GAGhB,OAAOC,I,SCHTN,EAAOC,QAJP,SAAyBC,GACvB,GAAIK,MAAMC,QAAQN,GAAM,OAAOA,I,eCDjC,IAAIO,EAAmB,EAAQ,MAM/BT,EAAOC,QAJP,SAA4BC,GAC1B,GAAIK,MAAMC,QAAQN,GAAM,OAAOO,EAAiBP,K,SCKlDF,EAAOC,QARP,SAAgCS,GAC9B,QAAa,IAATA,EACF,MAAM,IAAIC,eAAe,6DAG3B,OAAOD,I,SCLT,SAASE,EAAmBC,EAAKC,EAASC,EAAQC,EAAOC,EAAQC,EAAKC,GACpE,IACE,IAAIC,EAAOP,EAAIK,GAAKC,GAChBE,EAAQD,EAAKC,MACjB,MAAOC,GAEP,YADAP,EAAOO,GAILF,EAAKG,KACPT,EAAQO,GAERG,QAAQV,QAAQO,GAAOI,KAAKT,EAAOC,GAwBvCjB,EAAOC,QApBP,SAA2ByB,GACzB,OAAO,WACL,IAAIhB,EAAOiB,KACPC,EAAOC,UACX,OAAO,IAAIL,SAAQ,SAAUV,EAASC,GACpC,IAAIF,EAAMa,EAAGI,MAAMpB,EAAMkB,GAEzB,SAASZ,EAAMK,GACbT,EAAmBC,EAAKC,EAASC,EAAQC,E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