Payment Plugins for Stripe WooCommerce - Version 3.3.0

Version Description

  • Added - WooCommerce Blocks plugin support. All Stripe plugin payment methods are supported.
Download this release

Release Info

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

Code changes from version 3.2.15 to 3.3.0

Files changed (155) hide show
  1. assets/css/stripe-rtl.css +1 -1
  2. assets/css/stripe.css +1 -1
  3. assets/css/stripe.min-rtl.css +1 -1
  4. assets/css/stripe.min.css +1 -1
  5. assets/js/frontend/applepay-checkout.js +1 -1
  6. assets/js/frontend/applepay-checkout.min.js +1 -1
  7. assets/js/frontend/credit-card.js +1 -1
  8. assets/js/frontend/credit-card.min.js +1 -1
  9. assets/js/frontend/googlepay-checkout.js +1 -1
  10. assets/js/frontend/googlepay-checkout.min.js +1 -1
  11. assets/js/frontend/googlepay-product.js +1 -1
  12. assets/js/frontend/googlepay-product.min.js +1 -1
  13. assets/js/frontend/local-payment.js +6 -4
  14. assets/js/frontend/local-payment.min.js +1 -1
  15. assets/js/frontend/payment-request.js +1 -2
  16. assets/js/frontend/payment-request.min.js +1 -1
  17. assets/js/frontend/wc-stripe.js +8 -1
  18. assets/js/frontend/wc-stripe.min.js +1 -1
  19. bin/remove-file-plugin.js +28 -0
  20. bin/webpack-helpers.js +64 -0
  21. i18n/languages/woo-stripe-payment.pot +64 -53
  22. includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php +33 -21
  23. includes/abstract/abstract-wc-payment-gateway-stripe.php +21 -5
  24. includes/admin/class-wc-stripe-admin-menus.php +2 -2
  25. includes/admin/class-wc-stripe-admin-user-edit.php +3 -2
  26. includes/class-stripe.php +2 -2
  27. includes/class-wc-stripe-api-operation.php +136 -134
  28. includes/class-wc-stripe-frontend-scripts.php +1 -1
  29. includes/class-wc-stripe-payment-charge-local.php +1 -1
  30. includes/class-wc-stripe-redirect-handler.php +3 -3
  31. includes/controllers/class-wc-stripe-controller-payment-intent.php +1 -1
  32. includes/gateways/class-wc-payment-gateway-stripe-ach.php +0 -2
  33. includes/gateways/class-wc-payment-gateway-stripe-cc.php +5 -5
  34. includes/gateways/class-wc-payment-gateway-stripe-payment-request.php +1 -7
  35. includes/gateways/class-wc-payment-gateway-stripe-sepa.php +0 -9
  36. includes/wc-stripe-functions.php +2 -4
  37. packages/blocks/assets/css/style.scss +27 -0
  38. packages/blocks/assets/img/apple_pay_button.svg +1 -0
  39. packages/blocks/assets/img/apple_pay_button_black.svg +1 -0
  40. packages/blocks/assets/img/gpay_button_black.svg +16 -0
  41. packages/blocks/assets/img/gpay_button_buy_black.svg +24 -0
  42. packages/blocks/assets/js/components/checkout/checkbox/index.js +20 -0
  43. packages/blocks/assets/js/components/checkout/checkbox/styles.scss +40 -0
  44. packages/blocks/assets/js/components/checkout/index.js +4 -0
  45. packages/blocks/assets/js/components/checkout/payment-method-label/index.js +14 -0
  46. packages/blocks/assets/js/components/checkout/payment-method-label/style.scss +15 -0
  47. packages/blocks/assets/js/components/checkout/payment-method/index.js +27 -0
  48. packages/blocks/assets/js/components/checkout/payment-method/styles.scss +9 -0
  49. packages/blocks/assets/js/components/checkout/radio-control-accordion/index.js +20 -0
  50. packages/blocks/assets/js/components/checkout/radio-control-accordion/styles.scss +0 -0
  51. packages/blocks/assets/js/components/checkout/radio-option/index.js +22 -0
  52. packages/blocks/assets/js/components/checkout/radio-option/styles.scss +36 -0
  53. packages/blocks/assets/js/payment-methods/ach/hooks/index.js +3 -0
  54. packages/blocks/assets/js/payment-methods/ach/hooks/use-create-link-token.js +43 -0
  55. packages/blocks/assets/js/payment-methods/ach/hooks/use-initialize-plaid.js +38 -0
  56. packages/blocks/assets/js/payment-methods/ach/hooks/use-process-payment.js +39 -0
  57. packages/blocks/assets/js/payment-methods/ach/index.js +2 -0
  58. packages/blocks/assets/js/payment-methods/ach/payment-method.js +90 -0
  59. packages/blocks/assets/js/payment-methods/ach/styles.scss +18 -0
  60. packages/blocks/assets/js/payment-methods/applepay/index.js +3 -0
  61. packages/blocks/assets/js/payment-methods/applepay/payment-method.js +131 -0
  62. packages/blocks/assets/js/payment-methods/applepay/style.scss +39 -0
  63. packages/blocks/assets/js/payment-methods/credit-card/components/bootstrap/index.js +35 -0
  64. packages/blocks/assets/js/payment-methods/credit-card/components/bootstrap/style.scss +212 -0
  65. packages/blocks/assets/js/payment-methods/credit-card/components/custom-card-form.js +99 -0
  66. packages/blocks/assets/js/payment-methods/credit-card/components/simple/index.js +53 -0
  67. packages/blocks/assets/js/payment-methods/credit-card/components/simple/style.scss +172 -0
  68. packages/blocks/assets/js/payment-methods/credit-card/components/stripe-card-form.js +24 -0
  69. packages/blocks/assets/js/payment-methods/credit-card/index.js +6 -0
  70. packages/blocks/assets/js/payment-methods/credit-card/payment-method.js +117 -0
  71. packages/blocks/assets/js/payment-methods/credit-card/style.scss +28 -0
  72. packages/blocks/assets/js/payment-methods/error-boundary.js +31 -0
  73. packages/blocks/assets/js/payment-methods/googlepay/button.js +89 -0
  74. packages/blocks/assets/js/payment-methods/googlepay/constants.js +13 -0
  75. packages/blocks/assets/js/payment-methods/googlepay/hooks/index.js +3 -0
  76. packages/blocks/assets/js/payment-methods/googlepay/hooks/use-error-message.js +6 -0
  77. packages/blocks/assets/js/payment-methods/googlepay/hooks/use-payment-request.js +59 -0
  78. packages/blocks/assets/js/payment-methods/googlepay/hooks/use-payments-client.js +183 -0
  79. packages/blocks/assets/js/payment-methods/googlepay/index.js +3 -0
  80. packages/blocks/assets/js/payment-methods/googlepay/payment-method.js +80 -0
  81. packages/blocks/assets/js/payment-methods/googlepay/style.scss +51 -0
  82. packages/blocks/assets/js/payment-methods/googlepay/util.js +102 -0
  83. packages/blocks/assets/js/payment-methods/hooks/index.js +9 -0
  84. packages/blocks/assets/js/payment-methods/hooks/use-after-process-payment.js +44 -0
  85. packages/blocks/assets/js/payment-methods/hooks/use-breakpoint-width.js +58 -0
  86. packages/blocks/assets/js/payment-methods/hooks/use-exported-values.js +6 -0
  87. packages/blocks/assets/js/payment-methods/hooks/use-payment-events.js +89 -0
  88. packages/blocks/assets/js/payment-methods/hooks/use-payment-request.js +140 -0
  89. packages/blocks/assets/js/payment-methods/hooks/use-process-checkout-error.js +22 -0
  90. packages/blocks/assets/js/payment-methods/hooks/use-process-payment-intent.js +121 -0
  91. packages/blocks/assets/js/payment-methods/hooks/use-setup-intent.js +49 -0
  92. packages/blocks/assets/js/payment-methods/hooks/use-stripe-error.js +6 -0
  93. packages/blocks/assets/js/payment-methods/local-payment/alipay.js +32 -0
  94. packages/blocks/assets/js/payment-methods/local-payment/bancontact.js +31 -0
  95. packages/blocks/assets/js/payment-methods/local-payment/becs.js +32 -0
  96. packages/blocks/assets/js/payment-methods/local-payment/eps.js +27 -0
  97. packages/blocks/assets/js/payment-methods/local-payment/fpx.js +32 -0
  98. packages/blocks/assets/js/payment-methods/local-payment/giropay.js +27 -0
  99. packages/blocks/assets/js/payment-methods/local-payment/grabpay.js +30 -0
  100. packages/blocks/assets/js/payment-methods/local-payment/hooks/index.js +3 -0
  101. packages/blocks/assets/js/payment-methods/local-payment/hooks/use-after-process-local-payment.js +58 -0
  102. packages/blocks/assets/js/payment-methods/local-payment/hooks/use-create-source.js +100 -0
  103. packages/blocks/assets/js/payment-methods/local-payment/hooks/use-validate-checkout.js +30 -0
  104. packages/blocks/assets/js/payment-methods/local-payment/ideal.js +32 -0
  105. packages/blocks/assets/js/payment-methods/local-payment/index.js +14 -0
  106. packages/blocks/assets/js/payment-methods/local-payment/klarna/categories.js +39 -0
  107. packages/blocks/assets/js/payment-methods/local-payment/klarna/hooks/index.js +2 -0
  108. packages/blocks/assets/js/payment-methods/local-payment/klarna/hooks/use-create-source.js +240 -0
  109. packages/blocks/assets/js/payment-methods/local-payment/klarna/hooks/use-process-payment.js +43 -0
  110. packages/blocks/assets/js/payment-methods/local-payment/klarna/index.js +125 -0
  111. packages/blocks/assets/js/payment-methods/local-payment/klarna/loader.js +9 -0
  112. packages/blocks/assets/js/payment-methods/local-payment/klarna/styles.scss +61 -0
  113. packages/blocks/assets/js/payment-methods/local-payment/local-payment-method.js +161 -0
  114. packages/blocks/assets/js/payment-methods/local-payment/multibanco.js +27 -0
  115. packages/blocks/assets/js/payment-methods/local-payment/p24.js +27 -0
  116. packages/blocks/assets/js/payment-methods/local-payment/sepa.js +56 -0
  117. packages/blocks/assets/js/payment-methods/local-payment/sofort.js +34 -0
  118. packages/blocks/assets/js/payment-methods/local-payment/styles.scss +120 -0
  119. packages/blocks/assets/js/payment-methods/local-payment/wechat.js +226 -0
  120. packages/blocks/assets/js/payment-methods/payment-request/index.js +3 -0
  121. packages/blocks/assets/js/payment-methods/payment-request/payment-method.js +140 -0
  122. packages/blocks/assets/js/payment-methods/payment-request/style.scss +48 -0
  123. packages/blocks/assets/js/payment-methods/saved-card-component.js +26 -0
  124. packages/blocks/assets/js/payment-methods/util.js +490 -0
  125. packages/blocks/build/commons.js +3 -0
  126. packages/blocks/build/commons.js.LICENSE.txt +5 -0
  127. packages/blocks/build/commons.js.map +1 -0
  128. packages/blocks/build/credit-card/bootstrap-rtl.css +1 -0
  129. packages/blocks/build/credit-card/bootstrap.css +1 -0
  130. packages/blocks/build/credit-card/bootstrap.js.map +1 -0
  131. packages/blocks/build/credit-card/simple-rtl.css +1 -0
  132. packages/blocks/build/credit-card/simple.css +1 -0
  133. packages/blocks/build/credit-card/simple.js.map +1 -0
  134. packages/blocks/build/style-rtl.css +1 -0
  135. packages/blocks/build/style.css +1 -0
  136. packages/blocks/build/style.js.map +1 -0
  137. packages/blocks/build/wc-stripe-ach.asset.php +1 -0
  138. packages/blocks/build/wc-stripe-ach.js +2 -0
  139. packages/blocks/build/wc-stripe-ach.js.map +1 -0
  140. packages/blocks/build/wc-stripe-apple-pay.asset.php +1 -0
  141. packages/blocks/build/wc-stripe-apple-pay.js +2 -0
  142. packages/blocks/build/wc-stripe-apple-pay.js.map +1 -0
  143. packages/blocks/build/wc-stripe-credit-card.asset.php +1 -0
  144. packages/blocks/build/wc-stripe-credit-card.js +2 -0
  145. packages/blocks/build/wc-stripe-credit-card.js.map +1 -0
  146. packages/blocks/build/wc-stripe-googlepay.asset.php +1 -0
  147. packages/blocks/build/wc-stripe-googlepay.js +2 -0
  148. packages/blocks/build/wc-stripe-googlepay.js.map +1 -0
  149. packages/blocks/build/wc-stripe-local-payment.asset.php +1 -0
  150. packages/blocks/build/wc-stripe-local-payment.js +2 -0
  151. packages/blocks/build/wc-stripe-local-payment.js.map +1 -0
  152. packages/blocks/build/wc-stripe-payment-request.asset.php +1 -0
  153. packages/blocks/build/wc-stripe-payment-request.js +2 -0
  154. packages/blocks/build/wc-stripe-payment-request.js.map +1 -0
  155. packages/blocks/src/Assets/Api.php +42 -0
assets/css/stripe-rtl.css CHANGED
@@ -415,7 +415,7 @@ li.payment_method_stripe_ach label:first-of-type img {
415
  @supports (-webkit-appearance: -apple-pay-button) {
416
  .apple-pay-button {
417
  display: block;
418
- -webkit-appearance: -apple-pay-button;
419
  width: 100%;
420
  max-width: 100%;
421
  min-width: 200px;
415
  @supports (-webkit-appearance: -apple-pay-button) {
416
  .apple-pay-button {
417
  display: block;
418
+ -webkit-appearance: -apple-pay-button !important;
419
  width: 100%;
420
  max-width: 100%;
421
  min-width: 200px;
assets/css/stripe.css CHANGED
@@ -415,7 +415,7 @@ li.payment_method_stripe_ach label:first-of-type img {
415
  @supports (-webkit-appearance: -apple-pay-button) {
416
  .apple-pay-button {
417
  display: block;
418
- -webkit-appearance: -apple-pay-button;
419
  width: 100%;
420
  max-width: 100%;
421
  min-width: 200px;
415
  @supports (-webkit-appearance: -apple-pay-button) {
416
  .apple-pay-button {
417
  display: block;
418
+ -webkit-appearance: -apple-pay-button !important;
419
  width: 100%;
420
  max-width: 100%;
421
  min-width: 200px;
assets/css/stripe.min-rtl.css CHANGED
@@ -1 +1 @@
1
- .wc-stripe-card-icons-container,.wc-stripe-paymentRequest-icons-container{float:left;display:inline-block}ul.payment_methods li[class*=payment_method]{margin:0;padding:0}li[class*=payment_method] input[type=radio]{margin:0 5px 0 10px}li[class*=payment_method] input[type=radio]+label:not(.wc-stripe-label-payment-type){margin:0}.woocommerce-checkout #payment ul.payment_methods li[class*=payment_method_stripe_]:nth-child(n+2),ul.payment_methods li[class*=payment_method_stripe_]:nth-child(n+2){margin:0}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon,li.payment_method_stripe_payment_request .wc-stripe-paymentRequest-icons-container img{max-width:43px;max-height:26px;width:43px;height:26px;float:none;display:inline}li.payment_method_stripe_payment_request .wc-stripe-paymentRequest-icons-container img{width:25px;height:25px;max-width:25px;max-height:25px}ul.payment_methods label[for*=payment_method_stripe]:after{clear:left;content:"";display:block}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon:nth-child(2n+2){margin:0 2px}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon.open.visa{padding-top:2px}ul.payment_methods li[class*=payment_method_stripe_] label>img:first-of-type{float:left!important}.wc-stripe_cc-new-method-container{margin-bottom:1em}.wc-stripe_cc-container .StripeElement{box-sizing:border-box;height:40px;padding:10px 12px;border-radius:4px;background-color:#fff;-webkit-transition:box-shadow 150ms ease;transition:box-shadow 150ms ease}input.wc-stripe-klarna-category,input.wc-stripe-payment-type{display:none!important}body .wfacp_main_form.woocommerce .wc-stripe-save-source label.checkbox{padding:0!important}input[type=radio]+label.wc-stripe-label-payment-type,label.wc-stripe-label-klarna-category,label.wc-stripe-label-payment-type{margin-bottom:1em;display:block;padding:0!important;color:#000}.theme-flatsome div.wc-stripe-saved-methods-container{margin:0 0 1em 0}label.wc-stripe-label-klarna-category:before,label.wc-stripe-label-payment-type:before{content:"";display:inline-block;width:11px;height:11px;border:2px solid #fff;box-shadow:0 0 0 2px #000;background:#fff;margin-right:4px;margin-left:.5em;border-radius:100%;-webkit-transform:translateY(2px);-ms-transform:translateY(2px);transform:translateY(2px)}input.wc-stripe-klarna-category:checked+label.wc-stripe-label-klarna-category:before,input.wc-stripe-payment-type:checked+label.wc-stripe-label-payment-type:before{background:#000}label.wc-stripe-label-payment-type:after{content:none!important;display:none!important}.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]{width:60px;max-height:35px}li.payment_method_stripe_googlepay 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;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}.qrcode-message{margin:10px 0 0 0}#wc_stripe_local_payment_stripe_becs,#wc_stripe_local_payment_stripe_sepa{padding:10px 12px;box-shadow:0 1px 3px 0 #e6ebf1}.wc-stripe-local-desc.stripe_becs,.wc-stripe-local-desc.stripe_sepa{margin:10px 0}.wc-stripe-clear{clear:both;height:0;visibility:hidden}.wc-stripe-gateway-desc p{margin:0}#wc_stripe_local_payment_stripe_klarna,li[class*=payment_method_stripe_] div.wc-stripe-gateway-container.has_tokens{margin-top:10px}.wc-stripe-gateway-desc{margin-top:10px}#wc-stripe-card-element.StripeElement--webkit-autofill{background-color:transparent!important}#wc_stripe_local_payment_stripe_klarna .stripe-klarna-categories{list-style:none;margin:0;padding:10px}li.payment_method_stripe_alipay,li.payment_method_stripe_bancontact,li.payment_method_stripe_becs,li.payment_method_stripe_eps,li.payment_method_stripe_fpx,li.payment_method_stripe_giropay,li.payment_method_stripe_ideal,li.payment_method_stripe_klarna,li.payment_method_stripe_multibanco,li.payment_method_stripe_p24,li.payment_method_stripe_sepa,li.payment_method_stripe_sofort,li.payment_method_stripe_wechat{display:none}.widget_shopping_cart_content .wc-stripe-mini-cart-payment-methods{list-style:none;margin:0;padding:0}.widget_shopping_cart_content .wc-stripe-mini-cart-payment-methods li{margin:0}.widget_shopping_cart_content a.wc-stripe-applepay-mini-cart,.widget_shopping_cart_content a.wc-stripe-gpay-mini-cart,.widget_shopping_cart_content a.wc-stripe-payment-request-mini-cart{background:0 0;padding:0;border:none}a.wc-stripe-gpay-mini-cart .gpay-button,a.wc-stripe-gpay-mini-cart .gpay-card-info-container a.wc-stripe-applepay-mini-cart .apple-pay-button{width:100%;margin:0}.wc-stripe-payment-request-mini-cart.StripeElement{padding:0;background:0 0;border:none;width:100%}.wc-stripe-payment-request-mini-cart.StripeElement .__PrivateStripeElement{width:100%}.widget_shopping_cart_content .wc-stripe-overlay{display:none!important;position:absolute;background:rgba(255,255,255,.75);height:100%;width:100%;z-index:-1}.widget_shopping_cart_content .wc-stripe-overlay.active{display:block!important;z-index:9999}.wc-stripe-klarna-loader{display:flex;justify-content:center;position:relative;width:100%;height:30px;box-sizing:border-box;transform:scale(.65)}.wc-stripe-klarna-loader div{box-sizing:border-box;display:block;position:absolute;box-sizing:border-box;width:30px;height:30px;border:3px solid #000;border-radius:50%;animation:klarna-payments-loader 1.3s cubic-bezier(.5,0,.5,1) infinite;border-color:#000 transparent transparent transparent}.wc-stripe-klarna-loader div:nth-child(1){animation-delay:-.45s}.wc-stripe-klarna-loader div:nth-child(2){animation-delay:-.3s}.wc-stripe-klarna-loader div:nth-child(3){animation-delay:-.15s}@keyframes klarna-payments-loader{0%{transform:rotate(0)}100%{transform:rotate(-360deg)}}li.payment_method_stripe_alipay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_applepay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_bancontact.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_eps.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_giropay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_googlepay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_grabpay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_multibanco.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_p24.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_payment_request.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_sofort.wc-stripe-no-desc .payment_box.wc-stripe-no-methods{padding:0;margin:0}.wc-stripe-paymentRequest-icons-container,.wc-stripe-shortcode-cart-buttons .wc-stripe-card-icons-container{float:left;display:inline-block}ul.payment_methods li[class*=payment_method]{margin:0;padding:0}li[class*=payment_method] input[type=radio]{margin:0 5px 0 10px}li[class*=payment_method] input[type=radio]+label:not(.wc-stripe-label-payment-type){margin:0}.woocommerce-checkout #payment ul.payment_methods li[class*=payment_method_stripe_]:nth-child(n+2),ul.payment_methods li[class*=payment_method_stripe_]:nth-child(n+2){margin:0}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon,li.payment_method_stripe_payment_request .wc-stripe-paymentRequest-icons-container img{max-width:43px;max-height:26px;width:43px;height:26px;float:none;display:inline}li.payment_method_stripe_payment_request .wc-stripe-paymentRequest-icons-container img{width:25px;height:25px;max-width:25px;max-height:25px}ul.payment_methods label[for*=payment_method_stripe]:after{clear:left;content:"";display:block}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon:nth-child(2n+2){margin:0 2px}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon.open.visa{padding-top:2px}ul.payment_methods li[class*=payment_method_stripe_] label>img:first-of-type{float:left!important}.wc-stripe_cc-new-method-container{margin-bottom:1em}.wc-stripe_cc-container .StripeElement{box-sizing:border-box;height:40px;padding:10px 12px;border-radius:4px;background-color:#fff;-webkit-transition:box-shadow 150ms ease;transition:box-shadow 150ms ease}input.wc-stripe-klarna-category,input.wc-stripe-payment-type{display:none!important}body .wfacp_main_form.woocommerce .wc-stripe-save-source label.checkbox{padding:0!important}input[type=radio]+label.wc-stripe-label-payment-type,label.wc-stripe-label-klarna-category,label.wc-stripe-label-payment-type{margin-bottom:1em;display:block;padding:0!important;color:#000}.theme-flatsome div.wc-stripe-saved-methods-container{margin:0 0 1em 0}label.wc-stripe-label-klarna-category:before,label.wc-stripe-label-payment-type:before{content:"";display:inline-block;width:11px;height:11px;border:2px solid #fff;box-shadow:0 0 0 2px #000;background:#fff;margin-right:4px;margin-left:.5em;border-radius:100%;-webkit-transform:translateY(2px);-ms-transform:translateY(2px);transform:translateY(2px)}input.wc-stripe-klarna-category:checked+label.wc-stripe-label-klarna-category:before,input.wc-stripe-payment-type:checked+label.wc-stripe-label-payment-type:before{background:#000}label.wc-stripe-label-payment-type:after{content:none!important;display:none!important}.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]{width:60px;max-height:35px}li.payment_method_stripe_googlepay 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;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}.qrcode-message{margin:10px 0 0 0}#wc_stripe_local_payment_stripe_becs,#wc_stripe_local_payment_stripe_sepa{padding:10px 12px;box-shadow:0 1px 3px 0 #e6ebf1}.wc-stripe-local-desc.stripe_becs,.wc-stripe-local-desc.stripe_sepa{margin:10px 0}.wc-stripe-clear{clear:both;height:0;visibility:hidden}.wc-stripe-gateway-desc p{margin:0}#wc_stripe_local_payment_stripe_klarna,li[class*=payment_method_stripe_] div.wc-stripe-gateway-container.has_tokens{margin-top:10px}.wc-stripe-gateway-desc{margin-top:10px}#wc-stripe-card-element.StripeElement--webkit-autofill{background-color:transparent!important}#wc_stripe_local_payment_stripe_klarna .stripe-klarna-categories{list-style:none;margin:0;padding:10px}li.payment_method_stripe_alipay,li.payment_method_stripe_bancontact,li.payment_method_stripe_becs,li.payment_method_stripe_eps,li.payment_method_stripe_fpx,li.payment_method_stripe_giropay,li.payment_method_stripe_ideal,li.payment_method_stripe_klarna,li.payment_method_stripe_multibanco,li.payment_method_stripe_p24,li.payment_method_stripe_sepa,li.payment_method_stripe_sofort,li.payment_method_stripe_wechat{display:none}.widget_shopping_cart_content .wc-stripe-mini-cart-payment-methods{list-style:none;margin:0;padding:0}.widget_shopping_cart_content .wc-stripe-mini-cart-payment-methods li{margin:0}.widget_shopping_cart_content a.wc-stripe-applepay-mini-cart,.widget_shopping_cart_content a.wc-stripe-gpay-mini-cart,.widget_shopping_cart_content a.wc-stripe-payment-request-mini-cart{background:0 0;padding:0;border:none}a.wc-stripe-gpay-mini-cart .gpay-button,a.wc-stripe-gpay-mini-cart .gpay-card-info-container a.wc-stripe-applepay-mini-cart .apple-pay-button{width:100%;margin:0}.wc-stripe-payment-request-mini-cart.StripeElement{padding:0;background:0 0;border:none;width:100%}.wc-stripe-payment-request-mini-cart.StripeElement .__PrivateStripeElement{width:100%}.widget_shopping_cart_content .wc-stripe-overlay{display:none!important;position:absolute;background:rgba(255,255,255,.75);height:100%;width:100%;z-index:-1}.widget_shopping_cart_content .wc-stripe-overlay.active{display:block!important;z-index:9999}.wc-stripe-klarna-loader{display:flex;justify-content:center;position:relative;width:100%;height:30px;box-sizing:border-box;transform:scale(.65)}.wc-stripe-klarna-loader div{box-sizing:border-box;display:block;position:absolute;box-sizing:border-box;width:30px;height:30px;border:3px solid #000;border-radius:50%;animation:klarna-payments-loader 1.3s cubic-bezier(.5,0,.5,1) infinite;border-color:#000 transparent transparent transparent}.wc-stripe-klarna-loader div:nth-child(1){animation-delay:-.45s}.wc-stripe-klarna-loader div:nth-child(2){animation-delay:-.3s}.wc-stripe-klarna-loader div:nth-child(3){animation-delay:-.15s}@keyframes klarna-payments-loader{0%{transform:rotate(0)}100%{transform:rotate(-360deg)}}li.payment_method_stripe_alipay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_applepay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_bancontact.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_eps.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_giropay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_googlepay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_grabpay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_multibanco.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_p24.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_payment_request.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_sofort.wc-stripe-no-desc .payment_box.wc-stripe-no-methods{padding:0;margin:0}.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}li[class*=payment_method_stripe_] style{display:none}
1
+ .wc-stripe-card-icons-container,.wc-stripe-paymentRequest-icons-container{float:left;display:inline-block}ul.payment_methods li[class*=payment_method]{margin:0;padding:0}li[class*=payment_method] input[type=radio]{margin:0 5px 0 10px}li[class*=payment_method] input[type=radio]+label:not(.wc-stripe-label-payment-type){margin:0}.woocommerce-checkout #payment ul.payment_methods li[class*=payment_method_stripe_]:nth-child(n+2),ul.payment_methods li[class*=payment_method_stripe_]:nth-child(n+2){margin:0}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon,li.payment_method_stripe_payment_request .wc-stripe-paymentRequest-icons-container img{max-width:43px;max-height:26px;width:43px;height:26px;float:none;display:inline}li.payment_method_stripe_payment_request .wc-stripe-paymentRequest-icons-container img{width:25px;height:25px;max-width:25px;max-height:25px}ul.payment_methods label[for*=payment_method_stripe]:after{clear:left;content:"";display:block}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon:nth-child(2n+2){margin:0 2px}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon.open.visa{padding-top:2px}ul.payment_methods li[class*=payment_method_stripe_] label>img:first-of-type{float:left!important}.wc-stripe_cc-new-method-container{margin-bottom:1em}.wc-stripe_cc-container .StripeElement{box-sizing:border-box;height:40px;padding:10px 12px;border-radius:4px;background-color:#fff;-webkit-transition:box-shadow 150ms ease;transition:box-shadow 150ms ease}input.wc-stripe-klarna-category,input.wc-stripe-payment-type{display:none!important}body .wfacp_main_form.woocommerce .wc-stripe-save-source label.checkbox{padding:0!important}input[type=radio]+label.wc-stripe-label-payment-type,label.wc-stripe-label-klarna-category,label.wc-stripe-label-payment-type{margin-bottom:1em;display:block;padding:0!important;color:#000}.theme-flatsome div.wc-stripe-saved-methods-container{margin:0 0 1em 0}label.wc-stripe-label-klarna-category:before,label.wc-stripe-label-payment-type:before{content:"";display:inline-block;width:11px;height:11px;border:2px solid #fff;box-shadow:0 0 0 2px #000;background:#fff;margin-right:4px;margin-left:.5em;border-radius:100%;-webkit-transform:translateY(2px);-ms-transform:translateY(2px);transform:translateY(2px)}input.wc-stripe-klarna-category:checked+label.wc-stripe-label-klarna-category:before,input.wc-stripe-payment-type:checked+label.wc-stripe-label-payment-type:before{background:#000}label.wc-stripe-label-payment-type:after{content:none!important;display:none!important}.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]{width:60px;max-height:35px}li.payment_method_stripe_googlepay 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}.qrcode-message{margin:10px 0 0 0}#wc_stripe_local_payment_stripe_becs,#wc_stripe_local_payment_stripe_sepa{padding:10px 12px;box-shadow:0 1px 3px 0 #e6ebf1}.wc-stripe-local-desc.stripe_becs,.wc-stripe-local-desc.stripe_sepa{margin:10px 0}.wc-stripe-clear{clear:both;height:0;visibility:hidden}.wc-stripe-gateway-desc p{margin:0}#wc_stripe_local_payment_stripe_klarna,li[class*=payment_method_stripe_] div.wc-stripe-gateway-container.has_tokens{margin-top:10px}.wc-stripe-gateway-desc{margin-top:10px}#wc-stripe-card-element.StripeElement--webkit-autofill{background-color:transparent!important}#wc_stripe_local_payment_stripe_klarna .stripe-klarna-categories{list-style:none;margin:0;padding:10px}li.payment_method_stripe_alipay,li.payment_method_stripe_bancontact,li.payment_method_stripe_becs,li.payment_method_stripe_eps,li.payment_method_stripe_fpx,li.payment_method_stripe_giropay,li.payment_method_stripe_ideal,li.payment_method_stripe_klarna,li.payment_method_stripe_multibanco,li.payment_method_stripe_p24,li.payment_method_stripe_sepa,li.payment_method_stripe_sofort,li.payment_method_stripe_wechat{display:none}.widget_shopping_cart_content .wc-stripe-mini-cart-payment-methods{list-style:none;margin:0;padding:0}.widget_shopping_cart_content .wc-stripe-mini-cart-payment-methods li{margin:0}.widget_shopping_cart_content a.wc-stripe-applepay-mini-cart,.widget_shopping_cart_content a.wc-stripe-gpay-mini-cart,.widget_shopping_cart_content a.wc-stripe-payment-request-mini-cart{background:0 0;padding:0;border:none}a.wc-stripe-gpay-mini-cart .gpay-button,a.wc-stripe-gpay-mini-cart .gpay-card-info-container a.wc-stripe-applepay-mini-cart .apple-pay-button{width:100%;margin:0}.wc-stripe-payment-request-mini-cart.StripeElement{padding:0;background:0 0;border:none;width:100%}.wc-stripe-payment-request-mini-cart.StripeElement .__PrivateStripeElement{width:100%}.widget_shopping_cart_content .wc-stripe-overlay{display:none!important;position:absolute;background:rgba(255,255,255,.75);height:100%;width:100%;z-index:-1}.widget_shopping_cart_content .wc-stripe-overlay.active{display:block!important;z-index:9999}.wc-stripe-klarna-loader{display:flex;justify-content:center;position:relative;width:100%;height:30px;box-sizing:border-box;transform:scale(.65)}.wc-stripe-klarna-loader div{box-sizing:border-box;display:block;position:absolute;box-sizing:border-box;width:30px;height:30px;border:3px solid #000;border-radius:50%;animation:klarna-payments-loader 1.3s cubic-bezier(.5,0,.5,1) infinite;border-color:#000 transparent transparent transparent}.wc-stripe-klarna-loader div:nth-child(1){animation-delay:-.45s}.wc-stripe-klarna-loader div:nth-child(2){animation-delay:-.3s}.wc-stripe-klarna-loader div:nth-child(3){animation-delay:-.15s}@keyframes klarna-payments-loader{0%{transform:rotate(0)}100%{transform:rotate(-360deg)}}li.payment_method_stripe_alipay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_applepay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_bancontact.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_eps.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_giropay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_googlepay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_grabpay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_multibanco.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_p24.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_payment_request.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_sofort.wc-stripe-no-desc .payment_box.wc-stripe-no-methods{padding:0;margin:0}.wc-stripe-paymentRequest-icons-container,.wc-stripe-shortcode-cart-buttons .wc-stripe-card-icons-container{float:left;display:inline-block}ul.payment_methods li[class*=payment_method]{margin:0;padding:0}li[class*=payment_method] input[type=radio]{margin:0 5px 0 10px}li[class*=payment_method] input[type=radio]+label:not(.wc-stripe-label-payment-type){margin:0}.woocommerce-checkout #payment ul.payment_methods li[class*=payment_method_stripe_]:nth-child(n+2),ul.payment_methods li[class*=payment_method_stripe_]:nth-child(n+2){margin:0}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon,li.payment_method_stripe_payment_request .wc-stripe-paymentRequest-icons-container img{max-width:43px;max-height:26px;width:43px;height:26px;float:none;display:inline}li.payment_method_stripe_payment_request .wc-stripe-paymentRequest-icons-container img{width:25px;height:25px;max-width:25px;max-height:25px}ul.payment_methods label[for*=payment_method_stripe]:after{clear:left;content:"";display:block}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon:nth-child(2n+2){margin:0 2px}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon.open.visa{padding-top:2px}ul.payment_methods li[class*=payment_method_stripe_] label>img:first-of-type{float:left!important}.wc-stripe_cc-new-method-container{margin-bottom:1em}.wc-stripe_cc-container .StripeElement{box-sizing:border-box;height:40px;padding:10px 12px;border-radius:4px;background-color:#fff;-webkit-transition:box-shadow 150ms ease;transition:box-shadow 150ms ease}input.wc-stripe-klarna-category,input.wc-stripe-payment-type{display:none!important}body .wfacp_main_form.woocommerce .wc-stripe-save-source label.checkbox{padding:0!important}input[type=radio]+label.wc-stripe-label-payment-type,label.wc-stripe-label-klarna-category,label.wc-stripe-label-payment-type{margin-bottom:1em;display:block;padding:0!important;color:#000}.theme-flatsome div.wc-stripe-saved-methods-container{margin:0 0 1em 0}label.wc-stripe-label-klarna-category:before,label.wc-stripe-label-payment-type:before{content:"";display:inline-block;width:11px;height:11px;border:2px solid #fff;box-shadow:0 0 0 2px #000;background:#fff;margin-right:4px;margin-left:.5em;border-radius:100%;-webkit-transform:translateY(2px);-ms-transform:translateY(2px);transform:translateY(2px)}input.wc-stripe-klarna-category:checked+label.wc-stripe-label-klarna-category:before,input.wc-stripe-payment-type:checked+label.wc-stripe-label-payment-type:before{background:#000}label.wc-stripe-label-payment-type:after{content:none!important;display:none!important}.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]{width:60px;max-height:35px}li.payment_method_stripe_googlepay 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;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}.qrcode-message{margin:10px 0 0 0}#wc_stripe_local_payment_stripe_becs,#wc_stripe_local_payment_stripe_sepa{padding:10px 12px;box-shadow:0 1px 3px 0 #e6ebf1}.wc-stripe-local-desc.stripe_becs,.wc-stripe-local-desc.stripe_sepa{margin:10px 0}.wc-stripe-clear{clear:both;height:0;visibility:hidden}.wc-stripe-gateway-desc p{margin:0}#wc_stripe_local_payment_stripe_klarna,li[class*=payment_method_stripe_] div.wc-stripe-gateway-container.has_tokens{margin-top:10px}.wc-stripe-gateway-desc{margin-top:10px}#wc-stripe-card-element.StripeElement--webkit-autofill{background-color:transparent!important}#wc_stripe_local_payment_stripe_klarna .stripe-klarna-categories{list-style:none;margin:0;padding:10px}li.payment_method_stripe_alipay,li.payment_method_stripe_bancontact,li.payment_method_stripe_becs,li.payment_method_stripe_eps,li.payment_method_stripe_fpx,li.payment_method_stripe_giropay,li.payment_method_stripe_ideal,li.payment_method_stripe_klarna,li.payment_method_stripe_multibanco,li.payment_method_stripe_p24,li.payment_method_stripe_sepa,li.payment_method_stripe_sofort,li.payment_method_stripe_wechat{display:none}.widget_shopping_cart_content .wc-stripe-mini-cart-payment-methods{list-style:none;margin:0;padding:0}.widget_shopping_cart_content .wc-stripe-mini-cart-payment-methods li{margin:0}.widget_shopping_cart_content a.wc-stripe-applepay-mini-cart,.widget_shopping_cart_content a.wc-stripe-gpay-mini-cart,.widget_shopping_cart_content a.wc-stripe-payment-request-mini-cart{background:0 0;padding:0;border:none}a.wc-stripe-gpay-mini-cart .gpay-button,a.wc-stripe-gpay-mini-cart .gpay-card-info-container a.wc-stripe-applepay-mini-cart .apple-pay-button{width:100%;margin:0}.wc-stripe-payment-request-mini-cart.StripeElement{padding:0;background:0 0;border:none;width:100%}.wc-stripe-payment-request-mini-cart.StripeElement .__PrivateStripeElement{width:100%}.widget_shopping_cart_content .wc-stripe-overlay{display:none!important;position:absolute;background:rgba(255,255,255,.75);height:100%;width:100%;z-index:-1}.widget_shopping_cart_content .wc-stripe-overlay.active{display:block!important;z-index:9999}.wc-stripe-klarna-loader{display:flex;justify-content:center;position:relative;width:100%;height:30px;box-sizing:border-box;transform:scale(.65)}.wc-stripe-klarna-loader div{box-sizing:border-box;display:block;position:absolute;box-sizing:border-box;width:30px;height:30px;border:3px solid #000;border-radius:50%;animation:klarna-payments-loader 1.3s cubic-bezier(.5,0,.5,1) infinite;border-color:#000 transparent transparent transparent}.wc-stripe-klarna-loader div:nth-child(1){animation-delay:-.45s}.wc-stripe-klarna-loader div:nth-child(2){animation-delay:-.3s}.wc-stripe-klarna-loader div:nth-child(3){animation-delay:-.15s}@keyframes klarna-payments-loader{0%{transform:rotate(0)}100%{transform:rotate(-360deg)}}li.payment_method_stripe_alipay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_applepay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_bancontact.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_eps.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_giropay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_googlepay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_grabpay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_multibanco.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_p24.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_payment_request.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_sofort.wc-stripe-no-desc .payment_box.wc-stripe-no-methods{padding:0;margin:0}.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}li[class*=payment_method_stripe_] style{display:none}
assets/css/stripe.min.css CHANGED
@@ -1 +1 @@
1
- .wc-stripe-card-icons-container,.wc-stripe-paymentRequest-icons-container{float:right;display:inline-block}ul.payment_methods li[class*=payment_method]{margin:0;padding:0}li[class*=payment_method] input[type=radio]{margin:0 10px 0 5px}li[class*=payment_method] input[type=radio]+label:not(.wc-stripe-label-payment-type){margin:0}.woocommerce-checkout #payment ul.payment_methods li[class*=payment_method_stripe_]:nth-child(n+2),ul.payment_methods li[class*=payment_method_stripe_]:nth-child(n+2){margin:0}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon,li.payment_method_stripe_payment_request .wc-stripe-paymentRequest-icons-container img{max-width:43px;max-height:26px;width:43px;height:26px;float:none;display:inline}li.payment_method_stripe_payment_request .wc-stripe-paymentRequest-icons-container img{width:25px;height:25px;max-width:25px;max-height:25px}ul.payment_methods label[for*=payment_method_stripe]:after{clear:right;content:"";display:block}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon:nth-child(2n+2){margin:0 2px}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon.open.visa{padding-top:2px}ul.payment_methods li[class*=payment_method_stripe_] label>img:first-of-type{float:right!important}.wc-stripe_cc-new-method-container{margin-bottom:1em}.wc-stripe_cc-container .StripeElement{box-sizing:border-box;height:40px;padding:10px 12px;border-radius:4px;background-color:#fff;-webkit-transition:box-shadow 150ms ease;transition:box-shadow 150ms ease}input.wc-stripe-klarna-category,input.wc-stripe-payment-type{display:none!important}body .wfacp_main_form.woocommerce .wc-stripe-save-source label.checkbox{padding:0!important}input[type=radio]+label.wc-stripe-label-payment-type,label.wc-stripe-label-klarna-category,label.wc-stripe-label-payment-type{margin-bottom:1em;display:block;padding:0!important;color:#000}.theme-flatsome div.wc-stripe-saved-methods-container{margin:0 0 1em 0}label.wc-stripe-label-klarna-category:before,label.wc-stripe-label-payment-type:before{content:"";display:inline-block;width:11px;height:11px;border:2px solid #fff;box-shadow:0 0 0 2px #000;background:#fff;margin-left:4px;margin-right:.5em;border-radius:100%;-webkit-transform:translateY(2px);-ms-transform:translateY(2px);transform:translateY(2px)}input.wc-stripe-klarna-category:checked+label.wc-stripe-label-klarna-category:before,input.wc-stripe-payment-type:checked+label.wc-stripe-label-payment-type:before{background:#000}label.wc-stripe-label-payment-type:after{content:none!important;display:none!important}.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]{width:60px;max-height:35px}li.payment_method_stripe_googlepay 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;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}.qrcode-message{margin:10px 0 0 0}#wc_stripe_local_payment_stripe_becs,#wc_stripe_local_payment_stripe_sepa{padding:10px 12px;box-shadow:0 1px 3px 0 #e6ebf1}.wc-stripe-local-desc.stripe_becs,.wc-stripe-local-desc.stripe_sepa{margin:10px 0}.wc-stripe-clear{clear:both;height:0;visibility:hidden}.wc-stripe-gateway-desc p{margin:0}#wc_stripe_local_payment_stripe_klarna,li[class*=payment_method_stripe_] div.wc-stripe-gateway-container.has_tokens{margin-top:10px}.wc-stripe-gateway-desc{margin-top:10px}#wc-stripe-card-element.StripeElement--webkit-autofill{background-color:transparent!important}#wc_stripe_local_payment_stripe_klarna .stripe-klarna-categories{list-style:none;margin:0;padding:10px}li.payment_method_stripe_alipay,li.payment_method_stripe_bancontact,li.payment_method_stripe_becs,li.payment_method_stripe_eps,li.payment_method_stripe_fpx,li.payment_method_stripe_giropay,li.payment_method_stripe_ideal,li.payment_method_stripe_klarna,li.payment_method_stripe_multibanco,li.payment_method_stripe_p24,li.payment_method_stripe_sepa,li.payment_method_stripe_sofort,li.payment_method_stripe_wechat{display:none}.widget_shopping_cart_content .wc-stripe-mini-cart-payment-methods{list-style:none;margin:0;padding:0}.widget_shopping_cart_content .wc-stripe-mini-cart-payment-methods li{margin:0}.widget_shopping_cart_content a.wc-stripe-applepay-mini-cart,.widget_shopping_cart_content a.wc-stripe-gpay-mini-cart,.widget_shopping_cart_content a.wc-stripe-payment-request-mini-cart{background:0 0;padding:0;border:none}a.wc-stripe-gpay-mini-cart .gpay-button,a.wc-stripe-gpay-mini-cart .gpay-card-info-container a.wc-stripe-applepay-mini-cart .apple-pay-button{width:100%;margin:0}.wc-stripe-payment-request-mini-cart.StripeElement{padding:0;background:0 0;border:none;width:100%}.wc-stripe-payment-request-mini-cart.StripeElement .__PrivateStripeElement{width:100%}.widget_shopping_cart_content .wc-stripe-overlay{display:none!important;position:absolute;background:rgba(255,255,255,.75);height:100%;width:100%;z-index:-1}.widget_shopping_cart_content .wc-stripe-overlay.active{display:block!important;z-index:9999}.wc-stripe-klarna-loader{display:flex;justify-content:center;position:relative;width:100%;height:30px;box-sizing:border-box;transform:scale(.65)}.wc-stripe-klarna-loader div{box-sizing:border-box;display:block;position:absolute;box-sizing:border-box;width:30px;height:30px;border:3px solid #000;border-radius:50%;animation:klarna-payments-loader 1.3s cubic-bezier(.5,0,.5,1) infinite;border-color:#000 transparent transparent transparent}.wc-stripe-klarna-loader div:nth-child(1){animation-delay:-.45s}.wc-stripe-klarna-loader div:nth-child(2){animation-delay:-.3s}.wc-stripe-klarna-loader div:nth-child(3){animation-delay:-.15s}@keyframes klarna-payments-loader{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}li.payment_method_stripe_alipay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_applepay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_bancontact.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_eps.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_giropay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_googlepay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_grabpay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_multibanco.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_p24.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_payment_request.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_sofort.wc-stripe-no-desc .payment_box.wc-stripe-no-methods{padding:0;margin:0}.wc-stripe-paymentRequest-icons-container,.wc-stripe-shortcode-cart-buttons .wc-stripe-card-icons-container{float:right;display:inline-block}ul.payment_methods li[class*=payment_method]{margin:0;padding:0}li[class*=payment_method] input[type=radio]{margin:0 10px 0 5px}li[class*=payment_method] input[type=radio]+label:not(.wc-stripe-label-payment-type){margin:0}.woocommerce-checkout #payment ul.payment_methods li[class*=payment_method_stripe_]:nth-child(n+2),ul.payment_methods li[class*=payment_method_stripe_]:nth-child(n+2){margin:0}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon,li.payment_method_stripe_payment_request .wc-stripe-paymentRequest-icons-container img{max-width:43px;max-height:26px;width:43px;height:26px;float:none;display:inline}li.payment_method_stripe_payment_request .wc-stripe-paymentRequest-icons-container img{width:25px;height:25px;max-width:25px;max-height:25px}ul.payment_methods label[for*=payment_method_stripe]:after{clear:right;content:"";display:block}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon:nth-child(2n+2){margin:0 2px}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon.open.visa{padding-top:2px}ul.payment_methods li[class*=payment_method_stripe_] label>img:first-of-type{float:right!important}.wc-stripe_cc-new-method-container{margin-bottom:1em}.wc-stripe_cc-container .StripeElement{box-sizing:border-box;height:40px;padding:10px 12px;border-radius:4px;background-color:#fff;-webkit-transition:box-shadow 150ms ease;transition:box-shadow 150ms ease}input.wc-stripe-klarna-category,input.wc-stripe-payment-type{display:none!important}body .wfacp_main_form.woocommerce .wc-stripe-save-source label.checkbox{padding:0!important}input[type=radio]+label.wc-stripe-label-payment-type,label.wc-stripe-label-klarna-category,label.wc-stripe-label-payment-type{margin-bottom:1em;display:block;padding:0!important;color:#000}.theme-flatsome div.wc-stripe-saved-methods-container{margin:0 0 1em 0}label.wc-stripe-label-klarna-category:before,label.wc-stripe-label-payment-type:before{content:"";display:inline-block;width:11px;height:11px;border:2px solid #fff;box-shadow:0 0 0 2px #000;background:#fff;margin-left:4px;margin-right:.5em;border-radius:100%;-webkit-transform:translateY(2px);-ms-transform:translateY(2px);transform:translateY(2px)}input.wc-stripe-klarna-category:checked+label.wc-stripe-label-klarna-category:before,input.wc-stripe-payment-type:checked+label.wc-stripe-label-payment-type:before{background:#000}label.wc-stripe-label-payment-type:after{content:none!important;display:none!important}.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]{width:60px;max-height:35px}li.payment_method_stripe_googlepay 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;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}.qrcode-message{margin:10px 0 0 0}#wc_stripe_local_payment_stripe_becs,#wc_stripe_local_payment_stripe_sepa{padding:10px 12px;box-shadow:0 1px 3px 0 #e6ebf1}.wc-stripe-local-desc.stripe_becs,.wc-stripe-local-desc.stripe_sepa{margin:10px 0}.wc-stripe-clear{clear:both;height:0;visibility:hidden}.wc-stripe-gateway-desc p{margin:0}#wc_stripe_local_payment_stripe_klarna,li[class*=payment_method_stripe_] div.wc-stripe-gateway-container.has_tokens{margin-top:10px}.wc-stripe-gateway-desc{margin-top:10px}#wc-stripe-card-element.StripeElement--webkit-autofill{background-color:transparent!important}#wc_stripe_local_payment_stripe_klarna .stripe-klarna-categories{list-style:none;margin:0;padding:10px}li.payment_method_stripe_alipay,li.payment_method_stripe_bancontact,li.payment_method_stripe_becs,li.payment_method_stripe_eps,li.payment_method_stripe_fpx,li.payment_method_stripe_giropay,li.payment_method_stripe_ideal,li.payment_method_stripe_klarna,li.payment_method_stripe_multibanco,li.payment_method_stripe_p24,li.payment_method_stripe_sepa,li.payment_method_stripe_sofort,li.payment_method_stripe_wechat{display:none}.widget_shopping_cart_content .wc-stripe-mini-cart-payment-methods{list-style:none;margin:0;padding:0}.widget_shopping_cart_content .wc-stripe-mini-cart-payment-methods li{margin:0}.widget_shopping_cart_content a.wc-stripe-applepay-mini-cart,.widget_shopping_cart_content a.wc-stripe-gpay-mini-cart,.widget_shopping_cart_content a.wc-stripe-payment-request-mini-cart{background:0 0;padding:0;border:none}a.wc-stripe-gpay-mini-cart .gpay-button,a.wc-stripe-gpay-mini-cart .gpay-card-info-container a.wc-stripe-applepay-mini-cart .apple-pay-button{width:100%;margin:0}.wc-stripe-payment-request-mini-cart.StripeElement{padding:0;background:0 0;border:none;width:100%}.wc-stripe-payment-request-mini-cart.StripeElement .__PrivateStripeElement{width:100%}.widget_shopping_cart_content .wc-stripe-overlay{display:none!important;position:absolute;background:rgba(255,255,255,.75);height:100%;width:100%;z-index:-1}.widget_shopping_cart_content .wc-stripe-overlay.active{display:block!important;z-index:9999}.wc-stripe-klarna-loader{display:flex;justify-content:center;position:relative;width:100%;height:30px;box-sizing:border-box;transform:scale(.65)}.wc-stripe-klarna-loader div{box-sizing:border-box;display:block;position:absolute;box-sizing:border-box;width:30px;height:30px;border:3px solid #000;border-radius:50%;animation:klarna-payments-loader 1.3s cubic-bezier(.5,0,.5,1) infinite;border-color:#000 transparent transparent transparent}.wc-stripe-klarna-loader div:nth-child(1){animation-delay:-.45s}.wc-stripe-klarna-loader div:nth-child(2){animation-delay:-.3s}.wc-stripe-klarna-loader div:nth-child(3){animation-delay:-.15s}@keyframes klarna-payments-loader{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}li.payment_method_stripe_alipay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_applepay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_bancontact.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_eps.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_giropay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_googlepay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_grabpay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_multibanco.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_p24.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_payment_request.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_sofort.wc-stripe-no-desc .payment_box.wc-stripe-no-methods{padding:0;margin:0}.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}li[class*=payment_method_stripe_] style{display:none}
1
+ .wc-stripe-card-icons-container,.wc-stripe-paymentRequest-icons-container{float:right;display:inline-block}ul.payment_methods li[class*=payment_method]{margin:0;padding:0}li[class*=payment_method] input[type=radio]{margin:0 10px 0 5px}li[class*=payment_method] input[type=radio]+label:not(.wc-stripe-label-payment-type){margin:0}.woocommerce-checkout #payment ul.payment_methods li[class*=payment_method_stripe_]:nth-child(n+2),ul.payment_methods li[class*=payment_method_stripe_]:nth-child(n+2){margin:0}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon,li.payment_method_stripe_payment_request .wc-stripe-paymentRequest-icons-container img{max-width:43px;max-height:26px;width:43px;height:26px;float:none;display:inline}li.payment_method_stripe_payment_request .wc-stripe-paymentRequest-icons-container img{width:25px;height:25px;max-width:25px;max-height:25px}ul.payment_methods label[for*=payment_method_stripe]:after{clear:right;content:"";display:block}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon:nth-child(2n+2){margin:0 2px}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon.open.visa{padding-top:2px}ul.payment_methods li[class*=payment_method_stripe_] label>img:first-of-type{float:right!important}.wc-stripe_cc-new-method-container{margin-bottom:1em}.wc-stripe_cc-container .StripeElement{box-sizing:border-box;height:40px;padding:10px 12px;border-radius:4px;background-color:#fff;-webkit-transition:box-shadow 150ms ease;transition:box-shadow 150ms ease}input.wc-stripe-klarna-category,input.wc-stripe-payment-type{display:none!important}body .wfacp_main_form.woocommerce .wc-stripe-save-source label.checkbox{padding:0!important}input[type=radio]+label.wc-stripe-label-payment-type,label.wc-stripe-label-klarna-category,label.wc-stripe-label-payment-type{margin-bottom:1em;display:block;padding:0!important;color:#000}.theme-flatsome div.wc-stripe-saved-methods-container{margin:0 0 1em 0}label.wc-stripe-label-klarna-category:before,label.wc-stripe-label-payment-type:before{content:"";display:inline-block;width:11px;height:11px;border:2px solid #fff;box-shadow:0 0 0 2px #000;background:#fff;margin-left:4px;margin-right:.5em;border-radius:100%;-webkit-transform:translateY(2px);-ms-transform:translateY(2px);transform:translateY(2px)}input.wc-stripe-klarna-category:checked+label.wc-stripe-label-klarna-category:before,input.wc-stripe-payment-type:checked+label.wc-stripe-label-payment-type:before{background:#000}label.wc-stripe-label-payment-type:after{content:none!important;display:none!important}.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]{width:60px;max-height:35px}li.payment_method_stripe_googlepay 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}.qrcode-message{margin:10px 0 0 0}#wc_stripe_local_payment_stripe_becs,#wc_stripe_local_payment_stripe_sepa{padding:10px 12px;box-shadow:0 1px 3px 0 #e6ebf1}.wc-stripe-local-desc.stripe_becs,.wc-stripe-local-desc.stripe_sepa{margin:10px 0}.wc-stripe-clear{clear:both;height:0;visibility:hidden}.wc-stripe-gateway-desc p{margin:0}#wc_stripe_local_payment_stripe_klarna,li[class*=payment_method_stripe_] div.wc-stripe-gateway-container.has_tokens{margin-top:10px}.wc-stripe-gateway-desc{margin-top:10px}#wc-stripe-card-element.StripeElement--webkit-autofill{background-color:transparent!important}#wc_stripe_local_payment_stripe_klarna .stripe-klarna-categories{list-style:none;margin:0;padding:10px}li.payment_method_stripe_alipay,li.payment_method_stripe_bancontact,li.payment_method_stripe_becs,li.payment_method_stripe_eps,li.payment_method_stripe_fpx,li.payment_method_stripe_giropay,li.payment_method_stripe_ideal,li.payment_method_stripe_klarna,li.payment_method_stripe_multibanco,li.payment_method_stripe_p24,li.payment_method_stripe_sepa,li.payment_method_stripe_sofort,li.payment_method_stripe_wechat{display:none}.widget_shopping_cart_content .wc-stripe-mini-cart-payment-methods{list-style:none;margin:0;padding:0}.widget_shopping_cart_content .wc-stripe-mini-cart-payment-methods li{margin:0}.widget_shopping_cart_content a.wc-stripe-applepay-mini-cart,.widget_shopping_cart_content a.wc-stripe-gpay-mini-cart,.widget_shopping_cart_content a.wc-stripe-payment-request-mini-cart{background:0 0;padding:0;border:none}a.wc-stripe-gpay-mini-cart .gpay-button,a.wc-stripe-gpay-mini-cart .gpay-card-info-container a.wc-stripe-applepay-mini-cart .apple-pay-button{width:100%;margin:0}.wc-stripe-payment-request-mini-cart.StripeElement{padding:0;background:0 0;border:none;width:100%}.wc-stripe-payment-request-mini-cart.StripeElement .__PrivateStripeElement{width:100%}.widget_shopping_cart_content .wc-stripe-overlay{display:none!important;position:absolute;background:rgba(255,255,255,.75);height:100%;width:100%;z-index:-1}.widget_shopping_cart_content .wc-stripe-overlay.active{display:block!important;z-index:9999}.wc-stripe-klarna-loader{display:flex;justify-content:center;position:relative;width:100%;height:30px;box-sizing:border-box;transform:scale(.65)}.wc-stripe-klarna-loader div{box-sizing:border-box;display:block;position:absolute;box-sizing:border-box;width:30px;height:30px;border:3px solid #000;border-radius:50%;animation:klarna-payments-loader 1.3s cubic-bezier(.5,0,.5,1) infinite;border-color:#000 transparent transparent transparent}.wc-stripe-klarna-loader div:nth-child(1){animation-delay:-.45s}.wc-stripe-klarna-loader div:nth-child(2){animation-delay:-.3s}.wc-stripe-klarna-loader div:nth-child(3){animation-delay:-.15s}@keyframes klarna-payments-loader{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}li.payment_method_stripe_alipay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_applepay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_bancontact.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_eps.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_giropay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_googlepay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_grabpay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_multibanco.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_p24.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_payment_request.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_sofort.wc-stripe-no-desc .payment_box.wc-stripe-no-methods{padding:0;margin:0}.wc-stripe-paymentRequest-icons-container,.wc-stripe-shortcode-cart-buttons .wc-stripe-card-icons-container{float:right;display:inline-block}ul.payment_methods li[class*=payment_method]{margin:0;padding:0}li[class*=payment_method] input[type=radio]{margin:0 10px 0 5px}li[class*=payment_method] input[type=radio]+label:not(.wc-stripe-label-payment-type){margin:0}.woocommerce-checkout #payment ul.payment_methods li[class*=payment_method_stripe_]:nth-child(n+2),ul.payment_methods li[class*=payment_method_stripe_]:nth-child(n+2){margin:0}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon,li.payment_method_stripe_payment_request .wc-stripe-paymentRequest-icons-container img{max-width:43px;max-height:26px;width:43px;height:26px;float:none;display:inline}li.payment_method_stripe_payment_request .wc-stripe-paymentRequest-icons-container img{width:25px;height:25px;max-width:25px;max-height:25px}ul.payment_methods label[for*=payment_method_stripe]:after{clear:right;content:"";display:block}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon:nth-child(2n+2){margin:0 2px}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon.open.visa{padding-top:2px}ul.payment_methods li[class*=payment_method_stripe_] label>img:first-of-type{float:right!important}.wc-stripe_cc-new-method-container{margin-bottom:1em}.wc-stripe_cc-container .StripeElement{box-sizing:border-box;height:40px;padding:10px 12px;border-radius:4px;background-color:#fff;-webkit-transition:box-shadow 150ms ease;transition:box-shadow 150ms ease}input.wc-stripe-klarna-category,input.wc-stripe-payment-type{display:none!important}body .wfacp_main_form.woocommerce .wc-stripe-save-source label.checkbox{padding:0!important}input[type=radio]+label.wc-stripe-label-payment-type,label.wc-stripe-label-klarna-category,label.wc-stripe-label-payment-type{margin-bottom:1em;display:block;padding:0!important;color:#000}.theme-flatsome div.wc-stripe-saved-methods-container{margin:0 0 1em 0}label.wc-stripe-label-klarna-category:before,label.wc-stripe-label-payment-type:before{content:"";display:inline-block;width:11px;height:11px;border:2px solid #fff;box-shadow:0 0 0 2px #000;background:#fff;margin-left:4px;margin-right:.5em;border-radius:100%;-webkit-transform:translateY(2px);-ms-transform:translateY(2px);transform:translateY(2px)}input.wc-stripe-klarna-category:checked+label.wc-stripe-label-klarna-category:before,input.wc-stripe-payment-type:checked+label.wc-stripe-label-payment-type:before{background:#000}label.wc-stripe-label-payment-type:after{content:none!important;display:none!important}.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]{width:60px;max-height:35px}li.payment_method_stripe_googlepay 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;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}.qrcode-message{margin:10px 0 0 0}#wc_stripe_local_payment_stripe_becs,#wc_stripe_local_payment_stripe_sepa{padding:10px 12px;box-shadow:0 1px 3px 0 #e6ebf1}.wc-stripe-local-desc.stripe_becs,.wc-stripe-local-desc.stripe_sepa{margin:10px 0}.wc-stripe-clear{clear:both;height:0;visibility:hidden}.wc-stripe-gateway-desc p{margin:0}#wc_stripe_local_payment_stripe_klarna,li[class*=payment_method_stripe_] div.wc-stripe-gateway-container.has_tokens{margin-top:10px}.wc-stripe-gateway-desc{margin-top:10px}#wc-stripe-card-element.StripeElement--webkit-autofill{background-color:transparent!important}#wc_stripe_local_payment_stripe_klarna .stripe-klarna-categories{list-style:none;margin:0;padding:10px}li.payment_method_stripe_alipay,li.payment_method_stripe_bancontact,li.payment_method_stripe_becs,li.payment_method_stripe_eps,li.payment_method_stripe_fpx,li.payment_method_stripe_giropay,li.payment_method_stripe_ideal,li.payment_method_stripe_klarna,li.payment_method_stripe_multibanco,li.payment_method_stripe_p24,li.payment_method_stripe_sepa,li.payment_method_stripe_sofort,li.payment_method_stripe_wechat{display:none}.widget_shopping_cart_content .wc-stripe-mini-cart-payment-methods{list-style:none;margin:0;padding:0}.widget_shopping_cart_content .wc-stripe-mini-cart-payment-methods li{margin:0}.widget_shopping_cart_content a.wc-stripe-applepay-mini-cart,.widget_shopping_cart_content a.wc-stripe-gpay-mini-cart,.widget_shopping_cart_content a.wc-stripe-payment-request-mini-cart{background:0 0;padding:0;border:none}a.wc-stripe-gpay-mini-cart .gpay-button,a.wc-stripe-gpay-mini-cart .gpay-card-info-container a.wc-stripe-applepay-mini-cart .apple-pay-button{width:100%;margin:0}.wc-stripe-payment-request-mini-cart.StripeElement{padding:0;background:0 0;border:none;width:100%}.wc-stripe-payment-request-mini-cart.StripeElement .__PrivateStripeElement{width:100%}.widget_shopping_cart_content .wc-stripe-overlay{display:none!important;position:absolute;background:rgba(255,255,255,.75);height:100%;width:100%;z-index:-1}.widget_shopping_cart_content .wc-stripe-overlay.active{display:block!important;z-index:9999}.wc-stripe-klarna-loader{display:flex;justify-content:center;position:relative;width:100%;height:30px;box-sizing:border-box;transform:scale(.65)}.wc-stripe-klarna-loader div{box-sizing:border-box;display:block;position:absolute;box-sizing:border-box;width:30px;height:30px;border:3px solid #000;border-radius:50%;animation:klarna-payments-loader 1.3s cubic-bezier(.5,0,.5,1) infinite;border-color:#000 transparent transparent transparent}.wc-stripe-klarna-loader div:nth-child(1){animation-delay:-.45s}.wc-stripe-klarna-loader div:nth-child(2){animation-delay:-.3s}.wc-stripe-klarna-loader div:nth-child(3){animation-delay:-.15s}@keyframes klarna-payments-loader{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}li.payment_method_stripe_alipay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_applepay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_bancontact.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_eps.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_giropay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_googlepay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_grabpay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_multibanco.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_p24.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_payment_request.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_sofort.wc-stripe-no-desc .payment_box.wc-stripe-no-methods{padding:0;margin:0}.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}li[class*=payment_method_stripe_] style{display:none}
assets/js/frontend/applepay-checkout.js CHANGED
@@ -37,7 +37,7 @@
37
  * @return {[type]}
38
  */
39
  ApplePay.prototype.append_button = function () {
40
- $('#place_order').parent().append(this.$button);
41
  this.trigger_payment_method_selected();
42
  }
43
 
37
  * @return {[type]}
38
  */
39
  ApplePay.prototype.append_button = function () {
40
+ $('#place_order').after(this.$button);
41
  this.trigger_payment_method_selected();
42
  }
43
 
assets/js/frontend/applepay-checkout.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,i){function t(){i.BaseGateway.call(this,wc_stripe_applepay_checkout_params)}(t.prototype=e.extend({},i.BaseGateway.prototype,i.CheckoutGateway.prototype,i.ApplePay.prototype)).initialize=function(){i.CheckoutGateway.call(this),e("form.checkout").on("change",".form-row:not(.address-field) .input-text",this.update_payment_request.bind(this)),e(this.container).length&&i.ApplePay.prototype.initialize.call(this)},t.prototype.canMakePayment=function(){i.ApplePay.prototype.canMakePayment.apply(this,arguments).then(function(){var t;this.banner_enabled()&&((t=e(this.params.button)).addClass("banner-checkout"),t.on("click",this.start.bind(this)),e(this.banner_container).empty().append(t),e(this.banner_container).show().parent().parent().addClass("active"))}.bind(this))},t.prototype.append_button=function(){e("#place_order").parent().append(this.$button),this.trigger_payment_method_selected()},t.prototype.updated_checkout=function(){e(this.container).length&&i.ApplePay.prototype.initialize.call(this)},t.prototype.start=function(t){e(t.target).is(".banner-checkout")&&(this.set_payment_method(this.gateway_id),this.set_use_new_option(!0)),i.ApplePay.prototype.start.apply(this,arguments)},t.prototype.on_token_received=function(){i.CheckoutGateway.prototype.on_token_received.apply(this,arguments),this.payment_request_options.requestShipping&&this.maybe_set_ship_to_different(),this.fields.toFormFields({update_shipping_method:!1}),this.checkout_fields_valid()&&this.get_form().submit()},t.prototype.update_payment_request=function(){e(this.container).length&&i.ApplePay.prototype.initialize.call(this)},new t}(jQuery,window.wc_stripe);
1
+ !function(e,i){function t(){i.BaseGateway.call(this,wc_stripe_applepay_checkout_params)}(t.prototype=e.extend({},i.BaseGateway.prototype,i.CheckoutGateway.prototype,i.ApplePay.prototype)).initialize=function(){i.CheckoutGateway.call(this),e("form.checkout").on("change",".form-row:not(.address-field) .input-text",this.update_payment_request.bind(this)),e(this.container).length&&i.ApplePay.prototype.initialize.call(this)},t.prototype.canMakePayment=function(){i.ApplePay.prototype.canMakePayment.apply(this,arguments).then(function(){var t;this.banner_enabled()&&((t=e(this.params.button)).addClass("banner-checkout"),t.on("click",this.start.bind(this)),e(this.banner_container).empty().append(t),e(this.banner_container).show().parent().parent().addClass("active"))}.bind(this))},t.prototype.append_button=function(){e("#place_order").after(this.$button),this.trigger_payment_method_selected()},t.prototype.updated_checkout=function(){e(this.container).length&&i.ApplePay.prototype.initialize.call(this)},t.prototype.start=function(t){e(t.target).is(".banner-checkout")&&(this.set_payment_method(this.gateway_id),this.set_use_new_option(!0)),i.ApplePay.prototype.start.apply(this,arguments)},t.prototype.on_token_received=function(){i.CheckoutGateway.prototype.on_token_received.apply(this,arguments),this.payment_request_options.requestShipping&&this.maybe_set_ship_to_different(),this.fields.toFormFields({update_shipping_method:!1}),this.checkout_fields_valid()&&this.get_form().submit()},t.prototype.update_payment_request=function(){e(this.container).length&&i.ApplePay.prototype.initialize.call(this)},new t}(jQuery,window.wc_stripe);
assets/js/frontend/credit-card.js CHANGED
@@ -236,7 +236,7 @@
236
  return new Promise(function (resolve, reject) {
237
  // call intent api
238
  $.when($.ajax({
239
- method: 'GET',
240
  dataType: 'json',
241
  url: this.params.routes.setup_intent,
242
  beforeSend: this.ajax_before_send.bind(this)
236
  return new Promise(function (resolve, reject) {
237
  // call intent api
238
  $.when($.ajax({
239
+ method: 'POST',
240
  dataType: 'json',
241
  url: this.params.routes.setup_intent,
242
  beforeSend: this.ajax_before_send.bind(this)
assets/js/frontend/credit-card.min.js CHANGED
@@ -1 +1 @@
1
- !function(r,e){function t(){e.BaseGateway.call(this,wc_stripe_credit_card_params),e.CheckoutGateway.call(this),window.addEventListener("hashchange",this.hashchange.bind(this)),(e.credit_card=this).confirmedSetupIntent=!1,this.has3DSecureParams()}var i={focus:"focused",empty:"empty",invalid:"invalid"};(t.prototype=r.extend({},e.BaseGateway.prototype,e.CheckoutGateway.prototype)).mappings={cardNumber:"#stripe-card-number",cardExpiry:"#stripe-exp",cardCvc:"#stripe-cvv"},t.prototype.initialize=function(){r(document.body).on("click","#place_order",this.place_order.bind(this)),this.setup_card(),this.can_create_setup_intent()&&this.create_setup_intent()},t.prototype.setup_card=function(){var e;this.is_custom_form()?(e=r.extend(!0,{classes:i},this.params.cardOptions),["cardNumber","cardExpiry","cardCvc"].forEach(function(t){this[t]=this.elements.create(t,r.extend(!0,{},e,this.params.customFieldOptions[t]))}.bind(this)),this.cardNumber.on("change",this.card_number_change.bind(this)),this.cardNumber.on("change",this.on_input_change.bind(this)),this.cardExpiry.on("change",this.on_input_change.bind(this)),this.cardCvc.on("change",this.on_input_change.bind(this)),this.fields.required("billing_postcode")&&""!==this.fields.get("billing_postcode")&&0<r("#stripe-postal-code").length&&(r("#stripe-postal-code").val(this.fields.get("billing_postcode")),this.validate_postal_field()),r(document.body).on("change","#billing_postcode",function(t){var e=r("#billing_postcode").val();r("#stripe-postal-code").val(e).trigger("keyup")}.bind(this))):(this.card=this.elements.create("card",r.extend(!0,{},{value:{postalCode:this.fields.get("billing_postcode","")},hidePostalCode:this.fields.required("billing_postcode"),iconStyle:"default"},this.params.cardOptions)),r(document.body).on("change","#billing_postcode",function(t){this.card&&this.card.update({value:r("#billing_postcode").val()})}.bind(this))),setInterval(this.create_card_element.bind(this),2e3)},t.prototype.validate_postal_field=function(){var t,e;r("#billing_postcode").length&&r("#stripe-postal-code").length?this.params.postal_regex[this.fields.get("billing_country")]?(e=this.params.postal_regex[this.fields.get("billing_country")],t=r("#stripe-postal-code").val(),e=new RegExp(e,"i"),""!==t?null!==e.exec(t)?r("#stripe-postal-code").addClass("StripeElement--complete").removeClass("invalid"):r("#stripe-postal-code").removeClass("StripeElement--complete").addClass("invalid"):r("#stripe-postal-code").removeClass("StripeElement--complete").removeClass("invalid")):0!=r("#stripe-postal-code").val()?r("#stripe-postal-code").addClass("StripeElement--complete"):r("#stripe-postal-code").removeClass("StripeElement--complete"):r("#stripe-postal-code").length&&(""!=r("#stripe-postal-code").val()?r("#stripe-postal-code").addClass("StripeElement--complete"):r("#stripe-postal-code").removeClass("StripeElement--complete"))},t.prototype.create_card_element=function(){this.is_custom_form()?r("#wc-stripe-cc-custom-form").length&&0==r("#wc-stripe-cc-custom-form").find("iframe").length&&(r(this.mappings.cardNumber).length&&(this.cardNumber.mount(this.mappings.cardNumber),r(this.mappings.cardNumber).prepend(this.params.html.card_brand)),r(this.mappings.cardExpiry).length&&this.cardExpiry.mount(this.mappings.cardExpiry),r(this.mappings.cardCvc).length&&this.cardCvc.mount(this.mappings.cardCvc),r("#stripe-postal-code").length&&(r("#stripe-postal-code, .postalCode").on("focus",function(t){r("#stripe-postal-code").addClass("focused")}.bind(this)),r("#stripe-postal-code, .postalCode").on("blur",function(t){r("#stripe-postal-code").removeClass("focused").trigger("keyup")}.bind(this)),r("#stripe-postal-code").on("keyup",function(t){0==r("#stripe-postal-code").val()?r("#stripe-postal-code").addClass("empty"):r("#stripe-postal-code").removeClass("empty")}.bind(this)),r("#stripe-postal-code").on("change",this.validate_postal_field.bind(this)),r("#stripe-postal-code").trigger("change"))):r("#wc-stripe-card-element").length&&0==r("#wc-stripe-card-element").find("iframe").length&&(this.card.unmount(),this.card.mount("#wc-stripe-card-element"),this.card.update({value:{postalCode:this.fields.get("billing_postcode","")},hidePostalCode:this.fields.required("billing_postcode")})),r(this.container).outerWidth(!0)<450?r(this.container).addClass("stripe-small-container"):r(this.container).removeClass("stripe-small-container")},t.prototype.place_order=function(t){if(this.is_gateway_selected())if(this.can_create_setup_intent()&&!this.is_saved_method_selected()&&this.checkout_fields_valid()){if(t.preventDefault(),this.confirmedSetupIntent)return this.on_setup_intent_received(this.confirmedSetupIntent.payment_method);this.stripe.confirmCardSetup(this.client_secret,{payment_method:{card:this.is_custom_form()?this.cardNumber:this.card,billing_details:function(){return this.is_current_page("checkout")?this.get_billing_details():r.extend({},this.is_custom_form()?{address:{postal_code:r("#stripe-postal-code").val()}}:{})}.bind(this)()}}).then(function(t){t.error?this.submit_error(t.error):(this.confirmedSetupIntent=t.setupIntent,this.on_setup_intent_received(t.setupIntent.payment_method))}.bind(this))}else this.payment_token_received||this.is_saved_method_selected()||(t.preventDefault(),this.checkout_fields_valid()&&this.stripe.createPaymentMethod({type:"card",card:this.is_custom_form()?this.cardNumber:this.card,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)))},t.prototype.checkout_place_order=function(){return this.is_saved_method_selected()||this.payment_token_received?e.CheckoutGateway.prototype.checkout_place_order.apply(this,arguments):(this.place_order.apply(this,arguments),!1)},t.prototype.create_setup_intent=function(){return new Promise(function(e,t){r.when(r.ajax({method:"GET",dataType:"json",url:this.params.routes.setup_intent,beforeSend:this.ajax_before_send.bind(this)})).done(function(t){t.code?this.submit_error(t.message):this.client_secret=t.intent.client_secret,e(t)}.bind(this)).fail(function(t,e,i){this.submit_error(i)}.bind(this))}.bind(this))},t.prototype.on_token_received=function(t){this.payment_token_received=!0,this.set_nonce(t.id),this.get_form().submit()},t.prototype.on_setup_intent_received=function(t){this.payment_token_received=!0,this.set_nonce(t),this.get_form().submit()},t.prototype.updated_checkout=function(){this.create_card_element(),this.can_create_setup_intent()&&!this.client_secret&&this.create_setup_intent()},t.prototype.update_checkout=function(){this.clear_card_elements()},t.prototype.show_payment_button=function(){e.CheckoutGateway.prototype.show_place_order.apply(this,arguments)},t.prototype.hide_place_order=function(){},t.prototype.is_custom_form=function(){return"1"===this.params.custom_form},t.prototype.get_element_options=function(){return this.params.elementOptions},t.prototype.get_postal_code=function(){return this.is_custom_form()&&0<r("#stripe-postal-code").length?r("#stripe-postal-code").val():this.fields.get("billing_postcode",null)},t.prototype.card_number_change=function(t){"unknown"===t.brand?r("#wc-stripe-card").removeClass("active"):r("#wc-stripe-card").addClass("active"),r("#wc-stripe-card").attr("src",this.params.cards[t.brand])},t.prototype.on_input_change=function(t){if(t.complete){var e=r("#wc-stripe-cc-custom-form").find(".StripeElement, #stripe-postal-code"),i=[];e.each(function(t,e){i.push("#"+r(e).attr("id"))}.bind(this));var t=this.mappings[t.elementType],s=i.indexOf(t);if("undefined"!=typeof i[s+1])if("#stripe-postal-code"===i[s+1])document.getElementById("stripe-postal-code").focus();else for(var o in this.mappings)this.mappings[o]===i[s+1]&&this[o].focus()}},t.prototype.clear_card_elements=function(){for(var t=["cardNumber","cardExpiry","cardCvc"],e=0;e<t.length;e++)this[t[e]]&&this[t[e]].clear()},t.prototype.checkout_error=function(){this.is_gateway_selected()&&(this.payment_token_received=!1),e.CheckoutGateway.prototype.checkout_error.call(this)},t.prototype.get_billing_details=function(){var t=e.BaseGateway.prototype.get_billing_details.call(this);return t.address.postal_code=this.get_postal_code(),t},t.prototype.can_create_setup_intent=function(){return this.is_add_payment_method_page()||this.is_change_payment_method()||this.is_current_page("checkout")&&this.cart_contains_subscription()&&this.get_gateway_data()&&0==this.get_total_price_cents()||this.is_current_page("checkout")&&"undefined"!=typeof wc_stripe_preorder_exists||this.is_current_page("order_pay")&&"pre_order"in this.get_gateway_data()&&!0===this.get_gateway_data().pre_order},new t}(jQuery,window.wc_stripe);
1
+ !function(r,e){function t(){e.BaseGateway.call(this,wc_stripe_credit_card_params),e.CheckoutGateway.call(this),window.addEventListener("hashchange",this.hashchange.bind(this)),(e.credit_card=this).confirmedSetupIntent=!1,this.has3DSecureParams()}var i={focus:"focused",empty:"empty",invalid:"invalid"};(t.prototype=r.extend({},e.BaseGateway.prototype,e.CheckoutGateway.prototype)).mappings={cardNumber:"#stripe-card-number",cardExpiry:"#stripe-exp",cardCvc:"#stripe-cvv"},t.prototype.initialize=function(){r(document.body).on("click","#place_order",this.place_order.bind(this)),this.setup_card(),this.can_create_setup_intent()&&this.create_setup_intent()},t.prototype.setup_card=function(){var e;this.is_custom_form()?(e=r.extend(!0,{classes:i},this.params.cardOptions),["cardNumber","cardExpiry","cardCvc"].forEach(function(t){this[t]=this.elements.create(t,r.extend(!0,{},e,this.params.customFieldOptions[t]))}.bind(this)),this.cardNumber.on("change",this.card_number_change.bind(this)),this.cardNumber.on("change",this.on_input_change.bind(this)),this.cardExpiry.on("change",this.on_input_change.bind(this)),this.cardCvc.on("change",this.on_input_change.bind(this)),this.fields.required("billing_postcode")&&""!==this.fields.get("billing_postcode")&&0<r("#stripe-postal-code").length&&(r("#stripe-postal-code").val(this.fields.get("billing_postcode")),this.validate_postal_field()),r(document.body).on("change","#billing_postcode",function(t){var e=r("#billing_postcode").val();r("#stripe-postal-code").val(e).trigger("keyup")}.bind(this))):(this.card=this.elements.create("card",r.extend(!0,{},{value:{postalCode:this.fields.get("billing_postcode","")},hidePostalCode:this.fields.required("billing_postcode"),iconStyle:"default"},this.params.cardOptions)),r(document.body).on("change","#billing_postcode",function(t){this.card&&this.card.update({value:r("#billing_postcode").val()})}.bind(this))),setInterval(this.create_card_element.bind(this),2e3)},t.prototype.validate_postal_field=function(){var t,e;r("#billing_postcode").length&&r("#stripe-postal-code").length?this.params.postal_regex[this.fields.get("billing_country")]?(e=this.params.postal_regex[this.fields.get("billing_country")],t=r("#stripe-postal-code").val(),e=new RegExp(e,"i"),""!==t?null!==e.exec(t)?r("#stripe-postal-code").addClass("StripeElement--complete").removeClass("invalid"):r("#stripe-postal-code").removeClass("StripeElement--complete").addClass("invalid"):r("#stripe-postal-code").removeClass("StripeElement--complete").removeClass("invalid")):0!=r("#stripe-postal-code").val()?r("#stripe-postal-code").addClass("StripeElement--complete"):r("#stripe-postal-code").removeClass("StripeElement--complete"):r("#stripe-postal-code").length&&(""!=r("#stripe-postal-code").val()?r("#stripe-postal-code").addClass("StripeElement--complete"):r("#stripe-postal-code").removeClass("StripeElement--complete"))},t.prototype.create_card_element=function(){this.is_custom_form()?r("#wc-stripe-cc-custom-form").length&&0==r("#wc-stripe-cc-custom-form").find("iframe").length&&(r(this.mappings.cardNumber).length&&(this.cardNumber.mount(this.mappings.cardNumber),r(this.mappings.cardNumber).prepend(this.params.html.card_brand)),r(this.mappings.cardExpiry).length&&this.cardExpiry.mount(this.mappings.cardExpiry),r(this.mappings.cardCvc).length&&this.cardCvc.mount(this.mappings.cardCvc),r("#stripe-postal-code").length&&(r("#stripe-postal-code, .postalCode").on("focus",function(t){r("#stripe-postal-code").addClass("focused")}.bind(this)),r("#stripe-postal-code, .postalCode").on("blur",function(t){r("#stripe-postal-code").removeClass("focused").trigger("keyup")}.bind(this)),r("#stripe-postal-code").on("keyup",function(t){0==r("#stripe-postal-code").val()?r("#stripe-postal-code").addClass("empty"):r("#stripe-postal-code").removeClass("empty")}.bind(this)),r("#stripe-postal-code").on("change",this.validate_postal_field.bind(this)),r("#stripe-postal-code").trigger("change"))):r("#wc-stripe-card-element").length&&0==r("#wc-stripe-card-element").find("iframe").length&&(this.card.unmount(),this.card.mount("#wc-stripe-card-element"),this.card.update({value:{postalCode:this.fields.get("billing_postcode","")},hidePostalCode:this.fields.required("billing_postcode")})),r(this.container).outerWidth(!0)<450?r(this.container).addClass("stripe-small-container"):r(this.container).removeClass("stripe-small-container")},t.prototype.place_order=function(t){if(this.is_gateway_selected())if(this.can_create_setup_intent()&&!this.is_saved_method_selected()&&this.checkout_fields_valid()){if(t.preventDefault(),this.confirmedSetupIntent)return this.on_setup_intent_received(this.confirmedSetupIntent.payment_method);this.stripe.confirmCardSetup(this.client_secret,{payment_method:{card:this.is_custom_form()?this.cardNumber:this.card,billing_details:function(){return this.is_current_page("checkout")?this.get_billing_details():r.extend({},this.is_custom_form()?{address:{postal_code:r("#stripe-postal-code").val()}}:{})}.bind(this)()}}).then(function(t){t.error?this.submit_error(t.error):(this.confirmedSetupIntent=t.setupIntent,this.on_setup_intent_received(t.setupIntent.payment_method))}.bind(this))}else this.payment_token_received||this.is_saved_method_selected()||(t.preventDefault(),this.checkout_fields_valid()&&this.stripe.createPaymentMethod({type:"card",card:this.is_custom_form()?this.cardNumber:this.card,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)))},t.prototype.checkout_place_order=function(){return this.is_saved_method_selected()||this.payment_token_received?e.CheckoutGateway.prototype.checkout_place_order.apply(this,arguments):(this.place_order.apply(this,arguments),!1)},t.prototype.create_setup_intent=function(){return new Promise(function(e,t){r.when(r.ajax({method:"POST",dataType:"json",url:this.params.routes.setup_intent,beforeSend:this.ajax_before_send.bind(this)})).done(function(t){t.code?this.submit_error(t.message):this.client_secret=t.intent.client_secret,e(t)}.bind(this)).fail(function(t,e,i){this.submit_error(i)}.bind(this))}.bind(this))},t.prototype.on_token_received=function(t){this.payment_token_received=!0,this.set_nonce(t.id),this.get_form().submit()},t.prototype.on_setup_intent_received=function(t){this.payment_token_received=!0,this.set_nonce(t),this.get_form().submit()},t.prototype.updated_checkout=function(){this.create_card_element(),this.can_create_setup_intent()&&!this.client_secret&&this.create_setup_intent()},t.prototype.update_checkout=function(){this.clear_card_elements()},t.prototype.show_payment_button=function(){e.CheckoutGateway.prototype.show_place_order.apply(this,arguments)},t.prototype.hide_place_order=function(){},t.prototype.is_custom_form=function(){return"1"===this.params.custom_form},t.prototype.get_element_options=function(){return this.params.elementOptions},t.prototype.get_postal_code=function(){return this.is_custom_form()&&0<r("#stripe-postal-code").length?r("#stripe-postal-code").val():this.fields.get("billing_postcode",null)},t.prototype.card_number_change=function(t){"unknown"===t.brand?r("#wc-stripe-card").removeClass("active"):r("#wc-stripe-card").addClass("active"),r("#wc-stripe-card").attr("src",this.params.cards[t.brand])},t.prototype.on_input_change=function(t){if(t.complete){var e=r("#wc-stripe-cc-custom-form").find(".StripeElement, #stripe-postal-code"),i=[];e.each(function(t,e){i.push("#"+r(e).attr("id"))}.bind(this));var t=this.mappings[t.elementType],s=i.indexOf(t);if("undefined"!=typeof i[s+1])if("#stripe-postal-code"===i[s+1])document.getElementById("stripe-postal-code").focus();else for(var o in this.mappings)this.mappings[o]===i[s+1]&&this[o].focus()}},t.prototype.clear_card_elements=function(){for(var t=["cardNumber","cardExpiry","cardCvc"],e=0;e<t.length;e++)this[t[e]]&&this[t[e]].clear()},t.prototype.checkout_error=function(){this.is_gateway_selected()&&(this.payment_token_received=!1),e.CheckoutGateway.prototype.checkout_error.call(this)},t.prototype.get_billing_details=function(){var t=e.BaseGateway.prototype.get_billing_details.call(this);return t.address.postal_code=this.get_postal_code(),t},t.prototype.can_create_setup_intent=function(){return this.is_add_payment_method_page()||this.is_change_payment_method()||this.is_current_page("checkout")&&this.cart_contains_subscription()&&this.get_gateway_data()&&0==this.get_total_price_cents()||this.is_current_page("checkout")&&"undefined"!=typeof wc_stripe_preorder_exists||this.is_current_page("order_pay")&&"pre_order"in this.get_gateway_data()&&!0===this.get_gateway_data().pre_order},new t}(jQuery,window.wc_stripe);
assets/js/frontend/googlepay-checkout.js CHANGED
@@ -45,7 +45,7 @@
45
  */
46
  GPay.prototype.create_button = function () {
47
  wc_stripe.GooglePay.prototype.create_button.apply(this, arguments);
48
- $("#place_order").parent().append(this.$button);
49
  this.trigger_payment_method_selected();
50
  }
51
 
45
  */
46
  GPay.prototype.create_button = function () {
47
  wc_stripe.GooglePay.prototype.create_button.apply(this, arguments);
48
+ $('#place_order').after(this.$button);
49
  this.trigger_payment_method_selected();
50
  }
51
 
assets/js/frontend/googlepay-checkout.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){function i(){this.can_pay=!1,t.BaseGateway.call(this,wc_stripe_googlepay_checkout_params),t.CheckoutGateway.call(this),window.addEventListener("hashchange",this.hashchange.bind(this)),this.has3DSecureParams()}(i.prototype=e.extend({},t.BaseGateway.prototype,t.CheckoutGateway.prototype,t.GooglePay.prototype)).initialize=function(){e(this.container).length&&(this.createPaymentsClient(),this.isReadyToPay().then(function(){var t;e(this.container).show(),this.banner_enabled()&&(t=e(this.paymentsClient.createButton({onClick:this.banner_checkout.bind(this),buttonColor:this.params.button_color,buttonType:this.params.button_style})),e(this.banner_container).show().parent().parent().addClass("active"),e(this.banner_container).empty().append(t))}.bind(this)))},i.prototype.create_button=function(){t.GooglePay.prototype.create_button.apply(this,arguments),e("#place_order").parent().append(this.$button),this.trigger_payment_method_selected()},i.prototype.updated_checkout=function(){this.initialize()},i.prototype.banner_checkout=function(){this.set_payment_method(this.gateway_id),this.set_use_new_option(!0),t.GooglePay.prototype.start.apply(this,arguments)},i.prototype.on_token_received=function(){t.CheckoutGateway.prototype.on_token_received.apply(this,arguments),this.payment_request_options.shippingAddressRequired&&this.maybe_set_ship_to_different(),this.fields.toFormFields({update_shipping_method:!1}),this.checkout_fields_valid()&&this.get_form().submit()},i.prototype.payment_data_updated=function(t){this.populate_billing_fields(t.address),this.fields.toFormFields({update_shipping_method:!1})},new i}(jQuery,window.wc_stripe);
1
+ !function(e,t){function i(){this.can_pay=!1,t.BaseGateway.call(this,wc_stripe_googlepay_checkout_params),t.CheckoutGateway.call(this),window.addEventListener("hashchange",this.hashchange.bind(this)),this.has3DSecureParams()}(i.prototype=e.extend({},t.BaseGateway.prototype,t.CheckoutGateway.prototype,t.GooglePay.prototype)).initialize=function(){e(this.container).length&&(this.createPaymentsClient(),this.isReadyToPay().then(function(){var t;e(this.container).show(),this.banner_enabled()&&(t=e(this.paymentsClient.createButton({onClick:this.banner_checkout.bind(this),buttonColor:this.params.button_color,buttonType:this.params.button_style})),e(this.banner_container).show().parent().parent().addClass("active"),e(this.banner_container).empty().append(t))}.bind(this)))},i.prototype.create_button=function(){t.GooglePay.prototype.create_button.apply(this,arguments),e("#place_order").after(this.$button),this.trigger_payment_method_selected()},i.prototype.updated_checkout=function(){this.initialize()},i.prototype.banner_checkout=function(){this.set_payment_method(this.gateway_id),this.set_use_new_option(!0),t.GooglePay.prototype.start.apply(this,arguments)},i.prototype.on_token_received=function(){t.CheckoutGateway.prototype.on_token_received.apply(this,arguments),this.payment_request_options.shippingAddressRequired&&this.maybe_set_ship_to_different(),this.fields.toFormFields({update_shipping_method:!1}),this.checkout_fields_valid()&&this.get_form().submit()},i.prototype.payment_data_updated=function(t){this.populate_billing_fields(t.address),this.fields.toFormFields({update_shipping_method:!1})},new i}(jQuery,window.wc_stripe);
assets/js/frontend/googlepay-product.js CHANGED
@@ -46,7 +46,7 @@
46
  * @return {[type]}
47
  */
48
  GPay.prototype.get_button = function () {
49
- return $(this.$button).find('.gpay-button');
50
  }
51
 
52
  /**
46
  * @return {[type]}
47
  */
48
  GPay.prototype.get_button = function () {
49
+ return this.$button.find('button');
50
  }
51
 
52
  /**
assets/js/frontend/googlepay-product.min.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){function i(){e.BaseGateway.call(this,wc_stripe_googlepay_product_params),window.addEventListener("hashchange",this.hashchange.bind(this))}(i.prototype=t.extend({},e.BaseGateway.prototype,e.ProductGateway.prototype,e.GooglePay.prototype)).initialize=function(){if(!t(this.container).length)return setTimeout(this.initialize.bind(this),1e3);e.ProductGateway.call(this),this.createPaymentsClient(),this.isReadyToPay().then(function(){t(this.container).show(),t(this.container).parent().parent().addClass("active")}.bind(this))},i.prototype.create_button=function(){e.GooglePay.prototype.create_button.apply(this,arguments),t("#wc-stripe-googlepay-container").append(this.$button),this.is_variable_product()&&!this.variable_product_selected()&&this.disable_payment_button()},i.prototype.get_button=function(){return t(this.$button).find(".gpay-button")},i.prototype.start=function(){0<this.get_quantity()?this.add_to_cart().then(function(){e.GooglePay.prototype.start.apply(this,arguments)}.bind(this)):this.submit_error(this.params.messages.invalid_amount)},i.prototype.found_variation=function(){e.ProductGateway.prototype.found_variation.apply(this,arguments),this.enable_payment_button()},new i}(jQuery,wc_stripe);
1
+ !function(t,e){function i(){e.BaseGateway.call(this,wc_stripe_googlepay_product_params),window.addEventListener("hashchange",this.hashchange.bind(this))}(i.prototype=t.extend({},e.BaseGateway.prototype,e.ProductGateway.prototype,e.GooglePay.prototype)).initialize=function(){if(!t(this.container).length)return setTimeout(this.initialize.bind(this),1e3);e.ProductGateway.call(this),this.createPaymentsClient(),this.isReadyToPay().then(function(){t(this.container).show(),t(this.container).parent().parent().addClass("active")}.bind(this))},i.prototype.create_button=function(){e.GooglePay.prototype.create_button.apply(this,arguments),t("#wc-stripe-googlepay-container").append(this.$button),this.is_variable_product()&&!this.variable_product_selected()&&this.disable_payment_button()},i.prototype.get_button=function(){return this.$button.find("button")},i.prototype.start=function(){0<this.get_quantity()?this.add_to_cart().then(function(){e.GooglePay.prototype.start.apply(this,arguments)}.bind(this)):this.submit_error(this.params.messages.invalid_amount)},i.prototype.found_variation=function(){e.ProductGateway.prototype.found_variation.apply(this,arguments),this.enable_payment_button()},new i}(jQuery,wc_stripe);
assets/js/frontend/local-payment.js CHANGED
@@ -45,10 +45,10 @@
45
  return new Promise(function (resolve, reject) {
46
  var handler = function (result) {
47
  if (result.error) {
48
- this.submit_error(result.error.message);
49
  } else {
50
  this.payment_token_received = true;
51
- $(this.token_selector).val(result.source.id);
52
  this.get_form().submit();
53
  }
54
  resolve();
@@ -232,7 +232,10 @@
232
 
233
  LocalPayment.prototype.update_source = function (args) {
234
  return new Promise(function (resolve, reject) {
235
- $.ajax({
 
 
 
236
  url: this.params.routes.update_source,
237
  method: 'POST',
238
  dataType: 'json',
@@ -269,7 +272,6 @@
269
  function Klarna(params) {
270
  LocalPayment.call(this, params);
271
  $(document.body).on('change', '.wc-stripe-klarna-category', this.category_change.bind(this));
272
- window.addEventListener('hashchange', this.hashchange.bind(this));
273
  $('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));
274
  }
275
 
45
  return new Promise(function (resolve, reject) {
46
  var handler = function (result) {
47
  if (result.error) {
48
+ this.submit_error(result.error);
49
  } else {
50
  this.payment_token_received = true;
51
+ this.set_nonce(result.source.id);
52
  this.get_form().submit();
53
  }
54
  resolve();
232
 
233
  LocalPayment.prototype.update_source = function (args) {
234
  return new Promise(function (resolve, reject) {
235
+ if (this.updateSourceXhr) {
236
+ this.updateSourceXhr.abort();
237
+ }
238
+ this.updateSourceXhr = $.ajax({
239
  url: this.params.routes.update_source,
240
  method: 'POST',
241
  dataType: 'json',
272
  function Klarna(params) {
273
  LocalPayment.call(this, params);
274
  $(document.body).on('change', '.wc-stripe-klarna-category', this.category_change.bind(this));
 
275
  $('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));
276
  }
277
 
assets/js/frontend/local-payment.min.js CHANGED
@@ -1 +1 @@
1
- !function(o,i){function s(e){i.BaseGateway.call(this,e),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 e(e){this.elementType="idealBank",this.confirmation_method="confirmIdealPayment",s.call(this,e),window.addEventListener("hashchange",this.hashChange.bind(this))}function t(e){this.elementType="iban",s.call(this,e)}function n(e){s.call(this,e),o(document.body).on("change",".wc-stripe-klarna-category",this.category_change.bind(this)),window.addEventListener("hashchange",this.hashchange.bind(this)),o("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 r(e){this.elementType="fpxBank",this.confirmation_method="confirmFpxPayment",s.call(this,e),window.addEventListener("hashchange",this.hashChange.bind(this))}function a(e){s.call(this,e),window.addEventListener("hashchange",this.hashChange.bind(this))}function h(e){this.elementType="auBankAccount",this.confirmation_method="confirmAuBecsDebitPayment",s.call(this,e),window.addEventListener("hashchange",this.hashChange.bind(this))}function c(e){this.confirmation_method="confirmGrabPayPayment",s.call(this,e),window.addEventListener("hashchange",this.hashChange.bind(this))}(s.prototype=o.extend({},i.BaseGateway.prototype,i.CheckoutGateway.prototype)).initialize=function(){this.mount_button()},s.prototype.elementType=null,s.prototype.is_active=function(){return o("#wc_stripe_local_payment_"+this.gateway_id).data("active")},s.prototype.maybe_hide_gateway=function(){this.is_active()?o(this.container).show():o(this.container).hide()},s.prototype.createSource=function(){return new Promise(function(t,e){var i=function(e){e.error?this.submit_error(e.error.message):(this.payment_token_received=!0,o(this.token_selector).val(e.source.id),this.get_form().submit()),t()}.bind(this);if(null!=this.elementType)if(this.confirmation_method){if(!this.isValidElement())return this.submit_error({code:"empty_element_"+this.params.local_payment_type,message:wc_stripe_messages.empty_element});this.payment_token_received=!0,this.get_form().submit()}else this.stripe.createSource(this.element,this.getSourceArgs()).then(i)["catch"](function(e){this.submit_error(e.message)}.bind(this));else this.payment_token_received=!0,this.get_form().submit()}.bind(this))},s.prototype.place_order=function(e){this.is_gateway_selected()&&(this.payment_token_received||this.is_saved_method_selected()||(e.preventDefault(),this.createSource()))},s.prototype.process_order_pay=function(e){this.is_gateway_selected()&&(e.preventDefault(),(e=this.get_form().serializeArray()).push({name:"_wpnonce",value:this.params.rest_nonce}),e.push({name:"order_id",value:this.params.order_id}),o.ajax({url:this.params.routes.order_pay+window.location.search,method:"POST",dataType:"json",data:o.param(e)}).done(function(e){e.success?window.location.href=e.redirect:this.submit_error(e.message)}.bind(this)).fail(function(e,t,i){this.submit_error(i)}.bind(this)))},s.prototype.show_payment_button=function(){this.show_place_order()},s.prototype.hide_place_order=function(){},s.prototype.show_place_order=function(){i.CheckoutGateway.prototype.show_place_order.apply(this,arguments),this.payment_token_received&&o("#place_order").text(o("#place_order").data("value"))},s.prototype.getSourceArgs=function(){return{type:this.params.local_payment_type,amount:this.get_total_price_cents(),currency:this.get_currency(),owner:{name:this.get_customer_name("billing"),email:this.fields.get("billing_email",null)},redirect:{return_url:this.params.return_url}}},s.prototype.updated_checkout=function(){this.mount_button(),this.maybe_hide_gateway()},s.prototype.mount_button=function(){var e="#wc_stripe_local_payment_"+this.gateway_id;o(e).length&&null!=this.elementType&&(o(e).empty(),this.element||(this.element=this.elements.create(this.elementType,this.params.element_params),this.element.on("change",this.handleElementChange.bind(this))),this.elementEmpty=!0,this.element.mount(e))},s.prototype.handleElementChange=function(e){this.elementEmpty=e.empty},s.prototype.load_external_script=function(e){var t=document.createElement("script");t.type="text/javascript",t.src=e,t.onload=function(){this.script_loaded=!0}.bind(this),document.body.appendChild(t)},s.prototype.hashChange=function(e){!this.is_gateway_selected()||(e=e.newURL.match(/response=(.*)/))&&(history.pushState({},"",window.location.pathname),e=JSON.parse(window.atob(decodeURIComponent(e[1]))),this.processConfirmation(e))},s.prototype.processConfirmation=function(e){this.stripe[this.confirmation_method](e.client_secret,this.get_confirmation_args(e)).then(function(e){if(e.error)return this.submit_error(e.error.message);this.get_form().submit()}.bind(this))},s.prototype.get_confirmation_args=function(e){e={payment_method:{billing_details:this.get_billing_details()},return_url:e.return_url};return this.elementType&&(e.payment_method[this.params.local_payment_type]=this.element),e},s.prototype.isValidElement=function(){return!this.element||!this.elementEmpty},s.prototype.delete_order_source=function(){return new Promise(function(t,e){o.ajax({url:this.params.routes.delete_order_source,method:"DELETE",dataType:"json",beforeSend:this.ajax_before_send.bind(this)}).done(function(e){t(e)}.bind(this)).fail(function(){e()}.bind(this))}.bind(this))},s.prototype.update_source=function(i){return new Promise(function(t,e){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(e){t(e.source)}.bind(this)).fail(function(){e()})}.bind(this))},n.prototype.category_change=function(e){var t=function(){o('[id^="klarna-instance-"]').slideUp();var e=o('[name="klarna_category"]:checked').val();o("#klarna-instance-"+e).slideDown()}.bind(this);e.originalEvent?t():(clearTimeout(this.categoryChangeTimer),this.categoryChangeTimer=setTimeout(t,500))},n.prototype.processConfirmation=function(e){window.Klarna.Payments.init({client_token:e.klarna.client_token},function(e){}.bind(this)),this.payment_categories=e.klarna.payment_method_categories.split(","),this.render_ui(!0)},n.prototype.hashchange=function(){this.is_gateway_selected()&&(history.pushState({},"",window.location.pathname),this.get_form().removeClass("processing"),this.get_form().submit())},n.prototype.render_ui=function(e){if((this.show_form_false=0)<this.payment_categories.length){o("#wc_stripe_local_payment_stripe_klarna").show();for(var t=0;t<this.payment_categories.length;t++){var i,s="#klarna-instance-"+this.payment_categories[t];if(o(s).empty(),o("#klarna-category-"+this.payment_categories[t]).length){this.params.translate&&(i=this.source.klarna[this.payment_categories[t]+"_name"],o('label[for="klarna_'+this.payment_categories[t]+'"').text(i)),o("#klarna-category-"+this.payment_categories[t]).show();try{window.Klarna.Payments.load({container:s,payment_method_category:this.payment_categories[t],instance_id:"klarna-instance-"+this.payment_categories[t]},function(e){e.show_form||(this.source=null)}.bind(this))}catch(n){window.alert(n)}}}e&&o('[id^="klarna-category-"]:visible [name="klarna_category"]').first().prop("checked",!0).trigger("change")}},n.prototype.place_order=function(e){this.is_gateway_selected()&&(e.preventDefault(),this.checkout_fields_valid()&&window.Klarna.Payments.authorize({instance_id:"klarna-instance-"+o('[name="klarna_category"]:checked').val()},function(e){e.approved?(this.set_nonce(this.source.id),this.payment_token_received=!0,this.get_form().submit()):e.error?this.submit_error(e.error):this.submit_error(this.params.messages.klarna_error)}.bind(this)))},n.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)},n.prototype.initialize=function(){this.is_gateway_selected()&&this.is_active()&&!this.source&&this.klarna_fields_valid()&&this.createSource()},n.prototype.createSource=function(){clearTimeout(this.createSourceTimer),this.createSourceTimer=setTimeout(function(){this.show_loader(),this.stripe.createSource(this.getSourceArgs()).then(function(e){if(this.hide_loader(),e.error)return this.submit_error(e.error.message);this.source=e.source,this.set_nonce(this.source.id),this.filter_payment_method_categories(),this.processConfirmation(this.source)}.bind(this))["catch"](function(e){this.hide_loader(),this.submit_error(e.message)}.bind(this))}.bind(this),100)},n.prototype.getSourceArgs=function(){return o.extend(!0,{},this.get_gateway_data().source_args,function(){var e,t={owner:{name:this.fields.get("billing_first_name")+" "+this.fields.get("billing_last_name"),email:this.fields.get("billing_email"),address:{city:this.fields.get("billing_city"),country:this.fields.get("billing_country"),line1:this.fields.get("billing_address_1"),line2:this.fields.get("billing_address_2"),postal_code:this.fields.get("billing_postcode"),state:this.fields.get("billing_state")}},klarna:{purchase_country:this.fields.get("billing_country"),first_name:this.fields.get("billing_first_name"),last_name:this.fields.get("billing_last_name")}};return this.needs_shipping()&&(e=this.get_shipping_prefix(),t.klarna.shipping_first_name=this.fields.get("first_name",e),t.klarna.shipping_last_name=this.fields.get("last_name",e),t.source_order={shipping:{address:{city:this.fields.get("city",e),country:this.fields.get("country",e),line1:this.fields.get("address_1",e),line2:this.fields.get("address_2",e),postal_code:this.fields.get("postcode",e),state:this.fields.get("state",e)}}}),t}.bind(this)())},n.prototype.updated_checkout=function(){s.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()},n.prototype.update_source=function(){var e=this.get_source_update_args(this.getSourceArgs());this.show_loader(),s.prototype.update_source.call(this,e).then(function(e){this.source=e,this.filter_payment_method_categories(),this.hide_loader(),this.render_ui()}.bind(this))},n.prototype.checkout_error=function(){s.prototype.checkout_error.apply(this,arguments),this.is_gateway_selected()&&this.createSource()},n.prototype.show_loader=function(){o(this.container).find(".wc-stripe-klarna-loader").remove(),o(this.container).find('label[for="payment_method_'+this.gateway_id+'" ]').after(this.params.klarna_loader)},n.prototype.hide_loader=function(){o(this.container).find(".wc-stripe-klarna-loader").remove()},n.prototype.filter_payment_method_categories=function(){var e=this.source.klarna.payment_method_categories.split(",");this.source.klarna.payment_method_categories=e.filter(function(e){return-1<this.get_gateway_data().payment_sections.indexOf(e)}.bind(this)).join(",")},n.prototype.get_source_update_args=function(e){return["type","currency","statement_descriptor","redirect","klarna.product","klarna.locale","klarna.custom_payment_methods"].reduce(function(e,t){if(-1<t.indexOf(".")){var i=t.split(".");return delete i.slice(0,i.length-1).reduce(function(e,t){return e[t]},e)[t=i[i.length-1]],e}return delete e[t],e},e)},n.prototype.on_payment_method_selected=function(e,t){t===this.gateway_id&&(this.source||(this.klarna_fields_valid()?this.createSource():this.submit_error(this.params.messages.required_field)),i.CheckoutGateway.prototype.on_payment_method_selected.apply(this,arguments))},n.prototype.input_change=function(){this.is_gateway_selected()&&(this.source?this.update_source():this.klarna_fields_valid()&&this.createSource())},a.prototype.updated_checkout=function(){!this.script_loaded&&o(this.container).length&&this.load_external_script(this.params.qr_script),s.prototype.updated_checkout.apply(this,arguments)},a.prototype.hashChange=function(e){!this.is_gateway_selected()||(e=e.newURL.match(/qrcode=(.*)/))&&(history.pushState({},"",window.location.pathname),this.qrcode=JSON.parse(window.atob(decodeURIComponent(e[1]))),this.get_form().unblock().removeClass("processing").addClass("wechat"),new QRCode("wc_stripe_local_payment_stripe_wechat",{text:this.qrcode.code,width:128,height:128,colorDark:"#424770",colorLight:"#f8fbfd",correctLevel:QRCode.CorrectLevel.H}),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())},a.prototype.place_order=function(){this.get_form().is(".wechat")?window.location=this.qrcode.redirect:s.prototype.place_order.apply(this,arguments)},h.prototype.get_confirmation_args=function(e){var t=s.prototype.get_confirmation_args.apply(this,arguments);return t.payment_method.billing_details.email=this.fields.get("billing_email"),t},t.prototype.getSourceArgs=function(){var e=o.extend({},s.prototype.getSourceArgs.apply(this,arguments),{mandate:{notification_method:"email",interval:this.cart_contains_subscription()||this.is_change_payment_method()?"scheduled":"one_time"}});return"scheduled"===e.mandate.interval&&delete e.amount,e},e.prototype=o.extend({},s.prototype,e.prototype),t.prototype=o.extend({},s.prototype,t.prototype),n.prototype=o.extend({},s.prototype,n.prototype),r.prototype=o.extend({},s.prototype,r.prototype),a.prototype=o.extend({},s.prototype,a.prototype),h.prototype=o.extend({},s.prototype,h.prototype),c.prototype=o.extend({},s.prototype,c.prototype);var p,l={ideal:e,sepa_debit:t,klarna:n,fpx:r,wechat:a,au_becs_debit:h,grabpay:c};for(p in wc_stripe_local_payment_params.gateways){var _=wc_stripe_local_payment_params.gateways[p];new(l[_.local_payment_type]||s)(_)}}(jQuery,window.wc_stripe);
1
+ !function(o,i){function s(e){i.BaseGateway.call(this,e),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 e(e){this.elementType="idealBank",this.confirmation_method="confirmIdealPayment",s.call(this,e),window.addEventListener("hashchange",this.hashChange.bind(this))}function t(e){this.elementType="iban",s.call(this,e)}function n(e){s.call(this,e),o(document.body).on("change",".wc-stripe-klarna-category",this.category_change.bind(this)),o("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 r(e){this.elementType="fpxBank",this.confirmation_method="confirmFpxPayment",s.call(this,e),window.addEventListener("hashchange",this.hashChange.bind(this))}function a(e){s.call(this,e),window.addEventListener("hashchange",this.hashChange.bind(this))}function h(e){this.elementType="auBankAccount",this.confirmation_method="confirmAuBecsDebitPayment",s.call(this,e),window.addEventListener("hashchange",this.hashChange.bind(this))}function c(e){this.confirmation_method="confirmGrabPayPayment",s.call(this,e),window.addEventListener("hashchange",this.hashChange.bind(this))}(s.prototype=o.extend({},i.BaseGateway.prototype,i.CheckoutGateway.prototype)).initialize=function(){this.mount_button()},s.prototype.elementType=null,s.prototype.is_active=function(){return o("#wc_stripe_local_payment_"+this.gateway_id).data("active")},s.prototype.maybe_hide_gateway=function(){this.is_active()?o(this.container).show():o(this.container).hide()},s.prototype.createSource=function(){return new Promise(function(t,e){var i=function(e){e.error?this.submit_error(e.error):(this.payment_token_received=!0,this.set_nonce(e.source.id),this.get_form().submit()),t()}.bind(this);if(null!=this.elementType)if(this.confirmation_method){if(!this.isValidElement())return this.submit_error({code:"empty_element_"+this.params.local_payment_type,message:wc_stripe_messages.empty_element});this.payment_token_received=!0,this.get_form().submit()}else this.stripe.createSource(this.element,this.getSourceArgs()).then(i)["catch"](function(e){this.submit_error(e.message)}.bind(this));else this.payment_token_received=!0,this.get_form().submit()}.bind(this))},s.prototype.place_order=function(e){this.is_gateway_selected()&&(this.payment_token_received||this.is_saved_method_selected()||(e.preventDefault(),this.createSource()))},s.prototype.process_order_pay=function(e){this.is_gateway_selected()&&(e.preventDefault(),(e=this.get_form().serializeArray()).push({name:"_wpnonce",value:this.params.rest_nonce}),e.push({name:"order_id",value:this.params.order_id}),o.ajax({url:this.params.routes.order_pay+window.location.search,method:"POST",dataType:"json",data:o.param(e)}).done(function(e){e.success?window.location.href=e.redirect:this.submit_error(e.message)}.bind(this)).fail(function(e,t,i){this.submit_error(i)}.bind(this)))},s.prototype.show_payment_button=function(){this.show_place_order()},s.prototype.hide_place_order=function(){},s.prototype.show_place_order=function(){i.CheckoutGateway.prototype.show_place_order.apply(this,arguments),this.payment_token_received&&o("#place_order").text(o("#place_order").data("value"))},s.prototype.getSourceArgs=function(){return{type:this.params.local_payment_type,amount:this.get_total_price_cents(),currency:this.get_currency(),owner:{name:this.get_customer_name("billing"),email:this.fields.get("billing_email",null)},redirect:{return_url:this.params.return_url}}},s.prototype.updated_checkout=function(){this.mount_button(),this.maybe_hide_gateway()},s.prototype.mount_button=function(){var e="#wc_stripe_local_payment_"+this.gateway_id;o(e).length&&null!=this.elementType&&(o(e).empty(),this.element||(this.element=this.elements.create(this.elementType,this.params.element_params),this.element.on("change",this.handleElementChange.bind(this))),this.elementEmpty=!0,this.element.mount(e))},s.prototype.handleElementChange=function(e){this.elementEmpty=e.empty},s.prototype.load_external_script=function(e){var t=document.createElement("script");t.type="text/javascript",t.src=e,t.onload=function(){this.script_loaded=!0}.bind(this),document.body.appendChild(t)},s.prototype.hashChange=function(e){!this.is_gateway_selected()||(e=e.newURL.match(/response=(.*)/))&&(history.pushState({},"",window.location.pathname),e=JSON.parse(window.atob(decodeURIComponent(e[1]))),this.processConfirmation(e))},s.prototype.processConfirmation=function(e){this.stripe[this.confirmation_method](e.client_secret,this.get_confirmation_args(e)).then(function(e){if(e.error)return this.submit_error(e.error.message);this.get_form().submit()}.bind(this))},s.prototype.get_confirmation_args=function(e){e={payment_method:{billing_details:this.get_billing_details()},return_url:e.return_url};return this.elementType&&(e.payment_method[this.params.local_payment_type]=this.element),e},s.prototype.isValidElement=function(){return!this.element||!this.elementEmpty},s.prototype.delete_order_source=function(){return new Promise(function(t,e){o.ajax({url:this.params.routes.delete_order_source,method:"DELETE",dataType:"json",beforeSend:this.ajax_before_send.bind(this)}).done(function(e){t(e)}.bind(this)).fail(function(){e()}.bind(this))}.bind(this))},s.prototype.update_source=function(i){return new Promise(function(t,e){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(e){t(e.source)}.bind(this)).fail(function(){e()})}.bind(this))},n.prototype.category_change=function(e){var t=function(){o('[id^="klarna-instance-"]').slideUp();var e=o('[name="klarna_category"]:checked').val();o("#klarna-instance-"+e).slideDown()}.bind(this);e.originalEvent?t():(clearTimeout(this.categoryChangeTimer),this.categoryChangeTimer=setTimeout(t,500))},n.prototype.processConfirmation=function(e){window.Klarna.Payments.init({client_token:e.klarna.client_token},function(e){}.bind(this)),this.payment_categories=e.klarna.payment_method_categories.split(","),this.render_ui(!0)},n.prototype.hashchange=function(){this.is_gateway_selected()&&(history.pushState({},"",window.location.pathname),this.get_form().removeClass("processing"),this.get_form().submit())},n.prototype.render_ui=function(e){if((this.show_form_false=0)<this.payment_categories.length){o("#wc_stripe_local_payment_stripe_klarna").show();for(var t=0;t<this.payment_categories.length;t++){var i,s="#klarna-instance-"+this.payment_categories[t];if(o(s).empty(),o("#klarna-category-"+this.payment_categories[t]).length){this.params.translate&&(i=this.source.klarna[this.payment_categories[t]+"_name"],o('label[for="klarna_'+this.payment_categories[t]+'"').text(i)),o("#klarna-category-"+this.payment_categories[t]).show();try{window.Klarna.Payments.load({container:s,payment_method_category:this.payment_categories[t],instance_id:"klarna-instance-"+this.payment_categories[t]},function(e){e.show_form||(this.source=null)}.bind(this))}catch(n){window.alert(n)}}}e&&o('[id^="klarna-category-"]:visible [name="klarna_category"]').first().prop("checked",!0).trigger("change")}},n.prototype.place_order=function(e){this.is_gateway_selected()&&(e.preventDefault(),this.checkout_fields_valid()&&window.Klarna.Payments.authorize({instance_id:"klarna-instance-"+o('[name="klarna_category"]:checked').val()},function(e){e.approved?(this.set_nonce(this.source.id),this.payment_token_received=!0,this.get_form().submit()):e.error?this.submit_error(e.error):this.submit_error(this.params.messages.klarna_error)}.bind(this)))},n.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)},n.prototype.initialize=function(){this.is_gateway_selected()&&this.is_active()&&!this.source&&this.klarna_fields_valid()&&this.createSource()},n.prototype.createSource=function(){clearTimeout(this.createSourceTimer),this.createSourceTimer=setTimeout(function(){this.show_loader(),this.stripe.createSource(this.getSourceArgs()).then(function(e){if(this.hide_loader(),e.error)return this.submit_error(e.error.message);this.source=e.source,this.set_nonce(this.source.id),this.filter_payment_method_categories(),this.processConfirmation(this.source)}.bind(this))["catch"](function(e){this.hide_loader(),this.submit_error(e.message)}.bind(this))}.bind(this),100)},n.prototype.getSourceArgs=function(){return o.extend(!0,{},this.get_gateway_data().source_args,function(){var e,t={owner:{name:this.fields.get("billing_first_name")+" "+this.fields.get("billing_last_name"),email:this.fields.get("billing_email"),address:{city:this.fields.get("billing_city"),country:this.fields.get("billing_country"),line1:this.fields.get("billing_address_1"),line2:this.fields.get("billing_address_2"),postal_code:this.fields.get("billing_postcode"),state:this.fields.get("billing_state")}},klarna:{purchase_country:this.fields.get("billing_country"),first_name:this.fields.get("billing_first_name"),last_name:this.fields.get("billing_last_name")}};return this.needs_shipping()&&(e=this.get_shipping_prefix(),t.klarna.shipping_first_name=this.fields.get("first_name",e),t.klarna.shipping_last_name=this.fields.get("last_name",e),t.source_order={shipping:{address:{city:this.fields.get("city",e),country:this.fields.get("country",e),line1:this.fields.get("address_1",e),line2:this.fields.get("address_2",e),postal_code:this.fields.get("postcode",e),state:this.fields.get("state",e)}}}),t}.bind(this)())},n.prototype.updated_checkout=function(){s.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()},n.prototype.update_source=function(){var e=this.get_source_update_args(this.getSourceArgs());this.show_loader(),s.prototype.update_source.call(this,e).then(function(e){this.source=e,this.filter_payment_method_categories(),this.hide_loader(),this.render_ui()}.bind(this))},n.prototype.checkout_error=function(){s.prototype.checkout_error.apply(this,arguments),this.is_gateway_selected()&&this.createSource()},n.prototype.show_loader=function(){o(this.container).find(".wc-stripe-klarna-loader").remove(),o(this.container).find('label[for="payment_method_'+this.gateway_id+'" ]').after(this.params.klarna_loader)},n.prototype.hide_loader=function(){o(this.container).find(".wc-stripe-klarna-loader").remove()},n.prototype.filter_payment_method_categories=function(){var e=this.source.klarna.payment_method_categories.split(",");this.source.klarna.payment_method_categories=e.filter(function(e){return-1<this.get_gateway_data().payment_sections.indexOf(e)}.bind(this)).join(",")},n.prototype.get_source_update_args=function(e){return["type","currency","statement_descriptor","redirect","klarna.product","klarna.locale","klarna.custom_payment_methods"].reduce(function(e,t){if(-1<t.indexOf(".")){var i=t.split(".");return delete i.slice(0,i.length-1).reduce(function(e,t){return e[t]},e)[t=i[i.length-1]],e}return delete e[t],e},e)},n.prototype.on_payment_method_selected=function(e,t){t===this.gateway_id&&(this.source||(this.klarna_fields_valid()?this.createSource():this.submit_error(this.params.messages.required_field)),i.CheckoutGateway.prototype.on_payment_method_selected.apply(this,arguments))},n.prototype.input_change=function(){this.is_gateway_selected()&&(this.source?this.update_source():this.klarna_fields_valid()&&this.createSource())},a.prototype.updated_checkout=function(){!this.script_loaded&&o(this.container).length&&this.load_external_script(this.params.qr_script),s.prototype.updated_checkout.apply(this,arguments)},a.prototype.hashChange=function(e){!this.is_gateway_selected()||(e=e.newURL.match(/qrcode=(.*)/))&&(history.pushState({},"",window.location.pathname),this.qrcode=JSON.parse(window.atob(decodeURIComponent(e[1]))),this.get_form().unblock().removeClass("processing").addClass("wechat"),new QRCode("wc_stripe_local_payment_stripe_wechat",{text:this.qrcode.code,width:128,height:128,colorDark:"#424770",colorLight:"#f8fbfd",correctLevel:QRCode.CorrectLevel.H}),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())},a.prototype.place_order=function(){this.get_form().is(".wechat")?window.location=this.qrcode.redirect:s.prototype.place_order.apply(this,arguments)},h.prototype.get_confirmation_args=function(e){var t=s.prototype.get_confirmation_args.apply(this,arguments);return t.payment_method.billing_details.email=this.fields.get("billing_email"),t},t.prototype.getSourceArgs=function(){var e=o.extend({},s.prototype.getSourceArgs.apply(this,arguments),{mandate:{notification_method:"email",interval:this.cart_contains_subscription()||this.is_change_payment_method()?"scheduled":"one_time"}});return"scheduled"===e.mandate.interval&&delete e.amount,e},e.prototype=o.extend({},s.prototype,e.prototype),t.prototype=o.extend({},s.prototype,t.prototype),n.prototype=o.extend({},s.prototype,n.prototype),r.prototype=o.extend({},s.prototype,r.prototype),a.prototype=o.extend({},s.prototype,a.prototype),h.prototype=o.extend({},s.prototype,h.prototype),c.prototype=o.extend({},s.prototype,c.prototype);var p,_={ideal:e,sepa_debit:t,klarna:n,fpx:r,wechat:a,au_becs_debit:h,grabpay:c};for(p in wc_stripe_local_payment_params.gateways){var l=wc_stripe_local_payment_params.gateways[p];new(_[l.local_payment_type]||s)(l)}}(jQuery,window.wc_stripe);
assets/js/frontend/payment-request.js CHANGED
@@ -219,12 +219,11 @@
219
  * @return {[type]} [description]
220
  */
221
  PaymentRequest.prototype.create_button = function () {
222
- var $parent = $('#place_order').parent();
223
  if (this.$button) {
224
  this.$button.remove();
225
  }
226
  this.$button = $('<div id="wc-stripe-payment-request-container"></div>');
227
- $parent.append(this.$button);
228
  wc_stripe.PaymentRequest.prototype.create_button.call(this);
229
  this.trigger_payment_method_selected();
230
  }
219
  * @return {[type]} [description]
220
  */
221
  PaymentRequest.prototype.create_button = function () {
 
222
  if (this.$button) {
223
  this.$button.remove();
224
  }
225
  this.$button = $('<div id="wc-stripe-payment-request-container"></div>');
226
+ $('#place_order').after(this.$button);
227
  wc_stripe.PaymentRequest.prototype.create_button.call(this);
228
  this.trigger_payment_method_selected();
229
  }
assets/js/frontend/payment-request.min.js CHANGED
@@ -1 +1 @@
1
- !function(a,i){var t;a(document.body).is(".single-product")&&((t=function(){i.BaseGateway.call(this,wc_stripe_payment_request_params),window.addEventListener("hashchange",this.hashchange.bind(this)),this.old_qty=this.get_quantity()}).prototype=a.extend({},i.BaseGateway.prototype,i.ProductGateway.prototype,i.PaymentRequest.prototype),t.prototype.initialize=function(){if(!a(this.container).length)return setTimeout(this.initialize.bind(this),1e3);i.ProductGateway.call(this),i.PaymentRequest.prototype.initialize.call(this)},t.prototype.canMakePayment=function(){i.PaymentRequest.prototype.canMakePayment.apply(this,arguments).then(function(){a(document.body).on("change",'[name="quantity"]',this.add_to_cart.bind(this)),a(this.container).parent().parent().addClass("active"),this.is_variable_product()?this.variable_product_selected()?(this.cart_calculation(this.get_product_data().variation.variation_id),a(this.container).removeClass("processingFoundVariation")):this.disable_payment_button():this.cart_calculation()}.bind(this))},t.prototype.add_to_cart=function(t){this.disable_payment_button(),this.old_qty=this.get_quantity();var e=this.get_product_data().variation;this.is_variable_product()&&!this.variable_product_selected()||this.cart_calculation(e.variation_id).then(function(){this.is_variable_product()&&a(this.container).is(".processingFoundVariation")?(this.createPaymentRequest(),this.createPaymentRequestButton(),i.PaymentRequest.prototype.canMakePayment.apply(this,arguments).then(function(){this.enable_payment_button(),a(this.container).removeClass("processingFoundVariation")}.bind(this))):this.enable_payment_button()}.bind(this))},t.prototype.cart_calculation=function(){return i.ProductGateway.prototype.cart_calculation.apply(this,arguments).then(function(){this.paymentRequest.update(this.get_payment_request_update({total:{pending:!1}}))}.bind(this))["catch"](function(){}.bind(this))},t.prototype.create_button=function(){a("#wc-stripe-payment-request-container").empty(),i.PaymentRequest.prototype.create_button.apply(this,arguments),this.$button=a("#wc-stripe-payment-request-container")},t.prototype.button_click=function(t){this.$button.is(".disabled")?t.preventDefault():0==this.get_quantity()&&(t.preventDefault(),this.submit_error(this.params.messages.invalid_amount))},t.prototype.found_variation=function(){a(this.container).addClass("processingFoundVariation"),i.ProductGateway.prototype.found_variation.apply(this,arguments)},t.prototype.block=function(){a.blockUI({message:this.adding_to_cart?this.params.messages.add_to_cart:null,overlayCSS:{background:"#fff",opacity:.6}})}),a(document.body).is(".woocommerce-cart")&&((t=function(){i.BaseGateway.call(this,wc_stripe_payment_request_params),window.addEventListener("hashchange",this.hashchange.bind(this))}).prototype=a.extend({},i.BaseGateway.prototype,i.CartGateway.prototype,i.PaymentRequest.prototype),t.prototype.initialize=function(){i.CartGateway.call(this),i.PaymentRequest.prototype.initialize.call(this)},t.prototype.canMakePayment=function(){i.PaymentRequest.prototype.canMakePayment.apply(this,arguments).then(function(){a(this.container).addClass("active").parent().addClass("active")}.bind(this))},t.prototype.updated_html=function(){a(this.container).length||(this.can_pay=!1),this.can_pay&&this.initialize()},t.prototype.button_click=function(t){this.paymentRequest.update(this.get_payment_request_update({total:{pending:!1}}))},t.prototype.cart_emptied=function(t){this.can_pay=!1}),a(document.body).is(".woocommerce-checkout")&&((t=function(){i.BaseGateway.call(this,wc_stripe_payment_request_params),window.addEventListener("hashchange",this.hashchange.bind(this))}).prototype=a.extend({},i.BaseGateway.prototype,i.CheckoutGateway.prototype,i.PaymentRequest.prototype),t.prototype.initialize=function(){i.CheckoutGateway.call(this),a("form.checkout").on("change",".form-row:not(.address-field) .input-text",this.update_payment_request.bind(this)),a(this.container).length&&i.PaymentRequest.prototype.initialize.call(this)},t.prototype.canMakePayment=function(){i.PaymentRequest.prototype.canMakePayment.apply(this,arguments).then(function(){var t;this.banner_enabled()&&(a(this.banner_container).empty().show().append('<div id="wc-stripe-payment-request-banner"></div>'),a(this.banner_container).show().parent().parent().addClass("active"),(t=this.stripe.elements().create("paymentRequestButton",{paymentRequest:this.paymentRequest,style:{paymentRequestButton:{type:this.params.button.type,theme:this.params.button.theme,height:this.params.button.height}}})).on("click",this.banner_checkout.bind(this)),t.mount("#wc-stripe-payment-request-banner"))}.bind(this))},t.prototype.create_button=function(){var t=a("#place_order").parent();this.$button&&this.$button.remove(),this.$button=a('<div id="wc-stripe-payment-request-container"></div>'),t.append(this.$button),i.PaymentRequest.prototype.create_button.call(this),this.trigger_payment_method_selected()},t.prototype.updated_checkout=function(){a(this.container).length&&i.PaymentRequest.prototype.initialize.call(this)},t.prototype.banner_checkout=function(t){this.set_payment_method(this.gateway_id),this.set_use_new_option(!0)},t.prototype.on_token_received=function(){i.CheckoutGateway.prototype.on_token_received.apply(this,arguments),this.fields.toFormFields(),this.payment_request_options.requestShipping&&this.maybe_set_ship_to_different(),this.checkout_fields_valid()&&this.get_form().submit()},t.prototype.update_payment_request=function(){a(this.container).length&&i.PaymentRequest.prototype.initialize.call(this)}),new t}(jQuery,window.wc_stripe);
1
+ !function(a,i){var t;a(document.body).is(".single-product")&&((t=function(){i.BaseGateway.call(this,wc_stripe_payment_request_params),window.addEventListener("hashchange",this.hashchange.bind(this)),this.old_qty=this.get_quantity()}).prototype=a.extend({},i.BaseGateway.prototype,i.ProductGateway.prototype,i.PaymentRequest.prototype),t.prototype.initialize=function(){if(!a(this.container).length)return setTimeout(this.initialize.bind(this),1e3);i.ProductGateway.call(this),i.PaymentRequest.prototype.initialize.call(this)},t.prototype.canMakePayment=function(){i.PaymentRequest.prototype.canMakePayment.apply(this,arguments).then(function(){a(document.body).on("change",'[name="quantity"]',this.add_to_cart.bind(this)),a(this.container).parent().parent().addClass("active"),this.is_variable_product()?this.variable_product_selected()?(this.cart_calculation(this.get_product_data().variation.variation_id),a(this.container).removeClass("processingFoundVariation")):this.disable_payment_button():this.cart_calculation()}.bind(this))},t.prototype.add_to_cart=function(t){this.disable_payment_button(),this.old_qty=this.get_quantity();var e=this.get_product_data().variation;this.is_variable_product()&&!this.variable_product_selected()||this.cart_calculation(e.variation_id).then(function(){this.is_variable_product()&&a(this.container).is(".processingFoundVariation")?(this.createPaymentRequest(),this.createPaymentRequestButton(),i.PaymentRequest.prototype.canMakePayment.apply(this,arguments).then(function(){this.enable_payment_button(),a(this.container).removeClass("processingFoundVariation")}.bind(this))):this.enable_payment_button()}.bind(this))},t.prototype.cart_calculation=function(){return i.ProductGateway.prototype.cart_calculation.apply(this,arguments).then(function(){this.paymentRequest.update(this.get_payment_request_update({total:{pending:!1}}))}.bind(this))["catch"](function(){}.bind(this))},t.prototype.create_button=function(){a("#wc-stripe-payment-request-container").empty(),i.PaymentRequest.prototype.create_button.apply(this,arguments),this.$button=a("#wc-stripe-payment-request-container")},t.prototype.button_click=function(t){this.$button.is(".disabled")?t.preventDefault():0==this.get_quantity()&&(t.preventDefault(),this.submit_error(this.params.messages.invalid_amount))},t.prototype.found_variation=function(){a(this.container).addClass("processingFoundVariation"),i.ProductGateway.prototype.found_variation.apply(this,arguments)},t.prototype.block=function(){a.blockUI({message:this.adding_to_cart?this.params.messages.add_to_cart:null,overlayCSS:{background:"#fff",opacity:.6}})}),a(document.body).is(".woocommerce-cart")&&((t=function(){i.BaseGateway.call(this,wc_stripe_payment_request_params),window.addEventListener("hashchange",this.hashchange.bind(this))}).prototype=a.extend({},i.BaseGateway.prototype,i.CartGateway.prototype,i.PaymentRequest.prototype),t.prototype.initialize=function(){i.CartGateway.call(this),i.PaymentRequest.prototype.initialize.call(this)},t.prototype.canMakePayment=function(){i.PaymentRequest.prototype.canMakePayment.apply(this,arguments).then(function(){a(this.container).addClass("active").parent().addClass("active")}.bind(this))},t.prototype.updated_html=function(){a(this.container).length||(this.can_pay=!1),this.can_pay&&this.initialize()},t.prototype.button_click=function(t){this.paymentRequest.update(this.get_payment_request_update({total:{pending:!1}}))},t.prototype.cart_emptied=function(t){this.can_pay=!1}),a(document.body).is(".woocommerce-checkout")&&((t=function(){i.BaseGateway.call(this,wc_stripe_payment_request_params),window.addEventListener("hashchange",this.hashchange.bind(this))}).prototype=a.extend({},i.BaseGateway.prototype,i.CheckoutGateway.prototype,i.PaymentRequest.prototype),t.prototype.initialize=function(){i.CheckoutGateway.call(this),a("form.checkout").on("change",".form-row:not(.address-field) .input-text",this.update_payment_request.bind(this)),a(this.container).length&&i.PaymentRequest.prototype.initialize.call(this)},t.prototype.canMakePayment=function(){i.PaymentRequest.prototype.canMakePayment.apply(this,arguments).then(function(){var t;this.banner_enabled()&&(a(this.banner_container).empty().show().append('<div id="wc-stripe-payment-request-banner"></div>'),a(this.banner_container).show().parent().parent().addClass("active"),(t=this.stripe.elements().create("paymentRequestButton",{paymentRequest:this.paymentRequest,style:{paymentRequestButton:{type:this.params.button.type,theme:this.params.button.theme,height:this.params.button.height}}})).on("click",this.banner_checkout.bind(this)),t.mount("#wc-stripe-payment-request-banner"))}.bind(this))},t.prototype.create_button=function(){this.$button&&this.$button.remove(),this.$button=a('<div id="wc-stripe-payment-request-container"></div>'),a("#place_order").after(this.$button),i.PaymentRequest.prototype.create_button.call(this),this.trigger_payment_method_selected()},t.prototype.updated_checkout=function(){a(this.container).length&&i.PaymentRequest.prototype.initialize.call(this)},t.prototype.banner_checkout=function(t){this.set_payment_method(this.gateway_id),this.set_use_new_option(!0)},t.prototype.on_token_received=function(){i.CheckoutGateway.prototype.on_token_received.apply(this,arguments),this.fields.toFormFields(),this.payment_request_options.requestShipping&&this.maybe_set_ship_to_different(),this.checkout_fields_valid()&&this.get_form().submit()},t.prototype.update_payment_request=function(){a(this.container).length&&i.PaymentRequest.prototype.initialize.call(this)}),new t}(jQuery,window.wc_stripe);
assets/js/frontend/wc-stripe.js CHANGED
@@ -1611,7 +1611,8 @@
1611
  this.$button = $(this.paymentsClient.createButton({
1612
  onClick: this.start.bind(this),
1613
  buttonColor: this.params.button_color,
1614
- buttonType: this.params.button_style
 
1615
  }));
1616
  this.$button.addClass('gpay-button-container');
1617
  };
@@ -1658,6 +1659,12 @@
1658
  this.canMakePayment();
1659
  };
1660
 
 
 
 
 
 
 
1661
  wc_stripe.ApplePay.prototype.create_button = function () {
1662
  if (this.$button) {
1663
  this.$button.remove();
1611
  this.$button = $(this.paymentsClient.createButton({
1612
  onClick: this.start.bind(this),
1613
  buttonColor: this.params.button_color,
1614
+ buttonType: this.params.button_style,
1615
+ buttonSizeMode: this.params.button_size_mode
1616
  }));
1617
  this.$button.addClass('gpay-button-container');
1618
  };
1659
  this.canMakePayment();
1660
  };
1661
 
1662
+ wc_stripe.ApplePay.prototype.get_payment_request_options = function () {
1663
+ return $.extend({}, wc_stripe.BaseGateway.prototype.get_payment_request_options.apply(this, arguments), {
1664
+ disableWallets: ['googlePay']
1665
+ });
1666
+ }
1667
+
1668
  wc_stripe.ApplePay.prototype.create_button = function () {
1669
  if (this.$button) {
1670
  this.$button.remove();
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.elements=i.elements(o.extend({},{locale:"auto"},this.get_element_options())),this.fields=r,this.initialize()},wc_stripe.BaseGateway.prototype.get_page=function(){var t=wc_stripe_params_v3.page;return"cart"===t&&o(document.body).is(".woocommerce-checkout")&&(t="checkout"),t},wc_stripe.BaseGateway.prototype.set_nonce=function(t){this.fields.set(this.gateway_id+"_token_key",t),o(this.token_selector).val(t)},wc_stripe.BaseGateway.prototype.get_element_options=function(){return{}},wc_stripe.BaseGateway.prototype.initialize=function(){},wc_stripe.BaseGateway.prototype.create_button=function(){},wc_stripe.BaseGateway.prototype.is_gateway_selected=function(){return o('[name="payment_method"]:checked').val()===this.gateway_id},wc_stripe.BaseGateway.prototype.is_saved_method_selected=function(){return this.is_gateway_selected()&&"saved"===o('[name="'+this.gateway_id+'_payment_type_key"]:checked').val()},wc_stripe.BaseGateway.prototype.has_checkout_error=function(){return 0<o("#wc_stripe_checkout_error").length&&this.is_gateway_selected()},wc_stripe.BaseGateway.prototype.submit_error=function(t){var e=this.get_error_message(t);e.indexOf("</ul>")<0&&(e='<div class="'+function(){var t="woocommerce-NoticeGroup";return this.is_current_page("checkout")&&(t+=" woocommerce-NoticeGroup-checkout"),t}.bind(this)()+'"><ul class="woocommerce-error"><li>'+e+"</li></ul></div>");t=o(document.body).triggerHandler("wc_stripe_submit_error",[e,t,this]);e=void 0===t?e:t,this.submit_message(e)},wc_stripe.BaseGateway.prototype.submit_error_code=function(t){console.log(t)},wc_stripe.BaseGateway.prototype.get_error_message=function(t){return"object"==typeof t&&(t=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 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.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.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),this.handle_card_action(i))}catch(s){}return!0},wc_stripe.BaseGateway.prototype.sync_payment_intent=function(t,s){return new Promise(function(e,i){o.when(o.ajax({method:"POST",dataType:"json",url:this.params.routes.sync_intent,data:{order_id:t,client_secret:s},beforeSend:this.ajax_before_send.bind(this)})).done(function(t){(t.code?i:e)(t)}).fail(function(t,e,i){this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.BaseGateway.prototype.serialize_form=function(t){var e,i=t.find("input").filter(function(t,e){return!o(e).is('[name^="add-to-cart"]')}.bind(this)).serializeArray(),s={};for(e in i){var a=i[e];s[a.name]=a.value}return s.payment_method=this.gateway_id,s},wc_stripe.BaseGateway.prototype.serialize_fields=function(){return o.extend({},this.fields.toJson(),o(document.body).triggerHandler("wc_stripe_process_checkout_data",[this,this.fields]))},wc_stripe.BaseGateway.prototype.map_shipping_methods=function(t){var e={};return"default"===t||1<(t=t.match(/^([\w+]):(.+)$/)).length&&(e[t[1]]=t[2]),e},wc_stripe.BaseGateway.prototype.maybe_set_ship_to_different=function(){o('[name="ship_to_different_address"]').length&&o('[name="ship_to_different_address"]').prop("checked",this.get_address_field_hash("billing")!==this.get_address_field_hash("shipping")).trigger("change")},wc_stripe.BaseGateway.prototype.update_shipping_address=function(s){return new Promise(function(e,i){o.ajax({url:this.params.routes.shipping_address,method:"POST",dataType:"json",data:{address:this.map_address(s.shippingAddress),payment_method:this.gateway_id,page_id:this.get_page(),currency:this.get_currency()},beforeSend:this.ajax_before_send.bind(this)}).done(function(t){t.code?(s.updateWith(t.data.newData),i(t.data)):(s.updateWith(t.data.newData),this.fields.set("shipping_method",t.data.shipping_method),e(t.data))}.bind(this)).fail(function(){}.bind(this))}.bind(this))},wc_stripe.BaseGateway.prototype.update_shipping_method=function(s){return new Promise(function(e,i){o.ajax({url:this.params.routes.shipping_method,method:"POST",dataType:"json",data:{shipping_method:s.shippingOption.id,payment_method:this.gateway_id,currency:this.get_currency(),page_id:this.get_page()},beforeSend:this.ajax_before_send.bind(this)}).done(function(t){t.code?(s.updateWith(t.data.newData),i(t.data)):(this.set_selected_shipping_methods(t.data.shipping_methods),s.updateWith(t.data.newData),e(t.data))}.bind(this)).fail(function(t,e,i){this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.CheckoutGateway=function(){this.message_container="li.payment_method_"+this.gateway_id,this.banner_container="li.banner_payment_method_"+this.gateway_id,o(document.body).on("update_checkout",this.update_checkout.bind(this)),o(document.body).on("updated_checkout",this.updated_checkout.bind(this)),o(document.body).on("updated_checkout",this.container_styles.bind(this)),o(document.body).on("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(":checked"))},wc_stripe.CheckoutGateway.prototype.get_payment_method=function(){return o('[name="payment_method"]:checked').val()},wc_stripe.CheckoutGateway.prototype.set_use_new_option=function(t){o("#"+this.gateway_id+"_use_new").prop("checked",t).trigger("change")},wc_stripe.CheckoutGateway.prototype.checkout_place_order=function(){return this.is_valid_checkout()?!!this.is_saved_method_selected()||this.payment_token_received:(this.submit_error(this.params.messages.terms),!1)},wc_stripe.CheckoutGateway.prototype.on_token_received=function(t){this.payment_token_received=!0,this.set_nonce(t.id),this.hide_payment_button(),this.show_place_order()},wc_stripe.CheckoutGateway.prototype.block=function(){o().block&&o("form.checkout").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},wc_stripe.CheckoutGateway.prototype.unblock=function(){o().block&&o("form.checkout").unblock()},wc_stripe.CheckoutGateway.prototype.hide_place_order=function(){o("#place_order").addClass("wc-stripe-hide")},wc_stripe.CheckoutGateway.prototype.show_place_order=function(){o("#place_order").removeClass("wc-stripe-hide")},wc_stripe.CheckoutGateway.prototype.on_show_new_methods=function(){this.payment_token_received?(this.show_place_order(),this.hide_payment_button()):(this.hide_place_order(),this.show_payment_button())},wc_stripe.CheckoutGateway.prototype.on_show_saved_methods=function(){this.hide_payment_button(),this.show_place_order()},wc_stripe.CheckoutGateway.prototype.show_payment_button=function(){this.$button&&this.$button.show()},wc_stripe.CheckoutGateway.prototype.hide_payment_button=function(){this.$button&&this.$button.hide()},wc_stripe.CheckoutGateway.prototype.trigger_payment_method_selected=function(){this.on_payment_method_selected(null,o('[name="payment_method"]:checked').val())},wc_stripe.CheckoutGateway.prototype.on_payment_method_selected=function(t,e){e===this.gateway_id?this.payment_token_received||this.is_saved_method_selected()?(this.hide_payment_button(),this.show_place_order()):(this.show_payment_button(),this.hide_place_order()):(this.hide_payment_button(),e.indexOf("stripe_")<0&&this.show_place_order())},wc_stripe.CheckoutGateway.prototype.banner_enabled=function(){return"1"===this.params.banner_enabled},wc_stripe.CheckoutGateway.prototype.checkout_fields_valid=function(){if(["checkout","order_pay"].indexOf(this.get_page())<0)return!0;var t=!0;return(t=this.fields.validateFields("billing"))?this.needs_shipping()&&o("#ship-to-different-address-checkbox").is(":checked")?(t=this.fields.validateFields("shipping"))||this.submit_error(this.params.messages.required_field):(t=this.is_valid_checkout())||this.submit_error(this.params.messages.terms):this.submit_error(this.params.messages.required_field),t},wc_stripe.CheckoutGateway.prototype.cart_contains_subscription=function(){return"undefined"!=typeof wc_stripe_cart_contains_subscription&&!0===wc_stripe_cart_contains_subscription},wc_stripe.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(){return!1!==this.get_product_data().variation},wc_stripe.ProductGateway.prototype.get_product_data=function(){return this.get_gateway_data().product},wc_stripe.ProductGateway.prototype.set_product_data=function(t){var e=this.get_gateway_data();e.product=t,this.set_gateway_data(e)},wc_stripe.ProductGateway.prototype.add_to_cart=function(){return new Promise(function(e,i){this.block(),o.ajax({url:this.params.routes.add_to_cart,method:"POST",dataType:"json",data:o.extend({},{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()},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})),this.$button.addClass("gpay-button-container")},wc_stripe.GooglePay.prototype.start=function(){this.createPaymentsClient(),this.paymentsClient.loadPaymentData(this.build_payment_request()).then(function(t){var e=JSON.parse(t.paymentMethodData.tokenizationData.token);this.update_addresses(t),this.stripe.createPaymentMethod({type:"card",card:{token:e.id},billing_details:this.get_billing_details()}).then(function(t){if(t.error)return this.submit_error(t.error);this.on_token_received(t.paymentMethod)}.bind(this))}.bind(this))["catch"](function(t){"CANCELED"!==t.statusCode&&(t.statusMessage&&-1<t.statusMessage.indexOf("paymentDataRequest.callbackIntent")?this.submit_error_code("DEVELOPER_ERROR_WHITELIST"):this.submit_error(t.statusMessage))}.bind(this))},wc_stripe.ApplePay=function(){},wc_stripe.ApplePay.prototype.initialize=function(){this.createPaymentRequest(),this.canMakePayment()},wc_stripe.ApplePay.prototype.create_button=function(){this.$button&&this.$button.remove(),this.$button=o(this.params.button),this.$button.on("click",this.start.bind(this)),this.append_button()},wc_stripe.ApplePay.prototype.canMakePayment=function(){return new Promise(function(e){this.paymentRequest.canMakePayment().then(function(t){t&&t.applePay&&(this.can_pay=!0,this.create_button(),o(this.container).show(),e(t))}.bind(this))}.bind(this))},wc_stripe.ApplePay.prototype.start=function(t){t.preventDefault(),this.paymentRequest.update(this.get_payment_request_update({total:{pending:!1}})),this.paymentRequest.show()},wc_stripe.PaymentRequest=function(){},wc_stripe.PaymentRequest.prototype.initialize=function(){this.createPaymentRequest(),this.createPaymentRequestButton(),this.canMakePayment(),this.paymentRequestButton.on("click",this.button_click.bind(this))},wc_stripe.PaymentRequest.prototype.button_click=function(t){},wc_stripe.PaymentRequest.prototype.createPaymentRequestButton=function(){this.paymentRequestButton&&this.paymentRequestButton.destroy(),this.paymentRequestButton=this.elements.create("paymentRequestButton",{paymentRequest:this.paymentRequest,style:{paymentRequestButton:{type:this.params.button.type,theme:this.params.button.theme,height:this.params.button.height}}})},wc_stripe.PaymentRequest.prototype.canMakePayment=function(){return new Promise(function(e){this.paymentRequest.canMakePayment().then(function(t){t&&!t.applePay&&(this.can_pay=!0,this.create_button(),o(this.container).show(),e(t))}.bind(this))}.bind(this))},wc_stripe.PaymentRequest.prototype.create_button=function(){this.paymentRequestButton.mount("#wc-stripe-payment-request-container")},wc_stripe.CheckoutFields=function(t,e){this.params=t,this.page=e,this.session_values=this.supportsSessionStorage()&&sessionStorage.getItem("wc_stripe_checkout_fields")?JSON.parse(sessionStorage.getItem("wc_stripe_checkout_fields")):{},this.fields=new Map(Object.keys(this.params).map(function(t){return null===this.params[t].value&&(t in this.session_values&&null!==this.session_values[t]?this.params[t].value=this.session_values[t]:this.params[t].value=""),[t,this.params[t].value]}.bind(this))),("checkout"===e||"cart"===e&&o(document.body).is(".woocommerce-checkout"))&&(o(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(/&quot;/g,'"')):this.locales=null},wc_stripe.CheckoutFields.prototype.updated_checkout=function(){this.syncCheckoutFieldsWithDOM()},wc_stripe.CheckoutFields.prototype.syncCheckoutFieldsWithDOM=function(){for(var t in this.params)o("#"+t).length&&this.fields.set(t,o("#"+t).val())},wc_stripe.CheckoutFields.prototype.onChange=function(t){try{var e=t.currentTarget.name,i=t.currentTarget.value;this.fields.set(e,i),"billing_country"!==e&&"shipping_country"!==e||this.update_required_fields(i,e),this.supportsSessionStorage()&&sessionStorage.setItem("wc_stripe_checkout_fields",JSON.stringify(this.toJson()))}catch(s){console.log(s)}},wc_stripe.CheckoutFields.prototype.update_required_fields=function(t,e){if(this.locales){var i,s=-1<e.indexOf("billing_")?"billing_":"shipping_",t="undefined"!=typeof this.locales[t]?this.locales[t]:this.locales["default"],a=o.extend(!0,{},this.locales["default"],t);for(i in a){var n=s+i;this.params[n]&&(this.params[n]=o.extend(!0,{},this.params[n],a[i]))}}},wc_stripe.CheckoutFields.prototype.on_ship_to_address_change=function(t){o(t.currentTarget).is(":checked")&&this.update_required_fields(o("#shipping_country").val(),"shipping_country")},wc_stripe.CheckoutFields.prototype.requestFieldInWallet=function(t){return"checkout"===this.page?this.required(t)&&this.isEmpty(t):"order_pay"!==this.page&&this.required(t)},wc_stripe.CheckoutFields.prototype.set=function(t,e,i){this[t]&&"function"==typeof this[t]?this[t]().set.call(this,e,i):this.fields.set(t,e)},wc_stripe.CheckoutFields.prototype.get=function(t,e){var i;return this[t]&&"function"==typeof this[t]?i=this[t]().get.call(this,e):null!=(i=this.fields.get(t))&&""!==i||void 0!==e&&(i=e),void 0===i?"":i},wc_stripe.CheckoutFields.prototype.required=function(t){return!(!this.params[t]||"undefined"==typeof this.params[t].required)&&this.params[t].required},wc_stripe.CheckoutFields.prototype.exists=function(t){return t in this.params},wc_stripe.CheckoutFields.prototype.isEmpty=function(t){if(this.fields.has(t)){t=this.fields.get(t);return null==t||"string"==typeof t&&0===t.trim().length}return!0},wc_stripe.CheckoutFields.prototype.isValid=function(t){if(this[t]&&"function"==typeof this[t])return this[t]().isValid.apply(this,Array.prototype.slice.call(arguments,1))},wc_stripe.CheckoutFields.prototype.first_name=function(){return{set:function(t,e){this.fields.set(e+"_first_name",t)},get:function(t){return this.fields.get(t+"_first_name")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.last_name=function(){return{set:function(t,e){this.fields.set(e+"_last_name",t)},get:function(t){return this.fields.get(t+"_last_name")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.address_1=function(){return{set:function(t,e){this.fields.set(e+"_address_1",t)},get:function(t){return this.fields.get(t+"_address_1")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.address_2=function(){return{set:function(t,e){this.fields.set(e+"_address_2",t)},get:function(t){return this.fields.get(t+"_address_2")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.name=function(){return{set:function(t,e){this.fields.set(e+"_full_name",t);var i=t.split(" ");1<i.length?(t=i.pop(),this.fields.set(e+"_first_name",i.join(" ")),this.fields.set(e+"_last_name",t)):1==i.length&&this.fields.set(e+"_first_name",i[0])},get:function(t){return this.fields.get(t+"_first_name")+" "+this.fields.get(t+"_last_name")}}},wc_stripe.CheckoutFields.prototype.email=function(){return{set:function(t,e){this.fields.set(e+"_email",t)},get:function(t){return this.fields.get(t+"_email")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.phone=function(){return{set:function(t,e){this.fields.set(e+"_phone",t)},get:function(t){return this.fields.get(t+"_phone")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.country=function(){return{set:function(t,e){this.fields.set(e+"_country",t)},get:function(t){return this.fields.get(t+"_country")},isValid:function(t){return"string"==typeof t&&2===t.length}}},wc_stripe.CheckoutFields.prototype.state=function(){return{set:function(i,t){2<(i=i.toUpperCase()).length&&"checkout"===this.page&&o("#"+t+"_state option").each(function(){var t=o(this),e=t.text().toUpperCase();i===e&&(i=t.val())}),this.fields.set(t+"_state",i)},get:function(t){return this.fields.get(t+"_state")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.city=function(){return{set:function(t,e){this.fields.set(e+"_city",t)},get:function(t){return this.fields.get(t+"_city")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.postcode=function(){return{set:function(t,e){this.fields.set(e+"_postcode",t)},get:function(t){return this.fields.get(t+"_postcode")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.recipient=function(){return wc_stripe.CheckoutFields.prototype.name.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.payerName=function(){return wc_stripe.CheckoutFields.prototype.name.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.payerEmail=function(){return wc_stripe.CheckoutFields.prototype.email.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.payerPhone=function(){return wc_stripe.CheckoutFields.prototype.phone.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.phoneNumber=function(){return wc_stripe.CheckoutFields.prototype.phone.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.countryCode=function(){return wc_stripe.CheckoutFields.prototype.country.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.address1=function(){return wc_stripe.CheckoutFields.prototype.address_1.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.address2=function(){return wc_stripe.CheckoutFields.prototype.address_2.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.line1=function(){return wc_stripe.CheckoutFields.prototype.address_1.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.line2=function(){return wc_stripe.CheckoutFields.prototype.address_2.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.addressLine=function(){return{set:function(t,e){0<t.length&&this.fields.set(e+"_address_1",t[0]),1<t.length&&this.fields.set(e+"_address_2",t[1])},get:function(t){return[this.fields.get(t+"_address_1"),this.fields.get(t+"_address_2")]},isValid:function(t){return 0<t.length&&("string"==typeof t[0]&&0<t[0].length)}}},wc_stripe.CheckoutFields.prototype.region=function(){return wc_stripe.CheckoutFields.prototype.state.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.administrativeArea=function(){return wc_stripe.CheckoutFields.prototype.state.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.locality=function(){return wc_stripe.CheckoutFields.prototype.city.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.postal_code=function(){return wc_stripe.CheckoutFields.prototype.postcode.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.postalCode=function(){return wc_stripe.CheckoutFields.prototype.postcode.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.toJson=function(){var i={};return this.fields.forEach(function(t,e){i[e]=t}),i},wc_stripe.CheckoutFields.prototype.toFormFields=function(t){var i=[];this.fields.forEach(function(t,e){e='[name="'+e+'"]';o(e).length&&""!==t&&(o(e).val()!==t&&o(e).is("select")&&i.push(e),o(e).val(t))}),0<i.length&&o(i.join(",")).trigger("change"),void 0!==t&&o(document.body).trigger("update_checkout",t)},wc_stripe.CheckoutFields.prototype.validateFields=function(t){for(var e in this.params){var i=this.params[e];if(-1<e.indexOf(t)&&i.required&&o("#"+e).length&&o("#"+e).is(":visible")){i=o("#"+e).val();if(null==i||0===i.length)return!1}}return!0};try{i=Stripe(wc_stripe_params_v3.api_key,"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.elements=i.elements(o.extend({},{locale:"auto"},this.get_element_options())),this.fields=r,this.initialize()},wc_stripe.BaseGateway.prototype.get_page=function(){var t=wc_stripe_params_v3.page;return"cart"===t&&o(document.body).is(".woocommerce-checkout")&&(t="checkout"),t},wc_stripe.BaseGateway.prototype.set_nonce=function(t){this.fields.set(this.gateway_id+"_token_key",t),o(this.token_selector).val(t)},wc_stripe.BaseGateway.prototype.get_element_options=function(){return{}},wc_stripe.BaseGateway.prototype.initialize=function(){},wc_stripe.BaseGateway.prototype.create_button=function(){},wc_stripe.BaseGateway.prototype.is_gateway_selected=function(){return o('[name="payment_method"]:checked').val()===this.gateway_id},wc_stripe.BaseGateway.prototype.is_saved_method_selected=function(){return this.is_gateway_selected()&&"saved"===o('[name="'+this.gateway_id+'_payment_type_key"]:checked').val()},wc_stripe.BaseGateway.prototype.has_checkout_error=function(){return 0<o("#wc_stripe_checkout_error").length&&this.is_gateway_selected()},wc_stripe.BaseGateway.prototype.submit_error=function(t){var e=this.get_error_message(t);e.indexOf("</ul>")<0&&(e='<div class="'+function(){var t="woocommerce-NoticeGroup";return this.is_current_page("checkout")&&(t+=" woocommerce-NoticeGroup-checkout"),t}.bind(this)()+'"><ul class="woocommerce-error"><li>'+e+"</li></ul></div>");t=o(document.body).triggerHandler("wc_stripe_submit_error",[e,t,this]);e=void 0===t?e:t,this.submit_message(e)},wc_stripe.BaseGateway.prototype.submit_error_code=function(t){console.log(t)},wc_stripe.BaseGateway.prototype.get_error_message=function(t){return"object"==typeof t&&(t=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 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.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.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),this.handle_card_action(i))}catch(s){}return!0},wc_stripe.BaseGateway.prototype.sync_payment_intent=function(t,s){return new Promise(function(e,i){o.when(o.ajax({method:"POST",dataType:"json",url:this.params.routes.sync_intent,data:{order_id:t,client_secret:s},beforeSend:this.ajax_before_send.bind(this)})).done(function(t){(t.code?i:e)(t)}).fail(function(t,e,i){this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.BaseGateway.prototype.serialize_form=function(t){var e,i=t.find("input").filter(function(t,e){return!o(e).is('[name^="add-to-cart"]')}.bind(this)).serializeArray(),s={};for(e in i){var a=i[e];s[a.name]=a.value}return s.payment_method=this.gateway_id,s},wc_stripe.BaseGateway.prototype.serialize_fields=function(){return o.extend({},this.fields.toJson(),o(document.body).triggerHandler("wc_stripe_process_checkout_data",[this,this.fields]))},wc_stripe.BaseGateway.prototype.map_shipping_methods=function(t){var e={};return"default"===t||1<(t=t.match(/^([\w+]):(.+)$/)).length&&(e[t[1]]=t[2]),e},wc_stripe.BaseGateway.prototype.maybe_set_ship_to_different=function(){o('[name="ship_to_different_address"]').length&&o('[name="ship_to_different_address"]').prop("checked",this.get_address_field_hash("billing")!==this.get_address_field_hash("shipping")).trigger("change")},wc_stripe.BaseGateway.prototype.update_shipping_address=function(s){return new Promise(function(e,i){o.ajax({url:this.params.routes.shipping_address,method:"POST",dataType:"json",data:{address:this.map_address(s.shippingAddress),payment_method:this.gateway_id,page_id:this.get_page(),currency:this.get_currency()},beforeSend:this.ajax_before_send.bind(this)}).done(function(t){t.code?(s.updateWith(t.data.newData),i(t.data)):(s.updateWith(t.data.newData),this.fields.set("shipping_method",t.data.shipping_method),e(t.data))}.bind(this)).fail(function(){}.bind(this))}.bind(this))},wc_stripe.BaseGateway.prototype.update_shipping_method=function(s){return new Promise(function(e,i){o.ajax({url:this.params.routes.shipping_method,method:"POST",dataType:"json",data:{shipping_method:s.shippingOption.id,payment_method:this.gateway_id,currency:this.get_currency(),page_id:this.get_page()},beforeSend:this.ajax_before_send.bind(this)}).done(function(t){t.code?(s.updateWith(t.data.newData),i(t.data)):(this.set_selected_shipping_methods(t.data.shipping_methods),s.updateWith(t.data.newData),e(t.data))}.bind(this)).fail(function(t,e,i){this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.CheckoutGateway=function(){this.message_container="li.payment_method_"+this.gateway_id,this.banner_container="li.banner_payment_method_"+this.gateway_id,o(document.body).on("update_checkout",this.update_checkout.bind(this)),o(document.body).on("updated_checkout",this.updated_checkout.bind(this)),o(document.body).on("updated_checkout",this.container_styles.bind(this)),o(document.body).on("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(":checked"))},wc_stripe.CheckoutGateway.prototype.get_payment_method=function(){return o('[name="payment_method"]:checked').val()},wc_stripe.CheckoutGateway.prototype.set_use_new_option=function(t){o("#"+this.gateway_id+"_use_new").prop("checked",t).trigger("change")},wc_stripe.CheckoutGateway.prototype.checkout_place_order=function(){return this.is_valid_checkout()?!!this.is_saved_method_selected()||this.payment_token_received:(this.submit_error(this.params.messages.terms),!1)},wc_stripe.CheckoutGateway.prototype.on_token_received=function(t){this.payment_token_received=!0,this.set_nonce(t.id),this.hide_payment_button(),this.show_place_order()},wc_stripe.CheckoutGateway.prototype.block=function(){o().block&&o("form.checkout").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},wc_stripe.CheckoutGateway.prototype.unblock=function(){o().block&&o("form.checkout").unblock()},wc_stripe.CheckoutGateway.prototype.hide_place_order=function(){o("#place_order").addClass("wc-stripe-hide")},wc_stripe.CheckoutGateway.prototype.show_place_order=function(){o("#place_order").removeClass("wc-stripe-hide")},wc_stripe.CheckoutGateway.prototype.on_show_new_methods=function(){this.payment_token_received?(this.show_place_order(),this.hide_payment_button()):(this.hide_place_order(),this.show_payment_button())},wc_stripe.CheckoutGateway.prototype.on_show_saved_methods=function(){this.hide_payment_button(),this.show_place_order()},wc_stripe.CheckoutGateway.prototype.show_payment_button=function(){this.$button&&this.$button.show()},wc_stripe.CheckoutGateway.prototype.hide_payment_button=function(){this.$button&&this.$button.hide()},wc_stripe.CheckoutGateway.prototype.trigger_payment_method_selected=function(){this.on_payment_method_selected(null,o('[name="payment_method"]:checked').val())},wc_stripe.CheckoutGateway.prototype.on_payment_method_selected=function(t,e){e===this.gateway_id?this.payment_token_received||this.is_saved_method_selected()?(this.hide_payment_button(),this.show_place_order()):(this.show_payment_button(),this.hide_place_order()):(this.hide_payment_button(),e.indexOf("stripe_")<0&&this.show_place_order())},wc_stripe.CheckoutGateway.prototype.banner_enabled=function(){return"1"===this.params.banner_enabled},wc_stripe.CheckoutGateway.prototype.checkout_fields_valid=function(){if(["checkout","order_pay"].indexOf(this.get_page())<0)return!0;var t=!0;return(t=this.fields.validateFields("billing"))?this.needs_shipping()&&o("#ship-to-different-address-checkbox").is(":checked")?(t=this.fields.validateFields("shipping"))||this.submit_error(this.params.messages.required_field):(t=this.is_valid_checkout())||this.submit_error(this.params.messages.terms):this.submit_error(this.params.messages.required_field),t},wc_stripe.CheckoutGateway.prototype.cart_contains_subscription=function(){return"undefined"!=typeof wc_stripe_cart_contains_subscription&&!0===wc_stripe_cart_contains_subscription},wc_stripe.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(){return!1!==this.get_product_data().variation},wc_stripe.ProductGateway.prototype.get_product_data=function(){return this.get_gateway_data().product},wc_stripe.ProductGateway.prototype.set_product_data=function(t){var e=this.get_gateway_data();e.product=t,this.set_gateway_data(e)},wc_stripe.ProductGateway.prototype.add_to_cart=function(){return new Promise(function(e,i){this.block(),o.ajax({url:this.params.routes.add_to_cart,method:"POST",dataType:"json",data:o.extend({},{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()},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.CheckoutFields=function(t,e){this.params=t,this.page=e,this.session_values=this.supportsSessionStorage()&&sessionStorage.getItem("wc_stripe_checkout_fields")?JSON.parse(sessionStorage.getItem("wc_stripe_checkout_fields")):{},this.fields=new Map(Object.keys(this.params).map(function(t){return null===this.params[t].value&&(t in this.session_values&&null!==this.session_values[t]?this.params[t].value=this.session_values[t]:this.params[t].value=""),[t,this.params[t].value]}.bind(this))),("checkout"===e||"cart"===e&&o(document.body).is(".woocommerce-checkout"))&&(o(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(/&quot;/g,'"')):this.locales=null},wc_stripe.CheckoutFields.prototype.updated_checkout=function(){this.syncCheckoutFieldsWithDOM()},wc_stripe.CheckoutFields.prototype.syncCheckoutFieldsWithDOM=function(){for(var t in this.params)o("#"+t).length&&this.fields.set(t,o("#"+t).val())},wc_stripe.CheckoutFields.prototype.onChange=function(t){try{var e=t.currentTarget.name,i=t.currentTarget.value;this.fields.set(e,i),"billing_country"!==e&&"shipping_country"!==e||this.update_required_fields(i,e),this.supportsSessionStorage()&&sessionStorage.setItem("wc_stripe_checkout_fields",JSON.stringify(this.toJson()))}catch(s){console.log(s)}},wc_stripe.CheckoutFields.prototype.update_required_fields=function(t,e){if(this.locales){var i,s=-1<e.indexOf("billing_")?"billing_":"shipping_",t="undefined"!=typeof this.locales[t]?this.locales[t]:this.locales["default"],a=o.extend(!0,{},this.locales["default"],t);for(i in a){var n=s+i;this.params[n]&&(this.params[n]=o.extend(!0,{},this.params[n],a[i]))}}},wc_stripe.CheckoutFields.prototype.on_ship_to_address_change=function(t){o(t.currentTarget).is(":checked")&&this.update_required_fields(o("#shipping_country").val(),"shipping_country")},wc_stripe.CheckoutFields.prototype.requestFieldInWallet=function(t){return"checkout"===this.page?this.required(t)&&this.isEmpty(t):"order_pay"!==this.page&&this.required(t)},wc_stripe.CheckoutFields.prototype.set=function(t,e,i){this[t]&&"function"==typeof this[t]?this[t]().set.call(this,e,i):this.fields.set(t,e)},wc_stripe.CheckoutFields.prototype.get=function(t,e){var i;return this[t]&&"function"==typeof this[t]?i=this[t]().get.call(this,e):null!=(i=this.fields.get(t))&&""!==i||void 0!==e&&(i=e),void 0===i?"":i},wc_stripe.CheckoutFields.prototype.required=function(t){return!(!this.params[t]||"undefined"==typeof this.params[t].required)&&this.params[t].required},wc_stripe.CheckoutFields.prototype.exists=function(t){return t in this.params},wc_stripe.CheckoutFields.prototype.isEmpty=function(t){if(this.fields.has(t)){t=this.fields.get(t);return null==t||"string"==typeof t&&0===t.trim().length}return!0},wc_stripe.CheckoutFields.prototype.isValid=function(t){if(this[t]&&"function"==typeof this[t])return this[t]().isValid.apply(this,Array.prototype.slice.call(arguments,1))},wc_stripe.CheckoutFields.prototype.first_name=function(){return{set:function(t,e){this.fields.set(e+"_first_name",t)},get:function(t){return this.fields.get(t+"_first_name")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.last_name=function(){return{set:function(t,e){this.fields.set(e+"_last_name",t)},get:function(t){return this.fields.get(t+"_last_name")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.address_1=function(){return{set:function(t,e){this.fields.set(e+"_address_1",t)},get:function(t){return this.fields.get(t+"_address_1")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.address_2=function(){return{set:function(t,e){this.fields.set(e+"_address_2",t)},get:function(t){return this.fields.get(t+"_address_2")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.name=function(){return{set:function(t,e){this.fields.set(e+"_full_name",t);var i=t.split(" ");1<i.length?(t=i.pop(),this.fields.set(e+"_first_name",i.join(" ")),this.fields.set(e+"_last_name",t)):1==i.length&&this.fields.set(e+"_first_name",i[0])},get:function(t){return this.fields.get(t+"_first_name")+" "+this.fields.get(t+"_last_name")}}},wc_stripe.CheckoutFields.prototype.email=function(){return{set:function(t,e){this.fields.set(e+"_email",t)},get:function(t){return this.fields.get(t+"_email")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.phone=function(){return{set:function(t,e){this.fields.set(e+"_phone",t)},get:function(t){return this.fields.get(t+"_phone")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.country=function(){return{set:function(t,e){this.fields.set(e+"_country",t)},get:function(t){return this.fields.get(t+"_country")},isValid:function(t){return"string"==typeof t&&2===t.length}}},wc_stripe.CheckoutFields.prototype.state=function(){return{set:function(i,t){2<(i=i.toUpperCase()).length&&"checkout"===this.page&&o("#"+t+"_state option").each(function(){var t=o(this),e=t.text().toUpperCase();i===e&&(i=t.val())}),this.fields.set(t+"_state",i)},get:function(t){return this.fields.get(t+"_state")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.city=function(){return{set:function(t,e){this.fields.set(e+"_city",t)},get:function(t){return this.fields.get(t+"_city")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.postcode=function(){return{set:function(t,e){this.fields.set(e+"_postcode",t)},get:function(t){return this.fields.get(t+"_postcode")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.recipient=function(){return wc_stripe.CheckoutFields.prototype.name.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.payerName=function(){return wc_stripe.CheckoutFields.prototype.name.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.payerEmail=function(){return wc_stripe.CheckoutFields.prototype.email.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.payerPhone=function(){return wc_stripe.CheckoutFields.prototype.phone.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.phoneNumber=function(){return wc_stripe.CheckoutFields.prototype.phone.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.countryCode=function(){return wc_stripe.CheckoutFields.prototype.country.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.address1=function(){return wc_stripe.CheckoutFields.prototype.address_1.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.address2=function(){return wc_stripe.CheckoutFields.prototype.address_2.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.line1=function(){return wc_stripe.CheckoutFields.prototype.address_1.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.line2=function(){return wc_stripe.CheckoutFields.prototype.address_2.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.addressLine=function(){return{set:function(t,e){0<t.length&&this.fields.set(e+"_address_1",t[0]),1<t.length&&this.fields.set(e+"_address_2",t[1])},get:function(t){return[this.fields.get(t+"_address_1"),this.fields.get(t+"_address_2")]},isValid:function(t){return 0<t.length&&("string"==typeof t[0]&&0<t[0].length)}}},wc_stripe.CheckoutFields.prototype.region=function(){return wc_stripe.CheckoutFields.prototype.state.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.administrativeArea=function(){return wc_stripe.CheckoutFields.prototype.state.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.locality=function(){return wc_stripe.CheckoutFields.prototype.city.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.postal_code=function(){return wc_stripe.CheckoutFields.prototype.postcode.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.postalCode=function(){return wc_stripe.CheckoutFields.prototype.postcode.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.toJson=function(){var i={};return this.fields.forEach(function(t,e){i[e]=t}),i},wc_stripe.CheckoutFields.prototype.toFormFields=function(t){var i=[];this.fields.forEach(function(t,e){e='[name="'+e+'"]';o(e).length&&""!==t&&(o(e).val()!==t&&o(e).is("select")&&i.push(e),o(e).val(t))}),0<i.length&&o(i.join(",")).trigger("change"),void 0!==t&&o(document.body).trigger("update_checkout",t)},wc_stripe.CheckoutFields.prototype.validateFields=function(t){for(var e in this.params){var i=this.params[e];if(-1<e.indexOf(t)&&i.required&&o("#"+e).length&&o("#"+e).is(":visible")){i=o("#"+e).val();if(null==i||0===i.length)return!1}}return!0};try{i=Stripe(wc_stripe_params_v3.api_key,"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);
bin/remove-file-plugin.js ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const fs = require('fs');
2
+ const glob = require('glob');
3
+
4
+ /**
5
+ * Removes files that are generated during the Webpack build process
6
+ */
7
+ class RemoveFilesPlugin {
8
+ constructor(filepath) {
9
+ this.filepath = filepath;
10
+ }
11
+
12
+ apply(compiler) {
13
+ compiler.hooks.afterEmit.tap('afterEmit', this.deleteFiles.bind(this));
14
+ }
15
+
16
+ deleteFiles() {
17
+ let files = glob.sync(this.filepath);
18
+ files.forEach(file => {
19
+ fs.unlink(file, (err) => {
20
+ if (err) {
21
+ console.log(`error removing file ${file}.`, err);
22
+ }
23
+ })
24
+ })
25
+ }
26
+ }
27
+
28
+ module.exports = RemoveFilesPlugin;
bin/webpack-helpers.js ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const isDev = () => {
2
+ return getEnv() === 'development';
3
+ }
4
+
5
+ const getEnv = () => {
6
+ return process.env.NODE_ENV || 'development';
7
+ }
8
+
9
+ const requiredPackagesInWPLegacy = [
10
+ '@wordpress/compose',
11
+ ];
12
+
13
+ const wcDepMap = {
14
+ '@woocommerce/blocks-registry': ['wc', 'wcBlocksRegistry'],
15
+ '@woocommerce/settings': ['wc', 'wcSettings'],
16
+ '@woocommerce/block-data': ['wc', 'wcBlocksData'],
17
+ '@woocommerce/shared-context': ['wc', 'wcSharedContext'],
18
+ '@woocommerce/shared-hocs': ['wc', 'wcSharedHocs'],
19
+ '@woocommerce/price-format': ['wc', 'priceFormat'],
20
+ '@woocommerce/blocks-checkout': ['wc', 'blocksCheckout'],
21
+ '@googlepay': 'google',
22
+ 'QRCode': 'QRCode',
23
+ '@plaid': 'Plaid'
24
+ };
25
+
26
+ const wcHandleMap = {
27
+ '@woocommerce/blocks-registry': 'wc-blocks-registry',
28
+ '@woocommerce/settings': 'wc-settings',
29
+ '@woocommerce/block-settings': 'wc-settings',
30
+ '@woocommerce/block-data': 'wc-blocks-data-store',
31
+ '@woocommerce/shared-context': 'wc-shared-context',
32
+ '@woocommerce/shared-hocs': 'wc-shared-hocs',
33
+ '@woocommerce/price-format': 'wc-price-format',
34
+ '@woocommerce/blocks-checkout': 'wc-blocks-checkout',
35
+ '@googlepay': 'wc-stripe-gpay-external',
36
+ '@plaid': 'wc-stripe-plaid'
37
+ //'QRCode': 'wc-stripe-qrcode'
38
+ };
39
+
40
+ const requestToHandle = (request) => {
41
+ if (requiredPackagesInWPLegacy.includes(request)) {
42
+ return false;
43
+ }
44
+ if (wcHandleMap[request]) {
45
+ return wcHandleMap[request];
46
+ }
47
+ }
48
+
49
+ const requestToExternal = (request) => {
50
+ if (requiredPackagesInWPLegacy.includes(request)) {
51
+ return false;
52
+ }
53
+ if (wcDepMap[request]) {
54
+ return wcDepMap[request];
55
+ }
56
+ }
57
+
58
+ module.exports = {
59
+ isDev,
60
+ wcDepMap,
61
+ wcHandleMap,
62
+ requestToHandle,
63
+ requestToExternal
64
+ };
i18n/languages/woo-stripe-payment.pot CHANGED
@@ -2,14 +2,14 @@
2
  # This file is distributed under the same license as the Stripe For WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Stripe For WooCommerce 3.2.15\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-03-23T20:24:03+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"
@@ -103,24 +103,24 @@ msgstr ""
103
  msgid "Order %s"
104
  msgstr ""
105
 
106
- #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:362
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:365
111
  msgid " & billing country is not <strong>%s</strong>"
112
  msgstr ""
113
 
114
- #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:367
115
- #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:370
116
  msgid " & billing country is <strong>%s</strong>"
117
  msgstr ""
118
 
119
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:401
120
  msgid "Please fill out all required fields."
121
  msgstr ""
122
 
123
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:416
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
@@ -128,135 +128,138 @@ msgstr ""
128
  msgid "Total"
129
  msgstr ""
130
 
131
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:486
132
  msgid "User must be logged in."
133
  msgstr ""
134
 
135
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:511
136
  msgid "Error saving payment method. Reason: %s"
137
  msgstr ""
138
 
139
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:530
140
  #: includes/wc-stripe-webhook-functions.php:217
141
  msgid "Order refunded in Stripe. Amount: %s"
142
  msgstr ""
143
 
144
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:568
145
  msgid "Order amount captured in Stripe. Amount: %s"
146
  msgstr ""
147
 
148
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:578
149
  msgid "Error capturing charge in Stripe. Reason: %s"
150
  msgstr ""
151
 
152
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:599
153
  msgid "Error voiding charge. Reason: %s"
154
  msgstr ""
155
 
156
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:601
157
  msgid "Charge voided in Stripe."
158
  msgstr ""
159
 
160
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:764
161
  msgid "n/a"
162
  msgstr ""
163
 
164
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:792
165
  #: includes/admin/meta-boxes/views/html-order-pay.php:42
166
  msgid "New Card"
167
  msgstr ""
168
 
169
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:796
170
  #: includes/admin/meta-boxes/views/html-order-pay.php:30
171
  msgid "Saved Cards"
172
  msgstr ""
173
 
174
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1005
175
  msgid "Attempt to save payment method failed. Reason: %s"
176
  msgstr ""
177
 
178
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1030
179
  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."
180
  msgstr ""
181
 
182
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1032
183
  msgid "We were not able to save your payment method. Reason: %s"
184
  msgstr ""
185
 
186
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1066
187
  msgid "Payment Method Token"
188
  msgstr ""
189
 
190
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1086
191
  msgid "Recurring payment for order failed. Reason: %s"
192
  msgstr ""
193
 
194
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1099
195
  msgid "Recurring payment captured in Stripe. Payment method: %s"
196
  msgstr ""
197
 
198
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1101
199
  msgid "Recurring payment authorized in Stripe. Payment method: %s"
200
  msgstr ""
201
 
202
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1104
203
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1345
204
  msgid "Customer must manually complete payment for payment method %s"
205
  msgstr ""
206
 
207
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1138
208
  #: includes/abstract/abstract-wc-stripe-payment.php:227
209
  msgid "Order %1$s from %2$s"
210
  msgstr ""
211
 
212
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1332
213
  msgid "Pre-order payment for order failed. Reason: %s"
214
  msgstr ""
215
 
216
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1340
217
  msgid "Pre-order payment captured in Stripe. Payment method: %s"
218
  msgstr ""
219
 
220
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1342
221
  msgid "Pre-order payment authorized in Stripe. Payment method: %s"
222
  msgstr ""
223
 
224
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1414
225
  msgid "Cannot process payment"
226
  msgstr ""
227
 
228
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1422
229
  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."
230
  msgstr ""
231
 
232
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1537
233
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1568
234
- #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:203
 
235
  #: includes/wc-stripe-functions.php:424
236
  #: includes/wc-stripe-functions.php:489
237
  msgid "Shipping"
238
  msgstr ""
239
 
240
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1545
241
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1571
242
- #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:213
 
243
  #: includes/wc-stripe-functions.php:441
244
  #: includes/wc-stripe-functions.php:497
245
  msgid "Discount"
246
  msgstr ""
247
 
248
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1548
249
- #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:231
 
250
  #: includes/wc-stripe-functions.php:449
251
  msgid "Tax"
252
  msgstr ""
253
 
254
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1578
255
  #: includes/wc-stripe-functions.php:508
256
  msgid "Fees"
257
  msgstr ""
258
 
259
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1771
260
  msgid "Error saving payment method for subscription. Reason: %s"
261
  msgstr ""
262
 
@@ -281,7 +284,7 @@ msgid "Transaction Id cannot be empty."
281
  msgstr ""
282
 
283
  #: includes/abstract/abstract-wc-stripe-payment.php:294
284
- #: includes/gateways/class-wc-payment-gateway-stripe-ach.php:123
285
  msgid "Error processing payment. Reason: %s"
286
  msgstr ""
287
 
@@ -857,15 +860,15 @@ msgstr ""
857
  msgid "ACH gateway that integrates with your Stripe account."
858
  msgstr ""
859
 
860
- #: includes/gateways/class-wc-payment-gateway-stripe-ach.php:249
861
  msgid "Saved Banks"
862
  msgstr ""
863
 
864
- #: includes/gateways/class-wc-payment-gateway-stripe-ach.php:253
865
  msgid "New Bank"
866
  msgstr ""
867
 
868
- #: includes/gateways/class-wc-payment-gateway-stripe-ach.php:297
869
  msgid "You must set the API mode to live in order to enable the Plaid development environment."
870
  msgstr ""
871
 
@@ -1068,27 +1071,31 @@ msgstr ""
1068
  msgid "If enabled, the payment option labels will use the Stripe translated text."
1069
  msgstr ""
1070
 
1071
- #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:223
1072
  msgid "Fee total"
1073
  msgstr ""
1074
 
1075
- #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:264
 
 
 
 
1076
  msgid "Pay Now"
1077
  msgstr ""
1078
 
1079
- #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:265
1080
  msgid "Pay Later"
1081
  msgstr ""
1082
 
1083
- #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:266
1084
  msgid "Pay Over Time"
1085
  msgstr ""
1086
 
1087
- #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:279
1088
  msgid "Click %1$shere%2$s for Klarna test payment methods."
1089
  msgstr ""
1090
 
1091
- #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:285
1092
  msgid "Your purchase is not approved."
1093
  msgstr ""
1094
 
@@ -1977,6 +1984,10 @@ msgstr ""
1977
  msgid "Please select a bank before proceeding"
1978
  msgstr ""
1979
 
 
 
 
 
1980
  #: includes/wc-stripe-webhook-functions.php:92
1981
  msgid "Charge.succeeded webhook received. Payment has been completed."
1982
  msgstr ""
2
  # This file is distributed under the same license as the Stripe For WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Stripe For WooCommerce 3.3.0\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-05-05T19:17:21+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"
103
  msgid "Order %s"
104
  msgstr ""
105
 
106
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:374
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:377
111
  msgid " & billing country is not <strong>%s</strong>"
112
  msgstr ""
113
 
114
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:379
115
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:382
116
  msgid " & billing country is <strong>%s</strong>"
117
  msgstr ""
118
 
119
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:406
120
  msgid "Please fill out all required fields."
121
  msgstr ""
122
 
123
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:421
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
128
  msgid "Total"
129
  msgstr ""
130
 
131
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:491
132
  msgid "User must be logged in."
133
  msgstr ""
134
 
135
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:516
136
  msgid "Error saving payment method. Reason: %s"
137
  msgstr ""
138
 
139
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:535
140
  #: includes/wc-stripe-webhook-functions.php:217
141
  msgid "Order refunded in Stripe. Amount: %s"
142
  msgstr ""
143
 
144
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:573
145
  msgid "Order amount captured in Stripe. Amount: %s"
146
  msgstr ""
147
 
148
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:583
149
  msgid "Error capturing charge in Stripe. Reason: %s"
150
  msgstr ""
151
 
152
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:604
153
  msgid "Error voiding charge. Reason: %s"
154
  msgstr ""
155
 
156
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:606
157
  msgid "Charge voided in Stripe."
158
  msgstr ""
159
 
160
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:780
161
  msgid "n/a"
162
  msgstr ""
163
 
164
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:808
165
  #: includes/admin/meta-boxes/views/html-order-pay.php:42
166
  msgid "New Card"
167
  msgstr ""
168
 
169
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:812
170
  #: includes/admin/meta-boxes/views/html-order-pay.php:30
171
  msgid "Saved Cards"
172
  msgstr ""
173
 
174
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1021
175
  msgid "Attempt to save payment method failed. Reason: %s"
176
  msgstr ""
177
 
178
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1046
179
  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."
180
  msgstr ""
181
 
182
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1048
183
  msgid "We were not able to save your payment method. Reason: %s"
184
  msgstr ""
185
 
186
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1082
187
  msgid "Payment Method Token"
188
  msgstr ""
189
 
190
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1102
191
  msgid "Recurring payment for order failed. Reason: %s"
192
  msgstr ""
193
 
194
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1115
195
  msgid "Recurring payment captured in Stripe. Payment method: %s"
196
  msgstr ""
197
 
198
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1117
199
  msgid "Recurring payment authorized in Stripe. Payment method: %s"
200
  msgstr ""
201
 
202
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1120
203
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1361
204
  msgid "Customer must manually complete payment for payment method %s"
205
  msgstr ""
206
 
207
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1154
208
  #: includes/abstract/abstract-wc-stripe-payment.php:227
209
  msgid "Order %1$s from %2$s"
210
  msgstr ""
211
 
212
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1348
213
  msgid "Pre-order payment for order failed. Reason: %s"
214
  msgstr ""
215
 
216
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1356
217
  msgid "Pre-order payment captured in Stripe. Payment method: %s"
218
  msgstr ""
219
 
220
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1358
221
  msgid "Pre-order payment authorized in Stripe. Payment method: %s"
222
  msgstr ""
223
 
224
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1430
225
  msgid "Cannot process payment"
226
  msgstr ""
227
 
228
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1438
229
  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."
230
  msgstr ""
231
 
232
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1553
233
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1584
234
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:229
235
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:290
236
  #: includes/wc-stripe-functions.php:424
237
  #: includes/wc-stripe-functions.php:489
238
  msgid "Shipping"
239
  msgstr ""
240
 
241
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1561
242
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1587
243
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:239
244
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:300
245
  #: includes/wc-stripe-functions.php:441
246
  #: includes/wc-stripe-functions.php:497
247
  msgid "Discount"
248
  msgstr ""
249
 
250
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1564
251
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:257
252
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:322
253
  #: includes/wc-stripe-functions.php:449
254
  msgid "Tax"
255
  msgstr ""
256
 
257
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1594
258
  #: includes/wc-stripe-functions.php:508
259
  msgid "Fees"
260
  msgstr ""
261
 
262
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1787
263
  msgid "Error saving payment method for subscription. Reason: %s"
264
  msgstr ""
265
 
284
  msgstr ""
285
 
286
  #: includes/abstract/abstract-wc-stripe-payment.php:294
287
+ #: includes/gateways/class-wc-payment-gateway-stripe-ach.php:121
288
  msgid "Error processing payment. Reason: %s"
289
  msgstr ""
290
 
860
  msgid "ACH gateway that integrates with your Stripe account."
861
  msgstr ""
862
 
863
+ #: includes/gateways/class-wc-payment-gateway-stripe-ach.php:247
864
  msgid "Saved Banks"
865
  msgstr ""
866
 
867
+ #: includes/gateways/class-wc-payment-gateway-stripe-ach.php:251
868
  msgid "New Bank"
869
  msgstr ""
870
 
871
+ #: includes/gateways/class-wc-payment-gateway-stripe-ach.php:295
872
  msgid "You must set the API mode to live in order to enable the Plaid development environment."
873
  msgstr ""
874
 
1071
  msgid "If enabled, the payment option labels will use the Stripe translated text."
1072
  msgstr ""
1073
 
1074
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:249
1075
  msgid "Fee total"
1076
  msgstr ""
1077
 
1078
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:314
1079
+ msgid "Fee"
1080
+ msgstr ""
1081
+
1082
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:352
1083
  msgid "Pay Now"
1084
  msgstr ""
1085
 
1086
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:353
1087
  msgid "Pay Later"
1088
  msgstr ""
1089
 
1090
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:354
1091
  msgid "Pay Over Time"
1092
  msgstr ""
1093
 
1094
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:367
1095
  msgid "Click %1$shere%2$s for Klarna test payment methods."
1096
  msgstr ""
1097
 
1098
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:373
1099
  msgid "Your purchase is not approved."
1100
  msgstr ""
1101
 
1984
  msgid "Please select a bank before proceeding"
1985
  msgstr ""
1986
 
1987
+ #: includes/wc-stripe-functions.php:1219
1988
+ msgid "The IBAN you entered is incomplete."
1989
+ msgstr ""
1990
+
1991
  #: includes/wc-stripe-webhook-functions.php:92
1992
  msgid "Charge.succeeded webhook received. Payment has been completed."
1993
  msgstr ""
includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php CHANGED
@@ -20,9 +20,9 @@ abstract class WC_Payment_Gateway_Stripe_Local_Payment extends WC_Payment_Gatewa
20
  * Currencies this gateway accepts
21
  * @var array
22
  */
23
- protected $currencies = array();
24
 
25
- protected $local_payment_type = '';
26
 
27
  public $countries = array();
28
 
@@ -30,7 +30,7 @@ abstract class WC_Payment_Gateway_Stripe_Local_Payment extends WC_Payment_Gatewa
30
  * @var array
31
  * @since 3.2.10
32
  */
33
- protected $limited_countries = array();
34
 
35
  protected $local_payment_description = '';
36
 
@@ -235,25 +235,9 @@ abstract class WC_Payment_Gateway_Stripe_Local_Payment extends WC_Payment_Gatewa
235
  'amount' => wc_stripe_add_number_precision( $order->get_total(), $order->get_currency() ),
236
  'currency' => $order->get_currency(),
237
  'statement_descriptor' => sprintf( __( 'Order %s', 'woo-stripe-payment' ), $order->get_order_number() ),
238
- 'owner' => array(
239
- 'name' => $this->payment_object->get_name_from_order( $order, 'billing' ),
240
- 'address' => array(
241
- 'city' => $order->get_billing_city(),
242
- 'country' => $order->get_billing_country(),
243
- 'line1' => $order->get_billing_address_1(),
244
- 'line2' => $order->get_billing_address_2(),
245
- 'postal_code' => $order->get_billing_postcode(),
246
- 'state' => $order->get_billing_state(),
247
- )
248
- ),
249
  'redirect' => array( 'return_url' => $this->get_local_payment_return_url( $order ) ),
250
  );
251
- if ( ( $email = $order->get_billing_email() ) ) {
252
- $args['owner']['email'] = $email;
253
- }
254
- if ( ( $phone = $order->get_billing_phone() ) ) {
255
- $args['owner']['phone'] = $phone;
256
- }
257
 
258
  /**
259
  * @param $args
@@ -271,6 +255,7 @@ abstract class WC_Payment_Gateway_Stripe_Local_Payment extends WC_Payment_Gatewa
271
  */
272
  public function get_update_source_args( $order ) {
273
  return array(
 
274
  'metadata' => array(
275
  'order_id' => $order->get_id(),
276
  'created' => time(),
@@ -278,13 +263,40 @@ abstract class WC_Payment_Gateway_Stripe_Local_Payment extends WC_Payment_Gatewa
278
  );
279
  }
280
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
281
  /**
282
  *
283
  * @param WC_Order $order
284
  *
285
  * @return string
286
  */
287
- protected function get_local_payment_return_url( $order ) {
288
  global $wp;
289
  if ( isset( $wp->query_vars['order-pay'] ) ) {
290
  $url = $order->get_checkout_payment_url();
20
  * Currencies this gateway accepts
21
  * @var array
22
  */
23
+ public $currencies = array();
24
 
25
+ public $local_payment_type = '';
26
 
27
  public $countries = array();
28
 
30
  * @var array
31
  * @since 3.2.10
32
  */
33
+ public $limited_countries = array();
34
 
35
  protected $local_payment_description = '';
36
 
235
  'amount' => wc_stripe_add_number_precision( $order->get_total(), $order->get_currency() ),
236
  'currency' => $order->get_currency(),
237
  'statement_descriptor' => sprintf( __( 'Order %s', 'woo-stripe-payment' ), $order->get_order_number() ),
238
+ 'owner' => $this->get_source_owner_args( $order ),
 
 
 
 
 
 
 
 
 
 
239
  'redirect' => array( 'return_url' => $this->get_local_payment_return_url( $order ) ),
240
  );
 
 
 
 
 
 
241
 
242
  /**
243
  * @param $args
255
  */
256
  public function get_update_source_args( $order ) {
257
  return array(
258
+ 'owner' => $this->get_source_owner_args( $order ),
259
  'metadata' => array(
260
  'order_id' => $order->get_id(),
261
  'created' => time(),
263
  );
264
  }
265
 
266
+ /**
267
+ * @param WC_Order $order
268
+ *
269
+ * @return array
270
+ */
271
+ protected function get_source_owner_args( $order ) {
272
+ $owner = array(
273
+ 'name' => $this->payment_object->get_name_from_order( $order, 'billing' ),
274
+ 'address' => array(
275
+ 'city' => $order->get_billing_city(),
276
+ 'country' => $order->get_billing_country(),
277
+ 'line1' => $order->get_billing_address_1(),
278
+ 'line2' => $order->get_billing_address_2(),
279
+ 'postal_code' => $order->get_billing_postcode(),
280
+ 'state' => $order->get_billing_state(),
281
+ )
282
+ );
283
+ if ( ( $email = $order->get_billing_email() ) ) {
284
+ $args['owner']['email'] = $email;
285
+ }
286
+ if ( ( $phone = $order->get_billing_phone() ) ) {
287
+ $args['owner']['phone'] = $phone;
288
+ }
289
+
290
+ return $owner;
291
+ }
292
+
293
  /**
294
  *
295
  * @param WC_Order $order
296
  *
297
  * @return string
298
  */
299
+ public function get_local_payment_return_url( $order ) {
300
  global $wp;
301
  if ( isset( $wp->query_vars['order-pay'] ) ) {
302
  $url = $order->get_checkout_payment_url();
includes/abstract/abstract-wc-payment-gateway-stripe.php CHANGED
@@ -126,6 +126,11 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
126
  */
127
  public $processing_payment = false;
128
 
 
 
 
 
 
129
  public function __construct() {
130
  $this->token_key = $this->id . '_token_key';
131
  $this->saved_method_key = $this->id . '_saved_method_key';
@@ -366,7 +371,7 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
366
  if ( is_wp_error( $result ) ) {
367
  wc_add_notice( $this->is_active( 'generic_error' ) ? $this->get_generic_error( $result ) : $result->get_error_message(), 'error' );
368
 
369
- return $this->get_order_error();
370
  }
371
 
372
  if ( $result->complete_payment ) {
@@ -642,12 +647,16 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
642
  /**
643
  * Return a failed order response.
644
  *
 
 
645
  * @return array
646
  */
647
- public function get_order_error() {
648
  wc_stripe_set_checkout_error();
 
 
649
 
650
- return array( 'result' => WC_Stripe_Constants::FAILURE );
651
  }
652
 
653
  /**
@@ -684,7 +693,7 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
684
  * Return true of the customer is using a saved payment method.
685
  */
686
  public function use_saved_source() {
687
- return ( ! empty( $_POST[ $this->payment_type_key ] ) && $_POST[ $this->payment_type_key ] === 'saved' ) || $this->payment_method_token;
688
  }
689
 
690
  /**
@@ -701,6 +710,13 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
701
  }
702
 
703
  public function get_saved_source_id() {
 
 
 
 
 
 
 
704
  return ! empty( $_POST[ $this->saved_method_key ] ) ? $_POST[ $this->saved_method_key ] : $this->payment_method_token;
705
  }
706
 
@@ -997,7 +1013,7 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
997
  public function save_payment_method( $id, $order, $payment_details = null ) {
998
  if ( $payment_details ) {
999
  $token = $this->get_payment_token( $id, $payment_details );
1000
- $token->set_customer_id( wc_stripe_get_customer_id( $order->get_customer_id() ) );
1001
  } else {
1002
  $token = $this->create_payment_method( $id, wc_stripe_get_customer_id( $order->get_customer_id() ) );
1003
  if ( is_wp_error( $token ) ) {
126
  */
127
  public $processing_payment = false;
128
 
129
+ /**
130
+ * @var WP_Error
131
+ */
132
+ public $last_payment_error;
133
+
134
  public function __construct() {
135
  $this->token_key = $this->id . '_token_key';
136
  $this->saved_method_key = $this->id . '_saved_method_key';
371
  if ( is_wp_error( $result ) ) {
372
  wc_add_notice( $this->is_active( 'generic_error' ) ? $this->get_generic_error( $result ) : $result->get_error_message(), 'error' );
373
 
374
+ return $this->get_order_error( $result );
375
  }
376
 
377
  if ( $result->complete_payment ) {
647
  /**
648
  * Return a failed order response.
649
  *
650
+ * @param WP_Error $error
651
+ *
652
  * @return array
653
  */
654
+ public function get_order_error( $error = null ) {
655
  wc_stripe_set_checkout_error();
656
+ $this->last_payment_error = $error;
657
+ do_action( 'wc_stripe_process_payment_error', $error, $this );
658
 
659
+ return array( 'result' => WC_Stripe_Constants::FAILURE, 'redirect' => '' );
660
  }
661
 
662
  /**
693
  * Return true of the customer is using a saved payment method.
694
  */
695
  public function use_saved_source() {
696
+ return ( ! empty( $_POST[ $this->payment_type_key ] ) && $_POST[ $this->payment_type_key ] === 'saved' ) || $this->payment_method_token || ( ! empty( $_POST["wc-{$this->id}-payment-token"] ) );
697
  }
698
 
699
  /**
710
  }
711
 
712
  public function get_saved_source_id() {
713
+ // Check if Blocks are being used
714
+ if ( ! empty( $_POST["wc-{$this->id}-payment-token"] ) ) {
715
+ $token = WC_Payment_Tokens::get( wc_clean( $_POST["wc-{$this->id}-payment-token"] ) );
716
+
717
+ return $token->get_token();
718
+ }
719
+
720
  return ! empty( $_POST[ $this->saved_method_key ] ) ? $_POST[ $this->saved_method_key ] : $this->payment_method_token;
721
  }
722
 
1013
  public function save_payment_method( $id, $order, $payment_details = null ) {
1014
  if ( $payment_details ) {
1015
  $token = $this->get_payment_token( $id, $payment_details );
1016
+ $token->set_customer_id( wc_stripe_get_customer_id( $order->get_customer_id(), wc_stripe_order_mode( $order ) ) );
1017
  } else {
1018
  $token = $this->create_payment_method( $id, wc_stripe_get_customer_id( $order->get_customer_id() ) );
1019
  if ( is_wp_error( $token ) ) {
includes/admin/class-wc-stripe-admin-menus.php CHANGED
@@ -20,8 +20,8 @@ class WC_Stripe_Admin_Menus {
20
  }
21
 
22
  public static function sub_menu() {
23
- add_submenu_page( 'wc_stripe', __( 'Settings', 'woo-stripe-payment' ), __( 'Settings', 'woo-stripe-payment' ), 'manage_woocommerce', admin_url( 'admin.php?page=wc-settings&tab=checkout&section=stripe_api' ) );
24
- add_submenu_page( 'wc_stripe', __( 'Logs', 'woo-stripe-payment' ), __( 'Logs', 'woo-stripe-payment' ), 'manage_woocommerce', admin_url( 'admin.php?page=wc-status&tab=logs' ) );
25
  add_submenu_page( 'wc_stripe', __( 'Documentation', 'woo-stripe-payment' ), __( 'Documentation', 'woo-stripe-payment' ), 'manage_woocommerce', 'https://docs.paymentplugins.com/wc-stripe/config' );
26
  }
27
 
20
  }
21
 
22
  public static function sub_menu() {
23
+ add_submenu_page( 'wc_stripe', __( 'Settings', 'woo-stripe-payment' ), __( 'Settings', 'woo-stripe-payment' ), 'manage_woocommerce', 'admin.php?page=wc-settings&tab=checkout&section=stripe_api' );
24
+ add_submenu_page( 'wc_stripe', __( 'Logs', 'woo-stripe-payment' ), __( 'Logs', 'woo-stripe-payment' ), 'manage_woocommerce', 'admin.php?page=wc-status&tab=logs' );
25
  add_submenu_page( 'wc_stripe', __( 'Documentation', 'woo-stripe-payment' ), __( 'Documentation', 'woo-stripe-payment' ), 'manage_woocommerce', 'https://docs.paymentplugins.com/wc-stripe/config' );
26
  }
27
 
includes/admin/class-wc-stripe-admin-user-edit.php CHANGED
@@ -85,7 +85,6 @@ class WC_Stripe_Admin_User_Edit {
85
  'live' => $old_live_id !== wc_stripe_get_customer_id( $user_id, 'live' ),
86
  'test' => $old_test_id !== wc_stripe_get_customer_id( $user_id, 'test' ),
87
  );
88
- $gateway = WC_Stripe_Gateway::load();
89
 
90
  // this will prevent the payment method from being deleted in Stripe. We only want to remove the tokens
91
  // from the WC tables.
@@ -107,7 +106,9 @@ class WC_Stripe_Admin_User_Edit {
107
  }
108
  }
109
  // import payment methods from Stripe.
110
- WC_Stripe_Customer_Manager::sync_payment_methods( wc_stripe_get_customer_id( $user_id, $mode ), $user_id, $mode );
 
 
111
  }
112
  }
113
  }
85
  'live' => $old_live_id !== wc_stripe_get_customer_id( $user_id, 'live' ),
86
  'test' => $old_test_id !== wc_stripe_get_customer_id( $user_id, 'test' ),
87
  );
 
88
 
89
  // this will prevent the payment method from being deleted in Stripe. We only want to remove the tokens
90
  // from the WC tables.
106
  }
107
  }
108
  // import payment methods from Stripe.
109
+ if ( ( $customer_id = wc_stripe_get_customer_id( $user_id, $mode ) ) ) {
110
+ WC_Stripe_Customer_Manager::sync_payment_methods( $customer_id, $user_id, $mode );
111
+ }
112
  }
113
  }
114
  }
includes/class-stripe.php CHANGED
@@ -25,7 +25,7 @@ class WC_Stripe_Manager {
25
  *
26
  * @var string
27
  */
28
- public $version = '3.2.15';
29
 
30
  /**
31
  *
@@ -75,6 +75,7 @@ class WC_Stripe_Manager {
75
  add_action( 'init', array( $this, 'init' ) );
76
  add_action( 'admin_init', array( $this, 'admin_init' ) );
77
  add_action( 'woocommerce_init', array( $this, 'woocommerce_dependencies' ) );
 
78
  $this->includes();
79
  }
80
 
@@ -136,7 +137,6 @@ class WC_Stripe_Manager {
136
  }
137
  }
138
  }
139
-
140
  }
141
 
142
  /**
25
  *
26
  * @var string
27
  */
28
+ public $version = '3.3.0';
29
 
30
  /**
31
  *
75
  add_action( 'init', array( $this, 'init' ) );
76
  add_action( 'admin_init', array( $this, 'admin_init' ) );
77
  add_action( 'woocommerce_init', array( $this, 'woocommerce_dependencies' ) );
78
+ add_action( 'woocommerce_blocks_loaded', array( '\PaymentPlugins\Blocks\Stripe\Package', 'init' ) );
79
  $this->includes();
80
  }
81
 
137
  }
138
  }
139
  }
 
140
  }
141
 
142
  /**
includes/class-wc-stripe-api-operation.php CHANGED
@@ -1,134 +1,136 @@
1
- <?php
2
- defined( 'ABSPATH' ) || exit();
3
-
4
- /**
5
- * Used as a wrapper for API requests to Stripe.
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
-
15
- /**
16
- *
17
- * @var \Stripe\StripeClient
18
- */
19
- private $client;
20
-
21
- /**
22
- *
23
- * @var string
24
- */
25
- private $property;
26
-
27
- /**
28
- *
29
- * @var \Stripe\Service\AbstractService
30
- */
31
- private $service;
32
-
33
- /**
34
- *
35
- * @var WC_Stripe_Gateway
36
- */
37
- private $gateway;
38
-
39
- /**
40
- *
41
- * @var string
42
- */
43
- private $mode = '';
44
-
45
- /**
46
- *
47
- * @param WC_Stripe_Gateway $gateway
48
- * @param \Stripe\StripeClient $client
49
- * @param string $property
50
- *
51
- * @throws InvalidArgumentException
52
- */
53
- public function __construct( $gateway, $client, $property ) {
54
- $this->client = $client;
55
- $this->property = $property;
56
- $this->gateway = $gateway;
57
-
58
- $service = $this->client->__get( $property );
59
-
60
- if ( ! $service ) {
61
- throw new InvalidArgumentException( sprintf( 'Property %s is not a valid entry', $property ) );
62
- }
63
-
64
- $this->service = $service;
65
- }
66
-
67
- /**
68
- * Wrapper for Stripe API operations.
69
- * This way, all exceptions can be caught gracefully.
70
- *
71
- * @param string $method
72
- * @param array $args
73
- *
74
- * @throws InvalidArgumentException
75
- */
76
- public function __call( $method, $args ) {
77
- if ( ! method_exists( $this->service, $method ) ) {
78
- throw new InvalidArgumentException( sprintf( 'Method %s does not exist for class %s.', $method, get_class( $this->service ) ) );
79
- }
80
- $args = $this->parse_args( $args, $method );
81
- try {
82
- /**
83
- * Filters arguments before they are sent to the service for an API request.
84
- *
85
- * @param array $args The array of arguments that will be passed to the service method.
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
- *
89
- * @since 3.1.6
90
- */
91
- $args = apply_filters( 'wc_stripe_api_request_args', $args, $this->property, $method );
92
-
93
- return $this->service->{$method}( ...$args );
94
- } catch ( \Stripe\Exception\ApiErrorException $e ) {
95
- return $this->gateway->get_wp_error( $e, $this->property . '-error' );
96
- } catch ( \Stripe\Exception\UnexpectedValueException $e ) {
97
- return new WP_Error( 'stripe-error', $e->getMessage(), $e );
98
- }
99
- }
100
-
101
- /**
102
- *
103
- * @param string $mode
104
- *
105
- * @return $this
106
- */
107
- public function mode( $mode ) {
108
- $this->mode = $mode;
109
-
110
- return $this;
111
- }
112
-
113
- /**
114
- * Given an array of arguments, add method defaults to the array of args based on their existance.
115
- *
116
- * @param array $args
117
- * @param string $method
118
- */
119
- private function parse_args( $args, $method ) {
120
- $reflection_method = new ReflectionMethod( get_class( $this->service ), $method );
121
- $num_args = $reflection_method->getNumberOfParameters();
122
-
123
- // loop through each
124
- foreach ( $reflection_method->getParameters() as $parameter ) {
125
- if ( ! isset( $args[ $parameter->getPosition() ] ) && $parameter->isOptional() ) {
126
- $args[ $parameter->getPosition() ] = $parameter->getDefaultValue();
127
- }
128
- }
129
- // merge options
130
- $args[ $num_args - 1 ] = wp_parse_args( $args[ $num_args - 1 ], $this->gateway->get_api_options( $this->mode ) );
131
-
132
- return $args;
133
- }
134
- }
 
 
1
+ <?php
2
+ defined( 'ABSPATH' ) || exit();
3
+
4
+ /**
5
+ * Used as a wrapper for API requests to Stripe.
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
+
15
+ /**
16
+ *
17
+ * @var \Stripe\StripeClient
18
+ */
19
+ private $client;
20
+
21
+ /**
22
+ *
23
+ * @var string
24
+ */
25
+ private $property;
26
+
27
+ /**
28
+ *
29
+ * @var \Stripe\Service\AbstractService
30
+ */
31
+ private $service;
32
+
33
+ /**
34
+ *
35
+ * @var WC_Stripe_Gateway
36
+ */
37
+ private $gateway;
38
+
39
+ /**
40
+ *
41
+ * @var string
42
+ */
43
+ private $mode = '';
44
+
45
+ /**
46
+ *
47
+ * @param WC_Stripe_Gateway $gateway
48
+ * @param \Stripe\StripeClient $client
49
+ * @param string $property
50
+ *
51
+ * @throws InvalidArgumentException
52
+ */
53
+ public function __construct( $gateway, $client, $property ) {
54
+ $this->client = $client;
55
+ $this->property = $property;
56
+ $this->gateway = $gateway;
57
+
58
+ $service = $this->client->__get( $property );
59
+
60
+ if ( ! $service ) {
61
+ throw new InvalidArgumentException( sprintf( 'Property %s is not a valid entry', $property ) );
62
+ }
63
+
64
+ $this->service = $service;
65
+ }
66
+
67
+ /**
68
+ * Wrapper for Stripe API operations.
69
+ * This way, all exceptions can be caught gracefully.
70
+ *
71
+ * @param string $method
72
+ * @param array $args
73
+ *
74
+ * @throws InvalidArgumentException
75
+ */
76
+ public function __call( $method, $args ) {
77
+ if ( ! method_exists( $this->service, $method ) ) {
78
+ throw new InvalidArgumentException( sprintf( 'Method %s does not exist for class %s.', $method, get_class( $this->service ) ) );
79
+ }
80
+ $args = $this->parse_args( $args, $method );
81
+ try {
82
+ /**
83
+ * Filters arguments before they are sent to the service for an API request.
84
+ *
85
+ * @param array $args The array of arguments that will be passed to the service method.
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
+ *
89
+ * @since 3.1.6
90
+ */
91
+ $args = apply_filters( 'wc_stripe_api_request_args', $args, $this->property, $method );
92
+
93
+ return $this->service->{$method}( ...$args );
94
+ } catch ( \Stripe\Exception\ApiErrorException $e ) {
95
+ return $this->gateway->get_wp_error( $e, $this->property . '-error' );
96
+ } catch ( \Stripe\Exception\UnexpectedValueException $e ) {
97
+ return new WP_Error( 'stripe-error', $e->getMessage(), $e );
98
+ } catch ( \Stripe\Exception\InvalidArgumentException $e ) {
99
+ return new WP_Error( 'stripe-error', $e->getMessage(), $e );
100
+ }
101
+ }
102
+
103
+ /**
104
+ *
105
+ * @param string $mode
106
+ *
107
+ * @return $this
108
+ */
109
+ public function mode( $mode ) {
110
+ $this->mode = $mode;
111
+
112
+ return $this;
113
+ }
114
+
115
+ /**
116
+ * Given an array of arguments, add method defaults to the array of args based on their existance.
117
+ *
118
+ * @param array $args
119
+ * @param string $method
120
+ */
121
+ private function parse_args( $args, $method ) {
122
+ $reflection_method = new ReflectionMethod( get_class( $this->service ), $method );
123
+ $num_args = $reflection_method->getNumberOfParameters();
124
+
125
+ // loop through each
126
+ foreach ( $reflection_method->getParameters() as $parameter ) {
127
+ if ( ! isset( $args[ $parameter->getPosition() ] ) && $parameter->isOptional() ) {
128
+ $args[ $parameter->getPosition() ] = $parameter->getDefaultValue();
129
+ }
130
+ }
131
+ // merge options
132
+ $args[ $num_args - 1 ] = wp_parse_args( $args[ $num_args - 1 ], $this->gateway->get_api_options( $this->mode ) );
133
+
134
+ return $args;
135
+ }
136
+ }
includes/class-wc-stripe-frontend-scripts.php CHANGED
@@ -185,7 +185,7 @@ class WC_Stripe_Frontend_Scripts {
185
  }
186
 
187
  public function print_footer_scripts() {
188
- if ( is_checkout() && ! isset( $wp->query_vars['order_pay'] ) && ! is_order_received_page() ) {
189
  $available_gateways = array_keys( WC()->payment_gateways()->get_available_payment_gateways() );
190
  $gateways = array_filter( WC()->payment_gateways()->payment_gateways(), function ( $gateway ) use ( $available_gateways ) {
191
  return $gateway instanceof WC_Payment_Gateway_Stripe && $gateway->is_available() && ( ! in_array( $gateway->id, $available_gateways ) || ! $gateway->has_enqueued_scripts( $this ) );
185
  }
186
 
187
  public function print_footer_scripts() {
188
+ if ( is_checkout() && ! isset( $wp->query_vars['order_pay'] ) && ! is_order_received_page() && ! did_action( 'wc_stripe_blocks_enqueue_styles' ) ) {
189
  $available_gateways = array_keys( WC()->payment_gateways()->get_available_payment_gateways() );
190
  $gateways = array_filter( WC()->payment_gateways()->payment_gateways(), function ( $gateway ) use ( $available_gateways ) {
191
  return $gateway instanceof WC_Payment_Gateway_Stripe && $gateway->is_available() && ( ! in_array( $gateway->id, $available_gateways ) || ! $gateway->has_enqueued_scripts( $this ) );
includes/class-wc-stripe-payment-charge-local.php CHANGED
@@ -30,7 +30,7 @@ class WC_Stripe_Payment_Charge_Local extends WC_Stripe_Payment_Charge {
30
  }
31
 
32
  // update the source's metadata with the order id
33
- if ( 'chargeable' !== $source->status ) {
34
  $source = $this->gateway->sources->mode( wc_stripe_order_mode( $order ) )->update( $source_id, $this->payment_method->get_update_source_args( $order ) );
35
  }
36
  } else {
30
  }
31
 
32
  // update the source's metadata with the order id
33
+ if ( 'pending' === $source->status ) {
34
  $source = $this->gateway->sources->mode( wc_stripe_order_mode( $order ) )->update( $source_id, $this->payment_method->get_update_source_args( $order ) );
35
  }
36
  } else {
includes/class-wc-stripe-redirect-handler.php CHANGED
@@ -18,7 +18,7 @@ class WC_Stripe_Redirect_Handler {
18
  * Check if this request is for a local payment redirect.
19
  */
20
  public static function local_payment_redirect() {
21
- if ( isset( $_GET['_stripe_local_payment'], $_GET['key'] ) ) {
22
  self::process_redirect();
23
  }
24
  }
@@ -28,10 +28,10 @@ class WC_Stripe_Redirect_Handler {
28
  public static function process_redirect() {
29
  if ( isset( $_GET['source'] ) ) {
30
  $result = WC_Stripe_Gateway::load()->sources->retrieve( wc_clean( $_GET['source'] ) );
31
- $client_secret = $_GET['client_secret'];
32
  } else {
33
  $result = WC_Stripe_Gateway::load()->paymentIntents->retrieve( wc_clean( $_GET['payment_intent'] ) );
34
- $client_secret = $_GET['payment_intent_client_secret'];
35
  }
36
  if ( is_wp_error( $result ) ) {
37
  wc_add_notice( sprintf( __( 'Error retrieving payment source. Reason: %s', 'woo-stripe-payment' ), $result->get_error_message() ), 'error' );
18
  * Check if this request is for a local payment redirect.
19
  */
20
  public static function local_payment_redirect() {
21
+ if ( isset( $_GET['_stripe_local_payment'] ) ) {
22
  self::process_redirect();
23
  }
24
  }
28
  public static function process_redirect() {
29
  if ( isset( $_GET['source'] ) ) {
30
  $result = WC_Stripe_Gateway::load()->sources->retrieve( wc_clean( $_GET['source'] ) );
31
+ $client_secret = isset( $_GET['client_secret'] ) ? $_GET['client_secret'] : '';
32
  } else {
33
  $result = WC_Stripe_Gateway::load()->paymentIntents->retrieve( wc_clean( $_GET['payment_intent'] ) );
34
+ $client_secret = isset( $_GET['payment_intent_client_secret'] ) ? $_GET['payment_intent_client_secret'] : '';
35
  }
36
  if ( is_wp_error( $result ) ) {
37
  wc_add_notice( sprintf( __( 'Error retrieving payment source. Reason: %s', 'woo-stripe-payment' ), $result->get_error_message() ), 'error' );
includes/controllers/class-wc-stripe-controller-payment-intent.php CHANGED
@@ -17,7 +17,7 @@ class WC_Stripe_Controller_Payment_Intent extends WC_Stripe_Rest_Controller {
17
  $this->rest_uri(),
18
  'setup-intent',
19
  array(
20
- 'methods' => WP_REST_Server::READABLE,
21
  'permission_callback' => '__return_true',
22
  'callback' => array(
23
  $this,
17
  $this->rest_uri(),
18
  'setup-intent',
19
  array(
20
+ 'methods' => WP_REST_Server::CREATABLE,
21
  'permission_callback' => '__return_true',
22
  'callback' => array(
23
  $this,
includes/gateways/class-wc-payment-gateway-stripe-ach.php CHANGED
@@ -109,8 +109,6 @@ class WC_Payment_Gateway_Stripe_ACH extends WC_Payment_Gateway_Stripe {
109
  * @see WC_Payment_Gateway_Stripe_Charge::process_payment()
110
  */
111
  public function process_payment( $order_id ) {
112
- $order = wc_get_order( $order_id );
113
-
114
  // generate the access token first.
115
  if ( ! $this->use_saved_source() ) {
116
  try {
109
  * @see WC_Payment_Gateway_Stripe_Charge::process_payment()
110
  */
111
  public function process_payment( $order_id ) {
 
 
112
  // generate the access token first.
113
  if ( ! $this->use_saved_source() ) {
114
  try {
includes/gateways/class-wc-payment-gateway-stripe-cc.php CHANGED
@@ -82,7 +82,7 @@ class WC_Payment_Gateway_Stripe_CC extends WC_Payment_Gateway_Stripe {
82
  /**
83
  * @since 3.3.0
84
  */
85
- private function get_card_form_options() {
86
  $options = array(
87
  'style' => $this->get_form_style()
88
  );
@@ -94,7 +94,7 @@ class WC_Payment_Gateway_Stripe_CC extends WC_Payment_Gateway_Stripe {
94
  * @return mixed|void
95
  * @since 3.3.0
96
  */
97
- private function get_card_custom_field_options() {
98
  $style = $this->get_form_style();
99
  $options = array();
100
  foreach ( [ 'cardNumber', 'cardExpiry', 'cardCvc' ] as $key ) {
@@ -104,7 +104,7 @@ class WC_Payment_Gateway_Stripe_CC extends WC_Payment_Gateway_Stripe {
104
  return apply_filters( 'wc_stripe_get_card_custom_field_options', $options, $this );
105
  }
106
 
107
- private function get_form_style() {
108
  if ( $this->is_custom_form_active() ) {
109
  $style = $this->get_custom_form()['elementStyles'];
110
  } else {
@@ -127,11 +127,11 @@ class WC_Payment_Gateway_Stripe_CC extends WC_Payment_Gateway_Stripe {
127
  return apply_filters( 'wc_stripe_cc_element_style', $style, $this );
128
  }
129
 
130
- private function get_custom_form() {
131
  return wc_stripe_get_custom_forms()[ $this->get_option( 'custom_form' ) ];
132
  }
133
 
134
- private function get_element_options() {
135
  return $this->get_custom_form()['elementOptions'];
136
  }
137
 
82
  /**
83
  * @since 3.3.0
84
  */
85
+ public function get_card_form_options() {
86
  $options = array(
87
  'style' => $this->get_form_style()
88
  );
94
  * @return mixed|void
95
  * @since 3.3.0
96
  */
97
+ public function get_card_custom_field_options() {
98
  $style = $this->get_form_style();
99
  $options = array();
100
  foreach ( [ 'cardNumber', 'cardExpiry', 'cardCvc' ] as $key ) {
104
  return apply_filters( 'wc_stripe_get_card_custom_field_options', $options, $this );
105
  }
106
 
107
+ public function get_form_style() {
108
  if ( $this->is_custom_form_active() ) {
109
  $style = $this->get_custom_form()['elementStyles'];
110
  } else {
127
  return apply_filters( 'wc_stripe_cc_element_style', $style, $this );
128
  }
129
 
130
+ public function get_custom_form() {
131
  return wc_stripe_get_custom_forms()[ $this->get_option( 'custom_form' ) ];
132
  }
133
 
134
+ public function get_element_options() {
135
  return $this->get_custom_form()['elementOptions'];
136
  }
137
 
includes/gateways/class-wc-payment-gateway-stripe-payment-request.php CHANGED
@@ -83,19 +83,13 @@ class WC_Payment_Gateway_Stripe_Payment_Request extends WC_Payment_Gateway_Strip
83
  );
84
  }
85
 
86
- private function get_button_height() {
87
  $value = $this->get_option( 'button_height' );
88
  $value .= strpos( $value, 'px' ) === false ? 'px' : '';
89
 
90
  return $value;
91
  }
92
 
93
- private function get_icon_for_payment_request() {
94
- $user_agent = isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : '';
95
- if ( ! empty( $user_agent ) ) {
96
- }
97
- }
98
-
99
  public function has_enqueued_scripts( $scripts ) {
100
  return wp_script_is( $scripts->get_handle( 'payment-request' ) );
101
  }
83
  );
84
  }
85
 
86
+ public function get_button_height() {
87
  $value = $this->get_option( 'button_height' );
88
  $value .= strpos( $value, 'px' ) === false ? 'px' : '';
89
 
90
  return $value;
91
  }
92
 
 
 
 
 
 
 
93
  public function has_enqueued_scripts( $scripts ) {
94
  return wp_script_is( $scripts->get_handle( 'payment-request' ) );
95
  }
includes/gateways/class-wc-payment-gateway-stripe-sepa.php CHANGED
@@ -87,13 +87,4 @@ class WC_Payment_Gateway_Stripe_Sepa extends WC_Payment_Gateway_Stripe_Local_Pay
87
  return __( 'Saved Accounts', 'woo-stripe-payment' );
88
  }
89
 
90
- /*public function get_tokens() {
91
- // always return an empty array if this is the checkout page because
92
- // saved SEPA src's can only be used for the amount specified at source creation.
93
- if ( is_checkout() ) {
94
- return array();
95
- }
96
-
97
- return parent::get_tokens();
98
- }*/
99
  }
87
  return __( 'Saved Accounts', 'woo-stripe-payment' );
88
  }
89
 
 
 
 
 
 
 
 
 
 
90
  }
includes/wc-stripe-functions.php CHANGED
@@ -1215,10 +1215,8 @@ function wc_stripe_get_error_messages() {
1215
  'insufficient_funds' => __( 'The card has insufficient funds to complete the purchase.', 'woo-stripe-payment' ),
1216
  'empty_element' => __( 'Please select a payment method before proceeding.', 'woo-stripe-payment' ),
1217
  'empty_element_sepa_debit' => __( 'Please enter your IBAN before proceeding.', 'woo-stripe-payment' ),
1218
- 'empty_element_ideal' => __(
1219
- 'Please select a bank before proceeding',
1220
- 'woo-stripe-payment'
1221
- ),
1222
  )
1223
  );
1224
  }
1215
  'insufficient_funds' => __( 'The card has insufficient funds to complete the purchase.', 'woo-stripe-payment' ),
1216
  'empty_element' => __( 'Please select a payment method before proceeding.', 'woo-stripe-payment' ),
1217
  'empty_element_sepa_debit' => __( 'Please enter your IBAN before proceeding.', 'woo-stripe-payment' ),
1218
+ 'empty_element_ideal' => __( 'Please select a bank before proceeding', 'woo-stripe-payment' ),
1219
+ 'incomplete_iban' => __( 'The IBAN you entered is incomplete.', 'woo-stripe-payment' )
 
 
1220
  )
1221
  );
1222
  }
packages/blocks/assets/css/style.scss ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .wc-stripe-express__sm {
2
+ li {
3
+ &[id^=express-payment-method-stripe_] {
4
+ width: 100%;
5
+ padding-right: 0 !important;
6
+ padding-left: 0 !important;
7
+ }
8
+
9
+ &[id^=express-payment-method-stripe_] {
10
+ &:nth-child(n + 2) {
11
+ margin-top: 10px;
12
+ }
13
+ }
14
+ }
15
+ }
16
+
17
+ ul {
18
+ &:not(.wc-stripe-express__sm) {
19
+ li {
20
+ &[id^=express-payment-method-stripe_] {
21
+ &:nth-child(n + 3) {
22
+ margin-top: 10px;
23
+ }
24
+ }
25
+ }
26
+ }
27
+ }
packages/blocks/assets/img/apple_pay_button.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" height="800" width="1200" viewBox="-76.79115 -52.55 665.5233 315.3"><path d="M93.541 27.1c-6 7.1-15.6 12.7-25.2 11.9-1.2-9.6 3.5-19.8 9-26.1 6-7.3 16.5-12.5 25-12.9 1 10-2.9 19.8-8.8 27.1m8.7 13.8c-13.9-.8-25.8 7.9-32.4 7.9-6.7 0-16.8-7.5-27.8-7.3-14.3.2-27.6 8.3-34.9 21.2-15 25.8-3.9 64 10.6 85 7.1 10.4 15.6 21.8 26.8 21.4 10.6-.4 14.8-6.9 27.6-6.9 12.9 0 16.6 6.9 27.8 6.7 11.6-.2 18.9-10.4 26-20.8 8.1-11.8 11.4-23.3 11.6-23.9-.2-.2-22.4-8.7-22.6-34.3-.2-21.4 17.5-31.6 18.3-32.2-10-14.8-25.6-16.4-31-16.8m80.3-29v155.9h24.2v-53.3h33.5c30.6 0 52.1-21 52.1-51.4s-21.1-51.2-51.3-51.2zm24.2 20.4h27.9c21 0 33 11.2 33 30.9s-12 31-33.1 31h-27.8zm129.8 136.7c15.2 0 29.3-7.7 35.7-19.9h.5v18.7h22.4V90.2c0-22.5-18-37-45.7-37-25.7 0-44.7 14.7-45.4 34.9h21.8c1.8-9.6 10.7-15.9 22.9-15.9 14.8 0 23.1 6.9 23.1 19.6v8.6l-30.2 1.8c-28.1 1.7-43.3 13.2-43.3 33.2 0 20.2 15.7 33.6 38.2 33.6zm6.5-18.5c-12.9 0-21.1-6.2-21.1-15.7 0-9.8 7.9-15.5 23-16.4l26.9-1.7v8.8c0 14.6-12.4 25-28.8 25zm82 59.7c23.6 0 34.7-9 44.4-36.3l42.5-119.2h-24.6l-28.5 92.1h-.5l-28.5-92.1h-25.3l41 113.5-2.2 6.9c-3.7 11.7-9.7 16.2-20.4 16.2-1.9 0-5.6-.2-7.1-.4v18.7c1.4.4 7.4.6 9.2.6z"/></svg>
packages/blocks/assets/img/apple_pay_button_black.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" height="800" width="1200" viewBox="-76.79115 -52.55 665.5233 315.3"><path d="M93.541 27.1c-6 7.1-15.6 12.7-25.2 11.9-1.2-9.6 3.5-19.8 9-26.1 6-7.3 16.5-12.5 25-12.9 1 10-2.9 19.8-8.8 27.1m8.7 13.8c-13.9-.8-25.8 7.9-32.4 7.9-6.7 0-16.8-7.5-27.8-7.3-14.3.2-27.6 8.3-34.9 21.2-15 25.8-3.9 64 10.6 85 7.1 10.4 15.6 21.8 26.8 21.4 10.6-.4 14.8-6.9 27.6-6.9 12.9 0 16.6 6.9 27.8 6.7 11.6-.2 18.9-10.4 26-20.8 8.1-11.8 11.4-23.3 11.6-23.9-.2-.2-22.4-8.7-22.6-34.3-.2-21.4 17.5-31.6 18.3-32.2-10-14.8-25.6-16.4-31-16.8m80.3-29v155.9h24.2v-53.3h33.5c30.6 0 52.1-21 52.1-51.4s-21.1-51.2-51.3-51.2zm24.2 20.4h27.9c21 0 33 11.2 33 30.9s-12 31-33.1 31h-27.8zm129.8 136.7c15.2 0 29.3-7.7 35.7-19.9h.5v18.7h22.4V90.2c0-22.5-18-37-45.7-37-25.7 0-44.7 14.7-45.4 34.9h21.8c1.8-9.6 10.7-15.9 22.9-15.9 14.8 0 23.1 6.9 23.1 19.6v8.6l-30.2 1.8c-28.1 1.7-43.3 13.2-43.3 33.2 0 20.2 15.7 33.6 38.2 33.6zm6.5-18.5c-12.9 0-21.1-6.2-21.1-15.7 0-9.8 7.9-15.5 23-16.4l26.9-1.7v8.8c0 14.6-12.4 25-28.8 25zm82 59.7c23.6 0 34.7-9 44.4-36.3l42.5-119.2h-24.6l-28.5 92.1h-.5l-28.5-92.1h-25.3l41 113.5-2.2 6.9c-3.7 11.7-9.7 16.2-20.4 16.2-1.9 0-5.6-.2-7.1-.4v18.7c1.4.4 7.4.6 9.2.6z" fill="#fff"/></svg>
packages/blocks/assets/img/gpay_button_black.svg ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" id="Layer_1" data-name="Layer 1" viewBox="85.51 15 319 80">
2
+ <defs>
3
+ <style>
4
+ .cls-1{fill:#fff;}.cls-2{fill:#4285f4;}.cls-3{fill:#34a853;}.cls-4{fill:#fabb05;}.cls-5{fill:#e94235;}.cls-6{fill:none;}
5
+ </style>
6
+ </defs>
7
+ <path d="M395.51,95h-301a9,9,0,0,1-9-9V24a9,9,0,0,1,9-9h301a9,9,0,0,1,9,9V86a9,9,0,0,1-9,9"/>
8
+ <path class="cls-1" d="M242.29,54.56V64h-3V40.7h7.94a7.16,7.16,0,0,1,5.13,2,6.73,6.73,0,0,1,0,9.86,7.17,7.17,0,0,1-5.13,2h-4.94Zm0-11v8.12h5a4,4,0,0,0,3-1.2,3.93,3.93,0,0,0,1.2-2.85,4.15,4.15,0,0,0-4.17-4h-5Z"/>
9
+ <path class="cls-1" d="M262.34,47.53a7.38,7.38,0,0,1,5.24,1.78,6.3,6.3,0,0,1,1.92,4.86V64h-2.86V61.78h-.12a5.67,5.67,0,0,1-4.94,2.73A6.41,6.41,0,0,1,257.16,63a5,5,0,0,1-1.77-3.9,4.71,4.71,0,0,1,1.87-3.93,7.84,7.84,0,0,1,5-1.46,8.77,8.77,0,0,1,4.38,1V54a3.44,3.44,0,0,0-1.23-2.66,4.26,4.26,0,0,0-2.9-1.09,4.54,4.54,0,0,0-4,2.12l-2.64-1.65a7.32,7.32,0,0,1,6.44-3.15M258.47,59.1a2.36,2.36,0,0,0,1,1.95,3.65,3.65,0,0,0,2.32.78,4.76,4.76,0,0,0,3.37-1.4,4.39,4.39,0,0,0,1.48-3.29A6.1,6.1,0,0,0,262.75,56a5.15,5.15,0,0,0-3,.87,2.66,2.66,0,0,0-1.24,2.2"/>
10
+ <polygon class="cls-1" points="285.78 48.05 275.8 71 272.71 71 276.42 62.97 269.84 48.05 273.1 48.05 277.84 59.49 277.9 59.49 282.52 48.05 285.78 48.05"/>
11
+ <path class="cls-2" d="M230.38,52.66a16,16,0,0,0-.25-2.81H217.58V55h7.23a6.24,6.24,0,0,1-2.69,4.15v3.33h4.31a13.07,13.07,0,0,0,3.95-9.82"/>
12
+ <path class="cls-3" d="M222.12,59.15a8.08,8.08,0,0,1-4.54,1.28,8,8,0,0,1-7.5-5.52h-4.44v3.44a13.35,13.35,0,0,0,11.94,7.36,12.72,12.72,0,0,0,8.85-3.23Z"/>
13
+ <path class="cls-4" d="M209.66,52.36a8.08,8.08,0,0,1,.42-2.56V46.36h-4.44a13.39,13.39,0,0,0,0,12l4.44-3.45a8,8,0,0,1-.42-2.55"/>
14
+ <path class="cls-5" d="M217.58,44.29a7.26,7.26,0,0,1,5.13,2l3.81-3.81A12.84,12.84,0,0,0,217.58,39a13.35,13.35,0,0,0-11.94,7.36l4.44,3.44a8,8,0,0,1,7.5-5.51"/>
15
+ <rect class="cls-6" width="490" height="110"/>
16
+ </svg>
packages/blocks/assets/img/gpay_button_buy_black.svg ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" id="Layer_1" data-name="Layer 1" viewBox="5.26 14.74 479.5 80.5">
2
+ <defs>
3
+ <style>
4
+ .cls-1{fill:#fff;}.cls-2{fill:#4285f4;}.cls-3{fill:#34a853;}.cls-4{fill:#fabb05;}.cls-5{fill:#e94235;}.cls-6{fill:none;}
5
+ </style>
6
+ </defs>
7
+ <path d="M475.26,94.74h-461a9,9,0,0,1-9-9v-62a9,9,0,0,1,9-9h461a9,9,0,0,1,9,9v62a9,9,0,0,1-9,9"/>
8
+ <path d="M475.76,95.24h-461a9,9,0,0,1-9-9v-62a9,9,0,0,1,9-9h461a9,9,0,0,1,9,9v62a9,9,0,0,1-9,9"/>
9
+ <path class="cls-1" d="M141.16,42.84h7.77a6.75,6.75,0,0,1,3.08.73,5.69,5.69,0,0,1,2.24,2,5,5,0,0,1,.83,2.79,4.75,4.75,0,0,1-.77,2.69,5,5,0,0,1-2,1.75v.15a5.2,5.2,0,0,1,2.58,1.82,4.89,4.89,0,0,1,1,3,5.32,5.32,0,0,1-.89,3,6,6,0,0,1-2.38,2.06,7.26,7.26,0,0,1-3.26.74h-8.12Zm7.63,8.73a3.11,3.11,0,0,0,2.32-.88,2.83,2.83,0,0,0,.87-2,2.76,2.76,0,0,0-.86-2,3,3,0,0,0-2.22-.86h-4.55v5.8Zm.49,9.08a3.26,3.26,0,0,0,2.42-.91,3.06,3.06,0,0,0,0-4.4,3.41,3.41,0,0,0-2.51-.92h-4.81v6.23Z"/>
10
+ <path class="cls-1" d="M160.08,62.46a6.55,6.55,0,0,1-1.4-4.48V48.82h3.13v8.73a3.92,3.92,0,0,0,.84,2.72,2.89,2.89,0,0,0,2.26.93,3.57,3.57,0,0,0,2.06-.61A3.9,3.9,0,0,0,168.35,59a5.1,5.1,0,0,0,.48-2.21V48.82h3.1V63.61H169v-2h-.17a5,5,0,0,1-1.92,1.77,5.7,5.7,0,0,1-2.75.69A5.11,5.11,0,0,1,160.08,62.46Z"/>
11
+ <path class="cls-1" d="M180.19,62.8l-6.17-14h3.48l4.23,10.09h.15L186,48.82h3.46l-9.14,21.05H177Z"/>
12
+ <path class="cls-1" d="M196.61,48.82H200l3.05,10.64h.11l3.34-10.64h3.22l3.33,10.64h.12l3-10.64h3.34l-4.76,14.79h-3.28l-3.42-10.7H208l-3.4,10.7h-3.25Z"/>
13
+ <path class="cls-1" d="M221.88,46a2,2,0,0,1-.62-1.49,2,2,0,0,1,.62-1.48,2,2,0,0,1,1.49-.61,2.07,2.07,0,0,1,1.5.61,2,2,0,0,1,.62,1.48,2.12,2.12,0,0,1-2.12,2.11A2,2,0,0,1,221.88,46Zm-.07,2.8h3.13V63.61h-3.13Z"/>
14
+ <path class="cls-1" d="M232.9,63.76a3.71,3.71,0,0,1-1.41-.87,4.57,4.57,0,0,1-1.24-3.43V51.54h-2.58V48.82h2.58V44.64h3.13v4.18H237v2.72h-3.62v7.29a2.59,2.59,0,0,0,.46,1.75,1.88,1.88,0,0,0,1.51.56,2.67,2.67,0,0,0,.9-.13,3.64,3.64,0,0,0,.84-.42v3a5.8,5.8,0,0,1-2.35.43A5.27,5.27,0,0,1,232.9,63.76Z"/>
15
+ <path class="cls-1" d="M240.19,42.84h3.14v5.69l-.18,2.32h.18a4.66,4.66,0,0,1,1.9-1.8,5.67,5.67,0,0,1,2.77-.7A5.2,5.2,0,0,1,252.11,50a6.28,6.28,0,0,1,1.42,4.31v9.34h-3.1V54.68a3.42,3.42,0,0,0-.91-2.59,3.5,3.5,0,0,0-4.29-.24,4.26,4.26,0,0,0-1.4,1.67,5.06,5.06,0,0,0-.5,2.2v7.89h-3.14Z"/>
16
+ <path class="cls-1" d="M305.15,54.31v9.44h-3V40.45h7.94a7.17,7.17,0,0,1,5.13,2,6.73,6.73,0,0,1,0,9.86,7.18,7.18,0,0,1-5.13,2h-5Zm0-11v8.12h5a4,4,0,0,0,3-1.2,3.89,3.89,0,0,0,1.2-2.85,4.15,4.15,0,0,0-4.16-4h-5Z"/>
17
+ <path class="cls-1" d="M325.21,47.28a7.4,7.4,0,0,1,5.24,1.78,6.3,6.3,0,0,1,1.92,4.86v9.83h-2.86V61.53h-.12a5.7,5.7,0,0,1-4.95,2.73A6.4,6.4,0,0,1,320,62.7a5,5,0,0,1-1.78-3.9,4.74,4.74,0,0,1,1.87-3.93,7.88,7.88,0,0,1,5-1.46,8.81,8.81,0,0,1,4.39,1v-.68a3.42,3.42,0,0,0-1.24-2.66,4.22,4.22,0,0,0-2.9-1.09,4.55,4.55,0,0,0-4,2.12l-2.63-1.65a7.32,7.32,0,0,1,6.44-3.15m-3.87,11.57a2.36,2.36,0,0,0,1,1.95,3.61,3.61,0,0,0,2.32.78,4.77,4.77,0,0,0,3.37-1.4,4.42,4.42,0,0,0,1.48-3.29,6.12,6.12,0,0,0-3.9-1.11,5.17,5.17,0,0,0-3,.87,2.68,2.68,0,0,0-1.23,2.2"/>
18
+ <polygon class="cls-1" points="348.65 47.8 338.67 70.75 335.58 70.75 339.29 62.72 332.71 47.8 335.97 47.8 340.71 59.24 340.77 59.24 345.39 47.8 348.65 47.8"/>
19
+ <path class="cls-2" d="M293.24,52.41A15.07,15.07,0,0,0,293,49.6H280.44v5.15h7.23A6.23,6.23,0,0,1,285,58.9v3.33h4.3a13.07,13.07,0,0,0,3.95-9.82"/>
20
+ <path class="cls-3" d="M285,58.9a8.1,8.1,0,0,1-4.54,1.28,8,8,0,0,1-7.5-5.52h-4.44V58.1a13.34,13.34,0,0,0,11.94,7.36,12.7,12.7,0,0,0,8.84-3.23Z"/>
21
+ <path class="cls-4" d="M272.53,52.11a8.08,8.08,0,0,1,.42-2.56V46.11h-4.44a13.39,13.39,0,0,0,0,12L273,54.66a8,8,0,0,1-.42-2.55"/>
22
+ <path class="cls-5" d="M280.45,44a7.22,7.22,0,0,1,5.12,2l3.82-3.81a12.84,12.84,0,0,0-8.94-3.48,13.35,13.35,0,0,0-11.94,7.36L273,49.55a8,8,0,0,1,7.5-5.51"/>
23
+ <rect class="cls-6" width="490" height="110"/>
24
+ </svg>
packages/blocks/assets/js/components/checkout/checkbox/index.js ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import classNames from 'classnames';
2
+ import './styles.scss';
3
+
4
+ export const SavePaymentMethod = ({label, onChange, checked}) => {
5
+ return (
6
+ <div className='wc-stripe-save-payment-method'>
7
+ <label>
8
+ <input type='checkbox' onChange={(e) => onChange(e.target.checked)}/>
9
+ <svg
10
+ className={classNames('wc-stripe-components-checkbox__mark', {checked: checked})}
11
+ aria-hidden="true"
12
+ xmlns="http://www.w3.org/2000/svg"
13
+ viewBox="0 0 24 20">
14
+ <path d="M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"/>
15
+ </svg>
16
+ </label>
17
+ <span>{label}</span>
18
+ </div>
19
+ )
20
+ }
packages/blocks/assets/js/components/checkout/checkbox/styles.scss ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .wc-stripe-save-payment-method {
2
+ display: flex;
3
+ flex-wrap: wrap;
4
+ align-items: center;
5
+ margin-top: 1em;
6
+
7
+ input[type="checkbox"] {
8
+ position: absolute;
9
+ opacity: 0;
10
+ width: 20px;
11
+ height: 20px;
12
+
13
+ &:checked {
14
+ + svg {
15
+ display: block;
16
+ height: auto;
17
+ }
18
+ }
19
+ }
20
+
21
+ span {
22
+ margin-left: 5px;
23
+ }
24
+
25
+ label {
26
+ width: 20px;
27
+ height: 20px;
28
+ position: relative;
29
+ background-color: white;
30
+ display: block;
31
+ border-radius: 3px;
32
+ border: 1px solid #bababa;
33
+ margin: 0;
34
+ padding: 0;
35
+ }
36
+
37
+ svg {
38
+ display: none;
39
+ }
40
+ }
packages/blocks/assets/js/components/checkout/index.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ export * from './payment-method-label';
2
+ export * from './checkbox';
3
+ export * from './radio-option';
4
+ export * from './payment-method';
packages/blocks/assets/js/components/checkout/payment-method-label/index.js ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import './style.scss';
2
+
3
+ export const PaymentMethodLabel = ({title, icons, paymentMethod, ...props}) => {
4
+ const {PaymentMethodLabel: Label, PaymentMethodIcons: Icons} = props.components;
5
+ if (!Array.isArray(icons)) {
6
+ icons = [icons];
7
+ }
8
+ return (
9
+ <span className={`wc-stripe-label-container ${paymentMethod}`}>
10
+ <Label text={title}/>
11
+ <Icons icons={icons} align='left'/>
12
+ </span>
13
+ )
14
+ }
packages/blocks/assets/js/components/checkout/payment-method-label/style.scss ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .wc-stripe-label-container {
2
+ display: flex;
3
+ align-items: center;
4
+ flex-wrap: wrap;
5
+
6
+ .wc-block-components-payment-method-label {
7
+ flex: 0 1 auto;
8
+ }
9
+
10
+ .wc-block-components-payment-method-icons {
11
+ display: flex;
12
+ flex: 1 1 auto;
13
+ justify-content: flex-end;
14
+ }
15
+ }
packages/blocks/assets/js/components/checkout/payment-method/index.js ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {useState, useEffect, useRef} from '@wordpress/element';
2
+
3
+ export const PaymentMethod = ({getData, content, ...props}) => {
4
+ const Content = content;
5
+ const desc = getData('description');
6
+ const el = useRef(null);
7
+ useEffect(() => {
8
+ if (el.current && el.current.childNodes.length == 0) {
9
+ el.current.classList.add('no-content');
10
+ }
11
+ });
12
+ return (
13
+ <>
14
+ {desc && <Description desc={desc} payment_method={getData('name')}/>}
15
+ <div ref={el} className='wc-stripe-blocks-payment-method-content'>
16
+ <Content {...{...props, getData}}/>
17
+ </div>
18
+ </>);
19
+ }
20
+
21
+ const Description = ({desc, payment_method}) => {
22
+ return (
23
+ <div className={`wc-stripe-blocks-payment-method__desc ${payment_method}`}>
24
+ <span>{desc}</span>
25
+ </div>
26
+ )
27
+ }
packages/blocks/assets/js/components/checkout/payment-method/styles.scss ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ .wc-stripe-blocks-payment-method__desc {
2
+ + .wc-stripe-blocks-payment-method-content {
3
+ margin-top: 10px;
4
+
5
+ &.no-content {
6
+ margin-top: 0;
7
+ }
8
+ }
9
+ }
packages/blocks/assets/js/components/checkout/radio-control-accordion/index.js ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import RadioControlOption from '../radio-option';
2
+ import classnames from 'classnames';
3
+
4
+ export const RadioControlAccordion = ({option, checked, onChange}) => {
5
+ const {label, value} = option;
6
+ return (
7
+ <div className='wc-stripe-blocks-radio-accordion'>
8
+ <RadioControlOption checked={checked} onChange={onChange} value={value} label={label}/>
9
+ <div
10
+ className={classnames('wc-stripe-blocks-radio-accordion__content', {
11
+ 'wc-stripe-blocks-radio-accordion__content-visible': checked
12
+ })}>
13
+ {option.content}
14
+ </div>
15
+ </div>
16
+
17
+ )
18
+ }
19
+
20
+ export default RadioControlAccordion;
packages/blocks/assets/js/components/checkout/radio-control-accordion/styles.scss ADDED
File without changes
packages/blocks/assets/js/components/checkout/radio-option/index.js ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import classnames from 'classnames';
2
+
3
+ export const RadioControlOption = ({checked, onChange, value, label}) => {
4
+ return (
5
+ <label
6
+ className={classnames('wc-stripe-blocks-radio-control__option', {
7
+ 'wc-stripe-blocks-radio-control__option-checked': checked
8
+ })}>
9
+ <input
10
+ className='wc-stripe-blocks-radio-control__input'
11
+ type='radio'
12
+ value={value}
13
+ checked={checked}
14
+ onChange={(event) => onChange(event.target.value)}/>
15
+ <div className='wc-stripe-blocks-radio-control__label'>
16
+ <span>{label}</span>
17
+ </div>
18
+ </label>
19
+ )
20
+ }
21
+
22
+ export default RadioControlOption;
packages/blocks/assets/js/components/checkout/radio-option/styles.scss ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .wc-stripe-blocks-radio-control__option {
2
+ display: flex;
3
+ align-items: center;
4
+
5
+ .wc-stripe-blocks-radio-control__label {
6
+ margin-left: 10px;
7
+ }
8
+
9
+ .wc-stripe-blocks-radio-control__input {
10
+ appearance: none;
11
+ -webkit-appearance: none;
12
+ -moz-appearance: none;
13
+ min-width: 15px;
14
+ min-height: 15px;
15
+ background: #fff;
16
+ border: 2px solid #50575e;
17
+ border-radius: 50%;
18
+ display: inline-block;
19
+ position: relative;
20
+
21
+ &:checked {
22
+ &:before {
23
+ background: #000;
24
+ border-radius: 50%;
25
+ content: "";
26
+ display: block;
27
+ left: 50%;
28
+ min-width: 8px;
29
+ min-height: 8px;
30
+ position: absolute;
31
+ top: 50%;
32
+ transform: translate(-50%, -50%);
33
+ }
34
+ }
35
+ }
36
+ }
packages/blocks/assets/js/payment-methods/ach/hooks/index.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ export * from './use-create-link-token';
2
+ export * from './use-initialize-plaid';
3
+ export * from './use-process-payment';
packages/blocks/assets/js/payment-methods/ach/hooks/use-create-link-token.js ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {useEffect, useState, useCallback} from '@wordpress/element';
2
+ import apiFetch from '@wordpress/api-fetch';
3
+ import {getRoute, getFromCache, storeInCache} from '../../util';
4
+
5
+ export const useCreateLinkToken = (
6
+ {
7
+ setValidationError
8
+ }) => {
9
+ const [linkToken, setLinkToken] = useState(false);
10
+
11
+ const createToken = useCallback(async () => {
12
+ try {
13
+ const response = await apiFetch({
14
+ url: getRoute('create/linkToken'),
15
+ method: 'POST',
16
+ data: {}
17
+ });
18
+ if (response.token) {
19
+ storeInCache('linkToken', response.token);
20
+ setLinkToken(response.token);
21
+ }
22
+ } catch (err) {
23
+ setValidationError(err);
24
+ }
25
+ }, []);
26
+
27
+ useEffect(() => {
28
+ if (!linkToken) {
29
+ const token = getFromCache('linkToken');
30
+ if (token) {
31
+ // cached token exist so use it
32
+ setLinkToken(token);
33
+ } else {
34
+ // create the Plaid Link token
35
+ createToken();
36
+ }
37
+ }
38
+ }, [
39
+ linkToken,
40
+ setLinkToken
41
+ ]);
42
+ return linkToken;
43
+ }
packages/blocks/assets/js/payment-methods/ach/hooks/use-initialize-plaid.js ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {useState, useEffect, useRef, useCallback} from '@wordpress/element';
2
+ import Plaid from '@plaid';
3
+ import {getErrorMessage} from "../../util";
4
+
5
+ export const useInitializePlaid = (
6
+ {
7
+ getData,
8
+ linkToken
9
+ }) => {
10
+ const linkHandler = useRef(null);
11
+ const resolvePopup = useRef(null);
12
+ const openLinkPopup = useCallback(() => new Promise((resolve, reject) => {
13
+ resolvePopup.current = {resolve, reject};
14
+ linkHandler.current.open();
15
+ }), []);
16
+
17
+ // if the token exists, initialize Plaid's link handler
18
+ useEffect(() => {
19
+ if (linkToken) {
20
+ linkHandler.current = Plaid.create({
21
+ clientName: getData('clientName'),
22
+ env: getData('plaidEnvironment'),
23
+ product: ['auth'],
24
+ token: linkToken,
25
+ selectAccount: true,
26
+ countryCodes: ['US'],
27
+ onSuccess: (publicToken, metaData) => {
28
+ resolvePopup.current.resolve({publicToken, metaData});
29
+ },
30
+ onExit: (err) => {
31
+ resolvePopup.current.reject(err ? getErrorMessage(err.error_message) : false);
32
+ }
33
+ });
34
+ }
35
+ }, [linkToken]);
36
+
37
+ return openLinkPopup;
38
+ }
packages/blocks/assets/js/payment-methods/ach/hooks/use-process-payment.js ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {useEffect, useCallback} from '@wordpress/element';
2
+ import {ensureSuccessResponse, ensureErrorResponse, deleteFromCache} from "../../util";
3
+
4
+ export const useProcessPayment = (
5
+ {
6
+ openLinkPopup,
7
+ onPaymentProcessing,
8
+ responseTypes,
9
+ paymentMethod
10
+
11
+ }) => {
12
+
13
+ useEffect(() => {
14
+ const unsubscribe = onPaymentProcessing(async () => {
15
+ try {
16
+ // open the Plaid popup
17
+ const result = await openLinkPopup();
18
+ const {publicToken, metaData} = result;
19
+ // remove the cached link token.
20
+ deleteFromCache('linkToken');
21
+ return ensureSuccessResponse(responseTypes, {
22
+ meta: {
23
+ paymentMethodData: {
24
+ [`${paymentMethod}_token_key`]: publicToken,
25
+ [`${paymentMethod}_metadata`]: JSON.stringify(metaData)
26
+ }
27
+ }
28
+ });
29
+ } catch (err) {
30
+ return ensureErrorResponse(responseTypes, err);
31
+ }
32
+ });
33
+ return () => unsubscribe();
34
+ }, [
35
+ onPaymentProcessing,
36
+ responseTypes,
37
+ openLinkPopup
38
+ ]);
39
+ }
packages/blocks/assets/js/payment-methods/ach/index.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ import './styles.scss';
2
+ import './payment-method'
packages/blocks/assets/js/payment-methods/ach/payment-method.js ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {useState} from '@wordpress/element';
2
+ import {registerPaymentMethod} from '@woocommerce/blocks-registry';
3
+ import {getSettings, isTestMode} from '../util';
4
+ import {PaymentMethodLabel, PaymentMethod} from '../../components/checkout';
5
+ import SavedCardComponent from '../saved-card-component';
6
+ import {useCreateLinkToken, useInitializePlaid, useProcessPayment} from './hooks';
7
+ import {useProcessCheckoutError} from "../hooks";
8
+ import {__} from '@wordpress/i18n';
9
+
10
+ const getData = getSettings('stripe_ach_data');
11
+
12
+ const ACHPaymentContent = (
13
+ {
14
+ getData,
15
+ eventRegistration,
16
+ components,
17
+ emitResponse,
18
+ onSubmit,
19
+ ...props
20
+ }) => {
21
+ const {responseTypes} = emitResponse;
22
+ const {onPaymentProcessing, onCheckoutAfterProcessingWithError} = eventRegistration;
23
+ const {ValidationInputError} = components;
24
+ const [validationError, setValidationError] = useState(false);
25
+
26
+ const linkToken = useCreateLinkToken({setValidationError});
27
+
28
+ useProcessCheckoutError({
29
+ responseTypes,
30
+ subscriber: onCheckoutAfterProcessingWithError
31
+ });
32
+
33
+ const openLinkPopup = useInitializePlaid({
34
+ getData,
35
+ linkToken,
36
+ onSubmit
37
+ });
38
+
39
+ useProcessPayment({
40
+ openLinkPopup,
41
+ onPaymentProcessing,
42
+ responseTypes,
43
+ paymentMethod: getData('name')
44
+ });
45
+ return (
46
+ <>
47
+ {isTestMode && <ACHTestModeCredentials/>}
48
+ {validationError && <ValidationInputError errorMessage={validationError}/>}
49
+ </>
50
+ )
51
+ }
52
+
53
+ const ACHTestModeCredentials = () => {
54
+ return (
55
+ <div className='wc-stripe-blocks-ach__creds'>
56
+ <label className='wc-stripe-blocks-ach__creds-label'>{__('Test Credentials', 'woo-stripe-payment')}</label>
57
+ <div className='wc-stripe-blocks-ach__username'>
58
+ <div>
59
+ <strong>{__('username', 'woo-stripe-payment')}</strong>: user_good
60
+ </div>
61
+ <div>
62
+ <strong>{__('password', 'woo-stripe-payment')}</strong>: pass_good
63
+ </div>
64
+ <div>
65
+ <strong>{__('pin', 'woo-stripe-payment')}</strong>: credential_good
66
+ </div>
67
+ </div>
68
+ </div>
69
+ );
70
+ }
71
+
72
+ registerPaymentMethod({
73
+ name: getData('name'),
74
+ label: <PaymentMethodLabel title={getData('title')}
75
+ paymentMethod={getData('name')}
76
+ icons={getData('icons')}/>,
77
+ ariaLabel: 'ACH Payment',
78
+ canMakePayment: ({cartTotals}) => cartTotals.currency_code === 'USD',
79
+ content: <PaymentMethod
80
+ getData={getData}
81
+ content={ACHPaymentContent}/>,
82
+ savedTokenComponent: <SavedCardComponent getData={getData}/>,
83
+ edit: <ACHPaymentContent getData={getData}/>,
84
+ placeOrderButtonLabel: getData('placeOrderButtonLabel'),
85
+ supports: {
86
+ showSavedCards: getData('showSavedCards'),
87
+ showSaveOption: false,
88
+ features: getData('features')
89
+ }
90
+ })
packages/blocks/assets/js/payment-methods/ach/styles.scss ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .wc-stripe-label-container {
2
+ &.stripe_ach {
3
+ img {
4
+ &.wc-block-components-payment-method-icon--stripe_ach {
5
+ height: 25px;
6
+ }
7
+
8
+ }
9
+ }
10
+ }
11
+
12
+ .wc-stripe-blocks-ach__creds {
13
+ margin-top: 10px;
14
+
15
+ .wc-stripe-blocks-ach__creds-label {
16
+ font-weight: 700;
17
+ }
18
+ }
packages/blocks/assets/js/payment-methods/applepay/index.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ import './style.scss';
2
+
3
+ import './payment-method';
packages/blocks/assets/js/payment-methods/applepay/payment-method.js ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {useCallback} from '@wordpress/element';
2
+ import {registerExpressPaymentMethod} from '@woocommerce/blocks-registry';
3
+ import {getSettings, initStripe as loadStripe, canMakePayment} from "../util";
4
+ import {Elements, PaymentRequestButtonElement, useStripe} from "@stripe/react-stripe-js";
5
+ import ErrorBoundary from "../error-boundary";
6
+ import {
7
+ usePaymentRequest,
8
+ useProcessPaymentIntent,
9
+ useExportedValues,
10
+ useAfterProcessingPayment,
11
+ useStripeError,
12
+ useExpressBreakpointWidth
13
+ } from '../hooks';
14
+
15
+ const getData = getSettings('stripe_applepay_data');
16
+
17
+ const ApplePayContent = (props) => {
18
+ return (
19
+ <ErrorBoundary>
20
+ <div className='wc-stripe-apple-pay-container'>
21
+ <Elements stripe={loadStripe}>
22
+ <ApplePayButton {...props}/>
23
+ </Elements>
24
+ </div>
25
+ </ErrorBoundary>
26
+ );
27
+ }
28
+
29
+ const ApplePayButton = (
30
+ {
31
+ getData,
32
+ onClick,
33
+ onClose,
34
+ billing,
35
+ shippingData,
36
+ eventRegistration,
37
+ emitResponse,
38
+ onSubmit,
39
+ activePaymentMethod,
40
+ ...props
41
+ }) => {
42
+ const {onPaymentProcessing} = eventRegistration;
43
+ const {responseTypes, noticeContexts} = emitResponse;
44
+ const stripe = useStripe();
45
+ const [error] = useStripeError();
46
+ const canPay = (result) => result != null && result.applePay;
47
+ const exportedValues = useExportedValues();
48
+ useExpressBreakpointWidth({payment_method: getData('name'), width: 300});
49
+ const {setPaymentMethod} = useProcessPaymentIntent({
50
+ getData,
51
+ billing,
52
+ shippingData,
53
+ onPaymentProcessing,
54
+ emitResponse,
55
+ error,
56
+ onSubmit,
57
+ activePaymentMethod,
58
+ exportedValues
59
+ });
60
+ useAfterProcessingPayment({
61
+ getData,
62
+ eventRegistration,
63
+ responseTypes,
64
+ activePaymentMethod,
65
+ messageContext: noticeContexts.EXPRESS_PAYMENTS
66
+ });
67
+ const {paymentRequest} = usePaymentRequest({
68
+ getData,
69
+ onClose,
70
+ stripe,
71
+ billing,
72
+ shippingData,
73
+ eventRegistration,
74
+ setPaymentMethod,
75
+ exportedValues,
76
+ canPay
77
+ });
78
+
79
+ const handleClick = useCallback(() => {
80
+ if (paymentRequest) {
81
+ onClick();
82
+ paymentRequest.show();
83
+ }
84
+ }, [paymentRequest]);
85
+
86
+ if (paymentRequest) {
87
+ return (
88
+ <button
89
+ className={`apple-pay-button ${getData('buttonStyle')}`}
90
+ style={{
91
+ '-apple-pay-button-type': getData('buttonType')
92
+ }}
93
+ onClick={handleClick}/>
94
+
95
+ )
96
+ }
97
+ return null;
98
+ }
99
+
100
+ const ApplePayEdit = ({getData, ...props}) => {
101
+ return (
102
+ <div className={'apple-pay-block-editor'}>
103
+ <img src={getData('editorIcon')}/>
104
+ </div>
105
+ )
106
+ }
107
+
108
+ registerExpressPaymentMethod({
109
+ name: getData('name'),
110
+ canMakePayment: ({cartTotals, ...props}) => {
111
+ if (getData('isAdmin')) {
112
+ return true;
113
+ }
114
+ const {currency_code: currency, total_price} = cartTotals;
115
+ return canMakePayment({
116
+ country: getData('countryCode'),
117
+ currency: currency.toLowerCase(),
118
+ total: {
119
+ label: getData('totalLabel'),
120
+ amount: parseInt(total_price)
121
+ }
122
+ }, (result) => result != null && result.applePay);
123
+ },
124
+ content: <ApplePayContent getData={getData}/>,
125
+ edit: <ApplePayEdit getData={getData}/>,
126
+ supports: {
127
+ showSavedCards: getData('showSavedCards'),
128
+ showSaveOption: getData('showSaveOption'),
129
+ features: getData('features')
130
+ }
131
+ })
packages/blocks/assets/js/payment-methods/applepay/style.scss ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .wc-stripe-apple-pay-container {
2
+ @supports (-webkit-appearance: -apple-pay-button) {
3
+ .apple-pay-button {
4
+ -webkit-appearance: -apple-pay-button !important;
5
+ width: 100%;
6
+ max-width: 100%;
7
+ min-width: 200px;
8
+ height: 40px;
9
+ max-height: 40px;
10
+
11
+ &.apple-pay-button-black {
12
+ -apple-pay-button-style: black;
13
+ }
14
+
15
+ &.apple-pay-button-white {
16
+ -apple-pay-button-style: white;
17
+ }
18
+
19
+ &.apple-pay-button-white-with-line {
20
+ -apple-pay-button-style: white-outline;
21
+ }
22
+ }
23
+ }
24
+ }
25
+
26
+ .apple-pay-block-editor {
27
+ background-color: black;
28
+ width: 100%;
29
+ height: 40px;
30
+ display: flex;
31
+ align-items: center;
32
+ justify-content: center;
33
+ border-radius: 4px;
34
+
35
+ img {
36
+ height: 100%;
37
+ max-height: 40px;
38
+ }
39
+ }
packages/blocks/assets/js/payment-methods/credit-card/components/bootstrap/index.js ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import './style.scss';
2
+ import {registerCreditCardForm} from "@paymentplugins/stripe/util";
3
+ import {CardNumberElement, CardExpiryElement, CardCvcElement} from '@stripe/react-stripe-js';
4
+ import {__} from "@wordpress/i18n";
5
+
6
+ const Bootstrap = ({CardIcon, options, onChange}) => {
7
+ return (
8
+ <div className='wc-stripe-bootstrap-form'>
9
+ <div className='row'>
10
+ <div className='col-md-6 mb-3'>
11
+ <CardNumberElement className='md-form md-outline stripe-input' options={options['cardNumber']}
12
+ onChange={onChange(CardNumberElement)}/>
13
+ <label htmlFor="stripe-card-number">{__('Card Number', 'woo-stripe-payment')}</label>
14
+ {CardIcon}
15
+ </div>
16
+ <div className='col-md-3 mb-3'>
17
+ <CardExpiryElement className='md-form md-outline stripe-input' options={options['cardExpiry']}
18
+ onChange={onChange(CardExpiryElement)}/>
19
+ <label htmlFor="stripe-exp">{__('Exp', 'woo-stripe-payment')}</label>
20
+ </div>
21
+ <div className='col-md-3 mb-3'>
22
+ <CardCvcElement className="md-form md-outline stripe-input" options={options['cardCvc']}
23
+ onChange={onChange(CardCvcElement)}/>
24
+ <label htmlFor="stripe-cvv">{__('CVV', 'woo-stripe-payment')}</label>
25
+ </div>
26
+ </div>
27
+ </div>
28
+ )
29
+ }
30
+
31
+ registerCreditCardForm({
32
+ id: 'bootstrap',
33
+ breakpoint: 475,
34
+ component: <Bootstrap/>
35
+ })
packages/blocks/assets/js/payment-methods/credit-card/components/bootstrap/style.scss ADDED
@@ -0,0 +1,212 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $medium-width: 475px;
2
+
3
+ .wc-stripe-bootstrap-form {
4
+ background: #fff !important;
5
+ margin-top: 10px;
6
+
7
+ .StripeElement {
8
+ box-sizing: border-box;
9
+ height: 40px;
10
+ padding: 10px 12px;
11
+ border-radius: 4px;
12
+ background-color: white;
13
+ -webkit-transition: box-shadow 150ms ease;
14
+ transition: box-shadow 150ms ease;
15
+ }
16
+
17
+ .row {
18
+ display: -ms-flexbox;
19
+ display: flex;
20
+ -ms-flex-wrap: wrap;
21
+ flex-wrap: wrap;
22
+ margin-right: -15px;
23
+ margin-left: -15px;
24
+ margin-bottom: 0px;
25
+ margin-top: 0px;
26
+ }
27
+
28
+ .mb-2, .my-2 {
29
+ margin-bottom: .5rem !important;
30
+ }
31
+
32
+ .mb-3, .my-3 {
33
+ margin-bottom: 18px !important;
34
+ }
35
+
36
+ .col-md-3, .col-md-4, .col-md-6, .col-md-9, .col-md-12 {
37
+ position: relative;
38
+ width: 100%;
39
+ padding-right: 15px;
40
+ padding-left: 15px;
41
+ }
42
+
43
+ .md-form + label {
44
+ position: absolute;
45
+ top: .65rem;
46
+ left: 15px;
47
+ -webkit-transition: .3s ease-out;
48
+ -o-transition: .3s ease-out;
49
+ transition: .3s ease-out;
50
+ cursor: text;
51
+ color: #757575;
52
+ pointer-events: none;
53
+ overflow: hidden;
54
+ }
55
+
56
+ .md-form.md-outline,
57
+ .md-form.md-outline {
58
+ &.StripeElement {
59
+ + label {
60
+ font-size: 16px;
61
+ position: absolute !important;
62
+ top: 50%;
63
+ transition-property: color, transform;
64
+ transform: translateY(-50%);
65
+ -webkit-transform: translateY(-50%);
66
+ -ms-transform: translateY(-50%);
67
+ -moz-transform: translateY(-50%);
68
+ padding-left: 12px;
69
+ -webkit-transition: .3s ease-out;
70
+ -o-transition: .3s ease-out;
71
+ transition: .3s ease-out;
72
+ cursor: text;
73
+ color: #495057;
74
+ font-weight: 300;
75
+ margin: 0;
76
+ pointer-events: none;
77
+ }
78
+ }
79
+ }
80
+
81
+ .md-form.md-outline.focused,
82
+ .md-form.md-outline.invalid,
83
+ .md-form.md-outline.StripeElement--complete {
84
+ + label {
85
+ -webkit-transform: translateY(-35px);
86
+ -ms-transform: translateY(-35px);
87
+ transform: translateY(-35px);
88
+ background: #fff !important;
89
+ font-weight: 500;
90
+ padding-right: 5px;
91
+ padding-left: 5px;
92
+ font-size: 12px;
93
+ left: 20px;
94
+ font-weight: 500;
95
+ }
96
+ }
97
+
98
+ .md-form.md-outline {
99
+ height: auto;
100
+ position: relative;
101
+ width: 100%;
102
+
103
+ &.invalid {
104
+ + label {
105
+ color: #E25950 !important;
106
+ }
107
+ }
108
+
109
+ &.focused {
110
+ + label {
111
+ color: #4285f4
112
+ }
113
+ }
114
+
115
+ &.StripeElement--complete {
116
+ border-color: #1b9404;
117
+ box-shadow: inset 0 0 0 0.5px #1b9404;
118
+ -webkit-box-shadow: inset 0 0 0 0.5px #1b9404;
119
+
120
+ + label {
121
+ color: #1b9404;
122
+ }
123
+ }
124
+ }
125
+
126
+ .stripe-input {
127
+ -webkit-transition: all .3s;
128
+ -o-transition: all .3s;
129
+ transition: all .3s;
130
+ outline: 0;
131
+ -webkit-box-shadow: none;
132
+ box-shadow: none;
133
+ border: 1px solid #dadce0;
134
+ -webkit-border-radius: 4px;
135
+ border-radius: 4px;
136
+ background-color: #fff !important;
137
+ -webkit-box-sizing: border-box;
138
+ box-sizing: border-box;
139
+ height: 40px;
140
+ }
141
+
142
+ .stripe-input.focused,
143
+ .stripe-input.invalid {
144
+ border-color: #4285f4;
145
+ -webkit-box-shadow: inset 0 0 0 0.5px #4285f4;
146
+ box-shadow: inset 0 0 0 0.5px #4285f4
147
+ }
148
+
149
+ .stripe-input.invalid {
150
+ border-color: #E25950;
151
+ box-shadow: inset 0 0 0 0.5px #E25950;
152
+ }
153
+
154
+ [class^="col-md-"] {
155
+ -ms-flex: 0 0 100%;
156
+ flex: 0 0 100%;
157
+ max-width: 100%;
158
+ }
159
+
160
+ .wc-stripe-card {
161
+ top: 50%;
162
+ right: 30px;
163
+ bottom: 0;
164
+ transform: translateY(-50%);
165
+ }
166
+
167
+ @media (min-width: $medium-width) {
168
+ .col-md-3 {
169
+ -ms-flex: 0 0 25%;
170
+ flex: 0 0 25%;
171
+ max-width: 25%;
172
+ }
173
+
174
+ .col-md-4 {
175
+ -webkit-box-flex: 0;
176
+ -ms-flex: 0 0 33.33%;
177
+ flex: 0 0 33.33%;
178
+ max-width: 33.33%;
179
+ }
180
+
181
+ .col-md-6 {
182
+ -webkit-box-flex: 0;
183
+ -ms-flex: 0 0 50%;
184
+ flex: 0 0 50%;
185
+ max-width: 50%;
186
+ }
187
+
188
+ .col-md-9 {
189
+ -webkit-box-flex: 0;
190
+ -ms-flex: 0 0 75%;
191
+ flex: 0 0 75%;
192
+ max-width: 75%;
193
+ }
194
+
195
+ .col-md-12 {
196
+ -webkit-box-flex: 0;
197
+ -ms-flex: 0 0 100%;
198
+ flex: 0 0 100%;
199
+ max-width: 100%;
200
+ }
201
+ }
202
+ }
203
+
204
+ .small-form {
205
+ .wc-stripe-bootstrap-form {
206
+ [class^="col-md-"] {
207
+ -ms-flex: 0 0 100%;
208
+ flex: 0 0 100%;
209
+ max-width: 100%;
210
+ }
211
+ }
212
+ }
packages/blocks/assets/js/payment-methods/credit-card/components/custom-card-form.js ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {getCreditCardForm} from "../../util";
2
+ import {cloneElement, useRef, useCallback, useEffect, useState} from '@wordpress/element';
3
+ import {useElements, CardNumberElement, CardExpiryElement, CardCvcElement} from '@stripe/react-stripe-js';
4
+ import {sprintf, __} from '@wordpress/i18n';
5
+ import {useBreakpointWidth} from "../../hooks";
6
+
7
+ const classes = {
8
+ focus: 'focused',
9
+ empty: 'empty',
10
+ invalid: 'invalid'
11
+ }
12
+
13
+ const CustomCardForm = (
14
+ {
15
+ getData,
16
+ onChange: eventChange,
17
+ ValidationInputError
18
+ }) => {
19
+ const [windowSize, setWindowSize] = useState(window.innerWidth);
20
+ const [cardType, setCardType] = useState('');
21
+ const elementOrder = useRef([]);
22
+ const [container, setContainer] = useState(null);
23
+ const elements = useElements();
24
+ const id = getData('customForm');
25
+ const {component: CardForm, breakpoint = 475} = getCreditCardForm(id);
26
+ const postalCodeEnabled = getData('postalCodeEnabled');
27
+ const options = {};
28
+ ['cardNumber', 'cardExpiry', 'cardCvc'].forEach(type => {
29
+ options[type] = {
30
+ classes,
31
+ ...getData('cardOptions'),
32
+ ...getData('customFieldOptions')[type],
33
+ }
34
+ });
35
+ const onChange = (element) => {
36
+ setElementOrder(element);
37
+ return (event) => {
38
+ eventChange(event);
39
+ if (event.elementType === 'cardNumber') {
40
+ if (event.brand === 'unknown') {
41
+ setCardType('');
42
+ } else {
43
+ setCardType(event.brand);
44
+ }
45
+ }
46
+ if (event.complete) {
47
+ const idx = elementOrder.current.indexOf(element);
48
+ if (elementOrder.current[idx + 1]) {
49
+ const nextElement = elementOrder.current[idx + 1];
50
+ elements.getElement(nextElement).focus();
51
+ }
52
+ }
53
+ }
54
+ }
55
+ const setElementOrder = useCallback((element) => {
56
+ if (!elementOrder.current.includes(element)) {
57
+ elementOrder.current.push(element);
58
+ }
59
+ }, []);
60
+
61
+ useBreakpointWidth({name: 'creditCardForm', width: breakpoint, node: container, className: 'small-form'});
62
+
63
+ const getCardIconSrc = useCallback((type) => {
64
+ for (let icon of getData('icons')) {
65
+ if (icon.id === type) {
66
+ return icon.src;
67
+ }
68
+ }
69
+ return '';
70
+ }, []);
71
+
72
+ if (!CardForm) {
73
+ return (
74
+ <div className='wc-stripe-custom-form-error'>
75
+ <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>
76
+ </div>
77
+ )
78
+ }
79
+ return (
80
+ <div className={`wc-stripe-custom-form ${id}`} ref={setContainer}>
81
+ {cloneElement(CardForm, {
82
+ postalCodeEnabled,
83
+ options,
84
+ onChange,
85
+ CardIcon: <CardIcon type={cardType} src={getCardIconSrc(cardType)}/>
86
+ })}
87
+ </div>
88
+ )
89
+
90
+ }
91
+
92
+ const CardIcon = ({type, src}) => {
93
+ if (type) {
94
+ return <img className={`wc-stripe-card ${type}`} src={src}/>
95
+ }
96
+ return null;
97
+ }
98
+
99
+ export default CustomCardForm;
packages/blocks/assets/js/payment-methods/credit-card/components/simple/index.js ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import './style.scss';
2
+ import {registerCreditCardForm} from "@paymentplugins/stripe/util";
3
+ import {CardNumberElement, CardExpiryElement, CardCvcElement} from '@stripe/react-stripe-js';
4
+ import {__} from "@wordpress/i18n";
5
+ import {useEffect, useCallback, useRef} from '@wordpress/element';
6
+
7
+ const SimpleForm = ({CardIcon, options, onChange}) => {
8
+ useEffect(() => {
9
+ }, []);
10
+ return (
11
+ <div className='wc-stripe-simple-form'>
12
+ <div className="row">
13
+ <div className="field">
14
+ <div className='field-item'>
15
+ <CardNumberElement id="stripe-card-number" className="input empty"
16
+ options={options['cardNumber']}
17
+ onChange={onChange(CardNumberElement)}/>
18
+ <label htmlFor="stripe-card-number"
19
+ data-tid="">{__('Card Number', 'woo-stripe-payment')}</label>
20
+ <div className="baseline"></div>
21
+ {CardIcon}
22
+ </div>
23
+ </div>
24
+ </div>
25
+ <div className="row">
26
+ <div className="field half-width">
27
+ <div className='field-item'>
28
+ <CardExpiryElement id="stripe-exp" className="input empty" options={options['cardExpiry']}
29
+ onChange={onChange(CardExpiryElement)}/>
30
+ <label htmlFor="stripe-exp"
31
+ data-tid="">{__('Expiration', 'woo-stripe-payment')}</label>
32
+ <div className="baseline"></div>
33
+ </div>
34
+ </div>
35
+ <div className="field half-width cvc">
36
+ <div className='field-item'>
37
+ <CardCvcElement id="stripe-cvv" className="input empty" options={options['cardCvc']}
38
+ onChange={onChange(CardCvcElement)}/>
39
+ <label htmlFor="stripe-cvv"
40
+ data-tid="">{__('CVV', 'woo-stripe-payment')}</label>
41
+ <div className="baseline"></div>
42
+ </div>
43
+ </div>
44
+ </div>
45
+ </div>
46
+ )
47
+ }
48
+
49
+ registerCreditCardForm({
50
+ id: 'simple',
51
+ component: <SimpleForm/>,
52
+ breakpoint: 375
53
+ })
packages/blocks/assets/js/payment-methods/credit-card/components/simple/style.scss ADDED
@@ -0,0 +1,172 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $min-width: 475px;
2
+
3
+ .wc-stripe-simple-form {
4
+ background-color: #fff;
5
+ padding: 10px 0;
6
+
7
+ * {
8
+ font-family: Source Code Pro, Consolas, Menlo, monospace;
9
+ font-size: 16px;
10
+ font-weight: 500;
11
+ box-sizing: border-box;
12
+ }
13
+
14
+ .StripeElement {
15
+ padding-left: 0px;
16
+ }
17
+
18
+ .row {
19
+ display: -ms-flexbox;
20
+ display: flex;
21
+ flex-wrap: wrap;
22
+
23
+ &:first-of-type {
24
+ margin-bottom: 10px;
25
+ }
26
+ }
27
+
28
+ .field {
29
+ position: relative;
30
+ width: 100%;
31
+ height: 50px;
32
+ margin: 0;
33
+ display: flex;
34
+
35
+ &.half-width {
36
+ width: 50%;
37
+
38
+ &:nth-child(even) {
39
+ .field-item {
40
+ margin: 0 0 0 10px;
41
+ }
42
+ }
43
+
44
+ &:nth-child(odd) {
45
+ .field-item {
46
+ margin: 0 10px 0 0;
47
+ }
48
+ }
49
+ }
50
+
51
+ .field-item {
52
+ position: relative;
53
+ width: 100%;
54
+ }
55
+ }
56
+
57
+ .baseline {
58
+ position: absolute;
59
+ width: 100%;
60
+ height: 1px;
61
+ left: 0;
62
+ bottom: 0;
63
+ background-color: #cfd7df;
64
+ transition: background-color 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
65
+ }
66
+
67
+ label {
68
+ position: absolute;
69
+ width: 100%;
70
+ left: 0;
71
+ bottom: 8px;
72
+ color: #cfd7df;
73
+ overflow: hidden;
74
+ text-overflow: ellipsis;
75
+ white-space: nowrap;
76
+ transform-origin: 0 50%;
77
+ cursor: text;
78
+ transition-property: color, transform;
79
+ transition-duration: 0.3s;
80
+ transition-timing-function: cubic-bezier(0.165, 0.84, 0.44, 1);
81
+ margin-bottom: 0;
82
+ padding: 0;
83
+ }
84
+
85
+ .input {
86
+ position: absolute;
87
+ width: 100%;
88
+ left: 0;
89
+ bottom: 0;
90
+ padding-bottom: 7px;
91
+ color: #32325d;
92
+ background-color: transparent;
93
+ }
94
+
95
+ .input {
96
+
97
+ &::-webkit-input-placeholder,
98
+ &::-moz-placeholder {
99
+ color: transparent;
100
+ transition: color 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
101
+ }
102
+
103
+ &.StripeElement {
104
+ opacity: 0;
105
+ transition: opacity 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
106
+ will-change: opacity;
107
+ }
108
+
109
+ &.focused,
110
+ &:not(.empty) {
111
+ opacity: 1;
112
+
113
+ + label {
114
+ color: #aab7c4;
115
+ transform: scale(0.85) translateY(-25px);
116
+ cursor: default;
117
+ }
118
+ }
119
+
120
+ &.focused {
121
+ + label {
122
+ color: #24b47e;
123
+
124
+ + .baseline {
125
+ background-color: #24b47e;
126
+ }
127
+ }
128
+ }
129
+
130
+ &.invalid {
131
+ + label {
132
+ color: #ffa27b;
133
+
134
+ + .baseline {
135
+ background-color: #e25950;
136
+ }
137
+ }
138
+ }
139
+ }
140
+
141
+ @media(min-width: $min-width) {
142
+ .field {
143
+ &.half-width {
144
+ width: 50%;
145
+ }
146
+ }
147
+ }
148
+ }
149
+
150
+ .small-form {
151
+ .wc-stripe-simple-form {
152
+ .field {
153
+ &.half-width {
154
+ width: 100%;
155
+
156
+ &:nth-child(even),
157
+ &:nth-child(odd) {
158
+ .field-item {
159
+ margin: 0;
160
+ }
161
+ }
162
+ }
163
+
164
+ }
165
+
166
+ .cvc {
167
+ margin-top: 10px;
168
+ }
169
+
170
+
171
+ }
172
+ }
packages/blocks/assets/js/payment-methods/credit-card/components/stripe-card-form.js ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {CardElement} from "@stripe/react-stripe-js";
2
+ import {isFieldRequired} from "../../util";
3
+ import {useMemo} from '@wordpress/element';
4
+
5
+ const StripeCardForm = ({getData, billing, onChange}) => {
6
+ const cardOptions = useMemo(() => {
7
+ return {
8
+ ...{
9
+ value: {
10
+ postalCode: billing?.billingData?.postcode
11
+ },
12
+ hidePostalCode: isFieldRequired('postcode'),
13
+ iconStyle: 'default'
14
+ }, ...getData('cardOptions')
15
+ };
16
+ }, [billing.billingData]);
17
+ return (
18
+ <div className='wc-stripe-inline-form'>
19
+ <CardElement options={cardOptions} onChange={onChange}/>
20
+ </div>
21
+ )
22
+ }
23
+
24
+ export default StripeCardForm;
packages/blocks/assets/js/payment-methods/credit-card/index.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ import './style.scss';
2
+
3
+ export * from './payment-method';
4
+
5
+ import './components/bootstrap';
6
+ import './components/simple';
packages/blocks/assets/js/payment-methods/credit-card/payment-method.js ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {useEffect, useState, useCallback, useMemo} from '@wordpress/element';
2
+ import {registerPaymentMethod} from '@woocommerce/blocks-registry';
3
+ import {initStripe as loadStripe, getSettings, isFieldRequired, isUserLoggedIn} from '../util';
4
+ import {Elements, CardElement, useStripe, useElements, CardNumberElement} from '@stripe/react-stripe-js';
5
+ import {PaymentMethodLabel, PaymentMethod, SavePaymentMethod} from '../../components/checkout';
6
+ import SavedCardComponent from '@paymentplugins/stripe/saved-card-component';
7
+ import CustomCardForm from './components/custom-card-form';
8
+ import StripeCardForm from "./components/stripe-card-form";
9
+ import {
10
+ useProcessPaymentIntent,
11
+ useAfterProcessingPayment,
12
+ useSetupIntent,
13
+ useStripeError
14
+ } from "../hooks";
15
+
16
+ const getData = getSettings('stripe_cc_data');
17
+
18
+ const CreditCardContent = (props) => {
19
+ const [error, setError] = useState(false);
20
+ useEffect(() => {
21
+ loadStripe.catch(error => {
22
+ setError(error);
23
+ })
24
+ }, [setError]);
25
+ if (error) {
26
+ throw new Error(error);
27
+ }
28
+ return (
29
+ <Elements stripe={loadStripe}>
30
+ <CreditCardElement {...props}/>
31
+ </Elements>
32
+ );
33
+ };
34
+
35
+ const CreditCardElement = (
36
+ {
37
+ getData,
38
+ billing,
39
+ shippingData,
40
+ emitResponse,
41
+ eventRegistration,
42
+ activePaymentMethod
43
+ }) => {
44
+ const [error, setError] = useStripeError();
45
+ const [savePaymentMethod, setSavePaymentMethod] = useState(false);
46
+ const onSavePaymentMethod = (checked) => setSavePaymentMethod(checked);
47
+ const {onPaymentProcessing} = eventRegistration;
48
+ const stripe = useStripe();
49
+ const elements = useElements();
50
+ const getPaymentMethodArgs = useCallback(() => {
51
+ const elType = getData('customFormActive') ? CardNumberElement : CardElement;
52
+ return {card: elements.getElement(elType)};
53
+ }, [stripe, elements]);
54
+
55
+ const {setupIntent, removeSetupIntent} = useSetupIntent({
56
+ getData,
57
+ cartTotal: billing.cartTotal,
58
+ setError
59
+ })
60
+
61
+ useProcessPaymentIntent({
62
+ getData,
63
+ billing,
64
+ shippingData,
65
+ emitResponse,
66
+ error,
67
+ onPaymentProcessing,
68
+ savePaymentMethod,
69
+ setupIntent,
70
+ removeSetupIntent,
71
+ getPaymentMethodArgs,
72
+ activePaymentMethod
73
+ });
74
+ useAfterProcessingPayment({
75
+ getData,
76
+ eventRegistration,
77
+ responseTypes: emitResponse.responseTypes,
78
+ activePaymentMethod,
79
+ savePaymentMethod
80
+ });
81
+
82
+ const onChange = (event) => {
83
+ if (event.error) {
84
+ setError(event.error);
85
+ } else {
86
+ setError(false);
87
+ }
88
+ }
89
+ const Tag = getData('customFormActive') ? CustomCardForm : StripeCardForm;
90
+ return (
91
+ <div className='wc-stripe-card-container'>
92
+ <Tag {...{getData, billing, onChange}}/>
93
+ {isUserLoggedIn(billing.customerId) && getData('saveCardEnabled') &&
94
+ <SavePaymentMethod label={getData('savePaymentMethodLabel')}
95
+ onChange={onSavePaymentMethod}
96
+ checked={savePaymentMethod}/>}
97
+ </div>
98
+ );
99
+ }
100
+
101
+ registerPaymentMethod({
102
+ name: getData('name'),
103
+ label: <PaymentMethodLabel
104
+ title={getData('title')}
105
+ paymentMethod={getData('name')}
106
+ icons={getData('icons')}/>,
107
+ ariaLabel: 'Credit Cards',
108
+ canMakePayment: () => loadStripe,
109
+ content: <PaymentMethod content={CreditCardContent} getData={getData}/>,
110
+ savedTokenComponent: <SavedCardComponent getData={getData}/>,
111
+ edit: <PaymentMethod content={CreditCardContent} getData={getData}/>,
112
+ supports: {
113
+ showSavedCards: getData('showSavedCards'),
114
+ showSaveOption: false,
115
+ features: getData('features')
116
+ }
117
+ })
packages/blocks/assets/js/payment-methods/credit-card/style.scss ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .wc-stripe-inline-form {
2
+ border: 1px solid #e0e0e0;
3
+ border-radius: 2px;
4
+ padding: 10px 8px;
5
+ }
6
+
7
+ .wc-stripe-card-container,
8
+ .wc-stripe-save-payment-method {
9
+ + .wc-block-components-payment-methods__save-card-info {
10
+ display: none;
11
+ }
12
+ }
13
+
14
+ .wc-stripe-custom-form-error {
15
+ color: #cc1818;
16
+ width: 100%;
17
+ font-size: 16px;
18
+ }
19
+
20
+ .wc-stripe-custom-form {
21
+ .wc-stripe-card {
22
+ width: 32px;
23
+ height: 20px;
24
+ position: absolute;
25
+ right: 0;
26
+ bottom: 7px
27
+ }
28
+ }
packages/blocks/assets/js/payment-methods/error-boundary.js ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {Component} from '@wordpress/element';
2
+
3
+ class ErrorBoundary extends Component {
4
+ constructor(props) {
5
+ super(props);
6
+ this.state = {hasError: false, error: null, errorInfo: null};
7
+ }
8
+
9
+ componentDidCatch(error, errorInfo) {
10
+ this.setState({
11
+ hasError: true,
12
+ error,
13
+ errorInfo
14
+ })
15
+ }
16
+
17
+ render() {
18
+ if (this.state.hasError) {
19
+ return (
20
+ <>
21
+ {this.state.error && <div className='wc-stripe-block-error'>{this.state.error.toString()}</div>}
22
+ {this.state.errorInfo &&
23
+ <div className='wc-stripe-block-error'>{this.state.errorInfo.componentStack}</div>}
24
+ </>
25
+ )
26
+ }
27
+ return this.props.children;
28
+ }
29
+ }
30
+
31
+ export default ErrorBoundary;
packages/blocks/assets/js/payment-methods/googlepay/button.js ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {useRef, useEffect} from '@wordpress/element';
2
+ import {usePaymentsClient, usePaymentRequest} from './hooks';
3
+ import {
4
+ useProcessPaymentIntent,
5
+ useStripeError,
6
+ useExportedValues,
7
+ useExpressBreakpointWidth
8
+ } from '../hooks';
9
+ import {getSettings} from '@paymentplugins/stripe/util';
10
+
11
+ const {publishableKey} = getSettings('stripeGeneralData')();
12
+
13
+ const GooglePayButton = (
14
+ {
15
+ getData,
16
+ setErrorMessage,
17
+ billing,
18
+ shippingData,
19
+ canMakePayment,
20
+ checkoutStatus,
21
+ eventRegistration,
22
+ activePaymentMethod,
23
+ onClick,
24
+ onClose,
25
+ ...props
26
+ }) => {
27
+ const merchantInfo = {
28
+ merchantId: getData('merchantId'),
29
+ merchantName: getData('merchantName')
30
+ };
31
+ const [error, setError] = useStripeError();
32
+ const buttonContainer = useRef();
33
+ const {onSubmit, emitResponse} = props;
34
+ const {onPaymentProcessing} = eventRegistration;
35
+ const exportedValues = useExportedValues();
36
+ const width = getData('buttonStyle').buttonType === 'long' ? 390 : 300;
37
+ const {setPaymentMethod} = useProcessPaymentIntent({
38
+ getData,
39
+ billing,
40
+ shippingData,
41
+ onPaymentProcessing,
42
+ emitResponse,
43
+ error,
44
+ exportedValues,
45
+ onSubmit,
46
+ checkoutStatus,
47
+ activePaymentMethod
48
+ });
49
+
50
+ const paymentRequest = usePaymentRequest({
51
+ getData,
52
+ publishableKey,
53
+ merchantInfo,
54
+ billing,
55
+ shippingData
56
+ })
57
+
58
+ const {button, removeButton} = usePaymentsClient({
59
+ merchantInfo,
60
+ paymentRequest,
61
+ billing,
62
+ shippingData,
63
+ eventRegistration,
64
+ canMakePayment,
65
+ setErrorMessage,
66
+ onSubmit,
67
+ setPaymentMethod,
68
+ exportedValues,
69
+ onClick,
70
+ onClose,
71
+ getData
72
+ });
73
+
74
+ useExpressBreakpointWidth({payment_method: getData('name'), width});
75
+
76
+ useEffect(() => {
77
+ if (button) {
78
+ // prevent button duplicates
79
+ removeButton(buttonContainer.current);
80
+ buttonContainer.current.append(button);
81
+ }
82
+ }, [button]);
83
+
84
+ return (
85
+ <div className='wc-stripe-gpay-button-container' ref={buttonContainer}></div>
86
+ )
87
+ }
88
+
89
+ export default GooglePayButton;
packages/blocks/assets/js/payment-methods/googlepay/constants.js ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export const BASE_PAYMENT_METHOD = {
2
+ type: 'CARD',
3
+ parameters: {
4
+ allowedAuthMethods: ["PAN_ONLY"],
5
+ allowedCardNetworks: ["AMEX", "DISCOVER", "INTERAC", "JCB", "MASTERCARD", "VISA"],
6
+ assuranceDetailsRequired: true
7
+ }
8
+ };
9
+
10
+ export const BASE_PAYMENT_REQUEST = {
11
+ apiVersion: 2,
12
+ apiVersionMinor: 0
13
+ }
packages/blocks/assets/js/payment-methods/googlepay/hooks/index.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ export * from './use-payments-client';
2
+ export * from './use-payment-request';
3
+ export * from './use-error-message';
packages/blocks/assets/js/payment-methods/googlepay/hooks/use-error-message.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ import {useState} from '@wordpress/element';
2
+
3
+ export const useErrorMessage = () => {
4
+ const [errorMessage, setErrorMessage] = useState(false);
5
+ return {errorMessage, setErrorMessage};
6
+ }
packages/blocks/assets/js/payment-methods/googlepay/hooks/use-payment-request.js ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {useState, useEffect, useMemo} from '@wordpress/element';
2
+ import {BASE_PAYMENT_REQUEST, BASE_PAYMENT_METHOD} from "../constants";
3
+ import {isEmpty, isFieldRequired} from "../../util";
4
+ import {getTransactionInfo, getShippingOptionParameters} from "../util";
5
+
6
+ export const usePaymentRequest = ({getData, publishableKey, merchantInfo, billing, shippingData}) => {
7
+ const {billingData} = billing;
8
+ const {shippingRates, shippingAddress} = shippingData;
9
+ const {processingCountry, totalPriceLabel} = getData();
10
+
11
+ const paymentRequest = useMemo(() => {
12
+ let options = {
13
+ ...{
14
+ emailRequired: isEmpty(billingData.email),
15
+ merchantInfo,
16
+ allowedPaymentMethods: [{
17
+ ...{
18
+ type: 'CARD',
19
+ tokenizationSpecification: {
20
+ type: "PAYMENT_GATEWAY",
21
+ parameters: {
22
+ gateway: 'stripe',
23
+ "stripe:version": "2018-10-31",
24
+ "stripe:publishableKey": publishableKey
25
+ }
26
+ }
27
+ }, ...BASE_PAYMENT_METHOD
28
+ }],
29
+ shippingAddressRequired: shippingData.needsShipping,
30
+ transactionInfo: getTransactionInfo({
31
+ billing,
32
+ processingCountry,
33
+ totalPriceLabel
34
+ }),
35
+ callbackIntents: ['PAYMENT_AUTHORIZATION']
36
+ }, ...BASE_PAYMENT_REQUEST
37
+ };
38
+ options.allowedPaymentMethods[0].parameters.billingAddressRequired = true;
39
+ options.allowedPaymentMethods[0].parameters.billingAddressParameters = {
40
+ format: 'FULL',
41
+ phoneNumberRequired: isFieldRequired('phone', billingData.country) && isEmpty(billingData.phone)
42
+ };
43
+ if (options.shippingAddressRequired) {
44
+ options.callbackIntents = [...options.callbackIntents, ...['SHIPPING_ADDRESS', 'SHIPPING_OPTION']];
45
+ options.shippingOptionRequired = true;
46
+ const shippingOptionParameters = getShippingOptionParameters(shippingRates);
47
+ if (shippingOptionParameters.shippingOptions.length > 0) {
48
+ options = {...options, shippingOptionParameters};
49
+ }
50
+ }
51
+ return options;
52
+ }, [
53
+ billing.cartTotal,
54
+ billing.cartTotalItems,
55
+ billingData,
56
+ shippingData
57
+ ]);
58
+ return paymentRequest;
59
+ }
packages/blocks/assets/js/payment-methods/googlepay/hooks/use-payments-client.js ADDED
@@ -0,0 +1,183 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {useState, useEffect, useCallback, useMemo, useRef} from '@wordpress/element';
2
+ import isShallowEqual from "@wordpress/is-shallow-equal";
3
+ import {
4
+ getErrorMessage,
5
+ getSelectedShippingOption,
6
+ getBillingDetailsFromAddress,
7
+ isAddressValid,
8
+ isEmpty,
9
+ StripeError,
10
+ getIntermediateAddress
11
+ } from "../../util";
12
+ import {useStripe} from "@stripe/react-stripe-js";
13
+ import {getPaymentRequestUpdate, toCartAddress} from "../util";
14
+ import {__} from "@wordpress/i18n";
15
+ import {usePaymentEvents} from "../../hooks";
16
+
17
+ export const usePaymentsClient = (
18
+ {
19
+ merchantInfo,
20
+ paymentRequest,
21
+ billing,
22
+ shippingData,
23
+ eventRegistration,
24
+ canMakePayment,
25
+ setErrorMessage,
26
+ setPaymentMethod,
27
+ exportedValues,
28
+ onClick,
29
+ onClose,
30
+ getData
31
+ }) => {
32
+ const {environment} = getData();
33
+ const [paymentsClient, setPaymentsClient] = useState();
34
+ const [button, setButton] = useState(null);
35
+ const currentBilling = useRef(billing);
36
+ const currentShipping = useRef(shippingData);
37
+ const stripe = useStripe();
38
+ const {addPaymentEvent} = usePaymentEvents({
39
+ billing,
40
+ shippingData,
41
+ eventRegistration
42
+ });
43
+ useEffect(() => {
44
+ currentBilling.current = billing;
45
+ currentShipping.current = shippingData;
46
+ });
47
+
48
+ const setAddressData = useCallback((paymentData) => {
49
+ if (paymentData?.paymentMethodData?.info?.billingAddress) {
50
+ let billingAddress = paymentData.paymentMethodData.info.billingAddress;
51
+ if (isAddressValid(currentBilling.current.billingData, ['phone', 'email']) && isEmpty(currentBilling.current.billingData?.phone)) {
52
+ billingAddress = {phoneNumber: billingAddress.phoneNumber};
53
+ }
54
+ exportedValues.billingData = toCartAddress(billingAddress, {email: paymentData.email});
55
+ }
56
+ if (paymentData?.shippingAddress) {
57
+ exportedValues.shippingAddress = toCartAddress(paymentData.shippingAddress);
58
+ }
59
+ }, [exportedValues, paymentRequest]);
60
+
61
+ const removeButton = useCallback((parentElement) => {
62
+ while (parentElement.firstChild) {
63
+ parentElement.removeChild(parentElement.firstChild);
64
+ }
65
+ }, [button]);
66
+ const handleClick = useCallback(async () => {
67
+ onClick();
68
+ try {
69
+ let paymentData = await paymentsClient.loadPaymentData(paymentRequest);
70
+ const {billingData} = currentBilling.current;
71
+
72
+ // set the address data so it can be used during the checkout process
73
+ setAddressData(paymentData);
74
+
75
+ const data = JSON.parse(paymentData.paymentMethodData.tokenizationData.token);
76
+
77
+ let result = await stripe.createPaymentMethod({
78
+ type: 'card',
79
+ card: {token: data.id},
80
+ billing_details: getBillingDetailsFromAddress(billingData)
81
+ });
82
+
83
+ if (result.error) {
84
+ throw new StripeError(result.error);
85
+ }
86
+
87
+ setPaymentMethod(result.paymentMethod.id);
88
+ } catch (err) {
89
+ if (err?.statusCode === "CANCELED") {
90
+ onClose();
91
+ } else {
92
+ console.log(getErrorMessage(err));
93
+ setErrorMessage(getErrorMessage(err));
94
+ }
95
+ }
96
+ }, [
97
+ stripe,
98
+ paymentsClient,
99
+ onClick
100
+ ]);
101
+
102
+ const createButton = useCallback(async () => {
103
+ try {
104
+ if (paymentsClient && !button && stripe) {
105
+ await canMakePayment;
106
+ setButton(paymentsClient.createButton({
107
+ onClick: handleClick,
108
+ ...getData('buttonStyle')
109
+ }));
110
+ }
111
+ } catch (err) {
112
+ console.log(err);
113
+ }
114
+ }, [
115
+ stripe,
116
+ button,
117
+ paymentsClient
118
+ ]);
119
+
120
+ const paymentOptions = useMemo(() => {
121
+ let options = {
122
+ environment,
123
+ merchantInfo,
124
+ paymentDataCallbacks: {
125
+ onPaymentAuthorized: () => Promise.resolve({transactionState: "SUCCESS"})
126
+ }
127
+ }
128
+ if (paymentRequest.shippingAddressRequired) {
129
+ options.paymentDataCallbacks.onPaymentDataChanged = (paymentData) => {
130
+ return new Promise((resolve, reject) => {
131
+ const shipping = currentShipping.current;
132
+ const {shippingAddress: address, shippingOptionData} = paymentData;
133
+ const intermediateAddress = toCartAddress(address);
134
+ // pass the Promise resolve to a ref so it persists beyond the re-render
135
+ const selectedRates = getSelectedShippingOption(shippingOptionData.id);
136
+ const addressEqual = isShallowEqual(getIntermediateAddress(shipping.shippingAddress), intermediateAddress);
137
+ const shippingEqual = isShallowEqual(shipping.selectedRates, {
138
+ [selectedRates[1]]: selectedRates[0]
139
+ });
140
+ addPaymentEvent('onShippingChanged', (success, {billing, shipping}) => {
141
+ if (success) {
142
+ resolve(getPaymentRequestUpdate({
143
+ billing,
144
+ shippingData: {
145
+ needsShipping: true,
146
+ shippingRates: shipping.shippingRates
147
+ },
148
+ processingCountry: getData('processingCountry'),
149
+ totalPriceLabel: getData('totalPriceLabel')
150
+ }))
151
+ } else {
152
+ resolve({
153
+ error: {
154
+ reason: 'SHIPPING_ADDRESS_UNSERVICEABLE',
155
+ message: __('Your shipping address is not serviceable.', 'woo-stripe-payment'),
156
+ intent: 'SHIPPING_ADDRESS'
157
+ }
158
+ });
159
+ }
160
+ }, addressEqual && shippingEqual);
161
+ currentShipping.current.setShippingAddress({...currentShipping.current.shippingAddress, ...intermediateAddress});
162
+ if (shippingOptionData.id !== 'shipping_option_unselected') {
163
+ currentShipping.current.setSelectedRates(...selectedRates);
164
+ }
165
+ })
166
+ }
167
+ }
168
+ return options;
169
+ }, [paymentRequest]);
170
+
171
+ useEffect(() => {
172
+ setPaymentsClient(new google.payments.api.PaymentsClient(paymentOptions));
173
+ }, [paymentOptions]);
174
+
175
+ useEffect(() => {
176
+ createButton();
177
+ }, [createButton])
178
+
179
+ return {
180
+ button,
181
+ removeButton
182
+ };
183
+ }
packages/blocks/assets/js/payment-methods/googlepay/index.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ import './style.scss';
2
+
3
+ export * from './payment-method';
packages/blocks/assets/js/payment-methods/googlepay/payment-method.js ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {registerExpressPaymentMethod} from '@woocommerce/blocks-registry';
2
+ import {getSettings, initStripe as loadStripe, isCartPage} from '../util';
3
+ import {useErrorMessage} from "./hooks";
4
+ import GooglePayButton from './button';
5
+ import {BASE_PAYMENT_METHOD, BASE_PAYMENT_REQUEST} from './constants';
6
+ import google from '@googlepay';
7
+ import {Elements} from "@stripe/react-stripe-js";
8
+
9
+ const getData = getSettings('stripe_googlepay_data');
10
+
11
+ const canMakePayment = (() => {
12
+ const paymentsClient = new google.payments.api.PaymentsClient({
13
+ environment: getData('environment'),
14
+ merchantInfo: {
15
+ merchantId: getData('merchantId'),
16
+ merchantName: getData('merchantName')
17
+ }
18
+ });
19
+ const isReadyToPayRequest = {...BASE_PAYMENT_REQUEST, allowedPaymentMethods: [BASE_PAYMENT_METHOD]};
20
+ return paymentsClient.isReadyToPay(isReadyToPayRequest).then(() => {
21
+ return true;
22
+ }).catch(err => {
23
+ console.log(err);
24
+ return false;
25
+ })
26
+ })();
27
+
28
+ const GooglePayContent = ({getData, components, ...props}) => {
29
+ const {ValidationInputError} = components;
30
+ const {errorMessage, setErrorMessage} = useErrorMessage();
31
+ return (
32
+ <div className='wc-stripe-gpay-container'>
33
+ <Elements stripe={loadStripe}>
34
+ <GooglePayButton getData={getData}
35
+ canMakePayment={canMakePayment}
36
+ setErrorMessage={setErrorMessage}
37
+ {...props}/>
38
+ {errorMessage && <ValidationInputError errorMessage={errorMessage}/>}
39
+ </Elements>
40
+ </div>
41
+ )
42
+ }
43
+
44
+ const GooglePayEdit = ({getData, ...props}) => {
45
+ const buttonType = getData('buttonStyle').buttonType;
46
+ const src = getData('editorIcons')?.[buttonType] || 'long';
47
+ return (
48
+ <div className={`gpay-block-editor ${buttonType}`}>
49
+ <img src={src}/>
50
+ </div>
51
+ )
52
+ }
53
+
54
+ registerExpressPaymentMethod({
55
+ name: getData('name'),
56
+ canMakePayment: () => {
57
+ if (getData('isAdmin')) {
58
+ if (isCartPage()) {
59
+ return getData('cartCheckoutEnabled');
60
+ }
61
+ return true;
62
+ }
63
+ if (isCartPage() && !getData('cartCheckoutEnabled')) {
64
+ return false;
65
+ }
66
+ return loadStripe.then(stripe => {
67
+ if (stripe.error) {
68
+ return stripe;
69
+ }
70
+ return canMakePayment;
71
+ });
72
+ },
73
+ content: <GooglePayContent getData={getData}/>,
74
+ edit: <GooglePayEdit getData={getData}/>,
75
+ supports: {
76
+ showSavedCards: getData('showSavedCards'),
77
+ showSaveOption: getData('showSaveOption'),
78
+ features: getData('features')
79
+ }
80
+ })
packages/blocks/assets/js/payment-methods/googlepay/style.scss ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $iconHeight: 26px;
2
+
3
+ .wc-block-checkout__payment-method {
4
+ .wc-block-components-radio-control-accordion-option {
5
+ .wc-block-components-radio-control__label {
6
+ img {
7
+ &.wc-block-components-payment-method-icon--stripe_googlepay_icon {
8
+ height: $iconHeight;
9
+ }
10
+ }
11
+ }
12
+ }
13
+ }
14
+
15
+ .wc-stripe-label-container {
16
+ .wc-block-components-payment-method-icon--stripe_googlepay_icon {
17
+ height: $iconHeight;
18
+ }
19
+ }
20
+
21
+ .wc-stripe-gpay-container {
22
+ .wc-stripe-gpay-button-container {
23
+ .gpay-card-info-container-fill {
24
+ button {
25
+ &.long {
26
+ min-width: 200px;
27
+ }
28
+ }
29
+ }
30
+ }
31
+
32
+ .wc-block-components-validation-error {
33
+ position: relative;
34
+ margin-top: 5px;
35
+ }
36
+ }
37
+
38
+ .gpay-block-editor {
39
+ display: flex;
40
+ align-items: center;
41
+ justify-content: center;
42
+ width: 100%;
43
+ height: 40px;
44
+ background-color: black;
45
+ border-radius: 4px;
46
+ overflow: hidden;
47
+
48
+ img {
49
+ max-height: 40px;
50
+ }
51
+ }
packages/blocks/assets/js/payment-methods/googlepay/util.js ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {getShippingOptionId, removeNumberPrecision, toCartAddress as mapAddressToCartAddress} from "../util";
2
+ import {formatPrice} from '../util';
3
+
4
+ const ADDRESS_MAPPINGS = {
5
+ name: (address, name) => {
6
+ address.first_name = name.split(' ').slice(0, -1).join(' ');
7
+ address.last_name = name.split(' ').pop();
8
+ return address;
9
+ },
10
+ countryCode: 'country',
11
+ address1: 'address_1',
12
+ address2: 'address_2',
13
+ locality: 'city',
14
+ administrativeArea: 'state',
15
+ postalCode: 'postcode',
16
+ email: 'email',
17
+ phoneNumber: 'phone'
18
+ }
19
+
20
+ export const getTransactionInfo = ({billing, processingCountry, totalPriceLabel}, status = 'ESTIMATED') => {
21
+ const {cartTotal, cartTotalItems, currency} = billing;
22
+ const transactionInfo = {
23
+ countryCode: processingCountry,
24
+ currencyCode: currency.code,
25
+ totalPriceStatus: status,
26
+ totalPrice: removeNumberPrecision(cartTotal.value, currency.minorUnit).toString(),
27
+ displayItems: getDisplayItems(cartTotalItems, currency.minorUnit),
28
+ totalPriceLabel
29
+ }
30
+ return transactionInfo;
31
+ }
32
+
33
+ export const getPaymentRequestUpdate = ({billing, shippingData, processingCountry, totalPriceLabel}) => {
34
+ const {needsShipping, shippingRates} = shippingData;
35
+ let update = {
36
+ newTransactionInfo: getTransactionInfo({
37
+ billing, processingCountry, totalPriceLabel
38
+ }, 'FINAL')
39
+ }
40
+ if (needsShipping) {
41
+ update.newShippingOptionParameters = getShippingOptionParameters(shippingRates);
42
+ }
43
+ return update;
44
+ }
45
+
46
+ /**
47
+ * Return an array of line item objects
48
+ * @param cartTotalItems
49
+ * @param unit
50
+ * @returns {[]}
51
+ */
52
+ const getDisplayItems = (cartTotalItems, unit = 2) => {
53
+ let items = [];
54
+ cartTotalItems.forEach(item => {
55
+ if (0 < item.value) {
56
+ items.push({
57
+ label: item.label,
58
+ type: 'LINE_ITEM',
59
+ price: removeNumberPrecision(item.value, unit).toString()
60
+ });
61
+ }
62
+ })
63
+ return items;
64
+ }
65
+
66
+ export const getShippingOptionParameters = (shippingRates) => {
67
+ const shippingOptions = getShippingOptions(shippingRates);
68
+ const shippingOptionIds = shippingOptions.map(option => option.id);
69
+ let defaultSelectedOptionId = shippingOptionIds.slice(0, 1).shift();
70
+ shippingRates.forEach((shippingPackage, idx) => {
71
+ shippingPackage.shipping_rates.forEach(rate => {
72
+ if (rate.selected) {
73
+ defaultSelectedOptionId = getShippingOptionId(idx, rate.rate_id);
74
+ }
75
+ });
76
+ });
77
+ return {
78
+ shippingOptions,
79
+ defaultSelectedOptionId,
80
+ }
81
+ }
82
+
83
+ //id label description
84
+ export const getShippingOptions = (shippingRates) => {
85
+ let options = [];
86
+ shippingRates.forEach((shippingPackage, idx) => {
87
+ let rates = shippingPackage.shipping_rates.map(rate => {
88
+ let txt = document.createElement('textarea');
89
+ txt.innerHTML = rate.name;
90
+ let price = formatPrice(rate.price, rate.currency_code);
91
+ return {
92
+ id: getShippingOptionId(idx, rate.rate_id),
93
+ label: txt.value,
94
+ description: `${price}`
95
+ }
96
+ });
97
+ options = [...options, ...rates];
98
+ });
99
+ return options;
100
+ }
101
+
102
+ export const toCartAddress = mapAddressToCartAddress(ADDRESS_MAPPINGS);
packages/blocks/assets/js/payment-methods/hooks/index.js ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ export * from './use-process-payment-intent';
2
+ export * from './use-after-process-payment';
3
+ export * from './use-setup-intent';
4
+ export * from './use-stripe-error';
5
+ export * from './use-exported-values';
6
+ export * from './use-payment-request';
7
+ export * from './use-payment-events';
8
+ export * from './use-breakpoint-width';
9
+ export * from './use-process-checkout-error'
packages/blocks/assets/js/payment-methods/hooks/use-after-process-payment.js ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {useEffect} from '@wordpress/element'
2
+ import {useStripe} from "@stripe/react-stripe-js";
3
+ import {handleCardAction} from "../util";
4
+ import {useProcessCheckoutError} from "./use-process-checkout-error";
5
+
6
+ export const useAfterProcessingPayment = (
7
+ {
8
+ getData,
9
+ eventRegistration,
10
+ responseTypes,
11
+ activePaymentMethod,
12
+ savePaymentMethod = false,
13
+ messageContext = null
14
+ }) => {
15
+ const stripe = useStripe();
16
+ const {onCheckoutAfterProcessingWithSuccess, onCheckoutAfterProcessingWithError} = eventRegistration;
17
+ useProcessCheckoutError({
18
+ responseTypes,
19
+ subscriber: onCheckoutAfterProcessingWithError,
20
+ messageContext
21
+ });
22
+ useEffect(() => {
23
+ let unsubscribeAfterProcessingWithSuccess = onCheckoutAfterProcessingWithSuccess(async ({redirectUrl}) => {
24
+ if (getData('name') === activePaymentMethod) {
25
+ //check if response is in redirect. If so, open modal
26
+ return await handleCardAction({
27
+ redirectUrl,
28
+ responseTypes,
29
+ stripe,
30
+ getData,
31
+ savePaymentMethod
32
+ });
33
+ }
34
+ return null;
35
+ })
36
+ return () => unsubscribeAfterProcessingWithSuccess()
37
+ }, [
38
+ stripe,
39
+ responseTypes,
40
+ onCheckoutAfterProcessingWithSuccess,
41
+ activePaymentMethod,
42
+ savePaymentMethod
43
+ ]);
44
+ }
packages/blocks/assets/js/payment-methods/hooks/use-breakpoint-width.js ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {useState, useEffect, useCallback} from '@wordpress/element';
2
+ import {storeInCache, getFromCache} from "../util";
3
+
4
+ export const useBreakpointWidth = (
5
+ {
6
+ name,
7
+ width,
8
+ node,
9
+ className
10
+ }) => {
11
+ const [windowWidth, setWindowWith] = useState(window.innerWidth);
12
+ const getMaxWidth = useCallback((name) => {
13
+ const maxWidth = getFromCache(name);
14
+ return maxWidth ? parseInt(maxWidth) : 0;
15
+ }, []);
16
+ const setMaxWidth = useCallback((name, width) => storeInCache(name, width), []);
17
+
18
+ useEffect(() => {
19
+ const el = typeof node === 'function' ? node() : node;
20
+
21
+ if (el) {
22
+ const maxWidth = getMaxWidth(name);
23
+ if (!maxWidth || width > maxWidth) {
24
+ setMaxWidth(name, width);
25
+ }
26
+ if (el.clientWidth < width) {
27
+ el.classList.add(className);
28
+ } else {
29
+ if (el.clientWidth > maxWidth) {
30
+ el.classList.remove(className);
31
+ }
32
+ }
33
+ }
34
+ }, [windowWidth, node]);
35
+ useEffect(() => {
36
+ const handleResize = () => setWindowWith(window.innerWidth);
37
+ window.addEventListener('resize', handleResize);
38
+ return () => window.removeEventListener('resize', handleResize);
39
+ });
40
+ }
41
+
42
+ export const useExpressBreakpointWidth = (
43
+ {
44
+ payment_method,
45
+ width
46
+ }) => {
47
+ const node = useCallback(() => {
48
+ const el = document.getElementById(`express-payment-method-${payment_method}`);
49
+ return el ? el.parentNode : null;
50
+ }, []);
51
+ useBreakpointWidth({
52
+ name: 'expressMaxWidth',
53
+ width,
54
+ node,
55
+ className: 'wc-stripe-express__sm'
56
+ });
57
+
58
+ }
packages/blocks/assets/js/payment-methods/hooks/use-exported-values.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ import {useRef} from '@wordpress/element';
2
+
3
+ export const useExportedValues = () => {
4
+ const exportedValues = useRef({});
5
+ return exportedValues.current;
6
+ }
packages/blocks/assets/js/payment-methods/hooks/use-payment-events.js ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {useEffect, useCallback, useRef, useState} from '@wordpress/element';
2
+ import {hasShippingRates} from '../util';
3
+
4
+ export const usePaymentEvents = (
5
+ {
6
+ billing,
7
+ shippingData,
8
+ eventRegistration
9
+ }) => {
10
+ const {onShippingRateSuccess, onShippingRateFail, onShippingRateSelectSuccess} = eventRegistration;
11
+ const currentBilling = useRef(billing);
12
+ const currentShipping = useRef(shippingData);
13
+ const [handler, setHandler] = useState(null);
14
+ const [paymentEvents, setPaymentEvent] = useState({
15
+ onShippingChanged: false
16
+ });
17
+ const addPaymentEvent = useCallback((name, handler, execute = false) => {
18
+ if (execute) {
19
+ setHandler({[name]: handler});
20
+ } else {
21
+ setPaymentEvent({...paymentEvents, [name]: handler});
22
+ }
23
+ }, [paymentEvents, setPaymentEvent]);
24
+ const removePaymentEvent = useCallback((name) => {
25
+ if (paymentEvents[name]) {
26
+ delete paymentEvents[name];
27
+ setPaymentEvent(paymentEvents);
28
+ }
29
+ }, [paymentEvents]);
30
+
31
+ const onShippingChanged = useCallback(() => {
32
+ const shipping = currentShipping.current;
33
+ const billing = currentBilling.current;
34
+ if (paymentEvents.onShippingChanged && !shipping.isSelectingRate && !shipping.shippingRatesLoading) {
35
+ const handler = paymentEvents.onShippingChanged;
36
+ let success = true;
37
+ if (!hasShippingRates(shipping.shippingRates)) {
38
+ success = false;
39
+ }
40
+ handler(success, {
41
+ billing,
42
+ shipping
43
+ });
44
+ removePaymentEvent('onShippingChanged');
45
+ }
46
+ }, [paymentEvents, removePaymentEvent]);
47
+
48
+ useEffect(() => {
49
+ currentBilling.current = billing;
50
+ currentShipping.current = shippingData;
51
+ });
52
+
53
+ useEffect(() => {
54
+ if (handler) {
55
+ if (handler.onShippingChanged) {
56
+ handler.onShippingChanged(true, {
57
+ billing: currentBilling.current,
58
+ shipping: currentShipping.current
59
+ })
60
+ setHandler(null);
61
+ }
62
+ }
63
+ }, [handler]);
64
+
65
+ useEffect(() => {
66
+ const unsubscribeShippingRateSuccess = onShippingRateSuccess(onShippingChanged);
67
+ const unsubscribeShippingRateSelectSuccess = onShippingRateSelectSuccess(onShippingChanged);
68
+ const unsubscribeShippingRateFail = onShippingRateFail(({hasInvalidAddress, hasError}) => {
69
+ if (paymentEvents.onShippingChanged) {
70
+ const handler = paymentEvents.onShippingChanged;
71
+ handler(false);
72
+ removePaymentEvent('onShippingChanged');
73
+ }
74
+ });
75
+
76
+ return () => {
77
+ unsubscribeShippingRateSuccess();
78
+ unsubscribeShippingRateFail();
79
+ unsubscribeShippingRateSelectSuccess();
80
+ }
81
+ }, [
82
+ paymentEvents,
83
+ onShippingRateSuccess,
84
+ onShippingRateFail,
85
+ onShippingRateSelectSuccess
86
+ ]);
87
+
88
+ return {addPaymentEvent, removePaymentEvent};
89
+ }
packages/blocks/assets/js/payment-methods/hooks/use-payment-request.js ADDED
@@ -0,0 +1,140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {useState, useEffect, useRef, useCallback} from '@wordpress/element';
2
+ import {usePaymentEvents} from './use-payment-events';
3
+ import {getIntermediateAddress} from '../util';
4
+ import isShallowEqual from '@wordpress/is-shallow-equal';
5
+ import {
6
+ getDisplayItems,
7
+ getShippingOptions,
8
+ getSelectedShippingOption,
9
+ isFieldRequired,
10
+ toCartAddress as mapToCartAddress
11
+ } from "../util";
12
+
13
+ const toCartAddress = mapToCartAddress();
14
+
15
+ export const usePaymentRequest = (
16
+ {
17
+ getData,
18
+ onClose,
19
+ stripe,
20
+ billing,
21
+ shippingData,
22
+ eventRegistration,
23
+ setPaymentMethod,
24
+ exportedValues,
25
+ canPay
26
+ }) => {
27
+ const {addPaymentEvent} = usePaymentEvents({
28
+ billing,
29
+ shippingData,
30
+ eventRegistration
31
+ });
32
+ const {needsShipping, shippingRates} = shippingData;
33
+ const {billingData, cartTotalItems, currency, cartTotal} = billing;
34
+ const [paymentRequest, setPaymentRequest] = useState(null);
35
+ const paymentRequestOptions = useRef({});
36
+ const currentShipping = useRef(shippingData)
37
+ const currentBilling = useRef(billing);
38
+
39
+ useEffect(() => {
40
+ currentShipping.current = shippingData;
41
+ currentBilling.current = billing;
42
+ }, [shippingData]);
43
+
44
+ useEffect(() => {
45
+ if (stripe) {
46
+ const options = {
47
+ country: getData('countryCode'),
48
+ currency: currency?.code.toLowerCase(),
49
+ total: {
50
+ amount: cartTotal.value,
51
+ label: cartTotal.label,
52
+ pending: true
53
+ },
54
+ requestPayerName: true,
55
+ requestPayerEmail: isFieldRequired('email', billingData.country),
56
+ requestPayerPhone: isFieldRequired('phone', billingData.country),
57
+ requestShipping: needsShipping,
58
+ displayItems: getDisplayItems(cartTotalItems, currency)
59
+ }
60
+ if (options.requestShipping) {
61
+ options.shippingOptions = getShippingOptions(shippingRates);
62
+ }
63
+ paymentRequestOptions.current = options;
64
+ const paymentRequest = stripe.paymentRequest(paymentRequestOptions.current);
65
+ paymentRequest.canMakePayment().then(result => {
66
+ if (canPay(result)) {
67
+ setPaymentRequest(paymentRequest);
68
+ } else {
69
+ setPaymentRequest(null);
70
+ }
71
+ });
72
+ }
73
+ }, [stripe, billingData, shippingRates, needsShipping]);
74
+
75
+ useEffect(() => {
76
+ if (paymentRequest) {
77
+ if (paymentRequestOptions.current.requestShipping) {
78
+ paymentRequest.on('shippingaddresschange', onShippingAddressChange);
79
+ paymentRequest.on('shippingoptionchange', onShippingOptionChange);
80
+ }
81
+ paymentRequest.on('cancel', onClose);
82
+ paymentRequest.on('paymentmethod', onPaymentMethodReceived);
83
+ }
84
+ }, [paymentRequest]);
85
+
86
+ const updatePaymentEvent = useCallback((event) => (success, {billing, shipping}) => {
87
+ const {cartTotal, cartTotalItems, currency} = billing;
88
+ const {shippingRates} = shipping;
89
+ if (success) {
90
+ event.updateWith({
91
+ status: 'success',
92
+ total: {
93
+ amount: cartTotal.value,
94
+ label: cartTotal.label,
95
+ pending: false
96
+ },
97
+ displayItems: getDisplayItems(cartTotalItems, currency),
98
+ shippingOptions: getShippingOptions(shippingRates)
99
+ });
100
+ } else {
101
+ event.updateWith({status: 'invalid_shipping_address'});
102
+ }
103
+ }, []);
104
+
105
+ const onShippingAddressChange = useCallback(event => {
106
+ const {shippingAddress} = event;
107
+ const shipping = currentShipping.current;
108
+ const intermediateAddress = toCartAddress(shippingAddress);
109
+ shipping.setShippingAddress({...shipping.shippingAddress, ...intermediateAddress});
110
+ const addressEqual = isShallowEqual(getIntermediateAddress(shipping.shippingAddress), intermediateAddress);
111
+ addPaymentEvent('onShippingChanged', updatePaymentEvent(event), addressEqual);
112
+ }, [addPaymentEvent]);
113
+
114
+ const onShippingOptionChange = useCallback(event => {
115
+ const {shippingOption} = event;
116
+ const shipping = currentShipping.current;
117
+ shipping.setSelectedRates(...getSelectedShippingOption(shippingOption.id));
118
+ addPaymentEvent('onShippingChanged', updatePaymentEvent(event));
119
+ }, [addPaymentEvent]);
120
+
121
+ const onPaymentMethodReceived = useCallback((paymentResponse) => {
122
+ const {paymentMethod, payerName = null, payerEmail = null, payerPhone = null} = paymentResponse;
123
+ // set address data
124
+ let billingData = {payerName, payerEmail, payerPhone};
125
+ if (paymentMethod?.billing_details.address) {
126
+ billingData = toCartAddress(paymentMethod.billing_details.address, billingData);
127
+ }
128
+ exportedValues.billingData = billingData;
129
+
130
+ if (paymentResponse.shippingAddress) {
131
+ exportedValues.shippingAddress = toCartAddress(paymentResponse.shippingAddress);
132
+ }
133
+
134
+ // set payment method
135
+ setPaymentMethod(paymentMethod.id);
136
+ paymentResponse.complete("success");
137
+ }, [setPaymentMethod]);
138
+
139
+ return {paymentRequest};
140
+ }
packages/blocks/assets/js/payment-methods/hooks/use-process-checkout-error.js ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {useEffect} from '@wordpress/element';
2
+
3
+ export const useProcessCheckoutError = (
4
+ {
5
+ responseTypes,
6
+ subscriber,
7
+ messageContext = null
8
+ }) => {
9
+ useEffect(() => {
10
+ const unsubscribe = subscriber((data) => {
11
+ if (data?.processingResponse.paymentDetails?.stripeErrorMessage) {
12
+ return {
13
+ type: responseTypes.ERROR,
14
+ message: data.processingResponse.paymentDetails.stripeErrorMessage,
15
+ messageContext
16
+ };
17
+ }
18
+ return null;
19
+ });
20
+ return () => unsubscribe();
21
+ }, [responseTypes, subscriber]);
22
+ }
packages/blocks/assets/js/payment-methods/hooks/use-process-payment-intent.js ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {useEffect, useState, useCallback, useRef} from '@wordpress/element';
2
+ import {useStripe} from '@stripe/react-stripe-js';
3
+ import {
4
+ ensureSuccessResponse,
5
+ ensureErrorResponse,
6
+ getBillingDetailsFromAddress,
7
+ StripeError
8
+ } from '../util';
9
+
10
+ export const useProcessPaymentIntent = (
11
+ {
12
+ getData,
13
+ billing,
14
+ shippingData,
15
+ onPaymentProcessing,
16
+ emitResponse,
17
+ error,
18
+ onSubmit,
19
+ activePaymentMethod,
20
+ paymentType = 'card',
21
+ setupIntent = null,
22
+ removeSetupIntent = null,
23
+ savePaymentMethod = false,
24
+ exportedValues = {},
25
+ getPaymentMethodArgs = () => ({})
26
+ }) => {
27
+ const {billingData} = billing;
28
+ const {shippingAddress} = shippingData;
29
+ const {responseTypes} = emitResponse;
30
+ const [paymentMethod, setPaymentMethod] = useState(null);
31
+ const stripe = useStripe();
32
+ const currentPaymentMethodArgs = useRef(getPaymentMethodArgs);
33
+
34
+ useEffect(() => {
35
+ currentPaymentMethodArgs.current = getPaymentMethodArgs;
36
+ }, [getPaymentMethodArgs]);
37
+
38
+ const getCreatePaymentMethodArgs = useCallback(() => {
39
+ const args = {
40
+ type: paymentType,
41
+ billing_details: getBillingDetailsFromAddress(exportedValues?.billingData ? exportedValues.billingData : billingData)
42
+ }
43
+ return {...args, ...currentPaymentMethodArgs.current()};
44
+ }, [billingData, paymentType, getPaymentMethodArgs]);
45
+
46
+ const getSuccessResponse = useCallback((paymentMethodId, savePaymentMethod) => {
47
+ const response = {
48
+ meta: {
49
+ paymentMethodData: {
50
+ [`${getData('name')}_token_key`]: paymentMethodId,
51
+ [`${getData('name')}_save_source_key`]: savePaymentMethod
52
+ }
53
+ }
54
+ }
55
+ if (exportedValues?.billingData) {
56
+ response.meta.billingData = exportedValues.billingData;
57
+ }
58
+ if (exportedValues?.shippingAddress) {
59
+ response.meta.shippingData = {address: exportedValues.shippingAddress};
60
+ }
61
+ return response;
62
+ }, [billingData, shippingAddress]);
63
+
64
+ useEffect(() => {
65
+ if (paymentMethod && typeof paymentMethod === 'string') {
66
+ onSubmit();
67
+ }
68
+ }, [paymentMethod]);
69
+
70
+ useEffect(() => {
71
+ const unsubscribeProcessingPayment = onPaymentProcessing(async () => {
72
+ if (activePaymentMethod !== getData('name')) {
73
+ return null;
74
+ }
75
+ let [result, paymentMethodId] = [null, null];
76
+ try {
77
+ if (error) {
78
+ throw new StripeError(error);
79
+ }
80
+ if (setupIntent) {
81
+ result = await stripe.confirmCardSetup(setupIntent.client_secret, {
82
+ payment_method: getCreatePaymentMethodArgs()
83
+ });
84
+ if (result.error) {
85
+ throw new StripeError(result.error);
86
+ }
87
+ paymentMethodId = result.setupIntent.payment_method;
88
+ removeSetupIntent();
89
+ } else {
90
+ // payment method has already been created.
91
+ if (paymentMethod) {
92
+ paymentMethodId = paymentMethod;
93
+ } else {
94
+ //create the payment method
95
+ result = await stripe.createPaymentMethod(getCreatePaymentMethodArgs());
96
+ if (result.error) {
97
+ throw new StripeError(result.error);
98
+ }
99
+ paymentMethodId = result.paymentMethod.id;
100
+ }
101
+ }
102
+ return ensureSuccessResponse(responseTypes, getSuccessResponse(paymentMethodId, savePaymentMethod));
103
+ } catch (e) {
104
+ console.log(e);
105
+ setPaymentMethod(null);
106
+ return ensureErrorResponse(responseTypes, e.error);
107
+ }
108
+
109
+ });
110
+ return () => unsubscribeProcessingPayment();
111
+ }, [
112
+ paymentMethod,
113
+ billingData,
114
+ onPaymentProcessing,
115
+ stripe,
116
+ setupIntent,
117
+ activePaymentMethod,
118
+ savePaymentMethod
119
+ ]);
120
+ return {setPaymentMethod};
121
+ }
packages/blocks/assets/js/payment-methods/hooks/use-setup-intent.js ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {useEffect, useState, useCallback} from '@wordpress/element';
2
+ import apiFetch from "@wordpress/api-fetch";
3
+ import {
4
+ getSettings,
5
+ getRoute,
6
+ cartContainsPreOrder,
7
+ cartContainsSubscription,
8
+ getFromCache,
9
+ storeInCache,
10
+ deleteFromCache
11
+ } from '../util';
12
+
13
+ export const useSetupIntent = (
14
+ {
15
+ cartTotal,
16
+ setError
17
+ }) => {
18
+ const [setupIntent, setSetupIntent] = useState(getFromCache('setupIntent'));
19
+
20
+ useEffect(() => {
21
+ const createSetupIntent = async () => {
22
+ if (setupIntent) {
23
+ return;
24
+ }
25
+ // only create intent under certain conditions
26
+ let result = await apiFetch({
27
+ url: getRoute('create/setup_intent'),
28
+ method: 'POST'
29
+ });
30
+ if (result.code) {
31
+ setError(result.message);
32
+ } else {
33
+ storeInCache('setupIntent', result.intent);
34
+ setSetupIntent(result.intent);
35
+ }
36
+ }
37
+ if (cartContainsPreOrder() || (cartContainsSubscription() && cartTotal.value == 0)) {
38
+ if (!setupIntent) {
39
+ createSetupIntent();
40
+ }
41
+ } else {
42
+ setSetupIntent(null);
43
+ }
44
+ }, [cartTotal.value]);
45
+ const removeSetupIntent = useCallback(() => {
46
+ deleteFromCache('setupIntent');
47
+ }, [cartTotal.value]);
48
+ return {setupIntent, removeSetupIntent};
49
+ }
packages/blocks/assets/js/payment-methods/hooks/use-stripe-error.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ import {useState} from '@wordpress/element'
2
+
3
+ export const useStripeError = () => {
4
+ const [error, setError] = useState(false);
5
+ return [error, setError];
6
+ }
packages/blocks/assets/js/payment-methods/local-payment/alipay.js ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {registerPaymentMethod} from '@woocommerce/blocks-registry';
2
+ import {getSettings} from "../util";
3
+ import {LocalPaymentSourceContent} from './local-payment-method';
4
+ import {PaymentMethodLabel} from "../../components/checkout/payment-method-label";
5
+ import {canMakePayment} from "./local-payment-method";
6
+ import {PaymentMethod} from "../../components/checkout";
7
+
8
+ const getData = getSettings('stripe_alipay_data');
9
+
10
+ if (getData()) {
11
+ registerPaymentMethod({
12
+ name: getData('name'),
13
+ label: <PaymentMethodLabel
14
+ title={getData('title')}
15
+ paymentMethod={getData('name')}
16
+ icons={getData('icon')}/>,
17
+ ariaLabel: 'Alipay',
18
+ placeOrderButtonLabel: getData('placeOrderButtonLabel'),
19
+ canMakePayment: canMakePayment(getData),
20
+ content: <PaymentMethod
21
+ content={LocalPaymentSourceContent}
22
+ getData={getData}/>,
23
+ edit: <PaymentMethod
24
+ content={LocalPaymentSourceContent}
25
+ getData={getData}/>,
26
+ supports: {
27
+ showSavedCards: false,
28
+ showSaveOption: false,
29
+ features: getData('features')
30
+ }
31
+ })
32
+ }
packages/blocks/assets/js/payment-methods/local-payment/bancontact.js ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {registerPaymentMethod} from '@woocommerce/blocks-registry';
2
+ import {getSettings} from "../util";
3
+ import {LocalPaymentSourceContent} from './local-payment-method';
4
+ import {PaymentMethodLabel, PaymentMethod} from "../../components/checkout";
5
+ import {canMakePayment} from "./local-payment-method";
6
+
7
+ const getData = getSettings('stripe_bancontact_data');
8
+
9
+ if (getData()) {
10
+ registerPaymentMethod({
11
+ name: getData('name'),
12
+ label: <PaymentMethodLabel
13
+ title={getData('title')}
14
+ paymentMethod={getData('name')}
15
+ icons={getData('icon')}/>,
16
+ ariaLabel: 'Bancontact',
17
+ placeOrderButtonLabel: getData('placeOrderButtonLabel'),
18
+ canMakePayment: canMakePayment(getData),
19
+ content: <PaymentMethod
20
+ content={LocalPaymentSourceContent}
21
+ getData={getData}/>,
22
+ edit: <PaymentMethod
23
+ content={LocalPaymentSourceContent}
24
+ getData={getData}/>,
25
+ supports: {
26
+ showSavedCards: false,
27
+ showSaveOption: false,
28
+ features: getData('features')
29
+ }
30
+ })
31
+ }
packages/blocks/assets/js/payment-methods/local-payment/becs.js ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {registerPaymentMethod} from '@woocommerce/blocks-registry';
2
+ import {getSettings} 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 {AuBankAccountElement} from "@stripe/react-stripe-js";
7
+
8
+ const getData = getSettings('stripe_becs_data');
9
+
10
+ if (getData()) {
11
+ registerPaymentMethod({
12
+ name: getData('name'),
13
+ label: <PaymentMethodLabel
14
+ title={getData('title')}
15
+ paymentMethod={getData('name')}
16
+ icons={getData('icon')}/>,
17
+ ariaLabel: 'BECS',
18
+ placeOrderButtonLabel: getData('placeOrderButtonLabel'),
19
+ canMakePayment: canMakePayment(getData),
20
+ content: <PaymentMethod
21
+ content={LocalPaymentIntentContent}
22
+ getData={getData}
23
+ confirmationMethod={'confirmAuBecsDebitPayment'}
24
+ component={AuBankAccountElement}/>,
25
+ edit: <PaymentMethod content={LocalPaymentIntentContent} getData={getData}/>,
26
+ supports: {
27
+ showSavedCards: false,
28
+ showSaveOption: false,
29
+ features: getData('features')
30
+ }
31
+ })
32
+ }
packages/blocks/assets/js/payment-methods/local-payment/eps.js ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {registerPaymentMethod} from '@woocommerce/blocks-registry';
2
+ import {getSettings} from "../util";
3
+ import {LocalPaymentSourceContent} from './local-payment-method';
4
+ import {PaymentMethodLabel, PaymentMethod} from "../../components/checkout";
5
+ import {canMakePayment} from "./local-payment-method";
6
+
7
+ const getData = getSettings('stripe_eps_data');
8
+
9
+ if (getData()) {
10
+ registerPaymentMethod({
11
+ name: getData('name'),
12
+ label: <PaymentMethodLabel
13
+ title={getData('title')}
14
+ paymentMethod={getData('name')}
15
+ icons={getData('icon')}/>,
16
+ ariaLabel: 'EPS',
17
+ placeOrderButtonLabel: getData('placeOrderButtonLabel'),
18
+ canMakePayment: canMakePayment(getData),
19
+ content: <PaymentMethod content={LocalPaymentSourceContent} getData={getData}/>,
20
+ edit: <PaymentMethod content={LocalPaymentSourceContent} getData={getData}/>,
21
+ supports: {
22
+ showSavedCards: false,
23
+ showSaveOption: false,
24
+ features: getData('features')
25
+ }
26
+ })
27
+ }
packages/blocks/assets/js/payment-methods/local-payment/fpx.js ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {registerPaymentMethod} from '@woocommerce/blocks-registry';
2
+ import {getSettings} 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 {FpxBankElement} from "@stripe/react-stripe-js";
7
+
8
+ const getData = getSettings('stripe_fpx_data');
9
+
10
+ if (getData()) {
11
+ registerPaymentMethod({
12
+ name: getData('name'),
13
+ label: <PaymentMethodLabel
14
+ title={getData('title')}
15
+ paymentMethod={getData('name')}
16
+ icons={getData('icon')}/>,
17
+ ariaLabel: 'FPX',
18
+ placeOrderButtonLabel: getData('placeOrderButtonLabel'),
19
+ canMakePayment: canMakePayment(getData),
20
+ content: <PaymentMethod
21
+ content={LocalPaymentIntentContent}
22
+ getData={getData}
23
+ confirmationMethod={'confirmIdealPayment'}
24
+ component={FpxBankElement}/>,
25
+ edit: <PaymentMethod content={LocalPaymentIntentContent} getData={getData}/>,
26
+ supports: {
27
+ showSavedCards: false,
28
+ showSaveOption: false,
29
+ features: getData('features')
30
+ }
31
+ })
32
+ }
packages/blocks/assets/js/payment-methods/local-payment/giropay.js ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {registerPaymentMethod} from '@woocommerce/blocks-registry';
2
+ import {getSettings} from "../util";
3
+ import {LocalPaymentSourceContent} from './local-payment-method';
4
+ import {PaymentMethodLabel, PaymentMethod} from "../../components/checkout";
5
+ import {canMakePayment} from "./local-payment-method";
6
+
7
+ const getData = getSettings('stripe_giropay_data');
8
+
9
+ if (getData()) {
10
+ registerPaymentMethod({
11
+ name: getData('name'),
12
+ label: <PaymentMethodLabel
13
+ title={getData('title')}
14
+ paymentMethod={getData('name')}
15
+ icons={getData('icon')}/>,
16
+ ariaLabel: 'Giropay',
17
+ placeOrderButtonLabel: getData('placeOrderButtonLabel'),
18
+ canMakePayment: canMakePayment(getData),
19
+ content: <PaymentMethod content={LocalPaymentSourceContent} getData={getData}/>,
20
+ edit: <PaymentMethod content={LocalPaymentSourceContent} getData={getData}/>,
21
+ supports: {
22
+ showSavedCards: false,
23
+ showSaveOption: false,
24
+ features: getData('features')
25
+ }
26
+ })
27
+ }
packages/blocks/assets/js/payment-methods/local-payment/grabpay.js ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {registerPaymentMethod} from '@woocommerce/blocks-registry';
2
+ import {getSettings} from "../util";
3
+ import {LocalPaymentIntentContent} from './local-payment-method';
4
+ import {PaymentMethodLabel, PaymentMethod} from "../../components/checkout";
5
+ import {canMakePayment} from "./local-payment-method";
6
+
7
+ const getData = getSettings('stripe_grabpay_data');
8
+
9
+ if (getData()) {
10
+ registerPaymentMethod({
11
+ name: getData('name'),
12
+ label: <PaymentMethodLabel
13
+ title={getData('title')}
14
+ paymentMethod={getData('name')}
15
+ icons={getData('icon')}/>,
16
+ ariaLabel: 'GrabPay',
17
+ placeOrderButtonLabel: getData('placeOrderButtonLabel'),
18
+ canMakePayment: canMakePayment(getData),
19
+ content: <PaymentMethod
20
+ content={LocalPaymentIntentContent}
21
+ getData={getData}
22
+ confirmationMethod={'confirmGrabPayPayment'}/>,
23
+ edit: <PaymentMethod content={LocalPaymentIntentContent} getData={getData}/>,
24
+ supports: {
25
+ showSavedCards: false,
26
+ showSaveOption: false,
27
+ features: getData('features')
28
+ }
29
+ })
30
+ }
packages/blocks/assets/js/payment-methods/local-payment/hooks/index.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ export * from './use-after-process-local-payment';
2
+ export * from './use-validate-checkout';
3
+ export * from './use-create-source';
packages/blocks/assets/js/payment-methods/local-payment/hooks/use-after-process-local-payment.js ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {useEffect, useRef} from '@wordpress/element';
2
+ import {useStripe} from "@stripe/react-stripe-js";
3
+ import {ensureErrorResponse, getBillingDetailsFromAddress, StripeError} from "../../util";
4
+
5
+ export const useAfterProcessLocalPayment = (
6
+ {
7
+ getData,
8
+ billingData,
9
+ eventRegistration,
10
+ responseTypes,
11
+ activePaymentMethod,
12
+ confirmationMethod,
13
+ getPaymentMethodArgs = () => ({})
14
+ }
15
+ ) => {
16
+ const stripe = useStripe();
17
+ const {onCheckoutAfterProcessingWithSuccess, onCheckoutAfterProcessingWithError} = eventRegistration;
18
+ const currentBillingData = useRef(billingData);
19
+ const currentPaymentMethodArgs = useRef(getPaymentMethodArgs);
20
+ useEffect(() => {
21
+ currentBillingData.current = billingData;
22
+ }, [billingData]);
23
+
24
+ useEffect(() => {
25
+ currentPaymentMethodArgs.current = getPaymentMethodArgs;
26
+ }, [getPaymentMethodArgs]);
27
+
28
+ useEffect(() => {
29
+ const unsubscribeAfterProcessingWithSuccess = onCheckoutAfterProcessingWithSuccess(async ({redirectUrl}) => {
30
+ if (getData('name') === activePaymentMethod) {
31
+ try {
32
+ let match = redirectUrl.match(/#response=(.+)/);
33
+ if (match) {
34
+ let {client_secret, return_url, ...order} = JSON.parse(window.atob(decodeURIComponent(match[1])));
35
+ let result = await stripe[confirmationMethod](client_secret, {
36
+ payment_method: {
37
+ billing_details: getBillingDetailsFromAddress(currentBillingData.current),
38
+ ...currentPaymentMethodArgs.current()
39
+ },
40
+ return_url
41
+ });
42
+ if (result.error) {
43
+ throw new StripeError(result.error);
44
+ }
45
+ }
46
+ } catch (e) {
47
+ console.log(e);
48
+ return ensureErrorResponse(responseTypes, e.error);
49
+ }
50
+ }
51
+ })
52
+ return () => unsubscribeAfterProcessingWithSuccess();
53
+ }, [
54
+ stripe,
55
+ onCheckoutAfterProcessingWithSuccess,
56
+ onCheckoutAfterProcessingWithError
57
+ ]);
58
+ }
packages/blocks/assets/js/payment-methods/local-payment/hooks/use-create-source.js ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {useState, useEffect, useRef, useCallback} from '@wordpress/element';
2
+ import {
3
+ getDefaultSourceArgs,
4
+ ensureSuccessResponse,
5
+ ensureErrorResponse,
6
+ StripeError
7
+ } from "../../util";
8
+ import {useStripe, useElements} from "@stripe/react-stripe-js";
9
+ import {__} from '@wordpress/i18n';
10
+
11
+ export const useCreateSource = (
12
+ {
13
+ getData,
14
+ billing,
15
+ shippingAddress,
16
+ onPaymentProcessing,
17
+ responseTypes,
18
+ getSourceArgs = false,
19
+ element = false
20
+ }) => {
21
+ const [source, setSource] = useState(false);
22
+ const [isValid, setIsValid] = useState(false);
23
+ const currentValues = useRef({
24
+ billing,
25
+ shippingAddress,
26
+ });
27
+ const stripe = useStripe();
28
+ const elements = useElements();
29
+ useEffect(() => {
30
+ currentValues.current = {
31
+ billing,
32
+ shippingAddress
33
+ }
34
+ });
35
+
36
+ const getSourceArgsInternal = useCallback(() => {
37
+ const {billing} = currentValues.current;
38
+ const {cartTotal, currency, billingData} = billing;
39
+ let args = getDefaultSourceArgs({
40
+ type: getData('paymentType'),
41
+ amount: cartTotal.value,
42
+ billingData,
43
+ currency: currency.code,
44
+ returnUrl: getData('returnUrl')
45
+ });
46
+ if (getSourceArgs) {
47
+ args = getSourceArgs(args, {billingData});
48
+ }
49
+ return args;
50
+ }, []);
51
+
52
+ const getSuccessData = useCallback((sourceId) => {
53
+ return {
54
+ meta: {
55
+ paymentMethodData: {
56
+ [`${getData('name')}_token_key`]: sourceId
57
+ }
58
+ }
59
+ }
60
+ }, []);
61
+
62
+ useEffect(() => {
63
+ const unsubscribe = onPaymentProcessing(async () => {
64
+ if (source) {
65
+ return ensureSuccessResponse(responseTypes, getSuccessData(source.id));
66
+ }
67
+ // create the source
68
+ try {
69
+ let result;
70
+ if (element) {
71
+ // validate the element
72
+ if (!isValid) {
73
+ throw __('Please enter your payment info before proceeding.', 'woo-stripe-payment');
74
+ }
75
+ result = await stripe.createSource(elements.getElement(element), getSourceArgsInternal());
76
+ } else {
77
+ result = await stripe.createSource(getSourceArgsInternal());
78
+ }
79
+ if (result.error) {
80
+ throw new StripeError(result.error);
81
+ }
82
+ setSource(result.source);
83
+ return ensureSuccessResponse(responseTypes, getSuccessData(result.source.id));
84
+ } catch (err) {
85
+ console.log(err);
86
+ return ensureErrorResponse(responseTypes, err.error || err);
87
+ }
88
+ });
89
+ return () => unsubscribe();
90
+ }, [
91
+ source,
92
+ onPaymentProcessing,
93
+ stripe,
94
+ responseTypes,
95
+ element,
96
+ isValid,
97
+ setIsValid
98
+ ]);
99
+ return {setIsValid};
100
+ }
packages/blocks/assets/js/payment-methods/local-payment/hooks/use-validate-checkout.js ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {useEffect, useRef, useState} from '@wordpress/element';
2
+ import {ensureErrorResponse} from "../../util";
3
+ import {__} from "@wordpress/i18n";
4
+
5
+ export const useValidateCheckout = (
6
+ {
7
+ subscriber,
8
+ responseTypes,
9
+ component = null,
10
+ msg = __('Please enter your payment info before proceeding.', 'woo-stripe-payment')
11
+ }) => {
12
+ const [isValid, setIsValid] = useState(false);
13
+
14
+ useEffect(() => {
15
+ const unsubscribe = subscriber(() => {
16
+ if (component && !isValid) {
17
+ return ensureErrorResponse(responseTypes, msg);
18
+ }
19
+ return true;
20
+ });
21
+ return () => unsubscribe();
22
+ }, [
23
+ subscriber,
24
+ isValid,
25
+ setIsValid,
26
+ responseTypes,
27
+ component
28
+ ]);
29
+ return {isValid, setIsValid};
30
+ }
packages/blocks/assets/js/payment-methods/local-payment/ideal.js ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {registerPaymentMethod} from '@woocommerce/blocks-registry';
2
+ import {getSettings} 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 {IdealBankElement} from "@stripe/react-stripe-js";
7
+
8
+ const getData = getSettings('stripe_ideal_data');
9
+
10
+ if (getData()) {
11
+ registerPaymentMethod({
12
+ name: getData('name'),
13
+ label: <PaymentMethodLabel
14
+ title={getData('title')}
15
+ paymentMethod={getData('name')}
16
+ icons={getData('icon')}/>,
17
+ ariaLabel: 'Ideal',
18
+ placeOrderButtonLabel: getData('placeOrderButtonLabel'),
19
+ canMakePayment: canMakePayment(getData),
20
+ content: <PaymentMethod
21
+ content={LocalPaymentIntentContent}
22
+ getData={getData}
23
+ confirmationMethod={'confirmIdealPayment'}
24
+ component={IdealBankElement}/>,
25
+ edit: <PaymentMethod content={LocalPaymentIntentContent} getData={getData}/>,
26
+ supports: {
27
+ showSavedCards: false,
28
+ showSaveOption: false,
29
+ features: getData('features')
30
+ }
31
+ })
32
+ }
packages/blocks/assets/js/payment-methods/local-payment/index.js ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import './klarna';
2
+ import './ideal';
3
+ import './p24';
4
+ import './bancontact';
5
+ import './giropay';
6
+ import './eps';
7
+ import './multibanco';
8
+ import './sepa';
9
+ import './sofort';
10
+ import './wechat';
11
+ import './fpx';
12
+ import './becs';
13
+ import './grabpay';
14
+ import './alipay'
packages/blocks/assets/js/payment-methods/local-payment/klarna/categories.js ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {useEffect} from '@wordpress/element';
2
+ import RadioControlAccordion from "../../../components/checkout/radio-control-accordion";
3
+
4
+ export const KlarnaPaymentCategories = ({categories, onChange, selected}) => {
5
+ return (
6
+ <div className={'wc-stripe-blocks-klarna-container'}>
7
+ <ul>
8
+ {categories.map(category => {
9
+ return <KlarnaPaymentCategory
10
+ key={category.type}
11
+ category={category}
12
+ onChange={onChange}
13
+ selected={selected}/>
14
+ })}
15
+ </ul>
16
+ </div>
17
+ );
18
+ }
19
+
20
+ const KlarnaPaymentCategory = ({category, selected, onChange}) => {
21
+ const checked = category.type === selected;
22
+ useEffect(() => {
23
+ Klarna.Payments.load({
24
+ container: `#klarna-category-${category.type}`,
25
+ payment_method_category: category.type,
26
+ //instance_id: `klarna-instance-${category.type}`
27
+ });
28
+ }, []);
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 ADDED
@@ -0,0 +1,2 @@
 
 
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 ADDED
@@ -0,0 +1,240 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ let klarnaSource = {};
8
+
9
+ export const useCreateSource = (
10
+ {
11
+ getData,
12
+ billing,
13
+ shippingData,
14
+ }) => {
15
+ const stripe = useStripe();
16
+ const [error, setError] = useStripeError();
17
+ const abortController = useRef(new AbortController());
18
+ const currentSourceArgs = useRef({});
19
+ const oldSourceArgs = useRef({});
20
+ const [isLoading, setIsLoading] = useState(false);
21
+ const [source, setSource] = useState(false);
22
+ const {billingData, cartTotal, cartTotalItems, currency} = billing;
23
+ const isCheckoutValid = useCallback(({billingData, shippingData}) => {
24
+ const {needsShipping, shippingAddress} = shippingData;
25
+ if (isAddressValid(billingData)) {
26
+ if (needsShipping) {
27
+ return isAddressValid(shippingAddress);
28
+ }
29
+ return true;
30
+ }
31
+ return false;
32
+ }, []);
33
+ const getLineItems = useCallback((cartTotalItems, currency) => {
34
+ const items = [];
35
+ cartTotalItems.forEach(item => {
36
+ items.push({
37
+ amount: item.value,
38
+ currency,
39
+ description: item.label,
40
+ quantity: 1
41
+ });
42
+ });
43
+ return items;
44
+ }, []);
45
+
46
+ const getSourceArgs = useCallback(({cartTotal, cartTotalItems, billingData, currency, shippingData}) => {
47
+ const {first_name, last_name, country} = billingData;
48
+ const {needsShipping, shippingAddress} = shippingData;
49
+ let args = getDefaultSourceArgs({
50
+ type: getData('paymentType'),
51
+ amount: cartTotal.value,
52
+ billingData,
53
+ currency: currency.code,
54
+ returnUrl: getData('returnUrl')
55
+ });
56
+ args = {
57
+ ...args, ...{
58
+ source_order: {
59
+ items: getLineItems(cartTotalItems, currency.code)
60
+ },
61
+ klarna: {
62
+ locale: getData('locale'),
63
+ product: 'payment',
64
+ purchase_country: country,
65
+ first_name,
66
+ last_name
67
+ }
68
+ }
69
+ }
70
+ if (country == 'US') {
71
+ args.klarna.custom_payment_methods = 'payin4,installments';
72
+ }
73
+ if (needsShipping) {
74
+ args.klarna = {
75
+ ...args.klarna, ...{
76
+ shipping_first_name: shippingAddress.first_name,
77
+ shipping_last_name: shippingAddress.last_name
78
+ }
79
+ }
80
+ args.source_order.shipping = {
81
+ address: {
82
+ city: shippingAddress.city || '',
83
+ country: shippingAddress.country || '',
84
+ line1: shippingAddress.address_1 || '',
85
+ line2: shippingAddress.address_2 || '',
86
+ postal_code: shippingAddress.postcode || '',
87
+ state: shippingAddress.state || ''
88
+ }
89
+ }
90
+ }
91
+ oldSourceArgs.current = currentSourceArgs.current;
92
+ currentSourceArgs.current = args;
93
+ return args;
94
+ }, []);
95
+ const filterUpdateSourceArgs = (args) => {
96
+ return ['type', 'currency', 'statement_descriptor', 'redirect', 'klarna.product', 'klarna.locale', 'klarna.custom_payment_methods'].reduce((obj, k) => {
97
+ if (k.indexOf('.') > -1) {
98
+ let keys = k.split('.');
99
+ let obj2 = keys.slice(0, keys.length - 1).reduce(function (obj, k) {
100
+ return obj[k];
101
+ }, obj);
102
+ k = keys[keys.length - 1];
103
+ delete obj2[k];
104
+ return obj;
105
+ }
106
+ delete obj[k];
107
+ return obj;
108
+ }, args);
109
+ }
110
+
111
+ const compareSourceArgs = useCallback((args, args2) => {
112
+ const getArgs = (args1, args2) => {
113
+ const newArgs = {};
114
+ for (let key of Object.keys(args1)) {
115
+ if (typeof args1[key] === 'object' && !Array.isArray(args1[key])) {
116
+ newArgs[key] = getArgs(args1[key], args2[key]);
117
+ } else {
118
+ newArgs[key] = args2[key];
119
+ }
120
+ }
121
+ return newArgs;
122
+ }
123
+ const newArgs = getArgs(args, args2);
124
+ return JSON.stringify(args) == JSON.stringify(newArgs);
125
+ }, []);
126
+ const createSource = useCallback(async (
127
+ {
128
+ billingData,
129
+ shippingData,
130
+ cartTotal,
131
+ cartTotalItems,
132
+ currency,
133
+ }) => {
134
+ let args = getSourceArgs({
135
+ cartTotal,
136
+ cartTotalItems,
137
+ billingData,
138
+ currency,
139
+ shippingData
140
+ });
141
+ try {
142
+ let result = await stripe.createSource(args);
143
+ if (result.error) {
144
+ throw new StripeError(result.error);
145
+ }
146
+ storeInCache('klarna:source', {[currency.code]: {source: result.source, args: currentSourceArgs.current}});
147
+ setSource(result.source);
148
+ } catch (err) {
149
+ console.log(err);
150
+ setError(err.error);
151
+ }
152
+ }, [
153
+ stripe,
154
+ setSource
155
+ ]);
156
+
157
+ const updateSource = useCallback(async ({source, updates}) => {
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', {source, args: currentSourceArgs.current});
176
+ setSource(source);
177
+ }
178
+ } catch (err) {
179
+ console.log('update aborted');
180
+ }
181
+ }, [setSource]);
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});
228
+ }
229
+ }
230
+ }, [
231
+ source?.id,
232
+ billingData,
233
+ cartTotal.value,
234
+ cartTotalItems,
235
+ shippingData,
236
+ currency.code
237
+ ]);
238
+
239
+ return {source, setSource, isLoading};
240
+ }
packages/blocks/assets/js/payment-methods/local-payment/klarna/hooks/use-process-payment.js ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ } from "../../util";
9
+ import {PaymentMethodLabel, PaymentMethod} from "../../../components/checkout";
10
+ import {canMakePayment} from "../local-payment-method";
11
+ import {Elements} from "@stripe/react-stripe-js";
12
+ import {KlarnaPaymentCategories} from "./categories";
13
+ import {KlarnaLoader} from "./loader";
14
+ import {useCreateSource, useProcessPayment} from "./hooks";
15
+ import './styles.scss';
16
+
17
+ const getData = getSettings('stripe_klarna_data');
18
+
19
+ const KlarnaContainer = (props) => {
20
+ return (
21
+ <Elements stripe={initStripe}>
22
+ <KlarnaPaymentMethod {...props}/>
23
+ </Elements>
24
+ );
25
+ }
26
+
27
+ const KlarnaPaymentMethod = (
28
+ {
29
+ getData,
30
+ billing,
31
+ shippingData,
32
+ emitResponse,
33
+ eventRegistration
34
+ }) => {
35
+ const {responseTypes} = emitResponse;
36
+ const {onPaymentProcessing, onCheckoutAfterProcessingWithError} = eventRegistration;
37
+ const [selected, setSelected] = useState('');
38
+ const getCategoriesFromSource = (source) => {
39
+ const paymentMethodCategories = source.klarna.payment_method_categories.split(',');
40
+ const categories = [];
41
+ for (let type of Object.keys(getData('categories'))) {
42
+ if (paymentMethodCategories.includes(type)) {
43
+ categories.push({type, label: getData('categories')[type]});
44
+ }
45
+ }
46
+ return categories;
47
+ }
48
+
49
+ const {source, isLoading} = useCreateSource({
50
+ getData,
51
+ billing,
52
+ shippingData
53
+ });
54
+
55
+ useProcessPayment({
56
+ payment_method: getData('name'),
57
+ source_id: source.id,
58
+ paymentCategory: selected,
59
+ onPaymentProcessing,
60
+ responseTypes
61
+ });
62
+
63
+ useProcessCheckoutError({responseTypes, subscriber: onCheckoutAfterProcessingWithError});
64
+
65
+ useEffect(() => {
66
+ if (!selected && source) {
67
+ const categories = getCategoriesFromSource(source);
68
+ if (categories.length) {
69
+ setSelected(categories.shift().type);
70
+ }
71
+
72
+ }
73
+ }, [source]);
74
+
75
+ if (source) {
76
+ Klarna.Payments.init({
77
+ client_token: source.klarna.client_token
78
+ });
79
+ const categories = getCategoriesFromSource(source);
80
+ return (
81
+ <KlarnaPaymentCategories
82
+ categories={categories}
83
+ selected={!selected && categories.length > 0 ? categories[0].type : selected}
84
+ onChange={setSelected}/>
85
+ )
86
+ } else {
87
+ if (isLoading) {
88
+ return <KlarnaLoader/>
89
+ }
90
+ }
91
+ return (
92
+ <div className='wc-stripe-blocks-klarna__notice'>
93
+ {__('Please fill out all required fields before paying with Klarna.', 'woo-stripe-payment')}
94
+ </div>
95
+ );
96
+ }
97
+
98
+ if (getData()) {
99
+ registerPaymentMethod({
100
+ name: getData('name'),
101
+ label: <PaymentMethodLabel
102
+ title={getData('title')}
103
+ paymentMethod={getData('name')}
104
+ icons={getData('icon')}/>,
105
+ ariaLabel: 'Klarna',
106
+ placeOrderButtonLabel: getData('placeOrderButtonLabel'),
107
+ canMakePayment: canMakePayment(getData, ({settings, billingData, cartTotals}) => {
108
+ const {country} = billingData;
109
+ const {currency_code: currency} = cartTotals;
110
+ const requiredParams = settings('requiredParams');
111
+ return [currency] in requiredParams && requiredParams[currency].includes(country);
112
+ }),
113
+ content: <PaymentMethod
114
+ getData={getData}
115
+ content={KlarnaContainer}/>,
116
+ edit: <PaymentMethod
117
+ getData={getData}
118
+ content={KlarnaContainer}/>,
119
+ supports: {
120
+ showSavedCards: false,
121
+ showSaveOption: false,
122
+ features: getData('features')
123
+ }
124
+ })
125
+ }
packages/blocks/assets/js/payment-methods/local-payment/klarna/loader.js ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ }
packages/blocks/assets/js/payment-methods/local-payment/local-payment-method.js ADDED
@@ -0,0 +1,161 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {useCallback} from '@wordpress/element';
2
+ import {useElements, Elements} from "@stripe/react-stripe-js";
3
+ import {initStripe as loadStripe, cartContainsSubscription, cartContainsPreOrder} from '../util'
4
+ import {useAfterProcessLocalPayment, useValidateCheckout, useCreateSource} from "./hooks";
5
+ import {useProcessCheckoutError} from "../hooks";
6
+
7
+ /**
8
+ * Return true if the local payment method can be used.
9
+ * @param settings
10
+ * @returns {function({billingData: *, [p: string]: *}): *}
11
+ */
12
+ export const canMakePayment = (settings, callback = false) => ({billingData, cartTotals, ...props}) => {
13
+ const {currency_code} = cartTotals;
14
+ const {country} = billingData;
15
+ const countries = settings('countries');
16
+ const type = settings('allowedCountries');
17
+ const supports = settings('features');
18
+ let canMakePayment = false;
19
+ if (settings('isAdmin')) {
20
+ canMakePayment = true;
21
+ } else {
22
+ // Check if there are any subscriptions or pre-orders in the cart.
23
+ if (cartContainsSubscription() && !supports.includes('subscriptions')) {
24
+ return false;
25
+ } else if (cartContainsPreOrder() && !supports.includes('pre-orders')) {
26
+ return false;
27
+ }
28
+ if (settings('currencies').includes(currency_code)) {
29
+ if (type === 'all_except') {
30
+ canMakePayment = !settings('exceptCountries').includes(country);
31
+ } else if (type === 'specific') {
32
+ canMakePayment = settings('specificCountries').includes(country);
33
+ } else {
34
+ canMakePayment = countries.length > 0 ? countries.includes(country) : true;
35
+ }
36
+ }
37
+ if (callback && canMakePayment) {
38
+ canMakePayment = callback({settings, billingData, cartTotals, ...props});
39
+ }
40
+ }
41
+ return canMakePayment;
42
+ }
43
+
44
+ export const LocalPaymentIntentContent = (props) => {
45
+ return (
46
+ <Elements stripe={loadStripe}>
47
+ <LocalPaymentIntentMethod {...props}/>
48
+ </Elements>
49
+ )
50
+ }
51
+
52
+ export const LocalPaymentSourceContent = (props) => {
53
+ return (
54
+ <Elements stripe={loadStripe}>
55
+ <LocalPaymentSourceMethod {...props}/>
56
+ </Elements>
57
+ )
58
+ }
59
+
60
+ const LocalPaymentSourceMethod = (
61
+ {
62
+ getData,
63
+ billing,
64
+ shippingData,
65
+ emitResponse,
66
+ eventRegistration,
67
+ getSourceArgs = false,
68
+ element = false
69
+ }) => {
70
+ const {shippingAddress} = shippingData;
71
+ const {onPaymentProcessing, onCheckoutAfterProcessingWithError} = eventRegistration;
72
+ const {responseTypes, noticeContexts} = emitResponse;
73
+ const onChange = (event) => {
74
+ setIsValid(event.complete);
75
+ }
76
+ const {setIsValid} = useCreateSource({
77
+ getData,
78
+ billing,
79
+ shippingAddress,
80
+ onPaymentProcessing,
81
+ responseTypes,
82
+ getSourceArgs,
83
+ element
84
+ });
85
+
86
+ if (element) {
87
+ return (
88
+ <LocalPaymentElementContainer
89
+ name={getData('name')}
90
+ options={getData('elementOptions')}
91
+ onChange={onChange}
92
+ element={element}/>
93
+ )
94
+ }
95
+ return null;
96
+ }
97
+
98
+ const LocalPaymentIntentMethod = (
99
+ {
100
+ getData,
101
+ billing,
102
+ emitResponse,
103
+ eventRegistration,
104
+ activePaymentMethod,
105
+ confirmationMethod = null,
106
+ component = null
107
+ }) => {
108
+ const elements = useElements();
109
+ const {billingData} = billing;
110
+ const {onPaymentProcessing, onCheckoutAfterProcessingWithError} = eventRegistration;
111
+ const {responseTypes, noticeContexts} = emitResponse;
112
+ const getPaymentMethodArgs = useCallback(() => {
113
+ if (component) {
114
+ return {
115
+ [getData('paymentType')]: elements.getElement(component)
116
+ }
117
+ }
118
+ return {};
119
+ }, [elements]);
120
+ const {setIsValid} = useValidateCheckout({
121
+ subscriber: onPaymentProcessing,
122
+ responseTypes,
123
+ component
124
+ }
125
+ );
126
+
127
+ useAfterProcessLocalPayment({
128
+ getData,
129
+ billingData,
130
+ eventRegistration,
131
+ responseTypes,
132
+ activePaymentMethod,
133
+ confirmationMethod,
134
+ getPaymentMethodArgs
135
+ });
136
+ useProcessCheckoutError({
137
+ responseTypes,
138
+ subscriber: onCheckoutAfterProcessingWithError,
139
+ messageContext: noticeContexts.PAYMENT
140
+ });
141
+ if (component) {
142
+ const onChange = (event) => setIsValid(!event.empty)
143
+ return (
144
+ <LocalPaymentElementContainer
145
+ name={getData('name')}
146
+ options={getData('elementOptions')}
147
+ onChange={onChange}
148
+ element={component}/>
149
+ )
150
+ }
151
+ return null;
152
+ }
153
+
154
+ const LocalPaymentElementContainer = ({name, onChange, element, options}) => {
155
+ const Tag = element;
156
+ return (
157
+ <div className={`wc-stripe-local-payment-container ${name} ${Tag.displayName}`}>
158
+ <Tag options={options} onChange={onChange}/>
159
+ </div>
160
+ )
161
+ }
packages/blocks/assets/js/payment-methods/local-payment/multibanco.js ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {registerPaymentMethod} from '@woocommerce/blocks-registry';
2
+ import {getSettings} from "../util";
3
+ import {LocalPaymentSourceContent} from './local-payment-method';
4
+ import {PaymentMethodLabel, PaymentMethod} from "../../components/checkout";
5
+ import {canMakePayment} from "./local-payment-method";
6
+
7
+ const getData = getSettings('stripe_multibanco_data');
8
+
9
+ if (getData()) {
10
+ registerPaymentMethod({
11
+ name: getData('name'),
12
+ label: <PaymentMethodLabel
13
+ title={getData('title')}
14
+ paymentMethod={getData('name')}
15
+ icons={getData('icon')}/>,
16
+ ariaLabel: 'MultiBanco',
17
+ placeOrderButtonLabel: getData('placeOrderButtonLabel'),
18
+ canMakePayment: canMakePayment(getData),
19
+ content: <PaymentMethod content={LocalPaymentSourceContent} getData={getData}/>,
20
+ edit: <PaymentMethod content={LocalPaymentSourceContent} getData={getData}/>,
21
+ supports: {
22
+ showSavedCards: false,
23
+ showSaveOption: false,
24
+ features: getData('features')
25
+ }
26
+ })
27
+ }
packages/blocks/assets/js/payment-methods/local-payment/p24.js ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {registerPaymentMethod} from '@woocommerce/blocks-registry';
2
+ import {getSettings} from "../util";
3
+ import {LocalPaymentSourceContent} from './local-payment-method';
4
+ import {PaymentMethodLabel, PaymentMethod} from "../../components/checkout";
5
+ import {canMakePayment} from "./local-payment-method";
6
+
7
+ const getData = getSettings('stripe_p24_data');
8
+
9
+ if (getData()) {
10
+ registerPaymentMethod({
11
+ name: getData('name'),
12
+ label: <PaymentMethodLabel
13
+ title={getData('title')}
14
+ paymentMethod={getData('name')}
15
+ icons={getData('icon')}/>,
16
+ ariaLabel: 'P24',
17
+ placeOrderButtonLabel: getData('placeOrderButtonLabel'),
18
+ canMakePayment: canMakePayment(getData),
19
+ content: <PaymentMethod content={LocalPaymentSourceContent} getData={getData}/>,
20
+ edit: <PaymentMethod content={LocalPaymentSourceContent} getData={getData}/>,
21
+ supports: {
22
+ showSavedCards: false,
23
+ showSaveOption: false,
24
+ features: getData('features')
25
+ }
26
+ })
27
+ }
packages/blocks/assets/js/payment-methods/local-payment/sepa.js ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {registerPaymentMethod} from '@woocommerce/blocks-registry';
2
+ import {getSettings, cartContainsPreOrder, cartContainsSubscription} from "../util";
3
+ import {LocalPaymentSourceContent} from './local-payment-method';
4
+ import {PaymentMethodLabel, PaymentMethod} from "../../components/checkout";
5
+ import {canMakePayment} from "./local-payment-method";
6
+ import {IbanElement} from "@stripe/react-stripe-js";
7
+
8
+ const getData = getSettings('stripe_sepa_data');
9
+
10
+ const getSourceArgs = (args, {billingData}) => {
11
+ args.mandate = {
12
+ notification_method: billingData.email ? 'email' : 'manual',
13
+ interval: cartContainsSubscription() || cartContainsPreOrder() ? 'scheduled' : 'one_time'
14
+ }
15
+ if (args.mandate.interval === 'scheduled') {
16
+ delete args.amount;
17
+ }
18
+ return args;
19
+ }
20
+
21
+ const LocalPaymentMethod = (PaymentMethod) => ({getData, ...props}) => {
22
+ return (
23
+ <>
24
+ <PaymentMethod {...{...props, getData}}/>
25
+ <div className={'wc-stripe-blocks-sepa__mandate'}>
26
+ {getData('mandate')}
27
+ </div>
28
+ </>
29
+ )
30
+ }
31
+
32
+ const SepaPaymentMethod = LocalPaymentMethod(PaymentMethod);
33
+
34
+ if (getData()) {
35
+ registerPaymentMethod({
36
+ name: getData('name'),
37
+ label: <PaymentMethodLabel
38
+ title={getData('title')}
39
+ paymentMethod={getData('name')}
40
+ icons={getData('icon')}/>,
41
+ ariaLabel: 'SEPA',
42
+ placeOrderButtonLabel: getData('placeOrderButtonLabel'),
43
+ canMakePayment: canMakePayment(getData),
44
+ content: <SepaPaymentMethod
45
+ content={LocalPaymentSourceContent}
46
+ getData={getData}
47
+ element={IbanElement}
48
+ getSourceArgs={getSourceArgs}/>,
49
+ edit: <LocalPaymentSourceContent getData={getData}/>,
50
+ supports: {
51
+ showSavedCards: false,
52
+ showSaveOption: false,
53
+ features: getData('features')
54
+ }
55
+ })
56
+ }
packages/blocks/assets/js/payment-methods/local-payment/sofort.js ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {registerPaymentMethod} from '@woocommerce/blocks-registry';
2
+ import {getSettings} from "../util";
3
+ import {LocalPaymentSourceContent} from './local-payment-method';
4
+ import {PaymentMethodLabel, PaymentMethod} from "../../components/checkout";
5
+ import {canMakePayment} from "./local-payment-method";
6
+
7
+ const getData = getSettings('stripe_sofort_data');
8
+
9
+ const getSourceArgs = (args, {billingData}) => {
10
+ return {...args, sofort: {country: billingData.country}};
11
+ }
12
+
13
+ if (getData()) {
14
+ registerPaymentMethod({
15
+ name: getData('name'),
16
+ label: <PaymentMethodLabel
17
+ title={getData('title')}
18
+ paymentMethod={getData('name')}
19
+ icons={getData('icon')}/>,
20
+ ariaLabel: 'Sofort',
21
+ placeOrderButtonLabel: getData('placeOrderButtonLabel'),
22
+ canMakePayment: canMakePayment(getData),
23
+ content: <PaymentMethod
24
+ content={LocalPaymentSourceContent}
25
+ getData={getData}
26
+ getSourceArgs={getSourceArgs}/>,
27
+ edit: <PaymentMethod content={LocalPaymentSourceContent} getData={getData}/>,
28
+ supports: {
29
+ showSavedCards: false,
30
+ showSaveOption: false,
31
+ features: getData('features')
32
+ }
33
+ })
34
+ }
packages/blocks/assets/js/payment-methods/local-payment/styles.scss ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .wc-stripe-label-container {
2
+ &.stripe_ideal {
3
+ img {
4
+ &.wc-block-components-payment-method-icon--stripe_ideal {
5
+ height: 29px;
6
+ }
7
+
8
+ }
9
+ }
10
+
11
+ &.stripe_p24 {
12
+ img {
13
+ &.wc-block-components-payment-method-icon--stripe_p24 {
14
+ height: 25px;
15
+ }
16
+
17
+ }
18
+ }
19
+
20
+ &.stripe_bancontact {
21
+ img {
22
+ &.wc-block-components-payment-method-icon--stripe_bancontact {
23
+ height: 26px;
24
+ }
25
+
26
+ }
27
+ }
28
+
29
+ &.stripe_eps {
30
+ img {
31
+ &.wc-block-components-payment-method-icon--stripe_eps {
32
+ height: 34px;
33
+ }
34
+
35
+ }
36
+ }
37
+
38
+ &.stripe_multibanco {
39
+ img {
40
+ &.wc-block-components-payment-method-icon--stripe_multibanco {
41
+ height: 45px;
42
+ }
43
+
44
+ }
45
+ }
46
+
47
+ &.stripe_sepa {
48
+ img {
49
+ &.wc-block-components-payment-method-icon--stripe_sepa {
50
+ height: 17px;
51
+ }
52
+
53
+ }
54
+ }
55
+
56
+ &.stripe_sofort {
57
+ img {
58
+ &.wc-block-components-payment-method-icon--stripe_sofort {
59
+ height: 22px;
60
+ }
61
+
62
+ }
63
+ }
64
+
65
+ &.stripe_fpx {
66
+ img {
67
+ &.wc-block-components-payment-method-icon--stripe_fpx {
68
+ height: 22px;
69
+ }
70
+
71
+ }
72
+ }
73
+
74
+ &.stripe_alipay {
75
+ img {
76
+ &.wc-block-components-payment-method-icon--stripe_alipay {
77
+ height: 25px;
78
+ }
79
+
80
+ }
81
+ }
82
+
83
+ &.stripe_klarna {
84
+ img {
85
+ &.wc-block-components-payment-method-icon--stripe_klarna {
86
+ height: 26px;
87
+ }
88
+
89
+ }
90
+ }
91
+ }
92
+
93
+ .wc-stripe-local-payment-container {
94
+ border: 1px solid #dadce0;
95
+ border-radius: 4px;
96
+ min-height: 42px;
97
+ display: flex;
98
+ align-items: center;
99
+
100
+ &.IbanElement,
101
+ &.AuBankAccountElement {
102
+ padding-left: 10px;
103
+ }
104
+
105
+ .StripeElement {
106
+ flex: 1;
107
+ }
108
+ }
109
+
110
+ #wc-stripe-block-qrcode {
111
+ + p {
112
+ margin-top: 5px;
113
+ }
114
+ }
115
+
116
+ .wechat-validation-error {
117
+ .wc-block-components-validation-error {
118
+ position: relative;
119
+ }
120
+ }
packages/blocks/assets/js/payment-methods/local-payment/wechat.js ADDED
@@ -0,0 +1,226 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {useEffect, useRef, useState, useCallback} from '@wordpress/element';
2
+ import {registerPaymentMethod} from '@woocommerce/blocks-registry';
3
+ import {
4
+ getSettings,
5
+ initStripe as loadStripe,
6
+ getDefaultSourceArgs,
7
+ isAddressValid,
8
+ StripeError,
9
+ isTestMode,
10
+ ensureSuccessResponse,
11
+ getErrorMessage,
12
+ storeInCache,
13
+ getFromCache,
14
+ deleteFromCache
15
+ } from "../util";
16
+ import {PaymentMethodLabel, PaymentMethod} from "../../components/checkout";
17
+ import {canMakePayment} from "./local-payment-method";
18
+ import {Elements} from "@stripe/react-stripe-js";
19
+ import {useValidateCheckout} from "./hooks";
20
+ import {__} from '@wordpress/i18n';
21
+ //import QRCode from 'QRCode';
22
+ import {useStripe} from "@stripe/react-stripe-js";
23
+ import {useStripeError} from "../hooks";
24
+
25
+ const getData = getSettings('stripe_wechat_data');
26
+
27
+ const WeChatComponent = (props) => {
28
+ return (
29
+ <Elements stripe={loadStripe}>
30
+ <WeChatPaymentMethod {...props}/>
31
+ </Elements>
32
+ )
33
+ }
34
+
35
+ const WeChatPaymentMethod = (
36
+ {
37
+ getData,
38
+ billing,
39
+ shippingData,
40
+ emitResponse,
41
+ eventRegistration,
42
+ components
43
+ }) => {
44
+ const {responseTypes} = emitResponse;
45
+ const {onPaymentProcessing, onCheckoutAfterProcessingWithSuccess} = eventRegistration;
46
+ const {ValidationInputError} = components;
47
+ const {isValid, setIsValid} = useValidateCheckout({
48
+ subscriber: eventRegistration.onPaymentProcessing,
49
+ responseTypes: emitResponse.responseTypes,
50
+ msg: __('Please scan your QR code to continue with payment.', 'woo-stripe-payment')
51
+ });
52
+
53
+ const {source, error, deleteSourceFromStorage} = useCreateSource({
54
+ getData,
55
+ billing,
56
+ responseTypes,
57
+ subscriber: onPaymentProcessing
58
+ })
59
+
60
+ /**
61
+ * delete the source from storage once payment is successful.
62
+ * If test mode, redirect to the Stripe test url.
63
+ * If live mode, redirect to the return Url.
64
+ */
65
+ useEffect(() => {
66
+ const unsubscribe = onCheckoutAfterProcessingWithSuccess(() => {
67
+ deleteSourceFromStorage();
68
+ return ensureSuccessResponse(responseTypes);
69
+ });
70
+ return () => unsubscribe();
71
+ }, [
72
+ source,
73
+ onCheckoutAfterProcessingWithSuccess,
74
+ deleteSourceFromStorage
75
+ ]);
76
+
77
+ useEffect(() => {
78
+ if (source) {
79
+ setIsValid(true);
80
+ }
81
+ }, [source]);
82
+
83
+ if (source) {
84
+ return (
85
+ <QRCodeComponent text={source.wechat.qr_code_url}/>
86
+ );
87
+ } else if (error) {
88
+ return (
89
+ <div className='wechat-validation-error'>
90
+ <ValidationInputError errorMessage={getErrorMessage(error)}/>
91
+ </div>
92
+ );
93
+ } else {
94
+ // if billing address is not valid
95
+ if (!isAddressValid(billing.billingData)) {
96
+ return __('Please fill out all the required fields in order to complete the WeChat payment.', 'woo-stripe-payment');
97
+ }
98
+ }
99
+ return null;
100
+ }
101
+
102
+ const QRCodeComponent = (
103
+ {
104
+ text,
105
+ width = 128,
106
+ height = 128,
107
+ colorDark = '#424770',
108
+ colorLight = '#f8fbfd',
109
+ correctLevel = QRCode.CorrectLevel.H
110
+ }) => {
111
+ const el = useRef();
112
+ useEffect(() => {
113
+ new QRCode(el.current, {
114
+ text,
115
+ width,
116
+ height,
117
+ colorDark,
118
+ colorLight,
119
+ correctLevel
120
+ })
121
+ }, [el]);
122
+ return (
123
+ <>
124
+ <div id='wc-stripe-block-qrcode' ref={el}></div>
125
+ {isTestMode() && <p>
126
+ {__('Test mode: Click the Place Order button to proceed.', 'woo-stripe-payment')}
127
+ </p>}
128
+ {!isTestMode() && <p>
129
+ {__('Scan the QR code using your WeChat app. Once scanned click the Place Order button.', 'woo-stripe-payment')}
130
+ </p>}
131
+ </>
132
+ )
133
+ }
134
+
135
+ const useCreateSource = (
136
+ {
137
+ getData,
138
+ billing,
139
+ responseTypes,
140
+ subscriber
141
+ }) => {
142
+ const stripe = useStripe();
143
+ const [error, setError] = useStripeError();
144
+ const [source, setSource] = useState(getFromCache('wechat:source'));
145
+ const createSourceTimeoutId = useRef(null);
146
+ const {cartTotal, billingData, currency} = billing;
147
+
148
+ useEffect(() => {
149
+ const unsubscribe = subscriber(() => {
150
+ return ensureSuccessResponse(responseTypes, {
151
+ meta: {
152
+ paymentMethodData: {
153
+ [`${getData('name')}_token_key`]: source.id
154
+ }
155
+ }
156
+ })
157
+ });
158
+ return () => unsubscribe();
159
+ }, [source, subscriber]);
160
+
161
+ const createSource = useCallback(async () => {
162
+ // validate the billing fields. If valid, create the source.
163
+ try {
164
+ if (!error && isAddressValid(billingData)) {
165
+ let result = await stripe.createSource(getDefaultSourceArgs({
166
+ type: getData('paymentType'),
167
+ amount: cartTotal.value,
168
+ billingData,
169
+ currency: currency.code,
170
+ returnUrl: getData('returnUrl')
171
+ }));
172
+ if (result.error) {
173
+ throw new StripeError(result.error);
174
+ }
175
+ setSource(result.source);
176
+ storeInCache('wechat:source', result.source);
177
+ }
178
+ } catch (err) {
179
+ console.log('error: ', err);
180
+ setError(err.error);
181
+ }
182
+ }, [
183
+ stripe,
184
+ source,
185
+ cartTotal.value,
186
+ billingData,
187
+ currency,
188
+ error
189
+ ]);
190
+ const deleteSourceFromStorage = useCallback(() => {
191
+ deleteFromCache('wechat:source');
192
+ }, []);
193
+
194
+ useEffect(() => {
195
+ if (stripe && !source) {
196
+ // if there is an existing request, cancel it.
197
+ clearTimeout(createSourceTimeoutId.current);
198
+ createSourceTimeoutId.current = setTimeout(createSource, 1000);
199
+ }
200
+ }, [
201
+ stripe,
202
+ source
203
+ ]);
204
+
205
+ return {source, setSource, error, deleteSourceFromStorage};
206
+ }
207
+
208
+
209
+ if (getData()) {
210
+ registerPaymentMethod({
211
+ name: getData('name'),
212
+ label: <PaymentMethodLabel
213
+ title={getData('title')}
214
+ paymentMethod={getData('name')}
215
+ icons={getData('icon')}/>,
216
+ ariaLabel: 'WeChat',
217
+ canMakePayment: canMakePayment(getData),
218
+ content: <PaymentMethod content={WeChatComponent} getData={getData}/>,
219
+ edit: <PaymentMethod content={WeChatComponent} getData={getData}/>,
220
+ supports: {
221
+ showSavedCards: false,
222
+ showSaveOption: false,
223
+ features: getData('features')
224
+ }
225
+ })
226
+ }
packages/blocks/assets/js/payment-methods/payment-request/index.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ import './style.scss';
2
+
3
+ import './payment-method';
packages/blocks/assets/js/payment-methods/payment-request/payment-method.js ADDED
@@ -0,0 +1,140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {useMemo, useEffect, useRef} from '@wordpress/element';
2
+ import {registerExpressPaymentMethod} from '@woocommerce/blocks-registry';
3
+ import {getSettings, initStripe as loadStripe, canMakePayment} from "../util";
4
+ import {useBreakpointWidth, useExpressBreakpointWidth} from '../hooks';
5
+ import {Elements, PaymentRequestButtonElement, useStripe} from "@stripe/react-stripe-js";
6
+ import {
7
+ usePaymentRequest,
8
+ useProcessPaymentIntent,
9
+ useExportedValues,
10
+ useAfterProcessingPayment,
11
+ useStripeError
12
+ } from '../hooks';
13
+
14
+ const getData = getSettings('stripe_payment_request_data');
15
+
16
+ const PaymentRequestContent = (props) => {
17
+ return (
18
+ <div className='wc-stripe-payment-request-container'>
19
+ <Elements stripe={loadStripe}>
20
+ <PaymentRequestButton {...props}/>
21
+ </Elements>
22
+ </div>
23
+ );
24
+ }
25
+
26
+ const PaymentRequestButton = (
27
+ {
28
+ getData,
29
+ onClick,
30
+ onClose,
31
+ billing,
32
+ shippingData,
33
+ eventRegistration,
34
+ emitResponse,
35
+ onSubmit,
36
+ activePaymentMethod,
37
+ ...props
38
+ }) => {
39
+ const {onPaymentProcessing} = eventRegistration;
40
+ const {responseTypes, noticeContexts} = emitResponse;
41
+ const stripe = useStripe();
42
+ const [error] = useStripeError();
43
+ const canPay = (result) => result != null && !result.applePay;
44
+ const exportedValues = useExportedValues();
45
+ useExpressBreakpointWidth({payment_method: getData('name'), width: 300});
46
+ const {setPaymentMethod} = useProcessPaymentIntent({
47
+ getData,
48
+ billing,
49
+ shippingData,
50
+ onPaymentProcessing,
51
+ emitResponse,
52
+ error,
53
+ onSubmit,
54
+ activePaymentMethod,
55
+ exportedValues
56
+ });
57
+ useAfterProcessingPayment({
58
+ getData,
59
+ eventRegistration,
60
+ responseTypes,
61
+ activePaymentMethod,
62
+ messageContext: noticeContexts.EXPRESS_PAYMENTS
63
+ });
64
+ const {paymentRequest} = usePaymentRequest({
65
+ getData,
66
+ onClose,
67
+ stripe,
68
+ billing,
69
+ shippingData,
70
+ eventRegistration,
71
+ setPaymentMethod,
72
+ exportedValues,
73
+ canPay
74
+ });
75
+
76
+ const options = useMemo(() => {
77
+ return {
78
+ paymentRequest,
79
+ style: {
80
+ paymentRequestButton: getData('paymentRequestButton')
81
+ }
82
+ }
83
+ }, [paymentRequest]);
84
+
85
+ if (paymentRequest) {
86
+ return (
87
+ <PaymentRequestButtonElement options={options} onClick={onClick}/>
88
+ )
89
+ }
90
+ return null;
91
+ }
92
+
93
+ const PaymentRequestEdit = ({getData, ...props}) => {
94
+ const canvas = useRef();
95
+ useEffect(() => {
96
+ const scale = window.devicePixelRatio;
97
+ canvas.current.width = 20 * scale;
98
+ canvas.current.height = 20 * scale;
99
+ let ctx = canvas.current.getContext('2d');
100
+ ctx.scale(scale, scale);
101
+ ctx.beginPath();
102
+ ctx.arc(10, 10, 10, 0, 2 * Math.PI);
103
+ ctx.fillStyle = '#986fff';
104
+ ctx.fill();
105
+ });
106
+ return (
107
+ <div className='payment-request-block-editor'>
108
+ <div className={'icon-container'}>
109
+ <span>Buy now</span>
110
+ <canvas className='PaymentRequestButton-icon' ref={canvas}/>
111
+ <i className={'payment-request-arrow'}></i>
112
+ </div>
113
+ </div>
114
+ )
115
+ }
116
+
117
+ registerExpressPaymentMethod({
118
+ name: getData('name'),
119
+ canMakePayment: ({cartTotals}) => {
120
+ if (getData('isAdmin')) {
121
+ return true;
122
+ }
123
+ const {currency_code: currency, total_price} = cartTotals;
124
+ return canMakePayment({
125
+ country: getData('countryCode'),
126
+ currency: currency.toLowerCase(),
127
+ total: {
128
+ label: getData('totalLabel'),
129
+ amount: parseInt(total_price)
130
+ }
131
+ }, (result) => result != null && !result.applePay);
132
+ },
133
+ content: <PaymentRequestContent getData={getData}/>,
134
+ edit: <PaymentRequestEdit getData={getData}/>,
135
+ supports: {
136
+ showSavedCards: getData('showSavedCards'),
137
+ showSaveOption: getData('showSaveOption'),
138
+ features: getData('features')
139
+ }
140
+ });
packages/blocks/assets/js/payment-methods/payment-request/style.scss ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .payment-request-block-editor {
2
+ height: 40px;
3
+ background-color: #32325d;
4
+ color: white;
5
+ border-radius: 4px;
6
+ font-size: 16px;
7
+ display: flex;
8
+ align-items: center;
9
+ justify-content: center;
10
+ font-weight: 600;
11
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
12
+
13
+ .icon-container {
14
+ display: flex;
15
+ align-items: center;
16
+ position: relative;
17
+
18
+ span {
19
+ margin-bottom: 5px;
20
+ }
21
+
22
+ canvas {
23
+ &.PaymentRequestButton-icon {
24
+ -webkit-flex-shrink: 0;
25
+ -ms-flex-negative: 0;
26
+ flex-shrink: 0;
27
+ position: relative;
28
+ z-index: 10;
29
+ margin: 0 -1px -1px 7px;
30
+ will-change: opacity;
31
+ width: 20px;
32
+ height: 20px;
33
+ }
34
+ }
35
+
36
+ .payment-request-arrow {
37
+ z-index: 99;
38
+ position: absolute;
39
+ right: 8px;
40
+ border-right: 4px solid;
41
+ border-bottom: 4px solid;
42
+ height: 12px;
43
+ width: 12px;
44
+ transform: rotate(-45deg);
45
+ }
46
+ }
47
+
48
+ }
packages/blocks/assets/js/payment-methods/saved-card-component.js ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {useEffect, useCallback} from '@wordpress/element';
2
+ import {initStripe as loadStripe, getSettings, handleCardAction} from '@paymentplugins/stripe/util';
3
+
4
+ const SavedCardComponent = (
5
+ {
6
+ eventRegistration,
7
+ emitResponse,
8
+ getData
9
+ }) => {
10
+ const {onCheckoutAfterProcessingWithSuccess} = eventRegistration;
11
+ const {responseTypes} = emitResponse;
12
+ const handleSuccessResult = useCallback(async ({redirectUrl}) => {
13
+ const stripe = await loadStripe;
14
+ return await handleCardAction({redirectUrl, getData, stripe, responseTypes});
15
+ }, [onCheckoutAfterProcessingWithSuccess]);
16
+
17
+ useEffect(() => {
18
+ const unsubscribeOnCheckoutAfterProcessingWithSuccess = onCheckoutAfterProcessingWithSuccess(handleSuccessResult);
19
+ return () => unsubscribeOnCheckoutAfterProcessingWithSuccess();
20
+ }, [
21
+ onCheckoutAfterProcessingWithSuccess
22
+ ]);
23
+ return null;
24
+ }
25
+
26
+ export default SavedCardComponent;
packages/blocks/assets/js/payment-methods/util.js ADDED
@@ -0,0 +1,490 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {loadStripe} from '@stripe/stripe-js';
2
+ import {getSetting} from '@woocommerce/settings'
3
+ import apiFetch from "@wordpress/api-fetch";
4
+ import {getCurrency, formatPrice as wcFormatPrice} from '@woocommerce/price-format';
5
+
6
+ const {publishableKey, account} = getSetting('stripeGeneralData');
7
+ const messages = getSetting('stripeErrorMessages');
8
+ const countryLocale = getSetting('countryLocale', {});
9
+
10
+ const SHIPPING_OPTION_REGEX = /^([\w]+)\:(.+)$/;
11
+
12
+ const routes = getSetting('stripeGeneralData').routes;
13
+
14
+ const creditCardForms = {};
15
+
16
+ const localPaymentMethods = [];
17
+
18
+ const CACHE_PREFIX = 'stripe:';
19
+
20
+ const PAYMENT_REQUEST_ADDRESS_MAPPINGS = {
21
+ recipient: (address, name) => {
22
+ address.first_name = name.split(' ').slice(0, -1).join(' ');
23
+ address.last_name = name.split(' ').pop();
24
+ return address;
25
+ },
26
+ payerName: (address, name) => {
27
+ address.first_name = name.split(' ').slice(0, -1).join(' ');
28
+ address.last_name = name.split(' ').pop();
29
+ return address;
30
+ },
31
+ country: 'country',
32
+ addressLine: (address, value) => {
33
+ if (value[0]) {
34
+ address.address_1 = value[0];
35
+ }
36
+ if (value[1]) {
37
+ address.address_2 = value[1];
38
+ }
39
+ return address;
40
+ },
41
+ line1: 'address_1',
42
+ line2: 'address_2',
43
+ city: 'city',
44
+ region: 'state',
45
+ postalCode: 'postcode',
46
+ postal_code: 'postcode',
47
+ payerEmail: 'email',
48
+ payerPhone: 'phone'
49
+ }
50
+
51
+ export const initStripe = new Promise((resolve, reject) => {
52
+ loadStripe(publishableKey, (() => account ? {stripeAccount: account} : {})()).then(stripe => {
53
+ resolve(stripe);
54
+ }).catch(err => {
55
+ resolve({error: err});
56
+ });
57
+ });
58
+
59
+ export const registerCreditCardForm = ({id, ...props}) => {
60
+ creditCardForms[id] = props;
61
+ }
62
+
63
+ export const getCreditCardForm = (id) => {
64
+ return creditCardForms[id];
65
+ }
66
+
67
+ export const getRoute = (route) => {
68
+ return routes?.[route] ? routes[route] : console.log(`${route} is not a valid route`);
69
+ }
70
+
71
+ export const ensureSuccessResponse = (responseTypes, data = {}) => {
72
+ return {type: responseTypes.SUCCESS, ...data};
73
+ }
74
+
75
+ /**
76
+ * Returns a formatted error object used by observers
77
+ * @param responseTypes
78
+ * @param error
79
+ * @returns {{type: *, message: *}}
80
+ */
81
+ export const ensureErrorResponse = (responseTypes, error) => {
82
+ return {type: responseTypes.ERROR, message: getErrorMessage(error)}
83
+ };
84
+
85
+ /**
86
+ * Return a customized error message.
87
+ * @param error
88
+ */
89
+ export const getErrorMessage = (error) => {
90
+ if (typeof error == 'string') {
91
+ return error;
92
+ }
93
+ if (error?.code && messages?.[error.code]) {
94
+ return messages[error.code];
95
+ }
96
+ if (error?.statusCode) {
97
+ return messages?.[error.statusCode] ? messages[error.statusCode] : error.statusMessage;
98
+ }
99
+ return error.message;
100
+ }
101
+
102
+ /**
103
+ * Return a Stripe formatted billing_details object from a WC address
104
+ * @param billingAddress
105
+ */
106
+ export const getBillingDetailsFromAddress = (billingAddress) => {
107
+ let billing_details = {
108
+ name: `${billingAddress.first_name} ${billingAddress.last_name}`,
109
+ address: {
110
+ city: billingAddress.city || '',
111
+ country: billingAddress.country || '',
112
+ line1: billingAddress.address_1 || '',
113
+ line2: billingAddress.address_2 || '',
114
+ postal_code: billingAddress.postcode || '',
115
+ state: billingAddress.state || ''
116
+ }
117
+ }
118
+ if (billingAddress?.phone) {
119
+ billing_details.phone = billingAddress.phone;
120
+ }
121
+ if (billingAddress?.email) {
122
+ billing_details.email = billingAddress.email;
123
+ }
124
+ return billing_details;
125
+ }
126
+
127
+ export const getSettings = (name) => (key) => {
128
+ if (key) {
129
+ return getSetting(name)[key];
130
+ }
131
+ return getSetting(name);
132
+ }
133
+
134
+ export class StripeError extends Error {
135
+ constructor(error) {
136
+ super(error.message);
137
+ this.error = error;
138
+ }
139
+ }
140
+
141
+ /**
142
+ * Returns true if the provided value is empty.
143
+ * @param value
144
+ * @returns {boolean}
145
+ */
146
+ export const isEmpty = (value) => {
147
+ if (typeof value === 'string') {
148
+ return value.length == 0 || value == '';
149
+ }
150
+ if (Array.isArray(value)) {
151
+ return array.length == 0;
152
+ }
153
+ if (typeof value === 'object') {
154
+ return Object.keys(value).length == 0;
155
+ }
156
+ if (typeof value === 'undefined') {
157
+ return true;
158
+ }
159
+ return true;
160
+ }
161
+
162
+ export const removeNumberPrecision = (value, unit) => {
163
+ return value / 10 ** unit;
164
+ }
165
+
166
+ /**
167
+ *
168
+ * @param address
169
+ * @param country
170
+ */
171
+ export const isAddressValid = (address, exclude = []) => {
172
+ const fields = getLocaleFields(address.country);
173
+ for (const [key, value] of Object.entries(address)) {
174
+ if (!exclude.includes(key) && fields?.[key] && fields[key].required) {
175
+ if (isEmpty(value)) {
176
+ return false;
177
+ }
178
+ }
179
+ }
180
+ return true;
181
+ }
182
+
183
+ export const getLocaleFields = (country) => {
184
+ let localeFields = {...countryLocale.default};
185
+ if (country && countryLocale?.[country]) {
186
+ localeFields = Object.entries(countryLocale[country]).reduce((locale, [key, value]) => {
187
+ locale[key] = {...locale[key], ...value}
188
+ return locale;
189
+ }, localeFields);
190
+ ['phone', 'email'].forEach(key => {
191
+ let node = document.getElementById(key);
192
+ if (node) {
193
+ localeFields[key] = {required: node.required};
194
+ }
195
+ });
196
+ }
197
+ return localeFields;
198
+ }
199
+
200
+ /**
201
+ * Return true if the field is required by the cart
202
+ * @param field
203
+ * @param country
204
+ * @returns {boolean|*}
205
+ */
206
+ export const isFieldRequired = (field, country = false) => {
207
+ const fields = getLocaleFields(country);
208
+ return [field] in fields && fields[field].required;
209
+ }
210
+
211
+ export const getSelectedShippingOption = (id) => {
212
+ const result = id.match(SHIPPING_OPTION_REGEX);
213
+ if (result) {
214
+ const {1: packageIdx, 2: rate} = result;
215
+ return [rate, packageIdx];
216
+ }
217
+ return [];
218
+ }
219
+
220
+ export const hasShippingRates = (shippingRates) => {
221
+ return shippingRates.map(rate => {
222
+ return rate.shipping_rates.length > 0;
223
+ }).filter(Boolean).length > 0;
224
+ }
225
+
226
+ /**
227
+ * Return true if the customer is logged in.
228
+ * @param customerId
229
+ * @returns {boolean}
230
+ */
231
+ export const isUserLoggedIn = (customerId) => {
232
+ return customerId > 0;
233
+ }
234
+
235
+ const syncPaymentIntentWithOrder = async (order_id, client_secret) => {
236
+ try {
237
+ await apiFetch({
238
+ url: routes['sync/intent'],
239
+ method: 'POST',
240
+ data: {order_id, client_secret}
241
+ })
242
+ } catch (error) {
243
+ console.log(error);
244
+ }
245
+ }
246
+
247
+ export const handleCardAction = async (
248
+ {
249
+ redirectUrl,
250
+ responseTypes,
251
+ stripe,
252
+ getData,
253
+ savePaymentMethod = false
254
+ }) => {
255
+ try {
256
+ let match = redirectUrl.match(/#response=(.+)/)
257
+ if (match) {
258
+ let {client_secret, order_id, order_key} = JSON.parse(window.atob(decodeURIComponent(match[1])));
259
+ let result = await stripe.handleCardAction(client_secret);
260
+ if (result.error) {
261
+ syncPaymentIntentWithOrder(order_id, client_secret);
262
+ return ensureErrorResponse(responseTypes, result.error);
263
+ }
264
+ // success so finish processing order then redirect to thank you page
265
+ let data = {order_id, order_key, [`${getData('name')}_save_source_key`]: savePaymentMethod};
266
+ let response = await apiFetch({
267
+ url: getRoute('process/payment'),
268
+ method: 'POST',
269
+ data
270
+ })
271
+ if (response.messages) {
272
+ return ensureErrorResponse(responseTypes, response.messages);
273
+ }
274
+ return ensureSuccessResponse(responseTypes, {
275
+ redirectUrl: response.redirect
276
+ });
277
+ } else {
278
+ return ensureSuccessResponse(responseTypes);
279
+ }
280
+ } catch (err) {
281
+ console.log(err);
282
+ return ensureErrorResponse(responseTypes, err);
283
+ }
284
+ }
285
+
286
+ /**
287
+ * Convert a payment wallet address to a WC cart address.
288
+ * @param address_mappings
289
+ * @returns {function(*, *=): {}}
290
+ */
291
+ export const toCartAddress = (address_mappings = PAYMENT_REQUEST_ADDRESS_MAPPINGS) => (address, args = {}) => {
292
+ const cartAddress = {};
293
+ address = {...address, ...filterEmptyValues(args)};
294
+ for (let [key, cartKey] of Object.entries(address_mappings)) {
295
+ if (address?.[key]) {
296
+ if (typeof cartKey === 'function') {
297
+ cartKey(cartAddress, address[key]);
298
+ } else {
299
+ cartAddress[cartKey] = address[key];
300
+ }
301
+ }
302
+ }
303
+ return cartAddress;
304
+ }
305
+
306
+ /**
307
+ * Given a WC formatted address, return only the intermediate address values
308
+ * @param address
309
+ * @param fields
310
+ */
311
+ export const getIntermediateAddress = (address, fields = ['city', 'postcode', 'state', 'country']) => {
312
+ const intermediateAddress = {};
313
+ for (let key of fields) {
314
+ intermediateAddress[key] = address[key];
315
+ }
316
+ return intermediateAddress;
317
+ }
318
+
319
+ /**
320
+ *
321
+ * @param values
322
+ * @returns {{}|{[p: string]: *}}
323
+ */
324
+ export const filterEmptyValues = (values) => {
325
+ return Object.keys(values).filter(key => Boolean(values[key])).reduce((obj, key) => ({
326
+ ...obj,
327
+ [key]: values[key]
328
+ }), {});
329
+ }
330
+
331
+ export const formatPrice = (price, currencyCode) => {
332
+ const {prefix, suffix, decimalSeparator, minorUnit, thousandSeparator} = getCurrency(currencyCode);
333
+ if (price == '' || price === undefined) {
334
+ return price;
335
+ }
336
+
337
+ price = typeof price === 'string' ? parseInt(price, 10) : price;
338
+ price = price / 10 ** minorUnit;
339
+ price = price.toString().replace('.', decimalSeparator);
340
+ let fractional = '';
341
+ const index = price.indexOf(decimalSeparator);
342
+ if (index < 0) {
343
+ price += `${decimalSeparator}${new Array(minorUnit + 1).join('0')}`;
344
+ } else {
345
+ const fractional = price.substr(index + 1);
346
+ if (fractional.length < minorUnit) {
347
+ price += new Array(minorUnit - fractional.length + 1).join('0');
348
+ }
349
+ }
350
+
351
+ // separate out price and decimals so thousands separator can be added.
352
+ ({1: price, 2: fractional} = price.match(new RegExp(`(\\d+)\\${decimalSeparator}(\\d+)`)));
353
+ price = price.replace(new RegExp(`\\B(?=(\\d{3})+(?!\\d))`, 'g'), `${thousandSeparator}`);
354
+ price = price + decimalSeparator + fractional;
355
+ price = prefix + price + suffix;
356
+ return price;
357
+ }
358
+
359
+ export const getShippingOptions = (shippingRates) => {
360
+ let options = [];
361
+ shippingRates.forEach((shippingPackage, idx) => {
362
+ // sort by selected rate
363
+ shippingPackage.shipping_rates.sort((rate) => {
364
+ return rate.selected ? -1 : 1;
365
+ });
366
+ let rates = shippingPackage.shipping_rates.map(rate => {
367
+ let txt = document.createElement('textarea');
368
+ txt.innerHTML = rate.name;
369
+ let price = formatPrice(rate.price, rate.currency_code);
370
+ return {
371
+ id: getShippingOptionId(idx, rate.rate_id),
372
+ label: txt.value,
373
+ //detail: `${price}`,
374
+ amount: parseInt(rate.price, 10)
375
+ }
376
+ });
377
+ options = [...options, ...rates];
378
+ });
379
+ return options;
380
+ }
381
+
382
+ export const getShippingOptionId = (packageId, rateId) => `${packageId}:${rateId}`
383
+
384
+ export const getDisplayItems = (cartItems, {minorUnit}) => {
385
+ let items = [];
386
+ cartItems.forEach(item => {
387
+ if (0 < item.value) {
388
+ items.push({
389
+ label: item.label,
390
+ pending: false,
391
+ amount: item.value
392
+ });
393
+ }
394
+ })
395
+ return items;
396
+ }
397
+
398
+ const canPay = {};
399
+
400
+ export const canMakePayment = ({country, currency, total}, callback) => {
401
+ return new Promise((resolve, reject) => {
402
+ const key = [country, currency, total.amount].reduce((key, value) => `${key}-${value}`);
403
+ if (key in canPay) {
404
+ return resolve(canPay[key]);
405
+ }
406
+ return initStripe.then(stripe => {
407
+ if (stripe.error) {
408
+ return reject(stripe.error);
409
+ }
410
+ const request = stripe.paymentRequest({
411
+ country,
412
+ currency,
413
+ total
414
+ });
415
+ request.canMakePayment().then(result => {
416
+ canPay[key] = callback(result);
417
+ return resolve(canPay[key]);
418
+ });
419
+ }).catch(reject);
420
+ });
421
+ };
422
+
423
+ export const registerLocalPaymentMethod = (paymentMethod) => {
424
+ localPaymentMethods.push(paymentMethod);
425
+ }
426
+
427
+ export const getLocalPaymentMethods = () => localPaymentMethods;
428
+
429
+ export const cartContainsPreOrder = () => {
430
+ const data = getSetting('stripePaymentData');
431
+ return data && data.pre_order;
432
+ }
433
+
434
+ export const cartContainsSubscription = () => {
435
+ const data = getSetting('stripePaymentData');
436
+ return data && data.subscription;
437
+ }
438
+
439
+ export const getDefaultSourceArgs = ({type, amount, billingData, currency, returnUrl}) => {
440
+ return {
441
+ type,
442
+ amount,
443
+ currency,
444
+ owner: getBillingDetailsFromAddress(billingData),
445
+ redirect: {
446
+ return_url: returnUrl
447
+ }
448
+ }
449
+ }
450
+
451
+ export const isTestMode = () => {
452
+ return getSetting('stripeGeneralData').mode === 'test';
453
+ }
454
+
455
+ const getCacheKey = (key) => `${CACHE_PREFIX}${key}`;
456
+
457
+ export const storeInCache = (key, value) => {
458
+ const exp = Math.floor(new Date().getTime() / 1000) + (60 * 15);
459
+ if ('sessionStorage' in window) {
460
+ sessionStorage.setItem(getCacheKey(key), JSON.stringify({value, exp}));
461
+ }
462
+ }
463
+
464
+ export const getFromCache = (key) => {
465
+ if ('sessionStorage' in window) {
466
+ try {
467
+ const item = JSON.parse(sessionStorage.getItem(getCacheKey(key)));
468
+ if (item) {
469
+ const {value, exp} = item;
470
+ if (Math.floor(new Date().getTime() / 1000) > exp) {
471
+ deleteFromCache(getCacheKey(key));
472
+ } else {
473
+ return value;
474
+ }
475
+ }
476
+ } catch (err) {
477
+ }
478
+ }
479
+ return null;
480
+ }
481
+
482
+ export const deleteFromCache = (key) => {
483
+ if ('sessionStorage' in window) {
484
+ sessionStorage.removeItem(getCacheKey(key));
485
+ }
486
+ }
487
+
488
+ export const isCartPage = () => getSetting('stripeGeneralData').page === 'cart';
489
+
490
+ export const isCheckoutPage = () => getSetting('stripeGeneralData').page === 'checkout';
packages/blocks/build/commons.js ADDED
@@ -0,0 +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.2.2"})}),[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("paymentRequestButton",_);e.AuBankAccountElement=w,e.CardCvcElement=j,e.CardElement=C,e.CardExpiryElement=M,e.CardNumberElement=k,e.Elements=v,e.ElementsConsumer=b,e.FpxBankElement=D,e.IbanElement=R,e.IdealBankElement=x,e.PaymentRequestButtonElement=A,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("span",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())}),[_]);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){(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 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,o.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}var y={focus:"focused",empty:"empty",invalid:"invalid"},g=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=(e.ValidationInputError,(0,s.useState)(window.innerWidth)),o=(0,i.default)(a,2),f=(o[0],o[1],(0,s.useState)("")),v=(0,i.default)(f,2),h=v[0],b=v[1],P=(0,s.useRef)([]),E=(0,s.useState)(null),O=(0,i.default)(E,2),S=O[0],_=O[1],w=(0,u.useElements)(),C=t("customForm"),k=(0,c.getCreditCardForm)(C),M=k.component,j=k.breakpoint,D=void 0===j?475:j,R=t("postalCodeEnabled"),x={};["cardNumber","cardExpiry","cardCvc"].forEach((function(e){x[e]=m(m({classes:y},t("cardOptions")),t("customFieldOptions")[e])}));var A=(0,s.useCallback)((function(e){P.current.includes(e)||P.current.push(e)}),[]);(0,p.useBreakpointWidth)({name:"creditCardForm",width:D,node:S,className:"small-form"});var I=(0,s.useCallback)((function(e){var n,r=function(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 d(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)?d(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}}}}(t("icons"));try{for(r.s();!(n=r.n()).done;){var a=n.value;if(a.id===e)return a.src}}catch(e){r.e(e)}finally{r.f()}return""}),[]);return M?r.createElement("div",{className:"wc-stripe-custom-form ".concat(C),ref:_},(0,s.cloneElement)(M,{postalCodeEnabled:R,options:x,onChange:function(e){return A(e),function(t){if(n(t),"cardNumber"===t.elementType&&("unknown"===t.brand?b(""):b(t.brand)),t.complete){var r=P.current.indexOf(e);if(P.current[r+1]){var a=P.current[r+1];w.getElement(a).focus()}}}},CardIcon:r.createElement(g,{type:h,src:I(h)})})):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")[C])))}},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){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(v,e))},v=function(e){var t=e.getData,n=e.billing,a=e.shippingData,c=e.emitResponse,p=e.eventRegistration,y=e.activePaymentMethod,g=(0,m.useStripeError)(),v=(0,o.default)(g,2),h=v[0],b=v[1],P=(0,i.useState)(!1),E=(0,o.default)(P,2),O=E[0],S=E[1],_=p.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:y}),(0,m.useAfterProcessingPayment)({getData:t,eventRegistration:p,responseTypes:c.responseTypes,activePaymentMethod:y,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)}}),(0,s.isUserLoggedIn)(n.customerId)&&t("saveCardEnabled")&&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:g,getData:y}),savedTokenComponent:r.createElement(p.default,{getData:y}),edit:r.createElement(l.PaymentMethod,{content:g,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=(l.shippingAddress,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],T=(0,u.useRef)(r),L=(0,u.useRef)(g),N=(0,d.useStripe)(),B=(0,y.usePaymentEvents)({billing:r,shippingData:g,eventRegistration:h}).addPaymentEvent;(0,u.useEffect)((function(){T.current=r,L.current=g}));var q=(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)(T.current.billingData,["phone","email"])&&(0,p.isEmpty)(null===(r=T.current.billingData)||void 0===r?void 0:r.phone)&&(a={phoneNumber:a.phoneNumber}),O.billingData=(0,f.toCartAddress)(a,{email:e.email})}null!=e&&e.shippingAddress&&(O.shippingAddress=(0,f.toCartAddress)(e.shippingAddress))}),[O,n]),F=(0,u.useCallback)((function(e){for(;e.firstChild;)e.removeChild(e.firstChild)}),[A]),V=(0,u.useCallback)((0,c.default)(i.default.mark((function e(){var t,r,a,o;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,r=T.current.billingData,q(t),a=JSON.parse(t.paymentMethodData.tokenizationData.token),e.next=10,N.createPaymentMethod({type:"card",card:{token:a.id},billing_details:(0,p.getBillingDetailsFromAddress)(r)});case 10:if(!(o=e.sent).error){e.next=13;break}throw new p.StripeError(o.error);case 13:E(o.paymentMethod.id),e.next=19;break;case 16:e.prev=16,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 19:case"end":return e.stop()}}),e,null,[[1,16]])}))),[N,j,S]),U=(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:V},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]),W=(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=L.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),L.current.setShippingAddress(v(v({},L.current.shippingAddress),u)),"shipping_option_unselected"!==s.id&&(r=L.current).setSelectedRates.apply(r,(0,a.default)(d))}))}),e}),[n]);return(0,u.useEffect)((function(){D(new google.payments.api.PaymentsClient(W))}),[W]),(0,u.useEffect)((function(){U()}),[U]),{button:A,removeButton:F}}},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=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=[];return e.forEach((function(e){0<e.value&&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.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,E,P,b]),(0,c.useEffect)((function(){k&&(j.current.requestShipping&&(k.on("shippingaddresschange",A),k.on("shippingoptionchange",I)),k.on("cancel",n),k.on("paymentmethod",T))}),[k]);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]),T=(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")}),[y]);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],T=A[1],L=(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]),q=(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]),(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,L.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,L.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,q(r,_)));case 29:return e.prev=29,e.t0=e.catch(3),console.log(e.t0),T(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,L,P,g,_]),{setPaymentMethod:T}}},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]]}},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")}})},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;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.redirectUrl,t("name")!==p){e.next=17;break}if(e.prev=2,!(c=r.match(/#response=(.+)/))){e.next=11;break}return s=JSON.parse(window.atob(decodeURIComponent(c[1]))),u=s.client_secret,m=s.return_url,(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(!(y=e.sent).error){e.next=11;break}throw new l.StripeError(y.error);case 11:e.next=17;break;case 13:return e.prev=13,e.t0=e.catch(2),console.log(e.t0),e.abrupt("return",(0,l.ensureErrorResponse)(o,e.t0.error));case 17:case"end":return e.stop()}}),e,null,[[2,13]])})));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)},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.categories,n=e.onChange,a=e.selected;return r.createElement("div",{className:"wc-stripe-blocks-klarna-container"},r.createElement("ul",null,t.map((function(e){return r.createElement(c,{key:e.type,category:e,onChange:n,selected:a})}))))};var c=function(e){var t=e.category,n=e.selected,a=e.onChange,c=t.type===n;(0,o.useEffect)((function(){Klarna.Payments.load({container:"#klarna-category-".concat(t.type),payment_method_category:t.type})}),[]);var s={label:t.label,value:t.type,content:r.createElement("div",{id:"klarna-category-".concat(t.type)})};return r.createElement("li",{className:"wc-stripe-blocks-klarna__category",key:t.type},r.createElement(i.default,{option:s,checked:c,onChange:a}))}},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))}),[]),T=(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}),[]),L=(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:T(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){for(var r={},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])}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=L({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,j]),q=(0,u.useCallback)(function(){var e=(0,o.default)(a.default.mark((function e(n){var r,o,i;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.source,o=n.updates,i={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:i,signal:b.current.signal});case 7:e.sent.source&&((0,d.storeInCache)("klarna:source",{source:r,args:P.current}),j(r)),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)}}(),[j]);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=L({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)||q({source:M,updates:e})}var t}),[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,u=e.emitResponse,l=e.eventRegistration,p=u.responseTypes,d=l.onPaymentProcessing,g=l.onCheckoutAfterProcessingWithError,v=(0,o.useState)(""),h=(0,a.default)(v,2),b=h[0],P=h[1],E=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},O=(0,y.useCreateSource)({getData:t,billing:n,shippingData:i}),S=O.source,_=O.isLoading;if((0,y.useProcessPayment)({payment_method:t("name"),source_id:S.id,paymentCategory:b,onPaymentProcessing:d,responseTypes:p}),(0,s.useProcessCheckoutError)({responseTypes:p,subscriber:g}),(0,o.useEffect)((function(){if(!b&&S){var e=E(S);e.length&&P(e.shift().type)}}),[S]),S){Klarna.Payments.init({client_token:S.klarna.client_token});var w=E(S);return r.createElement(f.KlarnaPaymentCategories,{categories:w,selected:!b&&w.length>0?w[0].type:b,onChange:P})}return _?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(9713)),i=a(n(6479)),c=n(3027),s=n(6664),u=n(1134),l=n(8522),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}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,i.default)(n,["billingData","cartTotals"]),c=a.currency_code,s=r.country,l=e("countries"),p=e("allowedCountries"),d=e("features"),m=!1;if(e("isAdmin"))m=!0;else{if((0,u.cartContainsSubscription)()&&!d.includes("subscriptions"))return!1;if((0,u.cartContainsPreOrder)()&&!d.includes("pre-orders"))return!1;e("currencies").includes(c)&&(m="all_except"===p?!e("exceptCountries").includes(s):"specific"===p?e("specificCountries").includes(s):!(l.length>0)||l.includes(s)),t&&m&&(m=t(f({settings:e,billingData:r,cartTotals:a},o)))}return m}},t.LocalPaymentIntentContent=function(e){return r.createElement(s.Elements,{stripe:u.initStripe},r.createElement(y,e))},t.LocalPaymentSourceContent=function(e){return r.createElement(s.Elements,{stripe:u.initStripe},r.createElement(m,e))};var m=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,p=void 0!==u&&u,d=a.shippingAddress,f=i.onPaymentProcessing,m=(i.onCheckoutAfterProcessingWithError,o.responseTypes),y=(o.noticeContexts,(0,l.useCreateSource)({getData:t,billing:n,shippingAddress:d,onPaymentProcessing:f,responseTypes:m,getSourceArgs:s,element:p}).setIsValid);return p?r.createElement(g,{name:t("name"),options:t("elementOptions"),onChange:function(e){y(e.complete)},element:p}):null},y=function(e){var t=e.getData,n=e.billing,a=e.emitResponse,i=e.eventRegistration,u=e.activePaymentMethod,d=e.confirmationMethod,f=void 0===d?null:d,m=e.component,y=void 0===m?null:m,v=(0,s.useElements)(),h=n.billingData,b=i.onPaymentProcessing,P=i.onCheckoutAfterProcessingWithError,E=a.responseTypes,O=a.noticeContexts,S=(0,c.useCallback)((function(){return y?(0,o.default)({},t("paymentType"),v.getElement(y)):{}}),[v]),_=(0,l.useValidateCheckout)({subscriber:b,responseTypes:E,component:y}).setIsValid;return(0,l.useAfterProcessLocalPayment)({getData:t,billingData:h,eventRegistration:i,responseTypes:E,activePaymentMethod:u,confirmationMethod:f,getPaymentMethodArgs:S}),(0,p.useProcessCheckoutError)({responseTypes:E,subscriber:P,messageContext:O.PAYMENT}),y?r.createElement(g,{name:t("name"),options:t("elementOptions"),onChange:function(e){return _(!e.empty)},element:y}):null},g=function(e){var t=e.name,n=e.onChange,a=e.element,o=e.options,i=a;return r.createElement("div",{className:"wc-stripe-local-payment-container ".concat(t," ").concat(i.displayName)},r.createElement(i,{options:o,onChange:n}))}},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")}})},3868:(e,t,n)=>{var r=n(3027),a=n(4222),o=n(1134),i=n(3539),c=n(3187),s=(0,o.getSettings)("stripe_p24_data");s()&&(0,a.registerPaymentMethod)({name:s("name"),label:r.createElement(c.PaymentMethodLabel,{title:s("title"),paymentMethod:s("name"),icons:s("icon")}),ariaLabel:"P24",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")}})},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=a.responseTypes,s=o.onPaymentProcessing,l=o.onCheckoutAfterProcessingWithSuccess,d=i.ValidationInputError,f=(0,y.useValidateCheckout)({subscriber:o.onPaymentProcessing,responseTypes:a.responseTypes,msg:(0,g.__)("Please scan your QR code to continue with payment.","woo-stripe-payment")}),m=(f.isValid,f.setIsValid),v=O({getData:t,billing:n,responseTypes:c,subscriber:s}),h=v.source,b=v.error,P=v.deleteSourceFromStorage;return(0,u.useEffect)((function(){var e=l((function(){return P(),(0,p.ensureSuccessResponse)(c)}));return function(){return e()}}),[h,l,P]),(0,u.useEffect)((function(){h&&m(!0)}),[h]),h?r.createElement(E,{text:h.wechat.qr_code_url}):b?r.createElement("div",{className:"wechat-validation-error"},r.createElement(d,{errorMessage:(0,p.getErrorMessage)(b)})):(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]),{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.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",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[e]};var T=function(e){return null!=D&&D[e]?D[e]:console.log("".concat(e," is not a valid route"))};t.getRoute=T;var L=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return S({type:e.SUCCESS},t)};t.ensureSuccessResponse=L;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 q=function(e){var t={name:"".concat(e.first_name," ").concat(e.last_name),address:{city:e.city||"",country:e.country||"",line1:e.address_1||"",line2:e.address_2||"",postal_code:e.postcode||"",state:e.state||""}};return null!=e&&e.phone&&(t.phone=e.phone),null!=e&&e.email&&(t.email=e.email),t};t.getBillingDetailsFromAddress=q,t.getSettings=function(e){return function(t){return t?(0,v.getSetting)(e)[t]:(0,v.getSetting)(e)}};var F=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=F;var V=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=V,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=U(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&&V(s))return!1}return!0};var U=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=U,t.isFieldRequired=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=U(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 W=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)}}(),Y=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 W(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:T("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",L(r,{redirectUrl:v.redirect}));case 20:return e.abrupt("return",L(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=Y,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),K(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 K=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=K;var G=function(e,t){var n=(0,b.getCurrency)(t),r=n.prefix,a=n.suffix,o=n.decimalSeparator,i=n.minorUnit,c=n.thousandSeparator;if(""==e||void 0===e)return e;e="string"==typeof e?parseInt(e,10):e;var s,u=(e=(e/=Math.pow(10,i)).toString().replace(".",o)).indexOf(o);if(u<0)e+="".concat(o).concat(new Array(i+1).join("0"));else{var l=e.substr(u+1);l.length<i&&(e+=new Array(i-l.length+1).join("0"))}var p=e.match(new RegExp("(\\d+)\\".concat(o,"(\\d+)")));return e=p[1],s=p[2],r+(e=(e=e.replace(new RegExp("\\B(?=(\\d{3})+(?!\\d))","g"),"".concat(c)))+o+s)+a};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=[];return e.forEach((function(e){0<e.value&&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 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)}))},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:q(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.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
packages/blocks/build/commons.js.LICENSE.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ /*!
2
+ Copyright (c) 2017 Jed Watson.
3
+ Licensed under the MIT License (MIT), see
4
+ http://jedwatson.github.io/classnames
5
+ */
packages/blocks/build/commons.js.map ADDED
@@ -0,0 +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/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/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/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","PaymentRequestButtonElement","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","innerWidth","cardType","setCardType","elementOrder","container","setContainer","getCreditCardForm","CardForm","postalCodeEnabled","forEach","setElementOrder","includes","useBreakpointWidth","getCardIconSrc","icon","cloneElement","brand","complete","idx","nextElement","getElement","sprintf","SimpleForm","data-tid","cardOptions","postalCode","billingData","postcode","hidePostalCode","isFieldRequired","iconStyle","CreditCardContent","setError","catch","CreditCardElement","savePaymentMethod","setSavePaymentMethod","getPaymentMethodArgs","elType","card","useSetupIntent","cartTotal","setupIntent","removeSetupIntent","Tag","CustomCardForm","StripeCardForm","isUserLoggedIn","customerId","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","shippingAddress","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","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","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","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","cartContainsPreOrder","cartContainsSubscription","LocalPaymentSourceContent","LocalPaymentIntentContent","confirmationMethod","currentBillingData","match","atob","decodeURIComponent","return_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","locale","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","getCategoriesFromSource","paymentMethodCategories","payment_method_categories","useCreateSource","init","client_token","KlarnaPaymentCategories","KlarnaLoader","settings","requiredParams","callback","countries","LocalPaymentIntentMethod","LocalPaymentSourceMethod","LocalPaymentElementContainer","useValidateCheckout","useAfterProcessLocalPayment","PAYMENT","SepaPaymentMethod","mandate","notification_method","interval","sofort","WeChatComponent","WeChatPaymentMethod","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","getSetting","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","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,E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ACpBknB,eAAeG,WAAWP,EAAY52B,K,iCAIpB,iBAA+C,UAAzC,IAAAszB,YAAW,qBAAqB8D,M,iBAElC,iBAA+C,cAAzC,IAAA9D,YAAW,qBAAqB8D,O,aCzepE,OAOC,WACA,aAEA,IAAIC,EAAS,GAAGx0B,eAEhB,SAASy0B,IAGR,IAFA,IAAItc,EAAU,GAEL7b,EAAI,EAAGA,EAAIwB,UAAUzB,OAAQC,IAAK,CAC1C,IAAIc,EAAMU,UAAUxB,GACpB,GAAKc,EAAL,CAEA,IAAIs3B,SAAiBt3B,EAErB,GAAgB,WAAZs3B,GAAoC,WAAZA,EAC3Bvc,EAAQtZ,KAAKzB,QACP,GAAIZ,MAAMC,QAAQW,IAAQA,EAAIf,OAAQ,CAC5C,IAAIs4B,EAAQF,EAAW12B,MAAM,KAAMX,GAC/Bu3B,GACHxc,EAAQtZ,KAAK81B,QAER,GAAgB,WAAZD,EACV,IAAK,IAAIv3B,KAAOC,EACXo3B,EAAOv0B,KAAK7C,EAAKD,IAAQC,EAAID,IAChCgb,EAAQtZ,KAAK1B,IAMjB,OAAOgb,EAAQoM,KAAK,KAGgBtoB,EAAOC,SAC3Cu4B,EAAW1C,QAAU0C,EACrBx4B,EAAOC,QAAUu4B,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.2.2\"\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 PaymentRequestButtonElement = createElementComponent('paymentRequestButton', isServer);\n\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.FpxBankElement = FpxBankElement;\n exports.IbanElement = IbanElement;\n exports.IdealBankElement = IdealBankElement;\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 {useState, 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 <span>{desc}</span>\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]);\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 ValidationInputError\r\n }) => {\r\n const [windowSize, setWindowSize] = useState(window.innerWidth);\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, 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 icon of getData('icons')) {\r\n if (icon.id === type) {\r\n return icon.src;\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 {initStripe as loadStripe, getSettings, isFieldRequired, isUserLoggedIn} 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 '@paymentplugins/stripe/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 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 {isUserLoggedIn(billing.customerId) && getData('saveCardEnabled') &&\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, shippingAddress} = 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 = 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 const {billingData} = currentBilling.current;\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(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 ]);\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\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 cartTotalItems.forEach(item => {\r\n if (0 < item.value) {\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 {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 }, [stripe, billingData, shippingRates, needsShipping]);\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 }, [paymentRequest]);\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 }, [setPaymentMethod]);\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]);\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 {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 {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 }\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'","import {useEffect} from '@wordpress/element';\r\nimport RadioControlAccordion from \"../../../components/checkout/radio-control-accordion\";\r\n\r\nexport const KlarnaPaymentCategories = ({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 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 = ({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 //instance_id: `klarna-instance-${category.type}`\r\n });\r\n }, []);\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\nlet klarnaSource = {};\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(function (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) => {\r\n const newArgs = {};\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 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 }, [\r\n stripe,\r\n setSource\r\n ]);\r\n\r\n const updateSource = useCallback(async ({source, updates}) => {\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', {source, args: currentSourceArgs.current});\r\n setSource(source);\r\n }\r\n } catch (err) {\r\n console.log('update aborted');\r\n }\r\n }, [setSource]);\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});\r\n }\r\n }\r\n }, [\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} 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 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 if (source) {\r\n Klarna.Payments.init({\r\n client_token: source.klarna.client_token\r\n });\r\n const categories = getCategoriesFromSource(source);\r\n return (\r\n <KlarnaPaymentCategories\r\n categories={categories}\r\n selected={!selected && categories.length > 0 ? categories[0].type : selected}\r\n onChange={setSelected}/>\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 }) => {\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 }\r\n return {};\r\n }, [elements]);\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 )\r\n }\r\n return null;\r\n}\r\n\r\nconst LocalPaymentElementContainer = ({name, onChange, element, options}) => {\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}/>\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 {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_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 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, 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 {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}/>\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 ]);\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 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[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 || '',\r\n country: billingAddress.country || '',\r\n line1: billingAddress.address_1 || '',\r\n line2: billingAddress.address_2 || '',\r\n postal_code: billingAddress.postcode || '',\r\n state: billingAddress.state || ''\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 price += `${decimalSeparator}${new Array(minorUnit + 1).join('0')}`;\r\n } else {\r\n const 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 ({1: price, 2: fractional} = price.match(new RegExp(`(\\\\d+)\\\\${decimalSeparator}(\\\\d+)`)));\r\n price = price.replace(new RegExp(`\\\\B(?=(\\\\d{3})+(?!\\\\d))`, 'g'), `${thousandSeparator}`);\r\n price = price + decimalSeparator + fractional;\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 cartItems.forEach(item => {\r\n if (0 < item.value) {\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 (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 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":""}
packages/blocks/build/credit-card/bootstrap-rtl.css ADDED
@@ -0,0 +1 @@
 
1
+ .wc-stripe-bootstrap-form{background:#fff!important;margin-top:10px}.wc-stripe-bootstrap-form .StripeElement{background-color:#fff;border-radius:4px;box-sizing:border-box;height:40px;padding:10px 12px;-webkit-transition:box-shadow .15s ease;transition:box-shadow .15s ease}.wc-stripe-bootstrap-form .row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin:0 -15px}.wc-stripe-bootstrap-form .mb-2,.wc-stripe-bootstrap-form .my-2{margin-bottom:.5rem!important}.wc-stripe-bootstrap-form .mb-3,.wc-stripe-bootstrap-form .my-3{margin-bottom:18px!important}.wc-stripe-bootstrap-form .col-md-3,.wc-stripe-bootstrap-form .col-md-4,.wc-stripe-bootstrap-form .col-md-6,.wc-stripe-bootstrap-form .col-md-9,.wc-stripe-bootstrap-form .col-md-12{padding-right:15px;padding-left:15px;position:relative;width:100%}.wc-stripe-bootstrap-form .md-form+label{color:#757575;cursor:text;right:15px;overflow:hidden;pointer-events:none;position:absolute;top:.65rem;-webkit-transition:.3s ease-out;-o-transition:.3s ease-out;transition:.3s ease-out}.wc-stripe-bootstrap-form .md-form.md-outline.StripeElement+label{color:#495057;cursor:text;font-size:16px;font-weight:300;margin:0;padding-right:12px;pointer-events:none;position:absolute!important;top:50%;transform:translateY(-50%);-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);-moz-transform:translateY(-50%);transition-property:color,transform;-webkit-transition:.3s ease-out;-o-transition:.3s ease-out;transition:.3s ease-out}.wc-stripe-bootstrap-form .md-form.md-outline.focused+label,.wc-stripe-bootstrap-form .md-form.md-outline.invalid+label,.wc-stripe-bootstrap-form .md-form.md-outline.StripeElement--complete+label{background:#fff!important;font-size:12px;font-weight:500;right:20px;padding-right:5px;padding-left:5px;-webkit-transform:translateY(-35px);-ms-transform:translateY(-35px);transform:translateY(-35px)}.wc-stripe-bootstrap-form .md-form.md-outline{height:auto;position:relative;width:100%}.wc-stripe-bootstrap-form .md-form.md-outline.invalid+label{color:#e25950!important}.wc-stripe-bootstrap-form .md-form.md-outline.focused+label{color:#4285f4}.wc-stripe-bootstrap-form .md-form.md-outline.StripeElement--complete{border-color:#1b9404;box-shadow:inset 0 0 0 .5px #1b9404;-webkit-box-shadow:inset 0 0 0 .5px #1b9404}.wc-stripe-bootstrap-form .md-form.md-outline.StripeElement--complete+label{color:#1b9404}.wc-stripe-bootstrap-form .stripe-input{background-color:#fff!important;border:1px solid #dadce0;-webkit-border-radius:4px;border-radius:4px;-webkit-box-shadow:none;box-shadow:none;-webkit-box-sizing:border-box;box-sizing:border-box;height:40px;outline:0;-webkit-transition:all .3s;-o-transition:all .3s;transition:all .3s}.wc-stripe-bootstrap-form .stripe-input.focused,.wc-stripe-bootstrap-form .stripe-input.invalid{border-color:#4285f4;-webkit-box-shadow:inset 0 0 0 .5px #4285f4;box-shadow:inset 0 0 0 .5px #4285f4}.wc-stripe-bootstrap-form .stripe-input.invalid{border-color:#e25950;box-shadow:inset 0 0 0 .5px #e25950}.wc-stripe-bootstrap-form [class^=col-md-]{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.wc-stripe-bootstrap-form .wc-stripe-card{bottom:0;left:30px;top:50%;transform:translateY(-50%)}@media(min-width:475px){.wc-stripe-bootstrap-form .col-md-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.wc-stripe-bootstrap-form .col-md-4{-webkit-box-flex:0;-ms-flex:0 0 33.33%;flex:0 0 33.33%;max-width:33.33%}.wc-stripe-bootstrap-form .col-md-6{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.wc-stripe-bootstrap-form .col-md-9{-webkit-box-flex:0;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.wc-stripe-bootstrap-form .col-md-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}}.small-form .wc-stripe-bootstrap-form [class^=col-md-]{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}
packages/blocks/build/credit-card/bootstrap.css ADDED
@@ -0,0 +1 @@
 
1
+ .wc-stripe-bootstrap-form{background:#fff!important;margin-top:10px}.wc-stripe-bootstrap-form .StripeElement{background-color:#fff;border-radius:4px;box-sizing:border-box;height:40px;padding:10px 12px;-webkit-transition:box-shadow .15s ease;transition:box-shadow .15s ease}.wc-stripe-bootstrap-form .row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin:0 -15px}.wc-stripe-bootstrap-form .mb-2,.wc-stripe-bootstrap-form .my-2{margin-bottom:.5rem!important}.wc-stripe-bootstrap-form .mb-3,.wc-stripe-bootstrap-form .my-3{margin-bottom:18px!important}.wc-stripe-bootstrap-form .col-md-3,.wc-stripe-bootstrap-form .col-md-4,.wc-stripe-bootstrap-form .col-md-6,.wc-stripe-bootstrap-form .col-md-9,.wc-stripe-bootstrap-form .col-md-12{padding-left:15px;padding-right:15px;position:relative;width:100%}.wc-stripe-bootstrap-form .md-form+label{color:#757575;cursor:text;left:15px;overflow:hidden;pointer-events:none;position:absolute;top:.65rem;-webkit-transition:.3s ease-out;-o-transition:.3s ease-out;transition:.3s ease-out}.wc-stripe-bootstrap-form .md-form.md-outline.StripeElement+label{color:#495057;cursor:text;font-size:16px;font-weight:300;margin:0;padding-left:12px;pointer-events:none;position:absolute!important;top:50%;transform:translateY(-50%);-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);-moz-transform:translateY(-50%);transition-property:color,transform;-webkit-transition:.3s ease-out;-o-transition:.3s ease-out;transition:.3s ease-out}.wc-stripe-bootstrap-form .md-form.md-outline.focused+label,.wc-stripe-bootstrap-form .md-form.md-outline.invalid+label,.wc-stripe-bootstrap-form .md-form.md-outline.StripeElement--complete+label{background:#fff!important;font-size:12px;font-weight:500;left:20px;padding-left:5px;padding-right:5px;-webkit-transform:translateY(-35px);-ms-transform:translateY(-35px);transform:translateY(-35px)}.wc-stripe-bootstrap-form .md-form.md-outline{height:auto;position:relative;width:100%}.wc-stripe-bootstrap-form .md-form.md-outline.invalid+label{color:#e25950!important}.wc-stripe-bootstrap-form .md-form.md-outline.focused+label{color:#4285f4}.wc-stripe-bootstrap-form .md-form.md-outline.StripeElement--complete{border-color:#1b9404;box-shadow:inset 0 0 0 .5px #1b9404;-webkit-box-shadow:inset 0 0 0 .5px #1b9404}.wc-stripe-bootstrap-form .md-form.md-outline.StripeElement--complete+label{color:#1b9404}.wc-stripe-bootstrap-form .stripe-input{background-color:#fff!important;border:1px solid #dadce0;-webkit-border-radius:4px;border-radius:4px;-webkit-box-shadow:none;box-shadow:none;-webkit-box-sizing:border-box;box-sizing:border-box;height:40px;outline:0;-webkit-transition:all .3s;-o-transition:all .3s;transition:all .3s}.wc-stripe-bootstrap-form .stripe-input.focused,.wc-stripe-bootstrap-form .stripe-input.invalid{border-color:#4285f4;-webkit-box-shadow:inset 0 0 0 .5px #4285f4;box-shadow:inset 0 0 0 .5px #4285f4}.wc-stripe-bootstrap-form .stripe-input.invalid{border-color:#e25950;box-shadow:inset 0 0 0 .5px #e25950}.wc-stripe-bootstrap-form [class^=col-md-]{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.wc-stripe-bootstrap-form .wc-stripe-card{bottom:0;right:30px;top:50%;transform:translateY(-50%)}@media(min-width:475px){.wc-stripe-bootstrap-form .col-md-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.wc-stripe-bootstrap-form .col-md-4{-webkit-box-flex:0;-ms-flex:0 0 33.33%;flex:0 0 33.33%;max-width:33.33%}.wc-stripe-bootstrap-form .col-md-6{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.wc-stripe-bootstrap-form .col-md-9{-webkit-box-flex:0;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.wc-stripe-bootstrap-form .col-md-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}}.small-form .wc-stripe-bootstrap-form [class^=col-md-]{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}
packages/blocks/build/credit-card/bootstrap.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sources":["webpack://woo-stripe-payment/./packages/blocks/assets/js/payment-methods/credit-card/components/bootstrap/style.scss"],"names":[],"mappings":";;;AAAA","file":"credit-card/bootstrap.js","sourcesContent":["// extracted by mini-css-extract-plugin\nexport {};"],"sourceRoot":""}
packages/blocks/build/credit-card/simple-rtl.css ADDED
@@ -0,0 +1 @@
 
1
+ .wc-stripe-simple-form{background-color:#fff;padding:10px 0}.wc-stripe-simple-form *{box-sizing:border-box;font-family:Source Code Pro,Consolas,Menlo,monospace;font-size:16px;font-weight:500}.wc-stripe-simple-form .StripeElement{padding-right:0}.wc-stripe-simple-form .row{display:-ms-flexbox;display:flex;flex-wrap:wrap}.wc-stripe-simple-form .row:first-of-type{margin-bottom:10px}.wc-stripe-simple-form .field{display:flex;height:50px;margin:0;position:relative;width:100%}.wc-stripe-simple-form .field.half-width{width:50%}.wc-stripe-simple-form .field.half-width:nth-child(2n) .field-item{margin:0 10px 0 0}.wc-stripe-simple-form .field.half-width:nth-child(odd) .field-item{margin:0 0 0 10px}.wc-stripe-simple-form .field .field-item{position:relative;width:100%}.wc-stripe-simple-form .baseline{background-color:#cfd7df;bottom:0;height:1px;right:0;position:absolute;transition:background-color .3s cubic-bezier(.165,.84,.44,1);width:100%}.wc-stripe-simple-form label{bottom:8px;color:#cfd7df;cursor:text;right:0;margin-bottom:0;overflow:hidden;padding:0;position:absolute;text-overflow:ellipsis;transform-origin:100% 50%;transition-duration:.3s;transition-property:color,transform;transition-timing-function:cubic-bezier(.165,.84,.44,1);white-space:nowrap;width:100%}.wc-stripe-simple-form .input{background-color:transparent;bottom:0;color:#32325d;right:0;padding-bottom:7px;position:absolute;width:100%}.wc-stripe-simple-form .input::-moz-placeholder,.wc-stripe-simple-form .input::-webkit-input-placeholder{color:transparent;transition:color .3s cubic-bezier(.165,.84,.44,1)}.wc-stripe-simple-form .input.StripeElement{opacity:0;transition:opacity .3s cubic-bezier(.165,.84,.44,1);will-change:opacity}.wc-stripe-simple-form .input.focused,.wc-stripe-simple-form .input:not(.empty){opacity:1}.wc-stripe-simple-form .input.focused+label,.wc-stripe-simple-form .input:not(.empty)+label{color:#aab7c4;cursor:default;transform:scale(.85) translateY(-25px)}.wc-stripe-simple-form .input.focused+label{color:#24b47e}.wc-stripe-simple-form .input.focused+label+.baseline{background-color:#24b47e}.wc-stripe-simple-form .input.invalid+label{color:#ffa27b}.wc-stripe-simple-form .input.invalid+label+.baseline{background-color:#e25950}@media(min-width:475px){.wc-stripe-simple-form .field.half-width{width:50%}}.small-form .wc-stripe-simple-form .field.half-width{width:100%}.small-form .wc-stripe-simple-form .field.half-width:nth-child(2n) .field-item,.small-form .wc-stripe-simple-form .field.half-width:nth-child(odd) .field-item{margin:0}.small-form .wc-stripe-simple-form .cvc{margin-top:10px}
packages/blocks/build/credit-card/simple.css ADDED
@@ -0,0 +1 @@
 
1
+ .wc-stripe-simple-form{background-color:#fff;padding:10px 0}.wc-stripe-simple-form *{box-sizing:border-box;font-family:Source Code Pro,Consolas,Menlo,monospace;font-size:16px;font-weight:500}.wc-stripe-simple-form .StripeElement{padding-left:0}.wc-stripe-simple-form .row{display:-ms-flexbox;display:flex;flex-wrap:wrap}.wc-stripe-simple-form .row:first-of-type{margin-bottom:10px}.wc-stripe-simple-form .field{display:flex;height:50px;margin:0;position:relative;width:100%}.wc-stripe-simple-form .field.half-width{width:50%}.wc-stripe-simple-form .field.half-width:nth-child(2n) .field-item{margin:0 0 0 10px}.wc-stripe-simple-form .field.half-width:nth-child(odd) .field-item{margin:0 10px 0 0}.wc-stripe-simple-form .field .field-item{position:relative;width:100%}.wc-stripe-simple-form .baseline{background-color:#cfd7df;bottom:0;height:1px;left:0;position:absolute;transition:background-color .3s cubic-bezier(.165,.84,.44,1);width:100%}.wc-stripe-simple-form label{bottom:8px;color:#cfd7df;cursor:text;left:0;margin-bottom:0;overflow:hidden;padding:0;position:absolute;text-overflow:ellipsis;transform-origin:0 50%;transition-duration:.3s;transition-property:color,transform;transition-timing-function:cubic-bezier(.165,.84,.44,1);white-space:nowrap;width:100%}.wc-stripe-simple-form .input{background-color:transparent;bottom:0;color:#32325d;left:0;padding-bottom:7px;position:absolute;width:100%}.wc-stripe-simple-form .input::-moz-placeholder,.wc-stripe-simple-form .input::-webkit-input-placeholder{color:transparent;transition:color .3s cubic-bezier(.165,.84,.44,1)}.wc-stripe-simple-form .input.StripeElement{opacity:0;transition:opacity .3s cubic-bezier(.165,.84,.44,1);will-change:opacity}.wc-stripe-simple-form .input.focused,.wc-stripe-simple-form .input:not(.empty){opacity:1}.wc-stripe-simple-form .input.focused+label,.wc-stripe-simple-form .input:not(.empty)+label{color:#aab7c4;cursor:default;transform:scale(.85) translateY(-25px)}.wc-stripe-simple-form .input.focused+label{color:#24b47e}.wc-stripe-simple-form .input.focused+label+.baseline{background-color:#24b47e}.wc-stripe-simple-form .input.invalid+label{color:#ffa27b}.wc-stripe-simple-form .input.invalid+label+.baseline{background-color:#e25950}@media(min-width:475px){.wc-stripe-simple-form .field.half-width{width:50%}}.small-form .wc-stripe-simple-form .field.half-width{width:100%}.small-form .wc-stripe-simple-form .field.half-width:nth-child(2n) .field-item,.small-form .wc-stripe-simple-form .field.half-width:nth-child(odd) .field-item{margin:0}.small-form .wc-stripe-simple-form .cvc{margin-top:10px}
packages/blocks/build/credit-card/simple.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sources":["webpack://woo-stripe-payment/./packages/blocks/assets/js/payment-methods/credit-card/components/simple/style.scss"],"names":[],"mappings":";;;AAAA","file":"credit-card/simple.js","sourcesContent":["// extracted by mini-css-extract-plugin\nexport {};"],"sourceRoot":""}
packages/blocks/build/style-rtl.css ADDED
@@ -0,0 +1 @@
 
1
+ .wc-stripe-express__sm li[id^=express-payment-method-stripe_]{padding-right:0!important;padding-left:0!important;width:100%}.wc-stripe-express__sm li[id^=express-payment-method-stripe_]:nth-child(n+2),ul:not(.wc-stripe-express__sm) li[id^=express-payment-method-stripe_]:nth-child(n+3){margin-top:10px}.wc-stripe-save-payment-method{align-items:center;display:flex;flex-wrap:wrap;margin-top:1em}.wc-stripe-save-payment-method input[type=checkbox]{height:20px;opacity:0;position:absolute;width:20px}.wc-stripe-save-payment-method input[type=checkbox]:checked+svg{display:block;height:auto}.wc-stripe-save-payment-method span{margin-right:5px}.wc-stripe-save-payment-method label{background-color:#fff;border:1px solid #bababa;border-radius:3px;display:block;height:20px;margin:0;padding:0;position:relative;width:20px}.wc-stripe-save-payment-method svg{display:none}.wc-stripe-label-container{align-items:center;display:flex;flex-wrap:wrap}.wc-stripe-label-container .wc-block-components-payment-method-label{flex:0 1 auto}.wc-stripe-label-container .wc-block-components-payment-method-icons{display:flex;flex:1 1 auto;justify-content:flex-end}.wc-stripe-blocks-payment-method__desc+.wc-stripe-blocks-payment-method-content{margin-top:10px}.wc-stripe-blocks-payment-method__desc+.wc-stripe-blocks-payment-method-content.no-content{margin-top:0}.wc-stripe-blocks-radio-control__option{align-items:center;display:flex}.wc-stripe-blocks-radio-control__option .wc-stripe-blocks-radio-control__label{margin-right:10px}.wc-stripe-blocks-radio-control__option .wc-stripe-blocks-radio-control__input{appearance:none;-webkit-appearance:none;-moz-appearance:none;background:#fff;border:2px solid #50575e;border-radius:50%;display:inline-block;min-height:15px;min-width:15px;position:relative}.wc-stripe-blocks-radio-control__option .wc-stripe-blocks-radio-control__input:checked:before{background:#000;border-radius:50%;content:"";display:block;right:50%;min-height:8px;min-width:8px;position:absolute;top:50%;transform:translate(50%,-50%)}.wc-stripe-label-container.stripe_ach img.wc-block-components-payment-method-icon--stripe_ach{height:25px}.wc-stripe-blocks-ach__creds{margin-top:10px}.wc-stripe-blocks-ach__creds .wc-stripe-blocks-ach__creds-label{font-weight:700}@supports(-webkit-appearance:-apple-pay-button){.wc-stripe-apple-pay-container .apple-pay-button{-webkit-appearance:-apple-pay-button!important;height:40px;max-height:40px;max-width:100%;min-width:200px;width:100%}.wc-stripe-apple-pay-container .apple-pay-button.apple-pay-button-black{-apple-pay-button-style:#000}.wc-stripe-apple-pay-container .apple-pay-button.apple-pay-button-white{-apple-pay-button-style:#fff}.wc-stripe-apple-pay-container .apple-pay-button.apple-pay-button-white-with-line{-apple-pay-button-style:white-outline}}.apple-pay-block-editor{align-items:center;background-color:#000;border-radius:4px;display:flex;height:40px;justify-content:center;width:100%}.apple-pay-block-editor img{height:100%;max-height:40px}.wc-stripe-inline-form{border:1px solid #e0e0e0;border-radius:2px;padding:10px 8px}.wc-stripe-card-container+.wc-block-components-payment-methods__save-card-info,.wc-stripe-save-payment-method+.wc-block-components-payment-methods__save-card-info{display:none}.wc-stripe-custom-form-error{color:#cc1818;font-size:16px;width:100%}.wc-stripe-custom-form .wc-stripe-card{bottom:7px;height:20px;position:absolute;left:0;width:32px}.wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option .wc-block-components-radio-control__label img.wc-block-components-payment-method-icon--stripe_googlepay_icon,.wc-stripe-label-container .wc-block-components-payment-method-icon--stripe_googlepay_icon{height:26px}.wc-stripe-gpay-container .wc-stripe-gpay-button-container .gpay-card-info-container-fill button.long{min-width:200px}.wc-stripe-gpay-container .wc-block-components-validation-error{margin-top:5px;position:relative}.gpay-block-editor{align-items:center;background-color:#000;border-radius:4px;display:flex;height:40px;justify-content:center;overflow:hidden;width:100%}.gpay-block-editor img{max-height:40px}.wc-stripe-klarna-loader{box-sizing:border-box;display:flex;height:30px;justify-content:center;position:relative;transform:scale(.65);width:100%}.wc-stripe-klarna-loader div{animation:klarna-payments-loader 1.3s cubic-bezier(.5,0,.5,1) infinite;border-radius:50%;border:3px solid transparent;border-top-color:#000;box-sizing:border-box;display:block;height:30px;position:absolute;width:30px}.wc-stripe-klarna-loader div:first-child{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(0deg)}to{transform:rotate(-1turn)}}.wc-stripe-blocks-klarna-container ul{list-style:none;margin:0;padding:0}.wc-stripe-blocks-klarna-container .wc-stripe-blocks-radio-accordion .wc-stripe-blocks-radio-accordion__content{display:none}.wc-stripe-blocks-klarna-container .wc-stripe-blocks-radio-accordion .wc-stripe-blocks-radio-accordion__content.wc-stripe-blocks-radio-accordion__content-visible{display:block}.wc-stripe-label-container.stripe_ideal img.wc-block-components-payment-method-icon--stripe_ideal{height:29px}.wc-stripe-label-container.stripe_p24 img.wc-block-components-payment-method-icon--stripe_p24{height:25px}.wc-stripe-label-container.stripe_bancontact img.wc-block-components-payment-method-icon--stripe_bancontact{height:26px}.wc-stripe-label-container.stripe_eps img.wc-block-components-payment-method-icon--stripe_eps{height:34px}.wc-stripe-label-container.stripe_multibanco img.wc-block-components-payment-method-icon--stripe_multibanco{height:45px}.wc-stripe-label-container.stripe_sepa img.wc-block-components-payment-method-icon--stripe_sepa{height:17px}.wc-stripe-label-container.stripe_fpx img.wc-block-components-payment-method-icon--stripe_fpx,.wc-stripe-label-container.stripe_sofort img.wc-block-components-payment-method-icon--stripe_sofort{height:22px}.wc-stripe-label-container.stripe_alipay img.wc-block-components-payment-method-icon--stripe_alipay{height:25px}.wc-stripe-label-container.stripe_klarna img.wc-block-components-payment-method-icon--stripe_klarna{height:26px}.wc-stripe-local-payment-container{align-items:center;border:1px solid #dadce0;border-radius:4px;display:flex;min-height:42px}.wc-stripe-local-payment-container.AuBankAccountElement,.wc-stripe-local-payment-container.IbanElement{padding-right:10px}.wc-stripe-local-payment-container .StripeElement{flex:1}#wc-stripe-block-qrcode+p{margin-top:5px}.wechat-validation-error .wc-block-components-validation-error{position:relative}.payment-request-block-editor{align-items:center;background-color:#32325d;border-radius:4px;color:#fff;display:flex;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:16px;font-weight:600;height:40px;justify-content:center}.payment-request-block-editor .icon-container{align-items:center;display:flex;position:relative}.payment-request-block-editor .icon-container span{margin-bottom:5px}.payment-request-block-editor .icon-container canvas.PaymentRequestButton-icon{-ms-flex-negative:0;-webkit-flex-shrink:0;flex-shrink:0;height:20px;margin:0 7px -1px -1px;position:relative;width:20px;will-change:opacity;z-index:10}.payment-request-block-editor .icon-container .payment-request-arrow{border-bottom:4px solid;border-left:4px solid;height:12px;position:absolute;left:8px;transform:rotate(45deg);width:12px;z-index:99}
packages/blocks/build/style.css ADDED
@@ -0,0 +1 @@
 
1
+ .wc-stripe-express__sm li[id^=express-payment-method-stripe_]{padding-left:0!important;padding-right:0!important;width:100%}.wc-stripe-express__sm li[id^=express-payment-method-stripe_]:nth-child(n+2),ul:not(.wc-stripe-express__sm) li[id^=express-payment-method-stripe_]:nth-child(n+3){margin-top:10px}.wc-stripe-save-payment-method{align-items:center;display:flex;flex-wrap:wrap;margin-top:1em}.wc-stripe-save-payment-method input[type=checkbox]{height:20px;opacity:0;position:absolute;width:20px}.wc-stripe-save-payment-method input[type=checkbox]:checked+svg{display:block;height:auto}.wc-stripe-save-payment-method span{margin-left:5px}.wc-stripe-save-payment-method label{background-color:#fff;border:1px solid #bababa;border-radius:3px;display:block;height:20px;margin:0;padding:0;position:relative;width:20px}.wc-stripe-save-payment-method svg{display:none}.wc-stripe-label-container{align-items:center;display:flex;flex-wrap:wrap}.wc-stripe-label-container .wc-block-components-payment-method-label{flex:0 1 auto}.wc-stripe-label-container .wc-block-components-payment-method-icons{display:flex;flex:1 1 auto;justify-content:flex-end}.wc-stripe-blocks-payment-method__desc+.wc-stripe-blocks-payment-method-content{margin-top:10px}.wc-stripe-blocks-payment-method__desc+.wc-stripe-blocks-payment-method-content.no-content{margin-top:0}.wc-stripe-blocks-radio-control__option{align-items:center;display:flex}.wc-stripe-blocks-radio-control__option .wc-stripe-blocks-radio-control__label{margin-left:10px}.wc-stripe-blocks-radio-control__option .wc-stripe-blocks-radio-control__input{appearance:none;-webkit-appearance:none;-moz-appearance:none;background:#fff;border:2px solid #50575e;border-radius:50%;display:inline-block;min-height:15px;min-width:15px;position:relative}.wc-stripe-blocks-radio-control__option .wc-stripe-blocks-radio-control__input:checked:before{background:#000;border-radius:50%;content:"";display:block;left:50%;min-height:8px;min-width:8px;position:absolute;top:50%;transform:translate(-50%,-50%)}.wc-stripe-label-container.stripe_ach img.wc-block-components-payment-method-icon--stripe_ach{height:25px}.wc-stripe-blocks-ach__creds{margin-top:10px}.wc-stripe-blocks-ach__creds .wc-stripe-blocks-ach__creds-label{font-weight:700}@supports(-webkit-appearance:-apple-pay-button){.wc-stripe-apple-pay-container .apple-pay-button{-webkit-appearance:-apple-pay-button!important;height:40px;max-height:40px;max-width:100%;min-width:200px;width:100%}.wc-stripe-apple-pay-container .apple-pay-button.apple-pay-button-black{-apple-pay-button-style:#000}.wc-stripe-apple-pay-container .apple-pay-button.apple-pay-button-white{-apple-pay-button-style:#fff}.wc-stripe-apple-pay-container .apple-pay-button.apple-pay-button-white-with-line{-apple-pay-button-style:white-outline}}.apple-pay-block-editor{align-items:center;background-color:#000;border-radius:4px;display:flex;height:40px;justify-content:center;width:100%}.apple-pay-block-editor img{height:100%;max-height:40px}.wc-stripe-inline-form{border:1px solid #e0e0e0;border-radius:2px;padding:10px 8px}.wc-stripe-card-container+.wc-block-components-payment-methods__save-card-info,.wc-stripe-save-payment-method+.wc-block-components-payment-methods__save-card-info{display:none}.wc-stripe-custom-form-error{color:#cc1818;font-size:16px;width:100%}.wc-stripe-custom-form .wc-stripe-card{bottom:7px;height:20px;position:absolute;right:0;width:32px}.wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option .wc-block-components-radio-control__label img.wc-block-components-payment-method-icon--stripe_googlepay_icon,.wc-stripe-label-container .wc-block-components-payment-method-icon--stripe_googlepay_icon{height:26px}.wc-stripe-gpay-container .wc-stripe-gpay-button-container .gpay-card-info-container-fill button.long{min-width:200px}.wc-stripe-gpay-container .wc-block-components-validation-error{margin-top:5px;position:relative}.gpay-block-editor{align-items:center;background-color:#000;border-radius:4px;display:flex;height:40px;justify-content:center;overflow:hidden;width:100%}.gpay-block-editor img{max-height:40px}.wc-stripe-klarna-loader{box-sizing:border-box;display:flex;height:30px;justify-content:center;position:relative;transform:scale(.65);width:100%}.wc-stripe-klarna-loader div{animation:klarna-payments-loader 1.3s cubic-bezier(.5,0,.5,1) infinite;border-radius:50%;border:3px solid transparent;border-top-color:#000;box-sizing:border-box;display:block;height:30px;position:absolute;width:30px}.wc-stripe-klarna-loader div:first-child{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(0deg)}to{transform:rotate(1turn)}}.wc-stripe-blocks-klarna-container ul{list-style:none;margin:0;padding:0}.wc-stripe-blocks-klarna-container .wc-stripe-blocks-radio-accordion .wc-stripe-blocks-radio-accordion__content{display:none}.wc-stripe-blocks-klarna-container .wc-stripe-blocks-radio-accordion .wc-stripe-blocks-radio-accordion__content.wc-stripe-blocks-radio-accordion__content-visible{display:block}.wc-stripe-label-container.stripe_ideal img.wc-block-components-payment-method-icon--stripe_ideal{height:29px}.wc-stripe-label-container.stripe_p24 img.wc-block-components-payment-method-icon--stripe_p24{height:25px}.wc-stripe-label-container.stripe_bancontact img.wc-block-components-payment-method-icon--stripe_bancontact{height:26px}.wc-stripe-label-container.stripe_eps img.wc-block-components-payment-method-icon--stripe_eps{height:34px}.wc-stripe-label-container.stripe_multibanco img.wc-block-components-payment-method-icon--stripe_multibanco{height:45px}.wc-stripe-label-container.stripe_sepa img.wc-block-components-payment-method-icon--stripe_sepa{height:17px}.wc-stripe-label-container.stripe_fpx img.wc-block-components-payment-method-icon--stripe_fpx,.wc-stripe-label-container.stripe_sofort img.wc-block-components-payment-method-icon--stripe_sofort{height:22px}.wc-stripe-label-container.stripe_alipay img.wc-block-components-payment-method-icon--stripe_alipay{height:25px}.wc-stripe-label-container.stripe_klarna img.wc-block-components-payment-method-icon--stripe_klarna{height:26px}.wc-stripe-local-payment-container{align-items:center;border:1px solid #dadce0;border-radius:4px;display:flex;min-height:42px}.wc-stripe-local-payment-container.AuBankAccountElement,.wc-stripe-local-payment-container.IbanElement{padding-left:10px}.wc-stripe-local-payment-container .StripeElement{flex:1}#wc-stripe-block-qrcode+p{margin-top:5px}.wechat-validation-error .wc-block-components-validation-error{position:relative}.payment-request-block-editor{align-items:center;background-color:#32325d;border-radius:4px;color:#fff;display:flex;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:16px;font-weight:600;height:40px;justify-content:center}.payment-request-block-editor .icon-container{align-items:center;display:flex;position:relative}.payment-request-block-editor .icon-container span{margin-bottom:5px}.payment-request-block-editor .icon-container canvas.PaymentRequestButton-icon{-ms-flex-negative:0;-webkit-flex-shrink:0;flex-shrink:0;height:20px;margin:0 -1px -1px 7px;position:relative;width:20px;will-change:opacity;z-index:10}.payment-request-block-editor .icon-container .payment-request-arrow{border-bottom:4px solid;border-right:4px solid;height:12px;position:absolute;right:8px;transform:rotate(-45deg);width:12px;z-index:99}
packages/blocks/build/style.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sources":["webpack://woo-stripe-payment/./packages/blocks/assets/css/style.scss","webpack://woo-stripe-payment/./packages/blocks/assets/js/components/checkout/checkbox/styles.scss","webpack://woo-stripe-payment/./packages/blocks/assets/js/components/checkout/payment-method-label/style.scss","webpack://woo-stripe-payment/./packages/blocks/assets/js/components/checkout/payment-method/styles.scss","webpack://woo-stripe-payment/./packages/blocks/assets/js/components/checkout/radio-control-accordion/styles.scss","webpack://woo-stripe-payment/./packages/blocks/assets/js/components/checkout/radio-option/styles.scss","webpack://woo-stripe-payment/./packages/blocks/assets/js/payment-methods/ach/styles.scss","webpack://woo-stripe-payment/./packages/blocks/assets/js/payment-methods/applepay/style.scss","webpack://woo-stripe-payment/./packages/blocks/assets/js/payment-methods/credit-card/style.scss","webpack://woo-stripe-payment/./packages/blocks/assets/js/payment-methods/googlepay/style.scss","webpack://woo-stripe-payment/./packages/blocks/assets/js/payment-methods/local-payment/klarna/styles.scss","webpack://woo-stripe-payment/./packages/blocks/assets/js/payment-methods/local-payment/styles.scss","webpack://woo-stripe-payment/./packages/blocks/assets/js/payment-methods/payment-request/style.scss"],"names":[],"mappings":";;;;;AAAA;;;;;;ACAA;;;;;;ACAA;;;;;;ACAA;;;;;;ACAA;;;;;;ACAA;;;;;;ACAA;;;;;;ACAA;;;;;;ACAA;;;;;;ACAA;;;;;;ACAA;;;;;;ACAA;;;;;;ACAA","file":"style.js","sourcesContent":["// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};"],"sourceRoot":""}
packages/blocks/build/wc-stripe-ach.asset.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php return array('dependencies' => array('react', 'wc-blocks-registry', 'wc-price-format', 'wc-settings', 'wc-stripe-plaid', 'wp-api-fetch', 'wp-element', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill'), 'version' => '078b3dc1a06c9a4fa44bf734f4e92ce6');
packages/blocks/build/wc-stripe-ach.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ (()=>{"use strict";var e={2810:e=>{e.exports=window.Plaid},3804:e=>{e.exports=window.React},7015:e=>{e.exports=window.regeneratorRuntime},8419:e=>{e.exports=window.wc.priceFormat},4222:e=>{e.exports=window.wc.wcBlocksRegistry},2492:e=>{e.exports=window.wc.wcSettings},7606:e=>{e.exports=window.wp.apiFetch},3027:e=>{e.exports=window.wp.element},3163:e=>{e.exports=window.wp.i18n},4306:e=>{e.exports=window.wp.isShallowEqual}},r={};function t(o){if(r[o])return r[o].exports;var n=r[o]={exports:{}};return e[o].call(n.exports,n,n.exports,t),n.exports}t.m=e,t.x=e=>{},t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={584:0,78:0,797:0,733:0,417:0},r=[[5605,351]],o=e=>{},n=(n,i)=>{for(var p,s,[w,a,l,c]=i,u=0,d=[];u<w.length;u++)s=w[u],t.o(e,s)&&e[s]&&d.push(e[s][0]),e[s]=0;for(p in a)t.o(a,p)&&(t.m[p]=a[p]);for(l&&l(t),n&&n(i);d.length;)d.shift()();return c&&r.push.apply(r,c),o()},i=self.webpackChunkwc_stripe_name_=self.webpackChunkwc_stripe_name_||[];function p(){for(var o,n=0;n<r.length;n++){for(var i=r[n],p=!0,s=1;s<i.length;s++){var w=i[s];0!==e[w]&&(p=!1)}p&&(r.splice(n--,1),o=t(t.s=i[0]))}return 0===r.length&&(t.x(),t.x=e=>{}),o}i.forEach(n.bind(null,0)),i.push=n.bind(null,i.push.bind(i));var s=t.x;t.x=()=>(t.x=s||(e=>{}),(o=p)())})();var o=t.x();(this.wc_stripe=this.wc_stripe||{})["wc-stripe-ach"]=o})();
2
+ //# sourceMappingURL=wc-stripe-ach.js.map
packages/blocks/build/wc-stripe-ach.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sources":["webpack://wc_stripe.[name]/external \"Plaid\"","webpack://wc_stripe.[name]/external \"React\"","webpack://wc_stripe.[name]/external \"regeneratorRuntime\"","webpack://wc_stripe.[name]/external [\"wc\",\"priceFormat\"]","webpack://wc_stripe.[name]/external [\"wc\",\"wcBlocksRegistry\"]","webpack://wc_stripe.[name]/external [\"wc\",\"wcSettings\"]","webpack://wc_stripe.[name]/external [\"wp\",\"apiFetch\"]","webpack://wc_stripe.[name]/external [\"wp\",\"element\"]","webpack://wc_stripe.[name]/external [\"wp\",\"i18n\"]","webpack://wc_stripe.[name]/external [\"wp\",\"isShallowEqual\"]","webpack://wc_stripe.[name]/webpack/bootstrap","webpack://wc_stripe.[name]/webpack/runtime/define property getters","webpack://wc_stripe.[name]/webpack/runtime/hasOwnProperty shorthand","webpack://wc_stripe.[name]/webpack/runtime/make namespace object","webpack://wc_stripe.[name]/webpack/runtime/jsonp chunk loading","webpack://wc_stripe.[name]/webpack/startup"],"names":["module","exports","window","__webpack_module_cache__","__webpack_require__","moduleId","__webpack_modules__","call","m","x","d","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","r","Symbol","toStringTag","value","installedChunks","584","78","797","733","417","deferredModules","checkDeferredModules","webpackJsonpCallback","parentChunkLoadingFunction","data","chunkId","chunkIds","moreModules","runtime","executeModules","i","resolves","length","push","shift","apply","chunkLoadingGlobal","self","checkDeferredModulesImpl","result","deferredModule","fulfilled","j","depId","splice","s","forEach","bind","startup","__webpack_exports__"],"mappings":"mCAAAA,EAAOC,QAAUC,OAAc,O,SCA/BF,EAAOC,QAAUC,OAAc,O,SCA/BF,EAAOC,QAAUC,OAA2B,oB,SCA5CF,EAAOC,QAAUC,OAAW,GAAe,a,SCA3CF,EAAOC,QAAUC,OAAW,GAAoB,kB,SCAhDF,EAAOC,QAAUC,OAAW,GAAc,Y,SCA1CF,EAAOC,QAAUC,OAAW,GAAY,U,SCAxCF,EAAOC,QAAUC,OAAW,GAAW,S,SCAvCF,EAAOC,QAAUC,OAAW,GAAQ,M,SCApCF,EAAOC,QAAUC,OAAW,GAAkB,iBCC1CC,EAA2B,GAG/B,SAASC,EAAoBC,GAE5B,GAAGF,EAAyBE,GAC3B,OAAOF,EAAyBE,GAAUJ,QAG3C,IAAID,EAASG,EAAyBE,GAAY,CAGjDJ,QAAS,IAOV,OAHAK,EAAoBD,GAAUE,KAAKP,EAAOC,QAASD,EAAQA,EAAOC,QAASG,GAGpEJ,EAAOC,QAIfG,EAAoBI,EAAIF,EAIxBF,EAAoBK,EAAIA,MC3BxBL,EAAoBM,EAAI,CAACT,EAASU,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEZ,EAASW,IAC5EE,OAAOC,eAAed,EAASW,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3ER,EAAoBS,EAAI,CAACK,EAAKC,IAAUL,OAAOM,UAAUC,eAAed,KAAKW,EAAKC,GCClFf,EAAoBkB,EAAKrB,IACH,oBAAXsB,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAed,EAASsB,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAed,EAAS,aAAc,CAAEwB,OAAO,K,MCAvD,IAAIC,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,EAAoBK,EAClCL,EAAoBK,EAAI,KAEvBL,EAAoBK,EAAImD,GAAW,CAACnD,QAC5BwB,EAAuBiB,O,GCtFhC,IAAIW,EAAsBzD,EAAoBK,K","file":"wc-stripe-ach.js","sourcesContent":["module.exports = window[\"Plaid\"];","module.exports = window[\"React\"];","module.exports = window[\"regeneratorRuntime\"];","module.exports = window[\"wc\"][\"priceFormat\"];","module.exports = window[\"wc\"][\"wcBlocksRegistry\"];","module.exports = window[\"wc\"][\"wcSettings\"];","module.exports = window[\"wp\"][\"apiFetch\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"wp\"][\"isShallowEqual\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tif(__webpack_module_cache__[moduleId]) {\n\t\treturn __webpack_module_cache__[moduleId].exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n// the startup function\n// It's empty as some runtime module handles the default behavior\n__webpack_require__.x = x => {};\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// Promise = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t584: 0,\n\t78: 0,\n\t797: 0,\n\t733: 0,\n\t417: 0\n};\n\nvar deferredModules = [\n\t[5605,351]\n];\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\nvar checkDeferredModules = x => {};\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime, executeModules] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0, resolves = [];\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tresolves.push(installedChunks[chunkId][0]);\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\tfor(moduleId in moreModules) {\n\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t}\n\t}\n\tif(runtime) runtime(__webpack_require__);\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\twhile(resolves.length) {\n\t\tresolves.shift()();\n\t}\n\n\t// add entry modules from loaded chunk to deferred list\n\tif(executeModules) deferredModules.push.apply(deferredModules, executeModules);\n\n\t// run deferred modules when all chunks ready\n\treturn checkDeferredModules();\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkwc_stripe_name_\"] = self[\"webpackChunkwc_stripe_name_\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));\n\nfunction checkDeferredModulesImpl() {\n\tvar result;\n\tfor(var i = 0; i < deferredModules.length; i++) {\n\t\tvar deferredModule = deferredModules[i];\n\t\tvar fulfilled = true;\n\t\tfor(var j = 1; j < deferredModule.length; j++) {\n\t\t\tvar depId = deferredModule[j];\n\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferredModules.splice(i--, 1);\n\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n\t\t}\n\t}\n\tif(deferredModules.length === 0) {\n\t\t__webpack_require__.x();\n\t\t__webpack_require__.x = x => {};\n\t}\n\treturn result;\n}\nvar startup = __webpack_require__.x;\n__webpack_require__.x = () => {\n\t// reset startup function so it can be called again when more startup code is added\n\t__webpack_require__.x = startup || (x => {});\n\treturn (checkDeferredModules = checkDeferredModulesImpl)();\n};","// run startup\nvar __webpack_exports__ = __webpack_require__.x();\n"],"sourceRoot":""}
packages/blocks/build/wc-stripe-apple-pay.asset.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php return array('dependencies' => array('react', 'wc-blocks-registry', 'wc-price-format', 'wc-settings', 'wp-api-fetch', 'wp-element', 'wp-is-shallow-equal', 'wp-polyfill'), 'version' => '6875b27c3fa4d4ea8bd1e90c7f2a915c');
packages/blocks/build/wc-stripe-apple-pay.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ (()=>{"use strict";var e={3804:e=>{e.exports=window.React},7015:e=>{e.exports=window.regeneratorRuntime},8419:e=>{e.exports=window.wc.priceFormat},4222:e=>{e.exports=window.wc.wcBlocksRegistry},2492:e=>{e.exports=window.wc.wcSettings},7606:e=>{e.exports=window.wp.apiFetch},3027:e=>{e.exports=window.wp.element},4306:e=>{e.exports=window.wp.isShallowEqual}},r={};function t(o){if(r[o])return r[o].exports;var n=r[o]={exports:{}};return e[o].call(n.exports,n,n.exports,t),n.exports}t.m=e,t.x=e=>{},t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={797:0,733:0},r=[[3846,351]],o=e=>{},n=(n,p)=>{for(var i,s,[w,a,l,c]=p,u=0,x=[];u<w.length;u++)s=w[u],t.o(e,s)&&e[s]&&x.push(e[s][0]),e[s]=0;for(i in a)t.o(a,i)&&(t.m[i]=a[i]);for(l&&l(t),n&&n(p);x.length;)x.shift()();return c&&r.push.apply(r,c),o()},p=self.webpackChunkwc_stripe_name_=self.webpackChunkwc_stripe_name_||[];function i(){for(var o,n=0;n<r.length;n++){for(var p=r[n],i=!0,s=1;s<p.length;s++){var w=p[s];0!==e[w]&&(i=!1)}i&&(r.splice(n--,1),o=t(t.s=p[0]))}return 0===r.length&&(t.x(),t.x=e=>{}),o}p.forEach(n.bind(null,0)),p.push=n.bind(null,p.push.bind(p));var s=t.x;t.x=()=>(t.x=s||(e=>{}),(o=i)())})();var o=t.x();(this.wc_stripe=this.wc_stripe||{})["wc-stripe-apple-pay"]=o})();
2
+ //# sourceMappingURL=wc-stripe-apple-pay.js.map
packages/blocks/build/wc-stripe-apple-pay.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sources":["webpack://wc_stripe.[name]/external \"React\"","webpack://wc_stripe.[name]/external \"regeneratorRuntime\"","webpack://wc_stripe.[name]/external [\"wc\",\"priceFormat\"]","webpack://wc_stripe.[name]/external [\"wc\",\"wcBlocksRegistry\"]","webpack://wc_stripe.[name]/external [\"wc\",\"wcSettings\"]","webpack://wc_stripe.[name]/external [\"wp\",\"apiFetch\"]","webpack://wc_stripe.[name]/external [\"wp\",\"element\"]","webpack://wc_stripe.[name]/external [\"wp\",\"isShallowEqual\"]","webpack://wc_stripe.[name]/webpack/bootstrap","webpack://wc_stripe.[name]/webpack/runtime/define property getters","webpack://wc_stripe.[name]/webpack/runtime/hasOwnProperty shorthand","webpack://wc_stripe.[name]/webpack/runtime/make namespace object","webpack://wc_stripe.[name]/webpack/runtime/jsonp chunk loading","webpack://wc_stripe.[name]/webpack/startup"],"names":["module","exports","window","__webpack_module_cache__","__webpack_require__","moduleId","__webpack_modules__","call","m","x","d","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","r","Symbol","toStringTag","value","installedChunks","797","733","deferredModules","checkDeferredModules","webpackJsonpCallback","parentChunkLoadingFunction","data","chunkId","chunkIds","moreModules","runtime","executeModules","i","resolves","length","push","shift","apply","chunkLoadingGlobal","self","checkDeferredModulesImpl","result","deferredModule","fulfilled","j","depId","splice","s","forEach","bind","startup","__webpack_exports__"],"mappings":"mCAAAA,EAAOC,QAAUC,OAAc,O,SCA/BF,EAAOC,QAAUC,OAA2B,oB,SCA5CF,EAAOC,QAAUC,OAAW,GAAe,a,SCA3CF,EAAOC,QAAUC,OAAW,GAAoB,kB,SCAhDF,EAAOC,QAAUC,OAAW,GAAc,Y,SCA1CF,EAAOC,QAAUC,OAAW,GAAY,U,SCAxCF,EAAOC,QAAUC,OAAW,GAAW,S,SCAvCF,EAAOC,QAAUC,OAAW,GAAkB,iBCC1CC,EAA2B,GAG/B,SAASC,EAAoBC,GAE5B,GAAGF,EAAyBE,GAC3B,OAAOF,EAAyBE,GAAUJ,QAG3C,IAAID,EAASG,EAAyBE,GAAY,CAGjDJ,QAAS,IAOV,OAHAK,EAAoBD,GAAUE,KAAKP,EAAOC,QAASD,EAAQA,EAAOC,QAASG,GAGpEJ,EAAOC,QAIfG,EAAoBI,EAAIF,EAIxBF,EAAoBK,EAAIA,MC3BxBL,EAAoBM,EAAI,CAACT,EAASU,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEZ,EAASW,IAC5EE,OAAOC,eAAed,EAASW,EAAK,CAAEI,YAAY,EAAMC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,EAAoBkD,EAAIL,EAAe,KAOtE,OAJ8B,IAA3BpB,EAAgBY,SAClBrC,EAAoBK,IACpBL,EAAoBK,EAAIA,OAElBuC,EArBRH,EAAmBU,QAAQxB,EAAqByB,KAAK,KAAM,IAC3DX,EAAmBH,KAAOX,EAAqByB,KAAK,KAAMX,EAAmBH,KAAKc,KAAKX,IAsBvF,IAAIY,EAAUrD,EAAoBK,EAClCL,EAAoBK,EAAI,KAEvBL,EAAoBK,EAAIgD,GAAW,CAAChD,QAC5BqB,EAAuBiB,O,GCnFhC,IAAIW,EAAsBtD,EAAoBK,K","file":"wc-stripe-apple-pay.js","sourcesContent":["module.exports = window[\"React\"];","module.exports = window[\"regeneratorRuntime\"];","module.exports = window[\"wc\"][\"priceFormat\"];","module.exports = window[\"wc\"][\"wcBlocksRegistry\"];","module.exports = window[\"wc\"][\"wcSettings\"];","module.exports = window[\"wp\"][\"apiFetch\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"isShallowEqual\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tif(__webpack_module_cache__[moduleId]) {\n\t\treturn __webpack_module_cache__[moduleId].exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n// the startup function\n// It's empty as some runtime module handles the default behavior\n__webpack_require__.x = x => {};\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// Promise = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t797: 0,\n\t733: 0\n};\n\nvar deferredModules = [\n\t[3846,351]\n];\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\nvar checkDeferredModules = x => {};\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime, executeModules] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0, resolves = [];\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tresolves.push(installedChunks[chunkId][0]);\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\tfor(moduleId in moreModules) {\n\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t}\n\t}\n\tif(runtime) runtime(__webpack_require__);\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\twhile(resolves.length) {\n\t\tresolves.shift()();\n\t}\n\n\t// add entry modules from loaded chunk to deferred list\n\tif(executeModules) deferredModules.push.apply(deferredModules, executeModules);\n\n\t// run deferred modules when all chunks ready\n\treturn checkDeferredModules();\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkwc_stripe_name_\"] = self[\"webpackChunkwc_stripe_name_\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));\n\nfunction checkDeferredModulesImpl() {\n\tvar result;\n\tfor(var i = 0; i < deferredModules.length; i++) {\n\t\tvar deferredModule = deferredModules[i];\n\t\tvar fulfilled = true;\n\t\tfor(var j = 1; j < deferredModule.length; j++) {\n\t\t\tvar depId = deferredModule[j];\n\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferredModules.splice(i--, 1);\n\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n\t\t}\n\t}\n\tif(deferredModules.length === 0) {\n\t\t__webpack_require__.x();\n\t\t__webpack_require__.x = x => {};\n\t}\n\treturn result;\n}\nvar startup = __webpack_require__.x;\n__webpack_require__.x = () => {\n\t// reset startup function so it can be called again when more startup code is added\n\t__webpack_require__.x = startup || (x => {});\n\treturn (checkDeferredModules = checkDeferredModulesImpl)();\n};","// run startup\nvar __webpack_exports__ = __webpack_require__.x();\n"],"sourceRoot":""}
packages/blocks/build/wc-stripe-credit-card.asset.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php return array('dependencies' => array('react', 'wc-blocks-registry', 'wc-price-format', 'wc-settings', 'wp-api-fetch', 'wp-element', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill'), 'version' => 'f01cf601c1cfe57310d53a91380f6a79');
packages/blocks/build/wc-stripe-credit-card.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ (()=>{"use strict";var e={3804:e=>{e.exports=window.React},7015:e=>{e.exports=window.regeneratorRuntime},8419:e=>{e.exports=window.wc.priceFormat},4222:e=>{e.exports=window.wc.wcBlocksRegistry},2492:e=>{e.exports=window.wc.wcSettings},7606:e=>{e.exports=window.wp.apiFetch},3027:e=>{e.exports=window.wp.element},3163:e=>{e.exports=window.wp.i18n},4306:e=>{e.exports=window.wp.isShallowEqual}},r={};function t(o){if(r[o])return r[o].exports;var n=r[o]={exports:{}};return e[o].call(n.exports,n,n.exports,t),n.exports}t.m=e,t.x=e=>{},t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={78:0,797:0,733:0,417:0},r=[[627,351]],o=e=>{},n=(n,i)=>{for(var p,s,[w,a,l,c]=i,u=0,d=[];u<w.length;u++)s=w[u],t.o(e,s)&&e[s]&&d.push(e[s][0]),e[s]=0;for(p in a)t.o(a,p)&&(t.m[p]=a[p]);for(l&&l(t),n&&n(i);d.length;)d.shift()();return c&&r.push.apply(r,c),o()},i=self.webpackChunkwc_stripe_name_=self.webpackChunkwc_stripe_name_||[];function p(){for(var o,n=0;n<r.length;n++){for(var i=r[n],p=!0,s=1;s<i.length;s++){var w=i[s];0!==e[w]&&(p=!1)}p&&(r.splice(n--,1),o=t(t.s=i[0]))}return 0===r.length&&(t.x(),t.x=e=>{}),o}i.forEach(n.bind(null,0)),i.push=n.bind(null,i.push.bind(i));var s=t.x;t.x=()=>(t.x=s||(e=>{}),(o=p)())})();var o=t.x();(this.wc_stripe=this.wc_stripe||{})["wc-stripe-credit-card"]=o})();
2
+ //# sourceMappingURL=wc-stripe-credit-card.js.map
packages/blocks/build/wc-stripe-credit-card.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sources":["webpack://wc_stripe.[name]/external \"React\"","webpack://wc_stripe.[name]/external \"regeneratorRuntime\"","webpack://wc_stripe.[name]/external [\"wc\",\"priceFormat\"]","webpack://wc_stripe.[name]/external [\"wc\",\"wcBlocksRegistry\"]","webpack://wc_stripe.[name]/external [\"wc\",\"wcSettings\"]","webpack://wc_stripe.[name]/external [\"wp\",\"apiFetch\"]","webpack://wc_stripe.[name]/external [\"wp\",\"element\"]","webpack://wc_stripe.[name]/external [\"wp\",\"i18n\"]","webpack://wc_stripe.[name]/external [\"wp\",\"isShallowEqual\"]","webpack://wc_stripe.[name]/webpack/bootstrap","webpack://wc_stripe.[name]/webpack/runtime/define property getters","webpack://wc_stripe.[name]/webpack/runtime/hasOwnProperty shorthand","webpack://wc_stripe.[name]/webpack/runtime/make namespace object","webpack://wc_stripe.[name]/webpack/runtime/jsonp chunk loading","webpack://wc_stripe.[name]/webpack/startup"],"names":["module","exports","window","__webpack_module_cache__","__webpack_require__","moduleId","__webpack_modules__","call","m","x","d","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","r","Symbol","toStringTag","value","installedChunks","78","797","733","417","deferredModules","checkDeferredModules","webpackJsonpCallback","parentChunkLoadingFunction","data","chunkId","chunkIds","moreModules","runtime","executeModules","i","resolves","length","push","shift","apply","chunkLoadingGlobal","self","checkDeferredModulesImpl","result","deferredModule","fulfilled","j","depId","splice","s","forEach","bind","startup","__webpack_exports__"],"mappings":"mCAAAA,EAAOC,QAAUC,OAAc,O,SCA/BF,EAAOC,QAAUC,OAA2B,oB,SCA5CF,EAAOC,QAAUC,OAAW,GAAe,a,SCA3CF,EAAOC,QAAUC,OAAW,GAAoB,kB,SCAhDF,EAAOC,QAAUC,OAAW,GAAc,Y,SCA1CF,EAAOC,QAAUC,OAAW,GAAY,U,SCAxCF,EAAOC,QAAUC,OAAW,GAAW,S,SCAvCF,EAAOC,QAAUC,OAAW,GAAQ,M,SCApCF,EAAOC,QAAUC,OAAW,GAAkB,iBCC1CC,EAA2B,GAG/B,SAASC,EAAoBC,GAE5B,GAAGF,EAAyBE,GAC3B,OAAOF,EAAyBE,GAAUJ,QAG3C,IAAID,EAASG,EAAyBE,GAAY,CAGjDJ,QAAS,IAOV,OAHAK,EAAoBD,GAAU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SAASC,IAER,IADA,IAAIC,EACIT,EAAI,EAAGA,EAAIV,EAAgBY,OAAQF,IAAK,CAG/C,IAFA,IAAIU,EAAiBpB,EAAgBU,GACjCW,GAAY,EACRC,EAAI,EAAGA,EAAIF,EAAeR,OAAQU,IAAK,CAC9C,IAAIC,EAAQH,EAAeE,GACG,IAA3B3B,EAAgB4B,KAAcF,GAAY,GAE3CA,IACFrB,EAAgBwB,OAAOd,IAAK,GAC5BS,EAAS9C,EAAoBA,EAAoBoD,EAAIL,EAAe,KAOtE,OAJ8B,IAA3BpB,EAAgBY,SAClBvC,EAAoBK,IACpBL,EAAoBK,EAAIA,OAElByC,EArBRH,EAAmBU,QAAQxB,EAAqByB,KAAK,KAAM,IAC3DX,EAAmBH,KAAOX,EAAqByB,KAAK,KAAMX,EAAmBH,KAAKc,KAAKX,IAsBvF,IAAIY,EAAUvD,EAAoBK,EAClCL,EAAoBK,EAAI,KAEvBL,EAAoBK,EAAIkD,GAAW,CAAClD,QAC5BuB,EAAuBiB,O,GCrFhC,IAAIW,EAAsBxD,EAAoBK,K","file":"wc-stripe-credit-card.js","sourcesContent":["module.exports = window[\"React\"];","module.exports = window[\"regeneratorRuntime\"];","module.exports = window[\"wc\"][\"priceFormat\"];","module.exports = window[\"wc\"][\"wcBlocksRegistry\"];","module.exports = window[\"wc\"][\"wcSettings\"];","module.exports = window[\"wp\"][\"apiFetch\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"wp\"][\"isShallowEqual\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tif(__webpack_module_cache__[moduleId]) {\n\t\treturn __webpack_module_cache__[moduleId].exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n// the startup function\n// It's empty as some runtime module handles the default behavior\n__webpack_require__.x = x => {};\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// Promise = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t78: 0,\n\t797: 0,\n\t733: 0,\n\t417: 0\n};\n\nvar deferredModules = [\n\t[627,351]\n];\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\nvar checkDeferredModules = x => {};\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime, executeModules] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0, resolves = [];\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tresolves.push(installedChunks[chunkId][0]);\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\tfor(moduleId in moreModules) {\n\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t}\n\t}\n\tif(runtime) runtime(__webpack_require__);\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\twhile(resolves.length) {\n\t\tresolves.shift()();\n\t}\n\n\t// add entry modules from loaded chunk to deferred list\n\tif(executeModules) deferredModules.push.apply(deferredModules, executeModules);\n\n\t// run deferred modules when all chunks ready\n\treturn checkDeferredModules();\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkwc_stripe_name_\"] = self[\"webpackChunkwc_stripe_name_\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));\n\nfunction checkDeferredModulesImpl() {\n\tvar result;\n\tfor(var i = 0; i < deferredModules.length; i++) {\n\t\tvar deferredModule = deferredModules[i];\n\t\tvar fulfilled = true;\n\t\tfor(var j = 1; j < deferredModule.length; j++) {\n\t\t\tvar depId = deferredModule[j];\n\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferredModules.splice(i--, 1);\n\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n\t\t}\n\t}\n\tif(deferredModules.length === 0) {\n\t\t__webpack_require__.x();\n\t\t__webpack_require__.x = x => {};\n\t}\n\treturn result;\n}\nvar startup = __webpack_require__.x;\n__webpack_require__.x = () => {\n\t// reset startup function so it can be called again when more startup code is added\n\t__webpack_require__.x = startup || (x => {});\n\treturn (checkDeferredModules = checkDeferredModulesImpl)();\n};","// run startup\nvar __webpack_exports__ = __webpack_require__.x();\n"],"sourceRoot":""}
packages/blocks/build/wc-stripe-googlepay.asset.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php return array('dependencies' => array('react', 'wc-blocks-registry', 'wc-price-format', 'wc-settings', 'wc-stripe-gpay-external', 'wp-api-fetch', 'wp-element', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill'), 'version' => '4614b798610f1764e014a5abb06d51e1');
packages/blocks/build/wc-stripe-googlepay.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ (()=>{"use strict";var e={3804:e=>{e.exports=window.React},3905:e=>{e.exports=window.google},7015:e=>{e.exports=window.regeneratorRuntime},8419:e=>{e.exports=window.wc.priceFormat},4222:e=>{e.exports=window.wc.wcBlocksRegistry},2492:e=>{e.exports=window.wc.wcSettings},7606:e=>{e.exports=window.wp.apiFetch},3027:e=>{e.exports=window.wp.element},3163:e=>{e.exports=window.wp.i18n},4306:e=>{e.exports=window.wp.isShallowEqual}},r={};function o(t){if(r[t])return r[t].exports;var n=r[t]={exports:{}};return e[t].call(n.exports,n,n.exports,o),n.exports}o.m=e,o.x=e=>{},o.d=(e,r)=>{for(var t in r)o.o(r,t)&&!o.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={115:0,78:0,797:0,733:0,417:0},r=[[5341,351]],t=e=>{},n=(n,p)=>{for(var i,s,[w,l,a,c]=p,u=0,x=[];u<w.length;u++)s=w[u],o.o(e,s)&&e[s]&&x.push(e[s][0]),e[s]=0;for(i in l)o.o(l,i)&&(o.m[i]=l[i]);for(a&&a(o),n&&n(p);x.length;)x.shift()();return c&&r.push.apply(r,c),t()},p=self.webpackChunkwc_stripe_name_=self.webpackChunkwc_stripe_name_||[];function i(){for(var t,n=0;n<r.length;n++){for(var p=r[n],i=!0,s=1;s<p.length;s++){var w=p[s];0!==e[w]&&(i=!1)}i&&(r.splice(n--,1),t=o(o.s=p[0]))}return 0===r.length&&(o.x(),o.x=e=>{}),t}p.forEach(n.bind(null,0)),p.push=n.bind(null,p.push.bind(p));var s=o.x;o.x=()=>(o.x=s||(e=>{}),(t=i)())})();var t=o.x();(this.wc_stripe=this.wc_stripe||{})["wc-stripe-googlepay"]=t})();
2
+ //# sourceMappingURL=wc-stripe-googlepay.js.map
packages/blocks/build/wc-stripe-googlepay.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sources":["webpack://wc_stripe.[name]/external \"React\"","webpack://wc_stripe.[name]/external \"google\"","webpack://wc_stripe.[name]/external \"regeneratorRuntime\"","webpack://wc_stripe.[name]/external [\"wc\",\"priceFormat\"]","webpack://wc_stripe.[name]/external [\"wc\",\"wcBlocksRegistry\"]","webpack://wc_stripe.[name]/external [\"wc\",\"wcSettings\"]","webpack://wc_stripe.[name]/external [\"wp\",\"apiFetch\"]","webpack://wc_stripe.[name]/external [\"wp\",\"element\"]","webpack://wc_stripe.[name]/external [\"wp\",\"i18n\"]","webpack://wc_stripe.[name]/external [\"wp\",\"isShallowEqual\"]","webpack://wc_stripe.[name]/webpack/bootstrap","webpack://wc_stripe.[name]/webpack/runtime/define property getters","webpack://wc_stripe.[name]/webpack/runtime/hasOwnProperty shorthand","webpack://wc_stripe.[name]/webpack/runtime/make namespace object","webpack://wc_stripe.[name]/webpack/runtime/jsonp chunk loading","webpack://wc_stripe.[name]/webpack/startup"],"names":["module","exports","window","__webpack_module_cache__","__webpack_require__","moduleId","__webpack_modules__","call","m","x","d","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","r","Symbol","toStringTag","value","installedChunks","115","78","797","733","417","deferredModules","checkDeferredModules","webpackJsonpCallback","parentChunkLoadingFunction","data","chunkId","chunkIds","moreModules","runtime","executeModules","i","resolves","length","push","shift","apply","chunkLoadingGlobal","self","checkDeferredModulesImpl","result","deferredModule","fulfilled","j","depId","splice","s","forEach","bind","startup","__webpack_exports__"],"mappings":"mCAAAA,EAAOC,QAAUC,OAAc,O,SCA/BF,EAAOC,QAAUC,OAAe,Q,SCAhCF,EAAOC,QAAU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EAAW,GACpCD,EAAIJ,EAASM,OAAQF,IACzBL,EAAUC,EAASI,GAChBtC,EAAoBS,EAAEa,EAAiBW,IAAYX,EAAgBW,IACrEM,EAASE,KAAKnB,EAAgBW,GAAS,IAExCX,EAAgBW,GAAW,EAE5B,IAAIhC,KAAYkC,EACZnC,EAAoBS,EAAE0B,EAAalC,KACrCD,EAAoBI,EAAEH,GAAYkC,EAAYlC,IAKhD,IAFGmC,GAASA,EAAQpC,GACjB+B,GAA4BA,EAA2BC,GACpDO,EAASC,QACdD,EAASG,OAATH,GAOD,OAHGF,GAAgBT,EAAgBa,KAAKE,MAAMf,EAAiBS,GAGxDR,KAGJe,EAAqBC,KAAkC,4BAAIA,KAAkC,6BAAK,GAItG,SAASC,IAER,IADA,IAAIC,EACIT,EAAI,EAAGA,EAAIV,EAAgBY,OAAQF,IAAK,CAG/C,IAFA,IAAIU,EAAiBpB,EAAgBU,GACjCW,GAAY,EACRC,EAAI,EAAGA,EAAIF,EAAeR,OAAQU,IAAK,CAC9C,IAAIC,EAAQH,EAAeE,GACG,IAA3B5B,EAAgB6B,KAAcF,GAAY,GAE3CA,IACFrB,EAAgBwB,OAAOd,IAAK,GAC5BS,EAAS/C,EAAoBA,EAAoBqD,EAAIL,EAAe,KAOtE,OAJ8B,IAA3BpB,EAAgBY,SAClBxC,EAAoBK,IACpBL,EAAoBK,EAAIA,OAElB0C,EArBRH,EAAmBU,QAAQxB,EAAqByB,KAAK,KAAM,IAC3DX,EAAmBH,KAAOX,EAAqByB,KAAK,KAAMX,EAAmBH,KAAKc,KAAKX,IAsBvF,IAAIY,EAAUxD,EAAoBK,EAClCL,EAAoBK,EAAI,KAEvBL,EAAoBK,EAAImD,GAAW,CAACnD,QAC5BwB,EAAuBiB,O,GCtFhC,IAAIW,EAAsBzD,EAAoBK,K","file":"wc-stripe-googlepay.js","sourcesContent":["module.exports = window[\"React\"];","module.exports = window[\"google\"];","module.exports = window[\"regeneratorRuntime\"];","module.exports = window[\"wc\"][\"priceFormat\"];","module.exports = window[\"wc\"][\"wcBlocksRegistry\"];","module.exports = window[\"wc\"][\"wcSettings\"];","module.exports = window[\"wp\"][\"apiFetch\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"wp\"][\"isShallowEqual\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tif(__webpack_module_cache__[moduleId]) {\n\t\treturn __webpack_module_cache__[moduleId].exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n// the startup function\n// It's empty as some runtime module handles the default behavior\n__webpack_require__.x = x => {};\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// Promise = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t115: 0,\n\t78: 0,\n\t797: 0,\n\t733: 0,\n\t417: 0\n};\n\nvar deferredModules = [\n\t[5341,351]\n];\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\nvar checkDeferredModules = x => {};\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime, executeModules] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0, resolves = [];\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tresolves.push(installedChunks[chunkId][0]);\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\tfor(moduleId in moreModules) {\n\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t}\n\t}\n\tif(runtime) runtime(__webpack_require__);\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\twhile(resolves.length) {\n\t\tresolves.shift()();\n\t}\n\n\t// add entry modules from loaded chunk to deferred list\n\tif(executeModules) deferredModules.push.apply(deferredModules, executeModules);\n\n\t// run deferred modules when all chunks ready\n\treturn checkDeferredModules();\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkwc_stripe_name_\"] = self[\"webpackChunkwc_stripe_name_\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));\n\nfunction checkDeferredModulesImpl() {\n\tvar result;\n\tfor(var i = 0; i < deferredModules.length; i++) {\n\t\tvar deferredModule = deferredModules[i];\n\t\tvar fulfilled = true;\n\t\tfor(var j = 1; j < deferredModule.length; j++) {\n\t\t\tvar depId = deferredModule[j];\n\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferredModules.splice(i--, 1);\n\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n\t\t}\n\t}\n\tif(deferredModules.length === 0) {\n\t\t__webpack_require__.x();\n\t\t__webpack_require__.x = x => {};\n\t}\n\treturn result;\n}\nvar startup = __webpack_require__.x;\n__webpack_require__.x = () => {\n\t// reset startup function so it can be called again when more startup code is added\n\t__webpack_require__.x = startup || (x => {});\n\treturn (checkDeferredModules = checkDeferredModulesImpl)();\n};","// run startup\nvar __webpack_exports__ = __webpack_require__.x();\n"],"sourceRoot":""}
packages/blocks/build/wc-stripe-local-payment.asset.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php return array('dependencies' => array('react', 'wc-blocks-registry', 'wc-price-format', 'wc-settings', 'wp-api-fetch', 'wp-element', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill'), 'version' => '0888258de12c03b18f55c95f35af55d5');
packages/blocks/build/wc-stripe-local-payment.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ (()=>{"use strict";var e={3804:e=>{e.exports=window.React},7015:e=>{e.exports=window.regeneratorRuntime},8419:e=>{e.exports=window.wc.priceFormat},4222:e=>{e.exports=window.wc.wcBlocksRegistry},2492:e=>{e.exports=window.wc.wcSettings},7606:e=>{e.exports=window.wp.apiFetch},3027:e=>{e.exports=window.wp.element},3163:e=>{e.exports=window.wp.i18n},4306:e=>{e.exports=window.wp.isShallowEqual}},r={};function t(o){if(r[o])return r[o].exports;var n=r[o]={exports:{}};return e[o].call(n.exports,n,n.exports,t),n.exports}t.m=e,t.x=e=>{},t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={417:0,78:0,797:0,733:0},r=[[9738,351]],o=e=>{},n=(n,p)=>{for(var i,s,[w,a,l,c]=p,u=0,x=[];u<w.length;u++)s=w[u],t.o(e,s)&&e[s]&&x.push(e[s][0]),e[s]=0;for(i in a)t.o(a,i)&&(t.m[i]=a[i]);for(l&&l(t),n&&n(p);x.length;)x.shift()();return c&&r.push.apply(r,c),o()},p=self.webpackChunkwc_stripe_name_=self.webpackChunkwc_stripe_name_||[];function i(){for(var o,n=0;n<r.length;n++){for(var p=r[n],i=!0,s=1;s<p.length;s++){var w=p[s];0!==e[w]&&(i=!1)}i&&(r.splice(n--,1),o=t(t.s=p[0]))}return 0===r.length&&(t.x(),t.x=e=>{}),o}p.forEach(n.bind(null,0)),p.push=n.bind(null,p.push.bind(p));var s=t.x;t.x=()=>(t.x=s||(e=>{}),(o=i)())})();var o=t.x();(this.wc_stripe=this.wc_stripe||{})["wc-stripe-local-payment"]=o})();
2
+ //# sourceMappingURL=wc-stripe-local-payment.js.map
packages/blocks/build/wc-stripe-local-payment.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sources":["webpack://wc_stripe.[name]/external \"React\"","webpack://wc_stripe.[name]/external \"regeneratorRuntime\"","webpack://wc_stripe.[name]/external [\"wc\",\"priceFormat\"]","webpack://wc_stripe.[name]/external [\"wc\",\"wcBlocksRegistry\"]","webpack://wc_stripe.[name]/external [\"wc\",\"wcSettings\"]","webpack://wc_stripe.[name]/external [\"wp\",\"apiFetch\"]","webpack://wc_stripe.[name]/external [\"wp\",\"element\"]","webpack://wc_stripe.[name]/external [\"wp\",\"i18n\"]","webpack://wc_stripe.[name]/external [\"wp\",\"isShallowEqual\"]","webpack://wc_stripe.[name]/webpack/bootstrap","webpack://wc_stripe.[name]/webpack/runtime/define property getters","webpack://wc_stripe.[name]/webpack/runtime/hasOwnProperty shorthand","webpack://wc_stripe.[name]/webpack/runtime/make namespace object","webpack://wc_stripe.[name]/webpack/runtime/jsonp chunk loading","webpack://wc_stripe.[name]/webpack/startup"],"names":["module","exports","window","__webpack_module_cache__","__webpack_require__","moduleId","__webpack_modules__","call","m","x","d","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","r","Symbol","toStringTag","value","installedChunks","417","78","797","733","deferredModules","checkDeferredModules","webpackJsonpCallback","parentChunkLoadingFunction","data","chunkId","chunkIds","moreModules","runtime","executeModules","i","resolves","length","push","shift","apply","chunkLoadingGlobal","self","checkDeferredModulesImpl","result","deferredModule","fulfilled","j","depId","splice","s","forEach","bind","startup","__webpack_exports__"],"mappings":"mCAAAA,EAAOC,QAAUC,OAAc,O,SCA/BF,EAAOC,QAAUC,OAA2B,oB,SCA5CF,EAAOC,QAAUC,OAAW,GAAe,a,SCA3CF,EAAOC,QAAUC,OAAW,GAAoB,kB,SCAhDF,EAAOC,QAAUC,OAAW,GAAc,Y,SCA1CF,EAAOC,QAAUC,OAAW,GAAY,U,SCAxCF,EAAOC,QAAUC,OAAW,GAAW,S,SCAvCF,EAAOC,QAAUC,OAAW,GAAQ,M,SCApCF,EAAOC,QAAUC,OAAW,GAAkB,iBCC1CC,EAA2B,GAG/B,SAASC,EAAoBC,GAE5B,GAAGF,EAAyBE,GAC3B,OAAOF,EAAyBE,GAAUJ,QAG3C,IAAID,EAASG,EAAyBE,GAAY,CAGjDJ,QAAS,IAOV,OAHAK,EAAoBD,GAAUE,KAAKP,EAAOC,QAASD,EAAQA,EAAOC,QAASG,GAGpEJ,EAAOC,QAIfG,EAAoBI,EAAIF,EAIxBF,EAAoBK,EAAIA,MC3BxBL,EAAoBM,EAAI,CAACT,EAASU,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEZ,EAASW,IAC5EE,OAAOC,eAAed,EAASW,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3ER,EAAoBS,EAAI,CAACK,EAAKC,IAAUL,OAAOM,UAAUC,eAAed,KAAKW,EAAKC,GCClFf,EAAoBkB,EAAKrB,IACH,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BRH,EAAmBU,QAAQxB,EAAqByB,KAAK,KAAM,IAC3DX,EAAmBH,KAAOX,EAAqByB,KAAK,KAAMX,EAAmBH,KAAKc,KAAKX,IAsBvF,IAAIY,EAAUvD,EAAoBK,EAClCL,EAAoBK,EAAI,KAEvBL,EAAoBK,EAAIkD,GAAW,CAAClD,QAC5BuB,EAAuBiB,O,GCrFhC,IAAIW,EAAsBxD,EAAoBK,K","file":"wc-stripe-local-payment.js","sourcesContent":["module.exports = window[\"React\"];","module.exports = window[\"regeneratorRuntime\"];","module.exports = window[\"wc\"][\"priceFormat\"];","module.exports = window[\"wc\"][\"wcBlocksRegistry\"];","module.exports = window[\"wc\"][\"wcSettings\"];","module.exports = window[\"wp\"][\"apiFetch\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"wp\"][\"isShallowEqual\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tif(__webpack_module_cache__[moduleId]) {\n\t\treturn __webpack_module_cache__[moduleId].exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n// the startup function\n// It's empty as some runtime module handles the default behavior\n__webpack_require__.x = x => {};\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// Promise = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t417: 0,\n\t78: 0,\n\t797: 0,\n\t733: 0\n};\n\nvar deferredModules = [\n\t[9738,351]\n];\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\nvar checkDeferredModules = x => {};\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime, executeModules] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0, resolves = [];\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tresolves.push(installedChunks[chunkId][0]);\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\tfor(moduleId in moreModules) {\n\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t}\n\t}\n\tif(runtime) runtime(__webpack_require__);\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\twhile(resolves.length) {\n\t\tresolves.shift()();\n\t}\n\n\t// add entry modules from loaded chunk to deferred list\n\tif(executeModules) deferredModules.push.apply(deferredModules, executeModules);\n\n\t// run deferred modules when all chunks ready\n\treturn checkDeferredModules();\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkwc_stripe_name_\"] = self[\"webpackChunkwc_stripe_name_\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));\n\nfunction checkDeferredModulesImpl() {\n\tvar result;\n\tfor(var i = 0; i < deferredModules.length; i++) {\n\t\tvar deferredModule = deferredModules[i];\n\t\tvar fulfilled = true;\n\t\tfor(var j = 1; j < deferredModule.length; j++) {\n\t\t\tvar depId = deferredModule[j];\n\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferredModules.splice(i--, 1);\n\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n\t\t}\n\t}\n\tif(deferredModules.length === 0) {\n\t\t__webpack_require__.x();\n\t\t__webpack_require__.x = x => {};\n\t}\n\treturn result;\n}\nvar startup = __webpack_require__.x;\n__webpack_require__.x = () => {\n\t// reset startup function so it can be called again when more startup code is added\n\t__webpack_require__.x = startup || (x => {});\n\treturn (checkDeferredModules = checkDeferredModulesImpl)();\n};","// run startup\nvar __webpack_exports__ = __webpack_require__.x();\n"],"sourceRoot":""}
packages/blocks/build/wc-stripe-payment-request.asset.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php return array('dependencies' => array('react', 'wc-blocks-registry', 'wc-price-format', 'wc-settings', 'wp-api-fetch', 'wp-element', 'wp-is-shallow-equal', 'wp-polyfill'), 'version' => 'd61846bccc99e4343f7a5c551bbfbae8');
packages/blocks/build/wc-stripe-payment-request.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ (()=>{"use strict";var e={3804:e=>{e.exports=window.React},7015:e=>{e.exports=window.regeneratorRuntime},8419:e=>{e.exports=window.wc.priceFormat},4222:e=>{e.exports=window.wc.wcBlocksRegistry},2492:e=>{e.exports=window.wc.wcSettings},7606:e=>{e.exports=window.wp.apiFetch},3027:e=>{e.exports=window.wp.element},4306:e=>{e.exports=window.wp.isShallowEqual}},r={};function t(o){if(r[o])return r[o].exports;var n=r[o]={exports:{}};return e[o].call(n.exports,n,n.exports,t),n.exports}t.m=e,t.x=e=>{},t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={733:0,797:0},r=[[5180,351]],o=e=>{},n=(n,p)=>{for(var i,s,[w,a,l,c]=p,u=0,x=[];u<w.length;u++)s=w[u],t.o(e,s)&&e[s]&&x.push(e[s][0]),e[s]=0;for(i in a)t.o(a,i)&&(t.m[i]=a[i]);for(l&&l(t),n&&n(p);x.length;)x.shift()();return c&&r.push.apply(r,c),o()},p=self.webpackChunkwc_stripe_name_=self.webpackChunkwc_stripe_name_||[];function i(){for(var o,n=0;n<r.length;n++){for(var p=r[n],i=!0,s=1;s<p.length;s++){var w=p[s];0!==e[w]&&(i=!1)}i&&(r.splice(n--,1),o=t(t.s=p[0]))}return 0===r.length&&(t.x(),t.x=e=>{}),o}p.forEach(n.bind(null,0)),p.push=n.bind(null,p.push.bind(p));var s=t.x;t.x=()=>(t.x=s||(e=>{}),(o=i)())})();var o=t.x();(this.wc_stripe=this.wc_stripe||{})["wc-stripe-payment-request"]=o})();
2
+ //# sourceMappingURL=wc-stripe-payment-request.js.map
packages/blocks/build/wc-stripe-payment-request.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sources":["webpack://wc_stripe.[name]/external \"React\"","webpack://wc_stripe.[name]/external \"regeneratorRuntime\"","webpack://wc_stripe.[name]/external [\"wc\",\"priceFormat\"]","webpack://wc_stripe.[name]/external [\"wc\",\"wcBlocksRegistry\"]","webpack://wc_stripe.[name]/external [\"wc\",\"wcSettings\"]","webpack://wc_stripe.[name]/external [\"wp\",\"apiFetch\"]","webpack://wc_stripe.[name]/external [\"wp\",\"element\"]","webpack://wc_stripe.[name]/external [\"wp\",\"isShallowEqual\"]","webpack://wc_stripe.[name]/webpack/bootstrap","webpack://wc_stripe.[name]/webpack/runtime/define property getters","webpack://wc_stripe.[name]/webpack/runtime/hasOwnProperty shorthand","webpack://wc_stripe.[name]/webpack/runtime/make namespace object","webpack://wc_stripe.[name]/webpack/runtime/jsonp chunk loading","webpack://wc_stripe.[name]/webpack/startup"],"names":["module","exports","window","__webpack_module_cache__","__webpack_require__","moduleId","__webpack_modules__","call","m","x","d","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","r","Symbol","toStringTag","value","installedChunks","733","797","deferredModules","checkDeferredModules","webpackJsonpCallback","parentChunkLoadingFunction","data","chunkId","chunkIds","moreModules","runtime","executeModules","i","resolves","length","push","shift","apply","chunkLoadingGlobal","self","checkDeferredModulesImpl","result","deferredModule","fulfilled","j","depId","splice","s","forEach","bind","startup","__webpack_exports__"],"mappings":"mCAAAA,EAAOC,QAAUC,OAAc,O,SCA/BF,EAAOC,QAAUC,OAA2B,oB,SCA5CF,EAAOC,QAAUC,OAAW,GAAe,a,SCA3CF,EAAOC,QAAUC,OAAW,GAAoB,kB,SCAhDF,EAAOC,QAAUC,OAAW,GAAc,Y,SCA1CF,EAAOC,QAAUC,OAAW,GAAY,U,SCAxCF,EAAOC,QAAUC,OAAW,GAAW,S,SCAvCF,EAAOC,QAAUC,OAAW,GAAkB,iBCC1CC,EAA2B,GAG/B,SAASC,EAAoBC,GAE5B,GAAGF,EAAyBE,GAC3B,OAAOF,EAAyBE,GAAUJ,QAG3C,IAAID,EAASG,EAAyBE,GAAY,CAGjDJ,QAAS,IAOV,OAHAK,EAAoBD,GAAUE,KAAKP,EAAOC,QAASD,EAAQA,EAAOC,QAASG,GAGpEJ,EAAOC,QAIfG,EAAoBI,EAAIF,EAIxBF,EAAoBK,EAAIA,MC3BxBL,EAAoBM,EAAI,CAACT,EAASU,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,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,IAA3BzB,EAAgB0B,KAAcF,GAAY,GAE3CA,IACFrB,EAAgBwB,OAAOd,IAAK,GAC5BS,EAAS5C,EAAoBA,EAAoBkD,EAAIL,EAAe,KAOtE,OAJ8B,IAA3BpB,EAAgBY,SAClBrC,EAAoBK,IACpBL,EAAoBK,EAAIA,OAElBuC,EArBRH,EAAmBU,QAAQxB,EAAqByB,KAAK,KAAM,IAC3DX,EAAmBH,KAAOX,EAAqByB,KAAK,KAAMX,EAAmBH,KAAKc,KAAKX,IAsBvF,IAAIY,EAAUrD,EAAoBK,EAClCL,EAAoBK,EAAI,KAEvBL,EAAoBK,EAAIgD,GAAW,CAAChD,QAC5BqB,EAAuBiB,O,GCnFhC,IAAIW,EAAsBtD,EAAoBK,K","file":"wc-stripe-payment-request.js","sourcesContent":["module.exports = window[\"React\"];","module.exports = window[\"regeneratorRuntime\"];","module.exports = window[\"wc\"][\"priceFormat\"];","module.exports = window[\"wc\"][\"wcBlocksRegistry\"];","module.exports = window[\"wc\"][\"wcSettings\"];","module.exports = window[\"wp\"][\"apiFetch\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"isShallowEqual\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tif(__webpack_module_cache__[moduleId]) {\n\t\treturn __webpack_module_cache__[moduleId].exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n// the startup function\n// It's empty as some runtime module handles the default behavior\n__webpack_require__.x = x => {};\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// Promise = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t733: 0,\n\t797: 0\n};\n\nvar deferredModules = [\n\t[5180,351]\n];\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\nvar checkDeferredModules = x => {};\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime, executeModules] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0, resolves = [];\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tresolves.push(installedChunks[chunkId][0]);\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\tfor(moduleId in moreModules) {\n\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t}\n\t}\n\tif(runtime) runtime(__webpack_require__);\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\twhile(resolves.length) {\n\t\tresolves.shift()();\n\t}\n\n\t// add entry modules from loaded chunk to deferred list\n\tif(executeModules) deferredModules.push.apply(deferredModules, executeModules);\n\n\t// run deferred modules when all chunks ready\n\treturn checkDeferredModules();\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkwc_stripe_name_\"] = self[\"webpackChunkwc_stripe_name_\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));\n\nfunction checkDeferredModulesImpl() {\n\tvar result;\n\tfor(var i = 0; i < deferredModules.length; i++) {\n\t\tvar deferredModule = deferredModules[i];\n\t\tvar fulfilled = true;\n\t\tfor(var j = 1; j < deferredModule.length; j++) {\n\t\t\tvar depId = deferredModule[j];\n\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferredModules.splice(i--, 1);\n\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n\t\t}\n\t}\n\tif(deferredModules.length === 0) {\n\t\t__webpack_require__.x();\n\t\t__webpack_require__.x = x => {};\n\t}\n\treturn result;\n}\nvar startup = __webpack_require__.x;\n__webpack_require__.x = () => {\n\t// reset startup function so it can be called again when more startup code is added\n\t__webpack_require__.x = startup || (x => {});\n\treturn (checkDeferredModules = checkDeferredModulesImpl)();\n};","// run startup\nvar __webpack_exports__ = __webpack_require__.x();\n"],"sourceRoot":""}
packages/blocks/src/Assets/Api.php ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ namespace PaymentPlugins\Blocks\Stripe\Assets;
5
+
6
+ use \PaymentPlugins\Blocks\Stripe\Config;
7
+
8
+ class Api {
9
+
10
+ private $config;
11
+
12
+ private $asset_registry;
13
+
14
+ private $styles = array();
15
+
16
+ /**
17
+ * Api constructor.
18
+ *
19
+ * @param Config $config
20
+ */
21
+ public function __construct( Config $config ) {
22
+ $this->config = $config;
23
+ $this->init();
24
+ }
25
+
26
+ private function init() {
27
+ foreach ( array( 'cart', 'checkout' ) as $page ) {
28
+ add_action( "woocommerce_blocks_enqueue_${page}_block_scripts_after", array( $this, 'enqueue_style' ) );
29
+ }
30
+ $this->register_script( 'wc-stripe-blocks-commons', 'build/commons.js' );
31
+ }
32
+
33
+ /**
34
+ * @param string $relative_path
35
+ *
36
+ * @return string
37
+ */
38
+ public function get_asset_url( $relative_path = '' ) {
39
+ return $this->config->get_url( $relative_path );
40
+ }
41
+
42
+ public function g