Payment Plugins for Stripe WooCommerce - Version 3.3.20

Version Description

  • 6/3/22 =
  • Added - PaymentElement for card payments
  • Added - Link with Stripe which uses the PaymentElement to increase conversion rates
  • Added - Additional messaging for the installments option located on the Advanced Settings page
  • Added - Loader on Blocks ACH when initializing Plaid
  • Added - Ability to delete connection to Stripe account on API Settings page
  • Added - payment_intent.requires_action event for OXXO and Boleto
  • Fixed - ACH fee option not being included in order on checkout page
  • Fixed - Correctly display AfterPay messaging on product pages if prices are shown including tax
Download this release

Release Info

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

Code changes from version 3.3.19 to 3.3.20

Files changed (78) hide show
  1. assets/build/admin-feedback-styles-rtl.css +1 -0
  2. assets/build/admin-feedback-styles.css +1 -0
  3. assets/build/admin-feedback-styles.js +8 -0
  4. assets/build/admin-feedback-styles.js.map +1 -0
  5. assets/build/admin-feedback.asset.php +1 -0
  6. assets/build/admin-feedback.js +2 -0
  7. assets/build/admin-feedback.js.map +1 -0
  8. assets/build/link-checkout.asset.php +1 -0
  9. assets/build/link-checkout.js +2 -0
  10. assets/build/link-checkout.js.map +1 -0
  11. assets/css/admin/admin-rtl.css +1 -1
  12. assets/css/admin/admin.css +1 -1
  13. assets/css/admin/feedback.scss +12 -0
  14. assets/css/stripe-rtl.css +5 -0
  15. assets/css/stripe.css +5 -0
  16. assets/css/stripe.min-rtl.css +1 -1
  17. assets/css/stripe.min.css +1 -1
  18. assets/js/admin/admin-settings.js +24 -0
  19. assets/js/admin/feedback.js +95 -0
  20. assets/js/frontend/credit-card.js +246 -65
  21. assets/js/frontend/credit-card.min.js +1 -1
  22. assets/js/frontend/link-checkout.js +46 -0
  23. assets/js/frontend/local-payment.js +5 -22
  24. assets/js/frontend/local-payment.min.js +1 -1
  25. assets/js/frontend/wc-stripe.js +54 -11
  26. assets/js/frontend/wc-stripe.min.js +1 -1
  27. i18n/languages/woo-stripe-payment.pot +404 -297
  28. includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php +0 -15
  29. includes/abstract/abstract-wc-payment-gateway-stripe.php +16 -5
  30. includes/abstract/abstract-wc-stripe-payment.php +14 -4
  31. includes/admin/class-wc-stripe-admin-assets.php +38 -6
  32. includes/admin/settings/class-wc-stripe-account-settings.php +23 -11
  33. includes/admin/settings/class-wc-stripe-advanced-settings.php +71 -12
  34. includes/admin/settings/class-wc-stripe-api-settings.php +50 -13
  35. includes/admin/views/html-stripe-connect.php +20 -19
  36. includes/class-stripe.php +32 -6
  37. includes/class-wc-stripe-constants.php +8 -0
  38. includes/class-wc-stripe-frontend-scripts.php +19 -11
  39. includes/class-wc-stripe-gateway.php +8 -4
  40. includes/class-wc-stripe-install.php +14 -1
  41. includes/class-wc-stripe-payment-intent.php +135 -45
  42. includes/class-wc-stripe-rest-api.php +4 -1
  43. includes/class-wc-stripe-update.php +12 -11
  44. includes/class-wc-stripe-utils.php +111 -2
  45. includes/controllers/class-wc-stripe-controller-cart.php +2 -2
  46. includes/controllers/class-wc-stripe-controller-checkout.php +60 -8
  47. includes/controllers/class-wc-stripe-controller-feedback.php +55 -0
  48. includes/controllers/class-wc-stripe-controller-gateway-settings.php +17 -0
  49. includes/controllers/class-wc-stripe-controller-payment-intent.php +9 -10
  50. includes/gateways/class-wc-payment-gateway-stripe-ach.php +17 -13
  51. includes/gateways/class-wc-payment-gateway-stripe-cc.php +55 -0
  52. includes/gateways/class-wc-payment-gateway-stripe-googlepay.php +0 -6
  53. includes/gateways/class-wc-payment-gateway-stripe-klarna.php +34 -0
  54. includes/gateways/settings/cc-settings.php +5 -3
  55. includes/tokens/class-wc-payment-token-stripe-cc.php +31 -12
  56. includes/traits/wc-stripe-payment-traits.php +2 -10
  57. includes/updates/update-3.3.20.php +19 -0
  58. includes/wc-stripe-functions.php +55 -50
  59. includes/wc-stripe-hooks.php +1 -0
  60. includes/wc-stripe-webhook-functions.php +24 -1
  61. packages/blocks/assets/js/components/checkout/checkbox/index.js +0 -20
  62. packages/blocks/assets/js/components/checkout/checkbox/styles.scss +0 -40
  63. packages/blocks/assets/js/components/checkout/index.js +0 -1
  64. packages/blocks/assets/js/components/checkout/installments/index.js +26 -26
  65. packages/blocks/assets/js/payment-methods/ach/payment-method.js +3 -3
  66. packages/blocks/assets/js/payment-methods/credit-card/components/stripe-card-form.js +1 -1
  67. packages/blocks/assets/js/payment-methods/credit-card/payment-element.js +82 -0
  68. packages/blocks/assets/js/payment-methods/credit-card/payment-method.js +25 -22
  69. packages/blocks/assets/js/payment-methods/hooks/index.js +2 -1
  70. packages/blocks/assets/js/payment-methods/hooks/use-after-process-payment.js +3 -3
  71. packages/blocks/assets/js/payment-methods/hooks/use-process-payment-intent.js +5 -5
  72. packages/blocks/assets/js/payment-methods/hooks/use-update-payment-intent.js +138 -0
  73. packages/blocks/assets/js/payment-methods/link/hooks/index.js +1 -0
  74. packages/blocks/assets/js/payment-methods/link/hooks/use-link.js +88 -0
  75. packages/blocks/assets/js/payment-methods/link/index.js +59 -0
  76. packages/blocks/assets/js/payment-methods/util.js +14 -5
  77. packages/blocks/build/commons.js +1 -1
  78. packages/blocks/build/commons.js.map +0 -1
assets/build/admin-feedback-styles-rtl.css ADDED
@@ -0,0 +1 @@
 
1
+ .stripe-modal-actions{display:flex;margin-top:20px}.stripe-modal-actions .stripe-skip-deactivate{margin-right:5px}.stripe-modal-actions .stripe-deactivation__text{margin-top:10px}
assets/build/admin-feedback-styles.css ADDED
@@ -0,0 +1 @@
 
1
+ .stripe-modal-actions{display:flex;margin-top:20px}.stripe-modal-actions .stripe-skip-deactivate{margin-left:5px}.stripe-modal-actions .stripe-deactivation__text{margin-top:10px}
assets/build/admin-feedback-styles.js ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ /******/ (() => { // webpackBootstrap
2
+ /******/ "use strict";
3
+ var __webpack_exports__ = {};
4
+ // extracted by mini-css-extract-plugin
5
+
6
+ /******/ })()
7
+ ;
8
+ //# sourceMappingURL=admin-feedback-styles.js.map
assets/build/admin-feedback-styles.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"file":"admin-feedback-styles.js","mappings":";;;AAAA","sources":["webpack://woo-stripe-payment/./assets/css/admin/feedback.scss"],"sourcesContent":["// extracted by mini-css-extract-plugin\nexport {};"],"names":[],"sourceRoot":""}
assets/build/admin-feedback.asset.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php return array('dependencies' => array('wp-api-fetch', 'wp-components', 'wp-element', 'wp-polyfill'), 'version' => 'a899b43e4035d0ad1ae6a0bf9c0255c6');
assets/build/admin-feedback.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ (()=>{var e={228:e=>{e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}},858:e=>{e.exports=function(e){if(Array.isArray(e))return e}},926:e=>{function t(e,t,r,n,a,o,i){try{var s=e[o](i),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,a)}e.exports=function(e){return function(){var r=this,n=arguments;return new Promise((function(a,o){var i=e.apply(r,n);function s(e){t(i,a,o,s,u,"next",e)}function u(e){t(i,a,o,s,u,"throw",e)}s(void 0)}))}}},318:e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}}},884:e=>{e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,a=!1,o=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){a=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(a)throw o}}return r}}},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.")}},38:(e,t,r)=>{var n=r(858),a=r(884),o=r(379),i=r(521);e.exports=function(e,t){return n(e)||a(e,t)||o(e,t)||i()}},379:(e,t,r)=>{var n=r(228);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}},284:e=>{"use strict";e.exports=window.regeneratorRuntime},989:e=>{"use strict";e.exports=window.wp.apiFetch},609:e=>{"use strict";e.exports=window.wp.components},307:e=>{"use strict";e.exports=window.wp.element}},t={};function r(n){var a=t[n];if(void 0!==a)return a.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,r),o.exports}(()=>{var e=r(307),t=r(318),n=t(r(284)),a=t(r(926)),o=t(r(38)),i=r(307),s=r(609),u=t(r(989));window.addEventListener("load",(function(){var t,r=document.createElement("div");r.id="stripe-app",null===(t=document.getElementById("wpbody"))||void 0===t||t.append(r);var n=document.getElementById("deactivate-woo-stripe-payment");(0,i.render)(e.createElement(c,{el:n}),document.getElementById("stripe-app"))}));var c=function(t){var r=t.el,n=(0,i.useState)(!1),a=(0,o.default)(n,2),s=a[0],u=a[1],c=(0,i.useCallback)((function(e){e.preventDefault(),u(!0)}),[]);return(0,i.useEffect)((function(){return r.addEventListener("click",c),function(){return r.removeEventListener("click",c)}}),[c]),e.createElement(l,{submit:function(){r.removeEventListener("click",c),r.click(),u(!1)},deactivateLink:r.href,open:s,setOpen:u,data:stripeFeedbackParams})},l=function(t){var r=t.deactivateLink,c=t.open,l=t.setOpen,d=t.data,p=t.submit,f=(0,i.useState)(!1),v=(0,o.default)(f,2),m=v[0],y=v[1],h=(0,i.useState)(""),b=(0,o.default)(h,2),x=b[0],w=b[1],E=(0,i.useState)(),k=(0,o.default)(E,2),S=k[0],g=k[1],C=(0,i.useState)(""),O=(0,o.default)(C,2),L=O[0],A=O[1],B=function(){return l(!1)},I=Object.keys(d.options).map((function(e){return{label:d.options[e],value:e}})),_=function(){var e=(0,a.default)(n.default.mark((function e(){return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g(!0),e.prev=1,e.next=4,(0,u.default)({method:"POST",url:d.route,data:{reason_code:m,reason_text:x}});case 4:e.next=8;break;case 6:e.prev=6,e.t0=e.catch(1);case 8:return e.prev=8,g(!1),p(),e.finish(8);case 12:case"end":return e.stop()}}),e,null,[[1,6,8,12]])})));return function(){return e.apply(this,arguments)}}();(0,i.useEffect)((function(){d.placeholders.hasOwnProperty(m)?A(d.placeholders[m]):A("")}),[m]);var j={title:d.title,isDismissible:!0,focusOnMount:!0,isFullScreen:!1,onRequestClose:B};return c?e.createElement(s.Modal,j,e.createElement("div",{className:"stripe-modal-content"},e.createElement("p",null,d.description),e.createElement("div",{className:"options-container"},e.createElement(s.RadioControl,{selected:m,options:I,onChange:y})),e.createElement("div",{className:"stripe-deactivation__text"},e.createElement(s.TextareaControl,{placeholder:L,label:d.reasonTextLabel,value:x,onChange:w}))),e.createElement("div",{className:"stripe-modal-actions"},e.createElement(s.Button,{variant:"primary",onClick:_,isBusy:S,disabled:S},d.buttons.primary),e.createElement(s.Button,{href:r,className:"stripe-skip-deactivate",variant:"tertiary",onClick:B},d.buttons.secondary))):null}})()})();
2
+ //# sourceMappingURL=admin-feedback.js.map
assets/build/admin-feedback.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"file":"admin-feedback.js","mappings":"qBAUAA,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,QCHTN,EAAOC,QAJP,SAAyBC,GACvB,GAAIK,MAAMC,QAAQN,GAAM,OAAOA,I,QCDjC,SAASO,EAAmBC,EAAKC,EAASC,EAAQC,EAAOC,EAAQC,EAAKC,GACpE,IACE,IAAIC,EAAOP,EAAIK,GAAKC,GAChBE,EAAQD,EAA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AAA0C,MAAUN,EACP,uBAAKO,UAAU,wBACX,yBAAI9B,EAAK+B,aACT,uBAAKD,UAAU,qBACX,gBAAC,EAAAE,aAAD,CAAcC,SAAU/B,EAAYS,QAASA,EAASuB,SAAU/B,KAEpE,uBAAK2B,UAAU,6BACX,gBAAC,EAAAK,gBAAD,CAAiB3B,YAAaA,EAAaM,MAAOd,EAAKoC,gBAAiB7G,MAAO6E,EAAY8B,SAAU7B,MAG7G,uBAAKyB,UAAU,wBACX,gBAAC,EAAAO,OAAD,CAAQC,QAAQ,UAAUC,QAASxB,EAAUyB,OAAQlC,EAAYmC,SAAUnC,GAAaN,EAAK0C,QAAQC,SACrG,gBAAC,EAAAN,OAAD,CAAQtC,KAAMD,EAAgBgC,UAAU,yBAAyBQ,QAAQ,WAAWC,QAAS7B,GAAUV,EAAK0C,QAAQE,aAK7H,O","sources":["webpack://woo-stripe-payment/./node_modules/@babel/runtime/helpers/arrayLikeToArray.js","webpack://woo-stripe-payment/./node_modules/@babel/runtime/helpers/arrayWithHoles.js","webpack://woo-stripe-payment/./node_modules/@babel/runtime/helpers/asyncToGenerator.js","webpack://woo-stripe-payment/./node_modules/@babel/runtime/helpers/interopRequireDefault.js","webpack://woo-stripe-payment/./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js","webpack://woo-stripe-payment/./node_modules/@babel/runtime/helpers/nonIterableRest.js","webpack://woo-stripe-payment/./node_modules/@babel/runtime/helpers/slicedToArray.js","webpack://woo-stripe-payment/./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js","webpack://woo-stripe-payment/external window \"regeneratorRuntime\"","webpack://woo-stripe-payment/external window [\"wp\",\"apiFetch\"]","webpack://woo-stripe-payment/external window [\"wp\",\"components\"]","webpack://woo-stripe-payment/external window [\"wp\",\"element\"]","webpack://woo-stripe-payment/webpack/bootstrap","webpack://woo-stripe-payment/./assets/js/admin/feedback.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;","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 _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\n\nmodule.exports = _interopRequireDefault;","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;","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 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;","module.exports = window[\"regeneratorRuntime\"];","module.exports = window[\"wp\"][\"apiFetch\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"element\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","import {useState, useCallback, useEffect, render} from '@wordpress/element';\r\nimport {Modal, Button, RadioControl, TextareaControl} from '@wordpress/components';\r\nimport apiFetch from '@wordpress/api-fetch';\r\n\r\nwindow.addEventListener('load', () => {\r\n const app = document.createElement('div');\r\n app.id = 'stripe-app';\r\n document.getElementById('wpbody')?.append(app);\r\n const el = document.getElementById('deactivate-woo-stripe-payment');\r\n render(<App el={el}/>, document.getElementById('stripe-app'));\r\n});\r\n\r\nconst App = ({el}) => {\r\n const [open, setOpen] = useState(false);\r\n const openModal = useCallback((e) => {\r\n e.preventDefault();\r\n setOpen(true)\r\n }, []);\r\n useEffect(() => {\r\n el.addEventListener('click', openModal);\r\n return () => el.removeEventListener('click', openModal);\r\n }, [openModal]);\r\n const submit = () => {\r\n el.removeEventListener('click', openModal);\r\n el.click();\r\n setOpen(false);\r\n }\r\n return <FeedbackModal submit={submit} deactivateLink={el.href} open={open} setOpen={setOpen} data={stripeFeedbackParams}/>\r\n}\r\n\r\nconst FeedbackModal = ({deactivateLink, open, setOpen, data, submit}) => {\r\n const [reasonCode, setReasonCode] = useState(false);\r\n const [reasonText, setReasonText] = useState('');\r\n const [processing, setProcessing] = useState();\r\n const [placeholder, setPlaceHolder] = useState('');\r\n const onClose = () => setOpen(false);\r\n const options = Object.keys(data.options).map(id => ({\r\n label: data.options[id],\r\n value: id\r\n }));\r\n const onSubmit = async () => {\r\n setProcessing(true);\r\n try {\r\n await apiFetch({\r\n method: 'POST',\r\n url: data.route,\r\n data: {\r\n reason_code: reasonCode,\r\n reason_text: reasonText\r\n }\r\n })\r\n } catch (error) {\r\n\r\n } finally {\r\n setProcessing(false);\r\n submit();\r\n }\r\n }\r\n\r\n useEffect(() => {\r\n if (data.placeholders.hasOwnProperty(reasonCode)) {\r\n setPlaceHolder(data.placeholders[reasonCode]);\r\n } else {\r\n setPlaceHolder('');\r\n }\r\n }, [reasonCode]);\r\n\r\n const props = {\r\n title: data.title,\r\n isDismissible: true,\r\n focusOnMount: true,\r\n isFullScreen: false,\r\n onRequestClose: onClose\r\n }\r\n if (open) {\r\n return (\r\n <Modal {...props}>\r\n <div className='stripe-modal-content'>\r\n <p>{data.description}</p>\r\n <div className='options-container'>\r\n <RadioControl selected={reasonCode} options={options} onChange={setReasonCode}/>\r\n </div>\r\n <div className='stripe-deactivation__text'>\r\n <TextareaControl placeholder={placeholder} label={data.reasonTextLabel} value={reasonText} onChange={setReasonText}/>\r\n </div>\r\n </div>\r\n <div className='stripe-modal-actions'>\r\n <Button variant='primary' onClick={onSubmit} isBusy={processing} disabled={processing}>{data.buttons.primary}</Button>\r\n <Button href={deactivateLink} className='stripe-skip-deactivate' variant='tertiary' onClick={onClose}>{data.buttons.secondary}</Button>\r\n </div>\r\n </Modal>\r\n )\r\n }\r\n return null;\r\n}"],"names":["module","exports","arr","len","length","i","arr2","Array","isArray","asyncGeneratorStep","gen","resolve","reject","_next","_throw","key","arg","info","value","error","done","Promise","then","fn","self","this","args","arguments","apply","err","undefined","obj","__esModule","Symbol","iterator","Object","_arr","_n","_d","_e","_s","_i","next","push","TypeError","arrayWithHoles","iterableToArrayLimit","unsupportedIterableToArray","nonIterableRest","arrayLikeToArray","o","minLen","n","prototype","toString","call","slice","constructor","name","from","test","window","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","addEventListener","app","document","createElement","id","getElementById","append","el","render","App","useState","open","setOpen","openModal","useCallback","e","preventDefault","useEffect","removeEventListener","FeedbackModal","submit","click","deactivateLink","href","data","stripeFeedbackParams","reasonCode","setReasonCode","reasonText","setReasonText","processing","setProcessing","placeholder","setPlaceHolder","onClose","options","keys","map","label","onSubmit","method","url","route","reason_code","reason_text","placeholders","hasOwnProperty","props","title","isDismissible","focusOnMount","isFullScreen","onRequestClose","Modal","className","description","RadioControl","selected","onChange","TextareaControl","reasonTextLabel","Button","variant","onClick","isBusy","disabled","buttons","primary","secondary"],"sourceRoot":""}
assets/build/link-checkout.asset.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php return array('dependencies' => array('jquery', 'wp-polyfill'), 'version' => 'ab4aff3a00142b782605e7e6535685db');
assets/build/link-checkout.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ (()=>{var e={713:e=>{e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},318:e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}}},567:e=>{"use strict";e.exports=window.jQuery}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}(()=>{var e=r(318),t=e(r(713)),n=e(r(567));function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?i(Object(n),!0).forEach((function(r){(0,t.default)(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}(0,n.default)((function(){if("undefined"===wcStripeLinkParams)return!1;try{var e=wc_stripe.credit_card,t=e.stripe.linkAutofillModal(e.elements);(0,n.default)(document.body).on("keyup",'[name="billing_email"]',(function(e){t.launch({email:e.currentTarget.value})})),wcStripeLinkParams.launchLink&&t.launch({email:(0,n.default)('[name="billing_email"]').val()}),t.on("autofill",(function(t){var r=t.value,i=r.shippingAddress,o=void 0===i?null:i,l=r.billingAddress;if(o){var s=a({name:o.name},o.address);e.populate_shipping_fields(s)}if(l){var u=a({name:l.name},l.address);e.populate_billing_fields(u)}e.fields.toFormFields(),e.set_payment_method(e.gateway_id),e.show_new_payment_method(),e.hide_save_card(),o&&e.maybe_set_ship_to_different(),(0,n.default)('[name="terms"]').prop("checked",!0),e.fields.isEmpty("billing_phone")||e.get_form().trigger("submit")}))}catch(e){console.log(e)}}))})()})();
2
+ //# sourceMappingURL=link-checkout.js.map
assets/build/link-checkout.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"file":"link-checkout.js","mappings":"qBAeAA,EAAOC,QAfP,SAAyBC,EAAKC,EAAKC,GAYjC,OAXID,KA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AAE,kBAAkBC,KAAK,WAAW,GAC/B9B,EAAWuB,OAAOQ,QAAQ,kBAC3B/B,EAAWgC,WAAWC,QAAQ,aAGxC,MAAOC,GACLC,QAAQC,IAAIF,Q","sources":["webpack://woo-stripe-payment/./node_modules/@babel/runtime/helpers/defineProperty.js","webpack://woo-stripe-payment/./node_modules/@babel/runtime/helpers/interopRequireDefault.js","webpack://woo-stripe-payment/external window \"jQuery\"","webpack://woo-stripe-payment/webpack/bootstrap","webpack://woo-stripe-payment/./assets/js/frontend/link-checkout.js"],"sourcesContent":["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 _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\n\nmodule.exports = _interopRequireDefault;","module.exports = window[\"jQuery\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","import $ from 'jquery';\r\n\r\n$(() => {\r\n if (wcStripeLinkParams === 'undefined') {\r\n return false;\r\n }\r\n try {\r\n const creditCard = wc_stripe.credit_card;\r\n const stripe = creditCard.stripe;\r\n const link = stripe.linkAutofillModal(creditCard.elements);\r\n\r\n $(document.body).on('keyup', '[name=\"billing_email\"]', (e) => {\r\n link.launch({email: e.currentTarget.value});\r\n });\r\n\r\n if (wcStripeLinkParams.launchLink) {\r\n link.launch({email: $('[name=\"billing_email\"]').val()});\r\n }\r\n\r\n link.on('autofill', (event) => {\r\n const {shippingAddress = null, billingAddress} = event.value;\r\n // populate the address fields\r\n if (shippingAddress) {\r\n const address = {name: shippingAddress.name, ...shippingAddress.address};\r\n creditCard.populate_shipping_fields(address);\r\n }\r\n if (billingAddress) {\r\n const address = {name: billingAddress.name, ...billingAddress.address};\r\n creditCard.populate_billing_fields(address);\r\n }\r\n creditCard.fields.toFormFields();\r\n creditCard.set_payment_method(creditCard.gateway_id);\r\n creditCard.show_new_payment_method();\r\n creditCard.hide_save_card();\r\n if (shippingAddress) {\r\n creditCard.maybe_set_ship_to_different();\r\n }\r\n $('[name=\"terms\"]').prop('checked', true);\r\n if (!creditCard.fields.isEmpty('billing_phone')) {\r\n creditCard.get_form().trigger('submit');\r\n }\r\n });\r\n } catch (error) {\r\n console.log(error);\r\n }\r\n});"],"names":["module","exports","obj","key","value","Object","defineProperty","enumerable","configurable","writable","__esModule","window","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","wcStripeLinkParams","creditCard","wc_stripe","credit_card","link","stripe","linkAutofillModal","elements","document","body","on","e","launch","email","currentTarget","launchLink","val","event","shippingAddress","billingAddress","address","name","populate_shipping_fields","populate_billing_fields","fields","toFormFields","set_payment_method","gateway_id","show_new_payment_method","hide_save_card","maybe_set_ship_to_different","prop","isEmpty","get_form","trigger","error","console","log"],"sourceRoot":""}
assets/css/admin/admin-rtl.css CHANGED
@@ -313,7 +313,7 @@
313
  background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAAAwCAYAAABuZUjcAAAKRGlDQ1BJQ0MgUHJvZmlsZQAASA2dlndUFNcXx9/MbC+0XZYiZem9twWkLr1IlSYKy+4CS1nWZRewN0QFIoqICFYkKGLAaCgSK6JYCAgW7AEJIkoMRhEVlczGHPX3Oyf5/U7eH3c+8333nnfn3vvOGQAoASECYQ6sAEC2UCKO9PdmxsUnMPG9AAZ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mA9+POa7v5lgwHA2debJn5KSIvxQBnsXxj7qcfwe4a8bmAD4tWnLp6s7uzN2lWw33kdhkeK/lUpat+3Kg9C2ZMPIzuC6A9HmxDbsJeozndwNesXLCf2mO376gnz3TW4Jph2I3Y7cidnr7ynt54MJky/ZZli8jFTZHnE7Ikdmt+9Ua0wjg/bvSwM0+OHXER0ZV2PqULn4EGBjH8LKzgJH+OZnBpHG3kczuNgF7dUD/2DJ6JBlO6wLwP9OtgBt0vr22a3hrHBHQnQkSXlTWgahBlg+WgIMgHIoEpb6cdTvZ7A3QRRFruBDm+FnXRiyhZ3jY+YCXKLwgI0QNTYkKPt1d5YBBmAaJdver48bx/pWQZ/781wx06nq7kgGc0lu8ElOF74OqSBf4P9hj31KSAw4AAAAAASUVORK5CYII=")
314
  }
315
 
316
- .stipe-connect-active,
317
  .stripe-webhook-created {
318
  font-size: 30px;
319
  color: green;
313
  background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAAAwCAYAAABuZUjcAAAKRGlDQ1BJQ0MgUHJvZmlsZQAASA2dlndUFNcXx9/MbC+0XZYiZem9twWkLr1IlSYKy+4CS1nWZRewN0QFIoqICFYkKGLAaCgSK6JYCAgW7AEJIkoMRhEVlczGHPX3Oyf5/U7eH3c+8333nnfn3vvOGQAoASECYQ6sAEC2UCKO9PdmxsUnMPG9AAZEgAM2AHC4uaLQKL9ogK5AXzYzF3WS8V8LAuD1LYBaAK5bBIQzmX/p/+9DkSsSSwCAwtEAOx4/l4tyIcpZ+RKRTJ9EmZ6SKWMYI2MxmiDKqjJO+8Tmf/p8Yk8Z87KFPNRHlrOIl82TcRfKG/OkfJSREJSL8gT8fJRvoKyfJc0WoPwGZXo2n5MLAIYi0yV8bjrK1ihTxNGRbJTnAkCgpH3FKV+xhF+A5gkAO0e0RCxIS5cwjbkmTBtnZxYzgJ+fxZdILMI53EyOmMdk52SLOMIlAHz6ZlkUUJLVlokW2dHG2dHRwtYSLf/n9Y+bn73+GWS9/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TYkKPt1d5YBBmAaJdver48bx/pWQZ/781wx06nq7kgGc0lu8ElOF74OqSBf4P9hj31KSAw4AAAAAASUVORK5CYII=")
314
  }
315
 
316
+ .stripe-connect-active,
317
  .stripe-webhook-created {
318
  font-size: 30px;
319
  color: green;
assets/css/admin/admin.css CHANGED
@@ -313,7 +313,7 @@
313
  background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAAAwCAYAAABuZUjcAAAKRGlDQ1BJQ0MgUHJvZmlsZQAASA2dlndUFNcXx9/MbC+0XZYiZem9twWkLr1IlSYKy+4CS1nWZRewN0QFIoqICFYkKGLAaCgSK6JYCAgW7AEJIkoMRhEVlczGHPX3Oyf5/U7eH3c+8333nnfn3vvOGQAoASECYQ6sAEC2UCKO9PdmxsUnMPG9AAZEgAM2AHC4uaLQKL9ogK5AXzYzF3WS8V8LAuD1LYBaAK5bBIQzmX/p/+9DkSsSSwCAwtEAOx4/l4tyIcpZ+RKRTJ9EmZ6SKWMYI2MxmiDKqjJO+8Tmf/p8Yk8Z87KFPNRHlrOIl82TcRfKG/OkfJSREJSL8gT8fJRvoKyfJc0WoPwGZXo2n5MLAIYi0yV8bjrK1ihTxNGRbJTnAkCgpH3FKV+xhF+A5gkAO0e0RCxIS5cwjbkmTBtnZxYzgJ+fxZdILMI53EyOmMdk52SLOMIlAHz6ZlkUUJLVlokW2dHG2dHRwtYSLf/n9Y+bn73+GWS9/eTxMuLPnkGMni/al9gvWk4tAKwptDZbvmgpOwFoWw+A6t0vmv4+AOQLAWjt++p7GLJ5SZdIRC5WVvn5+ZYCPtdSVtDP6386fPb8e/jqPEvZeZ9rx/Thp3KkWRKmrKjcnKwcqZiZK+Jw+UyL/x7ifx34VVpf5WEeyU/li/lC9KgYdMoEwjS03UKeQCLIETIFwr/r8L8M+yoHGX6aaxRodR8BPckSKPTRAfJrD8DQyABJ3IPuQJ/7FkKMAbKbF6s99mnuUUb3/7T/YeAy9BXOFaQxZTI7MprJlYrzZIzeCZ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ehu0QW8ufX1eoGXJPNy6Mju3W2pAVgSeO4AHQLV+SR5pIVES+CQ1+QolPeoqlr0RMsFXJTkpXDbbVxVV/eclW+04wjTDod4HGe907aQuiImOV7RfbXVVdWNeqCMCUpu4ORM4Zl6csg2pC4X8GHRsNbdl6BrBs1MpWbh4DuLrhvoEGzZODVJHA7GPOuLJ5iG0ELAchUcn5mh63/n4hlKnwt4bW11uCvW65x+cLXAkgkQDgMpXDtQRkhAydXRKQnJVTqq5liZTv/V0dDJHCyD6rIZT5mU+15Fgk36/X7n/oQ0beGawQTgtMZxT4UP2a1zt4I6n8bxPlLNU+u+GxS6HMwch43lBZzu+tHpXPaIPDRKWi2gPDKi6sDo2sqjBUxx91CbOWdBN6r+hCqfJu+ezfuXEfCdX7lw+k70nvDmGHwr7KSbRrmA9+POa7v5lgwHA2debJn5KSIvxQBnsXxj7qcfwe4a8bmAD4tWnLp6s7uzN2lWw33kdhkeK/lUpat+3Kg9C2ZMPIzuC6A9HmxDbsJeozndwNesXLCf2mO376gnz3TW4Jph2I3Y7cidnr7ynt54MJky/ZZli8jFTZHnE7Ikdmt+9Ua0wjg/bvSwM0+OHXER0ZV2PqULn4EGBjH8LKzgJH+OZnBpHG3kczuNgF7dUD/2DJ6JBlO6wLwP9OtgBt0vr22a3hrHBHQnQkSXlTWgahBlg+WgIMgHIoEpb6cdTvZ7A3QRRFruBDm+FnXRiyhZ3jY+YCXKLwgI0QNTYkKPt1d5YBBmAaJdver48bx/pWQZ/781wx06nq7kgGc0lu8ElOF74OqSBf4P9hj31KSAw4AAAAAASUVORK5CYII=")
314
  }
315
 
316
- .stipe-connect-active,
317
  .stripe-webhook-created {
318
  font-size: 30px;
319
  color: green;
313
  background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAAAwCAYAAABuZUjcAAAKRGlDQ1BJQ0MgUHJvZmlsZQAASA2dlndUFNcXx9/MbC+0XZYiZem9twWkLr1IlSYKy+4CS1nWZRewN0QFIoqICFYkKG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HMwch43lBZzu+tHpXPaIPDRKWi2gPDKi6sDo2sqjBUxx91CbOWdBN6r+hCqfJu+ezfuXEfCdX7lw+k70nvDmGHwr7KSbRrmA9+POa7v5lgwHA2debJn5KSIvxQBnsXxj7qcfwe4a8bmAD4tWnLp6s7uzN2lWw33kdhkeK/lUpat+3Kg9C2ZMPIzuC6A9HmxDbsJeozndwNesXLCf2mO376gnz3TW4Jph2I3Y7cidnr7ynt54MJky/ZZli8jFTZHnE7Ikdmt+9Ua0wjg/bvSwM0+OHXER0ZV2PqULn4EGBjH8LKzgJH+OZnBpHG3kczuNgF7dUD/2DJ6JBlO6wLwP9OtgBt0vr22a3hrHBHQnQkSXlTWgahBlg+WgIMgHIoEpb6cdTvZ7A3QRRFruBDm+FnXRiyhZ3jY+YCXKLwgI0QNTYkKPt1d5YBBmAaJdver48bx/pWQZ/781wx06nq7kgGc0lu8ElOF74OqSBf4P9hj31KSAw4AAAAAASUVORK5CYII=")
314
  }
315
 
316
+ .stripe-connect-active,
317
  .stripe-webhook-created {
318
  font-size: 30px;
319
  color: green;
assets/css/admin/feedback.scss ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .stripe-modal-actions {
2
+ margin-top: 20px;
3
+ display: flex;
4
+
5
+ .stripe-skip-deactivate {
6
+ margin-left: 5px;
7
+ }
8
+
9
+ .stripe-deactivation__text {
10
+ margin-top: 10px;
11
+ }
12
+ }
assets/css/stripe-rtl.css CHANGED
@@ -213,6 +213,11 @@ label.wc-stripe-label-payment-type:after {
213
  margin-bottom: 1em;
214
  }
215
 
 
 
 
 
 
216
  .wc-stripe_cc-new-method-container .wc-stripe-save-source {
217
  display: flex;
218
  align-items: center;
213
  margin-bottom: 1em;
214
  }
215
 
216
+ #wc-stripe-card-element.payment-type {
217
+ height: 100%;
218
+ padding: 0px;
219
+ }
220
+
221
  .wc-stripe_cc-new-method-container .wc-stripe-save-source {
222
  display: flex;
223
  align-items: center;
assets/css/stripe.css CHANGED
@@ -213,6 +213,11 @@ label.wc-stripe-label-payment-type:after {
213
  margin-bottom: 1em;
214
  }
215
 
 
 
 
 
 
216
  .wc-stripe_cc-new-method-container .wc-stripe-save-source {
217
  display: flex;
218
  align-items: center;
213
  margin-bottom: 1em;
214
  }
215
 
216
+ #wc-stripe-card-element.payment-type {
217
+ height: 100%;
218
+ padding: 0px;
219
+ }
220
+
221
  .wc-stripe_cc-new-method-container .wc-stripe-save-source {
222
  display: flex;
223
  align-items: center;
assets/css/stripe.min-rtl.css CHANGED
@@ -1 +1 @@
1
- .wc-stripe-card-icons-container,.wc-stripe-paymentRequest-icons-container{float:left;display:inline-block}ul.payment_methods li[class*=payment_method]{margin:0;padding:0}li[class*=payment_method] input[type=radio]{margin:0 5px 0 10px}li[class*=payment_method] input[type=radio]+label:not(.wc-stripe-label-payment-type){margin:0}.woocommerce-checkout #payment ul.payment_methods li[class*=payment_method_stripe_]:nth-child(n+2),ul.payment_methods li[class*=payment_method_stripe_]:nth-child(n+2){margin:0}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon{max-width:43px;max-height:26px;width:43px;height:26px;float:none;display:inline}li.payment_method_stripe_payment_request .wc-stripe-paymentRequest-icons-container img:not(.gpay){width:25px;height:25px;max-width:25px;max-height:25px}ul.payment_methods label[for*=payment_method_stripe]:after{clear:left;content:"";display:block}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon:nth-child(2n+2){margin:0 2px}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon.open.visa{padding-top:2px}ul.payment_methods li[class*=payment_method_stripe_] label>img:first-of-type{float:left!important}.wc-stripe_cc-new-method-container{margin-bottom:1em}.wc-stripe_cc-container .StripeElement{box-sizing:border-box;height:40px;padding:10px 12px;border-radius:4px;background-color:#fff;-webkit-transition:box-shadow 150ms ease;transition:box-shadow 150ms ease}input.wc-stripe-klarna-category,input.wc-stripe-payment-type{display:none!important}body .wfacp_main_form.woocommerce .wc-stripe-save-source label.checkbox{padding:0!important}input[type=radio]+label.wc-stripe-label-payment-type,label.wc-stripe-label-klarna-category,label.wc-stripe-label-payment-type{margin-bottom:1em;display:block;padding:0!important;color:#000}.theme-flatsome div.wc-stripe-saved-methods-container{margin:0 0 1em 0}label.wc-stripe-label-klarna-category:before,label.wc-stripe-label-payment-type:before{content:"";display:inline-block;width:11px;height:11px;border:2px solid #fff;box-shadow:0 0 0 2px #000;background:#fff;margin-right:4px;margin-left:.5em;border-radius:100%;-webkit-transform:translateY(2px);-ms-transform:translateY(2px);transform:translateY(2px)}input.wc-stripe-klarna-category:checked+label.wc-stripe-label-klarna-category:before,input.wc-stripe-payment-type:checked+label.wc-stripe-label-payment-type:before{background:#000}label.wc-stripe-label-payment-type:after{content:none!important;display:none!important}.wc-stripe-saved-methods-container .select2-container .select2-selection--single .select2-selection__rendered{padding-right:8px}.select2-results__options li.wc-stripe-select2-container,.wc-stripe-saved-methods-container .select2-container .select2-selection--single .wc-stripe-select2-container{display:flex;align-items:center;height:42px;line-height:42px!important}.select2-container .select2-selection--single .wc-stripe-select2-container:before,.select2-results__options li.wc-stripe-select2-container:before{content:'';background-repeat:no-repeat;background-size:40px 24px;width:40px;height:42px;display:inline-block;margin-left:8px;background-position:center}.select2-container .select2-selection--single .wc-stripe-select2-container.visa:before,.select2-results__options li.wc-stripe-select2-container.visa:before{background-image:url(../img/cards/visa.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.mastercard:before,.select2-results__options li.wc-stripe-select2-container.mastercard:before{background-image:url(../img/cards/mastercard.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.americanexpress:before,.select2-results__options li.wc-stripe-select2-container.americanexpress:before{background-image:url(../img/cards/amex.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.amex:before,.select2-results__options li.wc-stripe-select2-container.amex:before{background-image:url(../img/cards/amex.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.discover:before,.select2-results__options li.wc-stripe-select2-container.discover:before{background-image:url(../img/cards/discover.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.mastercard:before,.select2-results__options li.wc-stripe-select2-container.mastercard:before{background-image:url(../img/cards/mastercard.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.dinersclub:before,.select2-results__options li.wc-stripe-select2-container.dinersclub:before{background-image:url(../img/cards/diners.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.diners:before,.select2-results__options li.wc-stripe-select2-container.diners:before{background-image:url(../img/cards/diners.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.jcb:before,.select2-results__options li.wc-stripe-select2-container.jcb:before{background-image:url(../img/cards/jcb.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.stripe_sepa:before,.select2-results__options li.wc-stripe-select2-container.stripe_sepa:before{background-image:url(../img/sepa.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.stripe_becs:before,.select2-results__options li.wc-stripe-select2-container.stripe_becs:before,.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][name=stripe_cc_save_source_key]{opacity:0;position:absolute;width:20px;height:20px}.wc-stripe_cc-container .wc-stripe-save-source label.checkbox{position:relative}.wc-stripe_cc-container .save-source-checkbox{height:20px;width:20px;position:relative;background-color:#fff;display:block;border-radius:3px;border:1px solid #bababa}.wc-stripe_cc-container .save-source-checkbox:after{content:"";position:absolute;top:0;right:0}.wc-stripe_cc-container .wc-stripe-save-source input[type=checkbox]:checked+.save-source-checkbox:after{right:6px;top:2px;width:7px;height:12px;border:solid #2196f3;border-width:0 0 3px 3px;-webkit-transform:rotate(-45deg);-ms-transform:rotate(-45deg);transform:rotate(-45deg);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}li.payment_method_stripe_applepay,li.payment_method_stripe_googlepay,li.payment_method_stripe_payment_request{display:none}#payment #place_order.wc-stripe-hide,#place_order.wc-stripe-hide,.woocommerce-checkout-review-order #payment #place_order.wc-stripe-hide{position:absolute!important;z-index:-1000!important;height:0!important;padding:0!important;opacity:0!important}.wc-stripe-product-checkout-container{display:none;width:100%}.wc-stripe-product-checkout-container.bottom{margin-top:1em}.wc-stripe-product-checkout-container.top{margin-bottom:1em}.wc-stripe-product-checkout-container.active{display:block}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods,.wc-stripe-product-checkout-container ul.wc_stripe_product_payment_methods{list-style:none;margin:0;padding:0}.wc-stripe-cart-checkout-container{margin:0;padding:0;clear:both}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods{margin-bottom:1.5em}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods li[class*=payment_method_stripe_],.wc-stripe-product-checkout-container ul.wc_stripe_product_payment_methods li[class*=payment_method_stripe_]{margin:0 0 1em 0;list-style:none}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods li[class*=payment_method_stripe_]:last-child,.wc-stripe-product-checkout-container ul.wc_stripe_product_payment_methods li[class*=payment_method_stripe_]:last-child{margin:0}.wc_stripe_cart_payment_methods .gpay-button,.wc_stripe_cart_payment_methods .gpay-card-info-container,.wc_stripe_product_payment_methods .gpay-button,.wc_stripe_product_payment_methods .gpay-card-info-container{width:100%!important;min-width:100%;margin:0}.wc_stripe_product_payment_methods .disabled{opacity:.45}.stripe_cart_gateway_active .checkout-button,.woocommerce-cart .stripe_cart_gateway_active .wc-proceed-to-checkout .checkout-button{margin-bottom:0}.wc-stripe-cart-or{margin:1em 0;text-align:center}li.wc-stripe-payment-method.or{display:none}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods.active li.wc-stripe-payment-method.or{display:block;margin:15px 0}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods.active li.wc-stripe-payment-method.or p{margin:0}li[class*=payment_method_stripe_].active~li.wc-stripe-payment-method.or{display:block;margin:0}li.payment_method_stripe_applepay label:first-of-type img{width:49px;max-height:32px}li.payment_method_stripe_googlepay label:first-of-type img{width:48px;max-height:35px}li.payment_method_stripe_googlepay label:first-of-type img[src*=googlepay_standard],li.payment_method_stripe_payment_request label:first-of-type img[src*=googlepay_standard]{width:60px;max-height:35px}li.payment_method_stripe_googlepay label:first-of-type img[src*=googlepay_round_outline],li.payment_method_stripe_payment_request label:first-of-type img[src*=googlepay_round_outline]{width:56px;max-height:30px}li.payment_method_stripe_ach label:first-of-type img{width:32px;height:32px;min-width:32px;min-height:32px}.gpay-button-container .gpay-button:hover,.wc-stripe-checkout-banner-gateway .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}.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:0;position:relative;margin:1em 0}.wc-stripe-banner-checkout fieldset{padding:15px 25px 15px;border:1px solid #d1d1d1;margin-bottom:20px;border-radius:3px}.wc-stripe-banner-checkout fieldset legend{margin:0 auto;font-weight:500;padding:0 1rem}.wc-stripe-banner-checkout.active{display:block}.wc-stripe-banner-checkout span.banner-divider{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-divider:after,.wc-stripe-banner-checkout span.banner-divider:before{content:' ';height:1px;background:#d1d1d1;display:block;width:50%}.wc-stripe-banner-checkout span.banner-divider:before{margin-left:1rem}.wc-stripe-banner-checkout span.banner-divider:after{margin-right:1rem}.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 auto;display:none;max-width:240px}.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways li.wc-stripe-checkout-banner-gateway.active:nth-child(n+2){margin:10px auto 0 auto}.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways li.wc-stripe-checkout-banner-gateway:first-child:not(.active)+li.wc-stripe-checkout-banner-gateway.active{margin:0 auto}.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}ul.payment_methods li.payment_method_stripe_oxxo img{max-width:52px;width:52px;max-height:24px}#wc-stripe-card-element{width:100%}li.banner_payment_method_stripe_payment_request .StripeElement{padding:0}.single-product .blockMsg{border:none!important;background-color:transparent!important}#wc-stripe-card{position:absolute!important;top:50%;left:8px;transform:translatey(-50%);width:23px;height:15px;padding:0;border:none}#wc-stripe-card.active{width:32px;height:20px}input[id=stripe-postal-code]:focus{outline:0;background:0 0;border:none;box-shadow:none}div.postalCode:focus{outline:0;border:none}li[class*=payment_method_stripe] .select2-container .select2-selection--single{height:42px;padding:0 5px}li[class*=payment_method_stripe] .select2-container--default .select2-selection--single .select2-selection__arrow{height:42px;top:1px;left:1px;transform:translateY(0)}.blockUI.blockMsg{font-size:20px;white-space:nowrap}#wc-stripe-payment-request-container.disabled{opacity:.45}.wc-stripe-paymentRequest-icons-container img{float:none}.select2-container .select2-selection--single .wc-stripe-select2-container.wc-stripe-ach:before{display:none}ul.wc_stripe_cart_payment_methods li.wc-stripe-payment-method button,ul.wc_stripe_checkout_banner_gateways li button,ul.wc_stripe_product_payment_methods li[class*=payment_method_stripe_] button{margin:0}ul.payment_methods li[class*=payment_method]{margin:0;padding:10px 0}ul.payment_methods li[class*=payment_method] input[name=payment_method]{margin:0 5px 0 10px;float:none}ul.payment_methods li[class*=payment_method]>input[name=payment_method]+label{padding-top:0;padding-left:0;padding-bottom:0}ul.payment_methods{list-style:none}ul.payment_methods li[class*=payment_method_stripe_] .wc-stripe_cc-new-method-container label:before{display:none}.wc-stripe_cc-container .wc-stripe-save-source label.checkbox{padding:0!important;margin:0}div[id*=wc_stripe_local_payment_stripe_].StripeElement{border:1px solid #eee;border-radius:4px}#payment .payment_methods li #wc_stripe_local_payment_stripe_wechat img,#wc_stripe_local_payment_stripe_wechat img{max-height:100%;float:none}.qrcode-message{margin:10px 0 0 0}#wc_stripe_local_payment_stripe_becs,#wc_stripe_local_payment_stripe_sepa{padding:10px 12px;box-shadow:0 1px 3px 0 #e6ebf1}.wc-stripe-local-desc.stripe_becs,.wc-stripe-local-desc.stripe_sepa{margin:10px 0}.wc-stripe-clear{clear:both;height:0;visibility:hidden}.wc-stripe-gateway-desc p{margin:0}#wc_stripe_local_payment_stripe_klarna,li[class*=payment_method_stripe_] div.wc-stripe-gateway-container.has_tokens{margin-top:10px}.wc-stripe-gateway-desc{margin-top:10px}#wc-stripe-card-element.StripeElement--webkit-autofill{background-color:transparent!important}#wc_stripe_local_payment_stripe_klarna .stripe-klarna-categories{list-style:none;margin:0;padding:10px}li.payment_method_stripe_alipay,li.payment_method_stripe_bancontact,li.payment_method_stripe_becs,li.payment_method_stripe_eps,li.payment_method_stripe_fpx,li.payment_method_stripe_giropay,li.payment_method_stripe_ideal,li.payment_method_stripe_klarna,li.payment_method_stripe_multibanco,li.payment_method_stripe_p24,li.payment_method_stripe_sepa,li.payment_method_stripe_sofort,li.payment_method_stripe_wechat{display:none}.widget_shopping_cart_content .wc-stripe-mini-cart-payment-methods{list-style:none;margin:0;padding:0}.widget_shopping_cart_content .wc-stripe-mini-cart-payment-methods li{margin:0}.widget_shopping_cart_content a.wc-stripe-applepay-mini-cart,.widget_shopping_cart_content a.wc-stripe-gpay-mini-cart,.widget_shopping_cart_content a.wc-stripe-payment-request-mini-cart{background:0 0;padding:0;border:none}a.wc-stripe-gpay-mini-cart .gpay-button,a.wc-stripe-gpay-mini-cart .gpay-card-info-container a.wc-stripe-applepay-mini-cart .apple-pay-button{width:100%;margin:0}.wc-stripe-payment-request-mini-cart.StripeElement{padding:0;background:0 0;border:none;width:100%}.wc-stripe-payment-request-mini-cart.StripeElement .__PrivateStripeElement{width:100%}.wc-stripe-minicart-overlay{display:none!important;position:absolute;background:rgba(255,255,255,.75);height:100%;width:100%;z-index:-1;top:0;right:0}.wc-stripe-minicart-overlay.active{display:block!important;z-index:9999}.wc-stripe-klarna-loader{display:flex;justify-content:center;position:relative;width:100%;height:30px;box-sizing:border-box;transform:scale(.65)}.wc-stripe-klarna-loader div{box-sizing:border-box;display:block;position:absolute;box-sizing:border-box;width:30px;height:30px;border:3px solid #000;border-radius:50%;animation:klarna-payments-loader 1.3s cubic-bezier(.5,0,.5,1) infinite;border-color:#000 transparent transparent transparent}.wc-stripe-klarna-loader div:nth-child(1){animation-delay:-.45s}.wc-stripe-klarna-loader div:nth-child(2){animation-delay:-.3s}.wc-stripe-klarna-loader div:nth-child(3){animation-delay:-.15s}@keyframes klarna-payments-loader{0%{transform:rotate(0)}100%{transform:rotate(-360deg)}}li.payment_method_stripe_alipay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_applepay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_bancontact.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_eps.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_giropay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_googlepay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_grabpay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_multibanco.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_oxxo.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_p24.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_payment_request.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_sofort.wc-stripe-no-desc .payment_box.wc-stripe-no-methods{padding:0;margin:0}.wc-stripe-shortcode-cart-buttons .wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods.active li.wc-stripe-payment-method.or{display:none}label[for=payment_method_stripe_afterpay]>#wc-stripe-afterpay-msg{display:inline-block}#wc-stripe-afterpay-cart-container #wc-stripe-afterpay-cart-msg .__PrivateStripeElement p,#wc-stripe-afterpay-product-msg .__PrivateStripeElement p,.payment_method_stripe_afterpay #wc-stripe-afterpay-msg .__PrivateStripeElement p{margin-bottom:0!important;margin-top:0!important}#wc-stripe-afterpay-cart-msg .__PrivateStripeElement p .AfterpayMessage-logo,.payment_method_stripe_afterpay #wc-stripe-afterpay-msg .__PrivateStripeElement p .AfterpayMessage-logo{vertical-align:middle}.payment_method_stripe_afterpay #wc_stripe_local_payment_stripe_afterpay.ineligible{display:none}.payment_method_stripe_afterpay .wc-stripe-afterpay__offsite{text-align:center;max-width:320px;margin:0 auto;padding:10px 0}.payment_method_stripe_afterpay .wc-stripe-afterpay__offsite img{display:inline-block}.payment_method_stripe_afterpay .wc-stripe-afterpay__offsite p{font-size:14px;margin-top:10px}#wc-stripe-afterpay-cart-container #wc-stripe-afterpay-cart-msg{text-align:right}#wc-stripe-afterpay-cart-container #wc-stripe-afterpay-cart-msg .AfterpayMessage-logoSvg,.payment_method_stripe_afterpay #wc-stripe-afterpay-msg .AfterpayMessage-logoSvg{min-width:64px;max-width:90px}#wc-stripe-afterpay-cart-container td{border:none}#wc-stripe-afterpay-cart-container td::before{content:''}.AfterpayMessage-logoSvg{display:inline-block}#wc-stripe-afterpay-product-msg{font-size:14px}#wc-stripe-afterpay-product-msg .AfterpayMessage-logoSvg{max-width:80px;min-width:64px}.wc-stripe-afterpay-minicart-msg{font-size:.8em}.afterpay-ineligible,.payment_method_stripe_afterpay.afterpay-ineligible{display:none}.woocommerce-mini-cart__buttons .gpay-card-info-container{min-width:100%}.woocommerce-mini-cart__buttons .gpay-card-info-container{margin:0}.wc-stripe-boleto__description{margin-top:10px}.wc-stripe-boleto__description div{display:flex;align-items:center}.wc-stripe-boleto__description div label{margin:0}.wc-stripe-klarna__testmode{margin-top:10px}.wc-stripe-klarna__testmode label{display:inline-block}div.payment_method_stripe_cc>.woocommerce-NoticeGroup{margin-bottom:10px}div.payment_method_stripe_cc.custom-form__bootstrap>.woocommerce-NoticeGroup{margin-bottom:20px}.wc-stripe-installment-container{margin-top:15px}.wc-stripe-installment-container p{margin:0}.wc-stripe-installment-container label.installment-label{font-weight:500;margin:0 0 5px 0;position:relative;display:flex;align-items:center}.wc-stripe-installment-container .wc-stripe-installment-options.loading-installments{opacity:.4}.wc-stripe-installment-loader__container{flex:1 1 auto}.wc-stripe-installment-loader__container .wc-stripe-installment-loader{transform:scale(.55);width:30px;height:30px;position:absolute;top:-2px}.wc-stripe-installment-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:installment-loader 1.3s cubic-bezier(.5,0,.5,1) infinite;border-color:#000 transparent transparent transparent}.wc-stripe-installment-loader div:nth-child(1){animation-delay:-.45s}.wc-stripe-installment-loader div:nth-child(2){animation-delay:-.3s}.wc-stripe-installment-loader div:nth-child(3){animation-delay:-.15s}@keyframes installment-loader{0%{transform:rotate(0)}100%{transform:rotate(-360deg)}}
1
+ .wc-stripe-card-icons-container,.wc-stripe-paymentRequest-icons-container{float:left;display:inline-block}ul.payment_methods li[class*=payment_method]{margin:0;padding:0}li[class*=payment_method] input[type=radio]{margin:0 5px 0 10px}li[class*=payment_method] input[type=radio]+label:not(.wc-stripe-label-payment-type){margin:0}.woocommerce-checkout #payment ul.payment_methods li[class*=payment_method_stripe_]:nth-child(n+2),ul.payment_methods li[class*=payment_method_stripe_]:nth-child(n+2){margin:0}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon{max-width:43px;max-height:26px;width:43px;height:26px;float:none;display:inline}li.payment_method_stripe_payment_request .wc-stripe-paymentRequest-icons-container img:not(.gpay){width:25px;height:25px;max-width:25px;max-height:25px}ul.payment_methods label[for*=payment_method_stripe]:after{clear:left;content:"";display:block}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon:nth-child(2n+2){margin:0 2px}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon.open.visa{padding-top:2px}ul.payment_methods li[class*=payment_method_stripe_] label>img:first-of-type{float:left!important}.wc-stripe_cc-new-method-container{margin-bottom:1em}.wc-stripe_cc-container .StripeElement{box-sizing:border-box;height:40px;padding:10px 12px;border-radius:4px;background-color:#fff;-webkit-transition:box-shadow 150ms ease;transition:box-shadow 150ms ease}input.wc-stripe-klarna-category,input.wc-stripe-payment-type{display:none!important}body .wfacp_main_form.woocommerce .wc-stripe-save-source label.checkbox{padding:0!important}input[type=radio]+label.wc-stripe-label-payment-type,label.wc-stripe-label-klarna-category,label.wc-stripe-label-payment-type{margin-bottom:1em;display:block;padding:0!important;color:#000}.theme-flatsome div.wc-stripe-saved-methods-container{margin:0 0 1em 0}label.wc-stripe-label-klarna-category:before,label.wc-stripe-label-payment-type:before{content:"";display:inline-block;width:11px;height:11px;border:2px solid #fff;box-shadow:0 0 0 2px #000;background:#fff;margin-right:4px;margin-left:.5em;border-radius:100%;-webkit-transform:translateY(2px);-ms-transform:translateY(2px);transform:translateY(2px)}input.wc-stripe-klarna-category:checked+label.wc-stripe-label-klarna-category:before,input.wc-stripe-payment-type:checked+label.wc-stripe-label-payment-type:before{background:#000}label.wc-stripe-label-payment-type:after{content:none!important;display:none!important}.wc-stripe-saved-methods-container .select2-container .select2-selection--single .select2-selection__rendered{padding-right:8px}.select2-results__options li.wc-stripe-select2-container,.wc-stripe-saved-methods-container .select2-container .select2-selection--single .wc-stripe-select2-container{display:flex;align-items:center;height:42px;line-height:42px!important}.select2-container .select2-selection--single .wc-stripe-select2-container:before,.select2-results__options li.wc-stripe-select2-container:before{content:'';background-repeat:no-repeat;background-size:40px 24px;width:40px;height:42px;display:inline-block;margin-left:8px;background-position:center}.select2-container .select2-selection--single .wc-stripe-select2-container.visa:before,.select2-results__options li.wc-stripe-select2-container.visa:before{background-image:url(../img/cards/visa.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.mastercard:before,.select2-results__options li.wc-stripe-select2-container.mastercard:before{background-image:url(../img/cards/mastercard.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.americanexpress:before,.select2-results__options li.wc-stripe-select2-container.americanexpress:before{background-image:url(../img/cards/amex.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.amex:before,.select2-results__options li.wc-stripe-select2-container.amex:before{background-image:url(../img/cards/amex.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.discover:before,.select2-results__options li.wc-stripe-select2-container.discover:before{background-image:url(../img/cards/discover.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.mastercard:before,.select2-results__options li.wc-stripe-select2-container.mastercard:before{background-image:url(../img/cards/mastercard.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.dinersclub:before,.select2-results__options li.wc-stripe-select2-container.dinersclub:before{background-image:url(../img/cards/diners.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.diners:before,.select2-results__options li.wc-stripe-select2-container.diners:before{background-image:url(../img/cards/diners.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.jcb:before,.select2-results__options li.wc-stripe-select2-container.jcb:before{background-image:url(../img/cards/jcb.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.stripe_sepa:before,.select2-results__options li.wc-stripe-select2-container.stripe_sepa:before{background-image:url(../img/sepa.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.stripe_becs:before,.select2-results__options li.wc-stripe-select2-container.stripe_becs:before,.select2-results__options li.wc-stripe-select2-container.wc-stripe-ach:before{display:none}#wc-stripe-card-element{margin-bottom:1em}#wc-stripe-card-element.payment-type{height:100%;padding:0}.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][name=stripe_cc_save_source_key]{opacity:0;position:absolute;width:20px;height:20px}.wc-stripe_cc-container .wc-stripe-save-source label.checkbox{position:relative}.wc-stripe_cc-container .save-source-checkbox{height:20px;width:20px;position:relative;background-color:#fff;display:block;border-radius:3px;border:1px solid #bababa}.wc-stripe_cc-container .save-source-checkbox:after{content:"";position:absolute;top:0;right:0}.wc-stripe_cc-container .wc-stripe-save-source input[type=checkbox]:checked+.save-source-checkbox:after{right:6px;top:2px;width:7px;height:12px;border:solid #2196f3;border-width:0 0 3px 3px;-webkit-transform:rotate(-45deg);-ms-transform:rotate(-45deg);transform:rotate(-45deg);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}li.payment_method_stripe_applepay,li.payment_method_stripe_googlepay,li.payment_method_stripe_payment_request{display:none}#payment #place_order.wc-stripe-hide,#place_order.wc-stripe-hide,.woocommerce-checkout-review-order #payment #place_order.wc-stripe-hide{position:absolute!important;z-index:-1000!important;height:0!important;padding:0!important;opacity:0!important}.wc-stripe-product-checkout-container{display:none;width:100%}.wc-stripe-product-checkout-container.bottom{margin-top:1em}.wc-stripe-product-checkout-container.top{margin-bottom:1em}.wc-stripe-product-checkout-container.active{display:block}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods,.wc-stripe-product-checkout-container ul.wc_stripe_product_payment_methods{list-style:none;margin:0;padding:0}.wc-stripe-cart-checkout-container{margin:0;padding:0;clear:both}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods{margin-bottom:1.5em}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods li[class*=payment_method_stripe_],.wc-stripe-product-checkout-container ul.wc_stripe_product_payment_methods li[class*=payment_method_stripe_]{margin:0 0 1em 0;list-style:none}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods li[class*=payment_method_stripe_]:last-child,.wc-stripe-product-checkout-container ul.wc_stripe_product_payment_methods li[class*=payment_method_stripe_]:last-child{margin:0}.wc_stripe_cart_payment_methods .gpay-button,.wc_stripe_cart_payment_methods .gpay-card-info-container,.wc_stripe_product_payment_methods .gpay-button,.wc_stripe_product_payment_methods .gpay-card-info-container{width:100%!important;min-width:100%;margin:0}.wc_stripe_product_payment_methods .disabled{opacity:.45}.stripe_cart_gateway_active .checkout-button,.woocommerce-cart .stripe_cart_gateway_active .wc-proceed-to-checkout .checkout-button{margin-bottom:0}.wc-stripe-cart-or{margin:1em 0;text-align:center}li.wc-stripe-payment-method.or{display:none}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods.active li.wc-stripe-payment-method.or{display:block;margin:15px 0}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods.active li.wc-stripe-payment-method.or p{margin:0}li[class*=payment_method_stripe_].active~li.wc-stripe-payment-method.or{display:block;margin:0}li.payment_method_stripe_applepay label:first-of-type img{width:49px;max-height:32px}li.payment_method_stripe_googlepay label:first-of-type img{width:48px;max-height:35px}li.payment_method_stripe_googlepay label:first-of-type img[src*=googlepay_standard],li.payment_method_stripe_payment_request label:first-of-type img[src*=googlepay_standard]{width:60px;max-height:35px}li.payment_method_stripe_googlepay label:first-of-type img[src*=googlepay_round_outline],li.payment_method_stripe_payment_request label:first-of-type img[src*=googlepay_round_outline]{width:56px;max-height:30px}li.payment_method_stripe_ach label:first-of-type img{width:32px;height:32px;min-width:32px;min-height:32px}.gpay-button-container .gpay-button:hover,.wc-stripe-checkout-banner-gateway .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}.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:0;position:relative;margin:1em 0}.wc-stripe-banner-checkout fieldset{padding:15px 25px 15px;border:1px solid #d1d1d1;margin-bottom:20px;border-radius:3px}.wc-stripe-banner-checkout fieldset legend{margin:0 auto;font-weight:500;padding:0 1rem}.wc-stripe-banner-checkout.active{display:block}.wc-stripe-banner-checkout span.banner-divider{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-divider:after,.wc-stripe-banner-checkout span.banner-divider:before{content:' ';height:1px;background:#d1d1d1;display:block;width:50%}.wc-stripe-banner-checkout span.banner-divider:before{margin-left:1rem}.wc-stripe-banner-checkout span.banner-divider:after{margin-right:1rem}.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 auto;display:none;max-width:240px}.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways li.wc-stripe-checkout-banner-gateway.active:nth-child(n+2){margin:10px auto 0 auto}.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways li.wc-stripe-checkout-banner-gateway:first-child:not(.active)+li.wc-stripe-checkout-banner-gateway.active{margin:0 auto}.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}ul.payment_methods li.payment_method_stripe_oxxo img{max-width:52px;width:52px;max-height:24px}#wc-stripe-card-element{width:100%}li.banner_payment_method_stripe_payment_request .StripeElement{padding:0}.single-product .blockMsg{border:none!important;background-color:transparent!important}#wc-stripe-card{position:absolute!important;top:50%;left:8px;transform:translatey(-50%);width:23px;height:15px;padding:0;border:none}#wc-stripe-card.active{width:32px;height:20px}input[id=stripe-postal-code]:focus{outline:0;background:0 0;border:none;box-shadow:none}div.postalCode:focus{outline:0;border:none}li[class*=payment_method_stripe] .select2-container .select2-selection--single{height:42px;padding:0 5px}li[class*=payment_method_stripe] .select2-container--default .select2-selection--single .select2-selection__arrow{height:42px;top:1px;left:1px;transform:translateY(0)}.blockUI.blockMsg{font-size:20px;white-space:nowrap}#wc-stripe-payment-request-container.disabled{opacity:.45}.wc-stripe-paymentRequest-icons-container img{float:none}.select2-container .select2-selection--single .wc-stripe-select2-container.wc-stripe-ach:before{display:none}ul.wc_stripe_cart_payment_methods li.wc-stripe-payment-method button,ul.wc_stripe_checkout_banner_gateways li button,ul.wc_stripe_product_payment_methods li[class*=payment_method_stripe_] button{margin:0}ul.payment_methods li[class*=payment_method]{margin:0;padding:10px 0}ul.payment_methods li[class*=payment_method] input[name=payment_method]{margin:0 5px 0 10px;float:none}ul.payment_methods li[class*=payment_method]>input[name=payment_method]+label{padding-top:0;padding-left:0;padding-bottom:0}ul.payment_methods{list-style:none}ul.payment_methods li[class*=payment_method_stripe_] .wc-stripe_cc-new-method-container label:before{display:none}.wc-stripe_cc-container .wc-stripe-save-source label.checkbox{padding:0!important;margin:0}div[id*=wc_stripe_local_payment_stripe_].StripeElement{border:1px solid #eee;border-radius:4px}#payment .payment_methods li #wc_stripe_local_payment_stripe_wechat img,#wc_stripe_local_payment_stripe_wechat img{max-height:100%;float:none}.qrcode-message{margin:10px 0 0 0}#wc_stripe_local_payment_stripe_becs,#wc_stripe_local_payment_stripe_sepa{padding:10px 12px;box-shadow:0 1px 3px 0 #e6ebf1}.wc-stripe-local-desc.stripe_becs,.wc-stripe-local-desc.stripe_sepa{margin:10px 0}.wc-stripe-clear{clear:both;height:0;visibility:hidden}.wc-stripe-gateway-desc p{margin:0}#wc_stripe_local_payment_stripe_klarna,li[class*=payment_method_stripe_] div.wc-stripe-gateway-container.has_tokens{margin-top:10px}.wc-stripe-gateway-desc{margin-top:10px}#wc-stripe-card-element.StripeElement--webkit-autofill{background-color:transparent!important}#wc_stripe_local_payment_stripe_klarna .stripe-klarna-categories{list-style:none;margin:0;padding:10px}li.payment_method_stripe_alipay,li.payment_method_stripe_bancontact,li.payment_method_stripe_becs,li.payment_method_stripe_eps,li.payment_method_stripe_fpx,li.payment_method_stripe_giropay,li.payment_method_stripe_ideal,li.payment_method_stripe_klarna,li.payment_method_stripe_multibanco,li.payment_method_stripe_p24,li.payment_method_stripe_sepa,li.payment_method_stripe_sofort,li.payment_method_stripe_wechat{display:none}.widget_shopping_cart_content .wc-stripe-mini-cart-payment-methods{list-style:none;margin:0;padding:0}.widget_shopping_cart_content .wc-stripe-mini-cart-payment-methods li{margin:0}.widget_shopping_cart_content a.wc-stripe-applepay-mini-cart,.widget_shopping_cart_content a.wc-stripe-gpay-mini-cart,.widget_shopping_cart_content a.wc-stripe-payment-request-mini-cart{background:0 0;padding:0;border:none}a.wc-stripe-gpay-mini-cart .gpay-button,a.wc-stripe-gpay-mini-cart .gpay-card-info-container a.wc-stripe-applepay-mini-cart .apple-pay-button{width:100%;margin:0}.wc-stripe-payment-request-mini-cart.StripeElement{padding:0;background:0 0;border:none;width:100%}.wc-stripe-payment-request-mini-cart.StripeElement .__PrivateStripeElement{width:100%}.wc-stripe-minicart-overlay{display:none!important;position:absolute;background:rgba(255,255,255,.75);height:100%;width:100%;z-index:-1;top:0;right:0}.wc-stripe-minicart-overlay.active{display:block!important;z-index:9999}.wc-stripe-klarna-loader{display:flex;justify-content:center;position:relative;width:100%;height:30px;box-sizing:border-box;transform:scale(.65)}.wc-stripe-klarna-loader div{box-sizing:border-box;display:block;position:absolute;box-sizing:border-box;width:30px;height:30px;border:3px solid #000;border-radius:50%;animation:klarna-payments-loader 1.3s cubic-bezier(.5,0,.5,1) infinite;border-color:#000 transparent transparent transparent}.wc-stripe-klarna-loader div:nth-child(1){animation-delay:-.45s}.wc-stripe-klarna-loader div:nth-child(2){animation-delay:-.3s}.wc-stripe-klarna-loader div:nth-child(3){animation-delay:-.15s}@keyframes klarna-payments-loader{0%{transform:rotate(0)}100%{transform:rotate(-360deg)}}li.payment_method_stripe_alipay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_applepay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_bancontact.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_eps.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_giropay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_googlepay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_grabpay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_multibanco.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_oxxo.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_p24.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_payment_request.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_sofort.wc-stripe-no-desc .payment_box.wc-stripe-no-methods{padding:0;margin:0}.wc-stripe-shortcode-cart-buttons .wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods.active li.wc-stripe-payment-method.or{display:none}label[for=payment_method_stripe_afterpay]>#wc-stripe-afterpay-msg{display:inline-block}#wc-stripe-afterpay-cart-container #wc-stripe-afterpay-cart-msg .__PrivateStripeElement p,#wc-stripe-afterpay-product-msg .__PrivateStripeElement p,.payment_method_stripe_afterpay #wc-stripe-afterpay-msg .__PrivateStripeElement p{margin-bottom:0!important;margin-top:0!important}#wc-stripe-afterpay-cart-msg .__PrivateStripeElement p .AfterpayMessage-logo,.payment_method_stripe_afterpay #wc-stripe-afterpay-msg .__PrivateStripeElement p .AfterpayMessage-logo{vertical-align:middle}.payment_method_stripe_afterpay #wc_stripe_local_payment_stripe_afterpay.ineligible{display:none}.payment_method_stripe_afterpay .wc-stripe-afterpay__offsite{text-align:center;max-width:320px;margin:0 auto;padding:10px 0}.payment_method_stripe_afterpay .wc-stripe-afterpay__offsite img{display:inline-block}.payment_method_stripe_afterpay .wc-stripe-afterpay__offsite p{font-size:14px;margin-top:10px}#wc-stripe-afterpay-cart-container #wc-stripe-afterpay-cart-msg{text-align:right}#wc-stripe-afterpay-cart-container #wc-stripe-afterpay-cart-msg .AfterpayMessage-logoSvg,.payment_method_stripe_afterpay #wc-stripe-afterpay-msg .AfterpayMessage-logoSvg{min-width:64px;max-width:90px}#wc-stripe-afterpay-cart-container td{border:none}#wc-stripe-afterpay-cart-container td::before{content:''}.AfterpayMessage-logoSvg{display:inline-block}#wc-stripe-afterpay-product-msg{font-size:14px}#wc-stripe-afterpay-product-msg .AfterpayMessage-logoSvg{max-width:80px;min-width:64px}.wc-stripe-afterpay-minicart-msg{font-size:.8em}.afterpay-ineligible,.payment_method_stripe_afterpay.afterpay-ineligible{display:none}.woocommerce-mini-cart__buttons .gpay-card-info-container{min-width:100%}.woocommerce-mini-cart__buttons .gpay-card-info-container{margin:0}.wc-stripe-boleto__description{margin-top:10px}.wc-stripe-boleto__description div{display:flex;align-items:center}.wc-stripe-boleto__description div label{margin:0}.wc-stripe-klarna__testmode{margin-top:10px}.wc-stripe-klarna__testmode label{display:inline-block}div.payment_method_stripe_cc>.woocommerce-NoticeGroup{margin-bottom:10px}div.payment_method_stripe_cc.custom-form__bootstrap>.woocommerce-NoticeGroup{margin-bottom:20px}.wc-stripe-installment-container{margin-top:15px}.wc-stripe-installment-container p{margin:0}.wc-stripe-installment-container label.installment-label{font-weight:500;margin:0 0 5px 0;position:relative;display:flex;align-items:center}.wc-stripe-installment-container .wc-stripe-installment-options.loading-installments{opacity:.4}.wc-stripe-installment-loader__container{flex:1 1 auto}.wc-stripe-installment-loader__container .wc-stripe-installment-loader{transform:scale(.55);width:30px;height:30px;position:absolute;top:-2px}.wc-stripe-installment-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:installment-loader 1.3s cubic-bezier(.5,0,.5,1) infinite;border-color:#000 transparent transparent transparent}.wc-stripe-installment-loader div:nth-child(1){animation-delay:-.45s}.wc-stripe-installment-loader div:nth-child(2){animation-delay:-.3s}.wc-stripe-installment-loader div:nth-child(3){animation-delay:-.15s}@keyframes installment-loader{0%{transform:rotate(0)}100%{transform:rotate(-360deg)}}
assets/css/stripe.min.css CHANGED
@@ -1 +1 @@
1
- .wc-stripe-card-icons-container,.wc-stripe-paymentRequest-icons-container{float:right;display:inline-block}ul.payment_methods li[class*=payment_method]{margin:0;padding:0}li[class*=payment_method] input[type=radio]{margin:0 10px 0 5px}li[class*=payment_method] input[type=radio]+label:not(.wc-stripe-label-payment-type){margin:0}.woocommerce-checkout #payment ul.payment_methods li[class*=payment_method_stripe_]:nth-child(n+2),ul.payment_methods li[class*=payment_method_stripe_]:nth-child(n+2){margin:0}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon{max-width:43px;max-height:26px;width:43px;height:26px;float:none;display:inline}li.payment_method_stripe_payment_request .wc-stripe-paymentRequest-icons-container img:not(.gpay){width:25px;height:25px;max-width:25px;max-height:25px}ul.payment_methods label[for*=payment_method_stripe]:after{clear:right;content:"";display:block}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon:nth-child(2n+2){margin:0 2px}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon.open.visa{padding-top:2px}ul.payment_methods li[class*=payment_method_stripe_] label>img:first-of-type{float:right!important}.wc-stripe_cc-new-method-container{margin-bottom:1em}.wc-stripe_cc-container .StripeElement{box-sizing:border-box;height:40px;padding:10px 12px;border-radius:4px;background-color:#fff;-webkit-transition:box-shadow 150ms ease;transition:box-shadow 150ms ease}input.wc-stripe-klarna-category,input.wc-stripe-payment-type{display:none!important}body .wfacp_main_form.woocommerce .wc-stripe-save-source label.checkbox{padding:0!important}input[type=radio]+label.wc-stripe-label-payment-type,label.wc-stripe-label-klarna-category,label.wc-stripe-label-payment-type{margin-bottom:1em;display:block;padding:0!important;color:#000}.theme-flatsome div.wc-stripe-saved-methods-container{margin:0 0 1em 0}label.wc-stripe-label-klarna-category:before,label.wc-stripe-label-payment-type:before{content:"";display:inline-block;width:11px;height:11px;border:2px solid #fff;box-shadow:0 0 0 2px #000;background:#fff;margin-left:4px;margin-right:.5em;border-radius:100%;-webkit-transform:translateY(2px);-ms-transform:translateY(2px);transform:translateY(2px)}input.wc-stripe-klarna-category:checked+label.wc-stripe-label-klarna-category:before,input.wc-stripe-payment-type:checked+label.wc-stripe-label-payment-type:before{background:#000}label.wc-stripe-label-payment-type:after{content:none!important;display:none!important}.wc-stripe-saved-methods-container .select2-container .select2-selection--single .select2-selection__rendered{padding-left:8px}.select2-results__options li.wc-stripe-select2-container,.wc-stripe-saved-methods-container .select2-container .select2-selection--single .wc-stripe-select2-container{display:flex;align-items:center;height:42px;line-height:42px!important}.select2-container .select2-selection--single .wc-stripe-select2-container:before,.select2-results__options li.wc-stripe-select2-container:before{content:'';background-repeat:no-repeat;background-size:40px 24px;width:40px;height:42px;display:inline-block;margin-right:8px;background-position:center}.select2-container .select2-selection--single .wc-stripe-select2-container.visa:before,.select2-results__options li.wc-stripe-select2-container.visa:before{background-image:url(../img/cards/visa.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.mastercard:before,.select2-results__options li.wc-stripe-select2-container.mastercard:before{background-image:url(../img/cards/mastercard.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.americanexpress:before,.select2-results__options li.wc-stripe-select2-container.americanexpress:before{background-image:url(../img/cards/amex.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.amex:before,.select2-results__options li.wc-stripe-select2-container.amex:before{background-image:url(../img/cards/amex.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.discover:before,.select2-results__options li.wc-stripe-select2-container.discover:before{background-image:url(../img/cards/discover.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.mastercard:before,.select2-results__options li.wc-stripe-select2-container.mastercard:before{background-image:url(../img/cards/mastercard.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.dinersclub:before,.select2-results__options li.wc-stripe-select2-container.dinersclub:before{background-image:url(../img/cards/diners.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.diners:before,.select2-results__options li.wc-stripe-select2-container.diners:before{background-image:url(../img/cards/diners.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.jcb:before,.select2-results__options li.wc-stripe-select2-container.jcb:before{background-image:url(../img/cards/jcb.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.stripe_sepa:before,.select2-results__options li.wc-stripe-select2-container.stripe_sepa:before{background-image:url(../img/sepa.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.stripe_becs:before,.select2-results__options li.wc-stripe-select2-container.stripe_becs:before,.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][name=stripe_cc_save_source_key]{opacity:0;position:absolute;width:20px;height:20px}.wc-stripe_cc-container .wc-stripe-save-source label.checkbox{position:relative}.wc-stripe_cc-container .save-source-checkbox{height:20px;width:20px;position:relative;background-color:#fff;display:block;border-radius:3px;border:1px solid #bababa}.wc-stripe_cc-container .save-source-checkbox:after{content:"";position:absolute;top:0;left:0}.wc-stripe_cc-container .wc-stripe-save-source input[type=checkbox]:checked+.save-source-checkbox:after{left:6px;top:2px;width:7px;height:12px;border:solid #2196f3;border-width:0 3px 3px 0;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}li.payment_method_stripe_applepay,li.payment_method_stripe_googlepay,li.payment_method_stripe_payment_request{display:none}#payment #place_order.wc-stripe-hide,#place_order.wc-stripe-hide,.woocommerce-checkout-review-order #payment #place_order.wc-stripe-hide{position:absolute!important;z-index:-1000!important;height:0!important;padding:0!important;opacity:0!important}.wc-stripe-product-checkout-container{display:none;width:100%}.wc-stripe-product-checkout-container.bottom{margin-top:1em}.wc-stripe-product-checkout-container.top{margin-bottom:1em}.wc-stripe-product-checkout-container.active{display:block}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods,.wc-stripe-product-checkout-container ul.wc_stripe_product_payment_methods{list-style:none;margin:0;padding:0}.wc-stripe-cart-checkout-container{margin:0;padding:0;clear:both}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods{margin-bottom:1.5em}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods li[class*=payment_method_stripe_],.wc-stripe-product-checkout-container ul.wc_stripe_product_payment_methods li[class*=payment_method_stripe_]{margin:0 0 1em 0;list-style:none}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods li[class*=payment_method_stripe_]:last-child,.wc-stripe-product-checkout-container ul.wc_stripe_product_payment_methods li[class*=payment_method_stripe_]:last-child{margin:0}.wc_stripe_cart_payment_methods .gpay-button,.wc_stripe_cart_payment_methods .gpay-card-info-container,.wc_stripe_product_payment_methods .gpay-button,.wc_stripe_product_payment_methods .gpay-card-info-container{width:100%!important;min-width:100%;margin:0}.wc_stripe_product_payment_methods .disabled{opacity:.45}.stripe_cart_gateway_active .checkout-button,.woocommerce-cart .stripe_cart_gateway_active .wc-proceed-to-checkout .checkout-button{margin-bottom:0}.wc-stripe-cart-or{margin:1em 0;text-align:center}li.wc-stripe-payment-method.or{display:none}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods.active li.wc-stripe-payment-method.or{display:block;margin:15px 0}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods.active li.wc-stripe-payment-method.or p{margin:0}li[class*=payment_method_stripe_].active~li.wc-stripe-payment-method.or{display:block;margin:0}li.payment_method_stripe_applepay label:first-of-type img{width:49px;max-height:32px}li.payment_method_stripe_googlepay label:first-of-type img{width:48px;max-height:35px}li.payment_method_stripe_googlepay label:first-of-type img[src*=googlepay_standard],li.payment_method_stripe_payment_request label:first-of-type img[src*=googlepay_standard]{width:60px;max-height:35px}li.payment_method_stripe_googlepay label:first-of-type img[src*=googlepay_round_outline],li.payment_method_stripe_payment_request label:first-of-type img[src*=googlepay_round_outline]{width:56px;max-height:30px}li.payment_method_stripe_ach label:first-of-type img{width:32px;height:32px;min-width:32px;min-height:32px}.gpay-button-container .gpay-button:hover,.wc-stripe-checkout-banner-gateway .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}.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:0;position:relative;margin:1em 0}.wc-stripe-banner-checkout fieldset{padding:15px 25px 15px;border:1px solid #d1d1d1;margin-bottom:20px;border-radius:3px}.wc-stripe-banner-checkout fieldset legend{margin:0 auto;font-weight:500;padding:0 1rem}.wc-stripe-banner-checkout.active{display:block}.wc-stripe-banner-checkout span.banner-divider{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-divider:after,.wc-stripe-banner-checkout span.banner-divider:before{content:' ';height:1px;background:#d1d1d1;display:block;width:50%}.wc-stripe-banner-checkout span.banner-divider:before{margin-right:1rem}.wc-stripe-banner-checkout span.banner-divider:after{margin-left:1rem}.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 auto;display:none;max-width:240px}.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways li.wc-stripe-checkout-banner-gateway.active:nth-child(n+2){margin:10px auto 0 auto}.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways li.wc-stripe-checkout-banner-gateway:first-child:not(.active)+li.wc-stripe-checkout-banner-gateway.active{margin:0 auto}.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}ul.payment_methods li.payment_method_stripe_oxxo img{max-width:52px;width:52px;max-height:24px}#wc-stripe-card-element{width:100%}li.banner_payment_method_stripe_payment_request .StripeElement{padding:0}.single-product .blockMsg{border:none!important;background-color:transparent!important}#wc-stripe-card{position:absolute!important;top:50%;right:8px;transform:translatey(-50%);width:23px;height:15px;padding:0;border:none}#wc-stripe-card.active{width:32px;height:20px}input[id=stripe-postal-code]:focus{outline:0;background:0 0;border:none;box-shadow:none}div.postalCode:focus{outline:0;border:none}li[class*=payment_method_stripe] .select2-container .select2-selection--single{height:42px;padding:0 5px}li[class*=payment_method_stripe] .select2-container--default .select2-selection--single .select2-selection__arrow{height:42px;top:1px;right:1px;transform:translateY(0)}.blockUI.blockMsg{font-size:20px;white-space:nowrap}#wc-stripe-payment-request-container.disabled{opacity:.45}.wc-stripe-paymentRequest-icons-container img{float:none}.select2-container .select2-selection--single .wc-stripe-select2-container.wc-stripe-ach:before{display:none}ul.wc_stripe_cart_payment_methods li.wc-stripe-payment-method button,ul.wc_stripe_checkout_banner_gateways li button,ul.wc_stripe_product_payment_methods li[class*=payment_method_stripe_] button{margin:0}ul.payment_methods li[class*=payment_method]{margin:0;padding:10px 0}ul.payment_methods li[class*=payment_method] input[name=payment_method]{margin:0 10px 0 5px;float:none}ul.payment_methods li[class*=payment_method]>input[name=payment_method]+label{padding-top:0;padding-right:0;padding-bottom:0}ul.payment_methods{list-style:none}ul.payment_methods li[class*=payment_method_stripe_] .wc-stripe_cc-new-method-container label:before{display:none}.wc-stripe_cc-container .wc-stripe-save-source label.checkbox{padding:0!important;margin:0}div[id*=wc_stripe_local_payment_stripe_].StripeElement{border:1px solid #eee;border-radius:4px}#payment .payment_methods li #wc_stripe_local_payment_stripe_wechat img,#wc_stripe_local_payment_stripe_wechat img{max-height:100%;float:none}.qrcode-message{margin:10px 0 0 0}#wc_stripe_local_payment_stripe_becs,#wc_stripe_local_payment_stripe_sepa{padding:10px 12px;box-shadow:0 1px 3px 0 #e6ebf1}.wc-stripe-local-desc.stripe_becs,.wc-stripe-local-desc.stripe_sepa{margin:10px 0}.wc-stripe-clear{clear:both;height:0;visibility:hidden}.wc-stripe-gateway-desc p{margin:0}#wc_stripe_local_payment_stripe_klarna,li[class*=payment_method_stripe_] div.wc-stripe-gateway-container.has_tokens{margin-top:10px}.wc-stripe-gateway-desc{margin-top:10px}#wc-stripe-card-element.StripeElement--webkit-autofill{background-color:transparent!important}#wc_stripe_local_payment_stripe_klarna .stripe-klarna-categories{list-style:none;margin:0;padding:10px}li.payment_method_stripe_alipay,li.payment_method_stripe_bancontact,li.payment_method_stripe_becs,li.payment_method_stripe_eps,li.payment_method_stripe_fpx,li.payment_method_stripe_giropay,li.payment_method_stripe_ideal,li.payment_method_stripe_klarna,li.payment_method_stripe_multibanco,li.payment_method_stripe_p24,li.payment_method_stripe_sepa,li.payment_method_stripe_sofort,li.payment_method_stripe_wechat{display:none}.widget_shopping_cart_content .wc-stripe-mini-cart-payment-methods{list-style:none;margin:0;padding:0}.widget_shopping_cart_content .wc-stripe-mini-cart-payment-methods li{margin:0}.widget_shopping_cart_content a.wc-stripe-applepay-mini-cart,.widget_shopping_cart_content a.wc-stripe-gpay-mini-cart,.widget_shopping_cart_content a.wc-stripe-payment-request-mini-cart{background:0 0;padding:0;border:none}a.wc-stripe-gpay-mini-cart .gpay-button,a.wc-stripe-gpay-mini-cart .gpay-card-info-container a.wc-stripe-applepay-mini-cart .apple-pay-button{width:100%;margin:0}.wc-stripe-payment-request-mini-cart.StripeElement{padding:0;background:0 0;border:none;width:100%}.wc-stripe-payment-request-mini-cart.StripeElement .__PrivateStripeElement{width:100%}.wc-stripe-minicart-overlay{display:none!important;position:absolute;background:rgba(255,255,255,.75);height:100%;width:100%;z-index:-1;top:0;left:0}.wc-stripe-minicart-overlay.active{display:block!important;z-index:9999}.wc-stripe-klarna-loader{display:flex;justify-content:center;position:relative;width:100%;height:30px;box-sizing:border-box;transform:scale(.65)}.wc-stripe-klarna-loader div{box-sizing:border-box;display:block;position:absolute;box-sizing:border-box;width:30px;height:30px;border:3px solid #000;border-radius:50%;animation:klarna-payments-loader 1.3s cubic-bezier(.5,0,.5,1) infinite;border-color:#000 transparent transparent transparent}.wc-stripe-klarna-loader div:nth-child(1){animation-delay:-.45s}.wc-stripe-klarna-loader div:nth-child(2){animation-delay:-.3s}.wc-stripe-klarna-loader div:nth-child(3){animation-delay:-.15s}@keyframes klarna-payments-loader{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}li.payment_method_stripe_alipay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_applepay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_bancontact.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_eps.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_giropay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_googlepay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_grabpay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_multibanco.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_oxxo.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_p24.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_payment_request.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_sofort.wc-stripe-no-desc .payment_box.wc-stripe-no-methods{padding:0;margin:0}.wc-stripe-shortcode-cart-buttons .wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods.active li.wc-stripe-payment-method.or{display:none}label[for=payment_method_stripe_afterpay]>#wc-stripe-afterpay-msg{display:inline-block}#wc-stripe-afterpay-cart-container #wc-stripe-afterpay-cart-msg .__PrivateStripeElement p,#wc-stripe-afterpay-product-msg .__PrivateStripeElement p,.payment_method_stripe_afterpay #wc-stripe-afterpay-msg .__PrivateStripeElement p{margin-bottom:0!important;margin-top:0!important}#wc-stripe-afterpay-cart-msg .__PrivateStripeElement p .AfterpayMessage-logo,.payment_method_stripe_afterpay #wc-stripe-afterpay-msg .__PrivateStripeElement p .AfterpayMessage-logo{vertical-align:middle}.payment_method_stripe_afterpay #wc_stripe_local_payment_stripe_afterpay.ineligible{display:none}.payment_method_stripe_afterpay .wc-stripe-afterpay__offsite{text-align:center;max-width:320px;margin:0 auto;padding:10px 0}.payment_method_stripe_afterpay .wc-stripe-afterpay__offsite img{display:inline-block}.payment_method_stripe_afterpay .wc-stripe-afterpay__offsite p{font-size:14px;margin-top:10px}#wc-stripe-afterpay-cart-container #wc-stripe-afterpay-cart-msg{text-align:left}#wc-stripe-afterpay-cart-container #wc-stripe-afterpay-cart-msg .AfterpayMessage-logoSvg,.payment_method_stripe_afterpay #wc-stripe-afterpay-msg .AfterpayMessage-logoSvg{min-width:64px;max-width:90px}#wc-stripe-afterpay-cart-container td{border:none}#wc-stripe-afterpay-cart-container td::before{content:''}.AfterpayMessage-logoSvg{display:inline-block}#wc-stripe-afterpay-product-msg{font-size:14px}#wc-stripe-afterpay-product-msg .AfterpayMessage-logoSvg{max-width:80px;min-width:64px}.wc-stripe-afterpay-minicart-msg{font-size:.8em}.afterpay-ineligible,.payment_method_stripe_afterpay.afterpay-ineligible{display:none}.woocommerce-mini-cart__buttons .gpay-card-info-container{min-width:100%}.woocommerce-mini-cart__buttons .gpay-card-info-container{margin:0}.wc-stripe-boleto__description{margin-top:10px}.wc-stripe-boleto__description div{display:flex;align-items:center}.wc-stripe-boleto__description div label{margin:0}.wc-stripe-klarna__testmode{margin-top:10px}.wc-stripe-klarna__testmode label{display:inline-block}div.payment_method_stripe_cc>.woocommerce-NoticeGroup{margin-bottom:10px}div.payment_method_stripe_cc.custom-form__bootstrap>.woocommerce-NoticeGroup{margin-bottom:20px}.wc-stripe-installment-container{margin-top:15px}.wc-stripe-installment-container p{margin:0}.wc-stripe-installment-container label.installment-label{font-weight:500;margin:0 0 5px 0;position:relative;display:flex;align-items:center}.wc-stripe-installment-container .wc-stripe-installment-options.loading-installments{opacity:.4}.wc-stripe-installment-loader__container{flex:1 1 auto}.wc-stripe-installment-loader__container .wc-stripe-installment-loader{transform:scale(.55);width:30px;height:30px;position:absolute;top:-2px}.wc-stripe-installment-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:installment-loader 1.3s cubic-bezier(.5,0,.5,1) infinite;border-color:#000 transparent transparent transparent}.wc-stripe-installment-loader div:nth-child(1){animation-delay:-.45s}.wc-stripe-installment-loader div:nth-child(2){animation-delay:-.3s}.wc-stripe-installment-loader div:nth-child(3){animation-delay:-.15s}@keyframes installment-loader{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}
1
+ .wc-stripe-card-icons-container,.wc-stripe-paymentRequest-icons-container{float:right;display:inline-block}ul.payment_methods li[class*=payment_method]{margin:0;padding:0}li[class*=payment_method] input[type=radio]{margin:0 10px 0 5px}li[class*=payment_method] input[type=radio]+label:not(.wc-stripe-label-payment-type){margin:0}.woocommerce-checkout #payment ul.payment_methods li[class*=payment_method_stripe_]:nth-child(n+2),ul.payment_methods li[class*=payment_method_stripe_]:nth-child(n+2){margin:0}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon{max-width:43px;max-height:26px;width:43px;height:26px;float:none;display:inline}li.payment_method_stripe_payment_request .wc-stripe-paymentRequest-icons-container img:not(.gpay){width:25px;height:25px;max-width:25px;max-height:25px}ul.payment_methods label[for*=payment_method_stripe]:after{clear:right;content:"";display:block}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon:nth-child(2n+2){margin:0 2px}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon.open.visa{padding-top:2px}ul.payment_methods li[class*=payment_method_stripe_] label>img:first-of-type{float:right!important}.wc-stripe_cc-new-method-container{margin-bottom:1em}.wc-stripe_cc-container .StripeElement{box-sizing:border-box;height:40px;padding:10px 12px;border-radius:4px;background-color:#fff;-webkit-transition:box-shadow 150ms ease;transition:box-shadow 150ms ease}input.wc-stripe-klarna-category,input.wc-stripe-payment-type{display:none!important}body .wfacp_main_form.woocommerce .wc-stripe-save-source label.checkbox{padding:0!important}input[type=radio]+label.wc-stripe-label-payment-type,label.wc-stripe-label-klarna-category,label.wc-stripe-label-payment-type{margin-bottom:1em;display:block;padding:0!important;color:#000}.theme-flatsome div.wc-stripe-saved-methods-container{margin:0 0 1em 0}label.wc-stripe-label-klarna-category:before,label.wc-stripe-label-payment-type:before{content:"";display:inline-block;width:11px;height:11px;border:2px solid #fff;box-shadow:0 0 0 2px #000;background:#fff;margin-left:4px;margin-right:.5em;border-radius:100%;-webkit-transform:translateY(2px);-ms-transform:translateY(2px);transform:translateY(2px)}input.wc-stripe-klarna-category:checked+label.wc-stripe-label-klarna-category:before,input.wc-stripe-payment-type:checked+label.wc-stripe-label-payment-type:before{background:#000}label.wc-stripe-label-payment-type:after{content:none!important;display:none!important}.wc-stripe-saved-methods-container .select2-container .select2-selection--single .select2-selection__rendered{padding-left:8px}.select2-results__options li.wc-stripe-select2-container,.wc-stripe-saved-methods-container .select2-container .select2-selection--single .wc-stripe-select2-container{display:flex;align-items:center;height:42px;line-height:42px!important}.select2-container .select2-selection--single .wc-stripe-select2-container:before,.select2-results__options li.wc-stripe-select2-container:before{content:'';background-repeat:no-repeat;background-size:40px 24px;width:40px;height:42px;display:inline-block;margin-right:8px;background-position:center}.select2-container .select2-selection--single .wc-stripe-select2-container.visa:before,.select2-results__options li.wc-stripe-select2-container.visa:before{background-image:url(../img/cards/visa.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.mastercard:before,.select2-results__options li.wc-stripe-select2-container.mastercard:before{background-image:url(../img/cards/mastercard.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.americanexpress:before,.select2-results__options li.wc-stripe-select2-container.americanexpress:before{background-image:url(../img/cards/amex.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.amex:before,.select2-results__options li.wc-stripe-select2-container.amex:before{background-image:url(../img/cards/amex.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.discover:before,.select2-results__options li.wc-stripe-select2-container.discover:before{background-image:url(../img/cards/discover.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.mastercard:before,.select2-results__options li.wc-stripe-select2-container.mastercard:before{background-image:url(../img/cards/mastercard.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.dinersclub:before,.select2-results__options li.wc-stripe-select2-container.dinersclub:before{background-image:url(../img/cards/diners.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.diners:before,.select2-results__options li.wc-stripe-select2-container.diners:before{background-image:url(../img/cards/diners.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.jcb:before,.select2-results__options li.wc-stripe-select2-container.jcb:before{background-image:url(../img/cards/jcb.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.stripe_sepa:before,.select2-results__options li.wc-stripe-select2-container.stripe_sepa:before{background-image:url(../img/sepa.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.stripe_becs:before,.select2-results__options li.wc-stripe-select2-container.stripe_becs:before,.select2-results__options li.wc-stripe-select2-container.wc-stripe-ach:before{display:none}#wc-stripe-card-element{margin-bottom:1em}#wc-stripe-card-element.payment-type{height:100%;padding:0}.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][name=stripe_cc_save_source_key]{opacity:0;position:absolute;width:20px;height:20px}.wc-stripe_cc-container .wc-stripe-save-source label.checkbox{position:relative}.wc-stripe_cc-container .save-source-checkbox{height:20px;width:20px;position:relative;background-color:#fff;display:block;border-radius:3px;border:1px solid #bababa}.wc-stripe_cc-container .save-source-checkbox:after{content:"";position:absolute;top:0;left:0}.wc-stripe_cc-container .wc-stripe-save-source input[type=checkbox]:checked+.save-source-checkbox:after{left:6px;top:2px;width:7px;height:12px;border:solid #2196f3;border-width:0 3px 3px 0;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}li.payment_method_stripe_applepay,li.payment_method_stripe_googlepay,li.payment_method_stripe_payment_request{display:none}#payment #place_order.wc-stripe-hide,#place_order.wc-stripe-hide,.woocommerce-checkout-review-order #payment #place_order.wc-stripe-hide{position:absolute!important;z-index:-1000!important;height:0!important;padding:0!important;opacity:0!important}.wc-stripe-product-checkout-container{display:none;width:100%}.wc-stripe-product-checkout-container.bottom{margin-top:1em}.wc-stripe-product-checkout-container.top{margin-bottom:1em}.wc-stripe-product-checkout-container.active{display:block}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods,.wc-stripe-product-checkout-container ul.wc_stripe_product_payment_methods{list-style:none;margin:0;padding:0}.wc-stripe-cart-checkout-container{margin:0;padding:0;clear:both}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods{margin-bottom:1.5em}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods li[class*=payment_method_stripe_],.wc-stripe-product-checkout-container ul.wc_stripe_product_payment_methods li[class*=payment_method_stripe_]{margin:0 0 1em 0;list-style:none}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods li[class*=payment_method_stripe_]:last-child,.wc-stripe-product-checkout-container ul.wc_stripe_product_payment_methods li[class*=payment_method_stripe_]:last-child{margin:0}.wc_stripe_cart_payment_methods .gpay-button,.wc_stripe_cart_payment_methods .gpay-card-info-container,.wc_stripe_product_payment_methods .gpay-button,.wc_stripe_product_payment_methods .gpay-card-info-container{width:100%!important;min-width:100%;margin:0}.wc_stripe_product_payment_methods .disabled{opacity:.45}.stripe_cart_gateway_active .checkout-button,.woocommerce-cart .stripe_cart_gateway_active .wc-proceed-to-checkout .checkout-button{margin-bottom:0}.wc-stripe-cart-or{margin:1em 0;text-align:center}li.wc-stripe-payment-method.or{display:none}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods.active li.wc-stripe-payment-method.or{display:block;margin:15px 0}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods.active li.wc-stripe-payment-method.or p{margin:0}li[class*=payment_method_stripe_].active~li.wc-stripe-payment-method.or{display:block;margin:0}li.payment_method_stripe_applepay label:first-of-type img{width:49px;max-height:32px}li.payment_method_stripe_googlepay label:first-of-type img{width:48px;max-height:35px}li.payment_method_stripe_googlepay label:first-of-type img[src*=googlepay_standard],li.payment_method_stripe_payment_request label:first-of-type img[src*=googlepay_standard]{width:60px;max-height:35px}li.payment_method_stripe_googlepay label:first-of-type img[src*=googlepay_round_outline],li.payment_method_stripe_payment_request label:first-of-type img[src*=googlepay_round_outline]{width:56px;max-height:30px}li.payment_method_stripe_ach label:first-of-type img{width:32px;height:32px;min-width:32px;min-height:32px}.gpay-button-container .gpay-button:hover,.wc-stripe-checkout-banner-gateway .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}.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:0;position:relative;margin:1em 0}.wc-stripe-banner-checkout fieldset{padding:15px 25px 15px;border:1px solid #d1d1d1;margin-bottom:20px;border-radius:3px}.wc-stripe-banner-checkout fieldset legend{margin:0 auto;font-weight:500;padding:0 1rem}.wc-stripe-banner-checkout.active{display:block}.wc-stripe-banner-checkout span.banner-divider{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-divider:after,.wc-stripe-banner-checkout span.banner-divider:before{content:' ';height:1px;background:#d1d1d1;display:block;width:50%}.wc-stripe-banner-checkout span.banner-divider:before{margin-right:1rem}.wc-stripe-banner-checkout span.banner-divider:after{margin-left:1rem}.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 auto;display:none;max-width:240px}.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways li.wc-stripe-checkout-banner-gateway.active:nth-child(n+2){margin:10px auto 0 auto}.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways li.wc-stripe-checkout-banner-gateway:first-child:not(.active)+li.wc-stripe-checkout-banner-gateway.active{margin:0 auto}.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}ul.payment_methods li.payment_method_stripe_oxxo img{max-width:52px;width:52px;max-height:24px}#wc-stripe-card-element{width:100%}li.banner_payment_method_stripe_payment_request .StripeElement{padding:0}.single-product .blockMsg{border:none!important;background-color:transparent!important}#wc-stripe-card{position:absolute!important;top:50%;right:8px;transform:translatey(-50%);width:23px;height:15px;padding:0;border:none}#wc-stripe-card.active{width:32px;height:20px}input[id=stripe-postal-code]:focus{outline:0;background:0 0;border:none;box-shadow:none}div.postalCode:focus{outline:0;border:none}li[class*=payment_method_stripe] .select2-container .select2-selection--single{height:42px;padding:0 5px}li[class*=payment_method_stripe] .select2-container--default .select2-selection--single .select2-selection__arrow{height:42px;top:1px;right:1px;transform:translateY(0)}.blockUI.blockMsg{font-size:20px;white-space:nowrap}#wc-stripe-payment-request-container.disabled{opacity:.45}.wc-stripe-paymentRequest-icons-container img{float:none}.select2-container .select2-selection--single .wc-stripe-select2-container.wc-stripe-ach:before{display:none}ul.wc_stripe_cart_payment_methods li.wc-stripe-payment-method button,ul.wc_stripe_checkout_banner_gateways li button,ul.wc_stripe_product_payment_methods li[class*=payment_method_stripe_] button{margin:0}ul.payment_methods li[class*=payment_method]{margin:0;padding:10px 0}ul.payment_methods li[class*=payment_method] input[name=payment_method]{margin:0 10px 0 5px;float:none}ul.payment_methods li[class*=payment_method]>input[name=payment_method]+label{padding-top:0;padding-right:0;padding-bottom:0}ul.payment_methods{list-style:none}ul.payment_methods li[class*=payment_method_stripe_] .wc-stripe_cc-new-method-container label:before{display:none}.wc-stripe_cc-container .wc-stripe-save-source label.checkbox{padding:0!important;margin:0}div[id*=wc_stripe_local_payment_stripe_].StripeElement{border:1px solid #eee;border-radius:4px}#payment .payment_methods li #wc_stripe_local_payment_stripe_wechat img,#wc_stripe_local_payment_stripe_wechat img{max-height:100%;float:none}.qrcode-message{margin:10px 0 0 0}#wc_stripe_local_payment_stripe_becs,#wc_stripe_local_payment_stripe_sepa{padding:10px 12px;box-shadow:0 1px 3px 0 #e6ebf1}.wc-stripe-local-desc.stripe_becs,.wc-stripe-local-desc.stripe_sepa{margin:10px 0}.wc-stripe-clear{clear:both;height:0;visibility:hidden}.wc-stripe-gateway-desc p{margin:0}#wc_stripe_local_payment_stripe_klarna,li[class*=payment_method_stripe_] div.wc-stripe-gateway-container.has_tokens{margin-top:10px}.wc-stripe-gateway-desc{margin-top:10px}#wc-stripe-card-element.StripeElement--webkit-autofill{background-color:transparent!important}#wc_stripe_local_payment_stripe_klarna .stripe-klarna-categories{list-style:none;margin:0;padding:10px}li.payment_method_stripe_alipay,li.payment_method_stripe_bancontact,li.payment_method_stripe_becs,li.payment_method_stripe_eps,li.payment_method_stripe_fpx,li.payment_method_stripe_giropay,li.payment_method_stripe_ideal,li.payment_method_stripe_klarna,li.payment_method_stripe_multibanco,li.payment_method_stripe_p24,li.payment_method_stripe_sepa,li.payment_method_stripe_sofort,li.payment_method_stripe_wechat{display:none}.widget_shopping_cart_content .wc-stripe-mini-cart-payment-methods{list-style:none;margin:0;padding:0}.widget_shopping_cart_content .wc-stripe-mini-cart-payment-methods li{margin:0}.widget_shopping_cart_content a.wc-stripe-applepay-mini-cart,.widget_shopping_cart_content a.wc-stripe-gpay-mini-cart,.widget_shopping_cart_content a.wc-stripe-payment-request-mini-cart{background:0 0;padding:0;border:none}a.wc-stripe-gpay-mini-cart .gpay-button,a.wc-stripe-gpay-mini-cart .gpay-card-info-container a.wc-stripe-applepay-mini-cart .apple-pay-button{width:100%;margin:0}.wc-stripe-payment-request-mini-cart.StripeElement{padding:0;background:0 0;border:none;width:100%}.wc-stripe-payment-request-mini-cart.StripeElement .__PrivateStripeElement{width:100%}.wc-stripe-minicart-overlay{display:none!important;position:absolute;background:rgba(255,255,255,.75);height:100%;width:100%;z-index:-1;top:0;left:0}.wc-stripe-minicart-overlay.active{display:block!important;z-index:9999}.wc-stripe-klarna-loader{display:flex;justify-content:center;position:relative;width:100%;height:30px;box-sizing:border-box;transform:scale(.65)}.wc-stripe-klarna-loader div{box-sizing:border-box;display:block;position:absolute;box-sizing:border-box;width:30px;height:30px;border:3px solid #000;border-radius:50%;animation:klarna-payments-loader 1.3s cubic-bezier(.5,0,.5,1) infinite;border-color:#000 transparent transparent transparent}.wc-stripe-klarna-loader div:nth-child(1){animation-delay:-.45s}.wc-stripe-klarna-loader div:nth-child(2){animation-delay:-.3s}.wc-stripe-klarna-loader div:nth-child(3){animation-delay:-.15s}@keyframes klarna-payments-loader{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}li.payment_method_stripe_alipay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_applepay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_bancontact.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_eps.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_giropay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_googlepay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_grabpay.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_multibanco.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_oxxo.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_p24.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_payment_request.wc-stripe-no-desc .payment_box.wc-stripe-no-methods,li.payment_method_stripe_sofort.wc-stripe-no-desc .payment_box.wc-stripe-no-methods{padding:0;margin:0}.wc-stripe-shortcode-cart-buttons .wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods.active li.wc-stripe-payment-method.or{display:none}label[for=payment_method_stripe_afterpay]>#wc-stripe-afterpay-msg{display:inline-block}#wc-stripe-afterpay-cart-container #wc-stripe-afterpay-cart-msg .__PrivateStripeElement p,#wc-stripe-afterpay-product-msg .__PrivateStripeElement p,.payment_method_stripe_afterpay #wc-stripe-afterpay-msg .__PrivateStripeElement p{margin-bottom:0!important;margin-top:0!important}#wc-stripe-afterpay-cart-msg .__PrivateStripeElement p .AfterpayMessage-logo,.payment_method_stripe_afterpay #wc-stripe-afterpay-msg .__PrivateStripeElement p .AfterpayMessage-logo{vertical-align:middle}.payment_method_stripe_afterpay #wc_stripe_local_payment_stripe_afterpay.ineligible{display:none}.payment_method_stripe_afterpay .wc-stripe-afterpay__offsite{text-align:center;max-width:320px;margin:0 auto;padding:10px 0}.payment_method_stripe_afterpay .wc-stripe-afterpay__offsite img{display:inline-block}.payment_method_stripe_afterpay .wc-stripe-afterpay__offsite p{font-size:14px;margin-top:10px}#wc-stripe-afterpay-cart-container #wc-stripe-afterpay-cart-msg{text-align:left}#wc-stripe-afterpay-cart-container #wc-stripe-afterpay-cart-msg .AfterpayMessage-logoSvg,.payment_method_stripe_afterpay #wc-stripe-afterpay-msg .AfterpayMessage-logoSvg{min-width:64px;max-width:90px}#wc-stripe-afterpay-cart-container td{border:none}#wc-stripe-afterpay-cart-container td::before{content:''}.AfterpayMessage-logoSvg{display:inline-block}#wc-stripe-afterpay-product-msg{font-size:14px}#wc-stripe-afterpay-product-msg .AfterpayMessage-logoSvg{max-width:80px;min-width:64px}.wc-stripe-afterpay-minicart-msg{font-size:.8em}.afterpay-ineligible,.payment_method_stripe_afterpay.afterpay-ineligible{display:none}.woocommerce-mini-cart__buttons .gpay-card-info-container{min-width:100%}.woocommerce-mini-cart__buttons .gpay-card-info-container{margin:0}.wc-stripe-boleto__description{margin-top:10px}.wc-stripe-boleto__description div{display:flex;align-items:center}.wc-stripe-boleto__description div label{margin:0}.wc-stripe-klarna__testmode{margin-top:10px}.wc-stripe-klarna__testmode label{display:inline-block}div.payment_method_stripe_cc>.woocommerce-NoticeGroup{margin-bottom:10px}div.payment_method_stripe_cc.custom-form__bootstrap>.woocommerce-NoticeGroup{margin-bottom:20px}.wc-stripe-installment-container{margin-top:15px}.wc-stripe-installment-container p{margin:0}.wc-stripe-installment-container label.installment-label{font-weight:500;margin:0 0 5px 0;position:relative;display:flex;align-items:center}.wc-stripe-installment-container .wc-stripe-installment-options.loading-installments{opacity:.4}.wc-stripe-installment-loader__container{flex:1 1 auto}.wc-stripe-installment-loader__container .wc-stripe-installment-loader{transform:scale(.55);width:30px;height:30px;position:absolute;top:-2px}.wc-stripe-installment-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:installment-loader 1.3s cubic-bezier(.5,0,.5,1) infinite;border-color:#000 transparent transparent transparent}.wc-stripe-installment-loader div:nth-child(1){animation-delay:-.45s}.wc-stripe-installment-loader div:nth-child(2){animation-delay:-.3s}.wc-stripe-installment-loader div:nth-child(3){animation-delay:-.15s}@keyframes installment-loader{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}
assets/js/admin/admin-settings.js CHANGED
@@ -21,6 +21,8 @@ jQuery(function ($) {
21
 
22
  $('.wc-stripe-connection-test').on('click', this.do_connection_test.bind(this));
23
 
 
 
24
  if (typeof (wc_stripe_admin_notices) != 'undefined') {
25
  this.display_notices();
26
  }
@@ -221,6 +223,28 @@ jQuery(function ($) {
221
  $('.wc-stripe-settings-container').unblock();
222
  }
223
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
224
  new Settings();
225
 
226
  });
21
 
22
  $('.wc-stripe-connection-test').on('click', this.do_connection_test.bind(this));
23
 
24
+ $('.stripe-delete-connection').on('click', this.do_delete_connection.bind(this));
25
+
26
  if (typeof (wc_stripe_admin_notices) != 'undefined') {
27
  this.display_notices();
28
  }
223
  $('.wc-stripe-settings-container').unblock();
224
  }
225
 
226
+ Settings.prototype.do_delete_connection = function (e) {
227
+ e.preventDefault();
228
+ if (confirm(this.params.messages.delete_connection)) {
229
+ this.block();
230
+ $.ajax({
231
+ method: 'POST',
232
+ url: this.params.routes.delete_connection,
233
+ dataType: 'json',
234
+ data: {_wpnonce: this.params.rest_nonce}
235
+ }).done(function (response) {
236
+ this.unblock();
237
+ if (!response.code) {
238
+ window.location.reload();
239
+ } else {
240
+ window.alert(response.message);
241
+ }
242
+ }.bind(this)).fail(function () {
243
+ this.unblock();
244
+ }.bind(this));
245
+ }
246
+ }
247
+
248
  new Settings();
249
 
250
  });
assets/js/admin/feedback.js ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {useState, useCallback, useEffect, render} from '@wordpress/element';
2
+ import {Modal, Button, RadioControl, TextareaControl} from '@wordpress/components';
3
+ import apiFetch from '@wordpress/api-fetch';
4
+
5
+ window.addEventListener('load', () => {
6
+ const app = document.createElement('div');
7
+ app.id = 'stripe-app';
8
+ document.getElementById('wpbody')?.append(app);
9
+ const el = document.getElementById('deactivate-woo-stripe-payment');
10
+ render(<App el={el}/>, document.getElementById('stripe-app'));
11
+ });
12
+
13
+ const App = ({el}) => {
14
+ const [open, setOpen] = useState(false);
15
+ const openModal = useCallback((e) => {
16
+ e.preventDefault();
17
+ setOpen(true)
18
+ }, []);
19
+ useEffect(() => {
20
+ el.addEventListener('click', openModal);
21
+ return () => el.removeEventListener('click', openModal);
22
+ }, [openModal]);
23
+ const submit = () => {
24
+ el.removeEventListener('click', openModal);
25
+ el.click();
26
+ setOpen(false);
27
+ }
28
+ return <FeedbackModal submit={submit} deactivateLink={el.href} open={open} setOpen={setOpen} data={stripeFeedbackParams}/>
29
+ }
30
+
31
+ const FeedbackModal = ({deactivateLink, open, setOpen, data, submit}) => {
32
+ const [reasonCode, setReasonCode] = useState(false);
33
+ const [reasonText, setReasonText] = useState('');
34
+ const [processing, setProcessing] = useState();
35
+ const [placeholder, setPlaceHolder] = useState('');
36
+ const onClose = () => setOpen(false);
37
+ const options = Object.keys(data.options).map(id => ({
38
+ label: data.options[id],
39
+ value: id
40
+ }));
41
+ const onSubmit = async () => {
42
+ setProcessing(true);
43
+ try {
44
+ await apiFetch({
45
+ method: 'POST',
46
+ url: data.route,
47
+ data: {
48
+ reason_code: reasonCode,
49
+ reason_text: reasonText
50
+ }
51
+ })
52
+ } catch (error) {
53
+
54
+ } finally {
55
+ setProcessing(false);
56
+ submit();
57
+ }
58
+ }
59
+
60
+ useEffect(() => {
61
+ if (data.placeholders.hasOwnProperty(reasonCode)) {
62
+ setPlaceHolder(data.placeholders[reasonCode]);
63
+ } else {
64
+ setPlaceHolder('');
65
+ }
66
+ }, [reasonCode]);
67
+
68
+ const props = {
69
+ title: data.title,
70
+ isDismissible: true,
71
+ focusOnMount: true,
72
+ isFullScreen: false,
73
+ onRequestClose: onClose
74
+ }
75
+ if (open) {
76
+ return (
77
+ <Modal {...props}>
78
+ <div className='stripe-modal-content'>
79
+ <p>{data.description}</p>
80
+ <div className='options-container'>
81
+ <RadioControl selected={reasonCode} options={options} onChange={setReasonCode}/>
82
+ </div>
83
+ <div className='stripe-deactivation__text'>
84
+ <TextareaControl placeholder={placeholder} label={data.reasonTextLabel} value={reasonText} onChange={setReasonText}/>
85
+ </div>
86
+ </div>
87
+ <div className='stripe-modal-actions'>
88
+ <Button variant='primary' onClick={onSubmit} isBusy={processing} disabled={processing}>{data.buttons.primary}</Button>
89
+ <Button href={deactivateLink} className='stripe-skip-deactivate' variant='tertiary' onClick={onClose}>{data.buttons.secondary}</Button>
90
+ </div>
91
+ </Modal>
92
+ )
93
+ }
94
+ return null;
95
+ }
assets/js/frontend/credit-card.js CHANGED
@@ -44,7 +44,7 @@
44
  $(document.body).on('change', '#createaccount', this.handle_create_account_change.bind(this));
45
  this.setup_card();
46
 
47
- if (this.can_create_setup_intent()) {
48
  this.create_setup_intent();
49
  }
50
  this.maybe_initialize_installments();
@@ -79,19 +79,29 @@
79
  $('#stripe-postal-code').val(val).trigger('keyup');
80
  }.bind(this));
81
  } else {
82
- this.card = this.elements.create('card', $.extend(true, {}, {
83
- value: {
84
- postalCode: this.fields.get('billing_postcode', '')
85
- },
86
- hidePostalCode: this.fields.required('billing_postcode'),
87
- iconStyle: 'default'
88
- }, this.params.cardOptions));
89
- $(document.body).on('change', '#billing_postcode', function (e) {
90
- if (this.card) {
91
- this.card.update({value: $('#billing_postcode').val()});
92
- }
93
- }.bind(this));
94
- this.elementStatus.card = {};
 
 
 
 
 
 
 
 
 
 
95
  this.card.on('change', this.on_card_element_change.bind(this));
96
  }
97
  // setup a timeout so CC element is always rendered.
@@ -169,12 +179,14 @@
169
  if ($('#wc-stripe-card-element').find('iframe').length == 0) {
170
  this.card.unmount();
171
  this.card.mount('#wc-stripe-card-element');
172
- this.card.update({
173
- value: {
174
- postalCode: this.fields.get('billing_postcode', '')
175
- },
176
- hidePostalCode: this.fields.required('billing_postcode')
177
- });
 
 
178
  }
179
  }
180
  }
@@ -193,38 +205,86 @@
193
  if (this.confirmedSetupIntent) {
194
  return this.on_setup_intent_received(this.confirmedSetupIntent);
195
  }
196
- this.stripe.confirmCardSetup(this.client_secret, {
197
- payment_method: {
198
- card: this.is_custom_form() ? this.cardNumber : this.card,
199
- billing_details: (function () {
 
200
  if (this.is_current_page('checkout')) {
201
- return this.get_billing_details();
 
 
202
  }
203
- return $.extend({}, this.is_custom_form() ? {address: {postal_code: $('#stripe-postal-code').val()}} : {});
204
- }.bind(this)())
205
- }
206
- }).then(function (result) {
207
- if (result.error) {
208
- this.submit_card_error(result.error);
209
- return;
210
- }
211
- this.confirmedSetupIntent = result.setupIntent;
212
- this.on_setup_intent_received(result.setupIntent);
213
- }.bind(this))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
214
  } else {
215
  if (!this.payment_token_received && !this.is_saved_method_selected()) {
216
  e.preventDefault();
217
  if (this.checkout_fields_valid()) {
218
- this.stripe.createPaymentMethod({
219
- type: 'card',
220
- card: this.is_custom_form() ? this.cardNumber : this.card,
221
- billing_details: this.get_billing_details()
222
- }).then(function (result) {
223
- if (result.error) {
224
- return this.submit_card_error(result.error);
 
 
 
 
 
 
 
 
 
 
 
 
225
  }
226
- this.on_token_received(result.paymentMethod);
227
- }.bind(this))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
228
  }
229
  }
230
  }
@@ -249,7 +309,11 @@
249
  */
250
  CC.prototype.on_token_received = function (paymentMethod) {
251
  this.payment_token_received = true;
252
- this.set_nonce(paymentMethod.id);
 
 
 
 
253
  this.get_form().trigger('submit');
254
  }
255
 
@@ -266,10 +330,19 @@
266
  /**
267
  *
268
  */
269
- CC.prototype.updated_checkout = function () {
 
 
 
 
 
 
 
 
 
270
  this.create_card_element();
271
  this.handle_create_account_change();
272
- if (this.can_create_setup_intent() && !this.client_secret) {
273
  this.create_setup_intent();
274
  }
275
  }
@@ -374,14 +447,22 @@
374
 
375
  CC.prototype.handle_create_account_change = function () {
376
  if ($('#createaccount').length) {
377
- if ($('#createaccount').is(':checked')) {
378
- $('.wc-stripe-save-source').show();
379
  } else {
380
- $('.wc-stripe-save-source').hide();
381
  }
382
  }
383
  }
384
 
 
 
 
 
 
 
 
 
385
  CC.prototype.submit_card_error = function (error) {
386
  if (this.params.notice_location === 'bcf') {
387
  $('.wc-stripe-card-notice').remove();
@@ -406,7 +487,11 @@
406
  }
407
 
408
  CC.prototype.is_installments_available = function () {
409
- return !!this.get_gateway_data().installments.enabled;
 
 
 
 
410
  }
411
 
412
  CC.prototype.update_element_status = function (event) {
@@ -421,6 +506,19 @@
421
 
422
  CC.prototype.on_card_element_change = function (event) {
423
  this.update_element_status(event);
 
 
 
 
 
 
 
 
 
 
 
 
 
424
  if (this.is_current_page(['checkout', 'order_pay']) && this.is_card_form_complete() && this.is_installments_available()) {
425
  this.initialize_installments();
426
  }
@@ -431,25 +529,46 @@
431
  clearTimeout(this.installmentTimeoutId);
432
  }
433
  this.installmentTimeoutId = setTimeout(function (paymentMethodId) {
434
- this.show_installment_loader();
435
  if (paymentMethodId) {
 
436
  this.fetch_installment_plans(paymentMethodId).finally(function () {
437
  this.hide_installment_loader();
438
  }.bind(this));
439
  } else {
440
- this.stripe.createPaymentMethod({
441
- type: 'card',
442
- card: this.is_custom_form() ? this.cardNumber : this.card,
443
- billing_details: this.get_billing_details()
444
- }).then(function (result) {
445
- if (!result.error) {
446
- this.fetch_installment_plans(result.paymentMethod.id).finally(function () {
 
 
 
 
 
 
 
 
447
  this.hide_installment_loader();
448
- }.bind(this));
449
- } else {
450
- this.hide_installment_loader();
451
- }
452
- }.bind(this));
 
 
 
 
 
 
 
 
 
 
 
 
 
453
  }
454
  }.bind(this, paymentMethodId), 250);
455
  }
@@ -519,6 +638,68 @@
519
  }
520
  }
521
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
522
  new CC();
523
 
524
  }(jQuery, window.wc_stripe))
44
  $(document.body).on('change', '#createaccount', this.handle_create_account_change.bind(this));
45
  this.setup_card();
46
 
47
+ if (this.can_create_setup_intent() && !this.is_payment_element_enabled()) {
48
  this.create_setup_intent();
49
  }
50
  this.maybe_initialize_installments();
79
  $('#stripe-postal-code').val(val).trigger('keyup');
80
  }.bind(this));
81
  } else {
82
+ if (this.is_payment_element_enabled()) {
83
+ this.card = this.elements.create('payment', {
84
+ fields: {
85
+ billingDetails: this.is_current_page('checkout') ? 'never' : 'auto'
86
+ },
87
+ wallets: {applePay: 'never', googlePay: 'never'}
88
+ });
89
+ this.elementStatus.payment = {};
90
+ } else {
91
+ this.card = this.elements.create('card', $.extend(true, {}, {
92
+ value: {
93
+ postalCode: this.fields.get('billing_postcode', '')
94
+ },
95
+ hidePostalCode: this.fields.required('billing_postcode'),
96
+ iconStyle: 'default'
97
+ }, this.params.cardOptions));
98
+ $(document.body).on('change', '#billing_postcode', function (e) {
99
+ if (this.card) {
100
+ this.card.update({value: $('#billing_postcode').val()});
101
+ }
102
+ }.bind(this));
103
+ this.elementStatus.card = {};
104
+ }
105
  this.card.on('change', this.on_card_element_change.bind(this));
106
  }
107
  // setup a timeout so CC element is always rendered.
179
  if ($('#wc-stripe-card-element').find('iframe').length == 0) {
180
  this.card.unmount();
181
  this.card.mount('#wc-stripe-card-element');
182
+ if (!this.is_payment_element_enabled()) {
183
+ this.card.update({
184
+ value: {
185
+ postalCode: this.fields.get('billing_postcode', '')
186
+ },
187
+ hidePostalCode: this.fields.required('billing_postcode')
188
+ });
189
+ }
190
  }
191
  }
192
  }
205
  if (this.confirmedSetupIntent) {
206
  return this.on_setup_intent_received(this.confirmedSetupIntent);
207
  }
208
+ if (this.is_payment_element_enabled()) {
209
+ this.stripe.confirmSetup({
210
+ elements: this.elements,
211
+ confirmParams: (function () {
212
+ var params = {return_url: ''};
213
  if (this.is_current_page('checkout')) {
214
+ params.payment_method_data = {
215
+ billing_details: this.get_billing_details()
216
+ };
217
  }
218
+ return params;
219
+ }.bind(this)()), redirect: 'if_required'
220
+ }).then(function (result) {
221
+ if (result.error) {
222
+ return this.submit_card_error(result.error);
223
+ }
224
+ this.confirmedSetupIntent = result.setupIntent;
225
+ this.on_setup_intent_received(result.setupIntent);
226
+ }.bind(this));
227
+ } else {
228
+ this.stripe.confirmCardSetup(this.client_secret, {
229
+ payment_method: {
230
+ card: this.is_custom_form() ? this.cardNumber : this.card,
231
+ billing_details: (function () {
232
+ if (this.is_current_page('checkout')) {
233
+ return this.get_billing_details();
234
+ }
235
+ return $.extend({}, this.is_custom_form() ? {address: {postal_code: $('#stripe-postal-code').val()}} : {});
236
+ }.bind(this)())
237
+ }
238
+ }).then(function (result) {
239
+ if (result.error) {
240
+ this.submit_card_error(result.error);
241
+ return;
242
+ }
243
+ this.confirmedSetupIntent = result.setupIntent;
244
+ this.on_setup_intent_received(result.setupIntent);
245
+ }.bind(this))
246
+ }
247
  } else {
248
  if (!this.payment_token_received && !this.is_saved_method_selected()) {
249
  e.preventDefault();
250
  if (this.checkout_fields_valid()) {
251
+ if (this.is_payment_element_enabled()) {
252
+ if (this.is_current_page('order_pay')) {
253
+ this.process_order_pay();
254
+ } else {
255
+ this.stripe.updatePaymentIntent({
256
+ elements: this.elements,
257
+ params: {
258
+ payment_method_data: {
259
+ billing_details: this.get_billing_details()
260
+ }
261
+ }
262
+ }).then(function (result) {
263
+ if (result.error) {
264
+ return this.submit_card_error(result.error);
265
+ }
266
+ this.on_token_received(result.paymentIntent.payment_method);
267
+ }.bind(this)).catch(function (error) {
268
+ return this.submit_card_error(error);
269
+ }.bind(this));
270
  }
271
+ } else {
272
+ this.stripe.createPaymentMethod({
273
+ type: 'card',
274
+ card: this.is_custom_form() ? this.cardNumber : this.card,
275
+ billing_details: this.get_billing_details()
276
+ }).then(function (result) {
277
+ if (result.error) {
278
+ return this.submit_card_error(result.error);
279
+ }
280
+ if (this.is_current_page('order_pay')) {
281
+ this.set_nonce(result.paymentMethod.id);
282
+ this.process_order_pay();
283
+ } else {
284
+ this.on_token_received(result.paymentMethod);
285
+ }
286
+ }.bind(this))
287
+ }
288
  }
289
  }
290
  }
309
  */
310
  CC.prototype.on_token_received = function (paymentMethod) {
311
  this.payment_token_received = true;
312
+ if (paymentMethod.hasOwnProperty('id')) {
313
+ this.set_nonce(paymentMethod.id);
314
+ } else {
315
+ this.set_nonce(paymentMethod);
316
+ }
317
  this.get_form().trigger('submit');
318
  }
319
 
330
  /**
331
  *
332
  */
333
+ CC.prototype.updated_checkout = function (e, data) {
334
+ if (typeof data !== 'undefined' && data.fragments && data.fragments.hasOwnProperty('.wc-stripe-intent-secret')) {
335
+ // if client secret has changed, update the elements
336
+ if (this.params.elementOptions.clientSecret !== data.fragments['.wc-stripe-intent-secret']) {
337
+ this.params.elementOptions.clientSecret = data.fragments['.wc-stripe-intent-secret'];
338
+ this.params.cardFormType = 'payment';
339
+ this.elements = this.create_stripe_elements();
340
+ this.setup_card();
341
+ }
342
+ }
343
  this.create_card_element();
344
  this.handle_create_account_change();
345
+ if (this.can_create_setup_intent() && !this.client_secret && !this.is_payment_element_enabled()) {
346
  this.create_setup_intent();
347
  }
348
  }
447
 
448
  CC.prototype.handle_create_account_change = function () {
449
  if ($('#createaccount').length) {
450
+ if ($('#createaccount').is(':checked') && !this.linkPaymentEnabled) {
451
+ this.show_save_card();
452
  } else {
453
+ this.hide_save_card();
454
  }
455
  }
456
  }
457
 
458
+ CC.prototype.hide_save_card = function () {
459
+ $('.wc-stripe-save-source').hide();
460
+ }
461
+
462
+ CC.prototype.show_save_card = function () {
463
+ $('.wc-stripe-save-source').show();
464
+ }
465
+
466
  CC.prototype.submit_card_error = function (error) {
467
  if (this.params.notice_location === 'bcf') {
468
  $('.wc-stripe-card-notice').remove();
487
  }
488
 
489
  CC.prototype.is_installments_available = function () {
490
+ var data = this.get_gateway_data();
491
+ if (data) {
492
+ return !!data.installments.enabled
493
+ }
494
+ return false;
495
  }
496
 
497
  CC.prototype.update_element_status = function (event) {
506
 
507
  CC.prototype.on_card_element_change = function (event) {
508
  this.update_element_status(event);
509
+ if (this.is_payment_element_enabled()) {
510
+ if (event.empty && !event.complete) {
511
+ this.linkPaymentEnabled = false;
512
+ if (this.is_user_logged_in()) {
513
+ this.show_save_card();
514
+ } else {
515
+ this.handle_create_account_change();
516
+ }
517
+ } else {
518
+ this.linkPaymentEnabled = true;
519
+ this.hide_save_card();
520
+ }
521
+ }
522
  if (this.is_current_page(['checkout', 'order_pay']) && this.is_card_form_complete() && this.is_installments_available()) {
523
  this.initialize_installments();
524
  }
529
  clearTimeout(this.installmentTimeoutId);
530
  }
531
  this.installmentTimeoutId = setTimeout(function (paymentMethodId) {
 
532
  if (paymentMethodId) {
533
+ this.show_installment_loader();
534
  this.fetch_installment_plans(paymentMethodId).finally(function () {
535
  this.hide_installment_loader();
536
  }.bind(this));
537
  } else {
538
+ if (this.is_payment_element_enabled()) {
539
+ this.stripe.updatePaymentIntent({
540
+ elements: this.elements,
541
+ params: {
542
+ payment_method_data: {
543
+ billing_details: this.get_billing_details()
544
+ }
545
+ }
546
+ }).then(function (result) {
547
+ if (!result.error) {
548
+ this.show_installment_loader();
549
+ this.fetch_installment_plans(result.paymentIntent.payment_method).finally(function () {
550
+ this.hide_installment_loader();
551
+ }.bind(this));
552
+ } else {
553
  this.hide_installment_loader();
554
+ }
555
+ }.bind(this)).catch(this.hide_installment_loader.bind(this));
556
+ } else {
557
+ this.stripe.createPaymentMethod({
558
+ type: 'card',
559
+ card: this.is_custom_form() ? this.cardNumber : this.card,
560
+ billing_details: this.get_billing_details()
561
+ }).then(function (result) {
562
+ if (!result.error) {
563
+ this.show_installment_loader();
564
+ this.fetch_installment_plans(result.paymentMethod.id).finally(function () {
565
+ this.hide_installment_loader();
566
+ }.bind(this));
567
+ } else {
568
+ this.hide_installment_loader();
569
+ }
570
+ }.bind(this)).catch(this.hide_installment_loader.bind(this));
571
+ }
572
  }
573
  }.bind(this, paymentMethodId), 250);
574
  }
638
  }
639
  }
640
 
641
+ CC.prototype.is_payment_element_enabled = function () {
642
+ return this.params.cardFormType === 'payment'
643
+ }
644
+
645
+ CC.prototype.handle_next_action = function (obj) {
646
+ if (this.is_payment_element_enabled()) {
647
+ this.stripe.confirmPayment({
648
+ elements: this.elements,
649
+ confirmParams: {
650
+ payment_method_data: {
651
+ billing_details: this.get_billing_details()
652
+ }
653
+ },
654
+ redirect: 'if_required'
655
+ }).then(function (result) {
656
+ if (result.error) {
657
+ this.unblock();
658
+ this.payment_token_received = false;
659
+ this.submit_error(result.error);
660
+ } else {
661
+ if (this.is_current_page('order_pay')) {
662
+ this.get_form().trigger('submit');
663
+ } else {
664
+ this.process_payment(obj.order_id, obj.order_key);
665
+ }
666
+ }
667
+ }.bind(this));
668
+ } else {
669
+ wc_stripe.BaseGateway.prototype.handle_next_action.apply(this, arguments);
670
+ }
671
+ }
672
+
673
+ CC.prototype.handle_payment_method_setup = function (obj) {
674
+ if (this.is_payment_element_enabled()) {
675
+ this.stripe.confirmSetup({
676
+ elements: this.elements,
677
+ confirmParams: {
678
+ payment_method_data: {
679
+ billing_details: this.get_billing_details()
680
+ }
681
+ },
682
+ redirect: 'if_required'
683
+ }).then(function (result) {
684
+ if (result.error) {
685
+ this.unblock();
686
+ this.payment_token_received = false;
687
+ this.submit_error(result.error);
688
+ } else {
689
+ if (this.is_current_page('order_pay')) {
690
+ this.get_form().trigger('submit');
691
+ } else {
692
+ this.set_nonce(result.setupIntent.payment_method);
693
+ this.set_intent(result.setupIntent.id);
694
+ this.process_payment(obj.order_id, obj.order_key);
695
+ }
696
+ }
697
+ }.bind(this));
698
+ } else {
699
+ wc_stripe.BaseGateway.prototype.handle_payment_method_setup.apply(this, arguments);
700
+ }
701
+ }
702
+
703
  new CC();
704
 
705
  }(jQuery, window.wc_stripe))
assets/js/frontend/credit-card.min.js CHANGED
@@ -1 +1 @@
1
- !function(a,e){function t(){this.elementStatus={},e.BaseGateway.call(this,wc_stripe_credit_card_params),e.CheckoutGateway.call(this),this.message_container=this.params.notice_selector,window.addEventListener("hashchange",this.hashchange.bind(this)),(e.credit_card=this).confirmedSetupIntent=!1,this.has3DSecureParams(),this.handle_create_account_change(),a(document.body).on("change",'[name="stripe_cc_saved_method_key"]',this.maybe_initialize_installments.bind(this)),a(document.body).on("wc_stripe_saved_method_"+this.gateway_id,this.maybe_initialize_installments.bind(this))}var i={focus:"focused",empty:"empty",invalid:"invalid"};(t.prototype=a.extend({},e.BaseGateway.prototype,e.CheckoutGateway.prototype)).mappings={cardNumber:"#stripe-card-number",cardExpiry:"#stripe-exp",cardCvc:"#stripe-cvv"},t.prototype.handleActionMethod="handleCardAction",t.prototype.setupActionMethod="confirmCardSetup",t.prototype.initialize=function(){a(document.body).on("click","#place_order",this.place_order.bind(this)),a(document.body).on("change","#createaccount",this.handle_create_account_change.bind(this)),this.setup_card(),this.can_create_setup_intent()&&this.create_setup_intent(),this.maybe_initialize_installments()},t.prototype.setup_card=function(){var e;this.is_custom_form()?(e=a.extend(!0,{classes:i},this.params.cardOptions),["cardNumber","cardExpiry","cardCvc"].forEach(function(t){this[t]=this.elements.create(t,a.extend(!0,{},e,this.params.customFieldOptions[t])),this.elementStatus[t]={},this[t].on("change",this.on_card_element_change.bind(this))}.bind(this)),this.cardNumber.on("change",this.card_number_change.bind(this)),this.cardNumber.on("change",this.on_input_change.bind(this)),this.cardExpiry.on("change",this.on_input_change.bind(this)),this.cardCvc.on("change",this.on_input_change.bind(this)),this.fields.required("billing_postcode")&&""!==this.fields.get("billing_postcode")&&0<a("#stripe-postal-code").length&&(a("#stripe-postal-code").val(this.fields.get("billing_postcode")),this.validate_postal_field()),a(document.body).on("change","#billing_postcode",function(t){var e=a("#billing_postcode").val();a("#stripe-postal-code").val(e).trigger("keyup")}.bind(this))):(this.card=this.elements.create("card",a.extend(!0,{},{value:{postalCode:this.fields.get("billing_postcode","")},hidePostalCode:this.fields.required("billing_postcode"),iconStyle:"default"},this.params.cardOptions)),a(document.body).on("change","#billing_postcode",function(t){this.card&&this.card.update({value:a("#billing_postcode").val()})}.bind(this)),this.elementStatus.card={},this.card.on("change",this.on_card_element_change.bind(this))),setInterval(this.create_card_element.bind(this),2e3)},t.prototype.validate_postal_field=function(){var t,e;a("#billing_postcode").length&&a("#stripe-postal-code").length?this.params.postal_regex[this.fields.get("billing_country")]?(e=this.params.postal_regex[this.fields.get("billing_country")],t=a("#stripe-postal-code").val(),e=new RegExp(e,"i"),""!==t?null!==e.exec(t)?a("#stripe-postal-code").addClass("StripeElement--complete").removeClass("invalid"):a("#stripe-postal-code").removeClass("StripeElement--complete").addClass("invalid"):a("#stripe-postal-code").removeClass("StripeElement--complete").removeClass("invalid")):0!=a("#stripe-postal-code").val()?a("#stripe-postal-code").addClass("StripeElement--complete"):a("#stripe-postal-code").removeClass("StripeElement--complete"):a("#stripe-postal-code").length&&(""!=a("#stripe-postal-code").val()?a("#stripe-postal-code").addClass("StripeElement--complete"):a("#stripe-postal-code").removeClass("StripeElement--complete"))},t.prototype.create_card_element=function(){this.is_custom_form()?a("#wc-stripe-cc-custom-form").length&&0==a("#wc-stripe-cc-custom-form").find("iframe").length&&(a(this.mappings.cardNumber).length&&(this.cardNumber.mount(this.mappings.cardNumber),a(this.mappings.cardNumber).prepend(this.params.html.card_brand)),a(this.mappings.cardExpiry).length&&this.cardExpiry.mount(this.mappings.cardExpiry),a(this.mappings.cardCvc).length&&this.cardCvc.mount(this.mappings.cardCvc),a("#stripe-postal-code").length&&(a("#stripe-postal-code, .postalCode").on("focus",function(t){a("#stripe-postal-code").addClass("focused")}.bind(this)),a("#stripe-postal-code, .postalCode").on("blur",function(t){a("#stripe-postal-code").removeClass("focused").trigger("keyup")}.bind(this)),a("#stripe-postal-code").on("keyup",function(t){0==a("#stripe-postal-code").val()?a("#stripe-postal-code").addClass("empty"):a("#stripe-postal-code").removeClass("empty")}.bind(this)),a("#stripe-postal-code").on("change",this.validate_postal_field.bind(this)),a("#stripe-postal-code").trigger("change"))):a("#wc-stripe-card-element").length&&0==a("#wc-stripe-card-element").find("iframe").length&&(this.card.unmount(),this.card.mount("#wc-stripe-card-element"),this.card.update({value:{postalCode:this.fields.get("billing_postcode","")},hidePostalCode:this.fields.required("billing_postcode")})),a(this.container).outerWidth(!0)<450?a(this.container).addClass("stripe-small-container"):a(this.container).removeClass("stripe-small-container")},t.prototype.place_order=function(t){if(this.fields.syncCheckoutFieldsWithDOM(),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);this.stripe.confirmCardSetup(this.client_secret,{payment_method:{card:this.is_custom_form()?this.cardNumber:this.card,billing_details:function(){return this.is_current_page("checkout")?this.get_billing_details():a.extend({},this.is_custom_form()?{address:{postal_code:a("#stripe-postal-code").val()}}:{})}.bind(this)()}}).then(function(t){t.error?this.submit_card_error(t.error):(this.confirmedSetupIntent=t.setupIntent,this.on_setup_intent_received(t.setupIntent))}.bind(this))}else this.payment_token_received||this.is_saved_method_selected()||(t.preventDefault(),this.checkout_fields_valid()&&this.stripe.createPaymentMethod({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_card_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.on_token_received=function(t){this.payment_token_received=!0,this.set_nonce(t.id),this.get_form().trigger("submit")},t.prototype.on_setup_intent_received=function(t){this.payment_token_received=!0,this.set_nonce(t.payment_method),this.set_intent(t.id),this.get_form().trigger("submit")},t.prototype.updated_checkout=function(){this.create_card_element(),this.handle_create_account_change(),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_postal_code=function(){return this.is_custom_form()&&0<a("#stripe-postal-code").length?a("#stripe-postal-code").val():this.fields.get(this.get_billing_prefix()+"_postcode",null)},t.prototype.card_number_change=function(t){"unknown"===t.brand?a("#wc-stripe-card").removeClass("active"):a("#wc-stripe-card").addClass("active"),a("#wc-stripe-card").attr("src",this.params.cards[t.brand])},t.prototype.on_input_change=function(t){if(t.complete){var e=a("#wc-stripe-cc-custom-form").find(".StripeElement, #stripe-postal-code"),i=[];e.each(function(t,e){i.push("#"+a(e).attr("id"))}.bind(this));var t=this.mappings[t.elementType],s=i.indexOf(t);if("undefined"!=typeof i[s+1])if("#stripe-postal-code"===i[s+1])document.getElementById("stripe-postal-code").focus();else for(var n in this.mappings)this.mappings[n]===i[s+1]&&this[n].focus()}},t.prototype.clear_card_elements=function(){for(var t=["cardNumber","cardExpiry","cardCvc"],e=0;e<t.length;e++)this[t[e]]&&this[t[e]].clear()},t.prototype.checkout_error=function(){this.is_gateway_selected()&&(this.payment_token_received=!1),e.CheckoutGateway.prototype.checkout_error.call(this)},t.prototype.get_billing_details=function(){var t=e.BaseGateway.prototype.get_billing_details.call(this);return t.address.postal_code=this.get_postal_code(),t},t.prototype.can_create_setup_intent=function(){return this.is_add_payment_method_page()||this.is_change_payment_method()||this.is_current_page("checkout")&&this.cart_contains_subscription()&&this.get_gateway_data()&&0==this.get_total_price_cents()||this.is_current_page(["checkout","product"])&&"undefined"!=typeof wc_stripe_preorder_exists||this.is_current_page("order_pay")&&"pre_order"in this.get_gateway_data()&&!0===this.get_gateway_data().pre_order||this.is_current_page("product")&&0==this.get_total_price_cents()},t.prototype.handle_create_account_change=function(){a("#createaccount").length&&(a("#createaccount").is(":checked")?a(".wc-stripe-save-source").show():a(".wc-stripe-save-source").hide())},t.prototype.submit_card_error=function(t){"bcf"===this.params.notice_location&&(a(".wc-stripe-card-notice").remove(),a(".wc-stripe_cc-new-method-container").append('<div class="wc-stripe-card-notice"></div>')),e.BaseGateway.prototype.submit_error.call(this,t,!0)},t.prototype.container_styles=function(){e.CheckoutGateway.prototype.container_styles.apply(this,arguments),this.is_custom_form()&&a(this.container).find(".payment_box").addClass("custom-form__"+this.params.custom_form_name)},t.prototype.checkout_fields_valid=function(){var t=this.is_valid_checkout();return t||this.submit_error(this.params.messages.terms),t},t.prototype.is_installments_available=function(){return!!this.get_gateway_data().installments.enabled},t.prototype.update_element_status=function(t){this.elementStatus[t.elementType]=t},t.prototype.is_card_form_complete=function(){return Object.keys(this.elementStatus).filter(function(t){return!!this.elementStatus[t].complete}.bind(this)).length==Object.keys(this.elementStatus).length},t.prototype.on_card_element_change=function(t){this.update_element_status(t),this.is_current_page(["checkout","order_pay"])&&this.is_card_form_complete()&&this.is_installments_available()&&this.initialize_installments()},t.prototype.initialize_installments=function(t){this.installmentTimeoutId&&clearTimeout(this.installmentTimeoutId),this.installmentTimeoutId=setTimeout(function(t){this.show_installment_loader(),t?this.fetch_installment_plans(t)["finally"](function(){this.hide_installment_loader()}.bind(this)):this.stripe.createPaymentMethod({type:"card",card:this.is_custom_form()?this.cardNumber:this.card,billing_details:this.get_billing_details()}).then(function(t){t.error?this.hide_installment_loader():this.fetch_installment_plans(t.paymentMethod.id)["finally"](function(){this.hide_installment_loader()}.bind(this))}.bind(this))}.bind(this,t),250)},t.prototype.fetch_installment_plans=function(t){return this.fetch_payment_intent(t).then(function(t){t.installments_html&&a(".wc-stripe-installment-container").replaceWith(t.installments_html)}.bind(this))["catch"](function(t){return this.submit_card_error(t)}.bind(this))["finally"](function(){}.bind(this))},t.prototype.fetch_payment_intent=function(n){return new Promise(function(e,i){var t=this.params.routes.create_payment_intent,s=!1;this.is_current_page("order_pay")&&(t=this.params.routes.order_create_payment_intent,s=!0),a.ajax({url:t,method:"POST",dataType:"json",data:s?{payment_method_id:n,payment_method:this.gateway_id,order_id:this.get_gateway_data().order.id,order_key:this.get_gateway_data().order.key}:a.extend({},this.serialize_fields(),{payment_method_id:n,payment_method:this.gateway_id,page_id:this.get_page()}),beforeSend:this.ajax_before_send.bind(this)}).done(function(t){(t.code?i:e)(t)}.bind(this)).fail(function(t){i()}.bind(this))}.bind(this))},t.prototype.show_installment_loader=function(){a(".wc-stripe-installment-options").addClass("loading-installments"),a('[name="_stripe_installment_plan"] option:selected').eq(0).text(this.params.installments.loading),a(".wc-stripe-installment-loader").show()},t.prototype.hide_installment_loader=function(t){a(".wc-stripe-installment-options").removeClass("loading-installments"),a(".wc-stripe-installment-loader").hide()},t.prototype.maybe_initialize_installments=function(){this.is_installments_available()&&this.is_saved_method_selected()&&this.initialize_installments(this.get_selected_payment_method())},new t}(jQuery,window.wc_stripe);
1
+ !function(a,i){function t(){this.elementStatus={},i.BaseGateway.call(this,wc_stripe_credit_card_params),i.CheckoutGateway.call(this),this.message_container=this.params.notice_selector,window.addEventListener("hashchange",this.hashchange.bind(this)),(i.credit_card=this).confirmedSetupIntent=!1,this.has3DSecureParams(),this.handle_create_account_change(),a(document.body).on("change",'[name="stripe_cc_saved_method_key"]',this.maybe_initialize_installments.bind(this)),a(document.body).on("wc_stripe_saved_method_"+this.gateway_id,this.maybe_initialize_installments.bind(this))}var s={focus:"focused",empty:"empty",invalid:"invalid"};(t.prototype=a.extend({},i.BaseGateway.prototype,i.CheckoutGateway.prototype)).mappings={cardNumber:"#stripe-card-number",cardExpiry:"#stripe-exp",cardCvc:"#stripe-cvv"},t.prototype.handleActionMethod="handleCardAction",t.prototype.setupActionMethod="confirmCardSetup",t.prototype.initialize=function(){a(document.body).on("click","#place_order",this.place_order.bind(this)),a(document.body).on("change","#createaccount",this.handle_create_account_change.bind(this)),this.setup_card(),this.can_create_setup_intent()&&!this.is_payment_element_enabled()&&this.create_setup_intent(),this.maybe_initialize_installments()},t.prototype.setup_card=function(){var e;this.is_custom_form()?(e=a.extend(!0,{classes:s},this.params.cardOptions),["cardNumber","cardExpiry","cardCvc"].forEach(function(t){this[t]=this.elements.create(t,a.extend(!0,{},e,this.params.customFieldOptions[t])),this.elementStatus[t]={},this[t].on("change",this.on_card_element_change.bind(this))}.bind(this)),this.cardNumber.on("change",this.card_number_change.bind(this)),this.cardNumber.on("change",this.on_input_change.bind(this)),this.cardExpiry.on("change",this.on_input_change.bind(this)),this.cardCvc.on("change",this.on_input_change.bind(this)),this.fields.required("billing_postcode")&&""!==this.fields.get("billing_postcode")&&0<a("#stripe-postal-code").length&&(a("#stripe-postal-code").val(this.fields.get("billing_postcode")),this.validate_postal_field()),a(document.body).on("change","#billing_postcode",function(t){var e=a("#billing_postcode").val();a("#stripe-postal-code").val(e).trigger("keyup")}.bind(this))):(this.is_payment_element_enabled()?(this.card=this.elements.create("payment",{fields:{billingDetails:this.is_current_page("checkout")?"never":"auto"},wallets:{applePay:"never",googlePay:"never"}}),this.elementStatus.payment={}):(this.card=this.elements.create("card",a.extend(!0,{},{value:{postalCode:this.fields.get("billing_postcode","")},hidePostalCode:this.fields.required("billing_postcode"),iconStyle:"default"},this.params.cardOptions)),a(document.body).on("change","#billing_postcode",function(t){this.card&&this.card.update({value:a("#billing_postcode").val()})}.bind(this)),this.elementStatus.card={}),this.card.on("change",this.on_card_element_change.bind(this))),setInterval(this.create_card_element.bind(this),2e3)},t.prototype.validate_postal_field=function(){var t,e;a("#billing_postcode").length&&a("#stripe-postal-code").length?this.params.postal_regex[this.fields.get("billing_country")]?(e=this.params.postal_regex[this.fields.get("billing_country")],t=a("#stripe-postal-code").val(),e=new RegExp(e,"i"),""!==t?null!==e.exec(t)?a("#stripe-postal-code").addClass("StripeElement--complete").removeClass("invalid"):a("#stripe-postal-code").removeClass("StripeElement--complete").addClass("invalid"):a("#stripe-postal-code").removeClass("StripeElement--complete").removeClass("invalid")):0!=a("#stripe-postal-code").val()?a("#stripe-postal-code").addClass("StripeElement--complete"):a("#stripe-postal-code").removeClass("StripeElement--complete"):a("#stripe-postal-code").length&&(""!=a("#stripe-postal-code").val()?a("#stripe-postal-code").addClass("StripeElement--complete"):a("#stripe-postal-code").removeClass("StripeElement--complete"))},t.prototype.create_card_element=function(){this.is_custom_form()?a("#wc-stripe-cc-custom-form").length&&0==a("#wc-stripe-cc-custom-form").find("iframe").length&&(a(this.mappings.cardNumber).length&&(this.cardNumber.mount(this.mappings.cardNumber),a(this.mappings.cardNumber).prepend(this.params.html.card_brand)),a(this.mappings.cardExpiry).length&&this.cardExpiry.mount(this.mappings.cardExpiry),a(this.mappings.cardCvc).length&&this.cardCvc.mount(this.mappings.cardCvc),a("#stripe-postal-code").length&&(a("#stripe-postal-code, .postalCode").on("focus",function(t){a("#stripe-postal-code").addClass("focused")}.bind(this)),a("#stripe-postal-code, .postalCode").on("blur",function(t){a("#stripe-postal-code").removeClass("focused").trigger("keyup")}.bind(this)),a("#stripe-postal-code").on("keyup",function(t){0==a("#stripe-postal-code").val()?a("#stripe-postal-code").addClass("empty"):a("#stripe-postal-code").removeClass("empty")}.bind(this)),a("#stripe-postal-code").on("change",this.validate_postal_field.bind(this)),a("#stripe-postal-code").trigger("change"))):a("#wc-stripe-card-element").length&&0==a("#wc-stripe-card-element").find("iframe").length&&(this.card.unmount(),this.card.mount("#wc-stripe-card-element"),this.is_payment_element_enabled()||this.card.update({value:{postalCode:this.fields.get("billing_postcode","")},hidePostalCode:this.fields.required("billing_postcode")})),a(this.container).outerWidth(!0)<450?a(this.container).addClass("stripe-small-container"):a(this.container).removeClass("stripe-small-container")},t.prototype.place_order=function(t){if(this.fields.syncCheckoutFieldsWithDOM(),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);this.is_payment_element_enabled()?this.stripe.confirmSetup({elements:this.elements,confirmParams:function(){var t={return_url:""};return this.is_current_page("checkout")&&(t.payment_method_data={billing_details:this.get_billing_details()}),t}.bind(this)(),redirect:"if_required"}).then(function(t){if(t.error)return this.submit_card_error(t.error);this.confirmedSetupIntent=t.setupIntent,this.on_setup_intent_received(t.setupIntent)}.bind(this)):this.stripe.confirmCardSetup(this.client_secret,{payment_method:{card:this.is_custom_form()?this.cardNumber:this.card,billing_details:function(){return this.is_current_page("checkout")?this.get_billing_details():a.extend({},this.is_custom_form()?{address:{postal_code:a("#stripe-postal-code").val()}}:{})}.bind(this)()}}).then(function(t){t.error?this.submit_card_error(t.error):(this.confirmedSetupIntent=t.setupIntent,this.on_setup_intent_received(t.setupIntent))}.bind(this))}else this.payment_token_received||this.is_saved_method_selected()||(t.preventDefault(),this.checkout_fields_valid()&&(this.is_payment_element_enabled()?this.is_current_page("order_pay")?this.process_order_pay():this.stripe.updatePaymentIntent({elements:this.elements,params:{payment_method_data:{billing_details:this.get_billing_details()}}}).then(function(t){if(t.error)return this.submit_card_error(t.error);this.on_token_received(t.paymentIntent.payment_method)}.bind(this))["catch"](function(t){return this.submit_card_error(t)}.bind(this)):this.stripe.createPaymentMethod({type:"card",card:this.is_custom_form()?this.cardNumber:this.card,billing_details:this.get_billing_details()}).then(function(t){if(t.error)return this.submit_card_error(t.error);this.is_current_page("order_pay")?(this.set_nonce(t.paymentMethod.id),this.process_order_pay()):this.on_token_received(t.paymentMethod)}.bind(this))))},t.prototype.checkout_place_order=function(){return this.is_saved_method_selected()||this.payment_token_received?i.CheckoutGateway.prototype.checkout_place_order.apply(this,arguments):(this.place_order.apply(this,arguments),!1)},t.prototype.on_token_received=function(t){this.payment_token_received=!0,t.hasOwnProperty("id")?this.set_nonce(t.id):this.set_nonce(t),this.get_form().trigger("submit")},t.prototype.on_setup_intent_received=function(t){this.payment_token_received=!0,this.set_nonce(t.payment_method),this.set_intent(t.id),this.get_form().trigger("submit")},t.prototype.updated_checkout=function(t,e){void 0!==e&&e.fragments&&e.fragments.hasOwnProperty(".wc-stripe-intent-secret")&&this.params.elementOptions.clientSecret!==e.fragments[".wc-stripe-intent-secret"]&&(this.params.elementOptions.clientSecret=e.fragments[".wc-stripe-intent-secret"],this.params.cardFormType="payment",this.elements=this.create_stripe_elements(),this.setup_card()),this.create_card_element(),this.handle_create_account_change(),!this.can_create_setup_intent()||this.client_secret||this.is_payment_element_enabled()||this.create_setup_intent()},t.prototype.update_checkout=function(){this.clear_card_elements()},t.prototype.show_payment_button=function(){i.CheckoutGateway.prototype.show_place_order.apply(this,arguments)},t.prototype.hide_place_order=function(){},t.prototype.is_custom_form=function(){return"1"===this.params.custom_form},t.prototype.get_postal_code=function(){return this.is_custom_form()&&0<a("#stripe-postal-code").length?a("#stripe-postal-code").val():this.fields.get(this.get_billing_prefix()+"_postcode",null)},t.prototype.card_number_change=function(t){"unknown"===t.brand?a("#wc-stripe-card").removeClass("active"):a("#wc-stripe-card").addClass("active"),a("#wc-stripe-card").attr("src",this.params.cards[t.brand])},t.prototype.on_input_change=function(t){if(t.complete){var e=a("#wc-stripe-cc-custom-form").find(".StripeElement, #stripe-postal-code"),i=[];e.each(function(t,e){i.push("#"+a(e).attr("id"))}.bind(this));var t=this.mappings[t.elementType],s=i.indexOf(t);if("undefined"!=typeof i[s+1])if("#stripe-postal-code"===i[s+1])document.getElementById("stripe-postal-code").focus();else for(var n in this.mappings)this.mappings[n]===i[s+1]&&this[n].focus()}},t.prototype.clear_card_elements=function(){for(var t=["cardNumber","cardExpiry","cardCvc"],e=0;e<t.length;e++)this[t[e]]&&this[t[e]].clear()},t.prototype.checkout_error=function(){this.is_gateway_selected()&&(this.payment_token_received=!1),i.CheckoutGateway.prototype.checkout_error.call(this)},t.prototype.get_billing_details=function(){var t=i.BaseGateway.prototype.get_billing_details.call(this);return t.address.postal_code=this.get_postal_code(),t},t.prototype.can_create_setup_intent=function(){return this.is_add_payment_method_page()||this.is_change_payment_method()||this.is_current_page("checkout")&&this.cart_contains_subscription()&&this.get_gateway_data()&&0==this.get_total_price_cents()||this.is_current_page(["checkout","product"])&&"undefined"!=typeof wc_stripe_preorder_exists||this.is_current_page("order_pay")&&"pre_order"in this.get_gateway_data()&&!0===this.get_gateway_data().pre_order||this.is_current_page("product")&&0==this.get_total_price_cents()},t.prototype.handle_create_account_change=function(){a("#createaccount").length&&(a("#createaccount").is(":checked")&&!this.linkPaymentEnabled?this.show_save_card():this.hide_save_card())},t.prototype.hide_save_card=function(){a(".wc-stripe-save-source").hide()},t.prototype.show_save_card=function(){a(".wc-stripe-save-source").show()},t.prototype.submit_card_error=function(t){"bcf"===this.params.notice_location&&(a(".wc-stripe-card-notice").remove(),a(".wc-stripe_cc-new-method-container").append('<div class="wc-stripe-card-notice"></div>')),i.BaseGateway.prototype.submit_error.call(this,t,!0)},t.prototype.container_styles=function(){i.CheckoutGateway.prototype.container_styles.apply(this,arguments),this.is_custom_form()&&a(this.container).find(".payment_box").addClass("custom-form__"+this.params.custom_form_name)},t.prototype.checkout_fields_valid=function(){var t=this.is_valid_checkout();return t||this.submit_error(this.params.messages.terms),t},t.prototype.is_installments_available=function(){var t=this.get_gateway_data();return!!t&&!!t.installments.enabled},t.prototype.update_element_status=function(t){this.elementStatus[t.elementType]=t},t.prototype.is_card_form_complete=function(){return Object.keys(this.elementStatus).filter(function(t){return!!this.elementStatus[t].complete}.bind(this)).length==Object.keys(this.elementStatus).length},t.prototype.on_card_element_change=function(t){this.update_element_status(t),this.is_payment_element_enabled()&&(t.empty&&!t.complete?(this.linkPaymentEnabled=!1,this.is_user_logged_in()?this.show_save_card():this.handle_create_account_change()):(this.linkPaymentEnabled=!0,this.hide_save_card())),this.is_current_page(["checkout","order_pay"])&&this.is_card_form_complete()&&this.is_installments_available()&&this.initialize_installments()},t.prototype.initialize_installments=function(t){this.installmentTimeoutId&&clearTimeout(this.installmentTimeoutId),this.installmentTimeoutId=setTimeout(function(t){t?(this.show_installment_loader(),this.fetch_installment_plans(t)["finally"](function(){this.hide_installment_loader()}.bind(this))):(this.is_payment_element_enabled()?this.stripe.updatePaymentIntent({elements:this.elements,params:{payment_method_data:{billing_details:this.get_billing_details()}}}).then(function(t){t.error?this.hide_installment_loader():(this.show_installment_loader(),this.fetch_installment_plans(t.paymentIntent.payment_method)["finally"](function(){this.hide_installment_loader()}.bind(this)))}.bind(this)):this.stripe.createPaymentMethod({type:"card",card:this.is_custom_form()?this.cardNumber:this.card,billing_details:this.get_billing_details()}).then(function(t){t.error?this.hide_installment_loader():(this.show_installment_loader(),this.fetch_installment_plans(t.paymentMethod.id)["finally"](function(){this.hide_installment_loader()}.bind(this)))}.bind(this)))["catch"](this.hide_installment_loader.bind(this))}.bind(this,t),250)},t.prototype.fetch_installment_plans=function(t){return this.fetch_payment_intent(t).then(function(t){t.installments_html&&a(".wc-stripe-installment-container").replaceWith(t.installments_html)}.bind(this))["catch"](function(t){return this.submit_card_error(t)}.bind(this))["finally"](function(){}.bind(this))},t.prototype.fetch_payment_intent=function(n){return new Promise(function(e,i){var t=this.params.routes.create_payment_intent,s=!1;this.is_current_page("order_pay")&&(t=this.params.routes.order_create_payment_intent,s=!0),a.ajax({url:t,method:"POST",dataType:"json",data:s?{payment_method_id:n,payment_method:this.gateway_id,order_id:this.get_gateway_data().order.id,order_key:this.get_gateway_data().order.key}:a.extend({},this.serialize_fields(),{payment_method_id:n,payment_method:this.gateway_id,page_id:this.get_page()}),beforeSend:this.ajax_before_send.bind(this)}).done(function(t){(t.code?i:e)(t)}.bind(this)).fail(function(t){i()}.bind(this))}.bind(this))},t.prototype.show_installment_loader=function(){a(".wc-stripe-installment-options").addClass("loading-installments"),a('[name="_stripe_installment_plan"] option:selected').eq(0).text(this.params.installments.loading),a(".wc-stripe-installment-loader").show()},t.prototype.hide_installment_loader=function(t){a(".wc-stripe-installment-options").removeClass("loading-installments"),a(".wc-stripe-installment-loader").hide()},t.prototype.maybe_initialize_installments=function(){this.is_installments_available()&&this.is_saved_method_selected()&&this.initialize_installments(this.get_selected_payment_method())},t.prototype.is_payment_element_enabled=function(){return"payment"===this.params.cardFormType},t.prototype.handle_next_action=function(e){this.is_payment_element_enabled()?this.stripe.confirmPayment({elements:this.elements,confirmParams:{payment_method_data:{billing_details:this.get_billing_details()}},redirect:"if_required"}).then(function(t){t.error?(this.unblock(),this.payment_token_received=!1,this.submit_error(t.error)):this.is_current_page("order_pay")?this.get_form().trigger("submit"):this.process_payment(e.order_id,e.order_key)}.bind(this)):i.BaseGateway.prototype.handle_next_action.apply(this,arguments)},t.prototype.handle_payment_method_setup=function(e){this.is_payment_element_enabled()?this.stripe.confirmSetup({elements:this.elements,confirmParams:{payment_method_data:{billing_details:this.get_billing_details()}},redirect:"if_required"}).then(function(t){t.error?(this.unblock(),this.payment_token_received=!1,this.submit_error(t.error)):this.is_current_page("order_pay")?this.get_form().trigger("submit"):(this.set_nonce(t.setupIntent.payment_method),this.set_intent(t.setupIntent.id),this.process_payment(e.order_id,e.order_key))}.bind(this)):i.BaseGateway.prototype.handle_payment_method_setup.apply(this,arguments)},new t}(jQuery,window.wc_stripe);
assets/js/frontend/link-checkout.js ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import $ from 'jquery';
2
+
3
+ $(() => {
4
+ if (wcStripeLinkParams === 'undefined') {
5
+ return false;
6
+ }
7
+ try {
8
+ const creditCard = wc_stripe.credit_card;
9
+ const stripe = creditCard.stripe;
10
+ const link = stripe.linkAutofillModal(creditCard.elements);
11
+
12
+ $(document.body).on('keyup', '[name="billing_email"]', (e) => {
13
+ link.launch({email: e.currentTarget.value});
14
+ });
15
+
16
+ if (wcStripeLinkParams.launchLink) {
17
+ link.launch({email: $('[name="billing_email"]').val()});
18
+ }
19
+
20
+ link.on('autofill', (event) => {
21
+ const {shippingAddress = null, billingAddress} = event.value;
22
+ // populate the address fields
23
+ if (shippingAddress) {
24
+ const address = {name: shippingAddress.name, ...shippingAddress.address};
25
+ creditCard.populate_shipping_fields(address);
26
+ }
27
+ if (billingAddress) {
28
+ const address = {name: billingAddress.name, ...billingAddress.address};
29
+ creditCard.populate_billing_fields(address);
30
+ }
31
+ creditCard.fields.toFormFields();
32
+ creditCard.set_payment_method(creditCard.gateway_id);
33
+ creditCard.show_new_payment_method();
34
+ creditCard.hide_save_card();
35
+ if (shippingAddress) {
36
+ creditCard.maybe_set_ship_to_different();
37
+ }
38
+ $('[name="terms"]').prop('checked', true);
39
+ if (!creditCard.fields.isEmpty('billing_phone')) {
40
+ creditCard.get_form().trigger('submit');
41
+ }
42
+ });
43
+ } catch (error) {
44
+ console.log(error);
45
+ }
46
+ });
assets/js/frontend/local-payment.js CHANGED
@@ -127,28 +127,7 @@
127
  LocalPayment.prototype.process_order_pay = function (e) {
128
  if (this.is_gateway_selected()) {
129
  e.preventDefault();
130
- var data = this.get_form().serializeArray();
131
- data.push({name: '_wpnonce', value: this.params.rest_nonce});
132
- data.push({name: 'order_id', value: this.params.order_id});
133
- var search = window.location.search;
134
- var match = this.params.routes.order_pay.match(/\?/);
135
- if (match) {
136
- search = '&' + search.substr(1);
137
- }
138
- $.ajax({
139
- url: this.params.routes.order_pay + search,
140
- method: 'POST',
141
- dataType: 'json',
142
- data: $.param(data)
143
- }).done(function (response) {
144
- if (response.success) {
145
- window.location.href = response.redirect;
146
- } else {
147
- this.submit_error(response.message);
148
- }
149
- }.bind(this)).fail(function (jqXHR, textStatus, errorThrown) {
150
- this.submit_error(errorThrown);
151
- }.bind(this))
152
  }
153
  }
154
 
@@ -230,6 +209,10 @@
230
  }
231
  }
232
 
 
 
 
 
233
  LocalPayment.prototype.processConfirmation = function (obj) {
234
  if (obj.type === 'payment_intent') {
235
  this.stripe[this.confirmation_method](obj.client_secret, this.get_confirmation_args(obj)).then(function (result) {
127
  LocalPayment.prototype.process_order_pay = function (e) {
128
  if (this.is_gateway_selected()) {
129
  e.preventDefault();
130
+ wc_stripe.CheckoutGateway.prototype.process_order_pay.apply(this, arguments);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
131
  }
132
  }
133
 
209
  }
210
  }
211
 
212
+ LocalPayment.prototype.handle_next_action = function (data) {
213
+ this.processConfirmation(data);
214
+ }
215
+
216
  LocalPayment.prototype.processConfirmation = function (obj) {
217
  if (obj.type === 'payment_intent') {
218
  this.stripe[this.confirmation_method](obj.client_secret, this.get_confirmation_args(obj)).then(function (result) {
assets/js/frontend/local-payment.min.js CHANGED
@@ -1 +1 @@
1
- !function(n,i){function o(t){i.BaseGateway.call(this,t),i.CheckoutGateway.call(this),n(document.body).on("click","#place_order",this.place_order.bind(this)),this.is_current_page("order_pay")&&n("#order_review").on("submit",this.process_order_pay.bind(this)),this.maybe_hide_gateway()}function t(t){this.elementType="idealBank",this.confirmation_method="confirmIdealPayment",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function e(t){this.elementType="p24Bank",this.confirmation_method="confirmP24Payment",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function s(t){this.elementType="iban",this.confirmation_method="confirmSepaDebitPayment",this.setupActionMethod="confirmSepaDebitSetup",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function r(t){this.confirmation_method="confirmKlarnaPayment",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function a(t){this.elementType="fpxBank",this.confirmation_method="confirmFpxPayment",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function h(t){o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function p(t){this.elementType="auBankAccount",this.confirmation_method="confirmAuBecsDebitPayment",this.setupActionMethod="confirmAuBecsDebitSetup",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function c(t){this.confirmation_method="confirmGrabPayPayment",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function d(t){this.confirmation_method="confirmAfterpayClearpayPayment",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function _(t){this.confirmation_method="confirmBoletoPayment",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function m(t){this.confirmation_method="confirmOxxoPayment",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function l(t){this.confirmation_method="confirmGiropayPayment",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function y(t){this.confirmation_method="confirmBancontactPayment",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function u(t){this.elementType="epsBank",this.confirmation_method="confirmEpsPayment",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function f(t){this.confirmation_method="confirmAlipayPayment",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function g(t){this.confirmation_method="confirmSofortPayment",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}(o.prototype=n.extend({},i.BaseGateway.prototype,i.CheckoutGateway.prototype)).initialize=function(){this.mount_button()},o.prototype.elementType=null,o.prototype.is_active=function(){return n("#wc_stripe_local_payment_"+this.gateway_id).data("active")},o.prototype.maybe_hide_gateway=function(){this.is_active()?n(this.container).show():(n(this.container).hide(),this.is_gateway_selected()&&n('li[class*="payment_method_stripe_"]').filter(":visible").eq(0).find('[name="payment_method"]').prop("checked",!0).trigger("click"))},o.prototype.createSource=function(){return new Promise(function(e,t){var i=function(t){t.error?this.submit_error(t.error):(this.payment_token_received=!0,this.set_nonce(t.source.id),this.get_form().trigger("submit")),e()}.bind(this);if(null!=this.elementType)if(this.confirmation_method)if(this.confirmation_obj)this.processConfirmation(this.confirmation_obj);else{if(!this.isValidElement())return this.submit_error({code:"empty_element_"+this.params.local_payment_type,message:wc_stripe_messages.empty_element});this.payment_token_received=!0,this.get_form().trigger("submit")}else this.stripe.createSource(this.element,this.getSourceArgs()).then(i)["catch"](function(t){this.submit_error(t.message)}.bind(this));else this.payment_token_received=!0,this.get_form().trigger("submit")}.bind(this))},o.prototype.place_order=function(t){this.is_gateway_selected()&&(this.payment_token_received||this.is_saved_method_selected()||(t.preventDefault(),this.is_change_payment_method()?this.process_setup_intent():this.createSource()))},o.prototype.process_setup_intent=function(){this.block(),this.create_setup_intent().then(function(){this.stripe[this.setupActionMethod](this.client_secret,this.get_confirmation_args()).then(function(t){if(t.error)return this.submit_error(t.error.message);this.set_nonce(t.setupIntent.payment_method),this.set_intent(t.setupIntent.id),this.payment_token_received=!0,this.get_form().trigger("submit")}.bind(this))}.bind(this))["catch"](function(t){this.submit_error(t)}.bind(this))["finally"](function(){this.unblock()}.bind(this))},o.prototype.checkout_place_order=function(t){return this.is_saved_method_selected()||this.payment_token_received?i.CheckoutGateway.prototype.checkout_place_order.apply(this,arguments):(this.place_order.apply(this,arguments),!1)},o.prototype.process_order_pay=function(t){var e;this.is_gateway_selected()&&(t.preventDefault(),(e=this.get_form().serializeArray()).push({name:"_wpnonce",value:this.params.rest_nonce}),e.push({name:"order_id",value:this.params.order_id}),t=window.location.search,this.params.routes.order_pay.match(/\?/)&&(t="&"+t.substr(1)),n.ajax({url:this.params.routes.order_pay+t,method:"POST",dataType:"json",data:n.param(e)}).done(function(t){t.success?window.location.href=t.redirect:this.submit_error(t.message)}.bind(this)).fail(function(t,e,i){this.submit_error(i)}.bind(this)))},o.prototype.show_payment_button=function(){this.show_place_order()},o.prototype.hide_place_order=function(){},o.prototype.show_place_order=function(){i.CheckoutGateway.prototype.show_place_order.apply(this,arguments),this.payment_token_received&&n("#place_order").text(n("#place_order").data("value"))},o.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(this.get_billing_prefix()),email:this.fields.get("billing_email",null)},redirect:{return_url:this.params.return_url}}},o.prototype.updated_checkout=function(){this.mount_button(),this.maybe_hide_gateway()},o.prototype.mount_button=function(){var t="#wc_stripe_local_payment_"+this.gateway_id;n(t).length&&null!=this.elementType&&(n(t).empty(),this.element||(this.element=this.elements.create(this.elementType,this.params.element_params),this.element.on("change",this.handleElementChange.bind(this))),this.elementEmpty=!0,this.element.mount(t))},o.prototype.handleElementChange=function(t){this.elementEmpty=t.empty},o.prototype.load_external_script=function(t){var e=document.createElement("script");e.type="text/javascript",e.src=t,e.onload=function(){this.script_loaded=!0}.bind(this),document.body.appendChild(e)},o.prototype.hashChange=function(t){var e;!this.is_gateway_selected()||(e=window.location.hash.match(/response=(.*)/))&&(history.pushState({},"",window.location.pathname),e=JSON.parse(window.atob(decodeURIComponent(e[1]))),this.processConfirmation(e))},o.prototype.processConfirmation=function(i){"payment_intent"===i.type?this.stripe[this.confirmation_method](i.client_secret,this.get_confirmation_args(i)).then(function(t){if(t.error)return this.confirmation_obj=i,this.payment_token_received=!1,this.submit_error(t.error.message);var e=decodeURI(i.order_received_url);"processing"===t.paymentIntent.status&&(e+="&"+n.param({_stripe_local_payment:this.gateway_id,payment_intent:t.paymentIntent.id,payment_intent_client_secret:t.paymentIntent.client_secret})),window.location.href=decodeURI(e)}.bind(this)):this.stripe[this.setupActionMethod](i.client_secret,this.get_confirmation_args(i)).then(function(t){return t.error?this.submit_error(t.error.message):(this.set_nonce(t.setupIntent.payment_method),this.set_intent(t.setupIntent.id),this.process_payment(i.order_id,i.order_key))}.bind(this))},o.prototype.get_confirmation_args=function(t){t=void 0===t?{}:t;t={payment_method:{billing_details:this.get_billing_details()},return_url:t.return_url};return this.elementType&&(t.payment_method[this.params.local_payment_type]=this.element),t},o.prototype.isValidElement=function(){return!this.element||!this.elementEmpty},o.prototype.delete_order_source=function(){return new Promise(function(e,t){n.ajax({url:this.params.routes.delete_order_source,method:"DELETE",dataType:"json",beforeSend:this.ajax_before_send.bind(this)}).done(function(t){e(t)}.bind(this)).fail(function(){t()}.bind(this))}.bind(this))},o.prototype.update_source=function(i){return new Promise(function(e,t){this.updateSourceXhr&&this.updateSourceXhr.abort(),this.updateSourceXhr=n.ajax({url:this.params.routes.update_source,method:"POST",dataType:"json",data:{_wpnonce:this.params.rest_nonce,updates:i,source_id:this.source.id,client_secret:this.source.client_secret,payment_method:this.gateway_id}}).done(function(t){e(t.source)}.bind(this)).fail(function(){t()})}.bind(this))},h.prototype.updated_checkout=function(){!this.script_loaded&&n(this.container).length&&this.load_external_script(this.params.qr_script),o.prototype.updated_checkout.apply(this,arguments)},h.prototype.hashChange=function(t){var e;!this.is_gateway_selected()||(e=window.location.hash.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:parseInt(this.params.qr_size),height:parseInt(this.params.qr_size),colorDark:"#424770",colorLight:"#f8fbfd",correctLevel:QRCode.CorrectLevel.H}),n("#wc_stripe_local_payment_stripe_wechat").append('<p class="qrcode-message">'+this.params.qr_message+"</p>"),this.payment_token_received=!0,this.show_place_order())},h.prototype.place_order=function(t){this.qrcode&&this.payment_token_received?(t.preventDefault(),window.location=this.qrcode.redirect):o.prototype.place_order.apply(this,arguments)},d.prototype.is_currency_supported=function(){return-1<this.params.currencies.indexOf(this.get_currency())},d.prototype.updated_checkout=function(){this.maybe_hide_gateway(),this.has_gateway_data()&&this.is_currency_supported()&&(this.add_eligibility(this.container,parseFloat(this.get_total_price())),this.elements=this.stripe.elements(this.get_element_options()),this.initialize_messaging())},d.prototype.initialize=function(){this.has_gateway_data()&&this.is_currency_supported()&&(this.add_eligibility(this.container,parseFloat(this.get_total_price())),this.initialize_messaging())},d.prototype.initialize_messaging=function(){this.msgElement=this.elements.create("afterpayClearpayMessage",n.extend({},this.params.msg_options,{amount:this.get_total_price_cents(),currency:this.get_currency()})),this.mount_message()},d.prototype.mount_message=function(t){t&&this.msgElement.update({amount:this.get_total_price_cents(),currency:this.get_currency()}),n('label[for="payment_method_stripe_afterpay"]').find("#wc-stripe-afterpay-msg").length||n('label[for="payment_method_stripe_afterpay"]').append('<div id="wc-stripe-afterpay-msg"></div>'),this.msgElement.mount("#wc-stripe-afterpay-msg")},d.prototype.add_eligibility=function(t,e){i.Afterpay.prototype.add_eligibility.apply(this,arguments),this.is_eligible(e)||n(this.container).find(".wc-stripe-afterpay__offsite").addClass("afterpay-ineligible")},_.prototype.get_confirmation_args=function(t){t=o.prototype.get_confirmation_args.call(this,t);return t.payment_method.boleto={tax_id:this.get_tax_id()},t},_.prototype.createSource=function(){var t=this.get_tax_id();if(!t||!t.match(/^(\w{3}\.){2}\w{3}-\w{2}$|^(\w{11}|\w{14})$|^\w{2}\.\w{3}\.\w{3}\/\w{4}-\w{2}$/))return this.submit_error({code:"incomplete_boleto_tax_id"});this.payment_token_received=!0,this.get_form().trigger("submit")},_.prototype.get_tax_id=function(){return n("#wc_stripe_boleto_tax_id").val()},s.prototype.updated_checkout=function(t){o.prototype.updated_checkout.apply(this,arguments);var e=n('[name="billing_country"]').val();e&&this.element&&this.element.update({placeholderCountry:e})},g.prototype.get_confirmation_args=function(){var t=o.prototype.get_confirmation_args.apply(this,arguments);return t.payment_method.sofort={country:t.payment_method.billing_details.address.country},t},t.prototype=n.extend({},o.prototype,t.prototype),e.prototype=n.extend({},o.prototype,e.prototype),s.prototype=n.extend({},o.prototype,s.prototype),r.prototype=n.extend({},o.prototype,r.prototype),a.prototype=n.extend({},o.prototype,a.prototype),h.prototype=n.extend({},o.prototype,h.prototype),p.prototype=n.extend({},o.prototype,p.prototype),c.prototype=n.extend({},o.prototype,c.prototype),d.prototype=n.extend({},o.prototype,i.Afterpay.prototype,d.prototype),_.prototype=n.extend({},o.prototype,_.prototype),m.prototype=n.extend({},o.prototype,m.prototype),l.prototype=n.extend({},o.prototype,l.prototype),y.prototype=n.extend({},o.prototype,y.prototype),u.prototype=n.extend({},o.prototype,u.prototype),f.prototype=n.extend({},o.prototype,f.prototype),g.prototype=n.extend({},o.prototype,g.prototype);var w,b={ideal:t,p24:e,sepa_debit:s,klarna:r,fpx:a,wechat:h,au_becs_debit:p,grabpay:c,afterpay_clearpay:d,boleto:_,oxxo:m,giropay:l,bancontact:y,eps:u,alipay:f,sofort:g};for(w in wc_stripe_local_payment_params.gateways){var v=wc_stripe_local_payment_params.gateways[w];new(b[v.local_payment_type]||o)(v)}}(jQuery,window.wc_stripe);
1
+ !function(n,i){function o(t){i.BaseGateway.call(this,t),i.CheckoutGateway.call(this),n(document.body).on("click","#place_order",this.place_order.bind(this)),this.is_current_page("order_pay")&&n("#order_review").on("submit",this.process_order_pay.bind(this)),this.maybe_hide_gateway()}function t(t){this.elementType="idealBank",this.confirmation_method="confirmIdealPayment",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function e(t){this.elementType="p24Bank",this.confirmation_method="confirmP24Payment",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function s(t){this.elementType="iban",this.confirmation_method="confirmSepaDebitPayment",this.setupActionMethod="confirmSepaDebitSetup",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function r(t){this.confirmation_method="confirmKlarnaPayment",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function a(t){this.elementType="fpxBank",this.confirmation_method="confirmFpxPayment",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function h(t){o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function p(t){this.elementType="auBankAccount",this.confirmation_method="confirmAuBecsDebitPayment",this.setupActionMethod="confirmAuBecsDebitSetup",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function c(t){this.confirmation_method="confirmGrabPayPayment",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function _(t){this.confirmation_method="confirmAfterpayClearpayPayment",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function d(t){this.confirmation_method="confirmBoletoPayment",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function m(t){this.confirmation_method="confirmOxxoPayment",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function l(t){this.confirmation_method="confirmGiropayPayment",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function y(t){this.confirmation_method="confirmBancontactPayment",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function u(t){this.elementType="epsBank",this.confirmation_method="confirmEpsPayment",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function f(t){this.confirmation_method="confirmAlipayPayment",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}function g(t){this.confirmation_method="confirmSofortPayment",o.call(this,t),window.addEventListener("hashchange",this.hashChange.bind(this))}(o.prototype=n.extend({},i.BaseGateway.prototype,i.CheckoutGateway.prototype)).initialize=function(){this.mount_button()},o.prototype.elementType=null,o.prototype.is_active=function(){return n("#wc_stripe_local_payment_"+this.gateway_id).data("active")},o.prototype.maybe_hide_gateway=function(){this.is_active()?n(this.container).show():(n(this.container).hide(),this.is_gateway_selected()&&n('li[class*="payment_method_stripe_"]').filter(":visible").eq(0).find('[name="payment_method"]').prop("checked",!0).trigger("click"))},o.prototype.createSource=function(){return new Promise(function(e,t){var i=function(t){t.error?this.submit_error(t.error):(this.payment_token_received=!0,this.set_nonce(t.source.id),this.get_form().trigger("submit")),e()}.bind(this);if(null!=this.elementType)if(this.confirmation_method)if(this.confirmation_obj)this.processConfirmation(this.confirmation_obj);else{if(!this.isValidElement())return this.submit_error({code:"empty_element_"+this.params.local_payment_type,message:wc_stripe_messages.empty_element});this.payment_token_received=!0,this.get_form().trigger("submit")}else this.stripe.createSource(this.element,this.getSourceArgs()).then(i)["catch"](function(t){this.submit_error(t.message)}.bind(this));else this.payment_token_received=!0,this.get_form().trigger("submit")}.bind(this))},o.prototype.place_order=function(t){this.is_gateway_selected()&&(this.payment_token_received||this.is_saved_method_selected()||(t.preventDefault(),this.is_change_payment_method()?this.process_setup_intent():this.createSource()))},o.prototype.process_setup_intent=function(){this.block(),this.create_setup_intent().then(function(){this.stripe[this.setupActionMethod](this.client_secret,this.get_confirmation_args()).then(function(t){if(t.error)return this.submit_error(t.error.message);this.set_nonce(t.setupIntent.payment_method),this.set_intent(t.setupIntent.id),this.payment_token_received=!0,this.get_form().trigger("submit")}.bind(this))}.bind(this))["catch"](function(t){this.submit_error(t)}.bind(this))["finally"](function(){this.unblock()}.bind(this))},o.prototype.checkout_place_order=function(t){return this.is_saved_method_selected()||this.payment_token_received?i.CheckoutGateway.prototype.checkout_place_order.apply(this,arguments):(this.place_order.apply(this,arguments),!1)},o.prototype.process_order_pay=function(t){this.is_gateway_selected()&&(t.preventDefault(),i.CheckoutGateway.prototype.process_order_pay.apply(this,arguments))},o.prototype.show_payment_button=function(){this.show_place_order()},o.prototype.hide_place_order=function(){},o.prototype.show_place_order=function(){i.CheckoutGateway.prototype.show_place_order.apply(this,arguments),this.payment_token_received&&n("#place_order").text(n("#place_order").data("value"))},o.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(this.get_billing_prefix()),email:this.fields.get("billing_email",null)},redirect:{return_url:this.params.return_url}}},o.prototype.updated_checkout=function(){this.mount_button(),this.maybe_hide_gateway()},o.prototype.mount_button=function(){var t="#wc_stripe_local_payment_"+this.gateway_id;n(t).length&&null!=this.elementType&&(n(t).empty(),this.element||(this.element=this.elements.create(this.elementType,this.params.element_params),this.element.on("change",this.handleElementChange.bind(this))),this.elementEmpty=!0,this.element.mount(t))},o.prototype.handleElementChange=function(t){this.elementEmpty=t.empty},o.prototype.load_external_script=function(t){var e=document.createElement("script");e.type="text/javascript",e.src=t,e.onload=function(){this.script_loaded=!0}.bind(this),document.body.appendChild(e)},o.prototype.hashChange=function(t){var e;!this.is_gateway_selected()||(e=window.location.hash.match(/response=(.*)/))&&(history.pushState({},"",window.location.pathname),e=JSON.parse(window.atob(decodeURIComponent(e[1]))),this.processConfirmation(e))},o.prototype.handle_next_action=function(t){this.processConfirmation(t)},o.prototype.processConfirmation=function(i){"payment_intent"===i.type?this.stripe[this.confirmation_method](i.client_secret,this.get_confirmation_args(i)).then(function(t){if(t.error)return this.confirmation_obj=i,this.payment_token_received=!1,this.submit_error(t.error.message);var e=decodeURI(i.order_received_url);"processing"===t.paymentIntent.status&&(e+="&"+n.param({_stripe_local_payment:this.gateway_id,payment_intent:t.paymentIntent.id,payment_intent_client_secret:t.paymentIntent.client_secret})),window.location.href=decodeURI(e)}.bind(this)):this.stripe[this.setupActionMethod](i.client_secret,this.get_confirmation_args(i)).then(function(t){return t.error?this.submit_error(t.error.message):(this.set_nonce(t.setupIntent.payment_method),this.set_intent(t.setupIntent.id),this.process_payment(i.order_id,i.order_key))}.bind(this))},o.prototype.get_confirmation_args=function(t){t=void 0===t?{}:t;t={payment_method:{billing_details:this.get_billing_details()},return_url:t.return_url};return this.elementType&&(t.payment_method[this.params.local_payment_type]=this.element),t},o.prototype.isValidElement=function(){return!this.element||!this.elementEmpty},o.prototype.delete_order_source=function(){return new Promise(function(e,t){n.ajax({url:this.params.routes.delete_order_source,method:"DELETE",dataType:"json",beforeSend:this.ajax_before_send.bind(this)}).done(function(t){e(t)}.bind(this)).fail(function(){t()}.bind(this))}.bind(this))},o.prototype.update_source=function(i){return new Promise(function(e,t){this.updateSourceXhr&&this.updateSourceXhr.abort(),this.updateSourceXhr=n.ajax({url:this.params.routes.update_source,method:"POST",dataType:"json",data:{_wpnonce:this.params.rest_nonce,updates:i,source_id:this.source.id,client_secret:this.source.client_secret,payment_method:this.gateway_id}}).done(function(t){e(t.source)}.bind(this)).fail(function(){t()})}.bind(this))},h.prototype.updated_checkout=function(){!this.script_loaded&&n(this.container).length&&this.load_external_script(this.params.qr_script),o.prototype.updated_checkout.apply(this,arguments)},h.prototype.hashChange=function(t){var e;!this.is_gateway_selected()||(e=window.location.hash.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:parseInt(this.params.qr_size),height:parseInt(this.params.qr_size),colorDark:"#424770",colorLight:"#f8fbfd",correctLevel:QRCode.CorrectLevel.H}),n("#wc_stripe_local_payment_stripe_wechat").append('<p class="qrcode-message">'+this.params.qr_message+"</p>"),this.payment_token_received=!0,this.show_place_order())},h.prototype.place_order=function(t){this.qrcode&&this.payment_token_received?(t.preventDefault(),window.location=this.qrcode.redirect):o.prototype.place_order.apply(this,arguments)},_.prototype.is_currency_supported=function(){return-1<this.params.currencies.indexOf(this.get_currency())},_.prototype.updated_checkout=function(){this.maybe_hide_gateway(),this.has_gateway_data()&&this.is_currency_supported()&&(this.add_eligibility(this.container,parseFloat(this.get_total_price())),this.elements=this.stripe.elements(this.get_element_options()),this.initialize_messaging())},_.prototype.initialize=function(){this.has_gateway_data()&&this.is_currency_supported()&&(this.add_eligibility(this.container,parseFloat(this.get_total_price())),this.initialize_messaging())},_.prototype.initialize_messaging=function(){this.msgElement=this.elements.create("afterpayClearpayMessage",n.extend({},this.params.msg_options,{amount:this.get_total_price_cents(),currency:this.get_currency()})),this.mount_message()},_.prototype.mount_message=function(t){t&&this.msgElement.update({amount:this.get_total_price_cents(),currency:this.get_currency()}),n('label[for="payment_method_stripe_afterpay"]').find("#wc-stripe-afterpay-msg").length||n('label[for="payment_method_stripe_afterpay"]').append('<div id="wc-stripe-afterpay-msg"></div>'),this.msgElement.mount("#wc-stripe-afterpay-msg")},_.prototype.add_eligibility=function(t,e){i.Afterpay.prototype.add_eligibility.apply(this,arguments),this.is_eligible(e)||n(this.container).find(".wc-stripe-afterpay__offsite").addClass("afterpay-ineligible")},d.prototype.get_confirmation_args=function(t){t=o.prototype.get_confirmation_args.call(this,t);return t.payment_method.boleto={tax_id:this.get_tax_id()},t},d.prototype.createSource=function(){var t=this.get_tax_id();if(!t||!t.match(/^(\w{3}\.){2}\w{3}-\w{2}$|^(\w{11}|\w{14})$|^\w{2}\.\w{3}\.\w{3}\/\w{4}-\w{2}$/))return this.submit_error({code:"incomplete_boleto_tax_id"});this.payment_token_received=!0,this.get_form().trigger("submit")},d.prototype.get_tax_id=function(){return n("#wc_stripe_boleto_tax_id").val()},s.prototype.updated_checkout=function(t){o.prototype.updated_checkout.apply(this,arguments);var e=n('[name="billing_country"]').val();e&&this.element&&this.element.update({placeholderCountry:e})},g.prototype.get_confirmation_args=function(){var t=o.prototype.get_confirmation_args.apply(this,arguments);return t.payment_method.sofort={country:t.payment_method.billing_details.address.country},t},t.prototype=n.extend({},o.prototype,t.prototype),e.prototype=n.extend({},o.prototype,e.prototype),s.prototype=n.extend({},o.prototype,s.prototype),r.prototype=n.extend({},o.prototype,r.prototype),a.prototype=n.extend({},o.prototype,a.prototype),h.prototype=n.extend({},o.prototype,h.prototype),p.prototype=n.extend({},o.prototype,p.prototype),c.prototype=n.extend({},o.prototype,c.prototype),_.prototype=n.extend({},o.prototype,i.Afterpay.prototype,_.prototype),d.prototype=n.extend({},o.prototype,d.prototype),m.prototype=n.extend({},o.prototype,m.prototype),l.prototype=n.extend({},o.prototype,l.prototype),y.prototype=n.extend({},o.prototype,y.prototype),u.prototype=n.extend({},o.prototype,u.prototype),f.prototype=n.extend({},o.prototype,f.prototype),g.prototype=n.extend({},o.prototype,g.prototype);var w,b={ideal:t,p24:e,sepa_debit:s,klarna:r,fpx:a,wechat:h,au_becs_debit:p,grabpay:c,afterpay_clearpay:_,boleto:d,oxxo:m,giropay:l,bancontact:y,eps:u,alipay:f,sofort:g};for(w in wc_stripe_local_payment_params.gateways){var v=wc_stripe_local_payment_params.gateways[w];new(b[v.local_payment_type]||o)(v)}}(jQuery,window.wc_stripe);
assets/js/frontend/wc-stripe.js CHANGED
@@ -20,12 +20,20 @@
20
  this.payment_token_received = false;
21
  this.stripe = stripe;
22
  this.fields = checkoutFields;
23
- this.elements = stripe.elements($.extend({}, {
24
- locale: 'auto'
25
- }, this.get_element_options()));
26
  this.initialize();
27
  };
28
 
 
 
 
 
 
 
 
 
 
 
29
  wc_stripe.BaseGateway.prototype.get_page = function () {
30
  var page = wc_stripe_params_v3.page;
31
  if ('cart' === page && $(document.body).is('.woocommerce-checkout')) {
@@ -91,6 +99,11 @@
91
 
92
  wc_stripe.BaseGateway.prototype.get_error_message = function (message) {
93
  if (typeof message == 'object') {
 
 
 
 
 
94
  if (message.code && wc_stripe_messages[message.code]) {
95
  message = wc_stripe_messages[message.code];
96
  } else {
@@ -528,7 +541,7 @@
528
  }
529
 
530
  wc_stripe.BaseGateway.prototype.ajax_before_send = function (xhr) {
531
- if (this.params.user_id > 0) {
532
  xhr.setRequestHeader('X-WP-Nonce', this.params.rest_nonce);
533
  }
534
  };
@@ -863,7 +876,7 @@
863
  };
864
 
865
  wc_stripe.CheckoutGateway.prototype.has3DSecureParams = function () {
866
- if (this.is_current_page('order_pay') || this.is_change_payment_method()) {
867
  if (window.location.hash && typeof window.location.hash === 'string') {
868
  var match = window.location.hash.match(/response=(.*)/);
869
  if (match) {
@@ -1017,6 +1030,10 @@
1017
  this.on_payment_method_selected(null, $('[name="payment_method"]:checked').val());
1018
  };
1019
 
 
 
 
 
1020
  wc_stripe.CheckoutGateway.prototype.on_payment_method_selected = function (e, payment_method) {
1021
  if (payment_method === this.gateway_id) {
1022
  if (this.payment_token_received || this.is_saved_method_selected()) {
@@ -1067,6 +1084,37 @@
1067
  $('[name="' + this.gateway_id + '_save_source_key' + '"]').prop('checked', bool);
1068
  }
1069
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1070
  /************** Product Gateway ***************/
1071
 
1072
  wc_stripe.ProductGateway = function () {
@@ -2130,12 +2178,7 @@
2130
  }
2131
 
2132
  try {
2133
- stripe = Stripe(wc_stripe_params_v3.api_key, (function () {
2134
- if (wc_stripe_params_v3.mode === 'test' && wc_stripe_params_v3.account === '') {
2135
- return {};
2136
- }
2137
- return {stripeAccount: wc_stripe_params_v3.account};
2138
- }()));
2139
  } catch (error) {
2140
  window.alert(error);
2141
  console.log(error);
20
  this.payment_token_received = false;
21
  this.stripe = stripe;
22
  this.fields = checkoutFields;
23
+ this.elements = this.create_stripe_elements();
 
 
24
  this.initialize();
25
  };
26
 
27
+ wc_stripe.BaseGateway.prototype.create_stripe_elements = function () {
28
+ return stripe.elements($.extend({}, {
29
+ locale: 'auto'
30
+ }, this.get_element_options()));
31
+ }
32
+
33
+ wc_stripe.BaseGateway.prototype.is_user_logged_in = function () {
34
+ return this.params.user_id > 0;
35
+ }
36
+
37
  wc_stripe.BaseGateway.prototype.get_page = function () {
38
  var page = wc_stripe_params_v3.page;
39
  if ('cart' === page && $(document.body).is('.woocommerce-checkout')) {
99
 
100
  wc_stripe.BaseGateway.prototype.get_error_message = function (message) {
101
  if (typeof message == 'object') {
102
+ if (message.hasOwnProperty('message')) {
103
+ if (message.message.indexOf('server_side_confirmation_beta=v1') > -1) {
104
+ message.code = 'server_side_confirmation_beta';
105
+ }
106
+ }
107
  if (message.code && wc_stripe_messages[message.code]) {
108
  message = wc_stripe_messages[message.code];
109
  } else {
541
  }
542
 
543
  wc_stripe.BaseGateway.prototype.ajax_before_send = function (xhr) {
544
+ if (this.is_user_logged_in()) {
545
  xhr.setRequestHeader('X-WP-Nonce', this.params.rest_nonce);
546
  }
547
  };
876
  };
877
 
878
  wc_stripe.CheckoutGateway.prototype.has3DSecureParams = function () {
879
+ if (this.is_current_page('order_pay') || this.is_current_page('checkout') || this.is_change_payment_method()) {
880
  if (window.location.hash && typeof window.location.hash === 'string') {
881
  var match = window.location.hash.match(/response=(.*)/);
882
  if (match) {
1030
  this.on_payment_method_selected(null, $('[name="payment_method"]:checked').val());
1031
  };
1032
 
1033
+ wc_stripe.CheckoutGateway.prototype.show_new_payment_method = function () {
1034
+ $('[name="' + this.gateway_id + '_payment_type_key"][value="new"').trigger('click');
1035
+ }
1036
+
1037
  wc_stripe.CheckoutGateway.prototype.on_payment_method_selected = function (e, payment_method) {
1038
  if (payment_method === this.gateway_id) {
1039
  if (this.payment_token_received || this.is_saved_method_selected()) {
1084
  $('[name="' + this.gateway_id + '_save_source_key' + '"]').prop('checked', bool);
1085
  }
1086
 
1087
+ wc_stripe.CheckoutGateway.prototype.process_order_pay = function () {
1088
+ var data = this.get_form().serializeArray();
1089
+ data.push({name: '_wpnonce', value: this.params.rest_nonce});
1090
+ data.push({name: 'order_id', value: this.params.order_id});
1091
+ data.push({name: 'order_key', value: this.params.order_key});
1092
+ this.block();
1093
+ $.ajax({
1094
+ url: this.params.routes.order_pay,
1095
+ method: 'POST',
1096
+ dataType: 'json',
1097
+ data: $.param(data)
1098
+ }).done(function (response) {
1099
+ if (response.success) {
1100
+ if (response.needs_confirmation) {
1101
+ if (response.data) {
1102
+ this.handle_next_action(response.data);
1103
+ } else {
1104
+ window.location.href = response.redirect;
1105
+ }
1106
+ } else {
1107
+ this.get_form().trigger('submit');
1108
+ }
1109
+ } else {
1110
+ this.submit_error(response.message);
1111
+ }
1112
+ }.bind(this)).fail(function (jqXHR, textStatus, errorThrown) {
1113
+ this.unblock();
1114
+ this.submit_error(errorThrown);
1115
+ }.bind(this))
1116
+ }
1117
+
1118
  /************** Product Gateway ***************/
1119
 
1120
  wc_stripe.ProductGateway = function () {
2178
  }
2179
 
2180
  try {
2181
+ stripe = Stripe(wc_stripe_params_v3.api_key, wc_stripe_params_v3.stripeParams);
 
 
 
 
 
2182
  } catch (error) {
2183
  window.alert(error);
2184
  console.log(error);
assets/js/frontend/wc-stripe.min.js CHANGED
@@ -1 +1 @@
1
- !function(a,o){a.wc_stripe={};var i=null;"undefined"==typeof wc_stripe_checkout_fields&&(a.wc_stripe_checkout_fields=[]),wc_stripe.BaseGateway=function(t,e){this.params=t,this.gateway_id=this.params.gateway_id,this.container=void 0===e?"li.payment_method_".concat(this.gateway_id):e,o(this.container).length||(this.container=".payment_method_".concat(this.gateway_id)),this.token_selector=this.params.token_selector,this.saved_method_selector=this.params.saved_method_selector,this.payment_token_received=!1,this.stripe=i,this.fields=r,this.elements=i.elements(o.extend({},{locale:"auto"},this.get_element_options())),this.initialize()},wc_stripe.BaseGateway.prototype.get_page=function(){var t=wc_stripe_params_v3.page;return"cart"===t&&o(document.body).is(".woocommerce-checkout")&&(t="checkout"),t},wc_stripe.BaseGateway.prototype.set_nonce=function(t){this.fields.set(this.gateway_id+"_token_key",t),o(this.token_selector).val(t)},wc_stripe.BaseGateway.prototype.set_intent=function(t){this.fields.set(this.gateway_id+"_payment_intent_key",t),o("#"+this.gateway_id+"_payment_intent_key").val(t)},wc_stripe.BaseGateway.prototype.get_element_options=function(){return this.params.elementOptions},wc_stripe.BaseGateway.prototype.initialize=function(){},wc_stripe.BaseGateway.prototype.create_button=function(){},wc_stripe.BaseGateway.prototype.is_gateway_selected=function(){return o('[name="payment_method"]:checked').val()===this.gateway_id},wc_stripe.BaseGateway.prototype.is_saved_method_selected=function(){return this.is_gateway_selected()&&"saved"===o('[name="'+this.gateway_id+'_payment_type_key"]:checked').val()},wc_stripe.BaseGateway.prototype.has_checkout_error=function(){return 0<o("#wc_stripe_checkout_error").length&&this.is_gateway_selected()},wc_stripe.BaseGateway.prototype.submit_error=function(t,e){var i=this.get_error_message(t);i.indexOf("</ul>")<0&&(i='<div class="'+function(){var t="woocommerce-NoticeGroup";return this.is_current_page("checkout")&&(t+=" woocommerce-NoticeGroup-checkout"),t}.bind(this)()+'"><ul class="woocommerce-error"><li>'+i+"</li></ul></div>");t=o(document.body).triggerHandler("wc_stripe_submit_error",[i,t,this]);i=void 0===t?i:t,this.submit_message(i,e)},wc_stripe.BaseGateway.prototype.submit_error_code=function(t){console.log(t)},wc_stripe.BaseGateway.prototype.get_error_message=function(t){return"object"==typeof t&&(t=t.code&&wc_stripe_messages[t.code]?wc_stripe_messages[t.code]:t.message),t},wc_stripe.BaseGateway.prototype.submit_message=function(t,e){o(".woocommerce-NoticeGroup-checkout, .woocommerce-error, .woocommerce-message").remove();var i=o(this.message_container);i.length&&(e||!i.closest("form").length)||(i.length||(i=o(this.container)),i=i.closest("form")),i.prepend(t),i.removeClass("processing").unblock(),i.find(".input-text, select, input:checkbox").trigger("blur"),o.scroll_to_notices?o.scroll_to_notices(i):o("html, body").animate({scrollTop:i.offset().top-100},1e3)},wc_stripe.BaseGateway.prototype.get_billing_details=function(){var t=this.get_billing_prefix(),t={name:this.get_customer_name(t),address:{city:this.fields.get(t+"_city",null),country:this.fields.get(t+"_country",null),line1:this.fields.get(t+"_address_1",null),line2:this.fields.get(t+"_address_2",null),postal_code:this.fields.get(t+"_postcode",null),state:this.fields.get(t+"_state",null)}};return t.name&&" "!==t.name||delete t.name,""!=this.fields.get("billing_email")&&(t.email=this.fields.get("billing_email")),""!=this.fields.get("billing_phone")&&(t.phone=this.fields.get("billing_phone")),t},wc_stripe.BaseGateway.prototype.get_first_name=function(t){return o("#"+t+"_first_name").val()},wc_stripe.BaseGateway.prototype.get_last_name=function(t){return o("#"+t+"_last_name").val()},wc_stripe.BaseGateway.prototype.get_shipping_prefix=function(){return this.needs_shipping()&&0<o('[name="ship_to_different_address"]').length&&o('[name="ship_to_different_address"]').is(":checked")?"shipping":"billing"},wc_stripe.BaseGateway.prototype.get_billing_prefix=function(){var t="billing";o('[name="billing_same_as_shipping"]').length&&o('[name="billing_same_as_shipping"]').is(":checked")&&(t="shipping"),o('[name="bill_to_different_address"]').length&&(1<o('[name="bill_to_different_address"]').length?"same_as_shipping"===o('[name="bill_to_different_address"]:checked').val()&&(t="shipping"):o('[name="bill_to_different_address"]').is(":checked")||(t="shipping"));var e=o(document.body).triggerHandler("wc_stripe_get_billing_prefix",[t]);return void 0===e?t:e},wc_stripe.BaseGateway.prototype.should_save_method=function(){return o("#"+this.gateway_id+"_save_source_key").is(":checked")},wc_stripe.BaseGateway.prototype.is_add_payment_method_page=function(){return"add_payment_method"===this.get_page()||o(document.body).hasClass("woocommerce-add-payment-method")},wc_stripe.BaseGateway.prototype.is_change_payment_method=function(){return"change_payment_method"===this.get_page()},wc_stripe.BaseGateway.prototype.get_selected_payment_method=function(){return o(this.saved_method_selector).val()},wc_stripe.BaseGateway.prototype.needs_shipping=function(){return this.get_gateway_data().needs_shipping},wc_stripe.BaseGateway.prototype.get_currency=function(){return this.get_gateway_data().currency},wc_stripe.BaseGateway.prototype.get_gateway_data=function(){var t=o(this.container).find(".woocommerce_".concat(this.gateway_id,"_gateway_data")).data("gateway");return void 0===t&&this.is_current_page("checkout")&&void 0===(t=o("form.checkout").find(".woocommerce_".concat(this.gateway_id,"_gateway_data")).data("gateway"))&&(t=o(".woocommerce_"+this.gateway_id+"_gateway_data").data("gateway")),t},wc_stripe.BaseGateway.prototype.set_gateway_data=function(t){o(this.container).find(".woocommerce_".concat(this.gateway_id,"_gateway_data")).data("gateway",t)},wc_stripe.BaseGateway.prototype.has_gateway_data=function(){return void 0!==this.get_gateway_data()},wc_stripe.BaseGateway.prototype.get_customer_name=function(t){return this.fields.get(t+"_first_name")+" "+this.fields.get(t+"_last_name")},wc_stripe.BaseGateway.prototype.get_customer_email=function(){return this.fields.get("billing_email")},wc_stripe.BaseGateway.prototype.get_address_field_hash=function(t){for(var e=["_first_name","_last_name","_address_1","_address_2","_postcode","_city","_state","_country"],i="",s=0;s<e.length;s++)i+=this.fields.get(t+e[s])+"_";return i},wc_stripe.BaseGateway.prototype.block=function(){o().block&&o.blockUI({message:null,overlayCSS:{background:"#fff",opacity:.6}})},wc_stripe.BaseGateway.prototype.unblock=function(){o().block&&o.unblockUI()},wc_stripe.BaseGateway.prototype.get_form=function(){return o(this.token_selector).closest("form")},wc_stripe.BaseGateway.prototype.get_total_price=function(){return this.get_gateway_data().total},wc_stripe.BaseGateway.prototype.get_total_price_cents=function(){return this.get_gateway_data().total_cents},wc_stripe.BaseGateway.prototype.set_total_price=function(t){var e=this.get_gateway_data();e.total=t,this.set_gateway_data(e)},wc_stripe.BaseGateway.prototype.set_total_price_cents=function(t){var e=this.get_gateway_data();e.total_cents=t,this.set_gateway_data(e)},wc_stripe.BaseGateway.prototype.set_payment_method=function(t){o('[name="payment_method"][value="'+t+'"]').prop("checked",!0).trigger("click")},wc_stripe.BaseGateway.prototype.set_selected_shipping_methods=function(t){if(this.fields.set("shipping_method",t),t&&o('[name^="shipping_method"]').length)for(var e in t){var i=t[e];o('[name="shipping_method['+e+']"][value="'+i+'"]').prop("checked",!0).trigger("change")}},wc_stripe.BaseGateway.prototype.on_token_received=function(t){this.payment_token_received=!0,this.set_nonce(t.id),this.process_checkout()},wc_stripe.BaseGateway.prototype.createPaymentRequest=function(){try{this.payment_request_options=this.get_payment_request_options(),this.paymentRequest=i.paymentRequest(this.payment_request_options),this.payment_request_options.requestShipping&&(this.paymentRequest.on("shippingaddresschange",this.update_shipping_address.bind(this)),this.paymentRequest.on("shippingoptionchange",this.update_shipping_method.bind(this))),this.paymentRequest.on("paymentmethod",this.on_payment_method_received.bind(this))}catch(t){return void this.submit_error(t.message)}},wc_stripe.BaseGateway.prototype.get_payment_request_options=function(){var t={country:this.params.country_code,currency:this.get_currency().toLowerCase(),total:{amount:this.get_total_price_cents(),label:this.params.total_label,pending:!0},requestPayerName:function(){return!this.is_current_page("checkout")||!this.is_valid_address(this.get_address_object("billing"),"billing",["email","phone"])}.bind(this)(),requestPayerEmail:this.fields.requestFieldInWallet("billing_email"),requestPayerPhone:this.fields.requestFieldInWallet("billing_phone"),requestShipping:function(){if(this.needs_shipping()){var t=this.get_shipping_prefix();if(this.is_current_page("checkout")&&!this.is_valid_address(this.get_address_object(t),t,["email","phone"])||!this.is_current_page("checkout"))return!0}return!1}.bind(this)()},e=this.get_display_items(),i=this.get_shipping_options();return e&&(t.displayItems=e),t.requestShipping&&i&&(t.shippingOptions=i),t},wc_stripe.BaseGateway.prototype.get_payment_request_update=function(t){var e={currency:this.get_currency().toLowerCase(),total:{amount:parseInt(this.get_total_price_cents()),label:this.params.total_label,pending:!0}},i=this.get_display_items(),s=this.get_shipping_options();return i&&(e.displayItems=i),this.payment_request_options.requestShipping&&s&&(e.shippingOptions=s),t&&(e=o.extend(!0,{},e,t)),e},wc_stripe.BaseGateway.prototype.get_display_items=function(){return this.get_gateway_data().items},wc_stripe.BaseGateway.prototype.set_display_items=function(t){var e=this.get_gateway_data();e.items=t,this.set_gateway_data(e)},wc_stripe.BaseGateway.prototype.get_shipping_options=function(){return this.get_gateway_data().shipping_options},wc_stripe.BaseGateway.prototype.set_shipping_options=function(t){var e=this.get_gateway_data();e.shipping_options=t,this.set_gateway_data(e)},wc_stripe.BaseGateway.prototype.map_address=function(t){return{city:t.city,postcode:t.postalCode,state:t.region,country:t.country}},wc_stripe.BaseGateway.prototype.on_payment_method_received=function(t){try{this.payment_response=t,this.populate_checkout_fields(t),t.complete("success"),this.on_token_received(t.paymentMethod)}catch(e){a.alert(e)}},wc_stripe.BaseGateway.prototype.populate_checkout_fields=function(t){this.set_nonce(t.paymentMethod.id),this.update_addresses(t)},wc_stripe.BaseGateway.prototype.update_addresses=function(t){t.payerName&&this.fields.set("name",t.payerName,"billing"),t.payerEmail&&this.fields.set("email",t.payerEmail,"billing"),t.payerPhone&&(this.fields.set("phone",t.payerPhone,"billing"),this.fields.exists("shipping_phone")&&this.fields.isEmpty("shipping_phone")&&this.fields.set("shipping_phone",t.payerPhone)),t.shippingAddress&&this.populate_shipping_fields(t.shippingAddress),t.paymentMethod.billing_details.address&&this.populate_billing_fields(t.paymentMethod.billing_details.address)},wc_stripe.BaseGateway.prototype.populate_address_fields=function(t,e){for(var i in t)null!==t[i]&&this.fields.set(i,t[i],e)},wc_stripe.BaseGateway.prototype.populate_billing_fields=function(t){this.populate_address_fields(t,"billing")},wc_stripe.BaseGateway.prototype.populate_shipping_fields=function(t){this.populate_address_fields(t,"shipping")},wc_stripe.BaseGateway.prototype.get_address_fields=function(){return["first_name","last_name","country","address_1","address_2","city","state","postcode","phone","email"]},wc_stripe.BaseGateway.prototype.get_address_object=function(e){var i={};return this.get_address_fields().forEach(function(t){i[t]=this.fields.get(t,e)}.bind(this)),i},wc_stripe.BaseGateway.prototype.is_current_page=function(t){return Array.isArray(t)?-1<t.indexOf(this.get_page()):this.get_page()===t},wc_stripe.BaseGateway.prototype.is_valid_address=function(t,e,i){if(o.isEmptyObject(t))return!1;var s=this.get_address_fields();void 0!==i&&i.forEach(function(t){-1<s.indexOf(t)&&s.splice(s.indexOf(t),1)});for(var a=0;a<s.length;a++){var n=s[a];if(this.fields.required(e+"_"+n)&&(!t[n]||"undefined"==typeof t[n]||!this.fields.isValid(n,t[n],t)))return!1}return!0},wc_stripe.BaseGateway.prototype.ajax_before_send=function(t){0<this.params.user_id&&t.setRequestHeader("X-WP-Nonce",this.params.rest_nonce)},wc_stripe.BaseGateway.prototype.process_checkout=function(){return new Promise(function(){this.block(),o.ajax({url:this.params.routes.checkout,method:"POST",dataType:"json",data:o.extend({},this.serialize_fields(),{payment_method:this.gateway_id,page_id:this.get_page(),currency:this.get_currency()}),beforeSend:this.ajax_before_send.bind(this)}).done(function(t){t.reload?a.location.reload():"success"===t.result?a.location=t.redirect:(t.messages&&this.submit_error(t.messages),this.unblock())}.bind(this)).fail(function(t,e,i){this.unblock(),this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.BaseGateway.prototype.process_payment=function(t,e){o.ajax({method:"POST",url:this.params.routes.checkout_payment,dataType:"json",data:o.extend({},this.fields.toJson(),{order_id:t,order_key:e}),beforeSend:this.ajax_before_send.bind(this)}).done(function(t){if(t.result&&"success"===t.result)a.location=t.redirect;else{if(t.reload)return a.location.reload();t.messages?(this.payment_token_received=!1,this.submit_error(t.messages)):this.submit_error(wc_checkout_params.i18n_checkout_error)}}.bind(this)).fail(function(){}.bind(this))},wc_stripe.BaseGateway.prototype.handle_next_action=function(e){try{return this.stripe[this.handleActionMethod](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().trigger("submit"):this.process_payment(e.order_id,e.order_key)}.bind(this))["catch"](function(t){this.submit_error(t.message)}.bind(this)),!1}catch(t){}},wc_stripe.BaseGateway.prototype.handle_payment_method_setup=function(e){try{return this.stripe[this.setupActionMethod](e.client_secret).then(function(t){if(t.error)return this.payment_token_received=!1,this.submit_error(t.error);this.is_current_page("order_pay")?this.get_form().trigger("submit"):this.process_payment(e.order_id,e.order_key)}.bind(this))["catch"](function(t){this.submit_error(t.message)}.bind(this)),!1}catch(t){}},wc_stripe.BaseGateway.prototype.hashchange=function(t){var e=a.location.hash.match(/response=(.*)/);if(e)try{var i=JSON.parse(a.atob(decodeURIComponent(e[1])));i&&i.hasOwnProperty("client_secret")&&i.gateway_id===this.gateway_id&&(history.pushState({},"",a.location.pathname),"intent"===i.type?this.handle_next_action(i):this.handle_payment_method_setup(i))}catch(s){}return!0},wc_stripe.BaseGateway.prototype.sync_payment_intent=function(t,s){return new Promise(function(e,i){o.ajax({method:"POST",dataType:"json",url:this.params.routes.sync_intent,data:{order_id:t,client_secret:s},beforeSend:this.ajax_before_send.bind(this)}).done(function(t){(t.code?i:e)(t)}).fail(function(t,e,i){this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.BaseGateway.prototype.create_setup_intent=function(){return new Promise(function(e,i){o.ajax({method:"POST",dataType:"json",data:{payment_method:this.gateway_id},url:this.params.routes.setup_intent,beforeSend:this.ajax_before_send.bind(this)}).done(function(t){t.code?i(t.message):(this.client_secret=t.intent.client_secret,e(t))}.bind(this)).fail(function(t,e,i){this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.BaseGateway.prototype.serialize_form=function(t){var e,i=t.find("input").filter(function(t,e){return!o(e).is('[name^="add-to-cart"]')}.bind(this)).serializeArray(),s={};for(e in i){var a=i[e];s[a.name]=a.value}return s.payment_method=this.gateway_id,s},wc_stripe.BaseGateway.prototype.serialize_fields=function(){return o.extend({},this.fields.toJson(),o(document.body).triggerHandler("wc_stripe_process_checkout_data",[this,this.fields]))},wc_stripe.BaseGateway.prototype.map_shipping_methods=function(t){var e={};return"default"===t||1<(t=t.match(/^([\w+]):(.+)$/)).length&&(e[t[1]]=t[2]),e},wc_stripe.BaseGateway.prototype.maybe_set_ship_to_different=function(){o('[name="ship_to_different_address"]').length&&o('[name="ship_to_different_address"]').prop("checked",this.get_address_field_hash("billing")!==this.get_address_field_hash("shipping")).trigger("change")},wc_stripe.BaseGateway.prototype.update_shipping_address=function(s){return new Promise(function(e,i){o.ajax({url:this.params.routes.shipping_address,method:"POST",dataType:"json",data:{address:this.map_address(s.shippingAddress),payment_method:this.gateway_id,page_id:this.get_page(),currency:this.get_currency()},beforeSend:this.ajax_before_send.bind(this)}).done(function(t){t.code?(s.updateWith(t.data.newData),i(t.data)):(s.updateWith(t.data.newData),this.fields.set("shipping_method",t.data.shipping_method),e(t.data))}.bind(this)).fail(function(){}.bind(this))}.bind(this))},wc_stripe.BaseGateway.prototype.update_shipping_method=function(s){return new Promise(function(e,i){o.ajax({url:this.params.routes.shipping_method,method:"POST",dataType:"json",data:{shipping_method:s.shippingOption.id,payment_method:this.gateway_id,currency:this.get_currency(),page_id:this.get_page()},beforeSend:this.ajax_before_send.bind(this)}).done(function(t){t.code?(s.updateWith(t.data.newData),i(t.data)):(this.set_selected_shipping_methods(t.data.shipping_methods),s.updateWith(t.data.newData),e(t.data))}.bind(this)).fail(function(t,e,i){this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.CheckoutGateway=function(){this.message_container="li.payment_method_"+this.gateway_id,this.banner_container="li.banner_payment_method_"+this.gateway_id,o(document.body).on("update_checkout",this.update_checkout.bind(this)),o(document.body).on("updated_checkout",this.updated_checkout.bind(this)),o(document.body).on("updated_checkout",this.container_styles.bind(this)),o(document.body).on("checkout_error",this.checkout_error.bind(this)),o(this.token_selector).closest("form").on("checkout_place_order_"+this.gateway_id,this.checkout_place_order.bind(this)),o(document.body).on("wc_stripe_new_method_"+this.gateway_id,this.on_show_new_methods.bind(this)),o(document.body).on("wc_stripe_saved_method_"+this.gateway_id,this.on_show_saved_methods.bind(this)),o(document.body).on("wc_stripe_payment_method_selected",this.on_payment_method_selected.bind(this)),this.banner_enabled()&&o(".woocommerce-billing-fields").length&&o(".wc-stripe-banner-checkout").css("max-width",o(".woocommerce-billing-fields").outerWidth(!0)),this.container_styles(),this.hasOrderReviewParams()},wc_stripe.CheckoutGateway.prototype.container_styles=function(){this.params.description||o(this.container).addClass("wc-stripe-no-desc"),o(this.container).find(".wc-stripe-saved-methods").length||o(this.container).find(".payment_box").addClass("wc-stripe-no-methods")},wc_stripe.CheckoutGateway.prototype.hasOrderReviewParams=function(){var t=a.location.search.match(/_stripe_order_review=(.+)/);if(t&&1<t.length)try{var e=JSON.parse(a.atob(decodeURIComponent(t[1])));this.gateway_id===e.payment_method&&(o(function(){this.payment_token_received=!0,this.set_nonce(e.payment_nonce),this.set_use_new_option(!0)}.bind(this)),history.pushState({},"",a.location.pathname))}catch(i){}},wc_stripe.CheckoutGateway.prototype.has3DSecureParams=function(){if((this.is_current_page("order_pay")||this.is_change_payment_method())&&a.location.hash&&"string"==typeof a.location.hash){var t=a.location.hash.match(/response=(.*)/);if(t)try{var e=JSON.parse(a.atob(decodeURIComponent(t[1])));e&&e.hasOwnProperty("client_secret")&&e.gateway_id===this.gateway_id&&(o(function(){this.set_payment_method(this.gateway_id),this.set_use_new_option(!0),this.set_nonce(e.pm),!0===e.save_method&&this.set_save_payment_method(!0),o('[name="terms"]').prop("checked",!0)}.bind(this)),history.pushState({},"",a.location.pathname+a.location.search),this.handle_next_action(e))}catch(i){}}},wc_stripe.CheckoutGateway.prototype.update_shipping_address=function(){return wc_stripe.BaseGateway.prototype.update_shipping_address.apply(this,arguments).then(function(t){this.populate_address_fields(t.address,this.get_shipping_prefix()),this.fields.toFormFields({update_shipping_method:!1})}.bind(this))},wc_stripe.CheckoutGateway.prototype.updated_checkout=function(){},wc_stripe.CheckoutGateway.prototype.update_checkout=function(){},wc_stripe.CheckoutGateway.prototype.checkout_error=function(){this.has_checkout_error()&&(this.payment_token_received=!1,this.payment_response=null,this.show_payment_button(),this.hide_place_order())},wc_stripe.CheckoutGateway.prototype.is_valid_checkout=function(){return!(o('[name="terms"]').length&&o('[name="terms"]').is(":visible")&&!o('[name="terms"]').is(":checked"))},wc_stripe.CheckoutGateway.prototype.get_payment_method=function(){return o('[name="payment_method"]:checked').val()},wc_stripe.CheckoutGateway.prototype.set_use_new_option=function(t){o("#"+this.gateway_id+"_use_new").prop("checked",t).trigger("change")},wc_stripe.CheckoutGateway.prototype.checkout_place_order=function(){return this.is_valid_checkout()?!!this.is_saved_method_selected()||this.payment_token_received:(this.submit_error(this.params.messages.terms),!1)},wc_stripe.CheckoutGateway.prototype.on_token_received=function(t){this.payment_token_received=!0,this.set_nonce(t.id),this.hide_payment_button(),this.show_place_order()},wc_stripe.CheckoutGateway.prototype.block=function(){o().block&&this.get_form().block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},wc_stripe.CheckoutGateway.prototype.unblock=function(){o().block&&this.get_form().unblock()},wc_stripe.CheckoutGateway.prototype.hide_place_order=function(){o("#place_order").addClass("wc-stripe-hide")},wc_stripe.CheckoutGateway.prototype.show_place_order=function(){o("#place_order").removeClass("wc-stripe-hide")},wc_stripe.CheckoutGateway.prototype.on_show_new_methods=function(){this.payment_token_received?(this.show_place_order(),this.hide_payment_button()):(this.hide_place_order(),this.show_payment_button())},wc_stripe.CheckoutGateway.prototype.on_show_saved_methods=function(){this.hide_payment_button(),this.show_place_order()},wc_stripe.CheckoutGateway.prototype.show_payment_button=function(){this.$button&&this.$button.show()},wc_stripe.CheckoutGateway.prototype.hide_payment_button=function(){this.$button&&this.$button.hide()},wc_stripe.CheckoutGateway.prototype.trigger_payment_method_selected=function(){this.on_payment_method_selected(null,o('[name="payment_method"]:checked').val())},wc_stripe.CheckoutGateway.prototype.on_payment_method_selected=function(t,e){e===this.gateway_id?this.payment_token_received||this.is_saved_method_selected()?(this.hide_payment_button(),this.show_place_order()):(this.show_payment_button(),this.hide_place_order()):(this.hide_payment_button(),e&&e.indexOf("stripe_")<0&&this.show_place_order())},wc_stripe.CheckoutGateway.prototype.banner_enabled=function(){return"1"===this.params.banner_enabled},wc_stripe.CheckoutGateway.prototype.checkout_fields_valid=function(){if(["checkout","order_pay"].indexOf(this.get_page())<0)return!0;var t=!0;return(t=this.fields.validateFields("billing"))?this.needs_shipping()&&o("#ship-to-different-address-checkbox").is(":checked")?(t=this.fields.validateFields("shipping"))||this.submit_error(this.params.messages.required_field):(t=this.is_valid_checkout())||this.submit_error(this.params.messages.terms):this.submit_error(this.params.messages.required_field),t},wc_stripe.CheckoutGateway.prototype.cart_contains_subscription=function(){return"undefined"!=typeof wc_stripe_cart_contains_subscription&&!0===wc_stripe_cart_contains_subscription},wc_stripe.CheckoutGateway.prototype.set_save_payment_method=function(t){o('[name="'+this.gateway_id+'_save_source_key"]').prop("checked",t)},wc_stripe.ProductGateway=function(){this.message_container="div.product",o("form.cart").on("found_variation",this.found_variation.bind(this)),o("form.cart").on("reset_data",this.reset_variation_data.bind(this)),this.buttonWidth=o("form.cart div.quantity").outerWidth(!0)+o(".single_add_to_cart_button").outerWidth();var t=o(".single_add_to_cart_button").css("marginLeft");t&&(this.buttonWidth+=parseInt(t.replace("px",""))),o(this.container).css("max-width",this.buttonWidth+"px")},wc_stripe.ProductGateway.prototype.get_quantity=function(){return parseInt(o('[name="quantity"]').val())},wc_stripe.ProductGateway.prototype.set_rest_nonce=function(t,e){this.params.rest_nonce=e},wc_stripe.ProductGateway.prototype.found_variation=function(t,e){var i=this.get_gateway_data();i.product.price=e.display_price,i.needs_shipping=!e.is_virtual,i.product.variation=e,this.set_gateway_data(i)},wc_stripe.ProductGateway.prototype.reset_variation_data=function(){var t=this.get_product_data();t.variation=!1,this.set_product_data(t),this.disable_payment_button()},wc_stripe.ProductGateway.prototype.disable_payment_button=function(){this.$button&&this.get_button().prop("disabled",!0).addClass("disabled")},wc_stripe.ProductGateway.prototype.enable_payment_button=function(){this.$button&&this.get_button().prop("disabled",!1).removeClass("disabled")},wc_stripe.ProductGateway.prototype.get_button=function(){return this.$button},wc_stripe.ProductGateway.prototype.is_variable_product=function(){return!!this.get_product_data().variation||0<o('[name="variation_id"]').length},wc_stripe.ProductGateway.prototype.variable_product_selected=function(){var t=this.get_product_data().variation,e=o('input[name="variation_id"]').val();return!!t||!!e&&"0"!=e},wc_stripe.ProductGateway.prototype.get_product_data=function(){return this.get_gateway_data().product},wc_stripe.ProductGateway.prototype.set_product_data=function(t){var e=this.get_gateway_data();e.product=t,this.set_gateway_data(e)},wc_stripe.ProductGateway.prototype.get_form=function(){return o(this.container).closest("form")},wc_stripe.ProductGateway.prototype.add_to_cart=function(){return new Promise(function(e,i){this.block();var t={product_id:this.get_product_data().id,variation_id:this.is_variable_product()?o('[name="variation_id"]').val():0,qty:o('[name="quantity"]').val(),payment_method:this.gateway_id,currency:this.get_currency(),page_id:this.get_page()},s=this.get_form().find(':not([name="add-to-cart"],[name="quantity"],[name^="attribute_"],[name="variation_id"])').serializeArray();if(s)for(var a in s)t[s[a].name]=s[a].value;o.ajax({url:this.params.routes.add_to_cart,method:"POST",dataType:"json",data:o.extend({},t,this.get_product_variations()),beforeSend:this.ajax_before_send.bind(this)}).done(function(t){this.unblock(),t.code?(this.submit_error(t.message),i(t)):(this.set_total_price(t.data.total),this.set_total_price_cents(t.data.totalCents),this.set_display_items(t.data.displayItems),e(t.data))}.bind(this)).fail(function(t,e,i){this.unblock(),this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.ProductGateway.prototype.cart_calculation=function(t){return new Promise(function(e,i){this.processing_calculation=!0,o.ajax({url:this.params.routes.cart_calculation,method:"POST",dataType:"json",data:o.extend({},{product_id:this.get_product_data().id,variation_id:this.is_variable_product()&&t?t:0,qty:o('[name="quantity"]').val(),currency:this.get_currency(),payment_method:this.gateway_id},this.get_product_variations()),beforeSend:this.ajax_before_send.bind(this)}).done(function(t){this.processing_calculation=!1,t.code?(this.cart_calculation_error=!0,i(t)):(this.set_total_price(t.data.total),this.set_total_price_cents(t.data.totalCents),this.set_display_items(t.data.displayItems),e(t.data))}.bind(this)).fail(function(){this.processing_calculation=!1}.bind(this))}.bind(this))},wc_stripe.ProductGateway.prototype.get_product_variations=function(){var s={};return this.is_variable_product()&&o('.variations [name^="attribute_"]').each(function(t,e){var i=o(e),e=i.data("attribute_name")||i.attr("name");s[e]=i.val()}),s},wc_stripe.CartGateway=function(){this.message_container="div.woocommerce",o(document.body).on("updated_wc_div",this.updated_html.bind(this)),o(document.body).on("updated_cart_totals",this.updated_html.bind(this)),o(document.body).on("wc_cart_emptied",this.cart_emptied.bind(this))},wc_stripe.CartGateway.prototype.submit_error=function(t){this.submit_message(this.get_error_message(t))},wc_stripe.CartGateway.prototype.updated_html=function(t){},wc_stripe.CartGateway.prototype.cart_emptied=function(t){},wc_stripe.CartGateway.prototype.add_cart_totals_class=function(){o(".cart_totals").addClass("stripe_cart_gateway_active")},wc_stripe.GooglePay=function(){},wc_stripe.GooglePay.prototype.handleActionMethod="handleCardAction",wc_stripe.GooglePay.prototype.setupActionMethod="confirmCardSetup";var s={apiVersion:2,apiVersionMinor:0},n={type:"CARD",parameters:{allowedAuthMethods:["PAN_ONLY"],allowedCardNetworks:["AMEX","DISCOVER","INTERAC","JCB","MASTERCARD","VISA"],assuranceDetailsRequired:!0}};wc_stripe.GooglePay.prototype.update_addresses=function(t){var e;t.paymentMethodData.info.billingAddress&&(e=t.paymentMethodData.info.billingAddress,this.is_current_page("checkout")&&this.is_valid_address(this.billing_address_object,"billing",["phone","email"])&&(e={phoneNumber:e.phoneNumber}),this.populate_billing_fields(e),e.phoneNumber&&this.fields.exists("shipping_phone")&&this.fields.isEmpty("shipping_phone")&&this.fields.set("shipping_phone",e.phoneNumber)),t.shippingAddress&&this.populate_shipping_fields(t.shippingAddress),t.email&&this.fields.set("email",t.email,"billing")},wc_stripe.GooglePay.prototype.map_address=function(t){return{city:t.locality,postcode:t.postalCode,state:t.administrativeArea,country:t.countryCode}},wc_stripe.GooglePay.prototype.update_payment_data=function(s){return new Promise(function(e,i){var t="default"==s.shippingOptionData.id?null:s.shippingOptionData.id;o.when(o.ajax({url:this.params.routes.payment_data,dataType:"json",method:"POST",data:{address:this.map_address(s.shippingAddress),shipping_method:t,page_id:this.get_page(),currency:this.get_currency()},beforeSend:this.ajax_before_send.bind(this)})).done(function(t){t.code?i(t.data.data):e(t.data)}.bind(this)).fail(function(){i()}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.on_payment_data_changed=function(i){return new Promise(function(e){this.update_payment_data(i).then(function(t){e(t.paymentRequestUpdate),this.set_selected_shipping_methods(t.shipping_methods),this.payment_data_updated(t,i)}.bind(this))["catch"](function(t){e(t)}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.payment_data_updated=function(t){},wc_stripe.GooglePay.prototype.get_merchant_info=function(){var t={merchantId:this.params.merchant_id,merchantName:this.params.merchant_name};return"TEST"===this.params.environment&&delete t.merchantId,t},wc_stripe.GooglePay.prototype.get_payment_options=function(){var t,e={environment:this.params.environment,merchantInfo:this.get_merchant_info(),paymentDataCallbacks:{onPaymentAuthorized:function(){return new Promise(function(t){t({transactionState:"SUCCESS"})}.bind(this))}}};return this.needs_shipping()&&(t=this.get_shipping_prefix(),(!this.is_current_page("checkout")||this.is_valid_address(this.get_address_object(t),t,["email","phone"]))&&this.is_current_page("checkout")||(e.paymentDataCallbacks.onPaymentDataChanged=this.on_payment_data_changed.bind(this))),e},wc_stripe.GooglePay.prototype.build_payment_request=function(){var t=o.extend({},s,{emailRequired:this.fields.requestFieldInWallet("billing_email"),merchantInfo:this.get_merchant_info(),allowedPaymentMethods:[o.extend({type:"CARD",tokenizationSpecification:{type:"PAYMENT_GATEWAY",parameters:{gateway:"stripe","stripe:version":"2018-10-31","stripe:publishableKey":this.params.api_key}}},n)],shippingAddressRequired:function(){if(this.needs_shipping()){var t=this.get_shipping_prefix();if(this.is_current_page("checkout")&&!this.is_valid_address(this.get_address_object(t),t,["email","phone"])||!this.is_current_page("checkout"))return!0}return!1}.bind(this)(),transactionInfo:{countryCode:this.params.processing_country,currencyCode:this.get_currency(),totalPriceStatus:"ESTIMATED",totalPrice:this.get_total_price().toString(),displayItems:this.get_display_items(),totalPriceLabel:this.params.total_price_label}});return t.allowedPaymentMethods[0].parameters.billingAddressRequired=function(){if(this.is_current_page("checkout")){var t=this.billing_address_object=this.get_address_object("billing");return this.fields.requestFieldInWallet("billing_phone")||!this.is_valid_address(t,"billing",["email"])?!0:!1}return!0}.bind(this)(),t.allowedPaymentMethods[0].parameters.billingAddressRequired&&(t.allowedPaymentMethods[0].parameters.billingAddressParameters={format:"FULL",phoneNumberRequired:this.fields.requestFieldInWallet("billing_phone")}),t.shippingAddressRequired?(t.shippingAddressParameters={},t.shippingOptionRequired=!0,t.shippingOptionParameters={shippingOptions:this.get_shipping_options()},t.callbackIntents=["SHIPPING_ADDRESS","SHIPPING_OPTION","PAYMENT_AUTHORIZATION"]):t.callbackIntents=["PAYMENT_AUTHORIZATION"],this.payment_request_options=t},wc_stripe.GooglePay.prototype.createPaymentsClient=function(){this.paymentsClient=new google.payments.api.PaymentsClient(this.get_payment_options())},wc_stripe.GooglePay.prototype.isReadyToPay=function(){return new Promise(function(t){var e=o.extend({},s);e.allowedPaymentMethods=[n],this.paymentsClient.isReadyToPay(e).then(function(){this.can_pay=!0,this.create_button(),t()}.bind(this))["catch"](function(t){t&&t.message&&-1<t.message.indexOf("ShadowRoot")?console.log("GPay is not supported on this browser."):this.submit_error(t)}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.create_button=function(){this.$button&&this.$button.remove(),this.$button=o(this.paymentsClient.createButton(this.get_button_options())),this.$button.addClass("gpay-button-container")},wc_stripe.GooglePay.prototype.get_button_options=function(){var t={onClick:this.start.bind(this),buttonColor:this.params.button_color,buttonType:this.params.button_style,buttonSizeMode:this.params.button_size_mode};return null!==this.params.button_locale&&(t.buttonLocale=this.params.button_locale),t},wc_stripe.GooglePay.prototype.start=function(){this.createPaymentsClient(),this.paymentsClient.loadPaymentData(this.build_payment_request()).then(function(t){var e=JSON.parse(t.paymentMethodData.tokenizationData.token);this.update_addresses(t),this.stripe.createPaymentMethod({type:"card",card:{token:e.id},billing_details:this.get_billing_details()}).then(function(t){if(t.error)return this.submit_error(t.error);this.on_token_received(t.paymentMethod)}.bind(this))}.bind(this))["catch"](function(t){"CANCELED"!==t.statusCode&&(t.statusMessage&&-1<t.statusMessage.indexOf("paymentDataRequest.callbackIntent")?this.submit_error_code("DEVELOPER_ERROR_WHITELIST"):this.submit_error(t.statusMessage))}.bind(this))},wc_stripe.ApplePay=function(){},wc_stripe.ApplePay.prototype.handleActionMethod="handleCardAction",wc_stripe.ApplePay.prototype.setupActionMethod="confirmCardSetup",wc_stripe.ApplePay.prototype.initialize=function(){this.createPaymentRequest(),this.canMakePayment()},wc_stripe.ApplePay.prototype.get_payment_request_options=function(){return o.extend({},wc_stripe.BaseGateway.prototype.get_payment_request_options.apply(this,arguments),{disableWallets:["googlePay"]})},wc_stripe.ApplePay.prototype.create_button=function(){this.$button&&this.$button.remove(),this.$button=o(this.params.button),this.$button.on("click",this.start.bind(this)),this.append_button()},wc_stripe.ApplePay.prototype.canMakePayment=function(){return new Promise(function(e){this.paymentRequest.canMakePayment().then(function(t){t&&t.applePay&&(this.can_pay=!0,this.create_button(),o(this.container).show(),e(t))}.bind(this))}.bind(this))},wc_stripe.ApplePay.prototype.start=function(t){t.preventDefault(),this.paymentRequest.update(this.get_payment_request_update({total:{pending:!1}})),this.paymentRequest.show()},wc_stripe.PaymentRequest=function(){},wc_stripe.PaymentRequest.prototype.handleActionMethod="handleCardAction",wc_stripe.PaymentRequest.prototype.setupActionMethod="confirmCardSetup",wc_stripe.PaymentRequest.prototype.initialize=function(){this.createPaymentRequest(),this.createPaymentRequestButton(),this.canMakePayment(),this.paymentRequestButton.on("click",this.button_click.bind(this))},wc_stripe.PaymentRequest.prototype.button_click=function(t){},wc_stripe.PaymentRequest.prototype.createPaymentRequestButton=function(){this.paymentRequestButton&&this.paymentRequestButton.destroy(),this.paymentRequestButton=this.elements.create("paymentRequestButton",{paymentRequest:this.paymentRequest,style:{paymentRequestButton:{type:this.params.button.type,theme:this.params.button.theme,height:this.params.button.height}}})},wc_stripe.PaymentRequest.prototype.canMakePayment=function(){return new Promise(function(e){var i=this.paymentRequest;this.paymentRequest.canMakePayment().then(function(t){t&&!t.applePay&&i===this.paymentRequest&&(this.can_pay=!0,this.create_button(),o(this.container).show(),e(t))}.bind(this))}.bind(this))},wc_stripe.PaymentRequest.prototype.create_button=function(){this.paymentRequestButton.mount("#wc-stripe-payment-request-container")},wc_stripe.Afterpay=function(){},wc_stripe.Afterpay.prototype.is_eligible=function(t){return this.needs_shipping()&&t>this.get_min()&&t<this.get_max()},wc_stripe.Afterpay.prototype.get_min=function(){var t=this.get_currency(),t=this.params.requirements[t];return t?t[1]:0},wc_stripe.Afterpay.prototype.get_max=function(){var t=this.get_currency(),t=this.params.requirements[t];return t?t[2]:0},wc_stripe.Afterpay.prototype.add_eligibility=function(t,e){o(t).length&&(this.is_eligible(e)?o(t).removeClass("afterpay-ineligible"):this.hide_ineligible_active()&&o(t).addClass("afterpay-ineligible"))},wc_stripe.Afterpay.prototype.hide_ineligible_active=function(){return"yes"===this.params.hide_ineligible},wc_stripe.CheckoutFields=function(t,e){this.params=t,this.page=e,this.session_values=this.supportsSessionStorage()&&sessionStorage.getItem("wc_stripe_checkout_fields")?JSON.parse(sessionStorage.getItem("wc_stripe_checkout_fields")):{},this.fields=new Map(Object.keys(this.params).map(function(t){return null===this.params[t].value&&(t in this.session_values&&null!==this.session_values[t]?this.params[t].value=this.session_values[t]:this.params[t].value=""),[t,this.params[t].value]}.bind(this))),("checkout"===e||"cart"===e&&o(document.body).is(".woocommerce-checkout")||0<o("form.woocommerce-checkout").length)&&(o(document.body).on("updated_checkout",this.updated_checkout.bind(this)),o(document.body).on("change",'[name^="billing_"], [name^="shipping_"]',this.onChange.bind(this)),o("form.checkout").on("change",'.input-text:not([name^="billing_"], [name^="shipping_"], [name="account_password"]), select:not([name^="billing_"], [name^="shipping_"])',this.onChange.bind(this)),o("form.checkout").on("change",'[name="ship_to_different_address"]',this.on_ship_to_address_change.bind(this)),this.init_i18n(),o('[name="ship_to_different_address"]').is(":checked")?this.update_required_fields(o("#shipping_country").val(),"shipping_country"):this.update_required_fields(o("#billing_country").val(),"billing_country"))},wc_stripe.CheckoutFields.prototype.supportsSessionStorage=function(){return"sessionStorage"in a&&null!==a.sessionStorage&&["getItem","setItem"].reduce(function(t,e){return t&&e in sessionStorage}.bind(this),!0)},wc_stripe.CheckoutFields.prototype.init_i18n=function(){"undefined"!=typeof wc_address_i18n_params?this.locales=JSON.parse(wc_address_i18n_params.locale.replace(/&quot;/g,'"')):this.locales=null},wc_stripe.CheckoutFields.prototype.updated_checkout=function(){this.syncCheckoutFieldsWithDOM()},wc_stripe.CheckoutFields.prototype.syncCheckoutFieldsWithDOM=function(){for(var t in this.params)o("#"+t).length&&this.fields.set(t,o("#"+t).val())},wc_stripe.CheckoutFields.prototype.onChange=function(t){try{var e=t.currentTarget.name,i=t.currentTarget.value;this.fields.set(e,i),"billing_country"!==e&&"shipping_country"!==e||this.update_required_fields(i,e),this.supportsSessionStorage()&&sessionStorage.setItem("wc_stripe_checkout_fields",JSON.stringify(this.toJson()))}catch(s){console.log(s)}},wc_stripe.CheckoutFields.prototype.update_required_fields=function(t,e){if(this.locales){var i,s=-1<e.indexOf("billing_")?"billing_":"shipping_",t="undefined"!=typeof this.locales[t]?this.locales[t]:this.locales["default"],a=o.extend(!0,{},this.locales["default"],t);for(i in a){var n=s+i;this.params[n]&&(this.params[n]=o.extend(!0,{},this.params[n],a[i]))}}},wc_stripe.CheckoutFields.prototype.on_ship_to_address_change=function(t){o(t.currentTarget).is(":checked")&&this.update_required_fields(o("#shipping_country").val(),"shipping_country")},wc_stripe.CheckoutFields.prototype.requestFieldInWallet=function(t){return"checkout"===this.page?this.required(t)&&this.isEmpty(t):"order_pay"!==this.page&&this.required(t)},wc_stripe.CheckoutFields.prototype.set=function(t,e,i){this[t]&&"function"==typeof this[t]?this[t]().set.call(this,e,i):this.fields.set(t,e)},wc_stripe.CheckoutFields.prototype.get=function(t,e){var i;return this[t]&&"function"==typeof this[t]?i=this[t]().get.call(this,e):null!=(i=this.fields.get(t))&&""!==i||void 0!==e&&(i=e),void 0===i?"":i},wc_stripe.CheckoutFields.prototype.required=function(t){return!(!this.params[t]||"undefined"==typeof this.params[t].required)&&this.params[t].required},wc_stripe.CheckoutFields.prototype.exists=function(t){return t in this.params},wc_stripe.CheckoutFields.prototype.isEmpty=function(t){if(this.fields.has(t)){t=this.fields.get(t);return null==t||"string"==typeof t&&0===t.trim().length}return!0},wc_stripe.CheckoutFields.prototype.isValid=function(t){if(this[t]&&"function"==typeof this[t])return this[t]().isValid.apply(this,Array.prototype.slice.call(arguments,1))},wc_stripe.CheckoutFields.prototype.first_name=function(){return{set:function(t,e){this.fields.set(e+"_first_name",t)},get:function(t){return this.fields.get(t+"_first_name")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.last_name=function(){return{set:function(t,e){this.fields.set(e+"_last_name",t)},get:function(t){return this.fields.get(t+"_last_name")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.address_1=function(){return{set:function(t,e){this.fields.set(e+"_address_1",t)},get:function(t){return this.fields.get(t+"_address_1")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.address_2=function(){return{set:function(t,e){this.fields.set(e+"_address_2",t)},get:function(t){return this.fields.get(t+"_address_2")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.name=function(){return{set:function(t,e){this.fields.set(e+"_full_name",t);var i=t.split(" ");1<i.length?(t=i.pop(),this.fields.set(e+"_first_name",i.join(" ")),this.fields.set(e+"_last_name",t)):1==i.length&&this.fields.set(e+"_first_name",i[0])},get:function(t){return this.fields.get(t+"_first_name")+" "+this.fields.get(t+"_last_name")}}},wc_stripe.CheckoutFields.prototype.email=function(){return{set:function(t,e){this.fields.set(e+"_email",t)},get:function(t){return this.fields.get(t+"_email")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.phone=function(){return{set:function(t,e){this.fields.set(e+"_phone",t)},get:function(t){return this.fields.get(t+"_phone")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.country=function(){return{set:function(t,e){this.fields.set(e+"_country",t)},get:function(t){return this.fields.get(t+"_country")},isValid:function(t){return"string"==typeof t&&2===t.length}}},wc_stripe.CheckoutFields.prototype.state=function(){return{set:function(i,t){2<(i=i.toUpperCase()).length&&"checkout"===this.page&&o("#"+t+"_state option").each(function(){var t=o(this),e=t.text().toUpperCase();i===e&&(i=t.val())}),this.fields.set(t+"_state",i)},get:function(t){return this.fields.get(t+"_state")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.city=function(){return{set:function(t,e){this.fields.set(e+"_city",t)},get:function(t){return this.fields.get(t+"_city")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.postcode=function(){return{set:function(t,e){this.fields.set(e+"_postcode",t)},get:function(t){return this.fields.get(t+"_postcode")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.recipient=function(){return wc_stripe.CheckoutFields.prototype.name.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.payerName=function(){return wc_stripe.CheckoutFields.prototype.name.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.payerEmail=function(){return wc_stripe.CheckoutFields.prototype.email.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.payerPhone=function(){return wc_stripe.CheckoutFields.prototype.phone.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.phoneNumber=function(){return wc_stripe.CheckoutFields.prototype.phone.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.countryCode=function(){return wc_stripe.CheckoutFields.prototype.country.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.address1=function(){return wc_stripe.CheckoutFields.prototype.address_1.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.address2=function(){return wc_stripe.CheckoutFields.prototype.address_2.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.line1=function(){return wc_stripe.CheckoutFields.prototype.address_1.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.line2=function(){return wc_stripe.CheckoutFields.prototype.address_2.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.addressLine=function(){return{set:function(t,e){0<t.length&&this.fields.set(e+"_address_1",t[0]),1<t.length&&this.fields.set(e+"_address_2",t[1])},get:function(t){return[this.fields.get(t+"_address_1"),this.fields.get(t+"_address_2")]},isValid:function(t){return 0<t.length&&("string"==typeof t[0]&&0<t[0].length)}}},wc_stripe.CheckoutFields.prototype.region=function(){return wc_stripe.CheckoutFields.prototype.state.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.administrativeArea=function(){return wc_stripe.CheckoutFields.prototype.state.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.locality=function(){return wc_stripe.CheckoutFields.prototype.city.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.postal_code=function(){return wc_stripe.CheckoutFields.prototype.postcode.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.postalCode=function(){return wc_stripe.CheckoutFields.prototype.postcode.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.toJson=function(){var i={};return this.fields.forEach(function(t,e){i[e]=t}),i},wc_stripe.CheckoutFields.prototype.toFormFields=function(t){var i=[];this.fields.forEach(function(t,e){e='[name="'+e+'"]';o(e).length&&""!==t&&(o(e).val()!==t&&o(e).is("select")&&i.push(e),o(e).val(t))}),0<i.length&&o(i.join(",")).trigger("change"),void 0!==t&&o(document.body).trigger("update_checkout",t)},wc_stripe.CheckoutFields.prototype.validateFields=function(t){for(var e in this.params){var i=this.params[e];if(-1<e.indexOf(t)&&i.required&&o("#"+e).length&&o("#"+e).is(":visible")){i=o("#"+e).val();if(null==i||0===i.length)return!1}}return!0};try{i=Stripe(wc_stripe_params_v3.api_key,"test"===wc_stripe_params_v3.mode&&""===wc_stripe_params_v3.account?{}:{stripeAccount:wc_stripe_params_v3.account})}catch(t){return a.alert(t),console.log(t)}var r=new wc_stripe.CheckoutFields(wc_stripe_checkout_fields,wc_stripe_params_v3.page)}(window,jQuery);
1
+ !function(a,o){a.wc_stripe={};var i=null;"undefined"==typeof wc_stripe_checkout_fields&&(a.wc_stripe_checkout_fields=[]),wc_stripe.BaseGateway=function(t,e){this.params=t,this.gateway_id=this.params.gateway_id,this.container=void 0===e?"li.payment_method_".concat(this.gateway_id):e,o(this.container).length||(this.container=".payment_method_".concat(this.gateway_id)),this.token_selector=this.params.token_selector,this.saved_method_selector=this.params.saved_method_selector,this.payment_token_received=!1,this.stripe=i,this.fields=r,this.elements=this.create_stripe_elements(),this.initialize()},wc_stripe.BaseGateway.prototype.create_stripe_elements=function(){return i.elements(o.extend({},{locale:"auto"},this.get_element_options()))},wc_stripe.BaseGateway.prototype.is_user_logged_in=function(){return 0<this.params.user_id},wc_stripe.BaseGateway.prototype.get_page=function(){var t=wc_stripe_params_v3.page;return"cart"===t&&o(document.body).is(".woocommerce-checkout")&&(t="checkout"),t},wc_stripe.BaseGateway.prototype.set_nonce=function(t){this.fields.set(this.gateway_id+"_token_key",t),o(this.token_selector).val(t)},wc_stripe.BaseGateway.prototype.set_intent=function(t){this.fields.set(this.gateway_id+"_payment_intent_key",t),o("#"+this.gateway_id+"_payment_intent_key").val(t)},wc_stripe.BaseGateway.prototype.get_element_options=function(){return this.params.elementOptions},wc_stripe.BaseGateway.prototype.initialize=function(){},wc_stripe.BaseGateway.prototype.create_button=function(){},wc_stripe.BaseGateway.prototype.is_gateway_selected=function(){return o('[name="payment_method"]:checked').val()===this.gateway_id},wc_stripe.BaseGateway.prototype.is_saved_method_selected=function(){return this.is_gateway_selected()&&"saved"===o('[name="'+this.gateway_id+'_payment_type_key"]:checked').val()},wc_stripe.BaseGateway.prototype.has_checkout_error=function(){return 0<o("#wc_stripe_checkout_error").length&&this.is_gateway_selected()},wc_stripe.BaseGateway.prototype.submit_error=function(t,e){var i=this.get_error_message(t);i.indexOf("</ul>")<0&&(i='<div class="'+function(){var t="woocommerce-NoticeGroup";return this.is_current_page("checkout")&&(t+=" woocommerce-NoticeGroup-checkout"),t}.bind(this)()+'"><ul class="woocommerce-error"><li>'+i+"</li></ul></div>");t=o(document.body).triggerHandler("wc_stripe_submit_error",[i,t,this]);i=void 0===t?i:t,this.submit_message(i,e)},wc_stripe.BaseGateway.prototype.submit_error_code=function(t){console.log(t)},wc_stripe.BaseGateway.prototype.get_error_message=function(t){return"object"==typeof t&&(t.hasOwnProperty("message")&&-1<t.message.indexOf("server_side_confirmation_beta=v1")&&(t.code="server_side_confirmation_beta"),t=t.code&&wc_stripe_messages[t.code]?wc_stripe_messages[t.code]:t.message),t},wc_stripe.BaseGateway.prototype.submit_message=function(t,e){o(".woocommerce-NoticeGroup-checkout, .woocommerce-error, .woocommerce-message").remove();var i=o(this.message_container);i.length&&(e||!i.closest("form").length)||(i.length||(i=o(this.container)),i=i.closest("form")),i.prepend(t),i.removeClass("processing").unblock(),i.find(".input-text, select, input:checkbox").trigger("blur"),o.scroll_to_notices?o.scroll_to_notices(i):o("html, body").animate({scrollTop:i.offset().top-100},1e3)},wc_stripe.BaseGateway.prototype.get_billing_details=function(){var t=this.get_billing_prefix(),t={name:this.get_customer_name(t),address:{city:this.fields.get(t+"_city",null),country:this.fields.get(t+"_country",null),line1:this.fields.get(t+"_address_1",null),line2:this.fields.get(t+"_address_2",null),postal_code:this.fields.get(t+"_postcode",null),state:this.fields.get(t+"_state",null)}};return t.name&&" "!==t.name||delete t.name,""!=this.fields.get("billing_email")&&(t.email=this.fields.get("billing_email")),""!=this.fields.get("billing_phone")&&(t.phone=this.fields.get("billing_phone")),t},wc_stripe.BaseGateway.prototype.get_first_name=function(t){return o("#"+t+"_first_name").val()},wc_stripe.BaseGateway.prototype.get_last_name=function(t){return o("#"+t+"_last_name").val()},wc_stripe.BaseGateway.prototype.get_shipping_prefix=function(){return this.needs_shipping()&&0<o('[name="ship_to_different_address"]').length&&o('[name="ship_to_different_address"]').is(":checked")?"shipping":"billing"},wc_stripe.BaseGateway.prototype.get_billing_prefix=function(){var t="billing";o('[name="billing_same_as_shipping"]').length&&o('[name="billing_same_as_shipping"]').is(":checked")&&(t="shipping"),o('[name="bill_to_different_address"]').length&&(1<o('[name="bill_to_different_address"]').length?"same_as_shipping"===o('[name="bill_to_different_address"]:checked').val()&&(t="shipping"):o('[name="bill_to_different_address"]').is(":checked")||(t="shipping"));var e=o(document.body).triggerHandler("wc_stripe_get_billing_prefix",[t]);return void 0===e?t:e},wc_stripe.BaseGateway.prototype.should_save_method=function(){return o("#"+this.gateway_id+"_save_source_key").is(":checked")},wc_stripe.BaseGateway.prototype.is_add_payment_method_page=function(){return"add_payment_method"===this.get_page()||o(document.body).hasClass("woocommerce-add-payment-method")},wc_stripe.BaseGateway.prototype.is_change_payment_method=function(){return"change_payment_method"===this.get_page()},wc_stripe.BaseGateway.prototype.get_selected_payment_method=function(){return o(this.saved_method_selector).val()},wc_stripe.BaseGateway.prototype.needs_shipping=function(){return this.get_gateway_data().needs_shipping},wc_stripe.BaseGateway.prototype.get_currency=function(){return this.get_gateway_data().currency},wc_stripe.BaseGateway.prototype.get_gateway_data=function(){var t=o(this.container).find(".woocommerce_".concat(this.gateway_id,"_gateway_data")).data("gateway");return void 0===t&&this.is_current_page("checkout")&&void 0===(t=o("form.checkout").find(".woocommerce_".concat(this.gateway_id,"_gateway_data")).data("gateway"))&&(t=o(".woocommerce_"+this.gateway_id+"_gateway_data").data("gateway")),t},wc_stripe.BaseGateway.prototype.set_gateway_data=function(t){o(this.container).find(".woocommerce_".concat(this.gateway_id,"_gateway_data")).data("gateway",t)},wc_stripe.BaseGateway.prototype.has_gateway_data=function(){return void 0!==this.get_gateway_data()},wc_stripe.BaseGateway.prototype.get_customer_name=function(t){return this.fields.get(t+"_first_name")+" "+this.fields.get(t+"_last_name")},wc_stripe.BaseGateway.prototype.get_customer_email=function(){return this.fields.get("billing_email")},wc_stripe.BaseGateway.prototype.get_address_field_hash=function(t){for(var e=["_first_name","_last_name","_address_1","_address_2","_postcode","_city","_state","_country"],i="",s=0;s<e.length;s++)i+=this.fields.get(t+e[s])+"_";return i},wc_stripe.BaseGateway.prototype.block=function(){o().block&&o.blockUI({message:null,overlayCSS:{background:"#fff",opacity:.6}})},wc_stripe.BaseGateway.prototype.unblock=function(){o().block&&o.unblockUI()},wc_stripe.BaseGateway.prototype.get_form=function(){return o(this.token_selector).closest("form")},wc_stripe.BaseGateway.prototype.get_total_price=function(){return this.get_gateway_data().total},wc_stripe.BaseGateway.prototype.get_total_price_cents=function(){return this.get_gateway_data().total_cents},wc_stripe.BaseGateway.prototype.set_total_price=function(t){var e=this.get_gateway_data();e.total=t,this.set_gateway_data(e)},wc_stripe.BaseGateway.prototype.set_total_price_cents=function(t){var e=this.get_gateway_data();e.total_cents=t,this.set_gateway_data(e)},wc_stripe.BaseGateway.prototype.set_payment_method=function(t){o('[name="payment_method"][value="'+t+'"]').prop("checked",!0).trigger("click")},wc_stripe.BaseGateway.prototype.set_selected_shipping_methods=function(t){if(this.fields.set("shipping_method",t),t&&o('[name^="shipping_method"]').length)for(var e in t){var i=t[e];o('[name="shipping_method['+e+']"][value="'+i+'"]').prop("checked",!0).trigger("change")}},wc_stripe.BaseGateway.prototype.on_token_received=function(t){this.payment_token_received=!0,this.set_nonce(t.id),this.process_checkout()},wc_stripe.BaseGateway.prototype.createPaymentRequest=function(){try{this.payment_request_options=this.get_payment_request_options(),this.paymentRequest=i.paymentRequest(this.payment_request_options),this.payment_request_options.requestShipping&&(this.paymentRequest.on("shippingaddresschange",this.update_shipping_address.bind(this)),this.paymentRequest.on("shippingoptionchange",this.update_shipping_method.bind(this))),this.paymentRequest.on("paymentmethod",this.on_payment_method_received.bind(this))}catch(t){return void this.submit_error(t.message)}},wc_stripe.BaseGateway.prototype.get_payment_request_options=function(){var t={country:this.params.country_code,currency:this.get_currency().toLowerCase(),total:{amount:this.get_total_price_cents(),label:this.params.total_label,pending:!0},requestPayerName:function(){return!this.is_current_page("checkout")||!this.is_valid_address(this.get_address_object("billing"),"billing",["email","phone"])}.bind(this)(),requestPayerEmail:this.fields.requestFieldInWallet("billing_email"),requestPayerPhone:this.fields.requestFieldInWallet("billing_phone"),requestShipping:function(){if(this.needs_shipping()){var t=this.get_shipping_prefix();if(this.is_current_page("checkout")&&!this.is_valid_address(this.get_address_object(t),t,["email","phone"])||!this.is_current_page("checkout"))return!0}return!1}.bind(this)()},e=this.get_display_items(),i=this.get_shipping_options();return e&&(t.displayItems=e),t.requestShipping&&i&&(t.shippingOptions=i),t},wc_stripe.BaseGateway.prototype.get_payment_request_update=function(t){var e={currency:this.get_currency().toLowerCase(),total:{amount:parseInt(this.get_total_price_cents()),label:this.params.total_label,pending:!0}},i=this.get_display_items(),s=this.get_shipping_options();return i&&(e.displayItems=i),this.payment_request_options.requestShipping&&s&&(e.shippingOptions=s),t&&(e=o.extend(!0,{},e,t)),e},wc_stripe.BaseGateway.prototype.get_display_items=function(){return this.get_gateway_data().items},wc_stripe.BaseGateway.prototype.set_display_items=function(t){var e=this.get_gateway_data();e.items=t,this.set_gateway_data(e)},wc_stripe.BaseGateway.prototype.get_shipping_options=function(){return this.get_gateway_data().shipping_options},wc_stripe.BaseGateway.prototype.set_shipping_options=function(t){var e=this.get_gateway_data();e.shipping_options=t,this.set_gateway_data(e)},wc_stripe.BaseGateway.prototype.map_address=function(t){return{city:t.city,postcode:t.postalCode,state:t.region,country:t.country}},wc_stripe.BaseGateway.prototype.on_payment_method_received=function(t){try{this.payment_response=t,this.populate_checkout_fields(t),t.complete("success"),this.on_token_received(t.paymentMethod)}catch(e){a.alert(e)}},wc_stripe.BaseGateway.prototype.populate_checkout_fields=function(t){this.set_nonce(t.paymentMethod.id),this.update_addresses(t)},wc_stripe.BaseGateway.prototype.update_addresses=function(t){t.payerName&&this.fields.set("name",t.payerName,"billing"),t.payerEmail&&this.fields.set("email",t.payerEmail,"billing"),t.payerPhone&&(this.fields.set("phone",t.payerPhone,"billing"),this.fields.exists("shipping_phone")&&this.fields.isEmpty("shipping_phone")&&this.fields.set("shipping_phone",t.payerPhone)),t.shippingAddress&&this.populate_shipping_fields(t.shippingAddress),t.paymentMethod.billing_details.address&&this.populate_billing_fields(t.paymentMethod.billing_details.address)},wc_stripe.BaseGateway.prototype.populate_address_fields=function(t,e){for(var i in t)null!==t[i]&&this.fields.set(i,t[i],e)},wc_stripe.BaseGateway.prototype.populate_billing_fields=function(t){this.populate_address_fields(t,"billing")},wc_stripe.BaseGateway.prototype.populate_shipping_fields=function(t){this.populate_address_fields(t,"shipping")},wc_stripe.BaseGateway.prototype.get_address_fields=function(){return["first_name","last_name","country","address_1","address_2","city","state","postcode","phone","email"]},wc_stripe.BaseGateway.prototype.get_address_object=function(e){var i={};return this.get_address_fields().forEach(function(t){i[t]=this.fields.get(t,e)}.bind(this)),i},wc_stripe.BaseGateway.prototype.is_current_page=function(t){return Array.isArray(t)?-1<t.indexOf(this.get_page()):this.get_page()===t},wc_stripe.BaseGateway.prototype.is_valid_address=function(t,e,i){if(o.isEmptyObject(t))return!1;var s=this.get_address_fields();void 0!==i&&i.forEach(function(t){-1<s.indexOf(t)&&s.splice(s.indexOf(t),1)});for(var a=0;a<s.length;a++){var n=s[a];if(this.fields.required(e+"_"+n)&&(!t[n]||"undefined"==typeof t[n]||!this.fields.isValid(n,t[n],t)))return!1}return!0},wc_stripe.BaseGateway.prototype.ajax_before_send=function(t){this.is_user_logged_in()&&t.setRequestHeader("X-WP-Nonce",this.params.rest_nonce)},wc_stripe.BaseGateway.prototype.process_checkout=function(){return new Promise(function(){this.block(),o.ajax({url:this.params.routes.checkout,method:"POST",dataType:"json",data:o.extend({},this.serialize_fields(),{payment_method:this.gateway_id,page_id:this.get_page(),currency:this.get_currency()}),beforeSend:this.ajax_before_send.bind(this)}).done(function(t){t.reload?a.location.reload():"success"===t.result?a.location=t.redirect:(t.messages&&this.submit_error(t.messages),this.unblock())}.bind(this)).fail(function(t,e,i){this.unblock(),this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.BaseGateway.prototype.process_payment=function(t,e){o.ajax({method:"POST",url:this.params.routes.checkout_payment,dataType:"json",data:o.extend({},this.fields.toJson(),{order_id:t,order_key:e}),beforeSend:this.ajax_before_send.bind(this)}).done(function(t){if(t.result&&"success"===t.result)a.location=t.redirect;else{if(t.reload)return a.location.reload();t.messages?(this.payment_token_received=!1,this.submit_error(t.messages)):this.submit_error(wc_checkout_params.i18n_checkout_error)}}.bind(this)).fail(function(){}.bind(this))},wc_stripe.BaseGateway.prototype.handle_next_action=function(e){try{return this.stripe[this.handleActionMethod](e.client_secret).then(function(t){if(t.error)return this.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().trigger("submit"):this.process_payment(e.order_id,e.order_key)}.bind(this))["catch"](function(t){this.submit_error(t.message)}.bind(this)),!1}catch(t){}},wc_stripe.BaseGateway.prototype.handle_payment_method_setup=function(e){try{return this.stripe[this.setupActionMethod](e.client_secret).then(function(t){if(t.error)return this.payment_token_received=!1,this.submit_error(t.error);this.is_current_page("order_pay")?this.get_form().trigger("submit"):this.process_payment(e.order_id,e.order_key)}.bind(this))["catch"](function(t){this.submit_error(t.message)}.bind(this)),!1}catch(t){}},wc_stripe.BaseGateway.prototype.hashchange=function(t){var e=a.location.hash.match(/response=(.*)/);if(e)try{var i=JSON.parse(a.atob(decodeURIComponent(e[1])));i&&i.hasOwnProperty("client_secret")&&i.gateway_id===this.gateway_id&&(history.pushState({},"",a.location.pathname),"intent"===i.type?this.handle_next_action(i):this.handle_payment_method_setup(i))}catch(s){}return!0},wc_stripe.BaseGateway.prototype.sync_payment_intent=function(t,s){return new Promise(function(e,i){o.ajax({method:"POST",dataType:"json",url:this.params.routes.sync_intent,data:{order_id:t,client_secret:s},beforeSend:this.ajax_before_send.bind(this)}).done(function(t){(t.code?i:e)(t)}).fail(function(t,e,i){this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.BaseGateway.prototype.create_setup_intent=function(){return new Promise(function(e,i){o.ajax({method:"POST",dataType:"json",data:{payment_method:this.gateway_id},url:this.params.routes.setup_intent,beforeSend:this.ajax_before_send.bind(this)}).done(function(t){t.code?i(t.message):(this.client_secret=t.intent.client_secret,e(t))}.bind(this)).fail(function(t,e,i){this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.BaseGateway.prototype.serialize_form=function(t){var e,i=t.find("input").filter(function(t,e){return!o(e).is('[name^="add-to-cart"]')}.bind(this)).serializeArray(),s={};for(e in i){var a=i[e];s[a.name]=a.value}return s.payment_method=this.gateway_id,s},wc_stripe.BaseGateway.prototype.serialize_fields=function(){return o.extend({},this.fields.toJson(),o(document.body).triggerHandler("wc_stripe_process_checkout_data",[this,this.fields]))},wc_stripe.BaseGateway.prototype.map_shipping_methods=function(t){var e={};return"default"===t||1<(t=t.match(/^([\w+]):(.+)$/)).length&&(e[t[1]]=t[2]),e},wc_stripe.BaseGateway.prototype.maybe_set_ship_to_different=function(){o('[name="ship_to_different_address"]').length&&o('[name="ship_to_different_address"]').prop("checked",this.get_address_field_hash("billing")!==this.get_address_field_hash("shipping")).trigger("change")},wc_stripe.BaseGateway.prototype.update_shipping_address=function(s){return new Promise(function(e,i){o.ajax({url:this.params.routes.shipping_address,method:"POST",dataType:"json",data:{address:this.map_address(s.shippingAddress),payment_method:this.gateway_id,page_id:this.get_page(),currency:this.get_currency()},beforeSend:this.ajax_before_send.bind(this)}).done(function(t){t.code?(s.updateWith(t.data.newData),i(t.data)):(s.updateWith(t.data.newData),this.fields.set("shipping_method",t.data.shipping_method),e(t.data))}.bind(this)).fail(function(){}.bind(this))}.bind(this))},wc_stripe.BaseGateway.prototype.update_shipping_method=function(s){return new Promise(function(e,i){o.ajax({url:this.params.routes.shipping_method,method:"POST",dataType:"json",data:{shipping_method:s.shippingOption.id,payment_method:this.gateway_id,currency:this.get_currency(),page_id:this.get_page()},beforeSend:this.ajax_before_send.bind(this)}).done(function(t){t.code?(s.updateWith(t.data.newData),i(t.data)):(this.set_selected_shipping_methods(t.data.shipping_methods),s.updateWith(t.data.newData),e(t.data))}.bind(this)).fail(function(t,e,i){this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.CheckoutGateway=function(){this.message_container="li.payment_method_"+this.gateway_id,this.banner_container="li.banner_payment_method_"+this.gateway_id,o(document.body).on("update_checkout",this.update_checkout.bind(this)),o(document.body).on("updated_checkout",this.updated_checkout.bind(this)),o(document.body).on("updated_checkout",this.container_styles.bind(this)),o(document.body).on("checkout_error",this.checkout_error.bind(this)),o(this.token_selector).closest("form").on("checkout_place_order_"+this.gateway_id,this.checkout_place_order.bind(this)),o(document.body).on("wc_stripe_new_method_"+this.gateway_id,this.on_show_new_methods.bind(this)),o(document.body).on("wc_stripe_saved_method_"+this.gateway_id,this.on_show_saved_methods.bind(this)),o(document.body).on("wc_stripe_payment_method_selected",this.on_payment_method_selected.bind(this)),this.banner_enabled()&&o(".woocommerce-billing-fields").length&&o(".wc-stripe-banner-checkout").css("max-width",o(".woocommerce-billing-fields").outerWidth(!0)),this.container_styles(),this.hasOrderReviewParams()},wc_stripe.CheckoutGateway.prototype.container_styles=function(){this.params.description||o(this.container).addClass("wc-stripe-no-desc"),o(this.container).find(".wc-stripe-saved-methods").length||o(this.container).find(".payment_box").addClass("wc-stripe-no-methods")},wc_stripe.CheckoutGateway.prototype.hasOrderReviewParams=function(){var t=a.location.search.match(/_stripe_order_review=(.+)/);if(t&&1<t.length)try{var e=JSON.parse(a.atob(decodeURIComponent(t[1])));this.gateway_id===e.payment_method&&(o(function(){this.payment_token_received=!0,this.set_nonce(e.payment_nonce),this.set_use_new_option(!0)}.bind(this)),history.pushState({},"",a.location.pathname))}catch(i){}},wc_stripe.CheckoutGateway.prototype.has3DSecureParams=function(){if((this.is_current_page("order_pay")||this.is_current_page("checkout")||this.is_change_payment_method())&&a.location.hash&&"string"==typeof a.location.hash){var t=a.location.hash.match(/response=(.*)/);if(t)try{var e=JSON.parse(a.atob(decodeURIComponent(t[1])));e&&e.hasOwnProperty("client_secret")&&e.gateway_id===this.gateway_id&&(o(function(){this.set_payment_method(this.gateway_id),this.set_use_new_option(!0),this.set_nonce(e.pm),!0===e.save_method&&this.set_save_payment_method(!0),o('[name="terms"]').prop("checked",!0)}.bind(this)),history.pushState({},"",a.location.pathname+a.location.search),this.handle_next_action(e))}catch(i){}}},wc_stripe.CheckoutGateway.prototype.update_shipping_address=function(){return wc_stripe.BaseGateway.prototype.update_shipping_address.apply(this,arguments).then(function(t){this.populate_address_fields(t.address,this.get_shipping_prefix()),this.fields.toFormFields({update_shipping_method:!1})}.bind(this))},wc_stripe.CheckoutGateway.prototype.updated_checkout=function(){},wc_stripe.CheckoutGateway.prototype.update_checkout=function(){},wc_stripe.CheckoutGateway.prototype.checkout_error=function(){this.has_checkout_error()&&(this.payment_token_received=!1,this.payment_response=null,this.show_payment_button(),this.hide_place_order())},wc_stripe.CheckoutGateway.prototype.is_valid_checkout=function(){return!(o('[name="terms"]').length&&o('[name="terms"]').is(":visible")&&!o('[name="terms"]').is(":checked"))},wc_stripe.CheckoutGateway.prototype.get_payment_method=function(){return o('[name="payment_method"]:checked').val()},wc_stripe.CheckoutGateway.prototype.set_use_new_option=function(t){o("#"+this.gateway_id+"_use_new").prop("checked",t).trigger("change")},wc_stripe.CheckoutGateway.prototype.checkout_place_order=function(){return this.is_valid_checkout()?!!this.is_saved_method_selected()||this.payment_token_received:(this.submit_error(this.params.messages.terms),!1)},wc_stripe.CheckoutGateway.prototype.on_token_received=function(t){this.payment_token_received=!0,this.set_nonce(t.id),this.hide_payment_button(),this.show_place_order()},wc_stripe.CheckoutGateway.prototype.block=function(){o().block&&this.get_form().block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},wc_stripe.CheckoutGateway.prototype.unblock=function(){o().block&&this.get_form().unblock()},wc_stripe.CheckoutGateway.prototype.hide_place_order=function(){o("#place_order").addClass("wc-stripe-hide")},wc_stripe.CheckoutGateway.prototype.show_place_order=function(){o("#place_order").removeClass("wc-stripe-hide")},wc_stripe.CheckoutGateway.prototype.on_show_new_methods=function(){this.payment_token_received?(this.show_place_order(),this.hide_payment_button()):(this.hide_place_order(),this.show_payment_button())},wc_stripe.CheckoutGateway.prototype.on_show_saved_methods=function(){this.hide_payment_button(),this.show_place_order()},wc_stripe.CheckoutGateway.prototype.show_payment_button=function(){this.$button&&this.$button.show()},wc_stripe.CheckoutGateway.prototype.hide_payment_button=function(){this.$button&&this.$button.hide()},wc_stripe.CheckoutGateway.prototype.trigger_payment_method_selected=function(){this.on_payment_method_selected(null,o('[name="payment_method"]:checked').val())},wc_stripe.CheckoutGateway.prototype.show_new_payment_method=function(){o('[name="'+this.gateway_id+'_payment_type_key"][value="new"').trigger("click")},wc_stripe.CheckoutGateway.prototype.on_payment_method_selected=function(t,e){e===this.gateway_id?this.payment_token_received||this.is_saved_method_selected()?(this.hide_payment_button(),this.show_place_order()):(this.show_payment_button(),this.hide_place_order()):(this.hide_payment_button(),e&&e.indexOf("stripe_")<0&&this.show_place_order())},wc_stripe.CheckoutGateway.prototype.banner_enabled=function(){return"1"===this.params.banner_enabled},wc_stripe.CheckoutGateway.prototype.checkout_fields_valid=function(){if(["checkout","order_pay"].indexOf(this.get_page())<0)return!0;var t=!0;return(t=this.fields.validateFields("billing"))?this.needs_shipping()&&o("#ship-to-different-address-checkbox").is(":checked")?(t=this.fields.validateFields("shipping"))||this.submit_error(this.params.messages.required_field):(t=this.is_valid_checkout())||this.submit_error(this.params.messages.terms):this.submit_error(this.params.messages.required_field),t},wc_stripe.CheckoutGateway.prototype.cart_contains_subscription=function(){return"undefined"!=typeof wc_stripe_cart_contains_subscription&&!0===wc_stripe_cart_contains_subscription},wc_stripe.CheckoutGateway.prototype.set_save_payment_method=function(t){o('[name="'+this.gateway_id+'_save_source_key"]').prop("checked",t)},wc_stripe.CheckoutGateway.prototype.process_order_pay=function(){var t=this.get_form().serializeArray();t.push({name:"_wpnonce",value:this.params.rest_nonce}),t.push({name:"order_id",value:this.params.order_id}),t.push({name:"order_key",value:this.params.order_key}),this.block(),o.ajax({url:this.params.routes.order_pay,method:"POST",dataType:"json",data:o.param(t)}).done(function(t){t.success?t.needs_confirmation?t.data?this.handle_next_action(t.data):a.location.href=t.redirect:this.get_form().trigger("submit"):this.submit_error(t.message)}.bind(this)).fail(function(t,e,i){this.unblock(),this.submit_error(i)}.bind(this))},wc_stripe.ProductGateway=function(){this.message_container="div.product",o("form.cart").on("found_variation",this.found_variation.bind(this)),o("form.cart").on("reset_data",this.reset_variation_data.bind(this)),this.buttonWidth=o("form.cart div.quantity").outerWidth(!0)+o(".single_add_to_cart_button").outerWidth();var t=o(".single_add_to_cart_button").css("marginLeft");t&&(this.buttonWidth+=parseInt(t.replace("px",""))),o(this.container).css("max-width",this.buttonWidth+"px")},wc_stripe.ProductGateway.prototype.get_quantity=function(){return parseInt(o('[name="quantity"]').val())},wc_stripe.ProductGateway.prototype.set_rest_nonce=function(t,e){this.params.rest_nonce=e},wc_stripe.ProductGateway.prototype.found_variation=function(t,e){var i=this.get_gateway_data();i.product.price=e.display_price,i.needs_shipping=!e.is_virtual,i.product.variation=e,this.set_gateway_data(i)},wc_stripe.ProductGateway.prototype.reset_variation_data=function(){var t=this.get_product_data();t.variation=!1,this.set_product_data(t),this.disable_payment_button()},wc_stripe.ProductGateway.prototype.disable_payment_button=function(){this.$button&&this.get_button().prop("disabled",!0).addClass("disabled")},wc_stripe.ProductGateway.prototype.enable_payment_button=function(){this.$button&&this.get_button().prop("disabled",!1).removeClass("disabled")},wc_stripe.ProductGateway.prototype.get_button=function(){return this.$button},wc_stripe.ProductGateway.prototype.is_variable_product=function(){return!!this.get_product_data().variation||0<o('[name="variation_id"]').length},wc_stripe.ProductGateway.prototype.variable_product_selected=function(){var t=this.get_product_data().variation,e=o('input[name="variation_id"]').val();return!!t||!!e&&"0"!=e},wc_stripe.ProductGateway.prototype.get_product_data=function(){return this.get_gateway_data().product},wc_stripe.ProductGateway.prototype.set_product_data=function(t){var e=this.get_gateway_data();e.product=t,this.set_gateway_data(e)},wc_stripe.ProductGateway.prototype.get_form=function(){return o(this.container).closest("form")},wc_stripe.ProductGateway.prototype.add_to_cart=function(){return new Promise(function(e,i){this.block();var t={product_id:this.get_product_data().id,variation_id:this.is_variable_product()?o('[name="variation_id"]').val():0,qty:o('[name="quantity"]').val(),payment_method:this.gateway_id,currency:this.get_currency(),page_id:this.get_page()},s=this.get_form().find(':not([name="add-to-cart"],[name="quantity"],[name^="attribute_"],[name="variation_id"])').serializeArray();if(s)for(var a in s)t[s[a].name]=s[a].value;o.ajax({url:this.params.routes.add_to_cart,method:"POST",dataType:"json",data:o.extend({},t,this.get_product_variations()),beforeSend:this.ajax_before_send.bind(this)}).done(function(t){this.unblock(),t.code?(this.submit_error(t.message),i(t)):(this.set_total_price(t.data.total),this.set_total_price_cents(t.data.totalCents),this.set_display_items(t.data.displayItems),e(t.data))}.bind(this)).fail(function(t,e,i){this.unblock(),this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.ProductGateway.prototype.cart_calculation=function(t){return new Promise(function(e,i){this.processing_calculation=!0,o.ajax({url:this.params.routes.cart_calculation,method:"POST",dataType:"json",data:o.extend({},{product_id:this.get_product_data().id,variation_id:this.is_variable_product()&&t?t:0,qty:o('[name="quantity"]').val(),currency:this.get_currency(),payment_method:this.gateway_id},this.get_product_variations()),beforeSend:this.ajax_before_send.bind(this)}).done(function(t){this.processing_calculation=!1,t.code?(this.cart_calculation_error=!0,i(t)):(this.set_total_price(t.data.total),this.set_total_price_cents(t.data.totalCents),this.set_display_items(t.data.displayItems),e(t.data))}.bind(this)).fail(function(){this.processing_calculation=!1}.bind(this))}.bind(this))},wc_stripe.ProductGateway.prototype.get_product_variations=function(){var s={};return this.is_variable_product()&&o('.variations [name^="attribute_"]').each(function(t,e){var i=o(e),e=i.data("attribute_name")||i.attr("name");s[e]=i.val()}),s},wc_stripe.CartGateway=function(){this.message_container="div.woocommerce",o(document.body).on("updated_wc_div",this.updated_html.bind(this)),o(document.body).on("updated_cart_totals",this.updated_html.bind(this)),o(document.body).on("wc_cart_emptied",this.cart_emptied.bind(this))},wc_stripe.CartGateway.prototype.submit_error=function(t){this.submit_message(this.get_error_message(t))},wc_stripe.CartGateway.prototype.updated_html=function(t){},wc_stripe.CartGateway.prototype.cart_emptied=function(t){},wc_stripe.CartGateway.prototype.add_cart_totals_class=function(){o(".cart_totals").addClass("stripe_cart_gateway_active")},wc_stripe.GooglePay=function(){},wc_stripe.GooglePay.prototype.handleActionMethod="handleCardAction",wc_stripe.GooglePay.prototype.setupActionMethod="confirmCardSetup";var s={apiVersion:2,apiVersionMinor:0},n={type:"CARD",parameters:{allowedAuthMethods:["PAN_ONLY"],allowedCardNetworks:["AMEX","DISCOVER","INTERAC","JCB","MASTERCARD","VISA"],assuranceDetailsRequired:!0}};wc_stripe.GooglePay.prototype.update_addresses=function(t){var e;t.paymentMethodData.info.billingAddress&&(e=t.paymentMethodData.info.billingAddress,this.is_current_page("checkout")&&this.is_valid_address(this.billing_address_object,"billing",["phone","email"])&&(e={phoneNumber:e.phoneNumber}),this.populate_billing_fields(e),e.phoneNumber&&this.fields.exists("shipping_phone")&&this.fields.isEmpty("shipping_phone")&&this.fields.set("shipping_phone",e.phoneNumber)),t.shippingAddress&&this.populate_shipping_fields(t.shippingAddress),t.email&&this.fields.set("email",t.email,"billing")},wc_stripe.GooglePay.prototype.map_address=function(t){return{city:t.locality,postcode:t.postalCode,state:t.administrativeArea,country:t.countryCode}},wc_stripe.GooglePay.prototype.update_payment_data=function(s){return new Promise(function(e,i){var t="default"==s.shippingOptionData.id?null:s.shippingOptionData.id;o.when(o.ajax({url:this.params.routes.payment_data,dataType:"json",method:"POST",data:{address:this.map_address(s.shippingAddress),shipping_method:t,page_id:this.get_page(),currency:this.get_currency()},beforeSend:this.ajax_before_send.bind(this)})).done(function(t){t.code?i(t.data.data):e(t.data)}.bind(this)).fail(function(){i()}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.on_payment_data_changed=function(i){return new Promise(function(e){this.update_payment_data(i).then(function(t){e(t.paymentRequestUpdate),this.set_selected_shipping_methods(t.shipping_methods),this.payment_data_updated(t,i)}.bind(this))["catch"](function(t){e(t)}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.payment_data_updated=function(t){},wc_stripe.GooglePay.prototype.get_merchant_info=function(){var t={merchantId:this.params.merchant_id,merchantName:this.params.merchant_name};return"TEST"===this.params.environment&&delete t.merchantId,t},wc_stripe.GooglePay.prototype.get_payment_options=function(){var t,e={environment:this.params.environment,merchantInfo:this.get_merchant_info(),paymentDataCallbacks:{onPaymentAuthorized:function(){return new Promise(function(t){t({transactionState:"SUCCESS"})}.bind(this))}}};return this.needs_shipping()&&(t=this.get_shipping_prefix(),(!this.is_current_page("checkout")||this.is_valid_address(this.get_address_object(t),t,["email","phone"]))&&this.is_current_page("checkout")||(e.paymentDataCallbacks.onPaymentDataChanged=this.on_payment_data_changed.bind(this))),e},wc_stripe.GooglePay.prototype.build_payment_request=function(){var t=o.extend({},s,{emailRequired:this.fields.requestFieldInWallet("billing_email"),merchantInfo:this.get_merchant_info(),allowedPaymentMethods:[o.extend({type:"CARD",tokenizationSpecification:{type:"PAYMENT_GATEWAY",parameters:{gateway:"stripe","stripe:version":"2018-10-31","stripe:publishableKey":this.params.api_key}}},n)],shippingAddressRequired:function(){if(this.needs_shipping()){var t=this.get_shipping_prefix();if(this.is_current_page("checkout")&&!this.is_valid_address(this.get_address_object(t),t,["email","phone"])||!this.is_current_page("checkout"))return!0}return!1}.bind(this)(),transactionInfo:{countryCode:this.params.processing_country,currencyCode:this.get_currency(),totalPriceStatus:"ESTIMATED",totalPrice:this.get_total_price().toString(),displayItems:this.get_display_items(),totalPriceLabel:this.params.total_price_label}});return t.allowedPaymentMethods[0].parameters.billingAddressRequired=function(){if(this.is_current_page("checkout")){var t=this.billing_address_object=this.get_address_object("billing");return this.fields.requestFieldInWallet("billing_phone")||!this.is_valid_address(t,"billing",["email"])?!0:!1}return!0}.bind(this)(),t.allowedPaymentMethods[0].parameters.billingAddressRequired&&(t.allowedPaymentMethods[0].parameters.billingAddressParameters={format:"FULL",phoneNumberRequired:this.fields.requestFieldInWallet("billing_phone")}),t.shippingAddressRequired?(t.shippingAddressParameters={},t.shippingOptionRequired=!0,t.shippingOptionParameters={shippingOptions:this.get_shipping_options()},t.callbackIntents=["SHIPPING_ADDRESS","SHIPPING_OPTION","PAYMENT_AUTHORIZATION"]):t.callbackIntents=["PAYMENT_AUTHORIZATION"],this.payment_request_options=t},wc_stripe.GooglePay.prototype.createPaymentsClient=function(){this.paymentsClient=new google.payments.api.PaymentsClient(this.get_payment_options())},wc_stripe.GooglePay.prototype.isReadyToPay=function(){return new Promise(function(t){var e=o.extend({},s);e.allowedPaymentMethods=[n],this.paymentsClient.isReadyToPay(e).then(function(){this.can_pay=!0,this.create_button(),t()}.bind(this))["catch"](function(t){t&&t.message&&-1<t.message.indexOf("ShadowRoot")?console.log("GPay is not supported on this browser."):this.submit_error(t)}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.create_button=function(){this.$button&&this.$button.remove(),this.$button=o(this.paymentsClient.createButton(this.get_button_options())),this.$button.addClass("gpay-button-container")},wc_stripe.GooglePay.prototype.get_button_options=function(){var t={onClick:this.start.bind(this),buttonColor:this.params.button_color,buttonType:this.params.button_style,buttonSizeMode:this.params.button_size_mode};return null!==this.params.button_locale&&(t.buttonLocale=this.params.button_locale),t},wc_stripe.GooglePay.prototype.start=function(){this.createPaymentsClient(),this.paymentsClient.loadPaymentData(this.build_payment_request()).then(function(t){var e=JSON.parse(t.paymentMethodData.tokenizationData.token);this.update_addresses(t),this.stripe.createPaymentMethod({type:"card",card:{token:e.id},billing_details:this.get_billing_details()}).then(function(t){if(t.error)return this.submit_error(t.error);this.on_token_received(t.paymentMethod)}.bind(this))}.bind(this))["catch"](function(t){"CANCELED"!==t.statusCode&&(t.statusMessage&&-1<t.statusMessage.indexOf("paymentDataRequest.callbackIntent")?this.submit_error_code("DEVELOPER_ERROR_WHITELIST"):this.submit_error(t.statusMessage))}.bind(this))},wc_stripe.ApplePay=function(){},wc_stripe.ApplePay.prototype.handleActionMethod="handleCardAction",wc_stripe.ApplePay.prototype.setupActionMethod="confirmCardSetup",wc_stripe.ApplePay.prototype.initialize=function(){this.createPaymentRequest(),this.canMakePayment()},wc_stripe.ApplePay.prototype.get_payment_request_options=function(){return o.extend({},wc_stripe.BaseGateway.prototype.get_payment_request_options.apply(this,arguments),{disableWallets:["googlePay"]})},wc_stripe.ApplePay.prototype.create_button=function(){this.$button&&this.$button.remove(),this.$button=o(this.params.button),this.$button.on("click",this.start.bind(this)),this.append_button()},wc_stripe.ApplePay.prototype.canMakePayment=function(){return new Promise(function(e){this.paymentRequest.canMakePayment().then(function(t){t&&t.applePay&&(this.can_pay=!0,this.create_button(),o(this.container).show(),e(t))}.bind(this))}.bind(this))},wc_stripe.ApplePay.prototype.start=function(t){t.preventDefault(),this.paymentRequest.update(this.get_payment_request_update({total:{pending:!1}})),this.paymentRequest.show()},wc_stripe.PaymentRequest=function(){},wc_stripe.PaymentRequest.prototype.handleActionMethod="handleCardAction",wc_stripe.PaymentRequest.prototype.setupActionMethod="confirmCardSetup",wc_stripe.PaymentRequest.prototype.initialize=function(){this.createPaymentRequest(),this.createPaymentRequestButton(),this.canMakePayment(),this.paymentRequestButton.on("click",this.button_click.bind(this))},wc_stripe.PaymentRequest.prototype.button_click=function(t){},wc_stripe.PaymentRequest.prototype.createPaymentRequestButton=function(){this.paymentRequestButton&&this.paymentRequestButton.destroy(),this.paymentRequestButton=this.elements.create("paymentRequestButton",{paymentRequest:this.paymentRequest,style:{paymentRequestButton:{type:this.params.button.type,theme:this.params.button.theme,height:this.params.button.height}}})},wc_stripe.PaymentRequest.prototype.canMakePayment=function(){return new Promise(function(e){var i=this.paymentRequest;this.paymentRequest.canMakePayment().then(function(t){t&&!t.applePay&&i===this.paymentRequest&&(this.can_pay=!0,this.create_button(),o(this.container).show(),e(t))}.bind(this))}.bind(this))},wc_stripe.PaymentRequest.prototype.create_button=function(){this.paymentRequestButton.mount("#wc-stripe-payment-request-container")},wc_stripe.Afterpay=function(){},wc_stripe.Afterpay.prototype.is_eligible=function(t){return this.needs_shipping()&&t>this.get_min()&&t<this.get_max()},wc_stripe.Afterpay.prototype.get_min=function(){var t=this.get_currency(),t=this.params.requirements[t];return t?t[1]:0},wc_stripe.Afterpay.prototype.get_max=function(){var t=this.get_currency(),t=this.params.requirements[t];return t?t[2]:0},wc_stripe.Afterpay.prototype.add_eligibility=function(t,e){o(t).length&&(this.is_eligible(e)?o(t).removeClass("afterpay-ineligible"):this.hide_ineligible_active()&&o(t).addClass("afterpay-ineligible"))},wc_stripe.Afterpay.prototype.hide_ineligible_active=function(){return"yes"===this.params.hide_ineligible},wc_stripe.CheckoutFields=function(t,e){this.params=t,this.page=e,this.session_values=this.supportsSessionStorage()&&sessionStorage.getItem("wc_stripe_checkout_fields")?JSON.parse(sessionStorage.getItem("wc_stripe_checkout_fields")):{},this.fields=new Map(Object.keys(this.params).map(function(t){return null===this.params[t].value&&(t in this.session_values&&null!==this.session_values[t]?this.params[t].value=this.session_values[t]:this.params[t].value=""),[t,this.params[t].value]}.bind(this))),("checkout"===e||"cart"===e&&o(document.body).is(".woocommerce-checkout")||0<o("form.woocommerce-checkout").length)&&(o(document.body).on("updated_checkout",this.updated_checkout.bind(this)),o(document.body).on("change",'[name^="billing_"], [name^="shipping_"]',this.onChange.bind(this)),o("form.checkout").on("change",'.input-text:not([name^="billing_"], [name^="shipping_"], [name="account_password"]), select:not([name^="billing_"], [name^="shipping_"])',this.onChange.bind(this)),o("form.checkout").on("change",'[name="ship_to_different_address"]',this.on_ship_to_address_change.bind(this)),this.init_i18n(),o('[name="ship_to_different_address"]').is(":checked")?this.update_required_fields(o("#shipping_country").val(),"shipping_country"):this.update_required_fields(o("#billing_country").val(),"billing_country"))},wc_stripe.CheckoutFields.prototype.supportsSessionStorage=function(){return"sessionStorage"in a&&null!==a.sessionStorage&&["getItem","setItem"].reduce(function(t,e){return t&&e in sessionStorage}.bind(this),!0)},wc_stripe.CheckoutFields.prototype.init_i18n=function(){"undefined"!=typeof wc_address_i18n_params?this.locales=JSON.parse(wc_address_i18n_params.locale.replace(/&quot;/g,'"')):this.locales=null},wc_stripe.CheckoutFields.prototype.updated_checkout=function(){this.syncCheckoutFieldsWithDOM()},wc_stripe.CheckoutFields.prototype.syncCheckoutFieldsWithDOM=function(){for(var t in this.params)o("#"+t).length&&this.fields.set(t,o("#"+t).val())},wc_stripe.CheckoutFields.prototype.onChange=function(t){try{var e=t.currentTarget.name,i=t.currentTarget.value;this.fields.set(e,i),"billing_country"!==e&&"shipping_country"!==e||this.update_required_fields(i,e),this.supportsSessionStorage()&&sessionStorage.setItem("wc_stripe_checkout_fields",JSON.stringify(this.toJson()))}catch(s){console.log(s)}},wc_stripe.CheckoutFields.prototype.update_required_fields=function(t,e){if(this.locales){var i,s=-1<e.indexOf("billing_")?"billing_":"shipping_",t="undefined"!=typeof this.locales[t]?this.locales[t]:this.locales["default"],a=o.extend(!0,{},this.locales["default"],t);for(i in a){var n=s+i;this.params[n]&&(this.params[n]=o.extend(!0,{},this.params[n],a[i]))}}},wc_stripe.CheckoutFields.prototype.on_ship_to_address_change=function(t){o(t.currentTarget).is(":checked")&&this.update_required_fields(o("#shipping_country").val(),"shipping_country")},wc_stripe.CheckoutFields.prototype.requestFieldInWallet=function(t){return"checkout"===this.page?this.required(t)&&this.isEmpty(t):"order_pay"!==this.page&&this.required(t)},wc_stripe.CheckoutFields.prototype.set=function(t,e,i){this[t]&&"function"==typeof this[t]?this[t]().set.call(this,e,i):this.fields.set(t,e)},wc_stripe.CheckoutFields.prototype.get=function(t,e){var i;return this[t]&&"function"==typeof this[t]?i=this[t]().get.call(this,e):null!=(i=this.fields.get(t))&&""!==i||void 0!==e&&(i=e),void 0===i?"":i},wc_stripe.CheckoutFields.prototype.required=function(t){return!(!this.params[t]||"undefined"==typeof this.params[t].required)&&this.params[t].required},wc_stripe.CheckoutFields.prototype.exists=function(t){return t in this.params},wc_stripe.CheckoutFields.prototype.isEmpty=function(t){if(this.fields.has(t)){t=this.fields.get(t);return null==t||"string"==typeof t&&0===t.trim().length}return!0},wc_stripe.CheckoutFields.prototype.isValid=function(t){if(this[t]&&"function"==typeof this[t])return this[t]().isValid.apply(this,Array.prototype.slice.call(arguments,1))},wc_stripe.CheckoutFields.prototype.first_name=function(){return{set:function(t,e){this.fields.set(e+"_first_name",t)},get:function(t){return this.fields.get(t+"_first_name")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.last_name=function(){return{set:function(t,e){this.fields.set(e+"_last_name",t)},get:function(t){return this.fields.get(t+"_last_name")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.address_1=function(){return{set:function(t,e){this.fields.set(e+"_address_1",t)},get:function(t){return this.fields.get(t+"_address_1")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.address_2=function(){return{set:function(t,e){this.fields.set(e+"_address_2",t)},get:function(t){return this.fields.get(t+"_address_2")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.name=function(){return{set:function(t,e){this.fields.set(e+"_full_name",t);var i=t.split(" ");1<i.length?(t=i.pop(),this.fields.set(e+"_first_name",i.join(" ")),this.fields.set(e+"_last_name",t)):1==i.length&&this.fields.set(e+"_first_name",i[0])},get:function(t){return this.fields.get(t+"_first_name")+" "+this.fields.get(t+"_last_name")}}},wc_stripe.CheckoutFields.prototype.email=function(){return{set:function(t,e){this.fields.set(e+"_email",t)},get:function(t){return this.fields.get(t+"_email")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.phone=function(){return{set:function(t,e){this.fields.set(e+"_phone",t)},get:function(t){return this.fields.get(t+"_phone")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.country=function(){return{set:function(t,e){this.fields.set(e+"_country",t)},get:function(t){return this.fields.get(t+"_country")},isValid:function(t){return"string"==typeof t&&2===t.length}}},wc_stripe.CheckoutFields.prototype.state=function(){return{set:function(i,t){2<(i=i.toUpperCase()).length&&"checkout"===this.page&&o("#"+t+"_state option").each(function(){var t=o(this),e=t.text().toUpperCase();i===e&&(i=t.val())}),this.fields.set(t+"_state",i)},get:function(t){return this.fields.get(t+"_state")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.city=function(){return{set:function(t,e){this.fields.set(e+"_city",t)},get:function(t){return this.fields.get(t+"_city")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.postcode=function(){return{set:function(t,e){this.fields.set(e+"_postcode",t)},get:function(t){return this.fields.get(t+"_postcode")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.recipient=function(){return wc_stripe.CheckoutFields.prototype.name.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.payerName=function(){return wc_stripe.CheckoutFields.prototype.name.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.payerEmail=function(){return wc_stripe.CheckoutFields.prototype.email.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.payerPhone=function(){return wc_stripe.CheckoutFields.prototype.phone.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.phoneNumber=function(){return wc_stripe.CheckoutFields.prototype.phone.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.countryCode=function(){return wc_stripe.CheckoutFields.prototype.country.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.address1=function(){return wc_stripe.CheckoutFields.prototype.address_1.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.address2=function(){return wc_stripe.CheckoutFields.prototype.address_2.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.line1=function(){return wc_stripe.CheckoutFields.prototype.address_1.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.line2=function(){return wc_stripe.CheckoutFields.prototype.address_2.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.addressLine=function(){return{set:function(t,e){0<t.length&&this.fields.set(e+"_address_1",t[0]),1<t.length&&this.fields.set(e+"_address_2",t[1])},get:function(t){return[this.fields.get(t+"_address_1"),this.fields.get(t+"_address_2")]},isValid:function(t){return 0<t.length&&("string"==typeof t[0]&&0<t[0].length)}}},wc_stripe.CheckoutFields.prototype.region=function(){return wc_stripe.CheckoutFields.prototype.state.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.administrativeArea=function(){return wc_stripe.CheckoutFields.prototype.state.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.locality=function(){return wc_stripe.CheckoutFields.prototype.city.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.postal_code=function(){return wc_stripe.CheckoutFields.prototype.postcode.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.postalCode=function(){return wc_stripe.CheckoutFields.prototype.postcode.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.toJson=function(){var i={};return this.fields.forEach(function(t,e){i[e]=t}),i},wc_stripe.CheckoutFields.prototype.toFormFields=function(t){var i=[];this.fields.forEach(function(t,e){e='[name="'+e+'"]';o(e).length&&""!==t&&(o(e).val()!==t&&o(e).is("select")&&i.push(e),o(e).val(t))}),0<i.length&&o(i.join(",")).trigger("change"),void 0!==t&&o(document.body).trigger("update_checkout",t)},wc_stripe.CheckoutFields.prototype.validateFields=function(t){for(var e in this.params){var i=this.params[e];if(-1<e.indexOf(t)&&i.required&&o("#"+e).length&&o("#"+e).is(":visible")){i=o("#"+e).val();if(null==i||0===i.length)return!1}}return!0};try{i=Stripe(wc_stripe_params_v3.api_key,wc_stripe_params_v3.stripeParams)}catch(t){return a.alert(t),console.log(t)}var r=new wc_stripe.CheckoutFields(wc_stripe_checkout_fields,wc_stripe_params_v3.page)}(window,jQuery);
i18n/languages/woo-stripe-payment.pot CHANGED
@@ -2,14 +2,14 @@
2
  # This file is distributed under the same license as the Payment Plugins for Stripe WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Payment Plugins for Stripe WooCommerce 3.3.19\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woo-stripe-payment\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "POT-Creation-Date: 2022-04-07T17:04:43+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.4.0\n"
15
  "X-Domain: woo-stripe-payment\n"
@@ -30,7 +30,7 @@ msgstr ""
30
  msgid "Payment Plugins, support@paymentplugins.com"
31
  msgstr ""
32
 
33
- #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:118
34
  #: includes/admin/meta-boxes/views/html-product-data.php:14
35
  #: includes/gateways/settings/ach-settings.php:13
36
  #: includes/gateways/settings/applepay-settings.php:11
@@ -40,11 +40,11 @@ msgstr ""
40
  msgid "Enabled"
41
  msgstr ""
42
 
43
- #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:123
44
  msgid "If enabled, your site can accept %s payments through Stripe."
45
  msgstr ""
46
 
47
- #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:127
48
  #: includes/gateways/settings/ach-settings.php:70
49
  #: includes/gateways/settings/applepay-settings.php:20
50
  #: includes/gateways/settings/cc-settings.php:18
@@ -53,7 +53,7 @@ msgstr ""
53
  msgid "General Settings"
54
  msgstr ""
55
 
56
- #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:131
57
  #: includes/admin/meta-boxes/views/html-charge-data-subview.php:47
58
  #: includes/gateways/settings/ach-settings.php:74
59
  #: includes/gateways/settings/applepay-settings.php:24
@@ -63,7 +63,7 @@ msgstr ""
63
  msgid "Title"
64
  msgstr ""
65
 
66
- #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:137
67
  #: includes/gateways/settings/ach-settings.php:80
68
  #: includes/gateways/settings/applepay-settings.php:30
69
  #: includes/gateways/settings/cc-settings.php:28
@@ -72,7 +72,7 @@ msgstr ""
72
  msgid "Description"
73
  msgstr ""
74
 
75
- #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:140
76
  #: includes/gateways/settings/ach-settings.php:83
77
  #: includes/gateways/settings/applepay-settings.php:33
78
  #: includes/gateways/settings/cc-settings.php:31
@@ -81,42 +81,42 @@ msgstr ""
81
  msgid "Leave blank if you don't want a description to show for the gateway."
82
  msgstr ""
83
 
84
- #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:144
85
  #: includes/gateways/settings/ach-settings.php:87
86
  msgid "Order Button Text"
87
  msgstr ""
88
 
89
- #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:147
90
  #: includes/gateways/settings/ach-settings.php:90
91
  msgid "The text on the Place Order button that displays when the gateway is selected on the checkout page."
92
  msgstr ""
93
 
94
- #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:171
95
  msgid "When the billing country matches one of these values, the payment method will be hidden on the checkout page."
96
  msgstr ""
97
 
98
- #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:184
99
  msgid "When the billing country matches one of these values, the payment method will be shown on the checkout page."
100
  msgstr ""
101
 
102
- #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:242
103
  msgid "Order %s"
104
  msgstr ""
105
 
106
- #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:381
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:384
111
  msgid " & billing country is not <strong>%s</strong>"
112
  msgstr ""
113
 
114
- #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:386
115
- #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:389
116
  msgid " & billing country is <strong>%s</strong>"
117
  msgstr ""
118
 
119
- #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:411
120
  msgid "Pay with %s"
121
  msgstr ""
122
 
@@ -124,148 +124,148 @@ msgstr ""
124
  msgid "Please fill out all required fields."
125
  msgstr ""
126
 
127
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:439
128
  #: includes/controllers/class-wc-stripe-controller-cart.php:134
129
  #: includes/controllers/class-wc-stripe-controller-cart.php:192
130
  #: includes/controllers/class-wc-stripe-controller-googlepay.php:136
131
  #: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:109
132
- #: packages/blocks/src/Payments/AbstractStripePayment.php:53
133
- #: packages/blocks/src/Payments/GooglePayPayment.php:26
134
  msgid "Total"
135
  msgstr ""
136
 
137
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:510
138
  msgid "User must be logged in."
139
  msgstr ""
140
 
141
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:535
142
  msgid "Error saving payment method. Reason: %s"
143
  msgstr ""
144
 
145
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:554
146
  #: includes/wc-stripe-webhook-functions.php:232
147
  msgid "Order refunded in Stripe. Amount: %s"
148
  msgstr ""
149
 
150
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:593
151
  msgid "Order amount captured in Stripe. Amount: %s"
152
  msgstr ""
153
 
154
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:597
155
  msgid "Error capturing charge in Stripe. Reason: %s"
156
  msgstr ""
157
 
158
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:618
159
  msgid "Error voiding charge. Reason: %s"
160
  msgstr ""
161
 
162
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:620
163
  msgid "Charge voided in Stripe."
164
  msgstr ""
165
 
166
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:798
167
  msgid "n/a"
168
  msgstr ""
169
 
170
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:826
171
  #: includes/admin/meta-boxes/views/html-order-pay.php:42
172
  msgid "New Card"
173
  msgstr ""
174
 
175
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:830
176
  #: includes/admin/meta-boxes/views/html-order-pay.php:30
177
  msgid "Saved Cards"
178
  msgstr ""
179
 
180
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1025
181
  msgid "Attempt to save payment method failed. Reason: %s"
182
  msgstr ""
183
 
184
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1050
185
  msgid "We were not able to save your payment method. To prevent billing issues with your subscription, please add a payment method to the subscription."
186
  msgstr ""
187
 
188
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1052
189
  msgid "We were not able to save your payment method. Reason: %s"
190
  msgstr ""
191
 
192
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1086
193
  msgid "Payment Method Token"
194
  msgstr ""
195
 
196
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1090
197
  msgid "Stripe Customer ID"
198
  msgstr ""
199
 
200
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1110
201
  msgid "Recurring payment for order failed. Reason: %s"
202
  msgstr ""
203
 
204
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1124
205
  msgid "Renewal payment initiated in Stripe. Waiting for the payment to clear."
206
  msgstr ""
207
 
208
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1128
209
  msgid "Recurring payment captured in Stripe. Payment method: %s"
210
  msgstr ""
211
 
212
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1132
213
  msgid "Recurring payment authorized in Stripe. Payment method: %s"
214
  msgstr ""
215
 
216
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1135
217
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1372
218
  msgid "Customer must manually complete payment for payment method %s"
219
  msgstr ""
220
 
221
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1169
222
  #: includes/abstract/abstract-wc-stripe-payment.php:268
223
  msgid "Order %1$s from %2$s"
224
  msgstr ""
225
 
226
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1354
227
  msgid "Pre-order payment for order failed. Reason: %s"
228
  msgstr ""
229
 
230
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1361
231
  msgid "Pre-order payment initiated in Stripe. Waiting for the payment to clear."
232
  msgstr ""
233
 
234
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1365
235
  msgid "Pre-order payment captured in Stripe. Payment method: %s"
236
  msgstr ""
237
 
238
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1369
239
  msgid "Pre-order payment authorized in Stripe. Payment method: %s"
240
  msgstr ""
241
 
242
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1441
243
  msgid "Cannot process payment"
244
  msgstr ""
245
 
246
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1449
247
  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."
248
  msgstr ""
249
 
250
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1567
251
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1598
252
  msgid "Shipping"
253
  msgstr ""
254
 
255
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1575
256
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1601
257
  msgid "Discount"
258
  msgstr ""
259
 
260
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1578
261
  msgid "Tax"
262
  msgstr ""
263
 
264
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1608
265
  msgid "Fees"
266
  msgstr ""
267
 
268
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1802
269
  msgid "Error saving payment method for subscription. Reason: %s"
270
  msgstr ""
271
 
@@ -290,17 +290,65 @@ msgid "Transaction Id cannot be empty."
290
  msgstr ""
291
 
292
  #: includes/abstract/abstract-wc-stripe-payment.php:335
293
- #: includes/gateways/class-wc-payment-gateway-stripe-ach.php:122
294
- #: includes/traits/wc-stripe-payment-traits.php:104
295
  msgid "Error processing payment. Reason: %s"
296
  msgstr ""
297
 
298
  #: includes/abstract/abstract-wc-stripe-rest-controller.php:58
299
- #: includes/controllers/class-wc-stripe-controller-gateway-settings.php:289
300
  #: includes/controllers/class-wc-stripe-controller-order-actions.php:333
301
  msgid "You do not have permissions to access this resource."
302
  msgstr ""
303
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
304
  #: includes/admin/class-wc-stripe-admin-menus.php:19
305
  msgid "Stripe Gateway"
306
  msgstr ""
@@ -321,17 +369,17 @@ msgid "Local Gateways"
321
  msgstr ""
322
 
323
  #: includes/admin/class-wc-stripe-admin-settings.php:95
324
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:147
325
  msgid "Stripe Email Options"
326
  msgstr ""
327
 
328
  #: includes/admin/class-wc-stripe-admin-settings.php:99
329
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:151
330
  msgid "Email Receipt"
331
  msgstr ""
332
 
333
  #: includes/admin/class-wc-stripe-admin-settings.php:102
334
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:153
335
  msgid "If enabled, an email receipt will be sent to the customer by Stripe when the order is processed."
336
  msgstr ""
337
 
@@ -370,7 +418,7 @@ msgstr ""
370
  #: includes/admin/meta-boxes/views/html-order-pay.php:23
371
  #: includes/admin/meta-boxes/views/html-product-data.php:46
372
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:53
373
- #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:116
374
  #: includes/gateways/settings/applepay-settings.php:52
375
  #: includes/gateways/settings/cc-settings.php:50
376
  #: includes/gateways/settings/googlepay-settings.php:74
@@ -393,13 +441,13 @@ msgstr ""
393
 
394
  #: includes/admin/meta-boxes/views/html-charge-data-subview.php:25
395
  #: includes/admin/settings/class-wc-stripe-api-settings.php:44
396
- #: includes/controllers/class-wc-stripe-controller-gateway-settings.php:181
397
  msgid "Live"
398
  msgstr ""
399
 
400
  #: includes/admin/meta-boxes/views/html-charge-data-subview.php:25
401
  #: includes/admin/settings/class-wc-stripe-api-settings.php:43
402
- #: includes/controllers/class-wc-stripe-controller-gateway-settings.php:181
403
  msgid "Test"
404
  msgstr ""
405
 
@@ -431,7 +479,7 @@ msgstr ""
431
  #: templates/cc-forms/bootstrap.php:16
432
  #: templates/cc-forms/minimalist.php:30
433
  #: packages/blocks/assets/js/payment-methods/credit-card/components/bootstrap/index.js:19
434
- #: packages/blocks/build/commons.js:1744
435
  msgid "Exp"
436
  msgstr ""
437
 
@@ -506,7 +554,7 @@ msgstr ""
506
  #: includes/admin/meta-boxes/views/html-order-pay.php:21
507
  #: includes/admin/meta-boxes/views/html-product-data.php:15
508
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:49
509
- #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:112
510
  #: includes/gateways/settings/applepay-settings.php:48
511
  #: includes/gateways/settings/cc-settings.php:46
512
  #: includes/gateways/settings/googlepay-settings.php:70
@@ -517,7 +565,7 @@ msgstr ""
517
  #: includes/admin/meta-boxes/views/html-order-pay.php:24
518
  #: includes/admin/meta-boxes/views/html-product-data.php:48
519
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:54
520
- #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:117
521
  #: includes/gateways/settings/applepay-settings.php:53
522
  #: includes/gateways/settings/cc-settings.php:51
523
  #: includes/gateways/settings/googlepay-settings.php:75
@@ -563,40 +611,40 @@ msgstr ""
563
  msgid "Advanced Settings"
564
  msgstr ""
565
 
566
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:30
567
- msgid "Locale Type"
568
  msgstr ""
569
 
570
  #: includes/admin/settings/class-wc-stripe-advanced-settings.php:34
 
 
 
 
571
  msgid "Auto"
572
  msgstr ""
573
 
574
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:35
575
  msgid "Site Locale"
576
  msgstr ""
577
 
578
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:38
579
  msgid "If set to \"auto\" Stripe will determine the locale to use based on the customer's browser/location settings. Site locale uses the Wordpress locale setting."
580
  msgstr ""
581
 
582
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:43
583
- msgid "This section provides advanced settings that allow you to configure functionality that fits your business process."
584
- msgstr ""
585
-
586
  #: includes/admin/settings/class-wc-stripe-advanced-settings.php:46
587
- msgid "Statement Descriptor"
588
  msgstr ""
589
 
590
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:50
591
- msgid "Maximum of 22 characters. This value represents the full statement descriptor that your customer will see. If left blank, Stripe will use your account descriptor."
592
  msgstr ""
593
 
594
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:61
595
- msgid "Installments"
596
  msgstr ""
597
 
598
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:66
599
- msgid "If enabled, installments will be available for the credit card gateway. %1$s"
600
  msgstr ""
601
 
602
  #: includes/admin/settings/class-wc-stripe-advanced-settings.php:69
@@ -623,56 +671,86 @@ msgstr ""
623
  msgid "If enabled, the plugin will process a payment cancellation or refund within Stripe when the order's status is set to cancelled."
624
  msgstr ""
625
 
626
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:98
627
- msgid "Dispute Settings"
628
  msgstr ""
629
 
630
  #: includes/admin/settings/class-wc-stripe-advanced-settings.php:102
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
631
  msgid "Dispute Created"
632
  msgstr ""
633
 
634
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:105
635
  msgid "If enabled, the plugin will listen for the <strong>charge.dispute.created</strong> webhook event and set the order's status to on-hold by default."
636
  msgstr ""
637
 
638
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:109
639
  msgid "Disputed Created Order Status"
640
  msgstr ""
641
 
642
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:113
643
  msgid "The status assigned to an order when a dispute is created."
644
  msgstr ""
645
 
646
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:121
647
  msgid "Dispute Closed"
648
  msgstr ""
649
 
650
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:124
651
  msgid "If enabled, the plugin will listen for the <strong>charge.dispute.closed</strong> webhook event and set the order's status back to the status before the dispute was opened."
652
  msgstr ""
653
 
654
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:128
655
  msgid "Review Settings"
656
  msgstr ""
657
 
658
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:132
659
  msgid "Review Created"
660
  msgstr ""
661
 
662
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:135
663
  msgid "If enabled, the plugin will listen for the <strong>review.created</strong> webhook event and set the order's status to on-hold by default."
664
  msgstr ""
665
 
666
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:139
667
  msgid "Review Closed"
668
  msgstr ""
669
 
670
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:142
671
  msgid "If enabled, the plugin will listen for the <strong>review.closed</strong> webhook event and set the order's status back to the status before the review was opened."
672
  msgstr ""
673
 
674
- #: includes/admin/settings/class-wc-stripe-advanced-settings.php:192
675
- msgid "Supported Stripe account countries: %1$s"
676
  msgstr ""
677
 
678
  #: includes/admin/settings/class-wc-stripe-api-settings.php:16
@@ -689,115 +767,117 @@ msgid "The mode determines if you are processing test transactions or live trans
689
  msgstr ""
690
 
691
  #: includes/admin/settings/class-wc-stripe-api-settings.php:53
 
692
  msgid "Account ID"
693
  msgstr ""
694
 
695
  #: includes/admin/settings/class-wc-stripe-api-settings.php:58
696
- msgid "This is your Stripe Connect ID and serves as a unique identifier."
 
697
  msgstr ""
698
 
699
- #: includes/admin/settings/class-wc-stripe-api-settings.php:62
700
  msgid "Connect Stripe Account"
701
  msgstr ""
702
 
703
- #: includes/admin/settings/class-wc-stripe-api-settings.php:63
704
  msgid "Click to Connect"
705
  msgstr ""
706
 
707
- #: includes/admin/settings/class-wc-stripe-api-settings.php:65
708
  msgid "We make it easy to connect Stripe to your site. Click the Connect button to go through our connect flow."
709
  msgstr ""
710
 
711
- #: includes/admin/settings/class-wc-stripe-api-settings.php:68
712
  msgid "Test Publishable Key"
713
  msgstr ""
714
 
715
- #: includes/admin/settings/class-wc-stripe-api-settings.php:72
716
  msgid "Your publishable key is used to initialize Stripe assets."
717
  msgstr ""
718
 
719
- #: includes/admin/settings/class-wc-stripe-api-settings.php:80
720
  msgid "Test Secret Key"
721
  msgstr ""
722
 
723
- #: includes/admin/settings/class-wc-stripe-api-settings.php:84
724
  msgid "Your secret key is used to authenticate requests to Stripe."
725
  msgstr ""
726
 
727
- #: includes/admin/settings/class-wc-stripe-api-settings.php:93
728
- #: includes/admin/settings/class-wc-stripe-api-settings.php:94
729
- #: includes/admin/settings/class-wc-stripe-api-settings.php:105
730
- #: includes/admin/settings/class-wc-stripe-api-settings.php:106
731
  msgid "Connection Test"
732
  msgstr ""
733
 
734
- #: includes/admin/settings/class-wc-stripe-api-settings.php:96
735
- #: includes/admin/settings/class-wc-stripe-api-settings.php:108
736
  msgid "Click this button to perform a connection test. If successful, your site is connected to Stripe."
737
  msgstr ""
738
 
739
- #: includes/admin/settings/class-wc-stripe-api-settings.php:117
740
- #: includes/admin/settings/class-wc-stripe-api-settings.php:118
741
- #: includes/admin/settings/class-wc-stripe-api-settings.php:128
742
- #: includes/admin/settings/class-wc-stripe-api-settings.php:129
743
  msgid "Create Webhook"
744
  msgstr ""
745
 
746
- #: includes/admin/settings/class-wc-stripe-api-settings.php:139
747
  msgid "Webhook url"
748
  msgstr ""
749
 
750
- #: includes/admin/settings/class-wc-stripe-api-settings.php:143
751
  msgid "<strong>Important:</strong> the webhook url is called by Stripe when events occur in your account, like a source becomes chargeable. Use the Create Webhook button or add the webhook manually in your Stripe account."
752
  msgstr ""
753
 
754
- #: includes/admin/settings/class-wc-stripe-api-settings.php:148
755
  msgid "Live Webhook Secret"
756
  msgstr ""
757
 
758
- #: includes/admin/settings/class-wc-stripe-api-settings.php:149
759
- #: includes/admin/settings/class-wc-stripe-api-settings.php:158
760
  msgid "The webhook secret is used to authenticate webhooks sent from Stripe. It ensures no 3rd party can send you events, pretending to be Stripe. %1$sWebhook guide%2$s"
761
  msgstr ""
762
 
763
- #: includes/admin/settings/class-wc-stripe-api-settings.php:157
764
  msgid "Test Webhook Secret"
765
  msgstr ""
766
 
767
- #: includes/admin/settings/class-wc-stripe-api-settings.php:165
768
  msgid "Debug Log"
769
  msgstr ""
770
 
771
- #: includes/admin/settings/class-wc-stripe-api-settings.php:169
772
  msgid "When enabled, the plugin logs important errors and info that can help you troubleshoot potential issues."
773
  msgstr ""
774
 
775
- #: includes/admin/settings/class-wc-stripe-api-settings.php:175
776
- msgid "%s Your Stripe account has been connected. You can now accept Live and Test payments. You can Re-Connect if you want to recycle your API keys for security."
777
  msgstr ""
778
 
779
- #: includes/admin/settings/class-wc-stripe-api-settings.php:188
780
- #: includes/admin/settings/class-wc-stripe-api-settings.php:189
781
  msgid "Delete Webhook"
782
  msgstr ""
783
 
784
- #: includes/admin/settings/class-wc-stripe-api-settings.php:213
785
- msgid "Click To Re-Connect"
786
  msgstr ""
787
 
788
- #: includes/admin/settings/class-wc-stripe-api-settings.php:231
789
  msgid "Please try again."
790
  msgstr ""
791
 
792
- #: includes/admin/settings/class-wc-stripe-api-settings.php:234
793
  msgid "We were not able to connect your Stripe account. Reason: %s"
794
  msgstr ""
795
 
796
- #: includes/admin/settings/class-wc-stripe-api-settings.php:239
797
  msgid "Not authorized to perform this action. Required permission: manage_woocommerce"
798
  msgstr ""
799
 
800
- #: includes/admin/settings/class-wc-stripe-api-settings.php:274
801
  msgid "Your Stripe account has been connected to your WooCommerce store. You may now accept payments in Live and Test mode."
802
  msgstr ""
803
 
@@ -815,13 +895,13 @@ msgstr ""
815
 
816
  #: includes/admin/views/html-main-navigation.php:15
817
  #: includes/admin/views/html-welcome-page.php:45
818
- #: includes/class-wc-stripe-install.php:32
819
  msgid "Settings"
820
  msgstr ""
821
 
822
  #: includes/admin/views/html-main-navigation.php:18
823
  #: includes/admin/views/html-welcome-page.php:59
824
- #: includes/class-wc-stripe-install.php:33
825
  msgid "Documentation"
826
  msgstr ""
827
 
@@ -959,7 +1039,7 @@ msgstr ""
959
  msgid "Error saving customer. Reason: %s"
960
  msgstr ""
961
 
962
- #: includes/class-wc-stripe-frontend-scripts.php:89
963
  msgid "No matches found"
964
  msgstr ""
965
 
@@ -979,11 +1059,11 @@ msgstr ""
979
  msgid "Payment authorization failed."
980
  msgstr ""
981
 
982
- #: includes/class-wc-stripe-rest-api.php:46
983
  msgid "%1$s is an invalid controller name."
984
  msgstr ""
985
 
986
- #: includes/class-wc-stripe-update.php:53
987
  msgid "Thank you for updating Stripe for WooCommerce to version %1$s."
988
  msgstr ""
989
 
@@ -991,59 +1071,66 @@ msgstr ""
991
  msgid "Quantity must be greater than zero."
992
  msgstr ""
993
 
994
- #: includes/controllers/class-wc-stripe-controller-checkout.php:123
995
  msgid "Invalid order ID."
996
  msgstr ""
997
 
998
- #: includes/controllers/class-wc-stripe-controller-checkout.php:126
999
  msgid "Invalid order key."
1000
  msgstr ""
1001
 
1002
- #: includes/controllers/class-wc-stripe-controller-checkout.php:245
1003
- #: includes/controllers/class-wc-stripe-controller-checkout.php:291
 
 
 
 
 
 
 
1004
  msgid "Please review your order details then click Place Order."
1005
  msgstr ""
1006
 
1007
- #: includes/controllers/class-wc-stripe-controller-gateway-settings.php:86
1008
  msgid "You cannot register your domain until you have completed the Connect process on the API Settings page. A registered domain is not required when test mode is enabled."
1009
  msgstr ""
1010
 
1011
- #: includes/controllers/class-wc-stripe-controller-gateway-settings.php:116
1012
  msgid "Domain registered successfully. You can confirm in your Stripe Dashboard at https://dashboard.stripe.com/account/apple_pay."
1013
  msgstr ""
1014
 
1015
- #: includes/controllers/class-wc-stripe-controller-gateway-settings.php:139
1016
  msgid "You must configure your secret key before creating webhooks."
1017
  msgstr ""
1018
 
1019
- #: includes/controllers/class-wc-stripe-controller-gateway-settings.php:161
1020
  msgid "There is already a webhook configured for this site. If you want to delete the webhook, login to your Stripe Dashboard."
1021
  msgstr ""
1022
 
1023
- #: includes/controllers/class-wc-stripe-controller-gateway-settings.php:178
1024
  msgid "Webhook created in Stripe for %s environment. You can test your webhook by logging in to the Stripe dashboard"
1025
  msgstr ""
1026
 
1027
- #: includes/controllers/class-wc-stripe-controller-gateway-settings.php:226
1028
  msgid "You must enter your API keys or connect the plugin before performing a connection test."
1029
  msgstr ""
1030
 
1031
- #: includes/controllers/class-wc-stripe-controller-gateway-settings.php:239
1032
  msgid "Mode: %s. Invalid secret key. Please check your entry."
1033
  msgstr ""
1034
 
1035
- #: includes/controllers/class-wc-stripe-controller-gateway-settings.php:263
1036
- #: includes/controllers/class-wc-stripe-controller-gateway-settings.php:266
1037
  msgid "Mode: %s. Invalid publishable key. Please check your entry."
1038
  msgstr ""
1039
 
1040
- #: includes/controllers/class-wc-stripe-controller-gateway-settings.php:280
1041
  msgid "Connection test to Stripe was successful. Mode: %s."
1042
  msgstr ""
1043
 
1044
  #: includes/controllers/class-wc-stripe-controller-googlepay.php:85
1045
  #: packages/blocks/assets/js/payment-methods/googlepay/hooks/use-payments-client.js:155
1046
- #: packages/blocks/build/commons.js:2460
1047
  msgid "Your shipping address is not serviceable."
1048
  msgstr ""
1049
 
@@ -1073,12 +1160,6 @@ msgstr ""
1073
  msgid "Invalid order id provided"
1074
  msgstr ""
1075
 
1076
- #: includes/controllers/class-wc-stripe-controller-payment-intent.php:115
1077
- #: includes/controllers/class-wc-stripe-controller-payment-intent.php:152
1078
- #: packages/cartflows/src/Routes/PaymentIntentRoute.php:47
1079
- msgid "You are not authorized to update this order."
1080
- msgstr ""
1081
-
1082
  #: includes/controllers/class-wc-stripe-controller-signup.php:67
1083
  msgid "It's on its way! Please check your emails."
1084
  msgstr ""
@@ -1116,22 +1197,28 @@ msgstr ""
1116
  msgid "ACH gateway that integrates with your Stripe account."
1117
  msgstr ""
1118
 
1119
- #: includes/gateways/class-wc-payment-gateway-stripe-ach.php:248
1120
  msgid "Saved Banks"
1121
  msgstr ""
1122
 
1123
- #: includes/gateways/class-wc-payment-gateway-stripe-ach.php:252
1124
  msgid "New Bank"
1125
  msgstr ""
1126
 
1127
- #: includes/gateways/class-wc-payment-gateway-stripe-ach.php:296
1128
  msgid "You must set the API mode to live in order to enable the Plaid development environment."
1129
  msgstr ""
1130
 
 
 
 
 
 
 
1131
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:26
1132
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:27
1133
  #: packages/blocks/assets/js/payment-methods/local-payment/afterpay.js:114
1134
- #: packages/blocks/build/commons.js:3357
1135
  msgid "Afterpay"
1136
  msgstr ""
1137
 
@@ -1144,7 +1231,7 @@ msgid "Complete Order"
1144
  msgstr ""
1145
 
1146
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:57
1147
- #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:120
1148
  #: includes/gateways/settings/applepay-settings.php:56
1149
  #: includes/gateways/settings/cc-settings.php:54
1150
  #: includes/gateways/settings/payment-request-settings.php:57
@@ -1194,7 +1281,7 @@ msgstr ""
1194
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:86
1195
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:145
1196
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:204
1197
- #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:124
1198
  #: includes/gateways/settings/googlepay-settings.php:111
1199
  msgid "Icon"
1200
  msgstr ""
@@ -1226,7 +1313,7 @@ msgstr ""
1226
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:96
1227
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:155
1228
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:214
1229
- #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:132
1230
  msgid "This is the icon style that appears next to the gateway on the checkout page."
1231
  msgstr ""
1232
 
@@ -1430,7 +1517,7 @@ msgid "If enabled, the voucher link will be included in the order on-hold email
1430
  msgstr ""
1431
 
1432
  #: includes/gateways/class-wc-payment-gateway-stripe-boleto.php:65
1433
- #: includes/wc-stripe-functions.php:1128
1434
  msgid "Please enter a valid CPF / CNPJ"
1435
  msgstr ""
1436
 
@@ -1451,12 +1538,24 @@ msgstr ""
1451
  msgid "Credit card gateway that integrates with your Stripe account."
1452
  msgstr ""
1453
 
1454
- #: includes/gateways/class-wc-payment-gateway-stripe-cc.php:85
1455
  #: packages/blocks/assets/js/components/checkout/installments/index.js:69
1456
- #: packages/blocks/build/commons.js:1284
1457
  msgid "Loading installments..."
1458
  msgstr ""
1459
 
 
 
 
 
 
 
 
 
 
 
 
 
1460
  #: includes/gateways/class-wc-payment-gateway-stripe-eps.php:26
1461
  #: includes/gateways/class-wc-payment-gateway-stripe-eps.php:29
1462
  msgid "EPS"
@@ -1528,20 +1627,20 @@ msgstr ""
1528
  msgid "Ideal gateway that integrates with your Stripe account."
1529
  msgstr ""
1530
 
1531
- #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:24
1532
- #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:26
1533
  msgid "Klarna"
1534
  msgstr ""
1535
 
1536
- #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:27
1537
  msgid "Klarna gateway that integrates with your Stripe account."
1538
  msgstr ""
1539
 
1540
- #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:127
1541
  msgid "Black text"
1542
  msgstr ""
1543
 
1544
- #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:128
1545
  msgid "Pink background black text"
1546
  msgstr ""
1547
 
@@ -1654,7 +1753,7 @@ msgstr ""
1654
 
1655
  #: includes/gateways/class-wc-payment-gateway-stripe-wechat.php:92
1656
  #: packages/blocks/assets/js/payment-methods/local-payment/wechat.js:130
1657
- #: packages/blocks/build/commons.js:4479
1658
  msgid "Scan the QR code using your WeChat app. Once scanned click the Place Order button."
1659
  msgstr ""
1660
 
@@ -1771,10 +1870,6 @@ msgstr ""
1771
  msgid "This is the status of the order once payment is complete. If <b>Default</b> is selected, then WooCommerce will set the order status automatically based on internal logic which states if a product is virtual and downloadable then status is set to complete. Products that require shipping are set to Processing. Default is the recommended setting as it allows standard WooCommerce code to process the order status."
1772
  msgstr ""
1773
 
1774
- #: includes/gateways/settings/ach-settings.php:121
1775
- msgid "ACH Fee"
1776
- msgstr ""
1777
-
1778
  #: includes/gateways/settings/ach-settings.php:131
1779
  msgid "None"
1780
  msgstr ""
@@ -1958,62 +2053,66 @@ msgid "Card Form"
1958
  msgstr ""
1959
 
1960
  #: includes/gateways/settings/cc-settings.php:118
1961
- msgid "Stripe form"
1962
  msgstr ""
1963
 
1964
  #: includes/gateways/settings/cc-settings.php:119
 
 
 
 
1965
  msgid "Custom form"
1966
  msgstr ""
1967
 
1968
- #: includes/gateways/settings/cc-settings.php:122
1969
- msgid "The Stripe form option displays a CC form rendered by Stripe. It works well with most themes. The custom card forms are offered if you want more options on the CC form design."
1970
  msgstr ""
1971
 
1972
- #: includes/gateways/settings/cc-settings.php:125
1973
  msgid "Custom Form"
1974
  msgstr ""
1975
 
1976
- #: includes/gateways/settings/cc-settings.php:129
1977
  msgid "The design of the credit card form."
1978
  msgstr ""
1979
 
1980
- #: includes/gateways/settings/cc-settings.php:134
1981
  msgid "Postal Code"
1982
  msgstr ""
1983
 
1984
- #: includes/gateways/settings/cc-settings.php:137
1985
  msgid "If enabled, the CC form will show the postal code on the checkout page. If disabled, the billing field's postal code will be used. The postal code will show on the Add Payment Method page for security reasons."
1986
  msgstr ""
1987
 
1988
- #: includes/gateways/settings/cc-settings.php:142
1989
  msgid "Notices Location"
1990
  msgstr ""
1991
 
1992
- #: includes/gateways/settings/cc-settings.php:146
1993
  msgid "Above card form"
1994
  msgstr ""
1995
 
1996
- #: includes/gateways/settings/cc-settings.php:147
1997
  msgid "Below card form"
1998
  msgstr ""
1999
 
2000
- #: includes/gateways/settings/cc-settings.php:148
2001
  msgid "Top of checkout page"
2002
  msgstr ""
2003
 
2004
- #: includes/gateways/settings/cc-settings.php:149
2005
  msgid "Custom css selector"
2006
  msgstr ""
2007
 
2008
- #: includes/gateways/settings/cc-settings.php:152
2009
  msgid "This option allows you to control the location of credit card form validation errors. If you select custom, then you can provide a custom css selector for where the notices appear."
2010
  msgstr ""
2011
 
2012
- #: includes/gateways/settings/cc-settings.php:155
2013
  msgid "Notices Selector"
2014
  msgstr ""
2015
 
2016
- #: includes/gateways/settings/cc-settings.php:159
2017
  msgid "This is the css selector where the card validation notices will be prepended to."
2018
  msgstr ""
2019
 
@@ -2169,7 +2268,7 @@ msgstr ""
2169
 
2170
  #: includes/tokens/class-wc-payment-token-stripe-ach.php:70
2171
  #: includes/tokens/class-wc-payment-token-stripe-ach.php:75
2172
- #: includes/tokens/class-wc-payment-token-stripe-cc.php:90
2173
  msgid "Type Ending In"
2174
  msgstr ""
2175
 
@@ -2183,45 +2282,49 @@ msgstr ""
2183
 
2184
  #: includes/tokens/class-wc-payment-token-stripe-ach.php:80
2185
  #: includes/tokens/class-wc-payment-token-stripe-becs.php:63
2186
- #: includes/tokens/class-wc-payment-token-stripe-cc.php:125
2187
  #: includes/tokens/class-wc-payment-token-stripe-local-payment.php:34
2188
  #: includes/tokens/class-wc-payment-token-stripe-sepa.php:63
2189
  msgid "Gateway Title"
2190
  msgstr ""
2191
 
2192
  #: includes/tokens/class-wc-payment-token-stripe-becs.php:65
2193
- #: includes/tokens/class-wc-payment-token-stripe-cc.php:92
2194
  #: includes/tokens/class-wc-payment-token-stripe-sepa.php:65
2195
  msgid "{brand} ending in {last4}"
2196
  msgstr ""
2197
 
2198
  #: includes/tokens/class-wc-payment-token-stripe-becs.php:68
2199
- #: includes/tokens/class-wc-payment-token-stripe-cc.php:105
2200
  #: includes/tokens/class-wc-payment-token-stripe-sepa.php:68
2201
  msgid "Type Last 4"
2202
  msgstr ""
2203
 
2204
- #: includes/tokens/class-wc-payment-token-stripe-cc.php:95
2205
  msgid "Type Masked Number"
2206
  msgstr ""
2207
 
2208
- #: includes/tokens/class-wc-payment-token-stripe-cc.php:100
2209
  msgid "Type Dash Masked Number"
2210
  msgstr ""
2211
 
2212
- #: includes/tokens/class-wc-payment-token-stripe-cc.php:110
2213
  msgid "Type Dash & Last 4"
2214
  msgstr ""
2215
 
2216
- #: includes/tokens/class-wc-payment-token-stripe-cc.php:115
2217
  msgid "Last Four"
2218
  msgstr ""
2219
 
2220
- #: includes/tokens/class-wc-payment-token-stripe-cc.php:120
2221
  msgid "Card Type"
2222
  msgstr ""
2223
 
2224
- #: includes/tokens/class-wc-payment-token-stripe-cc.php:133
 
 
 
 
2225
  msgid "Credit Card"
2226
  msgstr ""
2227
 
@@ -2254,241 +2357,245 @@ msgstr ""
2254
  msgid "Kind Regards,"
2255
  msgstr ""
2256
 
2257
- #: includes/wc-stripe-functions.php:729
2258
  msgid "Bootstrap form"
2259
  msgstr ""
2260
 
2261
- #: includes/wc-stripe-functions.php:755
2262
  msgid "Simple form"
2263
  msgstr ""
2264
 
2265
- #: includes/wc-stripe-functions.php:778
2266
  msgid "Minimalist form"
2267
  msgstr ""
2268
 
2269
- #: includes/wc-stripe-functions.php:804
2270
  msgid "Inline Form"
2271
  msgstr ""
2272
 
2273
- #: includes/wc-stripe-functions.php:826
2274
  msgid "Rounded Form"
2275
  msgstr ""
2276
 
2277
- #: includes/wc-stripe-functions.php:1057
2278
  msgid "There was an error processing your credit card."
2279
  msgstr ""
2280
 
2281
- #: includes/wc-stripe-functions.php:1058
2282
  msgid "Your card number is incomplete."
2283
  msgstr ""
2284
 
2285
- #: includes/wc-stripe-functions.php:1059
2286
  msgid "Your card's expiration date is incomplete."
2287
  msgstr ""
2288
 
2289
- #: includes/wc-stripe-functions.php:1060
2290
  msgid "Your card's security code is incomplete."
2291
  msgstr ""
2292
 
2293
- #: includes/wc-stripe-functions.php:1061
2294
  msgid "Your card's zip code is incomplete."
2295
  msgstr ""
2296
 
2297
- #: includes/wc-stripe-functions.php:1062
2298
  msgid "The card number is incorrect. Check the card's number or use a different card."
2299
  msgstr ""
2300
 
2301
- #: includes/wc-stripe-functions.php:1063
2302
  msgid "The card's security code is incorrect. Check the card's security code or use a different card."
2303
  msgstr ""
2304
 
2305
- #: includes/wc-stripe-functions.php:1064
2306
  msgid "The card's ZIP code is incorrect. Check the card's ZIP code or use a different card."
2307
  msgstr ""
2308
 
2309
- #: includes/wc-stripe-functions.php:1065
2310
- #: includes/wc-stripe-functions.php:1070
2311
  msgid "The card number is invalid. Check the card details or use a different card."
2312
  msgstr ""
2313
 
2314
- #: includes/wc-stripe-functions.php:1066
2315
  msgid "This value provided to the field contains characters that are unsupported by the field."
2316
  msgstr ""
2317
 
2318
- #: includes/wc-stripe-functions.php:1067
2319
  msgid "The card's security code is invalid. Check the card's security code or use a different card."
2320
  msgstr ""
2321
 
2322
- #: includes/wc-stripe-functions.php:1068
2323
  msgid "The card's expiration month is incorrect. Check the expiration date or use a different card."
2324
  msgstr ""
2325
 
2326
- #: includes/wc-stripe-functions.php:1069
2327
  msgid "The card's expiration year is incorrect. Check the expiration date or use a different card."
2328
  msgstr ""
2329
 
2330
- #: includes/wc-stripe-functions.php:1071
2331
  msgid "The card's address is incorrect. Check the card's address or use a different card."
2332
  msgstr ""
2333
 
2334
- #: includes/wc-stripe-functions.php:1072
2335
  msgid "The card has expired. Check the expiration date or use a different card."
2336
  msgstr ""
2337
 
2338
- #: includes/wc-stripe-functions.php:1073
2339
  msgid "The card has been declined."
2340
  msgstr ""
2341
 
2342
- #: includes/wc-stripe-functions.php:1074
2343
  msgid "Your card's expiration year is in the past."
2344
  msgstr ""
2345
 
2346
- #: includes/wc-stripe-functions.php:1075
2347
  msgid "The bank account number provided is invalid (e.g., missing digits). Bank account information varies from country to country. We recommend creating validations in your entry forms based on the bank account formats we provide."
2348
  msgstr ""
2349
 
2350
- #: includes/wc-stripe-functions.php:1077
2351
  msgid "The specified amount is greater than the maximum amount allowed. Use a lower amount and try again."
2352
  msgstr ""
2353
 
2354
- #: includes/wc-stripe-functions.php:1078
2355
  msgid "The specified amount is less than the minimum amount allowed. Use a higher amount and try again."
2356
  msgstr ""
2357
 
2358
- #: includes/wc-stripe-functions.php:1079
2359
  msgid "The payment requires authentication to proceed. If your customer is off session, notify your customer to return to your application and complete the payment. If you provided the error_on_requires_action parameter, then your customer should try another card that does not require authentication."
2360
  msgstr ""
2361
 
2362
- #: includes/wc-stripe-functions.php:1081
2363
  msgid "The transfer or payout could not be completed because the associated account does not have a sufficient balance available. Create a new transfer or payout using an amount less than or equal to the account's available balance."
2364
  msgstr ""
2365
 
2366
- #: includes/wc-stripe-functions.php:1083
2367
  msgid "The bank account provided can not be used to charge, either because it is not verified yet or it is not supported."
2368
  msgstr ""
2369
 
2370
- #: includes/wc-stripe-functions.php:1084
2371
  msgid "The bank account provided already exists on the specified Customer object. If the bank account should also be attached to a different customer, include the correct customer ID when making the request again."
2372
  msgstr ""
2373
 
2374
- #: includes/wc-stripe-functions.php:1086
2375
  msgid "The bank account provided cannot be used for payouts. A different bank account must be used."
2376
  msgstr ""
2377
 
2378
- #: includes/wc-stripe-functions.php:1087
2379
  msgid "Your Connect platform is attempting to share an unverified bank account with a connected account."
2380
  msgstr ""
2381
 
2382
- #: includes/wc-stripe-functions.php:1088
2383
  msgid "The bank account cannot be verified, either because the microdeposit amounts provided do not match the actual amounts, or because verification has failed too many times."
2384
  msgstr ""
2385
 
2386
- #: includes/wc-stripe-functions.php:1090
2387
  msgid "This card has been declined too many times. You can try to charge this card again after 24 hours. We suggest reaching out to your customer to make sure they have entered all of their information correctly and that there are no issues with their card."
2388
  msgstr ""
2389
 
2390
- #: includes/wc-stripe-functions.php:1092
2391
  msgid "The charge you're attempting to capture has already been captured. Update the request with an uncaptured charge ID."
2392
  msgstr ""
2393
 
2394
- #: includes/wc-stripe-functions.php:1093
2395
  msgid "The charge you're attempting to refund has already been refunded. Update the request to use the ID of a charge that has not been refunded."
2396
  msgstr ""
2397
 
2398
- #: includes/wc-stripe-functions.php:1095
2399
  msgid "The charge you're attempting to refund has been charged back. Check the disputes documentation to learn how to respond to the dispute."
2400
  msgstr ""
2401
 
2402
- #: includes/wc-stripe-functions.php:1097
2403
  msgid "This charge would cause you to exceed your rolling-window processing limit for this source type. Please retry the charge later, or contact us to request a higher processing limit."
2404
  msgstr ""
2405
 
2406
- #: includes/wc-stripe-functions.php:1099
2407
  msgid "The charge cannot be captured as the authorization has expired. Auth and capture charges must be captured within seven days."
2408
  msgstr ""
2409
 
2410
- #: includes/wc-stripe-functions.php:1101
2411
  msgid "One or more provided parameters was not allowed for the given operation on the Charge. Check our API reference or the returned error message to see which values were not correct for that Charge."
2412
  msgstr ""
2413
 
2414
- #: includes/wc-stripe-functions.php:1103
2415
  msgid "The email address is invalid (e.g., not properly formatted). Check that the email address is properly formatted and only includes allowed characters."
2416
  msgstr ""
2417
 
2418
- #: includes/wc-stripe-functions.php:1105
2419
  msgid "The idempotency key provided is currently being used in another request. This occurs if your integration is making duplicate requests simultaneously."
2420
  msgstr ""
2421
 
2422
- #: includes/wc-stripe-functions.php:1107
2423
  msgid "The specified amount is invalid. The charge amount must be a positive integer in the smallest currency unit, and not exceed the minimum or maximum amount."
2424
  msgstr ""
2425
 
2426
- #: includes/wc-stripe-functions.php:1109
2427
  msgid "The source cannot be used because it is not in the correct state (e.g., a charge request is trying to use a source with a pending, failed, or consumed source). Check the status of the source you are attempting to use."
2428
  msgstr ""
2429
 
2430
- #: includes/wc-stripe-functions.php:1111
2431
  msgid "Both a customer and source ID have been provided, but the source has not been saved to the customer. To create a charge for a customer with a specified source, you must first save the card details."
2432
  msgstr ""
2433
 
2434
- #: includes/wc-stripe-functions.php:1113
2435
  msgid "The ZIP code provided was incorrect."
2436
  msgstr ""
2437
 
2438
- #: includes/wc-stripe-functions.php:1114
2439
  msgid "An error occurred while processing the card. Try again later or with a different payment method."
2440
  msgstr ""
2441
 
2442
- #: includes/wc-stripe-functions.php:1115
2443
  msgid "The card does not support this type of purchase."
2444
  msgstr ""
2445
 
2446
- #: includes/wc-stripe-functions.php:1116
2447
- #: includes/wc-stripe-functions.php:1119
2448
- #: includes/wc-stripe-functions.php:1121
2449
  msgid "The card has been declined for an unknown reason."
2450
  msgstr ""
2451
 
2452
- #: includes/wc-stripe-functions.php:1117
2453
  msgid "The customer has exceeded the balance or credit limit available on their card."
2454
  msgstr ""
2455
 
2456
- #: includes/wc-stripe-functions.php:1118
2457
  msgid "The card does not support the specified currency."
2458
  msgstr ""
2459
 
2460
- #: includes/wc-stripe-functions.php:1120
2461
  msgid "The payment has been declined as Stripe suspects it is fraudulent."
2462
  msgstr ""
2463
 
2464
- #: includes/wc-stripe-functions.php:1122
2465
  msgid "The PIN entered is incorrect. "
2466
  msgstr ""
2467
 
2468
- #: includes/wc-stripe-functions.php:1123
2469
  msgid "The card has insufficient funds to complete the purchase."
2470
  msgstr ""
2471
 
2472
- #: includes/wc-stripe-functions.php:1124
2473
  msgid "Please select a payment method before proceeding."
2474
  msgstr ""
2475
 
2476
- #: includes/wc-stripe-functions.php:1125
2477
  msgid "Please enter your IBAN before proceeding."
2478
  msgstr ""
2479
 
2480
- #: includes/wc-stripe-functions.php:1126
2481
  msgid "Please select a bank before proceeding"
2482
  msgstr ""
2483
 
2484
- #: includes/wc-stripe-functions.php:1127
2485
  msgid "The IBAN you entered is incomplete."
2486
  msgstr ""
2487
 
2488
- #: includes/wc-stripe-functions.php:1129
2489
  msgid "Your card was declined. Your request was in test mode, but you used a real credit card. Only test cards can be used in test mode."
2490
  msgstr ""
2491
 
 
 
 
 
2492
  #: includes/wc-stripe-webhook-functions.php:106
2493
  msgid "Charge.succeeded webhook received. Payment has been completed."
2494
  msgstr ""
@@ -2513,8 +2620,8 @@ msgstr ""
2513
  msgid "A review has been closed for charge %1$s. Reason: %2$s."
2514
  msgstr ""
2515
 
2516
- #: packages/blocks/src/Payments/CreditCardPayment.php:34
2517
- #: templates/checkout/credit-card.php:22
2518
  msgid "Save Card"
2519
  msgstr ""
2520
 
@@ -2522,7 +2629,7 @@ msgstr ""
2522
  msgid "%1$s - Order %2$s - One Time offer"
2523
  msgstr ""
2524
 
2525
- #: src/Installments/InstallmentController.php:126
2526
  msgid "Installments:"
2527
  msgstr ""
2528
 
@@ -2534,19 +2641,19 @@ msgstr ""
2534
  msgid "Do not pay with installment."
2535
  msgstr ""
2536
 
2537
- #: src/Installments/InstallmentFormatter.php:45
2538
  msgid "day"
2539
  msgid_plural "days"
2540
  msgstr[0] ""
2541
  msgstr[1] ""
2542
 
2543
- #: src/Installments/InstallmentFormatter.php:46
2544
  msgid "week"
2545
  msgid_plural "weeks"
2546
  msgstr[0] ""
2547
  msgstr[1] ""
2548
 
2549
- #: src/Installments/InstallmentFormatter.php:47
2550
  msgid "month"
2551
  msgid_plural "months"
2552
  msgstr[0] ""
@@ -2567,8 +2674,8 @@ msgstr ""
2567
  #: templates/cc-forms/simple.php:12
2568
  #: packages/blocks/assets/js/payment-methods/credit-card/components/bootstrap/index.js:13
2569
  #: packages/blocks/assets/js/payment-methods/credit-card/components/simple/index.js:19
2570
- #: packages/blocks/build/commons.js:1738
2571
- #: packages/blocks/build/commons.js:1887
2572
  msgid "Card Number"
2573
  msgstr ""
2574
 
@@ -2578,8 +2685,8 @@ msgstr ""
2578
  #: templates/cc-forms/simple.php:26
2579
  #: packages/blocks/assets/js/payment-methods/credit-card/components/bootstrap/index.js:24
2580
  #: packages/blocks/assets/js/payment-methods/credit-card/components/simple/index.js:40
2581
- #: packages/blocks/build/commons.js:1749
2582
- #: packages/blocks/build/commons.js:1908
2583
  msgid "CVV"
2584
  msgstr ""
2585
 
@@ -2599,7 +2706,7 @@ msgstr ""
2599
 
2600
  #: templates/cc-forms/simple.php:20
2601
  #: packages/blocks/assets/js/payment-methods/credit-card/components/simple/index.js:31
2602
- #: packages/blocks/build/commons.js:1899
2603
  msgid "Expiration"
2604
  msgstr ""
2605
 
@@ -2609,19 +2716,19 @@ msgstr ""
2609
 
2610
  #: templates/checkout/ach.php:11
2611
  #: packages/blocks/assets/js/payment-methods/ach/payment-method.js:59
2612
- #: packages/blocks/build/commons.js:1559
2613
  msgid "username"
2614
  msgstr ""
2615
 
2616
  #: templates/checkout/ach.php:12
2617
  #: packages/blocks/assets/js/payment-methods/ach/payment-method.js:62
2618
- #: packages/blocks/build/commons.js:1562
2619
  msgid "password"
2620
  msgstr ""
2621
 
2622
  #: templates/checkout/ach.php:13
2623
  #: packages/blocks/assets/js/payment-methods/ach/payment-method.js:65
2624
- #: packages/blocks/build/commons.js:1565
2625
  msgid "pin"
2626
  msgstr ""
2627
 
@@ -2631,7 +2738,7 @@ msgstr ""
2631
 
2632
  #: templates/checkout/afterpay.php:11
2633
  #: packages/blocks/assets/js/payment-methods/local-payment/afterpay.js:74
2634
- #: packages/blocks/build/commons.js:3317
2635
  msgid "After clicking \"%s\", you will be redirected to Afterpay to complete your purchase securely."
2636
  msgstr ""
2637
 
@@ -2641,25 +2748,25 @@ msgstr ""
2641
 
2642
  #: templates/checkout/boleto.php:17
2643
  #: packages/blocks/assets/js/payment-methods/local-payment/boleto.js:48
2644
- #: packages/blocks/build/commons.js:3553
2645
  msgid "Test mode values"
2646
  msgstr ""
2647
 
2648
  #: templates/checkout/boleto.php:27
2649
  #: packages/blocks/assets/js/payment-methods/local-payment/boleto.js:58
2650
- #: packages/blocks/build/commons.js:3563
2651
  msgid "Accepted formats"
2652
  msgstr ""
2653
 
2654
  #: templates/checkout/boleto.php:29
2655
  #: packages/blocks/assets/js/payment-methods/local-payment/boleto.js:61
2656
- #: packages/blocks/build/commons.js:3566
2657
  msgid "XXX.XXX.XXX-XX or XXXXXXXXXXX"
2658
  msgstr ""
2659
 
2660
  #: templates/checkout/boleto.php:32
2661
  #: packages/blocks/assets/js/payment-methods/local-payment/boleto.js:65
2662
- #: packages/blocks/build/commons.js:3570
2663
  msgid "XX.XXX.XXX/XXXX-XX or XXXXXXXXXXXXXX"
2664
  msgstr ""
2665
 
@@ -2673,55 +2780,55 @@ msgstr ""
2673
 
2674
  #: templates/checkout/klarna-v2.php:12
2675
  #: packages/blocks/assets/js/payment-methods/local-payment/klarna.js:15
2676
- #: packages/blocks/build/commons.js:3978
2677
  msgid "Test mode sms"
2678
  msgstr ""
2679
 
2680
- #: templates/installment-plans.php:7
2681
  #: packages/blocks/assets/js/components/checkout/installments/index.js:72
2682
- #: packages/blocks/build/commons.js:1287
2683
  msgid "Fill out card form for eligibility."
2684
  msgstr ""
2685
 
2686
- #: templates/installment-plans.php:12
2687
  #: packages/blocks/assets/js/components/checkout/installments/index.js:54
2688
- #: packages/blocks/build/commons.js:1269
2689
  msgid "Pay in installments:"
2690
  msgstr ""
2691
 
2692
  #: packages/blocks/assets/js/payment-methods/ach/payment-method.js:56
2693
- #: packages/blocks/build/commons.js:1556
2694
  msgid "Test Credentials"
2695
  msgstr ""
2696
 
2697
  #: packages/blocks/assets/js/payment-methods/credit-card/components/custom-card-form.js:83
2698
- #: packages/blocks/build/commons.js:1843
2699
  msgid "%s is not a valid blocks Stripe custom form. Please choose another custom form option in the Credit Card Settings."
2700
  msgstr ""
2701
 
2702
  #: packages/blocks/assets/js/payment-methods/local-payment/boleto.js:27
2703
- #: packages/blocks/build/commons.js:3532
2704
  msgid "Please enter a valid CPF/CNPJ value"
2705
  msgstr ""
2706
 
2707
  #: packages/blocks/assets/js/payment-methods/local-payment/hooks/use-create-source.js:73
2708
  #: packages/blocks/assets/js/payment-methods/local-payment/hooks/use-validate-checkout.js:10
2709
- #: packages/blocks/build/commons.js:3857
2710
- #: packages/blocks/build/commons.js:3894
2711
  msgid "Please enter your payment info before proceeding."
2712
  msgstr ""
2713
 
2714
  #: packages/blocks/assets/js/payment-methods/local-payment/wechat.js:51
2715
- #: packages/blocks/build/commons.js:4400
2716
  msgid "Please scan your QR code to continue with payment."
2717
  msgstr ""
2718
 
2719
  #: packages/blocks/assets/js/payment-methods/local-payment/wechat.js:97
2720
- #: packages/blocks/build/commons.js:4446
2721
  msgid "Please fill out all the required fields in order to complete the WeChat payment."
2722
  msgstr ""
2723
 
2724
  #: packages/blocks/assets/js/payment-methods/local-payment/wechat.js:127
2725
- #: packages/blocks/build/commons.js:4476
2726
  msgid "Test mode: Click the Place Order button to proceed."
2727
  msgstr ""
2
  # This file is distributed under the same license as the Payment Plugins for Stripe WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Payment Plugins for Stripe WooCommerce 3.3.20\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woo-stripe-payment\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "POT-Creation-Date: 2022-06-04T02:53:14+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.4.0\n"
15
  "X-Domain: woo-stripe-payment\n"
30
  msgid "Payment Plugins, support@paymentplugins.com"
31
  msgstr ""
32
 
33
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:104
34
  #: includes/admin/meta-boxes/views/html-product-data.php:14
35
  #: includes/gateways/settings/ach-settings.php:13
36
  #: includes/gateways/settings/applepay-settings.php:11
40
  msgid "Enabled"
41
  msgstr ""
42
 
43
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:109
44
  msgid "If enabled, your site can accept %s payments through Stripe."
45
  msgstr ""
46
 
47
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:113
48
  #: includes/gateways/settings/ach-settings.php:70
49
  #: includes/gateways/settings/applepay-settings.php:20
50
  #: includes/gateways/settings/cc-settings.php:18
53
  msgid "General Settings"
54
  msgstr ""
55
 
56
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:117
57
  #: includes/admin/meta-boxes/views/html-charge-data-subview.php:47
58
  #: includes/gateways/settings/ach-settings.php:74
59
  #: includes/gateways/settings/applepay-settings.php:24
63
  msgid "Title"
64
  msgstr ""
65
 
66
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:123
67
  #: includes/gateways/settings/ach-settings.php:80
68
  #: includes/gateways/settings/applepay-settings.php:30
69
  #: includes/gateways/settings/cc-settings.php:28
72
  msgid "Description"
73
  msgstr ""
74
 
75
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:126
76
  #: includes/gateways/settings/ach-settings.php:83
77
  #: includes/gateways/settings/applepay-settings.php:33
78
  #: includes/gateways/settings/cc-settings.php:31
81
  msgid "Leave blank if you don't want a description to show for the gateway."
82
  msgstr ""
83
 
84
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:130
85
  #: includes/gateways/settings/ach-settings.php:87
86
  msgid "Order Button Text"
87
  msgstr ""
88
 
89
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:133
90
  #: includes/gateways/settings/ach-settings.php:90
91
  msgid "The text on the Place Order button that displays when the gateway is selected on the checkout page."
92
  msgstr ""
93
 
94
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:157
95
  msgid "When the billing country matches one of these values, the payment method will be hidden on the checkout page."
96
  msgstr ""
97
 
98
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:170
99
  msgid "When the billing country matches one of these values, the payment method will be shown on the checkout page."
100
  msgstr ""
101
 
102
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:227
103
  msgid "Order %s"
104
  msgstr ""
105
 
106
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:366
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:369
111
  msgid " & billing country is not <strong>%s</strong>"
112
  msgstr ""
113
 
114
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:371
115
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:374
116
  msgid " & billing country is <strong>%s</strong>"
117
  msgstr ""
118
 
119
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:396
120
  msgid "Pay with %s"
121
  msgstr ""
122
 
124
  msgid "Please fill out all required fields."
125
  msgstr ""
126
 
127
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:440
128
  #: includes/controllers/class-wc-stripe-controller-cart.php:134
129
  #: includes/controllers/class-wc-stripe-controller-cart.php:192
130
  #: includes/controllers/class-wc-stripe-controller-googlepay.php:136
131
  #: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:109
132
+ #: packages/blocks/src/Payments/AbstractStripePayment.php:54
133
+ #: packages/blocks/src/Payments/Gateways/GooglePayPayment.php:28
134
  msgid "Total"
135
  msgstr ""
136
 
137
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:518
138
  msgid "User must be logged in."
139
  msgstr ""
140
 
141
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:544
142
  msgid "Error saving payment method. Reason: %s"
143
  msgstr ""
144
 
145
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:563
146
  #: includes/wc-stripe-webhook-functions.php:232
147
  msgid "Order refunded in Stripe. Amount: %s"
148
  msgstr ""
149
 
150
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:602
151
  msgid "Order amount captured in Stripe. Amount: %s"
152
  msgstr ""
153
 
154
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:606
155
  msgid "Error capturing charge in Stripe. Reason: %s"
156
  msgstr ""
157
 
158
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:627
159
  msgid "Error voiding charge. Reason: %s"
160
  msgstr ""
161
 
162
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:629
163
  msgid "Charge voided in Stripe."
164
  msgstr ""
165
 
166
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:807
167
  msgid "n/a"
168
  msgstr ""
169
 
170
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:835
171
  #: includes/admin/meta-boxes/views/html-order-pay.php:42
172
  msgid "New Card"
173
  msgstr ""
174
 
175
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:839
176
  #: includes/admin/meta-boxes/views/html-order-pay.php:30
177
  msgid "Saved Cards"
178
  msgstr ""
179
 
180
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1034
181
  msgid "Attempt to save payment method failed. Reason: %s"
182
  msgstr ""
183
 
184
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1061
185
  msgid "We were not able to save your payment method. To prevent billing issues with your subscription, please add a payment method to the subscription."
186
  msgstr ""
187
 
188
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1063
189
  msgid "We were not able to save your payment method. Reason: %s"
190
  msgstr ""
191
 
192
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1097
193
  msgid "Payment Method Token"
194
  msgstr ""
195
 
196
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1101
197
  msgid "Stripe Customer ID"
198
  msgstr ""
199
 
200
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1121
201
  msgid "Recurring payment for order failed. Reason: %s"
202
  msgstr ""
203
 
204
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1135
205
  msgid "Renewal payment initiated in Stripe. Waiting for the payment to clear."
206
  msgstr ""
207
 
208
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1139
209
  msgid "Recurring payment captured in Stripe. Payment method: %s"
210
  msgstr ""
211
 
212
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1143
213
  msgid "Recurring payment authorized in Stripe. Payment method: %s"
214
  msgstr ""
215
 
216
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1146
217
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1383
218
  msgid "Customer must manually complete payment for payment method %s"
219
  msgstr ""
220
 
221
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1180
222
  #: includes/abstract/abstract-wc-stripe-payment.php:268
223
  msgid "Order %1$s from %2$s"
224
  msgstr ""
225
 
226
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1365
227
  msgid "Pre-order payment for order failed. Reason: %s"
228
  msgstr ""
229
 
230
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1372
231
  msgid "Pre-order payment initiated in Stripe. Waiting for the payment to clear."
232
  msgstr ""
233
 
234
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1376
235
  msgid "Pre-order payment captured in Stripe. Payment method: %s"
236
  msgstr ""
237
 
238
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1380
239
  msgid "Pre-order payment authorized in Stripe. Payment method: %s"
240
  msgstr ""
241
 
242
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1452
243
  msgid "Cannot process payment"
244
  msgstr ""
245
 
246
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1460
247
  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."
248
  msgstr ""
249
 
250
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1578
251
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1609
252
  msgid "Shipping"
253
  msgstr ""
254
 
255
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1586
256
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1612
257
  msgid "Discount"
258
  msgstr ""
259
 
260
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1589
261
  msgid "Tax"
262
  msgstr ""
263
 
264
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1619
265
  msgid "Fees"
266
  msgstr ""
267
 
268
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1813
269
  msgid "Error saving payment method for subscription. Reason: %s"
270
  msgstr ""
271
 
290
  msgstr ""
291
 
292
  #: includes/abstract/abstract-wc-stripe-payment.php:335
293
+ #: includes/gateways/class-wc-payment-gateway-stripe-ach.php:123
294
+ #: includes/traits/wc-stripe-payment-traits.php:95
295
  msgid "Error processing payment. Reason: %s"
296
  msgstr ""
297
 
298
  #: includes/abstract/abstract-wc-stripe-rest-controller.php:58
299
+ #: includes/controllers/class-wc-stripe-controller-gateway-settings.php:306
300
  #: includes/controllers/class-wc-stripe-controller-order-actions.php:333
301
  msgid "You do not have permissions to access this resource."
302
  msgstr ""
303
 
304
+ #: includes/admin/class-wc-stripe-admin-assets.php:73
305
+ msgid "Are you sure you want to delete your connection data?"
306
+ msgstr ""
307
+
308
+ #: includes/admin/class-wc-stripe-admin-assets.php:111
309
+ msgid "Feedback"
310
+ msgstr ""
311
+
312
+ #: includes/admin/class-wc-stripe-admin-assets.php:112
313
+ msgid "With your feedback we can make the plugin better."
314
+ msgstr ""
315
+
316
+ #: includes/admin/class-wc-stripe-admin-assets.php:113
317
+ msgid "Additional Info"
318
+ msgstr ""
319
+
320
+ #: includes/admin/class-wc-stripe-admin-assets.php:115
321
+ msgid "What is the plugin's name and why was it better?"
322
+ msgstr ""
323
+
324
+ #: includes/admin/class-wc-stripe-admin-assets.php:116
325
+ msgid "What error did you encounter?"
326
+ msgstr ""
327
+
328
+ #: includes/admin/class-wc-stripe-admin-assets.php:119
329
+ msgid "Submit & Deactivate"
330
+ msgstr ""
331
+
332
+ #: includes/admin/class-wc-stripe-admin-assets.php:120
333
+ msgid "Skip & Deactivate"
334
+ msgstr ""
335
+
336
+ #: includes/admin/class-wc-stripe-admin-assets.php:123
337
+ msgid "I found a better Stripe plugin"
338
+ msgstr ""
339
+
340
+ #: includes/admin/class-wc-stripe-admin-assets.php:124
341
+ msgid "The plugin caused errors"
342
+ msgstr ""
343
+
344
+ #: includes/admin/class-wc-stripe-admin-assets.php:125
345
+ msgid "This is a temporary deactivation"
346
+ msgstr ""
347
+
348
+ #: includes/admin/class-wc-stripe-admin-assets.php:126
349
+ msgid "Other"
350
+ msgstr ""
351
+
352
  #: includes/admin/class-wc-stripe-admin-menus.php:19
353
  msgid "Stripe Gateway"
354
  msgstr ""
369
  msgstr ""
370
 
371
  #: includes/admin/class-wc-stripe-admin-settings.php:95
372
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:183
373
  msgid "Stripe Email Options"
374
  msgstr ""
375
 
376
  #: includes/admin/class-wc-stripe-admin-settings.php:99
377
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:187
378
  msgid "Email Receipt"
379
  msgstr ""
380
 
381
  #: includes/admin/class-wc-stripe-admin-settings.php:102
382
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:189
383
  msgid "If enabled, an email receipt will be sent to the customer by Stripe when the order is processed."
384
  msgstr ""
385
 
418
  #: includes/admin/meta-boxes/views/html-order-pay.php:23
419
  #: includes/admin/meta-boxes/views/html-product-data.php:46
420
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:53
421
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:150
422
  #: includes/gateways/settings/applepay-settings.php:52
423
  #: includes/gateways/settings/cc-settings.php:50
424
  #: includes/gateways/settings/googlepay-settings.php:74
441
 
442
  #: includes/admin/meta-boxes/views/html-charge-data-subview.php:25
443
  #: includes/admin/settings/class-wc-stripe-api-settings.php:44
444
+ #: includes/controllers/class-wc-stripe-controller-gateway-settings.php:188
445
  msgid "Live"
446
  msgstr ""
447
 
448
  #: includes/admin/meta-boxes/views/html-charge-data-subview.php:25
449
  #: includes/admin/settings/class-wc-stripe-api-settings.php:43
450
+ #: includes/controllers/class-wc-stripe-controller-gateway-settings.php:188
451
  msgid "Test"
452
  msgstr ""
453
 
479
  #: templates/cc-forms/bootstrap.php:16
480
  #: templates/cc-forms/minimalist.php:30
481
  #: packages/blocks/assets/js/payment-methods/credit-card/components/bootstrap/index.js:19
482
+ #: packages/blocks/build/commons.js:1789
483
  msgid "Exp"
484
  msgstr ""
485
 
554
  #: includes/admin/meta-boxes/views/html-order-pay.php:21
555
  #: includes/admin/meta-boxes/views/html-product-data.php:15
556
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:49
557
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:146
558
  #: includes/gateways/settings/applepay-settings.php:48
559
  #: includes/gateways/settings/cc-settings.php:46
560
  #: includes/gateways/settings/googlepay-settings.php:70
565
  #: includes/admin/meta-boxes/views/html-order-pay.php:24
566
  #: includes/admin/meta-boxes/views/html-product-data.php:48
567
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:54
568
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:151
569
  #: includes/gateways/settings/applepay-settings.php:53
570
  #: includes/gateways/settings/cc-settings.php:51
571
  #: includes/gateways/settings/googlepay-settings.php:75
611
  msgid "Advanced Settings"
612
  msgstr ""
613
 
614
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:31
615
+ msgid "This section provides advanced settings that allow you to configure functionality that fits your business process."
616
  msgstr ""
617
 
618
  #: includes/admin/settings/class-wc-stripe-advanced-settings.php:34
619
+ msgid "Locale Type"
620
+ msgstr ""
621
+
622
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:38
623
  msgid "Auto"
624
  msgstr ""
625
 
626
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:39
627
  msgid "Site Locale"
628
  msgstr ""
629
 
630
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:42
631
  msgid "If set to \"auto\" Stripe will determine the locale to use based on the customer's browser/location settings. Site locale uses the Wordpress locale setting."
632
  msgstr ""
633
 
 
 
 
 
634
  #: includes/admin/settings/class-wc-stripe-advanced-settings.php:46
635
+ msgid "Installments"
636
  msgstr ""
637
 
638
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:51
639
+ msgid "If enabled, installments will be available for the credit card gateway. %1$s"
640
  msgstr ""
641
 
642
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:54
643
+ msgid "Statement Descriptor"
644
  msgstr ""
645
 
646
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:58
647
+ msgid "Maximum of 22 characters. This value represents the full statement descriptor that your customer will see. If left blank, Stripe will use your account descriptor."
648
  msgstr ""
649
 
650
  #: includes/admin/settings/class-wc-stripe-advanced-settings.php:69
671
  msgid "If enabled, the plugin will process a payment cancellation or refund within Stripe when the order's status is set to cancelled."
672
  msgstr ""
673
 
674
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:99
675
+ msgid "Link Settings"
676
  msgstr ""
677
 
678
  #: includes/admin/settings/class-wc-stripe-advanced-settings.php:102
679
+ msgid "Faster Checkout With Link"
680
+ msgstr ""
681
+
682
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:106
683
+ msgid ""
684
+ "Only available to US merchants: With Link enabled, Stripe will use your customer's email address to determine if they have used Stripe in the past. If yes, their payment info, billing and shipping information can be used to \r\n"
685
+ "\t\t\t\tauto-populate the checkout page resulting in higher conversion rates and less customer friction. If enabled, the Stripe payment form will be used because it's the only card form compatible with Link."
686
+ msgstr ""
687
+
688
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:110
689
+ msgid "Move email field to top of page"
690
+ msgstr ""
691
+
692
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:114
693
+ msgid "If enabled, the email field will be placed at the top of the checkout page. Link uses the email address so it's best to prioritize it."
694
+ msgstr ""
695
+
696
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:122
697
+ msgid "Launch link on page load"
698
+ msgstr ""
699
+
700
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:126
701
+ msgid "If enabled and the email address is already populated, the plugin will attempt to launch Link on the checkout page."
702
+ msgstr ""
703
+
704
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:134
705
+ msgid "Dispute Settings"
706
+ msgstr ""
707
+
708
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:138
709
  msgid "Dispute Created"
710
  msgstr ""
711
 
712
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:141
713
  msgid "If enabled, the plugin will listen for the <strong>charge.dispute.created</strong> webhook event and set the order's status to on-hold by default."
714
  msgstr ""
715
 
716
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:145
717
  msgid "Disputed Created Order Status"
718
  msgstr ""
719
 
720
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:149
721
  msgid "The status assigned to an order when a dispute is created."
722
  msgstr ""
723
 
724
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:157
725
  msgid "Dispute Closed"
726
  msgstr ""
727
 
728
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:160
729
  msgid "If enabled, the plugin will listen for the <strong>charge.dispute.closed</strong> webhook event and set the order's status back to the status before the dispute was opened."
730
  msgstr ""
731
 
732
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:164
733
  msgid "Review Settings"
734
  msgstr ""
735
 
736
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:168
737
  msgid "Review Created"
738
  msgstr ""
739
 
740
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:171
741
  msgid "If enabled, the plugin will listen for the <strong>review.created</strong> webhook event and set the order's status to on-hold by default."
742
  msgstr ""
743
 
744
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:175
745
  msgid "Review Closed"
746
  msgstr ""
747
 
748
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:178
749
  msgid "If enabled, the plugin will listen for the <strong>review.closed</strong> webhook event and set the order's status back to the status before the review was opened."
750
  msgstr ""
751
 
752
+ #: includes/admin/settings/class-wc-stripe-advanced-settings.php:249
753
+ msgid "Supported Stripe account countries: %1$s. Supported currencies: %2$s"
754
  msgstr ""
755
 
756
  #: includes/admin/settings/class-wc-stripe-api-settings.php:16
767
  msgstr ""
768
 
769
  #: includes/admin/settings/class-wc-stripe-api-settings.php:53
770
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:67
771
  msgid "Account ID"
772
  msgstr ""
773
 
774
  #: includes/admin/settings/class-wc-stripe-api-settings.php:58
775
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:72
776
+ msgid "This is your Stripe Account ID and serves as a unique identifier."
777
  msgstr ""
778
 
779
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:81
780
  msgid "Connect Stripe Account"
781
  msgstr ""
782
 
783
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:82
784
  msgid "Click to Connect"
785
  msgstr ""
786
 
787
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:84
788
  msgid "We make it easy to connect Stripe to your site. Click the Connect button to go through our connect flow."
789
  msgstr ""
790
 
791
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:87
792
  msgid "Test Publishable Key"
793
  msgstr ""
794
 
795
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:91
796
  msgid "Your publishable key is used to initialize Stripe assets."
797
  msgstr ""
798
 
799
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:99
800
  msgid "Test Secret Key"
801
  msgstr ""
802
 
803
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:103
804
  msgid "Your secret key is used to authenticate requests to Stripe."
805
  msgstr ""
806
 
807
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:112
808
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:113
809
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:124
810
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:125
811
  msgid "Connection Test"
812
  msgstr ""
813
 
814
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:115
815
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:127
816
  msgid "Click this button to perform a connection test. If successful, your site is connected to Stripe."
817
  msgstr ""
818
 
819
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:136
820
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:137
821
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:147
822
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:148
823
  msgid "Create Webhook"
824
  msgstr ""
825
 
826
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:158
827
  msgid "Webhook url"
828
  msgstr ""
829
 
830
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:162
831
  msgid "<strong>Important:</strong> the webhook url is called by Stripe when events occur in your account, like a source becomes chargeable. Use the Create Webhook button or add the webhook manually in your Stripe account."
832
  msgstr ""
833
 
834
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:167
835
  msgid "Live Webhook Secret"
836
  msgstr ""
837
 
838
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:168
839
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:177
840
  msgid "The webhook secret is used to authenticate webhooks sent from Stripe. It ensures no 3rd party can send you events, pretending to be Stripe. %1$sWebhook guide%2$s"
841
  msgstr ""
842
 
843
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:176
844
  msgid "Test Webhook Secret"
845
  msgstr ""
846
 
847
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:184
848
  msgid "Debug Log"
849
  msgstr ""
850
 
851
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:188
852
  msgid "When enabled, the plugin logs important errors and info that can help you troubleshoot potential issues."
853
  msgstr ""
854
 
855
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:193
856
+ msgid "%s Your Stripe account has been connected."
857
  msgstr ""
858
 
859
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:211
860
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:212
861
  msgid "Delete Webhook"
862
  msgstr ""
863
 
864
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:236
865
+ msgid "Delete Connection"
866
  msgstr ""
867
 
868
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:255
869
  msgid "Please try again."
870
  msgstr ""
871
 
872
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:258
873
  msgid "We were not able to connect your Stripe account. Reason: %s"
874
  msgstr ""
875
 
876
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:263
877
  msgid "Not authorized to perform this action. Required permission: manage_woocommerce"
878
  msgstr ""
879
 
880
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:298
881
  msgid "Your Stripe account has been connected to your WooCommerce store. You may now accept payments in Live and Test mode."
882
  msgstr ""
883
 
895
 
896
  #: includes/admin/views/html-main-navigation.php:15
897
  #: includes/admin/views/html-welcome-page.php:45
898
+ #: includes/class-wc-stripe-install.php:44
899
  msgid "Settings"
900
  msgstr ""
901
 
902
  #: includes/admin/views/html-main-navigation.php:18
903
  #: includes/admin/views/html-welcome-page.php:59
904
+ #: includes/class-wc-stripe-install.php:45
905
  msgid "Documentation"
906
  msgstr ""
907
 
1039
  msgid "Error saving customer. Reason: %s"
1040
  msgstr ""
1041
 
1042
+ #: includes/class-wc-stripe-frontend-scripts.php:97
1043
  msgid "No matches found"
1044
  msgstr ""
1045
 
1059
  msgid "Payment authorization failed."
1060
  msgstr ""
1061
 
1062
+ #: includes/class-wc-stripe-rest-api.php:47
1063
  msgid "%1$s is an invalid controller name."
1064
  msgstr ""
1065
 
1066
+ #: includes/class-wc-stripe-update.php:54
1067
  msgid "Thank you for updating Stripe for WooCommerce to version %1$s."
1068
  msgstr ""
1069
 
1071
  msgid "Quantity must be greater than zero."
1072
  msgstr ""
1073
 
1074
+ #: includes/controllers/class-wc-stripe-controller-checkout.php:129
1075
  msgid "Invalid order ID."
1076
  msgstr ""
1077
 
1078
+ #: includes/controllers/class-wc-stripe-controller-checkout.php:132
1079
  msgid "Invalid order key."
1080
  msgstr ""
1081
 
1082
+ #: includes/controllers/class-wc-stripe-controller-checkout.php:171
1083
+ #: includes/controllers/class-wc-stripe-controller-payment-intent.php:115
1084
+ #: includes/controllers/class-wc-stripe-controller-payment-intent.php:152
1085
+ #: packages/cartflows/src/Routes/PaymentIntentRoute.php:47
1086
+ msgid "You are not authorized to update this order."
1087
+ msgstr ""
1088
+
1089
+ #: includes/controllers/class-wc-stripe-controller-checkout.php:296
1090
+ #: includes/controllers/class-wc-stripe-controller-checkout.php:342
1091
  msgid "Please review your order details then click Place Order."
1092
  msgstr ""
1093
 
1094
+ #: includes/controllers/class-wc-stripe-controller-gateway-settings.php:93
1095
  msgid "You cannot register your domain until you have completed the Connect process on the API Settings page. A registered domain is not required when test mode is enabled."
1096
  msgstr ""
1097
 
1098
+ #: includes/controllers/class-wc-stripe-controller-gateway-settings.php:123
1099
  msgid "Domain registered successfully. You can confirm in your Stripe Dashboard at https://dashboard.stripe.com/account/apple_pay."
1100
  msgstr ""
1101
 
1102
+ #: includes/controllers/class-wc-stripe-controller-gateway-settings.php:146
1103
  msgid "You must configure your secret key before creating webhooks."
1104
  msgstr ""
1105
 
1106
+ #: includes/controllers/class-wc-stripe-controller-gateway-settings.php:168
1107
  msgid "There is already a webhook configured for this site. If you want to delete the webhook, login to your Stripe Dashboard."
1108
  msgstr ""
1109
 
1110
+ #: includes/controllers/class-wc-stripe-controller-gateway-settings.php:185
1111
  msgid "Webhook created in Stripe for %s environment. You can test your webhook by logging in to the Stripe dashboard"
1112
  msgstr ""
1113
 
1114
+ #: includes/controllers/class-wc-stripe-controller-gateway-settings.php:233
1115
  msgid "You must enter your API keys or connect the plugin before performing a connection test."
1116
  msgstr ""
1117
 
1118
+ #: includes/controllers/class-wc-stripe-controller-gateway-settings.php:246
1119
  msgid "Mode: %s. Invalid secret key. Please check your entry."
1120
  msgstr ""
1121
 
1122
+ #: includes/controllers/class-wc-stripe-controller-gateway-settings.php:270
1123
+ #: includes/controllers/class-wc-stripe-controller-gateway-settings.php:273
1124
  msgid "Mode: %s. Invalid publishable key. Please check your entry."
1125
  msgstr ""
1126
 
1127
+ #: includes/controllers/class-wc-stripe-controller-gateway-settings.php:287
1128
  msgid "Connection test to Stripe was successful. Mode: %s."
1129
  msgstr ""
1130
 
1131
  #: includes/controllers/class-wc-stripe-controller-googlepay.php:85
1132
  #: packages/blocks/assets/js/payment-methods/googlepay/hooks/use-payments-client.js:155
1133
+ #: packages/blocks/build/commons.js:2590
1134
  msgid "Your shipping address is not serviceable."
1135
  msgstr ""
1136
 
1160
  msgid "Invalid order id provided"
1161
  msgstr ""
1162
 
 
 
 
 
 
 
1163
  #: includes/controllers/class-wc-stripe-controller-signup.php:67
1164
  msgid "It's on its way! Please check your emails."
1165
  msgstr ""
1197
  msgid "ACH gateway that integrates with your Stripe account."
1198
  msgstr ""
1199
 
1200
+ #: includes/gateways/class-wc-payment-gateway-stripe-ach.php:249
1201
  msgid "Saved Banks"
1202
  msgstr ""
1203
 
1204
+ #: includes/gateways/class-wc-payment-gateway-stripe-ach.php:253
1205
  msgid "New Bank"
1206
  msgstr ""
1207
 
1208
+ #: includes/gateways/class-wc-payment-gateway-stripe-ach.php:297
1209
  msgid "You must set the API mode to live in order to enable the Plaid development environment."
1210
  msgstr ""
1211
 
1212
+ #: includes/gateways/class-wc-payment-gateway-stripe-ach.php:332
1213
+ #: includes/gateways/class-wc-payment-gateway-stripe-ach.php:336
1214
+ #: includes/gateways/settings/ach-settings.php:121
1215
+ msgid "ACH Fee"
1216
+ msgstr ""
1217
+
1218
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:26
1219
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:27
1220
  #: packages/blocks/assets/js/payment-methods/local-payment/afterpay.js:114
1221
+ #: packages/blocks/build/commons.js:3774
1222
  msgid "Afterpay"
1223
  msgstr ""
1224
 
1231
  msgstr ""
1232
 
1233
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:57
1234
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:154
1235
  #: includes/gateways/settings/applepay-settings.php:56
1236
  #: includes/gateways/settings/cc-settings.php:54
1237
  #: includes/gateways/settings/payment-request-settings.php:57
1281
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:86
1282
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:145
1283
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:204
1284
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:158
1285
  #: includes/gateways/settings/googlepay-settings.php:111
1286
  msgid "Icon"
1287
  msgstr ""
1313
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:96
1314
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:155
1315
  #: includes/gateways/class-wc-payment-gateway-stripe-afterpay.php:214
1316
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:166
1317
  msgid "This is the icon style that appears next to the gateway on the checkout page."
1318
  msgstr ""
1319
 
1517
  msgstr ""
1518
 
1519
  #: includes/gateways/class-wc-payment-gateway-stripe-boleto.php:65
1520
+ #: includes/wc-stripe-functions.php:1132
1521
  msgid "Please enter a valid CPF / CNPJ"
1522
  msgstr ""
1523
 
1538
  msgid "Credit card gateway that integrates with your Stripe account."
1539
  msgstr ""
1540
 
1541
+ #: includes/gateways/class-wc-payment-gateway-stripe-cc.php:86
1542
  #: packages/blocks/assets/js/components/checkout/installments/index.js:69
1543
+ #: packages/blocks/build/commons.js:1329
1544
  msgid "Loading installments..."
1545
  msgstr ""
1546
 
1547
+ #: includes/gateways/class-wc-payment-gateway-stripe-cc.php:325
1548
+ msgid "Only the Stripe payment form can be used while Link is enabled."
1549
+ msgstr ""
1550
+
1551
+ #: includes/gateways/class-wc-payment-gateway-stripe-cc.php:330
1552
+ msgid "The Payment Element card form design is only available to connected accounts at this time because it's a Stripe beta feature. To use the Payment Element in test mode, use the connect option on the API Settings page."
1553
+ msgstr ""
1554
+
1555
+ #: includes/gateways/class-wc-payment-gateway-stripe-cc.php:341
1556
+ msgid "Stripe payment form (beta feature)"
1557
+ msgstr ""
1558
+
1559
  #: includes/gateways/class-wc-payment-gateway-stripe-eps.php:26
1560
  #: includes/gateways/class-wc-payment-gateway-stripe-eps.php:29
1561
  msgid "EPS"
1627
  msgid "Ideal gateway that integrates with your Stripe account."
1628
  msgstr ""
1629
 
1630
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:55
1631
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:57
1632
  msgid "Klarna"
1633
  msgstr ""
1634
 
1635
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:58
1636
  msgid "Klarna gateway that integrates with your Stripe account."
1637
  msgstr ""
1638
 
1639
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:161
1640
  msgid "Black text"
1641
  msgstr ""
1642
 
1643
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:162
1644
  msgid "Pink background black text"
1645
  msgstr ""
1646
 
1753
 
1754
  #: includes/gateways/class-wc-payment-gateway-stripe-wechat.php:92
1755
  #: packages/blocks/assets/js/payment-methods/local-payment/wechat.js:130
1756
+ #: packages/blocks/build/commons.js:4896
1757
  msgid "Scan the QR code using your WeChat app. Once scanned click the Place Order button."
1758
  msgstr ""
1759
 
1870
  msgid "This is the status of the order once payment is complete. If <b>Default</b> is selected, then WooCommerce will set the order status automatically based on internal logic which states if a product is virtual and downloadable then status is set to complete. Products that require shipping are set to Processing. Default is the recommended setting as it allows standard WooCommerce code to process the order status."
1871
  msgstr ""
1872
 
 
 
 
 
1873
  #: includes/gateways/settings/ach-settings.php:131
1874
  msgid "None"
1875
  msgstr ""
2053
  msgstr ""
2054
 
2055
  #: includes/gateways/settings/cc-settings.php:118
2056
+ msgid "Stripe inline form"
2057
  msgstr ""
2058
 
2059
  #: includes/gateways/settings/cc-settings.php:119
2060
+ msgid "Stripe payment form"
2061
+ msgstr ""
2062
+
2063
+ #: includes/gateways/settings/cc-settings.php:120
2064
  msgid "Custom form"
2065
  msgstr ""
2066
 
2067
+ #: includes/gateways/settings/cc-settings.php:124
2068
+ msgid "The card form design that displays on payment pages."
2069
  msgstr ""
2070
 
2071
+ #: includes/gateways/settings/cc-settings.php:127
2072
  msgid "Custom Form"
2073
  msgstr ""
2074
 
2075
+ #: includes/gateways/settings/cc-settings.php:131
2076
  msgid "The design of the credit card form."
2077
  msgstr ""
2078
 
2079
+ #: includes/gateways/settings/cc-settings.php:136
2080
  msgid "Postal Code"
2081
  msgstr ""
2082
 
2083
+ #: includes/gateways/settings/cc-settings.php:139
2084
  msgid "If enabled, the CC form will show the postal code on the checkout page. If disabled, the billing field's postal code will be used. The postal code will show on the Add Payment Method page for security reasons."
2085
  msgstr ""
2086
 
2087
+ #: includes/gateways/settings/cc-settings.php:144
2088
  msgid "Notices Location"
2089
  msgstr ""
2090
 
2091
+ #: includes/gateways/settings/cc-settings.php:148
2092
  msgid "Above card form"
2093
  msgstr ""
2094
 
2095
+ #: includes/gateways/settings/cc-settings.php:149
2096
  msgid "Below card form"
2097
  msgstr ""
2098
 
2099
+ #: includes/gateways/settings/cc-settings.php:150
2100
  msgid "Top of checkout page"
2101
  msgstr ""
2102
 
2103
+ #: includes/gateways/settings/cc-settings.php:151
2104
  msgid "Custom css selector"
2105
  msgstr ""
2106
 
2107
+ #: includes/gateways/settings/cc-settings.php:154
2108
  msgid "This option allows you to control the location of credit card form validation errors. If you select custom, then you can provide a custom css selector for where the notices appear."
2109
  msgstr ""
2110
 
2111
+ #: includes/gateways/settings/cc-settings.php:157
2112
  msgid "Notices Selector"
2113
  msgstr ""
2114
 
2115
+ #: includes/gateways/settings/cc-settings.php:161
2116
  msgid "This is the css selector where the card validation notices will be prepended to."
2117
  msgstr ""
2118
 
2268
 
2269
  #: includes/tokens/class-wc-payment-token-stripe-ach.php:70
2270
  #: includes/tokens/class-wc-payment-token-stripe-ach.php:75
2271
+ #: includes/tokens/class-wc-payment-token-stripe-cc.php:96
2272
  msgid "Type Ending In"
2273
  msgstr ""
2274
 
2282
 
2283
  #: includes/tokens/class-wc-payment-token-stripe-ach.php:80
2284
  #: includes/tokens/class-wc-payment-token-stripe-becs.php:63
2285
+ #: includes/tokens/class-wc-payment-token-stripe-cc.php:131
2286
  #: includes/tokens/class-wc-payment-token-stripe-local-payment.php:34
2287
  #: includes/tokens/class-wc-payment-token-stripe-sepa.php:63
2288
  msgid "Gateway Title"
2289
  msgstr ""
2290
 
2291
  #: includes/tokens/class-wc-payment-token-stripe-becs.php:65
2292
+ #: includes/tokens/class-wc-payment-token-stripe-cc.php:98
2293
  #: includes/tokens/class-wc-payment-token-stripe-sepa.php:65
2294
  msgid "{brand} ending in {last4}"
2295
  msgstr ""
2296
 
2297
  #: includes/tokens/class-wc-payment-token-stripe-becs.php:68
2298
+ #: includes/tokens/class-wc-payment-token-stripe-cc.php:111
2299
  #: includes/tokens/class-wc-payment-token-stripe-sepa.php:68
2300
  msgid "Type Last 4"
2301
  msgstr ""
2302
 
2303
+ #: includes/tokens/class-wc-payment-token-stripe-cc.php:101
2304
  msgid "Type Masked Number"
2305
  msgstr ""
2306
 
2307
+ #: includes/tokens/class-wc-payment-token-stripe-cc.php:106
2308
  msgid "Type Dash Masked Number"
2309
  msgstr ""
2310
 
2311
+ #: includes/tokens/class-wc-payment-token-stripe-cc.php:116
2312
  msgid "Type Dash & Last 4"
2313
  msgstr ""
2314
 
2315
+ #: includes/tokens/class-wc-payment-token-stripe-cc.php:121
2316
  msgid "Last Four"
2317
  msgstr ""
2318
 
2319
+ #: includes/tokens/class-wc-payment-token-stripe-cc.php:126
2320
  msgid "Card Type"
2321
  msgstr ""
2322
 
2323
+ #: includes/tokens/class-wc-payment-token-stripe-cc.php:140
2324
+ msgid "Link by Stripe"
2325
+ msgstr ""
2326
+
2327
+ #: includes/tokens/class-wc-payment-token-stripe-cc.php:143
2328
  msgid "Credit Card"
2329
  msgstr ""
2330
 
2357
  msgid "Kind Regards,"
2358
  msgstr ""
2359
 
2360
+ #: includes/wc-stripe-functions.php:733
2361
  msgid "Bootstrap form"
2362
  msgstr ""
2363
 
2364
+ #: includes/wc-stripe-functions.php:759
2365
  msgid "Simple form"
2366
  msgstr ""
2367
 
2368
+ #: includes/wc-stripe-functions.php:782
2369
  msgid "Minimalist form"
2370
  msgstr ""
2371
 
2372
+ #: includes/wc-stripe-functions.php:808
2373
  msgid "Inline Form"
2374
  msgstr ""
2375
 
2376
+ #: includes/wc-stripe-functions.php:830
2377
  msgid "Rounded Form"
2378
  msgstr ""
2379
 
2380
+ #: includes/wc-stripe-functions.php:1061
2381
  msgid "There was an error processing your credit card."
2382
  msgstr ""
2383
 
2384
+ #: includes/wc-stripe-functions.php:1062
2385
  msgid "Your card number is incomplete."
2386
  msgstr ""
2387
 
2388
+ #: includes/wc-stripe-functions.php:1063
2389
  msgid "Your card's expiration date is incomplete."
2390
  msgstr ""
2391
 
2392
+ #: includes/wc-stripe-functions.php:1064
2393
  msgid "Your card's security code is incomplete."
2394
  msgstr ""
2395
 
2396
+ #: includes/wc-stripe-functions.php:1065
2397
  msgid "Your card's zip code is incomplete."
2398
  msgstr ""
2399
 
2400
+ #: includes/wc-stripe-functions.php:1066
2401
  msgid "The card number is incorrect. Check the card's number or use a different card."
2402
  msgstr ""
2403
 
2404
+ #: includes/wc-stripe-functions.php:1067
2405
  msgid "The card's security code is incorrect. Check the card's security code or use a different card."
2406
  msgstr ""
2407
 
2408
+ #: includes/wc-stripe-functions.php:1068
2409
  msgid "The card's ZIP code is incorrect. Check the card's ZIP code or use a different card."
2410
  msgstr ""
2411
 
2412
+ #: includes/wc-stripe-functions.php:1069
2413
+ #: includes/wc-stripe-functions.php:1074
2414
  msgid "The card number is invalid. Check the card details or use a different card."
2415
  msgstr ""
2416
 
2417
+ #: includes/wc-stripe-functions.php:1070
2418
  msgid "This value provided to the field contains characters that are unsupported by the field."
2419
  msgstr ""
2420
 
2421
+ #: includes/wc-stripe-functions.php:1071
2422
  msgid "The card's security code is invalid. Check the card's security code or use a different card."
2423
  msgstr ""
2424
 
2425
+ #: includes/wc-stripe-functions.php:1072
2426
  msgid "The card's expiration month is incorrect. Check the expiration date or use a different card."
2427
  msgstr ""
2428
 
2429
+ #: includes/wc-stripe-functions.php:1073
2430
  msgid "The card's expiration year is incorrect. Check the expiration date or use a different card."
2431
  msgstr ""
2432
 
2433
+ #: includes/wc-stripe-functions.php:1075
2434
  msgid "The card's address is incorrect. Check the card's address or use a different card."
2435
  msgstr ""
2436
 
2437
+ #: includes/wc-stripe-functions.php:1076
2438
  msgid "The card has expired. Check the expiration date or use a different card."
2439
  msgstr ""
2440
 
2441
+ #: includes/wc-stripe-functions.php:1077
2442
  msgid "The card has been declined."
2443
  msgstr ""
2444
 
2445
+ #: includes/wc-stripe-functions.php:1078
2446
  msgid "Your card's expiration year is in the past."
2447
  msgstr ""
2448
 
2449
+ #: includes/wc-stripe-functions.php:1079
2450
  msgid "The bank account number provided is invalid (e.g., missing digits). Bank account information varies from country to country. We recommend creating validations in your entry forms based on the bank account formats we provide."
2451
  msgstr ""
2452
 
2453
+ #: includes/wc-stripe-functions.php:1081
2454
  msgid "The specified amount is greater than the maximum amount allowed. Use a lower amount and try again."
2455
  msgstr ""
2456
 
2457
+ #: includes/wc-stripe-functions.php:1082
2458
  msgid "The specified amount is less than the minimum amount allowed. Use a higher amount and try again."
2459
  msgstr ""
2460
 
2461
+ #: includes/wc-stripe-functions.php:1083
2462
  msgid "The payment requires authentication to proceed. If your customer is off session, notify your customer to return to your application and complete the payment. If you provided the error_on_requires_action parameter, then your customer should try another card that does not require authentication."
2463
  msgstr ""
2464
 
2465
+ #: includes/wc-stripe-functions.php:1085
2466
  msgid "The transfer or payout could not be completed because the associated account does not have a sufficient balance available. Create a new transfer or payout using an amount less than or equal to the account's available balance."
2467
  msgstr ""
2468
 
2469
+ #: includes/wc-stripe-functions.php:1087
2470
  msgid "The bank account provided can not be used to charge, either because it is not verified yet or it is not supported."
2471
  msgstr ""
2472
 
2473
+ #: includes/wc-stripe-functions.php:1088
2474
  msgid "The bank account provided already exists on the specified Customer object. If the bank account should also be attached to a different customer, include the correct customer ID when making the request again."
2475
  msgstr ""
2476
 
2477
+ #: includes/wc-stripe-functions.php:1090
2478
  msgid "The bank account provided cannot be used for payouts. A different bank account must be used."
2479
  msgstr ""
2480
 
2481
+ #: includes/wc-stripe-functions.php:1091
2482
  msgid "Your Connect platform is attempting to share an unverified bank account with a connected account."
2483
  msgstr ""
2484
 
2485
+ #: includes/wc-stripe-functions.php:1092
2486
  msgid "The bank account cannot be verified, either because the microdeposit amounts provided do not match the actual amounts, or because verification has failed too many times."
2487
  msgstr ""
2488
 
2489
+ #: includes/wc-stripe-functions.php:1094
2490
  msgid "This card has been declined too many times. You can try to charge this card again after 24 hours. We suggest reaching out to your customer to make sure they have entered all of their information correctly and that there are no issues with their card."
2491
  msgstr ""
2492
 
2493
+ #: includes/wc-stripe-functions.php:1096
2494
  msgid "The charge you're attempting to capture has already been captured. Update the request with an uncaptured charge ID."
2495
  msgstr ""
2496
 
2497
+ #: includes/wc-stripe-functions.php:1097
2498
  msgid "The charge you're attempting to refund has already been refunded. Update the request to use the ID of a charge that has not been refunded."
2499
  msgstr ""
2500
 
2501
+ #: includes/wc-stripe-functions.php:1099
2502
  msgid "The charge you're attempting to refund has been charged back. Check the disputes documentation to learn how to respond to the dispute."
2503
  msgstr ""
2504
 
2505
+ #: includes/wc-stripe-functions.php:1101
2506
  msgid "This charge would cause you to exceed your rolling-window processing limit for this source type. Please retry the charge later, or contact us to request a higher processing limit."
2507
  msgstr ""
2508
 
2509
+ #: includes/wc-stripe-functions.php:1103
2510
  msgid "The charge cannot be captured as the authorization has expired. Auth and capture charges must be captured within seven days."
2511
  msgstr ""
2512
 
2513
+ #: includes/wc-stripe-functions.php:1105
2514
  msgid "One or more provided parameters was not allowed for the given operation on the Charge. Check our API reference or the returned error message to see which values were not correct for that Charge."
2515
  msgstr ""
2516
 
2517
+ #: includes/wc-stripe-functions.php:1107
2518
  msgid "The email address is invalid (e.g., not properly formatted). Check that the email address is properly formatted and only includes allowed characters."
2519
  msgstr ""
2520
 
2521
+ #: includes/wc-stripe-functions.php:1109
2522
  msgid "The idempotency key provided is currently being used in another request. This occurs if your integration is making duplicate requests simultaneously."
2523
  msgstr ""
2524
 
2525
+ #: includes/wc-stripe-functions.php:1111
2526
  msgid "The specified amount is invalid. The charge amount must be a positive integer in the smallest currency unit, and not exceed the minimum or maximum amount."
2527
  msgstr ""
2528
 
2529
+ #: includes/wc-stripe-functions.php:1113
2530
  msgid "The source cannot be used because it is not in the correct state (e.g., a charge request is trying to use a source with a pending, failed, or consumed source). Check the status of the source you are attempting to use."
2531
  msgstr ""
2532
 
2533
+ #: includes/wc-stripe-functions.php:1115
2534
  msgid "Both a customer and source ID have been provided, but the source has not been saved to the customer. To create a charge for a customer with a specified source, you must first save the card details."
2535
  msgstr ""
2536
 
2537
+ #: includes/wc-stripe-functions.php:1117
2538
  msgid "The ZIP code provided was incorrect."
2539
  msgstr ""
2540
 
2541
+ #: includes/wc-stripe-functions.php:1118
2542
  msgid "An error occurred while processing the card. Try again later or with a different payment method."
2543
  msgstr ""
2544
 
2545
+ #: includes/wc-stripe-functions.php:1119
2546
  msgid "The card does not support this type of purchase."
2547
  msgstr ""
2548
 
2549
+ #: includes/wc-stripe-functions.php:1120
2550
+ #: includes/wc-stripe-functions.php:1123
2551
+ #: includes/wc-stripe-functions.php:1125
2552
  msgid "The card has been declined for an unknown reason."
2553
  msgstr ""
2554
 
2555
+ #: includes/wc-stripe-functions.php:1121
2556
  msgid "The customer has exceeded the balance or credit limit available on their card."
2557
  msgstr ""
2558
 
2559
+ #: includes/wc-stripe-functions.php:1122
2560
  msgid "The card does not support the specified currency."
2561
  msgstr ""
2562
 
2563
+ #: includes/wc-stripe-functions.php:1124
2564
  msgid "The payment has been declined as Stripe suspects it is fraudulent."
2565
  msgstr ""
2566
 
2567
+ #: includes/wc-stripe-functions.php:1126
2568
  msgid "The PIN entered is incorrect. "
2569
  msgstr ""
2570
 
2571
+ #: includes/wc-stripe-functions.php:1127
2572
  msgid "The card has insufficient funds to complete the purchase."
2573
  msgstr ""
2574
 
2575
+ #: includes/wc-stripe-functions.php:1128
2576
  msgid "Please select a payment method before proceeding."
2577
  msgstr ""
2578
 
2579
+ #: includes/wc-stripe-functions.php:1129
2580
  msgid "Please enter your IBAN before proceeding."
2581
  msgstr ""
2582
 
2583
+ #: includes/wc-stripe-functions.php:1130
2584
  msgid "Please select a bank before proceeding"
2585
  msgstr ""
2586
 
2587
+ #: includes/wc-stripe-functions.php:1131
2588
  msgid "The IBAN you entered is incomplete."
2589
  msgstr ""
2590
 
2591
+ #: includes/wc-stripe-functions.php:1133
2592
  msgid "Your card was declined. Your request was in test mode, but you used a real credit card. Only test cards can be used in test mode."
2593
  msgstr ""
2594
 
2595
+ #: includes/wc-stripe-functions.php:1135
2596
+ msgid "You do not have permission to use the PaymentElement card form. Please send a request to https://support.stripe.com/ and ask for the \"server_side_confirmation_beta\" to be added to your account."
2597
+ msgstr ""
2598
+
2599
  #: includes/wc-stripe-webhook-functions.php:106
2600
  msgid "Charge.succeeded webhook received. Payment has been completed."
2601
  msgstr ""
2620
  msgid "A review has been closed for charge %1$s. Reason: %2$s."
2621
  msgstr ""
2622
 
2623
+ #: packages/blocks/src/Payments/Gateways/CreditCardPayment.php:44
2624
+ #: templates/checkout/credit-card.php:23
2625
  msgid "Save Card"
2626
  msgstr ""
2627
 
2629
  msgid "%1$s - Order %2$s - One Time offer"
2630
  msgstr ""
2631
 
2632
+ #: src/Installments/InstallmentController.php:127
2633
  msgid "Installments:"
2634
  msgstr ""
2635
 
2641
  msgid "Do not pay with installment."
2642
  msgstr ""
2643
 
2644
+ #: src/Installments/InstallmentFormatter.php:46
2645
  msgid "day"
2646
  msgid_plural "days"
2647
  msgstr[0] ""
2648
  msgstr[1] ""
2649
 
2650
+ #: src/Installments/InstallmentFormatter.php:47
2651
  msgid "week"
2652
  msgid_plural "weeks"
2653
  msgstr[0] ""
2654
  msgstr[1] ""
2655
 
2656
+ #: src/Installments/InstallmentFormatter.php:48
2657
  msgid "month"
2658
  msgid_plural "months"
2659
  msgstr[0] ""
2674
  #: templates/cc-forms/simple.php:12
2675
  #: packages/blocks/assets/js/payment-methods/credit-card/components/bootstrap/index.js:13
2676
  #: packages/blocks/assets/js/payment-methods/credit-card/components/simple/index.js:19
2677
+ #: packages/blocks/build/commons.js:1783
2678
+ #: packages/blocks/build/commons.js:1932
2679
  msgid "Card Number"
2680
  msgstr ""
2681
 
2685
  #: templates/cc-forms/simple.php:26
2686
  #: packages/blocks/assets/js/payment-methods/credit-card/components/bootstrap/index.js:24
2687
  #: packages/blocks/assets/js/payment-methods/credit-card/components/simple/index.js:40
2688
+ #: packages/blocks/build/commons.js:1794
2689
+ #: packages/blocks/build/commons.js:1953
2690
  msgid "CVV"
2691
  msgstr ""
2692
 
2706
 
2707
  #: templates/cc-forms/simple.php:20
2708
  #: packages/blocks/assets/js/payment-methods/credit-card/components/simple/index.js:31
2709
+ #: packages/blocks/build/commons.js:1944
2710
  msgid "Expiration"
2711
  msgstr ""
2712
 
2716
 
2717
  #: templates/checkout/ach.php:11
2718
  #: packages/blocks/assets/js/payment-methods/ach/payment-method.js:59
2719
+ #: packages/blocks/build/commons.js:1604
2720
  msgid "username"
2721
  msgstr ""
2722
 
2723
  #: templates/checkout/ach.php:12
2724
  #: packages/blocks/assets/js/payment-methods/ach/payment-method.js:62
2725
+ #: packages/blocks/build/commons.js:1607
2726
  msgid "password"
2727
  msgstr ""
2728
 
2729
  #: templates/checkout/ach.php:13
2730
  #: packages/blocks/assets/js/payment-methods/ach/payment-method.js:65
2731
+ #: packages/blocks/build/commons.js:1610
2732
  msgid "pin"
2733
  msgstr ""
2734
 
2738
 
2739
  #: templates/checkout/afterpay.php:11
2740
  #: packages/blocks/assets/js/payment-methods/local-payment/afterpay.js:74
2741
+ #: packages/blocks/build/commons.js:3734
2742
  msgid "After clicking \"%s\", you will be redirected to Afterpay to complete your purchase securely."
2743
  msgstr ""
2744
 
2748
 
2749
  #: templates/checkout/boleto.php:17
2750
  #: packages/blocks/assets/js/payment-methods/local-payment/boleto.js:48
2751
+ #: packages/blocks/build/commons.js:3970
2752
  msgid "Test mode values"
2753
  msgstr ""
2754
 
2755
  #: templates/checkout/boleto.php:27
2756
  #: packages/blocks/assets/js/payment-methods/local-payment/boleto.js:58
2757
+ #: packages/blocks/build/commons.js:3980
2758
  msgid "Accepted formats"
2759
  msgstr ""
2760
 
2761
  #: templates/checkout/boleto.php:29
2762
  #: packages/blocks/assets/js/payment-methods/local-payment/boleto.js:61
2763
+ #: packages/blocks/build/commons.js:3983
2764
  msgid "XXX.XXX.XXX-XX or XXXXXXXXXXX"
2765
  msgstr ""
2766
 
2767
  #: templates/checkout/boleto.php:32
2768
  #: packages/blocks/assets/js/payment-methods/local-payment/boleto.js:65
2769
+ #: packages/blocks/build/commons.js:3987
2770
  msgid "XX.XXX.XXX/XXXX-XX or XXXXXXXXXXXXXX"
2771
  msgstr ""
2772
 
2780
 
2781
  #: templates/checkout/klarna-v2.php:12
2782
  #: packages/blocks/assets/js/payment-methods/local-payment/klarna.js:15
2783
+ #: packages/blocks/build/commons.js:4395
2784
  msgid "Test mode sms"
2785
  msgstr ""
2786
 
2787
+ #: templates/installment-plans.php:8
2788
  #: packages/blocks/assets/js/components/checkout/installments/index.js:72
2789
+ #: packages/blocks/build/commons.js:1332
2790
  msgid "Fill out card form for eligibility."
2791
  msgstr ""
2792
 
2793
+ #: templates/installment-plans.php:13
2794
  #: packages/blocks/assets/js/components/checkout/installments/index.js:54
2795
+ #: packages/blocks/build/commons.js:1314
2796
  msgid "Pay in installments:"
2797
  msgstr ""
2798
 
2799
  #: packages/blocks/assets/js/payment-methods/ach/payment-method.js:56
2800
+ #: packages/blocks/build/commons.js:1601
2801
  msgid "Test Credentials"
2802
  msgstr ""
2803
 
2804
  #: packages/blocks/assets/js/payment-methods/credit-card/components/custom-card-form.js:83
2805
+ #: packages/blocks/build/commons.js:1888
2806
  msgid "%s is not a valid blocks Stripe custom form. Please choose another custom form option in the Credit Card Settings."
2807
  msgstr ""
2808
 
2809
  #: packages/blocks/assets/js/payment-methods/local-payment/boleto.js:27
2810
+ #: packages/blocks/build/commons.js:3949
2811
  msgid "Please enter a valid CPF/CNPJ value"
2812
  msgstr ""
2813
 
2814
  #: packages/blocks/assets/js/payment-methods/local-payment/hooks/use-create-source.js:73
2815
  #: packages/blocks/assets/js/payment-methods/local-payment/hooks/use-validate-checkout.js:10
2816
+ #: packages/blocks/build/commons.js:4274
2817
+ #: packages/blocks/build/commons.js:4311
2818
  msgid "Please enter your payment info before proceeding."
2819
  msgstr ""
2820
 
2821
  #: packages/blocks/assets/js/payment-methods/local-payment/wechat.js:51
2822
+ #: packages/blocks/build/commons.js:4817
2823
  msgid "Please scan your QR code to continue with payment."
2824
  msgstr ""
2825
 
2826
  #: packages/blocks/assets/js/payment-methods/local-payment/wechat.js:97
2827
+ #: packages/blocks/build/commons.js:4863
2828
  msgid "Please fill out all the required fields in order to complete the WeChat payment."
2829
  msgstr ""
2830
 
2831
  #: packages/blocks/assets/js/payment-methods/local-payment/wechat.js:127
2832
+ #: packages/blocks/build/commons.js:4893
2833
  msgid "Test mode: Click the Place Order button to proceed."
2834
  msgstr ""
includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php CHANGED
@@ -89,20 +89,6 @@ abstract class WC_Payment_Gateway_Stripe_Local_Payment extends WC_Payment_Gatewa
89
  $this->supports = array( 'tokenization', 'products', 'refunds' );
90
  }
91
 
92
- public function process_payment( $order_id ) {
93
- $result = parent::process_payment( $order_id );
94
-
95
- if ( defined( WC_Stripe_Constants::WOOCOMMERCE_STRIPE_ORDER_PAY ) && $result['result'] == 'success' ) {
96
- wp_send_json( array(
97
- 'success' => true,
98
- 'redirect' => $result['redirect']
99
- ), 200 );
100
- exit();
101
- }
102
-
103
- return $result;
104
- }
105
-
106
  /**
107
  * Return an array of form fields for the gateway.
108
  *
@@ -204,7 +190,6 @@ abstract class WC_Payment_Gateway_Stripe_Local_Payment extends WC_Payment_Gatewa
204
  ),
205
  'element_params' => $this->get_element_params(),
206
  'routes' => array(
207
- 'order_pay' => stripe_wc()->rest_api->checkout->rest_url( 'order-pay' ),
208
  'delete_order_source' => WC_Stripe_Rest_API::get_endpoint( stripe_wc()->rest_api->checkout->rest_uri( 'order/source' ) ),
209
  'update_source' => WC_Stripe_Rest_API::get_endpoint( stripe_wc()->rest_api->source->rest_uri( 'update' ) )
210
  )
89
  $this->supports = array( 'tokenization', 'products', 'refunds' );
90
  }
91
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  /**
93
  * Return an array of form fields for the gateway.
94
  *
190
  ),
191
  'element_params' => $this->get_element_params(),
192
  'routes' => array(
 
193
  'delete_order_source' => WC_Stripe_Rest_API::get_endpoint( stripe_wc()->rest_api->checkout->rest_uri( 'order/source' ) ),
194
  'update_source' => WC_Stripe_Rest_API::get_endpoint( stripe_wc()->rest_api->source->rest_uri( 'update' ) )
195
  )
includes/abstract/abstract-wc-payment-gateway-stripe.php CHANGED
@@ -391,9 +391,9 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
391
  }
392
 
393
  if ( $result->complete_payment ) {
 
394
  $this->payment_object->payment_complete( $order, $result->charge );
395
  $this->trigger_post_payment_processes( $order, $this );
396
- WC()->cart->empty_cart();
397
 
398
  return array(
399
  'result' => 'success',
@@ -412,7 +412,7 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
412
  * @return array
413
  */
414
  public function get_localized_params() {
415
- return array(
416
  'gateway_id' => $this->id,
417
  'api_key' => wc_stripe_get_publishable_key(),
418
  'saved_method_selector' => '[name="' . $this->saved_method_key . '"]',
@@ -431,7 +431,8 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
431
  'shipping_method' => WC_Stripe_Rest_API::get_endpoint( stripe_wc()->rest_api->cart->rest_uri( 'shipping-method' ) ),
432
  'shipping_address' => WC_Stripe_Rest_API::get_endpoint( stripe_wc()->rest_api->cart->rest_uri( 'shipping-address' ) ),
433
  'checkout' => WC_Stripe_Rest_API::get_endpoint( stripe_wc()->rest_api->checkout->rest_uri( 'checkout' ) ),
434
- 'checkout_payment' => WC_Stripe_Rest_API::get_endpoint( stripe_wc()->rest_api->checkout->rest_uri( 'checkout/payment' ) )
 
435
  ),
436
  'rest_nonce' => wp_create_nonce( 'wp_rest' ),
437
  'banner_enabled' => $this->banner_checkout_enabled(),
@@ -442,6 +443,13 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
442
  'description' => $this->get_description(),
443
  'elementOptions' => $this->get_element_options()
444
  );
 
 
 
 
 
 
 
445
  }
446
 
447
  /**
@@ -525,6 +533,7 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
525
  $result->save();
526
  WC_Payment_Tokens::set_users_default( $user_id, $result->get_id() );
527
 
 
528
  do_action( 'wc_stripe_add_payment_method_success', $result );
529
 
530
  return array(
@@ -1028,7 +1037,9 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
1028
  }
1029
  }
1030
  $token->set_user_id( $order->get_user_id() );
1031
- $token->save();
 
 
1032
 
1033
  // set token value so it can be used for other processes.
1034
  $this->payment_method_token = $token->get_token();
@@ -1492,7 +1503,7 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
1492
  $data['needs_shipping'] = $product->needs_shipping();
1493
  $data['product'] = array(
1494
  'id' => $product->get_id(),
1495
- 'price' => $product->get_price(),
1496
  'variation' => false
1497
  );
1498
  }
391
  }
392
 
393
  if ( $result->complete_payment ) {
394
+ WC()->cart->empty_cart();
395
  $this->payment_object->payment_complete( $order, $result->charge );
396
  $this->trigger_post_payment_processes( $order, $this );
 
397
 
398
  return array(
399
  'result' => 'success',
412
  * @return array
413
  */
414
  public function get_localized_params() {
415
+ $data = array(
416
  'gateway_id' => $this->id,
417
  'api_key' => wc_stripe_get_publishable_key(),
418
  'saved_method_selector' => '[name="' . $this->saved_method_key . '"]',
431
  'shipping_method' => WC_Stripe_Rest_API::get_endpoint( stripe_wc()->rest_api->cart->rest_uri( 'shipping-method' ) ),
432
  'shipping_address' => WC_Stripe_Rest_API::get_endpoint( stripe_wc()->rest_api->cart->rest_uri( 'shipping-address' ) ),
433
  'checkout' => WC_Stripe_Rest_API::get_endpoint( stripe_wc()->rest_api->checkout->rest_uri( 'checkout' ) ),
434
+ 'checkout_payment' => WC_Stripe_Rest_API::get_endpoint( stripe_wc()->rest_api->checkout->rest_uri( 'checkout/payment' ) ),
435
+ 'order_pay' => WC_Stripe_Rest_API::get_endpoint( stripe_wc()->rest_api->checkout->rest_uri( 'order-pay' ) ),
436
  ),
437
  'rest_nonce' => wp_create_nonce( 'wp_rest' ),
438
  'banner_enabled' => $this->banner_checkout_enabled(),
443
  'description' => $this->get_description(),
444
  'elementOptions' => $this->get_element_options()
445
  );
446
+ global $wp;
447
+ if ( isset( $wp->query_vars['order-pay'] ) ) {
448
+ $data['order_id'] = absint( $wp->query_vars['order-pay'] );
449
+ $data['order_key'] = isset( $_GET['key'] ) ? $_GET['key'] : '';
450
+ }
451
+
452
+ return $data;
453
  }
454
 
455
  /**
533
  $result->save();
534
  WC_Payment_Tokens::set_users_default( $user_id, $result->get_id() );
535
 
536
+ unset( WC()->session->{WC_Stripe_Constants::PAYMENT_INTENT} );
537
  do_action( 'wc_stripe_add_payment_method_success', $result );
538
 
539
  return array(
1037
  }
1038
  }
1039
  $token->set_user_id( $order->get_user_id() );
1040
+ if ( strtolower( $token->get_brand() ) !== 'link' ) {
1041
+ $token->save();
1042
+ }
1043
 
1044
  // set token value so it can be used for other processes.
1045
  $this->payment_method_token = $token->get_token();
1503
  $data['needs_shipping'] = $product->needs_shipping();
1504
  $data['product'] = array(
1505
  'id' => $product->get_id(),
1506
+ 'price' => wc_get_price_to_display( $product ),
1507
  'variation' => false
1508
  );
1509
  }
includes/abstract/abstract-wc-stripe-payment.php CHANGED
@@ -4,8 +4,8 @@ defined( 'ABSPATH' ) || exit();
4
 
5
  /**
6
  *
7
- * @since 3.1.0
8
- * @author PaymentPlugins
9
  * @package Stripe/Abstract
10
  *
11
  */
@@ -167,8 +167,7 @@ abstract class WC_Stripe_Payment {
167
  }
168
 
169
  return $result;
170
- }
171
- catch ( Exception $e ) {
172
  return new WP_Error( 'refund-error', $e->getMessage() );
173
  }
174
  }
@@ -188,6 +187,7 @@ abstract class WC_Stripe_Payment {
188
  $order->update_status( apply_filters( 'wc_stripe_authorized_order_status', 'default' === $order_status ? 'on-hold' : $order_status, $order, $payment_method ) );
189
  }
190
  WC()->cart->empty_cart();
 
191
 
192
  return array(
193
  'result' => 'success',
@@ -352,4 +352,14 @@ abstract class WC_Stripe_Payment {
352
  $this->payment_method = $payment_method;
353
  }
354
 
 
 
 
 
 
 
 
 
 
 
355
  }
4
 
5
  /**
6
  *
7
+ * @since 3.1.0
8
+ * @author PaymentPlugins
9
  * @package Stripe/Abstract
10
  *
11
  */
167
  }
168
 
169
  return $result;
170
+ } catch ( Exception $e ) {
 
171
  return new WP_Error( 'refund-error', $e->getMessage() );
172
  }
173
  }
187
  $order->update_status( apply_filters( 'wc_stripe_authorized_order_status', 'default' === $order_status ? 'on-hold' : $order_status, $order, $payment_method ) );
188
  }
189
  WC()->cart->empty_cart();
190
+ $this->destroy_session_data();
191
 
192
  return array(
193
  'result' => 'success',
352
  $this->payment_method = $payment_method;
353
  }
354
 
355
+ /**
356
+ * @since 3.3.20
357
+ */
358
+ protected function get_payment_method_charge_type() {
359
+ return $this->payment_method->get_option( 'charge_type' ) === 'capture' ? WC_Stripe_Constants::AUTOMATIC : WC_Stripe_Constants::MANUAL;
360
+ }
361
+
362
+ public function destroy_session_data() {
363
+ }
364
+
365
  }
includes/admin/class-wc-stripe-admin-assets.php CHANGED
@@ -10,19 +10,21 @@ class WC_Stripe_Admin_Assets {
10
 
11
  public function __construct() {
12
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
13
-
14
  add_action( 'wp_print_scripts', array( __CLASS__, 'localize_scripts' ) );
15
-
16
  add_action( 'admin_footer', array( __CLASS__, 'localize_scripts' ) );
17
  add_action( 'wc_stripe_localize_stripe_advanced_settings', array( __CLASS__, 'localize_advanced_scripts' ) );
18
  }
19
 
20
  public function enqueue_scripts() {
 
21
  $screen = get_current_screen();
22
  $screen_id = $screen ? $screen->id : '';
23
  $js_path = stripe_wc()->assets_url() . 'js/';
24
  $css_path = stripe_wc()->assets_url() . 'css/';
25
 
 
 
 
26
  wp_register_script( 'wc-stripe-help-widget', $js_path . 'admin/help-widget.js', array( 'jquery' ), stripe_wc()->version(), true );
27
 
28
  wp_register_script( 'wc-stripe-admin-settings', $js_path . 'admin/admin-settings.js', array(
@@ -60,12 +62,16 @@ class WC_Stripe_Admin_Assets {
60
  'wc_stripe_setting_params',
61
  array(
62
  'routes' => array(
63
- 'apple_domain' => WC_Stripe_Rest_API::get_admin_endpoint( stripe_wc()->rest_api->settings->rest_uri( 'apple-domain' ) ),
64
- 'create_webhook' => WC_Stripe_Rest_API::get_admin_endpoint( stripe_wc()->rest_api->settings->rest_uri( 'create-webhook' ) ),
65
- 'delete_webhook' => WC_Stripe_Rest_API::get_admin_endpoint( stripe_wc()->rest_api->settings->rest_uri( 'delete-webhook' ) ),
66
- 'connection_test' => WC_Stripe_Rest_API::get_admin_endpoint( stripe_wc()->rest_api->settings->rest_uri( 'connection-test' ) ),
 
67
  ),
68
  'rest_nonce' => wp_create_nonce( 'wp_rest' ),
 
 
 
69
  )
70
  );
71
  }
@@ -97,6 +103,32 @@ class WC_Stripe_Admin_Assets {
97
  }
98
  }
99
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
  }
101
 
102
  public static function localize_scripts() {
10
 
11
  public function __construct() {
12
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
 
13
  add_action( 'wp_print_scripts', array( __CLASS__, 'localize_scripts' ) );
 
14
  add_action( 'admin_footer', array( __CLASS__, 'localize_scripts' ) );
15
  add_action( 'wc_stripe_localize_stripe_advanced_settings', array( __CLASS__, 'localize_advanced_scripts' ) );
16
  }
17
 
18
  public function enqueue_scripts() {
19
+ global $pagenow;
20
  $screen = get_current_screen();
21
  $screen_id = $screen ? $screen->id : '';
22
  $js_path = stripe_wc()->assets_url() . 'js/';
23
  $css_path = stripe_wc()->assets_url() . 'css/';
24
 
25
+ stripe_wc()->assets()->register_script( 'wc-stripe-admin-feedback', 'assets/build/admin-feedback.js' );
26
+ stripe_wc()->assets()->register_style( 'wc-stripe-admin-feedback', 'assets/build/admin-feedback-styles.css' );
27
+
28
  wp_register_script( 'wc-stripe-help-widget', $js_path . 'admin/help-widget.js', array( 'jquery' ), stripe_wc()->version(), true );
29
 
30
  wp_register_script( 'wc-stripe-admin-settings', $js_path . 'admin/admin-settings.js', array(
62
  'wc_stripe_setting_params',
63
  array(
64
  'routes' => array(
65
+ 'apple_domain' => WC_Stripe_Rest_API::get_admin_endpoint( stripe_wc()->rest_api->settings->rest_uri( 'apple-domain' ) ),
66
+ 'create_webhook' => WC_Stripe_Rest_API::get_admin_endpoint( stripe_wc()->rest_api->settings->rest_uri( 'create-webhook' ) ),
67
+ 'delete_webhook' => WC_Stripe_Rest_API::get_admin_endpoint( stripe_wc()->rest_api->settings->rest_uri( 'delete-webhook' ) ),
68
+ 'connection_test' => WC_Stripe_Rest_API::get_admin_endpoint( stripe_wc()->rest_api->settings->rest_uri( 'connection-test' ) ),
69
+ 'delete_connection' => WC_Stripe_Rest_API::get_admin_endpoint( stripe_wc()->rest_api->settings->rest_uri( 'delete-connection' ) )
70
  ),
71
  'rest_nonce' => wp_create_nonce( 'wp_rest' ),
72
+ 'messages' => array(
73
+ 'delete_connection' => __( 'Are you sure you want to delete your connection data?', 'woo-stripe-payment' )
74
+ )
75
  )
76
  );
77
  }
103
  }
104
  }
105
  }
106
+ if ( $pagenow === 'plugins.php' ) {
107
+ wp_enqueue_script( 'wc-stripe-admin-feedback' );
108
+ wp_enqueue_style( 'wc-stripe-admin-feedback' );
109
+ add_action( 'admin_print_scripts', function () {
110
+ stripe_wc()->data_api()->print_data( 'stripeFeedbackParams', [
111
+ 'title' => esc_html__( 'Feedback', 'woo-stripe-payment' ),
112
+ 'description' => esc_html__( 'With your feedback we can make the plugin better.', 'woo-stripe-payment' ),
113
+ 'reasonTextLabel' => esc_html__( 'Additional Info', 'woo-stripe-payment' ),
114
+ 'placeholders' => array(
115
+ 'found_better' => __( 'What is the plugin\'s name and why was it better?', 'woo-stripe-payment' ),
116
+ 'error' => __( 'What error did you encounter?', 'woo-stripe-payment' )
117
+ ),
118
+ 'buttons' => [
119
+ 'primary' => __( 'Submit & Deactivate', 'woo-stripe-payment' ),
120
+ 'secondary' => __( 'Skip & Deactivate', 'woo-stripe-payment' )
121
+ ],
122
+ 'options' => [
123
+ 'found_better' => esc_html__( 'I found a better Stripe plugin', 'woo-stripe-payment' ),
124
+ 'error' => esc_html__( 'The plugin caused errors', 'woo-stripe-payment' ),
125
+ 'temporary' => esc_html__( 'This is a temporary deactivation', 'woo-stripe-payment' ),
126
+ 'other' => esc_html__( 'Other', 'woo-stripe-payment' )
127
+ ],
128
+ 'route' => WC_Stripe_Rest_API::get_admin_endpoint( stripe_wc()->rest_api->feedback->rest_uri( 'feedback' ) )
129
+ ] );
130
+ } );
131
+ }
132
  }
133
 
134
  public static function localize_scripts() {
includes/admin/settings/class-wc-stripe-account-settings.php CHANGED
@@ -11,7 +11,9 @@ defined( 'ABSPATH' ) || exit();
11
  */
12
  class WC_Stripe_Account_Settings extends WC_Stripe_Settings_API {
13
 
14
- private $api_settings = array();
 
 
15
 
16
  const DEFAULT_ACCOUNT_SETTINGS = array(
17
  'account_id' => '',
@@ -19,11 +21,6 @@ class WC_Stripe_Account_Settings extends WC_Stripe_Settings_API {
19
  'default_currency' => ''
20
  );
21
 
22
- public function __construct() {
23
- $this->id = 'stripe_account';
24
- parent::__construct();
25
- }
26
-
27
  public function hooks() {
28
  add_action( 'wc_stripe_connect_settings', array( $this, 'connect_settings' ) );
29
  add_action( 'woocommerce_update_options_checkout_stripe_api', array( $this, 'pre_api_update' ), 5 );
@@ -52,6 +49,8 @@ class WC_Stripe_Account_Settings extends WC_Stripe_Settings_API {
52
  $this->settings['country'] = strtoupper( $account->country );
53
  $this->settings['default_currency'] = strtoupper( $account->default_currency );
54
  } else {
 
 
55
  $this->settings[ WC_Stripe_Constants::TEST ] = array(
56
  'account_id' => $account->id,
57
  'country' => strtoupper( $account->country ),
@@ -63,9 +62,8 @@ class WC_Stripe_Account_Settings extends WC_Stripe_Settings_API {
63
  }
64
 
65
  public function pre_api_update() {
66
- $settings = stripe_wc()->api_settings;
67
- $this->api_settings = array(
68
- 'key' => $settings->get_option( 'publishable_key_test' ),
69
  'secret' => $settings->get_option( 'secret_key_test' )
70
  );
71
  }
@@ -73,11 +71,10 @@ class WC_Stripe_Account_Settings extends WC_Stripe_Settings_API {
73
  public function post_api_update() {
74
  $api_settings = stripe_wc()->api_settings;
75
  $settings = array(
76
- 'key' => $api_settings->get_option( 'publishable_key_test' ),
77
  'secret' => $api_settings->get_option( 'secret_key_test' )
78
  );
79
  $is_valid = array_filter( $settings ) == $settings;
80
- if ( ( ! isset( $this->settings['test'] ) || $settings != $this->api_settings ) && $is_valid ) {
81
  $this->save_account_settings( null, 'test' );
82
  }
83
  }
@@ -100,4 +97,19 @@ class WC_Stripe_Account_Settings extends WC_Stripe_Settings_API {
100
  return $country;
101
  }
102
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  }
11
  */
12
  class WC_Stripe_Account_Settings extends WC_Stripe_Settings_API {
13
 
14
+ public $id = 'stripe_account';
15
+
16
+ private $previous_settings = array();
17
 
18
  const DEFAULT_ACCOUNT_SETTINGS = array(
19
  'account_id' => '',
21
  'default_currency' => ''
22
  );
23
 
 
 
 
 
 
24
  public function hooks() {
25
  add_action( 'wc_stripe_connect_settings', array( $this, 'connect_settings' ) );
26
  add_action( 'woocommerce_update_options_checkout_stripe_api', array( $this, 'pre_api_update' ), 5 );
49
  $this->settings['country'] = strtoupper( $account->country );
50
  $this->settings['default_currency'] = strtoupper( $account->default_currency );
51
  } else {
52
+ stripe_wc()->api_settings->update_option( 'account_id_test', $account->id );
53
+ stripe_wc()->api_settings->init_form_fields();
54
  $this->settings[ WC_Stripe_Constants::TEST ] = array(
55
  'account_id' => $account->id,
56
  'country' => strtoupper( $account->country ),
62
  }
63
 
64
  public function pre_api_update() {
65
+ $settings = stripe_wc()->api_settings;
66
+ $this->previous_settings = array(
 
67
  'secret' => $settings->get_option( 'secret_key_test' )
68
  );
69
  }
71
  public function post_api_update() {
72
  $api_settings = stripe_wc()->api_settings;
73
  $settings = array(
 
74
  'secret' => $api_settings->get_option( 'secret_key_test' )
75
  );
76
  $is_valid = array_filter( $settings ) == $settings;
77
+ if ( ( ! isset( $this->settings['test'] ) || $settings != $this->previous_settings ) && $is_valid ) {
78
  $this->save_account_settings( null, 'test' );
79
  }
80
  }
97
  return $country;
98
  }
99
 
100
+ public function get_account_id( $mode = 'live' ) {
101
+ if ( $mode === WC_Stripe_Constants::LIVE ) {
102
+ $id = $this->get_option( 'account_id' );
103
+ } else {
104
+ $settings = $this->get_option( WC_Stripe_Constants::TEST, self::DEFAULT_ACCOUNT_SETTINGS );
105
+ $id = $settings['account_id'];
106
+ }
107
+
108
+ return $id;
109
+ }
110
+
111
+ public function delete_account_settings() {
112
+ delete_option( $this->get_option_key() );
113
+ }
114
+
115
  }
includes/admin/settings/class-wc-stripe-advanced-settings.php CHANGED
@@ -26,6 +26,10 @@ class WC_Stripe_Advanced_Settings extends WC_Stripe_Settings_API {
26
  'type' => 'title',
27
  'title' => __( 'Advanced Settings', 'woo-stripe-payment' ),
28
  ),
 
 
 
 
29
  'locale' => array(
30
  'title' => __( 'Locale Type', 'woo-stripe-payment' ),
31
  'type' => 'select',
@@ -38,9 +42,13 @@ class WC_Stripe_Advanced_Settings extends WC_Stripe_Settings_API {
38
  'description' => __( 'If set to "auto" Stripe will determine the locale to use based on the customer\'s browser/location settings. Site locale uses the Wordpress locale setting.',
39
  'woo-stripe-payment' )
40
  ),
41
- 'settings_description' => array(
42
- 'type' => 'description',
43
- 'description' => __( 'This section provides advanced settings that allow you to configure functionality that fits your business process.', 'woo-stripe-payment' )
 
 
 
 
44
  ),
45
  'statement_descriptor' => array(
46
  'title' => __( 'Statement Descriptor', 'woo-stripe-payment' ),
@@ -57,14 +65,6 @@ class WC_Stripe_Advanced_Settings extends WC_Stripe_Settings_API {
57
  return WC_Stripe_Utils::sanitize_statement_descriptor( $value );
58
  }
59
  ),
60
- 'installments' => array(
61
- 'title' => __( 'Installments', 'woo-stripe-payment' ),
62
- 'type' => 'checkbox',
63
- 'default' => 'no',
64
- 'value' => 'yes',
65
- 'desc_tip' => false,
66
- 'description' => sprintf( __( 'If enabled, installments will be available for the credit card gateway. %1$s', 'woo-stripe-payment' ), $this->get_supported_countries_description() )
67
- ),
68
  'stripe_fee' => array(
69
  'title' => __( 'Display Stripe Fee', 'woo-stripe-payment' ),
70
  'type' => 'checkbox',
@@ -94,6 +94,42 @@ class WC_Stripe_Advanced_Settings extends WC_Stripe_Settings_API {
94
  'desc_tip' => true,
95
  'description' => __( 'If enabled, the plugin will process a payment cancellation or refund within Stripe when the order\'s status is set to cancelled.', 'woo-stripe-payment' )
96
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
  'disputes' => array(
98
  'title' => __( 'Dispute Settings', 'woo-stripe-payment' ),
99
  'type' => 'title'
@@ -156,6 +192,27 @@ class WC_Stripe_Advanced_Settings extends WC_Stripe_Settings_API {
156
  );
157
  }
158
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
159
  public function is_fee_enabled() {
160
  return $this->is_active( 'stripe_fee' );
161
  }
@@ -189,7 +246,9 @@ class WC_Stripe_Advanced_Settings extends WC_Stripe_Settings_API {
189
  }
190
 
191
  public function get_supported_countries_description() {
192
- return sprintf( __( 'Supported Stripe account countries: %1$s', 'woo-stripe-payment' ), implode( ', ', \PaymentPlugins\Stripe\Installments\InstallmentController::get_supported_countries() ) );
 
 
193
  }
194
 
195
  }
26
  'type' => 'title',
27
  'title' => __( 'Advanced Settings', 'woo-stripe-payment' ),
28
  ),
29
+ 'settings_description' => array(
30
+ 'type' => 'description',
31
+ 'description' => __( 'This section provides advanced settings that allow you to configure functionality that fits your business process.', 'woo-stripe-payment' )
32
+ ),
33
  'locale' => array(
34
  'title' => __( 'Locale Type', 'woo-stripe-payment' ),
35
  'type' => 'select',
42
  'description' => __( 'If set to "auto" Stripe will determine the locale to use based on the customer\'s browser/location settings. Site locale uses the Wordpress locale setting.',
43
  'woo-stripe-payment' )
44
  ),
45
+ 'installments' => array(
46
+ 'title' => __( 'Installments', 'woo-stripe-payment' ),
47
+ 'type' => 'checkbox',
48
+ 'default' => 'yes',
49
+ 'value' => 'yes',
50
+ 'desc_tip' => false,
51
+ 'description' => sprintf( __( 'If enabled, installments will be available for the credit card gateway. %1$s', 'woo-stripe-payment' ), $this->get_supported_countries_description() )
52
  ),
53
  'statement_descriptor' => array(
54
  'title' => __( 'Statement Descriptor', 'woo-stripe-payment' ),
65
  return WC_Stripe_Utils::sanitize_statement_descriptor( $value );
66
  }
67
  ),
 
 
 
 
 
 
 
 
68
  'stripe_fee' => array(
69
  'title' => __( 'Display Stripe Fee', 'woo-stripe-payment' ),
70
  'type' => 'checkbox',
94
  'desc_tip' => true,
95
  'description' => __( 'If enabled, the plugin will process a payment cancellation or refund within Stripe when the order\'s status is set to cancelled.', 'woo-stripe-payment' )
96
  ),
97
+ 'link_title' => array(
98
+ 'type' => 'title',
99
+ 'title' => __( 'Link Settings', 'woo-stripe-payment' ),
100
+ ),
101
+ 'link_enabled' => array(
102
+ 'title' => __( 'Faster Checkout With Link', 'woo-stripe-payment' ),
103
+ 'type' => 'checkbox',
104
+ 'default' => 'no',
105
+ 'value' => 'yes',
106
+ 'description' => __( 'Only available to US merchants: With Link enabled, Stripe will use your customer\'s email address to determine if they have used Stripe in the past. If yes, their payment info, billing and shipping information can be used to
107
+ auto-populate the checkout page resulting in higher conversion rates and less customer friction. If enabled, the Stripe payment form will be used because it\'s the only card form compatible with Link.', 'woo-stripe-payment' )
108
+ ),
109
+ 'link_email' => array(
110
+ 'title' => __( 'Move email field to top of page', 'woo-stripe-payment' ),
111
+ 'type' => 'checkbox',
112
+ 'default' => 'yes',
113
+ 'value' => 'yes',
114
+ 'description' => __( 'If enabled, the email field will be placed at the top of the checkout page. Link uses the email address so it\'s best to prioritize it.', 'woo-stripe-payment' ),
115
+ 'custom_attributes' => array(
116
+ 'data-show-if' => array(
117
+ 'link_enabled' => true
118
+ )
119
+ )
120
+ ),
121
+ 'link_autoload' => array(
122
+ 'title' => __( 'Launch link on page load', 'woo-stripe-payment' ),
123
+ 'type' => 'checkbox',
124
+ 'default' => 'yes',
125
+ 'value' => 'yes',
126
+ 'description' => __( 'If enabled and the email address is already populated, the plugin will attempt to launch Link on the checkout page.', 'woo-stripe-payment' ),
127
+ 'custom_attributes' => array(
128
+ 'data-show-if' => array(
129
+ 'link_enabled' => true
130
+ )
131
+ )
132
+ ),
133
  'disputes' => array(
134
  'title' => __( 'Dispute Settings', 'woo-stripe-payment' ),
135
  'type' => 'title'
192
  );
193
  }
194
 
195
+ public function process_admin_options() {
196
+ parent::process_admin_options();
197
+ if ( $this->is_active( 'link_enabled' ) ) {
198
+ /**
199
+ * @var \WC_Payment_Gateway_Stripe $payment_method
200
+ */
201
+ $payment_method = WC()->payment_gateways()->payment_gateways()['stripe_cc'];
202
+ $payment_method->update_option( 'form_type', 'payment' );
203
+ wc_stripe_log_info( 'Stripe payment form enabled for Link integration compatibility' );
204
+ }
205
+ }
206
+
207
+ public function get_form_fields() {
208
+ $fields = parent::get_form_fields();
209
+ if ( stripe_wc()->account_settings->get_account_country( wc_stripe_mode() ) !== 'US' ) {
210
+ //unset( $fields['link_title'], $fields['link_enabled'], $fields['link_email'], $fields['link_autoload'] );
211
+ }
212
+
213
+ return $fields;
214
+ }
215
+
216
  public function is_fee_enabled() {
217
  return $this->is_active( 'stripe_fee' );
218
  }
246
  }
247
 
248
  public function get_supported_countries_description() {
249
+ return sprintf( __( 'Supported Stripe account countries: %1$s. Supported currencies: %2$s', 'woo-stripe-payment' ),
250
+ implode( ', ', \PaymentPlugins\Stripe\Installments\InstallmentController::get_supported_countries() ),
251
+ implode( ', ', \PaymentPlugins\Stripe\Installments\InstallmentController::get_supported_currencies() ) );
252
  }
253
 
254
  }
includes/admin/settings/class-wc-stripe-api-settings.php CHANGED
@@ -49,13 +49,32 @@ class WC_Stripe_API_Settings extends WC_Stripe_Settings_API {
49
  'woo-stripe-payment' ),
50
  ),
51
  'account_id' => array(
52
- 'type' => 'paragraph',
53
- 'title' => __( 'Account ID', 'woo-stripe-payment' ),
54
- 'text' => '',
55
- 'class' => '',
56
- 'default' => '',
57
- 'desc_tip' => true,
58
- 'description' => __( 'This is your Stripe Connect ID and serves as a unique identifier.', 'woo-stripe-payment' ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  ),
60
  'stripe_connect' => array(
61
  'type' => 'stripe_connect',
@@ -170,17 +189,21 @@ class WC_Stripe_API_Settings extends WC_Stripe_Settings_API {
170
  ),
171
  );
172
  if ( $this->get_option( 'account_id' ) ) {
173
- $this->form_fields['account_id']['text'] = $this->get_option( 'account_id' );
174
- $this->form_fields['stripe_connect']['description']
175
- = sprintf( __( '%s Your Stripe account has been connected. You can now accept Live and Test payments. You can Re-Connect if you want to recycle your API keys for security.',
176
  'woo-stripe-payment' ),
177
- '<span class="dashicons dashicons-yes stipe-connect-active"></span>' );
178
- $this->form_fields['stripe_connect']['active'] = true;
179
  } else {
180
  unset( $this->form_fields['account_id'] );
181
  // don't show the live connection test unless connect process has been completed.
182
  unset( $this->form_fields['connection_test_live'] );
183
  }
 
 
 
 
 
184
 
185
  foreach ( array( 'test', 'live' ) as $mode ) {
186
  $webhook_id = $this->get_webhook_id( $mode );
@@ -210,7 +233,8 @@ class WC_Stripe_API_Settings extends WC_Stripe_Settings_API {
210
  );
211
  $data['connect_url'] = $this->get_connect_url();
212
  if ( $data['active'] ) {
213
- $data['label'] = __( 'Click To Re-Connect', 'woo-stripe-payment' );
 
214
  }
215
  ob_start();
216
  include stripe_wc()->plugin_path() . 'includes/admin/views/html-stripe-connect.php';
@@ -326,6 +350,7 @@ class WC_Stripe_API_Settings extends WC_Stripe_Settings_API {
326
  'charge.succeeded',
327
  'source.chargeable',
328
  'payment_intent.succeeded',
 
329
  'charge.refunded',
330
  'charge.dispute.created',
331
  'charge.dispute.closed',
@@ -360,4 +385,16 @@ class WC_Stripe_API_Settings extends WC_Stripe_Settings_API {
360
  return $this->get_option( "webhook_id_{$mode}", null );
361
  }
362
 
 
 
 
 
 
 
 
 
 
 
 
 
363
  }
49
  'woo-stripe-payment' ),
50
  ),
51
  'account_id' => array(
52
+ 'type' => 'paragraph',
53
+ 'title' => __( 'Account ID', 'woo-stripe-payment' ),
54
+ 'text' => '',
55
+ 'class' => '',
56
+ 'default' => '',
57
+ 'desc_tip' => true,
58
+ 'description' => __( 'This is your Stripe Account ID and serves as a unique identifier.', 'woo-stripe-payment' ),
59
+ 'custom_attributes' => array(
60
+ 'data-show-if' => array(
61
+ 'mode' => 'live'
62
+ )
63
+ )
64
+ ),
65
+ 'account_id_test' => array(
66
+ 'type' => 'paragraph',
67
+ 'title' => __( 'Account ID', 'woo-stripe-payment' ),
68
+ 'text' => '',
69
+ 'class' => '',
70
+ 'default' => '',
71
+ 'desc_tip' => true,
72
+ 'description' => __( 'This is your Stripe Account ID and serves as a unique identifier.', 'woo-stripe-payment' ),
73
+ 'custom_attributes' => array(
74
+ 'data-show-if' => array(
75
+ 'mode' => 'test'
76
+ )
77
+ )
78
  ),
79
  'stripe_connect' => array(
80
  'type' => 'stripe_connect',
189
  ),
190
  );
191
  if ( $this->get_option( 'account_id' ) ) {
192
+ $this->form_fields['account_id']['text'] = $this->get_option( 'account_id' );
193
+ $this->form_fields['stripe_connect']['description'] = sprintf( __( '%s Your Stripe account has been connected.',
 
194
  'woo-stripe-payment' ),
195
+ '<span class="dashicons dashicons-yes stripe-connect-active"></span>' );
196
+ $this->form_fields['stripe_connect']['active'] = true;
197
  } else {
198
  unset( $this->form_fields['account_id'] );
199
  // don't show the live connection test unless connect process has been completed.
200
  unset( $this->form_fields['connection_test_live'] );
201
  }
202
+ if ( $this->get_option( 'account_id_test' ) ) {
203
+ $this->form_fields['account_id_test']['text'] = $this->get_option( 'account_id_test' );
204
+ } else {
205
+ unset( $this->form_fields['account_id_test'] );
206
+ }
207
 
208
  foreach ( array( 'test', 'live' ) as $mode ) {
209
  $webhook_id = $this->get_webhook_id( $mode );
233
  );
234
  $data['connect_url'] = $this->get_connect_url();
235
  if ( $data['active'] ) {
236
+ $data['label'] = __( 'Delete Connection', 'woo-stripe-payment' );
237
+ $data['class'] .= ' stripe-delete-connection';
238
  }
239
  ob_start();
240
  include stripe_wc()->plugin_path() . 'includes/admin/views/html-stripe-connect.php';
350
  'charge.succeeded',
351
  'source.chargeable',
352
  'payment_intent.succeeded',
353
+ 'payment_intent.requires_action',
354
  'charge.refunded',
355
  'charge.dispute.created',
356
  'charge.dispute.closed',
385
  return $this->get_option( "webhook_id_{$mode}", null );
386
  }
387
 
388
+ public function get_account_id( $mode = '' ) {
389
+ if ( ! $mode ) {
390
+ $mode = wc_stripe_mode();
391
+ }
392
+
393
+ return $mode === WC_Stripe_Constants::LIVE ? $this->get_option( 'account_id' ) : $this->get_option( 'account_id_test' );
394
+ }
395
+
396
+ public function delete_account_settings() {
397
+ delete_option( $this->get_option_key() );
398
+ }
399
+
400
  }
includes/admin/views/html-stripe-connect.php CHANGED
@@ -1,19 +1,20 @@
1
- <tr valign="top">
2
- <th scope="row" class="titledesc"><label
3
- for="<?php echo esc_attr( $field_key ); ?>"><?php echo wp_kses_post( $data['title'] ); ?> <?php echo $this->get_tooltip_html( $data ); // WPCS: XSS ok. ?></label>
4
- </th>
5
- <td class="forminp
6
- <?php
7
- if ( $data['active'] ) {
8
- ?>
9
- active<?php } ?>">
10
- <fieldset>
11
- <legend class="screen-reader-text">
12
- <span><?php echo wp_kses_post( $data['title'] ); ?></span>
13
- </legend>
14
- <label for="<?php echo esc_attr( $field_key ); ?>"> <a href="<?php echo $data['connect_url']; ?>" type="submit" class="stripe-connect light-blue <?php echo esc_attr( $data['class'] ); ?>" name="<?php echo esc_attr( $field_key ); ?>" id="<?php echo esc_attr( $field_key ); ?>" style="<?php echo esc_attr( $data['css'] ); ?>" value="<?php echo $field_key; ?>" <?php echo $this->get_custom_attribute_html( $data ); // WPCS: XSS ok. ?>><span><?php echo wp_kses_post( $data['label'] ); ?></span></a>
15
- </label>
16
- <?php echo $this->get_description_html( $data ); // WPCS: XSS ok. ?>
17
- </fieldset>
18
- </td>
19
- </tr>
 
1
+ <tr valign="top">
2
+ <th scope="row" class="titledesc"><label
3
+ for="<?php echo esc_attr( $field_key ); ?>"><?php echo wp_kses_post( $data['title'] ); ?> <?php echo $this->get_tooltip_html( $data ); // WPCS: XSS ok. ?></label>
4
+ </th>
5
+ <td class="forminp
6
+ <?php
7
+ if ( $data['active'] ) {
8
+ ?>
9
+ active<?php } ?>">
10
+ <fieldset>
11
+ <legend class="screen-reader-text">
12
+ <span><?php echo wp_kses_post( $data['title'] ); ?></span>
13
+ </legend>
14
+ <label for="<?php echo esc_attr( $field_key ); ?>">
15
+ <a href="<?php echo $data['connect_url']; ?>" type="submit" class="stripe-connect light-blue <?php echo esc_attr( $data['class'] ); ?>" name="<?php echo esc_attr( $field_key ); ?>" id="<?php echo esc_attr( $field_key ); ?>" style="<?php echo esc_attr( $data['css'] ); ?>" value="<?php echo $field_key; ?>" <?php echo $this->get_custom_attribute_html( $data ); // WPCS: XSS ok. ?>><span><?php echo wp_kses_post( $data['label'] ); ?></span></a>
16
+ </label>
17
+ <?php echo $this->get_description_html( $data ); // WPCS: XSS ok. ?>
18
+ </fieldset>
19
+ </td>
20
+ </tr>
includes/class-stripe.php CHANGED
@@ -26,7 +26,7 @@ class WC_Stripe_Manager {
26
  *
27
  * @var string
28
  */
29
- public $version = '3.3.19';
30
 
31
  /**
32
  *
@@ -152,6 +152,9 @@ class WC_Stripe_Manager {
152
  \PaymentPlugins\CartFlows\Stripe\Main::init();
153
  \PaymentPlugins\WooFunnels\Stripe\Main::init();
154
  \PaymentPlugins\CheckoutWC\Stripe\Main::init();
 
 
 
155
  }
156
 
157
  /**
@@ -161,6 +164,7 @@ class WC_Stripe_Manager {
161
  }
162
 
163
  public function includes() {
 
164
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/class-wc-stripe-install.php';
165
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/class-wc-stripe-update.php';
166
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/class-wc-stripe-rest-api.php';
@@ -191,9 +195,6 @@ class WC_Stripe_Manager {
191
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/wc-stripe-webhook-functions.php';
192
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/wc-stripe-hooks.php';
193
 
194
- // constants
195
- include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/class-wc-stripe-constants.php';
196
-
197
  // traits
198
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/traits/wc-stripe-settings-trait.php';
199
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/traits/wc-stripe-controller-traits.php';
@@ -294,7 +295,7 @@ class WC_Stripe_Manager {
294
  $this->rest_api = new $api_class();
295
 
296
  if ( $this->is_request( 'frontend' ) && class_exists( 'WC_Stripe_Frontend_Scripts' ) ) {
297
- $this->scripts = new WC_Stripe_Frontend_Scripts();
298
  }
299
 
300
  // allow other plugins to provide their own settings classes.
@@ -310,6 +311,9 @@ class WC_Stripe_Manager {
310
  }
311
 
312
  new WC_Stripe_API_Request_Filter( $this->advanced_settings );
 
 
 
313
  }
314
 
315
  /**
@@ -348,12 +352,34 @@ class WC_Stripe_Manager {
348
  */
349
  public function scripts() {
350
  if ( is_null( $this->scripts ) ) {
351
- $this->scripts = new WC_Stripe_Frontend_Scripts();
352
  }
353
 
354
  return $this->scripts;
355
  }
356
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
357
  public function payment_gateways() {
358
  return $this->payment_gateways;
359
  }
26
  *
27
  * @var string
28
  */
29
+ public $version = '3.3.20';
30
 
31
  /**
32
  *
152
  \PaymentPlugins\CartFlows\Stripe\Main::init();
153
  \PaymentPlugins\WooFunnels\Stripe\Main::init();
154
  \PaymentPlugins\CheckoutWC\Stripe\Main::init();
155
+ \PaymentPlugins\Stripe\WooCommerceSubscriptions\Package::init();
156
+ \PaymentPlugins\Stripe\WooCommercePreOrders\Package::init();
157
+ \PaymentPlugins\Stripe\GermanMarket\Package::init();
158
  }
159
 
160
  /**
164
  }
165
 
166
  public function includes() {
167
+ include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/class-wc-stripe-constants.php';
168
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/class-wc-stripe-install.php';
169
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/class-wc-stripe-update.php';
170
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/class-wc-stripe-rest-api.php';
195
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/wc-stripe-webhook-functions.php';
196
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/wc-stripe-hooks.php';
197
 
 
 
 
198
  // traits
199
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/traits/wc-stripe-settings-trait.php';
200
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/traits/wc-stripe-controller-traits.php';
295
  $this->rest_api = new $api_class();
296
 
297
  if ( $this->is_request( 'frontend' ) && class_exists( 'WC_Stripe_Frontend_Scripts' ) ) {
298
+ $this->scripts();
299
  }
300
 
301
  // allow other plugins to provide their own settings classes.
311
  }
312
 
313
  new WC_Stripe_API_Request_Filter( $this->advanced_settings );
314
+
315
+ new \PaymentPlugins\Stripe\Link\LinkIntegration( $this->advanced_settings, $this->account_settings, $this->assets(), $this->data_api() );
316
+ new \PaymentPlugins\Stripe\Controllers\PaymentIntent( WC_Stripe_Gateway::load(), [ 'stripe_cc' ] );
317
  }
318
 
319
  /**
352
  */
353
  public function scripts() {
354
  if ( is_null( $this->scripts ) ) {
355
+ $this->scripts = new WC_Stripe_Frontend_Scripts( $this->assets() );
356
  }
357
 
358
  return $this->scripts;
359
  }
360
 
361
+ public function assets() {
362
+ static $assets;
363
+ if ( is_null( $assets ) ) {
364
+ $assets = new \PaymentPlugins\Stripe\Assets\AssetsApi(
365
+ WC_STRIPE_PLUGIN_FILE_PATH,
366
+ trailingslashit( plugins_url( dirname( WC_STRIPE_PLUGIN_NAME ) ) ),
367
+ $this->version()
368
+ );
369
+ }
370
+
371
+ return $assets;
372
+ }
373
+
374
+ public function data_api() {
375
+ static $data_api;
376
+ if ( is_null( $data_api ) ) {
377
+ $data_api = new \PaymentPlugins\Stripe\Assets\AssetDataApi();
378
+ }
379
+
380
+ return $data_api;
381
+ }
382
+
383
  public function payment_gateways() {
384
  return $this->payment_gateways;
385
  }
includes/class-wc-stripe-constants.php CHANGED
@@ -83,4 +83,12 @@ class WC_Stripe_Constants {
83
 
84
  const TEST = 'test';
85
 
 
 
 
 
 
 
 
 
86
  }
83
 
84
  const TEST = 'test';
85
 
86
+ const VERSION_KEY = 'stripe_wc_version';
87
+
88
+ const INITIAL_INSTALL = 'wc_stripe_initialize_install';
89
+
90
+ const AUTOMATIC = 'automatic';
91
+
92
+ const MANUAL = 'manual';
93
+
94
  }
includes/class-wc-stripe-frontend-scripts.php CHANGED
@@ -20,13 +20,15 @@ class WC_Stripe_Frontend_Scripts {
20
 
21
  public $localized_data = array();
22
 
23
- public $global_scripts
24
- = array(
25
- 'external' => 'https://js.stripe.com/v3/',
26
- 'gpay' => 'https://pay.google.com/gp/p/js/pay.js'
27
- );
 
28
 
29
- public function __construct() {
 
30
  add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
31
  add_action( 'wp_print_scripts', array( $this, 'localize_scripts' ), 5 );
32
  add_action( 'wp_print_footer_scripts', array( $this, 'localize_scripts' ), 5 );
@@ -74,13 +76,19 @@ class WC_Stripe_Frontend_Scripts {
74
  }
75
 
76
  public function localize_scripts() {
 
77
  $this->localize_script( 'wc-stripe',
78
  array(
79
- 'api_key' => wc_stripe_get_publishable_key(),
80
- 'account' => wc_stripe_get_account_id(),
81
- 'page' => $this->get_page_id(),
82
- 'version' => stripe_wc()->version(),
83
- 'mode' => wc_stripe_mode()
 
 
 
 
 
84
  ),
85
  'wc_stripe_params_v3'
86
  );
20
 
21
  public $localized_data = array();
22
 
23
+ public $global_scripts = array(
24
+ 'external' => 'https://js.stripe.com/v3/',
25
+ 'gpay' => 'https://pay.google.com/gp/p/js/pay.js'
26
+ );
27
+
28
+ public $assets_api;
29
 
30
+ public function __construct( \PaymentPlugins\Stripe\Assets\AssetsApi $assets_api ) {
31
+ $this->assets_api = $assets_api;
32
  add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
33
  add_action( 'wp_print_scripts', array( $this, 'localize_scripts' ), 5 );
34
  add_action( 'wp_print_footer_scripts', array( $this, 'localize_scripts' ), 5 );
76
  }
77
 
78
  public function localize_scripts() {
79
+ $account_id = wc_stripe_get_account_id();
80
  $this->localize_script( 'wc-stripe',
81
  array(
82
+ 'api_key' => wc_stripe_get_publishable_key(),
83
+ 'account' => $account_id,
84
+ 'page' => $this->get_page_id(),
85
+ 'version' => stripe_wc()->version(),
86
+ 'mode' => wc_stripe_mode(),
87
+ 'stripeParams' => array(
88
+ 'stripeAccount' => $account_id,
89
+ 'apiVersion' => '2020-08-27',
90
+ 'betas' => array()
91
+ )
92
  ),
93
  'wc_stripe_params_v3'
94
  );
includes/class-wc-stripe-gateway.php CHANGED
@@ -83,17 +83,21 @@ class WC_Stripe_Gateway {
83
  */
84
  private $client = null;
85
 
86
- public function __construct( $mode = null, $secret_key = null ) {
87
  if ( null != $mode ) {
88
  $this->mode = $mode;
89
  }
90
  if ( null != $secret_key ) {
91
  $this->secret_key = $secret_key;
92
  }
93
- $this->client = new \Stripe\StripeClient( array( 'stripe_version' => '2020-08-27' ) );
94
  self::init();
95
  }
96
 
 
 
 
 
97
  public static function init() {
98
  \Stripe\Stripe::setAppInfo( 'WordPress woo-stripe-payment', stripe_wc()->version(), 'https://wordpress.org/plugins/woo-stripe-payment/', 'pp_partner_FdPtriN2Q7JLOe' );
99
  }
@@ -110,10 +114,10 @@ class WC_Stripe_Gateway {
110
  * @since 3.1.0
111
  * @return WC_Stripe_Gateway
112
  */
113
- public static function load( $mode = null, $secret_key = null ) {
114
  $class = apply_filters( 'wc_stripe_gateway_class', 'WC_Stripe_Gateway' );
115
 
116
- return new $class( $mode, $secret_key );
117
  }
118
 
119
  /**
83
  */
84
  private $client = null;
85
 
86
+ public function __construct( $mode = null, $secret_key = null, $config = array() ) {
87
  if ( null != $mode ) {
88
  $this->mode = $mode;
89
  }
90
  if ( null != $secret_key ) {
91
  $this->secret_key = $secret_key;
92
  }
93
+ $this->client = new \Stripe\StripeClient( array_merge( $this->get_client_config(), $config ) );
94
  self::init();
95
  }
96
 
97
+ protected function get_client_config() {
98
+ return apply_filters( 'wc_stripe_client_config_params', array( 'stripe_version' => '2020-08-27' ), $this );
99
+ }
100
+
101
  public static function init() {
102
  \Stripe\Stripe::setAppInfo( 'WordPress woo-stripe-payment', stripe_wc()->version(), 'https://wordpress.org/plugins/woo-stripe-payment/', 'pp_partner_FdPtriN2Q7JLOe' );
103
  }
114
  * @since 3.1.0
115
  * @return WC_Stripe_Gateway
116
  */
117
+ public static function load( $mode = null, $secret_key = null, $config = array() ) {
118
  $class = apply_filters( 'wc_stripe_gateway_class', 'WC_Stripe_Gateway' );
119
 
120
+ return new $class( $mode, $secret_key, $config );
121
  }
122
 
123
  /**
includes/class-wc-stripe-install.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  defined( 'ABSPATH' ) || exit();
3
 
4
  /**
@@ -9,12 +10,16 @@ defined( 'ABSPATH' ) || exit();
9
  class WC_Stripe_Install {
10
 
11
  public static function init() {
 
12
  add_filter( 'plugin_action_links_' . WC_STRIPE_PLUGIN_NAME, array( __CLASS__, 'plugin_action_links' ) );
13
  register_activation_hook( WC_STRIPE_PLUGIN_NAME, array( __CLASS__, 'install' ) );
14
  }
15
 
16
  public static function install() {
17
- update_option( 'stripe_wc_version', stripe_wc()->version() );
 
 
 
18
 
19
  /**
20
  * Schedule required actions. Actions are scheduled during install as they only need to be setup
@@ -23,6 +28,13 @@ class WC_Stripe_Install {
23
  stripe_wc()->scheduled_actions();
24
  }
25
 
 
 
 
 
 
 
 
26
  /**
27
  *
28
  * @param array $links
@@ -35,6 +47,7 @@ class WC_Stripe_Install {
35
 
36
  return array_merge( $action_links, $links );
37
  }
 
38
  }
39
 
40
  WC_Stripe_Install::init();
1
  <?php
2
+
3
  defined( 'ABSPATH' ) || exit();
4
 
5
  /**
10
  class WC_Stripe_Install {
11
 
12
  public static function init() {
13
+ add_action( 'admin_init', array( __CLASS__, 'initialize' ) );
14
  add_filter( 'plugin_action_links_' . WC_STRIPE_PLUGIN_NAME, array( __CLASS__, 'plugin_action_links' ) );
15
  register_activation_hook( WC_STRIPE_PLUGIN_NAME, array( __CLASS__, 'install' ) );
16
  }
17
 
18
  public static function install() {
19
+ if ( ! get_option( WC_Stripe_Constants::VERSION_KEY, false ) ) {
20
+ update_option( WC_Stripe_Constants::INITIAL_INSTALL, 'yes' );
21
+ }
22
+ update_option( WC_Stripe_Constants::VERSION_KEY, stripe_wc()->version() );
23
 
24
  /**
25
  * Schedule required actions. Actions are scheduled during install as they only need to be setup
28
  stripe_wc()->scheduled_actions();
29
  }
30
 
31
+ public static function initialize() {
32
+ if ( get_option( WC_Stripe_Constants::INITIAL_INSTALL, null ) === 'yes' ) {
33
+ delete_option( WC_Stripe_Constants::INITIAL_INSTALL );
34
+ wp_safe_redirect( admin_url( 'admin.php?page=wc-stripe-main' ) );
35
+ }
36
+ }
37
+
38
  /**
39
  *
40
  * @param array $links
47
 
48
  return array_merge( $action_links, $links );
49
  }
50
+
51
  }
52
 
53
  WC_Stripe_Install::init();
includes/class-wc-stripe-payment-intent.php CHANGED
@@ -13,6 +13,10 @@ require_once( WC_STRIPE_PLUGIN_FILE_PATH . 'includes/abstract/abstract-wc-stripe
13
  */
14
  class WC_Stripe_Payment_Intent extends WC_Stripe_Payment {
15
 
 
 
 
 
16
  /**
17
  *
18
  * {@inheritDoc}
@@ -22,29 +26,33 @@ class WC_Stripe_Payment_Intent extends WC_Stripe_Payment {
22
  public function process_payment( $order ) {
23
  // first check to see if a payment intent can be used
24
  if ( ( $intent = $this->can_use_payment_intent( $order ) ) ) {
25
- $intent_id = $intent['id'];
26
  if ( $this->can_update_payment_intent( $order, $intent ) ) {
27
- $intent = $this->gateway->paymentIntents->update( $intent_id, $this->get_payment_intent_args( $order, false ) );
28
- } else {
29
- $intent = $this->gateway->paymentIntents->retrieve( $intent_id, apply_filters( 'wc_stripe_payment_intent_retrieve_args', null, $order, $intent_id ) );
30
  }
31
  } else {
32
  $intent = $this->gateway->paymentIntents->create( $this->get_payment_intent_args( $order ) );
33
  }
34
 
35
  if ( is_wp_error( $intent ) ) {
36
- $this->add_payment_failed_note( $order, $intent );
 
 
 
37
 
38
- return $intent;
 
39
  }
40
 
 
 
 
41
  // always update the order with the payment intent.
42
  $order->update_meta_data( WC_Stripe_Constants::PAYMENT_INTENT_ID, $intent->id );
43
  $order->update_meta_data( WC_Stripe_Constants::PAYMENT_METHOD_TOKEN, $intent->payment_method );
44
  $order->update_meta_data( WC_Stripe_Constants::MODE, wc_stripe_mode() );
45
  // serialize the intent and save to the order. The intent will be used to analyze if anything
46
  // has changed.
47
- $order->update_meta_data( WC_Stripe_Constants::PAYMENT_INTENT, WC_Stripe_Utils::sanitize_intent( $intent->jsonSerialize() ) );
48
  $order->save();
49
 
50
  if ( $intent->status === 'requires_confirmation' ) {
@@ -53,6 +61,7 @@ class WC_Stripe_Payment_Intent extends WC_Stripe_Payment {
53
  apply_filters( 'wc_stripe_payment_intent_confirmation_args', $this->payment_method->get_payment_intent_confirmation_args( $intent, $order ), $intent, $order )
54
  );
55
  if ( is_wp_error( $intent ) ) {
 
56
  $this->add_payment_failed_note( $order, $intent );
57
 
58
  return $intent;
@@ -67,7 +76,8 @@ class WC_Stripe_Payment_Intent extends WC_Stripe_Payment {
67
  }
68
  // remove metadata that's no longer needed
69
  $order->delete_meta_data( WC_Stripe_Constants::PAYMENT_INTENT );
70
- unset( WC()->session->{WC_Stripe_Constants::PAYMENT_INTENT} );
 
71
 
72
  return (object) array(
73
  'complete_payment' => true,
@@ -75,6 +85,7 @@ class WC_Stripe_Payment_Intent extends WC_Stripe_Payment {
75
  );
76
  }
77
  if ( $intent->status === 'processing' ) {
 
78
  $order->update_status( 'on-hold' );
79
  $this->payment_method->save_order_meta( $order, $intent->charges->data[0] );
80
 
@@ -180,49 +191,65 @@ class WC_Stripe_Payment_Intent extends WC_Stripe_Payment {
180
  * @param WC_Order $order
181
  */
182
  public function can_update_payment_intent( $order, $intent = null ) {
183
- if ( ! is_checkout() || defined( WC_Stripe_Constants::REDIRECT_HANDLER ) || defined( WC_Stripe_Constants::PROCESSING_PAYMENT ) ) {
184
- return false;
185
- }
186
- $intent = ! $intent ? $order->get_meta( WC_Stripe_Constants::PAYMENT_INTENT ) : $intent;
187
- if ( $intent ) {
188
- $order_hash = implode(
189
- '_',
190
- array(
191
- wc_stripe_add_number_precision( $order->get_total(), $order->get_currency() ),
192
- wc_stripe_get_customer_id( $order->get_user_id() ),
193
- $this->payment_method->get_payment_method_from_request(),
194
- $this->payment_method->get_payment_method_type(),
195
- )
196
- );
197
- $intent_hash = implode(
198
- '_',
199
- array(
200
- $intent['amount'],
201
- $intent['customer'],
202
- $intent['payment_method'],
203
- isset( $intent['payment_method_types'] ) ? $intent['payment_method_types'][0] : '',
204
- )
205
- );
206
-
207
- return apply_filters( 'wc_stripe_can_update_payment_intent', $order_hash !== $intent_hash, $intent, $order );
 
 
 
208
  }
209
 
210
- return false;
211
  }
212
 
213
  /**
214
  *
215
  * @param WC_Order $order
216
  */
217
- public function get_payment_intent_args( $order, $new = true ) {
218
  $this->add_general_order_args( $args, $order );
219
 
 
 
 
 
220
  if ( $new ) {
221
  $args['confirmation_method'] = $this->payment_method->get_confirmation_method( $order );
222
- $args['capture_method'] = $this->payment_method->get_option( 'charge_type' ) === 'capture' ? 'automatic' : 'manual';
223
  $args['confirm'] = false;
224
- if ( ( $statement_descriptor = stripe_wc()->advanced_settings->get_option( 'statement_descriptor' ) ) ) {
225
- $args['statement_descriptor'] = WC_Stripe_Utils::sanitize_statement_descriptor( $statement_descriptor );
 
 
 
 
 
 
 
 
 
 
226
  }
227
  }
228
 
@@ -330,13 +357,24 @@ class WC_Stripe_Payment_Intent extends WC_Stripe_Payment {
330
  * @param WC_Order $order
331
  */
332
  public function can_use_payment_intent( $order ) {
333
- $intent = $order->get_meta( WC_Stripe_Constants::PAYMENT_INTENT );
334
-
335
- if ( $intent ) {
336
- if ( $intent['confirmation_method'] != $this->payment_method->get_confirmation_method( $order ) ) {
337
- $intent = false;
338
  }
339
- if ( ! empty( $intent['payment_method_types'] ) && ! in_array( $this->payment_method->get_payment_method_type(), $intent['payment_method_types'] ) ) {
 
 
 
 
 
 
 
 
 
 
 
340
  $intent = false;
341
  }
342
 
@@ -346,7 +384,7 @@ class WC_Stripe_Payment_Intent extends WC_Stripe_Payment {
346
  $intent = false;
347
  }
348
  } else {
349
- $intent = WC()->session->get( WC_Stripe_Constants::PAYMENT_INTENT );
350
  }
351
 
352
  return $intent;
@@ -362,4 +400,56 @@ class WC_Stripe_Payment_Intent extends WC_Stripe_Payment {
362
  return $order->get_meta( WC_Stripe_Constants::PAYMENT_INTENT_ID );
363
  }
364
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
365
  }
13
  */
14
  class WC_Stripe_Payment_Intent extends WC_Stripe_Payment {
15
 
16
+ private $update_payment_intent = false;
17
+
18
+ private $retry_count = 0;
19
+
20
  /**
21
  *
22
  * {@inheritDoc}
26
  public function process_payment( $order ) {
27
  // first check to see if a payment intent can be used
28
  if ( ( $intent = $this->can_use_payment_intent( $order ) ) ) {
 
29
  if ( $this->can_update_payment_intent( $order, $intent ) ) {
30
+ $intent = $this->gateway->paymentIntents->update( $intent['id'], $this->get_payment_intent_args( $order, false, $intent ) );
 
 
31
  }
32
  } else {
33
  $intent = $this->gateway->paymentIntents->create( $this->get_payment_intent_args( $order ) );
34
  }
35
 
36
  if ( is_wp_error( $intent ) ) {
37
+ if ( $this->should_retry_payment( $intent, $order ) ) {
38
+ return $this->process_payment( $order );
39
+ } else {
40
+ $this->add_payment_failed_note( $order, $intent );
41
 
42
+ return $intent;
43
+ }
44
  }
45
 
46
+ if ( $this->payment_method->get_confirmation_method( $order ) === WC_Stripe_Constants::AUTOMATIC ) {
47
+ WC_Stripe_Utils::save_payment_intent_to_session( $intent );
48
+ }
49
  // always update the order with the payment intent.
50
  $order->update_meta_data( WC_Stripe_Constants::PAYMENT_INTENT_ID, $intent->id );
51
  $order->update_meta_data( WC_Stripe_Constants::PAYMENT_METHOD_TOKEN, $intent->payment_method );
52
  $order->update_meta_data( WC_Stripe_Constants::MODE, wc_stripe_mode() );
53
  // serialize the intent and save to the order. The intent will be used to analyze if anything
54
  // has changed.
55
+ $order->update_meta_data( WC_Stripe_Constants::PAYMENT_INTENT, WC_Stripe_Utils::sanitize_intent( $intent->toArray() ) );
56
  $order->save();
57
 
58
  if ( $intent->status === 'requires_confirmation' ) {
61
  apply_filters( 'wc_stripe_payment_intent_confirmation_args', $this->payment_method->get_payment_intent_confirmation_args( $intent, $order ), $intent, $order )
62
  );
63
  if ( is_wp_error( $intent ) ) {
64
+ $this->post_payment_process_error_handling( $intent, $order );
65
  $this->add_payment_failed_note( $order, $intent );
66
 
67
  return $intent;
76
  }
77
  // remove metadata that's no longer needed
78
  $order->delete_meta_data( WC_Stripe_Constants::PAYMENT_INTENT );
79
+
80
+ $this->destroy_session_data();
81
 
82
  return (object) array(
83
  'complete_payment' => true,
85
  );
86
  }
87
  if ( $intent->status === 'processing' ) {
88
+ $this->destroy_session_data();
89
  $order->update_status( 'on-hold' );
90
  $this->payment_method->save_order_meta( $order, $intent->charges->data[0] );
91
 
191
  * @param WC_Order $order
192
  */
193
  public function can_update_payment_intent( $order, $intent = null ) {
194
+ $result = true;
195
+ if ( ! $this->update_payment_intent && ( defined( WC_Stripe_Constants::WOOCOMMERCE_STRIPE_ORDER_PAY ) || ! is_checkout() || defined( WC_Stripe_Constants::REDIRECT_HANDLER ) || defined( WC_Stripe_Constants::PROCESSING_PAYMENT ) ) ) {
196
+ $result = false;
197
+ } else {
198
+ $intent = ! $intent ? $order->get_meta( WC_Stripe_Constants::PAYMENT_INTENT ) : $intent;
199
+ if ( $intent ) {
200
+ $order_hash = implode(
201
+ '_',
202
+ array(
203
+ wc_stripe_add_number_precision( $order->get_total(), $order->get_currency() ),
204
+ strtolower( $order->get_currency() ),
205
+ $this->get_payment_method_charge_type(),
206
+ wc_stripe_get_customer_id( $order->get_user_id() ),
207
+ $this->payment_method->get_payment_method_from_request()
208
+ )
209
+ );
210
+ $intent_hash = implode(
211
+ '_',
212
+ array(
213
+ $intent['amount'],
214
+ $intent['currency'],
215
+ $intent['capture_method'],
216
+ $intent['customer'],
217
+ isset( $intent['payment_method']['id'] ) ? $intent['payment_method']['id'] : ''
218
+ )
219
+ );
220
+ $result = $order_hash !== $intent_hash || ! in_array( $this->payment_method->get_payment_method_type(), $intent['payment_method_types'] );
221
+ }
222
  }
223
 
224
+ return apply_filters( 'wc_stripe_can_update_payment_intent', $result, $intent, $order );;
225
  }
226
 
227
  /**
228
  *
229
  * @param WC_Order $order
230
  */
231
+ public function get_payment_intent_args( $order, $new = true, $intent = null ) {
232
  $this->add_general_order_args( $args, $order );
233
 
234
+ $args['capture_method'] = $this->get_payment_method_charge_type();
235
+ if ( ( $statement_descriptor = stripe_wc()->advanced_settings->get_option( 'statement_descriptor' ) ) ) {
236
+ $args['statement_descriptor'] = WC_Stripe_Utils::sanitize_statement_descriptor( $statement_descriptor );
237
+ }
238
  if ( $new ) {
239
  $args['confirmation_method'] = $this->payment_method->get_confirmation_method( $order );
 
240
  $args['confirm'] = false;
241
+ } else {
242
+ if ( ! $this->payment_method->id === 'stripe_cc' || $this->payment_method->get_confirmation_method() !== WC_Stripe_Constants::AUTOMATIC ) {
243
+ // have to add a validation since capture_method is only allowed for gated accounts and in test mode
244
+ // you must request to be gated in.
245
+ unset( $args['capture_method'] );
246
+ }
247
+ if ( isset( $intent['payment_method']['type'] ) && $intent['payment_method']['type'] === 'link' ) {
248
+ /**
249
+ * Unset the payment method so it's not updated by Stripe. We don't want to update the payment method
250
+ * if it exists because it already contains the Link mandate.
251
+ */
252
+ unset( $args['payment_method'] );
253
  }
254
  }
255
 
357
  * @param WC_Order $order
358
  */
359
  public function can_use_payment_intent( $order ) {
360
+ $intent = $order->get_meta( WC_Stripe_Constants::PAYMENT_INTENT );
361
+ $session_intent = (array) WC_Stripe_Utils::get_payment_intent_from_session();
362
+ if ( $session_intent ) {
363
+ if ( ! $intent || $session_intent['id'] !== $intent['id'] ) {
364
+ $intent = $session_intent;
365
  }
366
+ }
367
+ $intent = $intent ? $this->gateway->paymentIntents->retrieve( $intent['id'], apply_filters( 'wc_stripe_payment_intent_retrieve_args', array( 'expand' => array( 'payment_method' ) ), $order, $intent['id'] ) ) : false;
368
+ if ( $intent && ! is_wp_error( $intent ) ) {
369
+ if ( \in_array( $intent->status, array( 'succeeded', 'requires_capture' ) ) && ! defined( WC_Stripe_Constants::REDIRECT_HANDLER ) ) {
370
+ /**
371
+ * If the status is succeeded, and the order ID on the intent doesn't match this checkout's order ID, we know this is
372
+ * a previously processed intent and so should not be used.
373
+ */
374
+ if ( isset( $intent->metadata['order_id'] ) && $intent->metadata['order_id'] != $order->get_id() ) {
375
+ $intent = false;
376
+ }
377
+ } elseif ( $intent['confirmation_method'] != $this->payment_method->get_confirmation_method( $order ) ) {
378
  $intent = false;
379
  }
380
 
384
  $intent = false;
385
  }
386
  } else {
387
+ $intent = false;
388
  }
389
 
390
  return $intent;
400
  return $order->get_meta( WC_Stripe_Constants::PAYMENT_INTENT_ID );
401
  }
402
 
403
+ public function set_update_payment_intent( $bool ) {
404
+ $this->update_payment_intent = $bool;
405
+ }
406
+
407
+ public function destroy_session_data() {
408
+ WC_Stripe_Utils::delete_payment_intent_to_session();
409
+ }
410
+
411
+ /**
412
+ * @param \WP_Error $error
413
+ * @param \WC_Order $order
414
+ */
415
+ public function should_retry_payment( $error, $order ) {
416
+ $result = false;
417
+ $data = $error->get_error_data();
418
+ $delete_data = function () use ( $order ) {
419
+ WC_Stripe_Utils::delete_payment_intent_to_session();
420
+ $order->delete_meta_data( WC_Stripe_Constants::PAYMENT_INTENT );
421
+ };
422
+ if ( $this->retry_count < 1 ) {
423
+ if ( $data && isset( $data['payment_intent'] ) ) {
424
+ if ( isset( $data['payment_intent']['status'] ) ) {
425
+ $result = in_array( $data['payment_intent']['status'], array( 'succeeded', 'requires_capture' ), true );
426
+ if ( $result ) {
427
+ $delete_data();
428
+ }
429
+ }
430
+ } elseif ( isset( $data['code'] ) ) {
431
+ if ( $data['code'] === 'resource_missing' ) {
432
+ $delete_data();
433
+ $result = true;
434
+ }
435
+ }
436
+ if ( $result ) {
437
+ $this->retry_count += 1;
438
+ }
439
+ }
440
+
441
+ return $result;
442
+ }
443
+
444
+ /**
445
+ * @param \WP_Error $error
446
+ * @param \WC_Order $order
447
+ */
448
+ public function post_payment_process_error_handling( $error, $order ) {
449
+ $data = $error->get_error_data();
450
+ if ( isset( $data['payment_intent'] ) ) {
451
+ WC_Stripe_Utils::save_payment_intent_to_session( $data['payment_intent'], $order );
452
+ }
453
+ }
454
+
455
  }
includes/class-wc-stripe-rest-api.php CHANGED
@@ -17,6 +17,7 @@ defined( 'ABSPATH' ) || exit();
17
  * @property WC_Stripe_Rest_Controller $plaid
18
  * @property WC_Stripe_Rest_Controller $source
19
  * @property \WC_Stripe_Rest_Controller $signup
 
20
  */
21
  class WC_Stripe_Rest_API {
22
 
@@ -68,6 +69,7 @@ class WC_Stripe_Rest_API {
68
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/controllers/class-wc-stripe-controller-plaid.php';
69
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/controllers/class-wc-stripe-controller-source.php';
70
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/controllers/class-wc-stripe-controller-signup.php';
 
71
 
72
  foreach ( $this->get_controllers() as $key => $class_name ) {
73
  if ( class_exists( $class_name ) ) {
@@ -99,7 +101,8 @@ class WC_Stripe_Rest_API {
99
  'product_data' => 'WC_Stripe_Controller_Product_Data',
100
  'plaid' => 'WC_Stripe_Controller_Plaid',
101
  'source' => 'WC_Stripe_Controller_Source',
102
- 'signup' => 'WC_Stripe_Controller_SignUp'
 
103
  );
104
 
105
  /**
17
  * @property WC_Stripe_Rest_Controller $plaid
18
  * @property WC_Stripe_Rest_Controller $source
19
  * @property \WC_Stripe_Rest_Controller $signup
20
+ * @property \WC_Stripe_Rest_Controller $feedback
21
  */
22
  class WC_Stripe_Rest_API {
23
 
69
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/controllers/class-wc-stripe-controller-plaid.php';
70
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/controllers/class-wc-stripe-controller-source.php';
71
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/controllers/class-wc-stripe-controller-signup.php';
72
+ include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/controllers/class-wc-stripe-controller-feedback.php';
73
 
74
  foreach ( $this->get_controllers() as $key => $class_name ) {
75
  if ( class_exists( $class_name ) ) {
101
  'product_data' => 'WC_Stripe_Controller_Product_Data',
102
  'plaid' => 'WC_Stripe_Controller_Plaid',
103
  'source' => 'WC_Stripe_Controller_Source',
104
+ 'signup' => 'WC_Stripe_Controller_SignUp',
105
+ 'feedback' => 'WC_Stripe_Controller_Feedback'
106
  );
107
 
108
  /**
includes/class-wc-stripe-update.php CHANGED
@@ -4,7 +4,7 @@ defined( 'ABSPATH' ) || exit();
4
 
5
  /**
6
  *
7
- * @author PaymentPlugins
8
  * @package Stripe/Classes
9
  *
10
  */
@@ -12,15 +12,16 @@ class WC_Stripe_Update {
12
 
13
  private static $updates
14
  = array(
15
- '3.0.7' => 'update-3.0.7.php',
16
- '3.1.0' => 'update-3.1.0.php',
17
- '3.1.1' => 'update-3.1.1.php',
18
- '3.1.6' => 'update-3.1.6.php',
19
- '3.1.7' => 'update-3.1.7.php',
20
- '3.2.8' => 'update-3.2.8.php',
21
  '3.3.13' => 'update-3.3.13.php',
22
  '3.3.14' => 'update-3.3.14.php',
23
- '3.3.19' => 'update-3.3.19.php'
 
24
  );
25
 
26
  public static function init() {
@@ -32,7 +33,7 @@ class WC_Stripe_Update {
32
  */
33
  public static function update() {
34
  // if option is not set, make the default version 3.0.6.
35
- $current_version = get_option( 'stripe_wc_version', '3.0.6' );
36
 
37
  // if database version is less than plugin version, an update might be required.
38
  if ( version_compare( $current_version, stripe_wc()->version(), '<' ) ) {
@@ -46,7 +47,7 @@ class WC_Stripe_Update {
46
  include $file;
47
  }
48
  $current_version = $version;
49
- update_option( 'stripe_wc_version', $current_version );
50
  add_action(
51
  'admin_notices',
52
  function () use ( $current_version ) {
@@ -60,7 +61,7 @@ class WC_Stripe_Update {
60
  }
61
  }
62
  // save latest version.
63
- update_option( 'stripe_wc_version', stripe_wc()->version() );
64
  }
65
  }
66
 
4
 
5
  /**
6
  *
7
+ * @author PaymentPlugins
8
  * @package Stripe/Classes
9
  *
10
  */
12
 
13
  private static $updates
14
  = array(
15
+ '3.0.7' => 'update-3.0.7.php',
16
+ '3.1.0' => 'update-3.1.0.php',
17
+ '3.1.1' => 'update-3.1.1.php',
18
+ '3.1.6' => 'update-3.1.6.php',
19
+ '3.1.7' => 'update-3.1.7.php',
20
+ '3.2.8' => 'update-3.2.8.php',
21
  '3.3.13' => 'update-3.3.13.php',
22
  '3.3.14' => 'update-3.3.14.php',
23
+ '3.3.19' => 'update-3.3.19.php',
24
+ '3.3.20' => 'update-3.3.20.php'
25
  );
26
 
27
  public static function init() {
33
  */
34
  public static function update() {
35
  // if option is not set, make the default version 3.0.6.
36
+ $current_version = get_option( WC_Stripe_Constants::VERSION_KEY, '3.0.6' );
37
 
38
  // if database version is less than plugin version, an update might be required.
39
  if ( version_compare( $current_version, stripe_wc()->version(), '<' ) ) {
47
  include $file;
48
  }
49
  $current_version = $version;
50
+ update_option( WC_Stripe_Constants::VERSION_KEY, $current_version );
51
  add_action(
52
  'admin_notices',
53
  function () use ( $current_version ) {
61
  }
62
  }
63
  // save latest version.
64
+ update_option( WC_Stripe_Constants::VERSION_KEY, stripe_wc()->version() );
65
  }
66
  }
67
 
includes/class-wc-stripe-utils.php CHANGED
@@ -121,9 +121,118 @@ class WC_Stripe_Utils {
121
  * @param \Stripe\PaymentIntent|\Stripe\SetupIntent $intent
122
  */
123
  public static function sanitize_intent( $intent ) {
124
- unset( $intent->client_secret );
125
-
126
  return $intent;
127
  }
128
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  }
121
  * @param \Stripe\PaymentIntent|\Stripe\SetupIntent $intent
122
  */
123
  public static function sanitize_intent( $intent ) {
 
 
124
  return $intent;
125
  }
126
 
127
+ public static function get_payment_intent_from_session() {
128
+ $session = WC()->session;
129
+ $payment_intent = null;
130
+ if ( $session ) {
131
+ $payment_intent = WC()->session->get( \WC_Stripe_Constants::PAYMENT_INTENT, null );
132
+ if ( $payment_intent ) {
133
+ $payment_intent = (object) $payment_intent;
134
+ }
135
+ }
136
+
137
+ return $payment_intent;
138
+ }
139
+
140
+ public static function save_payment_intent_to_session( $payment_intent, $order = null ) {
141
+ if ( WC()->session ) {
142
+ $data = \is_array( $payment_intent ) ? $payment_intent : $payment_intent->toArray();
143
+ WC()->session->set( \WC_Stripe_Constants::PAYMENT_INTENT, $data );
144
+ $order_id = WC()->session->get( 'order_awaiting_payment', null );
145
+ if ( $order || $order_id ) {
146
+ $order = ! $order ? wc_get_order( absint( $order_id ) ) : $order;
147
+ if ( $order ) {
148
+ $order->update_meta_data( \WC_Stripe_Constants::PAYMENT_INTENT, $data );
149
+ $order->save();
150
+ }
151
+ }
152
+ }
153
+ }
154
+
155
+ public static function delete_payment_intent_to_session() {
156
+ if ( WC()->session ) {
157
+ unset( WC()->session->{\WC_Stripe_Constants::PAYMENT_INTENT} );
158
+ }
159
+ }
160
+
161
+ public static function redirect_url_has_hash( $url ) {
162
+ return preg_match( '/^#response=(.*)/', $url );
163
+ }
164
+
165
+ public static function parse_url_hash( $url ) {
166
+ preg_match( '/^#response=(.*)/', $url, $matches );
167
+
168
+ return json_decode( base64_decode( rawurldecode( $matches[1] ) ) );
169
+ }
170
+
171
+ public static function is_setup_intent( $intent ) {
172
+ return self::is_intent_type( 'seti_', $intent );
173
+ }
174
+
175
+ public static function is_payment_intent( $intent ) {
176
+ return self::is_intent_type( 'pi_', $intent );
177
+ }
178
+
179
+ private static function is_intent_type( $prefix, $intent ) {
180
+ if ( ! $intent ) {
181
+ return false;
182
+ }
183
+ if ( is_object( $intent ) && isset( $intent->id ) ) {
184
+ return strpos( $intent->id, $prefix ) !== false;
185
+ } elseif ( is_array( $intent ) && isset( $intent['id'] ) ) {
186
+ return strpos( $intent['id'], $prefix ) !== false;
187
+ }
188
+
189
+ return false;
190
+ }
191
+
192
+ public static function is_intent_mode_equal( $intent, $mode = null ) {
193
+ if ( $intent ) {
194
+ $intent = (object) $intent;
195
+ $mode = ! $mode ? wc_stripe_mode() : $mode;
196
+ if ( $mode === WC_Stripe_Constants::TEST ) {
197
+ return ! $intent->livemode;
198
+ }
199
+
200
+ return $intent->livemode;
201
+ }
202
+
203
+ return false;
204
+ }
205
+
206
+ public static function validate_account_access( $betas = array(), $mode = 'test' ) {
207
+ $betas = array_merge( array( '2020-08-27' ), $betas );
208
+ $result = wp_remote_post(
209
+ 'https://api.stripe.com/v1/payment_methods',
210
+ array(
211
+ 'headers' => array( 'Content-Type' => 'application/x-www-form-urlencoded' ),
212
+ 'body' => array(
213
+ 'key' => wc_stripe_get_publishable_key( $mode ),
214
+ '_stripe_version' => sprintf( implode( ';', array_fill( 0, count( $betas ), '%s' ) ), ...$betas ),
215
+ 'type' => 'card',
216
+ 'card' => array(
217
+ 'number' => '4242424242424242',
218
+ 'exp_month' => 12,
219
+ 'exp_year' => 2030,
220
+ 'cvc' => 314
221
+ ),
222
+ 'metadata' => array(
223
+ 'origin' => 'API Settings connection test'
224
+ )
225
+ ),
226
+ )
227
+ );
228
+ if ( ! is_wp_error( $result ) ) {
229
+ $body = json_decode( wp_remote_retrieve_body( $result ), true );
230
+ if ( isset( $body['error']['message'] ) && strpos( $body['error']['message'], 'server_side_confirmation_beta=v1' ) !== false ) {
231
+ return false;
232
+ }
233
+ }
234
+
235
+ return true;
236
+ }
237
+
238
  }
includes/controllers/class-wc-stripe-controller-cart.php CHANGED
@@ -249,8 +249,8 @@ class WC_Stripe_Controller_Cart extends WC_Stripe_Rest_Controller {
249
  array(
250
  'data' => $gateway->add_to_cart_response(
251
  array(
252
- 'total' => round( WC()->cart->total, 2 ),
253
- 'subtotal' => round( WC()->cart->subtotal, 2 ),
254
  'totalCents' => wc_stripe_add_number_precision( WC()->cart->total ),
255
  'displayItems' => $gateway->get_display_items( 'cart' ),
256
  'shippingOptions' => $gateway->get_formatted_shipping_methods(),
249
  array(
250
  'data' => $gateway->add_to_cart_response(
251
  array(
252
+ 'total' => wc_format_decimal( WC()->cart->total, 2 ),
253
+ 'subtotal' => wc_format_decimal( WC()->cart->subtotal, 2 ),
254
  'totalCents' => wc_stripe_add_number_precision( WC()->cart->total ),
255
  'displayItems' => $gateway->get_display_items( 'cart' ),
256
  'shippingOptions' => $gateway->get_formatted_shipping_methods(),
includes/controllers/class-wc-stripe-controller-checkout.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  defined( 'ABSPATH' ) || exit();
3
 
4
  if ( ! class_exists( 'WC_Stripe_Rest_Controller' ) ) {
@@ -7,8 +8,8 @@ if ( ! class_exists( 'WC_Stripe_Rest_Controller' ) ) {
7
 
8
  /**
9
  *
10
- * @author PaymentPlugins
11
- * @since 3.0.0
12
  * @package Stripe/Controllers
13
  */
14
  class WC_Stripe_Controller_Checkout extends WC_Stripe_Rest_Controller {
@@ -55,6 +56,11 @@ class WC_Stripe_Controller_Checkout extends WC_Stripe_Rest_Controller {
55
  'methods' => WP_REST_Server::CREATABLE,
56
  'callback' => array( $this, 'process_order_pay' ),
57
  'permission_callback' => '__return_true',
 
 
 
 
 
58
  )
59
  );
60
  }
@@ -148,10 +154,55 @@ class WC_Stripe_Controller_Checkout extends WC_Stripe_Rest_Controller {
148
  *
149
  * @param WP_REST_Request $request
150
  *
151
- * @return WP_REST_Response
152
  * @since 3.1.8
 
153
  */
154
  public function process_order_pay( $request ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
155
  global $wp;
156
  $this->frontend_includes();
157
 
@@ -225,7 +276,7 @@ class WC_Stripe_Controller_Checkout extends WC_Stripe_Rest_Controller {
225
 
226
  /**
227
  *
228
- * @param WC_Order $order
229
  * @param WC_Payment_Gateway_Stripe $gateway
230
  */
231
  public function set_stashed_cart( $order, $gateway ) {
@@ -234,7 +285,7 @@ class WC_Stripe_Controller_Checkout extends WC_Stripe_Rest_Controller {
234
 
235
  /**
236
  *
237
- * @param array $data
238
  * @param WP_Error $errors
239
  */
240
  public function after_checkout_validation( $data, $errors ) {
@@ -282,8 +333,8 @@ class WC_Stripe_Controller_Checkout extends WC_Stripe_Rest_Controller {
282
 
283
  /**
284
  *
285
- * @param int $order_id
286
- * @param array $posted_data
287
  * @param WC_Order $order
288
  */
289
  public function checkout_order_processed( $order_id, $posted_data, $order ) {
@@ -309,8 +360,8 @@ class WC_Stripe_Controller_Checkout extends WC_Stripe_Rest_Controller {
309
  /**
310
  * @param $data
311
  *
312
- * @return mixed
313
  * @since 3.2.1
 
314
  */
315
  public function filter_posted_data( $data ) {
316
  if ( isset( $data['shipping_method'], $data['shipping_country'], $data['shipping_state'] ) ) {
@@ -319,4 +370,5 @@ class WC_Stripe_Controller_Checkout extends WC_Stripe_Rest_Controller {
319
 
320
  return $data;
321
  }
 
322
  }
1
  <?php
2
+
3
  defined( 'ABSPATH' ) || exit();
4
 
5
  if ( ! class_exists( 'WC_Stripe_Rest_Controller' ) ) {
8
 
9
  /**
10
  *
11
+ * @since 3.0.0
12
+ * @author PaymentPlugins
13
  * @package Stripe/Controllers
14
  */
15
  class WC_Stripe_Controller_Checkout extends WC_Stripe_Rest_Controller {
56
  'methods' => WP_REST_Server::CREATABLE,
57
  'callback' => array( $this, 'process_order_pay' ),
58
  'permission_callback' => '__return_true',
59
+ 'args' => array(
60
+ 'order_id' => array( 'required' => true ),
61
+ 'order_key' => array( 'required' => true ),
62
+ 'payment_method' => array( 'required' => true )
63
+ )
64
  )
65
  );
66
  }
154
  *
155
  * @param WP_REST_Request $request
156
  *
 
157
  * @since 3.1.8
158
+ * @return WP_REST_Response
159
  */
160
  public function process_order_pay( $request ) {
161
+ global $wp;
162
+ /**
163
+ * @var \WC_Payment_Gateway_Stripe $payment_method
164
+ */
165
+ $payment_method = WC()->payment_gateways()->payment_gateways()[ $request['payment_method'] ];
166
+ $order_id = absint( $request['order_id'] );
167
+ $order_key = $request['order_key'];
168
+ $order = wc_get_order( $order_id );
169
+ try {
170
+ if ( ! $order || ! hash_equals( $order_key, $order->get_order_key() ) ) {
171
+ throw new Exception( __( 'You are not authorized to update this order.', 'woo-stripe-payment' ) );
172
+ }
173
+ $wp->set_query_var( 'order-pay', $order_id );
174
+ $order->set_payment_method( $payment_method->id );
175
+ $payment_method->payment_object->set_update_payment_intent( true );
176
+ $response = array( 'success' => true, 'needs_confirmation' => false );
177
+ $result = $payment_method->payment_object->process_payment( $order );
178
+ if ( is_wp_error( $result ) ) {
179
+ throw new Exception( $result->get_error_message() );
180
+ }
181
+ if ( ! $result->complete_payment ) {
182
+ if ( WC_Stripe_Utils::redirect_url_has_hash( $result->redirect ) ) {
183
+ $response['needs_confirmation'] = true;
184
+ $response['data'] = WC_Stripe_Utils::parse_url_hash( $result->redirect );
185
+ } else {
186
+ $response['redirect'] = $result->redirect;
187
+ }
188
+ }
189
+
190
+ return rest_ensure_response( $response );
191
+ } catch ( Exception $e ) {
192
+ wc_add_notice( $e->getMessage(), 'error' );
193
+
194
+ return new WP_Error( 'order-pay-error', $this->get_error_messages(), array( 'status' => 200 ) );
195
+ }
196
+ }
197
+
198
+ /**
199
+ *
200
+ * @param WP_REST_Request $request
201
+ *
202
+ * @since 3.1.8
203
+ * @return WP_REST_Response
204
+ */
205
+ public function process_local_order_pay( $request ) {
206
  global $wp;
207
  $this->frontend_includes();
208
 
276
 
277
  /**
278
  *
279
+ * @param WC_Order $order
280
  * @param WC_Payment_Gateway_Stripe $gateway
281
  */
282
  public function set_stashed_cart( $order, $gateway ) {
285
 
286
  /**
287
  *
288
+ * @param array $data
289
  * @param WP_Error $errors
290
  */
291
  public function after_checkout_validation( $data, $errors ) {
333
 
334
  /**
335
  *
336
+ * @param int $order_id
337
+ * @param array $posted_data
338
  * @param WC_Order $order
339
  */
340
  public function checkout_order_processed( $order_id, $posted_data, $order ) {
360
  /**
361
  * @param $data
362
  *
 
363
  * @since 3.2.1
364
+ * @return mixed
365
  */
366
  public function filter_posted_data( $data ) {
367
  if ( isset( $data['shipping_method'], $data['shipping_country'], $data['shipping_state'] ) ) {
370
 
371
  return $data;
372
  }
373
+
374
  }
includes/controllers/class-wc-stripe-controller-feedback.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WC_Stripe_Controller_Feedback extends WC_Stripe_Rest_Controller {
4
+
5
+ protected $namespace = 'admin';
6
+
7
+ private $api_url = 'https://crm.paymentplugins.com/v1/feedback/stripe';
8
+
9
+ public function register_routes() {
10
+ register_rest_route(
11
+ $this->rest_uri(), 'feedback', array(
12
+ 'methods' => WP_REST_Server::CREATABLE,
13
+ 'callback' => array( $this, 'process_request' ),
14
+ 'permission_callback' => array( $this, 'admin_permission_check' )
15
+ )
16
+ );
17
+ }
18
+
19
+ /**
20
+ * @param $request \WP_REST_Request
21
+ */
22
+ public function process_request( $request ) {
23
+ $reason_code = $request['reason_code'];
24
+ $reason_text = isset( $request['reason_text'] ) ? $request['reason_text'] : '';
25
+ $website = site_url();
26
+ $data = compact( 'website', 'reason_code', 'reason_text' );
27
+ $account_id = stripe_wc()->account_settings->get_account_id();
28
+ $account_id = ! $account_id ? stripe_wc()->account_settings->get_account_id( 'test' ) : $account_id;
29
+ if ( $account_id ) {
30
+ $data['account_id'] = $account_id;
31
+ }
32
+ $result = wp_safe_remote_post( $this->api_url, [
33
+ 'method' => 'POST',
34
+ 'timeout' => 30,
35
+ 'httpversion' => 1,
36
+ 'blocking' => true,
37
+ 'headers' => [
38
+ 'Content-Type' => 'application/json'
39
+ ],
40
+ 'body' => wp_json_encode( $data ),
41
+ 'cookies' => []
42
+ ] );
43
+ if ( is_wp_error( $result ) ) {
44
+ return new \WP_Error( 'feedback-error', $result->get_error_message(), array( 'status' => 200 ) );
45
+ }
46
+ if ( wp_remote_retrieve_response_code( $result ) > 299 ) {
47
+ $body = json_decode( wp_remote_retrieve_body( $result ), true );
48
+
49
+ return new \WP_Error( 'feedback-error', $body['message'], array( 'status' => 200 ) );
50
+ }
51
+
52
+ return rest_ensure_response( [ 'success' => true ] );
53
+ }
54
+
55
+ }
includes/controllers/class-wc-stripe-controller-gateway-settings.php CHANGED
@@ -39,6 +39,13 @@ class WC_Stripe_Controller_Gateway_Settings extends WC_Stripe_Rest_Controller {
39
  'permission_callback' => array( $this, 'shop_manager_permission_check' )
40
  )
41
  );
 
 
 
 
 
 
 
42
  }
43
 
44
  /**
@@ -281,6 +288,16 @@ class WC_Stripe_Controller_Gateway_Settings extends WC_Stripe_Rest_Controller {
281
  ) );
282
  }
283
 
 
 
 
 
 
 
 
 
 
 
284
  public function shop_manager_permission_check() {
285
  if ( current_user_can( 'manage_woocommerce' ) ) {
286
  return true;
39
  'permission_callback' => array( $this, 'shop_manager_permission_check' )
40
  )
41
  );
42
+ register_rest_route( $this->rest_uri(), 'delete-connection',
43
+ array(
44
+ 'methods' => WP_REST_Server::CREATABLE,
45
+ 'callback' => array( $this, 'delete_connection' ),
46
+ 'permission_callback' => array( $this, 'shop_manager_permission_check' )
47
+ )
48
+ );
49
  }
50
 
51
  /**
288
  ) );
289
  }
290
 
291
+ /**
292
+ * @param \WP_REST_Request $request
293
+ */
294
+ public function delete_connection( $request ) {
295
+ stripe_wc()->api_settings->delete_account_settings();
296
+ stripe_wc()->account_settings->delete_account_settings();
297
+
298
+ return rest_ensure_response( array( 'success', true ) );
299
+ }
300
+
301
  public function shop_manager_permission_check() {
302
  if ( current_user_can( 'manage_woocommerce' ) ) {
303
  return true;
includes/controllers/class-wc-stripe-controller-payment-intent.php CHANGED
@@ -129,11 +129,11 @@ class WC_Stripe_Controller_Payment_Intent extends WC_Stripe_Rest_Controller {
129
  */
130
  public function create_payment_intent_from_cart( $request ) {
131
  try {
132
- $payment_intent = WC()->session->get( WC_Stripe_Constants::PAYMENT_INTENT );
133
  $order_id = absint( WC()->session->get( 'order_awaiting_payment' ) );
134
  $order = $order_id ? wc_get_order( $order_id ) : null;
135
  $result = $this->create_payment_intent( $request, $payment_intent, $order );
136
- WC()->session->set( WC_Stripe_Constants::PAYMENT_INTENT, WC_Stripe_Utils::sanitize_intent( $result->payment_intent->toArray() ) );
137
 
138
  return rest_ensure_response( $result );
139
  } catch ( \Exception $e ) {
@@ -170,14 +170,16 @@ class WC_Stripe_Controller_Payment_Intent extends WC_Stripe_Rest_Controller {
170
  $payment_method = WC()->payment_gateways()->payment_gateways()[ $request['payment_method'] ];
171
  $params = $this->get_create_payment_intent_params( $request, $payment_method, $order );
172
  if ( $payment_intent ) {
173
- $payment_intent = $payment_method->gateway->paymentIntents->retrieve( $payment_intent['id'] );
174
- if ( is_wp_error( $payment_intent ) || in_array( $payment_intent->status, array( 'succeeded', 'requires_capture' ) ) ) {
175
- unset( WC()->session->{WC_Stripe_Constants::PAYMENT_INTENT} );
 
 
176
 
177
  return $this->create_payment_intent( $request );
178
  }
179
  unset( $params['confirmation_method'] );
180
- $payment_intent = $payment_method->gateway->paymentIntents->update( $payment_intent['id'], $params );
181
  } else {
182
  $payment_intent = $payment_method->gateway->paymentIntents->create( $params );
183
  }
@@ -185,10 +187,7 @@ class WC_Stripe_Controller_Payment_Intent extends WC_Stripe_Rest_Controller {
185
  if ( is_wp_error( $payment_intent ) ) {
186
  throw new Exception( $payment_intent->get_error_message() );
187
  }
188
- if ( $order ) {
189
- $order->update_meta_data( WC_Stripe_Constants::PAYMENT_INTENT, WC_Stripe_Utils::sanitize_intent( $payment_intent->toArray() ) );
190
- $order->save();
191
- }
192
  $response = array( 'payment_intent' => $payment_intent );
193
  $installments = array();
194
  if ( $payment_intent->payment_method_options->card->installments->enabled ) {
129
  */
130
  public function create_payment_intent_from_cart( $request ) {
131
  try {
132
+ $payment_intent = WC_Stripe_Utils::get_payment_intent_from_session();
133
  $order_id = absint( WC()->session->get( 'order_awaiting_payment' ) );
134
  $order = $order_id ? wc_get_order( $order_id ) : null;
135
  $result = $this->create_payment_intent( $request, $payment_intent, $order );
136
+ WC_Stripe_Utils::save_payment_intent_to_session( $result->payment_intent, $order );
137
 
138
  return rest_ensure_response( $result );
139
  } catch ( \Exception $e ) {
170
  $payment_method = WC()->payment_gateways()->payment_gateways()[ $request['payment_method'] ];
171
  $params = $this->get_create_payment_intent_params( $request, $payment_method, $order );
172
  if ( $payment_intent ) {
173
+ $payment_intent = $payment_method->gateway->paymentIntents->retrieve( $payment_intent->id );
174
+ if ( is_wp_error( $payment_intent ) || in_array( $payment_intent->status, array( 'succeeded', 'requires_capture' ) )
175
+ || $params['confirmation_method'] !== $payment_intent->confirmation_method
176
+ ) {
177
+ WC_Stripe_Utils::delete_payment_intent_to_session();
178
 
179
  return $this->create_payment_intent( $request );
180
  }
181
  unset( $params['confirmation_method'] );
182
+ $payment_intent = $payment_method->gateway->paymentIntents->update( $payment_intent->id, $params );
183
  } else {
184
  $payment_intent = $payment_method->gateway->paymentIntents->create( $params );
185
  }
187
  if ( is_wp_error( $payment_intent ) ) {
188
  throw new Exception( $payment_intent->get_error_message() );
189
  }
190
+
 
 
 
191
  $response = array( 'payment_intent' => $payment_intent );
192
  $installments = array();
193
  if ( $payment_intent->payment_method_options->card->installments->enabled ) {
includes/gateways/class-wc-payment-gateway-stripe-ach.php CHANGED
@@ -38,6 +38,7 @@ class WC_Payment_Gateway_Stripe_ACH extends WC_Payment_Gateway_Stripe {
38
 
39
  public static function init() {
40
  add_action( 'woocommerce_checkout_update_order_review', array( __CLASS__, 'update_order_review' ) );
 
41
  }
42
 
43
  /**
@@ -315,13 +316,8 @@ class WC_Payment_Gateway_Stripe_ACH extends WC_Payment_Gateway_Stripe {
315
  *
316
  * @param WC_Cart $cart
317
  */
318
- public function after_calculate_totals( $cart ) {
319
- remove_action( 'woocommerce_after_calculate_totals', array( $this, 'after_calculate_totals' ) );
320
-
321
- add_action( 'woocommerce_cart_calculate_fees', array( $this, 'calculate_fees' ) );
322
-
323
- WC()->session->set( 'wc_stripe_cart_total', $cart->total );
324
- $cart->calculate_totals();
325
  }
326
 
327
  /**
@@ -329,25 +325,33 @@ class WC_Payment_Gateway_Stripe_ACH extends WC_Payment_Gateway_Stripe {
329
  * @param WC_Cart $cart
330
  */
331
  public function calculate_fees( $cart ) {
332
- remove_action( 'woocommerce_cart_calculate_fees', array( $this, 'calculate_fees' ) );
333
  $fee = $this->get_option( 'fee' );
334
- $taxable = $fee['taxable'] == 'yes';
335
  switch ( $fee['type'] ) {
336
  case 'amount':
337
- $cart->add_fee( __( 'ACH Fee' ), $fee['value'], $taxable );
338
  break;
339
  case 'percent':
340
- $cart->add_fee( __( 'ACH Fee' ), $fee['value'] * WC()->session->get( 'wc_stripe_cart_total', 0 ), $taxable );
 
341
  break;
342
  }
343
- unset( WC()->session->wc_stripe_cart_total );
344
  }
345
 
346
  public static function update_order_review() {
347
  if ( ! empty( $_POST['payment_method'] ) && wc_clean( $_POST['payment_method'] ) === 'stripe_ach' ) {
348
  $payment_method = new WC_Payment_Gateway_Stripe_ACH();
349
  if ( $payment_method->fees_enabled() ) {
350
- add_action( 'woocommerce_after_calculate_totals', array( $payment_method, 'after_calculate_totals' ) );
 
 
 
 
 
 
 
 
 
351
  }
352
  }
353
  }
38
 
39
  public static function init() {
40
  add_action( 'woocommerce_checkout_update_order_review', array( __CLASS__, 'update_order_review' ) );
41
+ add_action( 'woocommerce_checkout_process', array( __CLASS__, 'add_fees_for_checkout' ) );
42
  }
43
 
44
  /**
316
  *
317
  * @param WC_Cart $cart
318
  */
319
+ public function calculate_cart_fees( $cart ) {
320
+ $this->calculate_fees( $cart );
 
 
 
 
 
321
  }
322
 
323
  /**
325
  * @param WC_Cart $cart
326
  */
327
  public function calculate_fees( $cart ) {
 
328
  $fee = $this->get_option( 'fee' );
329
+ $taxable = wc_string_to_bool( $fee['taxable'] );
330
  switch ( $fee['type'] ) {
331
  case 'amount':
332
+ $cart->add_fee( __( 'ACH Fee', 'woo-stripe-payment' ), $fee['value'], $taxable );
333
  break;
334
  case 'percent':
335
+ $cart_total = $cart->get_subtotal() + $cart->get_shipping_total() + $cart->get_subtotal_tax() + $cart->get_shipping_tax();
336
+ $cart->add_fee( __( 'ACH Fee', 'woo-stripe-payment' ), $fee['value'] * $cart_total, $taxable );
337
  break;
338
  }
 
339
  }
340
 
341
  public static function update_order_review() {
342
  if ( ! empty( $_POST['payment_method'] ) && wc_clean( $_POST['payment_method'] ) === 'stripe_ach' ) {
343
  $payment_method = new WC_Payment_Gateway_Stripe_ACH();
344
  if ( $payment_method->fees_enabled() ) {
345
+ add_action( 'woocommerce_cart_calculate_fees', array( $payment_method, 'calculate_cart_fees' ) );
346
+ }
347
+ }
348
+ }
349
+
350
+ public static function add_fees_for_checkout() {
351
+ if ( ! empty( $_POST['payment_method'] ) && wc_clean( $_POST['payment_method'] ) === 'stripe_ach' ) {
352
+ $payment_method = WC()->payment_gateways()->payment_gateways()['stripe_ach'];
353
+ if ( $payment_method && $payment_method->fees_enabled() ) {
354
+ add_action( 'woocommerce_cart_calculate_fees', array( $payment_method, 'calculate_cart_fees' ) );
355
  }
356
  }
357
  }
includes/gateways/class-wc-payment-gateway-stripe-cc.php CHANGED
@@ -65,6 +65,7 @@ class WC_Payment_Gateway_Stripe_CC extends WC_Payment_Gateway_Stripe {
65
  array(
66
  'cardOptions' => $this->get_card_form_options(),
67
  'customFieldOptions' => $this->get_card_custom_field_options(),
 
68
  'custom_form' => $this->is_custom_form_active(),
69
  'custom_form_name' => $this->get_option( 'custom_form' ),
70
  'html' => array( 'card_brand' => sprintf( '<img id="wc-stripe-card" src="%s" />', $this->get_custom_form()['cardBrand'] ) ),
@@ -143,6 +144,11 @@ class WC_Payment_Gateway_Stripe_CC extends WC_Payment_Gateway_Stripe {
143
  public function get_element_options( $options = array() ) {
144
  if ( $this->is_custom_form_active() ) {
145
  return parent::get_element_options( $this->get_custom_form()['elementOptions'] );
 
 
 
 
 
146
  }
147
 
148
  return parent::get_element_options();
@@ -157,6 +163,10 @@ class WC_Payment_Gateway_Stripe_CC extends WC_Payment_Gateway_Stripe {
157
  return $this->get_option( 'form_type' ) === 'custom';
158
  }
159
 
 
 
 
 
160
  public function get_custom_form_template() {
161
  $form = $this->get_option( 'custom_form' );
162
 
@@ -289,4 +299,49 @@ class WC_Payment_Gateway_Stripe_CC extends WC_Payment_Gateway_Stripe {
289
  return $this->installments->is_available( $order_id );
290
  }
291
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
292
  }
65
  array(
66
  'cardOptions' => $this->get_card_form_options(),
67
  'customFieldOptions' => $this->get_card_custom_field_options(),
68
+ 'cardFormType' => $this->get_active_card_form_type(),
69
  'custom_form' => $this->is_custom_form_active(),
70
  'custom_form_name' => $this->get_option( 'custom_form' ),
71
  'html' => array( 'card_brand' => sprintf( '<img id="wc-stripe-card" src="%s" />', $this->get_custom_form()['cardBrand'] ) ),
144
  public function get_element_options( $options = array() ) {
145
  if ( $this->is_custom_form_active() ) {
146
  return parent::get_element_options( $this->get_custom_form()['elementOptions'] );
147
+ } elseif ( $this->is_payment_element_active() ) {
148
+ $payment_intent = \WC_Stripe_Utils::get_payment_intent_from_session();
149
+ if ( $payment_intent ) {
150
+ return parent::get_element_options( array( 'clientSecret' => $payment_intent->client_secret ) );
151
+ }
152
  }
153
 
154
  return parent::get_element_options();
163
  return $this->get_option( 'form_type' ) === 'custom';
164
  }
165
 
166
+ public function is_payment_element_active() {
167
+ return $this->get_option( 'form_type' ) === 'payment';
168
+ }
169
+
170
  public function get_custom_form_template() {
171
  $form = $this->get_option( 'custom_form' );
172
 
299
  return $this->installments->is_available( $order_id );
300
  }
301
 
302
+ public function get_confirmation_method( $order = null ) {
303
+ return $this->is_payment_element_active() ? 'automatic' : 'manual';
304
+ }
305
+
306
+ /**
307
+ * @return string Serves as a wrapper for the form_type option with some validations to ensure
308
+ * a payment intent exists in the session.
309
+ */
310
+ protected function get_active_card_form_type() {
311
+ $type = $this->get_option( 'form_type' );
312
+ if ( $this->is_payment_element_active() ) {
313
+ $payment_intent = WC_Stripe_Utils::get_payment_intent_from_session();
314
+ if ( ! $payment_intent ) {
315
+ $type = 'inline';
316
+ }
317
+ }
318
+
319
+ return $type;
320
+ }
321
+
322
+ public function validate_form_type_field( $key, $value ) {
323
+ if ( $value !== 'payment' && stripe_wc()->advanced_settings->is_active( 'link_enabled' ) ) {
324
+ $value = 'payment';
325
+ WC_Admin_Settings::add_error( __( 'Only the Stripe payment form can be used while Link is enabled.', 'woo-stripe-payment' ) );
326
+ } elseif ( $value === 'payment' && wc_stripe_test_mode() ) {
327
+ $key = wc_stripe_get_publishable_key( 'live' );
328
+ if ( ! $key ) {
329
+ $value = 'inline';
330
+ WC_Admin_Settings::add_error( __( 'The Payment Element card form design is only available to connected accounts at this time because it\'s a Stripe beta feature. To use the Payment Element in test mode, use the connect option on the API Settings page.', 'woo-stripe-payment' ) );
331
+ }
332
+ }
333
+
334
+ return $value;
335
+ }
336
+
337
+ public function get_form_fields() {
338
+ $fields = parent::get_form_fields();
339
+ if ( wc_stripe_test_mode() ) {
340
+ // until server side updates for the payment element are released fully, show a notice
341
+ $fields['form_type']['options']['payment'] = __( 'Stripe payment form (beta feature)', 'woo-stripe-payment' );
342
+ }
343
+
344
+ return $fields;
345
+ }
346
+
347
  }
includes/gateways/class-wc-payment-gateway-stripe-googlepay.php CHANGED
@@ -218,12 +218,6 @@ class WC_Payment_Gateway_Stripe_GooglePay extends WC_Payment_Gateway_Stripe {
218
  return $this->get_formatted_shipping_label( $price, $rate, $incl_tax );
219
  }
220
 
221
- public function add_to_cart_response( $data ) {
222
- $data['googlepay']['displayItems'] = $this->get_display_items();
223
-
224
- return $data;
225
- }
226
-
227
  /**
228
  * @param array $deps
229
  * @param $scripts
218
  return $this->get_formatted_shipping_label( $price, $rate, $incl_tax );
219
  }
220
 
 
 
 
 
 
 
221
  /**
222
  * @param array $deps
223
  * @param $scripts
includes/gateways/class-wc-payment-gateway-stripe-klarna.php CHANGED
@@ -14,6 +14,37 @@ class WC_Payment_Gateway_Stripe_Klarna extends WC_Payment_Gateway_Stripe_Local_P
14
 
15
  protected $payment_method_type = 'klarna';
16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  use WC_Stripe_Local_Payment_Intent_Trait;
18
 
19
  public function __construct() {
@@ -100,6 +131,9 @@ class WC_Payment_Gateway_Stripe_Klarna extends WC_Payment_Gateway_Stripe_Local_P
100
  default:
101
  $locale = strtolower( $country ) . '-' . strtoupper( $country );
102
  }
 
 
 
103
 
104
  return $locale;
105
  }
14
 
15
  protected $payment_method_type = 'klarna';
16
 
17
+ private $supported_locales = array(
18
+ 'de-AT',
19
+ 'en-AT',
20
+ 'da-DK',
21
+ 'en-DK',
22
+ 'fi-FI',
23
+ 'sv-FI',
24
+ 'en-FI',
25
+ 'de-DE',
26
+ 'en-DE',
27
+ 'nl-NL',
28
+ 'en-NL',
29
+ 'nb-NO',
30
+ 'en-NO',
31
+ 'sv-SE',
32
+ 'en-SE',
33
+ 'en-GB',
34
+ 'en-US',
35
+ 'es-US',
36
+ 'nl-BE',
37
+ 'fr-BE',
38
+ 'en-BE',
39
+ 'es-ES',
40
+ 'en-ES',
41
+ 'it-IT',
42
+ 'en-IT',
43
+ 'fr-FR',
44
+ 'en-FR',
45
+ 'en-IE'
46
+ );
47
+
48
  use WC_Stripe_Local_Payment_Intent_Trait;
49
 
50
  public function __construct() {
131
  default:
132
  $locale = strtolower( $country ) . '-' . strtoupper( $country );
133
  }
134
+ if ( ! in_array( $locale, $this->supported_locales, true ) ) {
135
+ $locale = 'en-US';
136
+ }
137
 
138
  return $locale;
139
  }
includes/gateways/settings/cc-settings.php CHANGED
@@ -115,11 +115,13 @@ return array(
115
  'title' => __( 'Card Form', 'woo-stripe-payment' ),
116
  'type' => 'select',
117
  'options' => array(
118
- 'inline' => __( 'Stripe form', 'woo-stripe-payment' ),
119
- 'custom' => __( 'Custom form', 'woo-stripe-payment' ),
 
120
  ),
121
  'default' => 'inline',
122
- 'description' => __( 'The Stripe form option displays a CC form rendered by Stripe. It works well with most themes. The custom card forms are offered if you want more options on the CC form design.', 'woo-stripe-payment' ),
 
123
  ),
124
  'custom_form' => array(
125
  'title' => __( 'Custom Form', 'woo-stripe-payment' ),
115
  'title' => __( 'Card Form', 'woo-stripe-payment' ),
116
  'type' => 'select',
117
  'options' => array(
118
+ 'inline' => __( 'Stripe inline form', 'woo-stripe-payment' ),
119
+ 'payment' => __( 'Stripe payment form', 'woo-stripe-payment' ),
120
+ 'custom' => __( 'Custom form', 'woo-stripe-payment' ),
121
  ),
122
  'default' => 'inline',
123
+ 'desc_tip' => true,
124
+ 'description' => __( 'The card form design that displays on payment pages.', 'woo-stripe-payment' ),
125
  ),
126
  'custom_form' => array(
127
  'title' => __( 'Custom Form', 'woo-stripe-payment' ),
includes/tokens/class-wc-payment-token-stripe-cc.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  defined( 'ABSPATH' ) || exit();
3
 
4
  if ( ! class_exists( 'WC_Payment_Token_Stripe' ) ) {
@@ -6,9 +7,9 @@ if ( ! class_exists( 'WC_Payment_Token_Stripe' ) ) {
6
  }
7
 
8
  /**
9
- * @sin 3.0.0
10
  *
11
- * @author PaymentPlugins
12
  * @package Stripe/Tokens
13
  *
14
  */
@@ -31,17 +32,22 @@ class WC_Payment_Token_Stripe_CC extends WC_Payment_Token_Stripe {
31
  );
32
 
33
  public function details_to_props( $details ) {
34
- if ( isset( $details['card'] ) ) {
35
- $card = $details['card'];
36
- }
37
- if ( $details instanceof \Stripe\Card ) {
38
- $card = $details;
 
 
 
 
 
 
 
 
 
 
39
  }
40
- $this->set_brand( $card['brand'] );
41
- $this->set_last4( $card['last4'] );
42
- $this->set_exp_month( $card['exp_month'] );
43
- $this->set_exp_year( $card['exp_year'] );
44
- $this->set_masked_number( sprintf( '********%s', $card['last4'] ) );
45
  }
46
 
47
  public function get_last4( $context = 'view' ) {
@@ -130,6 +136,19 @@ class WC_Payment_Token_Stripe_CC extends WC_Payment_Token_Stripe {
130
  }
131
 
132
  public function get_basic_payment_method_title() {
 
 
 
 
133
  return __( 'Credit Card', 'woo-stripe-payment' );
134
  }
 
 
 
 
 
 
 
 
 
135
  }
1
  <?php
2
+
3
  defined( 'ABSPATH' ) || exit();
4
 
5
  if ( ! class_exists( 'WC_Payment_Token_Stripe' ) ) {
7
  }
8
 
9
  /**
10
+ * @sin 3.0.0
11
  *
12
+ * @author PaymentPlugins
13
  * @package Stripe/Tokens
14
  *
15
  */
32
  );
33
 
34
  public function details_to_props( $details ) {
35
+ if ( isset( $details['type'] ) && $details['type'] === 'link' ) {
36
+ $this->set_brand( 'link' );
37
+ $this->set_format( 'short_title' );
38
+ } else {
39
+ if ( isset( $details['card'] ) ) {
40
+ $card = $details['card'];
41
+ }
42
+ if ( $details instanceof \Stripe\Card ) {
43
+ $card = $details;
44
+ }
45
+ $this->set_brand( $card['brand'] );
46
+ $this->set_last4( $card['last4'] );
47
+ $this->set_exp_month( $card['exp_month'] );
48
+ $this->set_exp_year( $card['exp_year'] );
49
+ $this->set_masked_number( sprintf( '********%s', $card['last4'] ) );
50
  }
 
 
 
 
 
51
  }
52
 
53
  public function get_last4( $context = 'view' ) {
136
  }
137
 
138
  public function get_basic_payment_method_title() {
139
+ if ( strtolower( $this->get_brand() ) === 'link' ) {
140
+ return __( 'Link by Stripe', 'woo-stripe-payment' );
141
+ }
142
+
143
  return __( 'Credit Card', 'woo-stripe-payment' );
144
  }
145
+
146
+ public function get_payment_method_title( $format = '' ) {
147
+ if ( strtolower( $this->get_brand() ) === 'link' ) {
148
+ return $this->get_basic_payment_method_title();
149
+ }
150
+
151
+ return parent::get_payment_method_title( $format );
152
+ }
153
+
154
  }
includes/traits/wc-stripe-payment-traits.php CHANGED
@@ -57,16 +57,7 @@ trait WC_Stripe_Payment_Intent_Trait {
57
  * @param WC_Order $order
58
  */
59
  public function get_payment_intent_confirmation_args( $intent, $order ) {
60
- $args = array();
61
- if ( ! empty( $intent->payment_method_options->card->installments->available_plans ) ) {
62
- $plan_id = isset( $_POST[ WC_Stripe_Constants::INSTALLMENT_PLAN ] ) ? wc_clean( $_POST[ WC_Stripe_Constants::INSTALLMENT_PLAN ] ) : null;
63
- $formatter = new \PaymentPlugins\Stripe\Installments\InstallmentFormatter();
64
- if ( $formatter->is_valid_plan( $plan_id ) ) {
65
- $args = array( 'payment_method_options' => array( 'card' => array( 'installments' => array( 'plan' => $formatter->parse_plan_from_id( $plan_id ) ) ) ) );
66
- }
67
- }
68
-
69
- return $args;
70
  }
71
 
72
  /**
@@ -170,6 +161,7 @@ trait WC_Stripe_Payment_Intent_Trait {
170
  }
171
  WC_Pre_Orders_Order::mark_order_as_pre_ordered( $order );
172
  $this->save_zero_total_meta( $order, $token );
 
173
 
174
  return array(
175
  'result' => 'success',
57
  * @param WC_Order $order
58
  */
59
  public function get_payment_intent_confirmation_args( $intent, $order ) {
60
+ return array();
 
 
 
 
 
 
 
 
 
61
  }
62
 
63
  /**
161
  }
162
  WC_Pre_Orders_Order::mark_order_as_pre_ordered( $order );
163
  $this->save_zero_total_meta( $order, $token );
164
+ $this->payment_object->destroy_session_data();
165
 
166
  return array(
167
  'result' => 'success',
includes/updates/update-3.3.20.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ defined( 'ABSPATH' ) || exit();
4
+
5
+ if ( function_exists( 'WC' ) ) {
6
+ $client = WC_Stripe_Gateway::load();
7
+ $api_settings = stripe_wc()->api_settings;
8
+ foreach ( array( 'live', 'test' ) as $mode ) {
9
+ $id = $api_settings->get_option( "webhook_id_{$mode}" );
10
+ if ( $id ) {
11
+ $webhook = $client->webhookEndpoints->retrieve( $id );
12
+ if ( ! is_wp_error( $webhook ) && ! in_array( '*', $webhook->enabled_events, true ) ) {
13
+ $events = array_values( array_unique( array_merge( $webhook->enabled_events, array( 'payment_intent.requires_action' ) ) ) );
14
+ $client->webhookEndpoints->update( $id, array( 'enabled_events' => $events ) );
15
+ wc_stripe_log_info( sprintf( 'Webhook %s updated during version 3.3.20 update.', $id ) );
16
+ }
17
+ }
18
+ }
19
+ }
includes/wc-stripe-functions.php CHANGED
@@ -7,7 +7,7 @@ defined( 'ABSPATH' ) || exit();
7
  * @param string $template_name
8
  * @param array $args
9
  *
10
- * @since 3.0.0
11
  * @package Stripe/Functions
12
  * Wrapper for wc_get_template that returns Stripe specfic templates.
13
  */
@@ -23,7 +23,7 @@ function wc_stripe_get_template( $template_name, $args = array() ) {
23
  * @param string $template_name
24
  * @param array $args
25
  *
26
- * @since 3.0.0
27
  * @return string
28
  * @package Stripe/Functions
29
  */
@@ -83,13 +83,17 @@ function wc_stripe_mode() {
83
  return apply_filters( 'wc_stripe_mode', stripe_wc()->api_settings->get_option( 'mode' ) );
84
  }
85
 
 
 
 
 
86
  /**
87
  * Return the secret key for the provided mode.
88
  * If no mode given, the key for the active mode is returned.
89
  *
90
  * @param string $mode
91
  *
92
- * @since 3.0.0
93
  * @package Stripe/Functions
94
  */
95
  function wc_stripe_get_secret_key( $mode = '' ) {
@@ -104,7 +108,7 @@ function wc_stripe_get_secret_key( $mode = '' ) {
104
  *
105
  * @param string $mode
106
  *
107
- * @since 3.0.0
108
  * @package Stripe/Functions
109
  */
110
  function wc_stripe_get_publishable_key( $mode = '' ) {
@@ -116,12 +120,12 @@ function wc_stripe_get_publishable_key( $mode = '' ) {
116
  /**
117
  * Return the merchant's Stripe account.
118
  *
119
- * @since 3.1.4
120
  * @return string
121
  * @package Stripe/Functions
122
  */
123
  function wc_stripe_get_account_id() {
124
- return apply_filters( 'wc_stripe_get_account_id', stripe_wc()->api_settings->get_option( 'account_id' ) );
125
  }
126
 
127
  /**
@@ -130,7 +134,7 @@ function wc_stripe_get_account_id() {
130
  * @param int $user_id
131
  * @param string $mode
132
  *
133
- * @since 3.0.0
134
  * @package Stripe/Functions
135
  */
136
  function wc_stripe_get_customer_id( $user_id = '', $mode = '' ) {
@@ -183,7 +187,7 @@ function wc_stripe_delete_customer( $user_id, $mode = '', $global = false ) {
183
  * @param int $token_id
184
  * @param WC_Payment_Token $token
185
  *
186
- * @since 3.0.0
187
  * @package Stripe/Functions
188
  */
189
  function wc_stripe_woocommerce_payment_token_deleted( $token_id, $token ) {
@@ -199,7 +203,7 @@ function wc_stripe_woocommerce_payment_token_deleted( $token_id, $token ) {
199
  * @param int $level
200
  * @param string $message
201
  *
202
- * @since 3.0.0
203
  * @package Stripe/Functions
204
  */
205
  function wc_stripe_log( $level, $message ) {
@@ -213,7 +217,7 @@ function wc_stripe_log( $level, $message ) {
213
  *
214
  * @param string $message
215
  *
216
- * @since 3.0.0
217
  * @package Stripe/Functions
218
  */
219
  function wc_stripe_log_error( $message ) {
@@ -224,7 +228,7 @@ function wc_stripe_log_error( $message ) {
224
  *
225
  * @param string $message
226
  *
227
- * @since 3.0.0
228
  * @package Stripe/Functions
229
  */
230
  function wc_stripe_log_info( $message ) {
@@ -237,7 +241,7 @@ function wc_stripe_log_info( $message ) {
237
  *
238
  * @param WC_Order|int $order
239
  *
240
- * @since 3.0.0
241
  * @package Stripe/Functions
242
  */
243
  function wc_stripe_order_mode( $order ) {
@@ -252,7 +256,7 @@ function wc_stripe_order_mode( $order ) {
252
  *
253
  * @param array $gateways
254
  *
255
- * @since 3.0.0
256
  * @package Stripe\Functions
257
  */
258
  function wc_stripe_payment_gateways( $gateways ) {
@@ -287,7 +291,7 @@ function wc_stripe_order_cancelled( $order_id, $order ) {
287
  * @param int $order_id
288
  * @param WC_Order $order
289
  *
290
- * @since 3.0.0
291
  * @package Stripe/Functions
292
  */
293
  function wc_stripe_order_status_completed( $order_id, $order ) {
@@ -305,9 +309,9 @@ function wc_stripe_order_status_completed( $order_id, $order ) {
305
 
306
  /**
307
  *
308
- * @param [] $address
309
  *
310
- * @since 3.0.0
311
  * @throws Exception
312
  * @package Stripe/Functions
313
  */
@@ -349,9 +353,9 @@ function wc_stripe_update_customer_location( $address ) {
349
 
350
  /**
351
  *
352
- * @param [] $methods
353
  *
354
- * @since 3.0.0
355
  * @package Stripe/Functions
356
  */
357
  function wc_stripe_update_shipping_methods( $methods ) {
@@ -369,7 +373,7 @@ function wc_stripe_update_shipping_methods( $methods ) {
369
  *
370
  * @param array $packages
371
  *
372
- * @since 3.0.0
373
  * @return boolean
374
  * @package Stripe/Functions
375
  */
@@ -390,7 +394,7 @@ function wc_stripe_shipping_address_serviceable( $packages = array() ) {
390
  * @param string $page
391
  * @param WC_Order $order
392
  *
393
- * @since 3.0.0
394
  * @deprecated
395
  * @package Stripe/Functions
396
  */
@@ -405,7 +409,7 @@ function wc_stripe_get_display_items( $page = 'cart', $order = null ) {
405
  * @param WC_Order $order
406
  * @param array $packages
407
  *
408
- * @since 3.0.0
409
  * @return mixed
410
  * @deprecated
411
  * @package Stripe/Functions
@@ -461,7 +465,7 @@ function wc_stripe_get_shipping_options( $order = null, $packages = array() ) {
461
 
462
  /**
463
  *
464
- * @since 3.0.0
465
  * @package Stripe/Functions
466
  */
467
  function wc_stripe_set_checkout_error() {
@@ -472,7 +476,7 @@ function wc_stripe_set_checkout_error() {
472
  *
473
  * @param string $template_name
474
  *
475
- * @since 3.0.0
476
  * @package Stripe/Functions
477
  */
478
  function wc_stripe_output_checkout_error( $template_name ) {
@@ -485,7 +489,7 @@ function wc_stripe_output_checkout_error( $template_name ) {
485
 
486
  /**
487
  *
488
- * @since 3.0.0
489
  * @package Stripe/Functions
490
  */
491
  function wc_stripe_add_allowed_html( $tags, $context ) {
@@ -534,7 +538,7 @@ function wc_stripe_process_shop_subscription_meta( $post_id, $post ) {
534
  *
535
  * @param WC_Payment_Gateway[] $gateways
536
  *
537
- * @since 3.0.0
538
  * @package Stripe/Functions
539
  */
540
  function wc_stripe_available_payment_gateways( $gateways ) {
@@ -554,7 +558,7 @@ function wc_stripe_available_payment_gateways( $gateways ) {
554
 
555
  /**
556
  *
557
- * @since 3.0.0
558
  * @return array
559
  * @package Stripe/Functions
560
  */
@@ -579,7 +583,7 @@ function wc_stripe_get_local_payment_params() {
579
  *
580
  * @param array $gateways
581
  *
582
- * @since 3.0.0
583
  * @return WC_Payment_Gateway[]
584
  * @package Stripe/Functions
585
  */
@@ -599,7 +603,7 @@ function wc_stripe_get_available_local_gateways( $gateways ) {
599
  *
600
  * @param string|int $key
601
  *
602
- * @since 3.0.0
603
  * @package Stripe/Functions
604
  */
605
  function wc_stripe_set_idempotency_key( $key ) {
@@ -609,7 +613,7 @@ function wc_stripe_set_idempotency_key( $key ) {
609
 
610
  /**
611
  *
612
- * @since 3.0.0
613
  * @return mixed
614
  * @package Stripe/Functions
615
  */
@@ -623,7 +627,7 @@ function wc_stripe_get_idempotency_key() {
623
  *
624
  * @param array $options
625
  *
626
- * @since 3.0.0
627
  * @return array
628
  * @package Stripe/Functions
629
  */
@@ -642,7 +646,7 @@ function wc_stripe_api_options( $options ) {
642
  * @param int $order_id
643
  * @param WC_Order $order
644
  *
645
- * @since 3.0.0
646
  * <br/><strong>3.1.7</strong> - default $order argument of null added to prevent errors when 3rd party plugins trigger
647
  * action woocommerce_payment_complete_order_status and don't pass three arguments.
648
  * @package Stripe/Functions
@@ -666,7 +670,7 @@ function wc_stripe_payment_complete_order_status( $order_status, $order_id, $ord
666
  * @param string $currency
667
  * @param string $round
668
  *
669
- * @since 3.0.0
670
  * @return number
671
  * @package Stripe/Functions
672
  */
@@ -716,7 +720,7 @@ function wc_stripe_remove_number_precision( $value, $currency = '', $round = tru
716
  /**
717
  * Return an array of credit card forms.
718
  *
719
- * @since 3.0.0
720
  * @return mixed
721
  * @package Stripe/Functions
722
  */
@@ -855,7 +859,7 @@ function wc_stripe_get_custom_forms() {
855
  *
856
  * @param WC_Order $order
857
  *
858
- * @since 3.0.0
859
  * @package Stripe/Functions
860
  */
861
  function wc_stripe_order_has_shipping_address( $order ) {
@@ -868,7 +872,7 @@ function wc_stripe_order_has_shipping_address( $order ) {
868
 
869
  /**
870
  *
871
- * @since 3.0.0
872
  * @package Stripe/Functions
873
  */
874
  function wc_stripe_display_prices_including_tax() {
@@ -886,7 +890,7 @@ function wc_stripe_display_prices_including_tax() {
886
  /**
887
  * Return true if the WC pre-orders plugin is active
888
  *
889
- * @since 3.0.1
890
  * @package Stripe/Functions
891
  */
892
  function wc_stripe_pre_orders_active() {
@@ -897,7 +901,7 @@ function wc_stripe_pre_orders_active() {
897
  *
898
  * @param string $source_id
899
  *
900
- * @since 3.0.5
901
  * @package Stripe/Functions
902
  */
903
  function wc_stripe_get_order_from_source_id( $source_id ) {
@@ -914,7 +918,7 @@ function wc_stripe_get_order_from_source_id( $source_id ) {
914
  *
915
  * @param string $transaction_id
916
  *
917
- * @since 3.0.5
918
  * @return WC_Order|WC_Refund|boolean|WC_Order_Refund
919
  * @package Stripe/Functions
920
  */
@@ -936,8 +940,8 @@ function wc_stripe_get_order_from_transaction( $transaction_id ) {
936
  * @param WC_Cart $cart
937
  * @param bool $product_cart
938
  *
939
- * @since 3.0.6
940
- * @todo Maybe empty cart silently so actions are not triggered that cause session data to be removed
941
  * from 3rd party plugins.
942
  *
943
  * @package Stripe/Functions
@@ -965,7 +969,7 @@ function wc_stripe_stash_cart( $cart, $product_cart = true ) {
965
  * @param WC_Cart $cart
966
  * @param array $params
967
  *
968
- * @since 3.0.6
969
  * @package Stripe/Functions
970
  */
971
  function wc_stripe_stash_product_cart( $cart, $params = array() ) {
@@ -980,7 +984,7 @@ function wc_stripe_stash_product_cart( $cart, $params = array() ) {
980
  *
981
  * @param WC_Cart $cart
982
  *
983
- * @since 3.0.6
984
  * @package Stripe/Functions
985
  */
986
  function wc_stripe_restore_cart( $cart ) {
@@ -991,7 +995,7 @@ function wc_stripe_restore_cart( $cart ) {
991
 
992
  /**
993
  *
994
- * @since 3.0.6
995
  * @package Stripe/Functions
996
  */
997
  function wc_stripe_restore_cart_after_product_checkout() {
@@ -1011,7 +1015,7 @@ function wc_stripe_restore_cart_after_product_checkout() {
1011
  * @param int $user_id
1012
  * @param string $gateway_id
1013
  *
1014
- * @since 3.1.0
1015
  * @return WC_Payment_Token[]
1016
  * @package Stripe/Functions
1017
  */
@@ -1032,7 +1036,7 @@ function wc_stripe_get_customer_payment_tokens( $tokens, $user_id, $gateway_id )
1032
  *
1033
  * @param array $labels
1034
  *
1035
- * @since 3.1.0
1036
  * @return string
1037
  * @package Stripe/Functions
1038
  */
@@ -1047,7 +1051,7 @@ function wc_stripe_credit_card_labels( $labels ) {
1047
  /**
1048
  * Return an array of Stripe error messages.
1049
  *
1050
- * @since 3.1.1
1051
  * @package Stripe/Functions
1052
  */
1053
  function wc_stripe_get_error_messages() {
@@ -1127,7 +1131,8 @@ function wc_stripe_get_error_messages() {
1127
  'incomplete_iban' => __( 'The IBAN you entered is incomplete.', 'woo-stripe-payment' ),
1128
  'incomplete_boleto_tax_id' => __( 'Please enter a valid CPF / CNPJ', 'woo-stripe-payment' ),
1129
  'test_mode_live_card' => __( 'Your card was declined. Your request was in test mode, but you used a real credit card. Only test cards can be used in test mode.',
1130
- 'woo-stripe-payment' )
 
1131
  )
1132
  );
1133
  }
@@ -1136,7 +1141,7 @@ function wc_stripe_get_error_messages() {
1136
  * Return an array of Stripe currencies where the value of each
1137
  * currency is the curency multiplier.
1138
  *
1139
- * @since 3.1.2
1140
  * @return mixed
1141
  * @package Stripe/Functions
1142
  */
@@ -1179,7 +1184,7 @@ function wc_stripe_get_currencies() {
1179
  * @param int $order_id
1180
  * @param \Stripe\ApiResource $object
1181
  *
1182
- * @since 3.1.3
1183
  * @package Stripe/Functions
1184
  */
1185
  function wc_stripe_filter_order_id( $order_id, $object ) {
@@ -1189,7 +1194,7 @@ function wc_stripe_filter_order_id( $order_id, $object ) {
1189
  /**
1190
  * Removes order locks that have expired so the options table does not get cluttered with transients.
1191
  *
1192
- * @since 3.1.6
1193
  * @package Stripe/Functions
1194
  */
1195
  function wc_stripe_remove_order_locks() {
7
  * @param string $template_name
8
  * @param array $args
9
  *
10
+ * @since 3.0.0
11
  * @package Stripe/Functions
12
  * Wrapper for wc_get_template that returns Stripe specfic templates.
13
  */
23
  * @param string $template_name
24
  * @param array $args
25
  *
26
+ * @since 3.0.0
27
  * @return string
28
  * @package Stripe/Functions
29
  */
83
  return apply_filters( 'wc_stripe_mode', stripe_wc()->api_settings->get_option( 'mode' ) );
84
  }
85
 
86
+ function wc_stripe_test_mode() {
87
+ return wc_stripe_mode() === 'test';
88
+ }
89
+
90
  /**
91
  * Return the secret key for the provided mode.
92
  * If no mode given, the key for the active mode is returned.
93
  *
94
  * @param string $mode
95
  *
96
+ * @since 3.0.0
97
  * @package Stripe/Functions
98
  */
99
  function wc_stripe_get_secret_key( $mode = '' ) {
108
  *
109
  * @param string $mode
110
  *
111
+ * @since 3.0.0
112
  * @package Stripe/Functions
113
  */
114
  function wc_stripe_get_publishable_key( $mode = '' ) {
120
  /**
121
  * Return the merchant's Stripe account.
122
  *
123
+ * @since 3.1.4
124
  * @return string
125
  * @package Stripe/Functions
126
  */
127
  function wc_stripe_get_account_id() {
128
+ return apply_filters( 'wc_stripe_get_account_id', stripe_wc()->api_settings->get_account_id() );
129
  }
130
 
131
  /**
134
  * @param int $user_id
135
  * @param string $mode
136
  *
137
+ * @since 3.0.0
138
  * @package Stripe/Functions
139
  */
140
  function wc_stripe_get_customer_id( $user_id = '', $mode = '' ) {
187
  * @param int $token_id
188
  * @param WC_Payment_Token $token
189
  *
190
+ * @since 3.0.0
191
  * @package Stripe/Functions
192
  */
193
  function wc_stripe_woocommerce_payment_token_deleted( $token_id, $token ) {
203
  * @param int $level
204
  * @param string $message
205
  *
206
+ * @since 3.0.0
207
  * @package Stripe/Functions
208
  */
209
  function wc_stripe_log( $level, $message ) {
217
  *
218
  * @param string $message
219
  *
220
+ * @since 3.0.0
221
  * @package Stripe/Functions
222
  */
223
  function wc_stripe_log_error( $message ) {
228
  *
229
  * @param string $message
230
  *
231
+ * @since 3.0.0
232
  * @package Stripe/Functions
233
  */
234
  function wc_stripe_log_info( $message ) {
241
  *
242
  * @param WC_Order|int $order
243
  *
244
+ * @since 3.0.0
245
  * @package Stripe/Functions
246
  */
247
  function wc_stripe_order_mode( $order ) {
256
  *
257
  * @param array $gateways
258
  *
259
+ * @since 3.0.0
260
  * @package Stripe\Functions
261
  */
262
  function wc_stripe_payment_gateways( $gateways ) {
291
  * @param int $order_id
292
  * @param WC_Order $order
293
  *
294
+ * @since 3.0.0
295
  * @package Stripe/Functions
296
  */
297
  function wc_stripe_order_status_completed( $order_id, $order ) {
309
 
310
  /**
311
  *
312
+ * @param [] $address
313
  *
314
+ * @since 3.0.0
315
  * @throws Exception
316
  * @package Stripe/Functions
317
  */
353
 
354
  /**
355
  *
356
+ * @param [] $methods
357
  *
358
+ * @since 3.0.0
359
  * @package Stripe/Functions
360
  */
361
  function wc_stripe_update_shipping_methods( $methods ) {
373
  *
374
  * @param array $packages
375
  *
376
+ * @since 3.0.0
377
  * @return boolean
378
  * @package Stripe/Functions
379
  */
394
  * @param string $page
395
  * @param WC_Order $order
396
  *
397
+ * @since 3.0.0
398
  * @deprecated
399
  * @package Stripe/Functions
400
  */
409
  * @param WC_Order $order
410
  * @param array $packages
411
  *
412
+ * @since 3.0.0
413
  * @return mixed
414
  * @deprecated
415
  * @package Stripe/Functions
465
 
466
  /**
467
  *
468
+ * @since 3.0.0
469
  * @package Stripe/Functions
470
  */
471
  function wc_stripe_set_checkout_error() {
476
  *
477
  * @param string $template_name
478
  *
479
+ * @since 3.0.0
480
  * @package Stripe/Functions
481
  */
482
  function wc_stripe_output_checkout_error( $template_name ) {
489
 
490
  /**
491
  *
492
+ * @since 3.0.0
493
  * @package Stripe/Functions
494
  */
495
  function wc_stripe_add_allowed_html( $tags, $context ) {
538
  *
539
  * @param WC_Payment_Gateway[] $gateways
540
  *
541
+ * @since 3.0.0
542
  * @package Stripe/Functions
543
  */
544
  function wc_stripe_available_payment_gateways( $gateways ) {
558
 
559
  /**
560
  *
561
+ * @since 3.0.0
562
  * @return array
563
  * @package Stripe/Functions
564
  */
583
  *
584
  * @param array $gateways
585
  *
586
+ * @since 3.0.0
587
  * @return WC_Payment_Gateway[]
588
  * @package Stripe/Functions
589
  */
603
  *
604
  * @param string|int $key
605
  *
606
+ * @since 3.0.0
607
  * @package Stripe/Functions
608
  */
609
  function wc_stripe_set_idempotency_key( $key ) {
613
 
614
  /**
615
  *
616
+ * @since 3.0.0
617
  * @return mixed
618
  * @package Stripe/Functions
619
  */
627
  *
628
  * @param array $options
629
  *
630
+ * @since 3.0.0
631
  * @return array
632
  * @package Stripe/Functions
633
  */
646
  * @param int $order_id
647
  * @param WC_Order $order
648
  *
649
+ * @since 3.0.0
650
  * <br/><strong>3.1.7</strong> - default $order argument of null added to prevent errors when 3rd party plugins trigger
651
  * action woocommerce_payment_complete_order_status and don't pass three arguments.
652
  * @package Stripe/Functions
670
  * @param string $currency
671
  * @param string $round
672
  *
673
+ * @since 3.0.0
674
  * @return number
675
  * @package Stripe/Functions
676
  */
720
  /**
721
  * Return an array of credit card forms.
722
  *
723
+ * @since 3.0.0
724
  * @return mixed
725
  * @package Stripe/Functions
726
  */
859
  *
860
  * @param WC_Order $order
861
  *
862
+ * @since 3.0.0
863
  * @package Stripe/Functions
864
  */
865
  function wc_stripe_order_has_shipping_address( $order ) {
872
 
873
  /**
874
  *
875
+ * @since 3.0.0
876
  * @package Stripe/Functions
877
  */
878
  function wc_stripe_display_prices_including_tax() {
890
  /**
891
  * Return true if the WC pre-orders plugin is active
892
  *
893
+ * @since 3.0.1
894
  * @package Stripe/Functions
895
  */
896
  function wc_stripe_pre_orders_active() {
901
  *
902
  * @param string $source_id
903
  *
904
+ * @since 3.0.5
905
  * @package Stripe/Functions
906
  */
907
  function wc_stripe_get_order_from_source_id( $source_id ) {
918
  *
919
  * @param string $transaction_id
920
  *
921
+ * @since 3.0.5
922
  * @return WC_Order|WC_Refund|boolean|WC_Order_Refund
923
  * @package Stripe/Functions
924
  */
940
  * @param WC_Cart $cart
941
  * @param bool $product_cart
942
  *
943
+ * @since 3.0.6
944
+ * @todo Maybe empty cart silently so actions are not triggered that cause session data to be removed
945
  * from 3rd party plugins.
946
  *
947
  * @package Stripe/Functions
969
  * @param WC_Cart $cart
970
  * @param array $params
971
  *
972
+ * @since 3.0.6
973
  * @package Stripe/Functions
974
  */
975
  function wc_stripe_stash_product_cart( $cart, $params = array() ) {
984
  *
985
  * @param WC_Cart $cart
986
  *
987
+ * @since 3.0.6
988
  * @package Stripe/Functions
989
  */
990
  function wc_stripe_restore_cart( $cart ) {
995
 
996
  /**
997
  *
998
+ * @since 3.0.6
999
  * @package Stripe/Functions
1000
  */
1001
  function wc_stripe_restore_cart_after_product_checkout() {
1015
  * @param int $user_id
1016
  * @param string $gateway_id
1017
  *
1018
+ * @since 3.1.0
1019
  * @return WC_Payment_Token[]
1020
  * @package Stripe/Functions
1021
  */
1036
  *
1037
  * @param array $labels
1038
  *
1039
+ * @since 3.1.0
1040
  * @return string
1041
  * @package Stripe/Functions
1042
  */
1051
  /**
1052
  * Return an array of Stripe error messages.
1053
  *
1054
+ * @since 3.1.1
1055
  * @package Stripe/Functions
1056
  */
1057
  function wc_stripe_get_error_messages() {
1131
  'incomplete_iban' => __( 'The IBAN you entered is incomplete.', 'woo-stripe-payment' ),
1132
  'incomplete_boleto_tax_id' => __( 'Please enter a valid CPF / CNPJ', 'woo-stripe-payment' ),
1133
  'test_mode_live_card' => __( 'Your card was declined. Your request was in test mode, but you used a real credit card. Only test cards can be used in test mode.',
1134
+ 'woo-stripe-payment' ),
1135
+ 'server_side_confirmation_beta' => __( 'You do not have permission to use the PaymentElement card form. Please send a request to https://support.stripe.com/ and ask for the "server_side_confirmation_beta" to be added to your account.', 'woo-stripe-payment' )
1136
  )
1137
  );
1138
  }
1141
  * Return an array of Stripe currencies where the value of each
1142
  * currency is the curency multiplier.
1143
  *
1144
+ * @since 3.1.2
1145
  * @return mixed
1146
  * @package Stripe/Functions
1147
  */
1184
  * @param int $order_id
1185
  * @param \Stripe\ApiResource $object
1186
  *
1187
+ * @since 3.1.3
1188
  * @package Stripe/Functions
1189
  */
1190
  function wc_stripe_filter_order_id( $order_id, $object ) {
1194
  /**
1195
  * Removes order locks that have expired so the options table does not get cluttered with transients.
1196
  *
1197
+ * @since 3.1.6
1198
  * @package Stripe/Functions
1199
  */
1200
  function wc_stripe_remove_order_locks() {
includes/wc-stripe-hooks.php CHANGED
@@ -18,6 +18,7 @@ add_action( 'wc_stripe_webhook_source_chargeable', 'wc_stripe_process_source_cha
18
  add_action( 'wc_stripe_webhook_charge_succeeded', 'wc_stripe_process_charge_succeeded', 10, 2 );
19
  add_action( 'wc_stripe_webhook_charge_failed', 'wc_stripe_process_charge_failed', 10, 2 );
20
  add_action( 'wc_stripe_webhook_payment_intent_succeeded', 'wc_stripe_process_payment_intent_succeeded', 10, 2 );
 
21
  add_action( 'wc_stripe_webhook_charge_refunded', 'wc_stripe_process_create_refund' );
22
  add_action( 'wc_stripe_webhook_charge_dispute_created', 'wc_stripe_charge_dispute_created', 10, 1 );
23
  add_action( 'wc_stripe_webhook_charge_dispute_closed', 'wc_stripe_charge_dispute_closed', 10, 1 );
18
  add_action( 'wc_stripe_webhook_charge_succeeded', 'wc_stripe_process_charge_succeeded', 10, 2 );
19
  add_action( 'wc_stripe_webhook_charge_failed', 'wc_stripe_process_charge_failed', 10, 2 );
20
  add_action( 'wc_stripe_webhook_payment_intent_succeeded', 'wc_stripe_process_payment_intent_succeeded', 10, 2 );
21
+ add_action( 'wc_stripe_webhook_payment_intent_requires_action', 'wc_stripe_process_requires_action', 10, 1 );
22
  add_action( 'wc_stripe_webhook_charge_refunded', 'wc_stripe_process_create_refund' );
23
  add_action( 'wc_stripe_webhook_charge_dispute_created', 'wc_stripe_charge_dispute_created', 10, 1 );
24
  add_action( 'wc_stripe_webhook_charge_dispute_closed', 'wc_stripe_charge_dispute_closed', 10, 1 );
includes/wc-stripe-webhook-functions.php CHANGED
@@ -139,7 +139,7 @@ function wc_stripe_process_payment_intent_succeeded( $intent, $request ) {
139
  }
140
 
141
  $payment_method->set_order_lock( $order );
142
- $order->update_meta_data( WC_Stripe_Constants::PAYMENT_INTENT, WC_Stripe_Utils::sanitize_intent( $intent->jsonSerialize() ) );
143
  $result = $payment_method->payment_object->process_payment( $order );
144
  if ( ! is_wp_error( $result ) && $result->complete_payment ) {
145
  $payment_method->payment_object->payment_complete( $order, $result->charge );
@@ -354,3 +354,26 @@ function wc_stripe_review_closed( $review ) {
354
  }
355
  }
356
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
  }
140
 
141
  $payment_method->set_order_lock( $order );
142
+ $order->update_meta_data( WC_Stripe_Constants::PAYMENT_INTENT, WC_Stripe_Utils::sanitize_intent( $intent->toArray() ) );
143
  $result = $payment_method->payment_object->process_payment( $order );
144
  if ( ! is_wp_error( $result ) && $result->complete_payment ) {
145
  $payment_method->payment_object->payment_complete( $order, $result->charge );
354
  }
355
  }
356
  }
357
+
358
+ /**
359
+ * @param \Stripe\PaymentIntent $payment_intent
360
+ */
361
+ function wc_stripe_process_requires_action( $payment_intent ) {
362
+ if ( isset( $payment_intent->metadata['gateway_id'], $payment_intent->metadata['order_id'] ) ) {
363
+ if ( in_array( $payment_intent->metadata['gateway_id'], array( 'stripe_oxxo', 'stripe_boleto' ), true ) ) {
364
+ $order = wc_get_order( wc_stripe_filter_order_id( $payment_intent->metadata['order_id'], $payment_intent ) );
365
+ if ( ! $order ) {
366
+ return;
367
+ }
368
+ /**
369
+ *
370
+ * @var WC_Payment_Gateway_Stripe $payment_method
371
+ */
372
+ $payment_method = WC()->payment_gateways()->payment_gateways()[ $payment_intent->metadata['gateway_id'] ];
373
+ if ( $payment_method ) {
374
+ $payment_method->process_voucher_order_status( $order );
375
+ wc_stripe_log_info( sprintf( 'Order status processed for Voucher payment. Order ID %s. Payment Intent %s', $order->get_id(), $payment_intent->id ) );
376
+ }
377
+ }
378
+ }
379
+ }
packages/blocks/assets/js/components/checkout/checkbox/index.js DELETED
@@ -1,20 +0,0 @@
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 DELETED
@@ -1,40 +0,0 @@
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 CHANGED
@@ -1,5 +1,4 @@
1
  export * from './payment-method-label';
2
- export * from './checkbox';
3
  export * from './radio-option';
4
  export * from './payment-method';
5
  export * from './installments';
1
  export * from './payment-method-label';
 
2
  export * from './radio-option';
3
  export * from './payment-method';
4
  export * from './installments';
packages/blocks/assets/js/components/checkout/installments/index.js CHANGED
@@ -8,45 +8,45 @@ import './style.scss';
8
  export const Installments = (
9
  {
10
  paymentMethodName,
11
- stripe,
12
- getCreatePaymentMethodArgs,
13
  cardFormComplete = false,
14
- addPaymentMethodData
 
15
  }) => {
16
  const [installments, setInstallments] = useState(null);
17
  const [installment, setInstallment] = useState('');
18
  const [loading, setLoading] = useState(false);
19
  const onInstallmentSelected = (e) => {
20
  setInstallment(e.target.value);
21
- addPaymentMethodData({_stripe_installment_plan: e.target.value});
 
 
22
  }
23
- useEffect(async () => {
 
24
  if (cardFormComplete) {
25
  // fetch the installments
26
- try {
27
- setLoading(true);
28
- setInstallment('');
29
- let result = await stripe.createPaymentMethod(getCreatePaymentMethodArgs());
30
- if (result.error) {
31
- throw new StripeError(result.error);
32
- }
33
- // fetch the installment plans
34
- result = await apiFetch({
35
- url: getRoute('create/payment_intent'),
36
- method: 'POST',
37
- data: {payment_method_id: result.paymentMethod.id, payment_method: paymentMethodName}
38
- });
39
- setInstallments(result.installments);
40
- if (Object.keys(result.installments)?.length) {
41
- setInstallment(Object.keys(result.installments)[0]);
42
  }
43
- } catch (error) {
44
 
45
- } finally {
46
- setLoading(false);
47
- }
48
  }
49
- }, [cardFormComplete]);
50
 
51
  return (
52
  <div className='wc-stripe-installments__container'>
8
  export const Installments = (
9
  {
10
  paymentMethodName,
11
+ getCreatePaymentMethodArgs = null,
 
12
  cardFormComplete = false,
13
+ addPaymentMethodData = null,
14
+ getPaymentMethod
15
  }) => {
16
  const [installments, setInstallments] = useState(null);
17
  const [installment, setInstallment] = useState('');
18
  const [loading, setLoading] = useState(false);
19
  const onInstallmentSelected = (e) => {
20
  setInstallment(e.target.value);
21
+ if (addPaymentMethodData) {
22
+ addPaymentMethodData({_stripe_installment_plan: e.target.value});
23
+ }
24
  }
25
+
26
+ useEffect(() => {
27
  if (cardFormComplete) {
28
  // fetch the installments
29
+ setLoading(true);
30
+ setInstallment('');
31
+
32
+ getPaymentMethod().then(async paymentMethod => {
33
+ if (paymentMethod) {
34
+ // fetch the installment plans
35
+ const result = await apiFetch({
36
+ url: getRoute('create/payment_intent'),
37
+ method: 'POST',
38
+ data: {payment_method_id: paymentMethod, payment_method: paymentMethodName}
39
+ });
40
+ setInstallments(result.installments);
41
+ if (Object.keys(result.installments)?.length) {
42
+ setInstallment(Object.keys(result.installments)[0]);
43
+ }
 
44
  }
45
+ }).catch(error => {
46
 
47
+ }).finally(() => setLoading(false));
 
 
48
  }
49
+ }, [cardFormComplete, getPaymentMethod]);
50
 
51
  return (
52
  <div className='wc-stripe-installments__container'>
packages/blocks/assets/js/payment-methods/ach/payment-method.js CHANGED
@@ -20,7 +20,7 @@ const ACHPaymentContent = (
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});
@@ -43,10 +43,10 @@ const ACHPaymentContent = (
43
  paymentMethod: getData('name')
44
  });
45
  return (
46
- <>
47
  {isTestMode && <ACHTestModeCredentials/>}
48
  {validationError && <ValidationInputError errorMessage={validationError}/>}
49
- </>
50
  )
51
  }
52
 
20
  }) => {
21
  const {responseTypes} = emitResponse;
22
  const {onPaymentProcessing, onCheckoutAfterProcessingWithError} = eventRegistration;
23
+ const {ValidationInputError, LoadingMask} = components;
24
  const [validationError, setValidationError] = useState(false);
25
 
26
  const linkToken = useCreateLinkToken({setValidationError});
43
  paymentMethod: getData('name')
44
  });
45
  return (
46
+ <LoadingMask isLoading={!validationError && !linkToken} showSpinner={true}>
47
  {isTestMode && <ACHTestModeCredentials/>}
48
  {validationError && <ValidationInputError errorMessage={validationError}/>}
49
+ </LoadingMask>
50
  )
51
  }
52
 
packages/blocks/assets/js/payment-methods/credit-card/components/stripe-card-form.js CHANGED
@@ -7,7 +7,7 @@ const StripeCardForm = ({getData, billing, onChange: eventChange, onComplete}) =
7
  const onChange = (event) => {
8
  eventChange(event);
9
  elementStatus[event.elementType] = event;
10
- onComplete(isFormComplete);
11
  }
12
  const isFormComplete = () => {
13
  return Object.keys(elementStatus).filter(type => !!elementStatus[type].complete).length === Object.keys(elementStatus).length;
7
  const onChange = (event) => {
8
  eventChange(event);
9
  elementStatus[event.elementType] = event;
10
+ onComplete(isFormComplete());
11
  }
12
  const isFormComplete = () => {
13
  return Object.keys(elementStatus).filter(type => !!elementStatus[type].complete).length === Object.keys(elementStatus).length;
packages/blocks/assets/js/payment-methods/credit-card/payment-element.js ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {useEffect, useState, useCallback, useMemo} from '@wordpress/element';
2
+ import {Elements, PaymentElement, useStripe, useElements} from '@stripe/react-stripe-js';
3
+ import {
4
+ getSettings,
5
+ initStripe as loadStripe
6
+ } from '../util';
7
+
8
+ import {Installments} from '../../components/checkout/';
9
+
10
+ import {useProcessCheckoutError, useUpdatePaymentIntent} from "../hooks";
11
+
12
+
13
+ const getData = getSettings('stripe_cc_data');
14
+
15
+ export const PaymentElementComponent = ({cartData, ...props}) => {
16
+ const clientSecret = cartData?.extensions?.stripe_cc?.clientSecret;
17
+ return (
18
+ <>
19
+ <Elements stripe={loadStripe} options={{...getData('elementOptions'), clientSecret}}>
20
+ <CardElement {...props} clientSecret={clientSecret}/>
21
+ </Elements>
22
+ </>
23
+ );
24
+ }
25
+
26
+ const CardElement = ({onComplete, clientSecret, ...props}) => {
27
+ const [formComplete, setFormComplete] = useState(false);
28
+ const installmentsActive = getData('installmentsActive')
29
+ const elements = useElements();
30
+ const stripe = useStripe();
31
+ const {billing: {billingData}, eventRegistration, emitResponse, shouldSavePayment} = props;
32
+ const {onPaymentProcessing, onCheckoutAfterProcessingWithError} = eventRegistration;
33
+ const {responseTypes, noticeContexts} = emitResponse;
34
+ const name = getData('name');
35
+ const onChange = useCallback((event) => {
36
+ setFormComplete(event.complete);
37
+ }, []);
38
+ const {updatePaymentIntent, addPaymentMethodData} = useUpdatePaymentIntent({
39
+ clientSecret,
40
+ billingData,
41
+ eventRegistration,
42
+ responseTypes,
43
+ shouldSavePayment,
44
+ noticeContexts,
45
+ name
46
+ });
47
+
48
+ useProcessCheckoutError({
49
+ responseTypes,
50
+ subscriber: onCheckoutAfterProcessingWithError,
51
+ messageContext: noticeContexts.PAYMENTS
52
+ });
53
+
54
+ const getPaymentMethod = useCallback(async () => {
55
+ let paymentMethod = null;
56
+ const result = await updatePaymentIntent();
57
+ if (result?.paymentIntent?.payment_method) {
58
+ paymentMethod = result.paymentIntent.payment_method;
59
+ }
60
+ return paymentMethod;
61
+ }, [updatePaymentIntent]);
62
+
63
+ const options = {
64
+ fields: {
65
+ billingDetails: 'never'
66
+ },
67
+ wallets: {applePay: 'never', googlePay: 'never'}
68
+ }
69
+ return (
70
+ <>
71
+ <PaymentElement options={options} onChange={onChange}/>
72
+ {installmentsActive && <Installments
73
+ paymentMethodName={getData('name')}
74
+ stripe={stripe}
75
+ cardFormComplete={formComplete}
76
+ getPaymentMethod={getPaymentMethod}
77
+ addPaymentMethodData={addPaymentMethodData}/>}
78
+ </>
79
+ )
80
+ }
81
+
82
+ export default PaymentElementComponent;
packages/blocks/assets/js/payment-methods/credit-card/payment-method.js CHANGED
@@ -3,16 +3,14 @@ import {registerPaymentMethod} from '@woocommerce/blocks-registry';
3
  import {
4
  initStripe as loadStripe,
5
  getSettings,
6
- isUserLoggedIn,
7
- cartContainsSubscription,
8
- cartContainsPreOrder
9
  } from '../util';
10
  import {Elements, CardElement, useStripe, useElements, CardNumberElement} from '@stripe/react-stripe-js';
11
- import {PaymentMethodLabel, PaymentMethod, SavePaymentMethod} from '../../components/checkout';
12
  import SavedCardComponent from '../saved-card-component';
13
  import CustomCardForm from './components/custom-card-form';
14
  import StripeCardForm from "./components/stripe-card-form";
15
  import {Installments} from '../../components/checkout';
 
16
  import {
17
  useProcessPaymentIntent,
18
  useAfterProcessingPayment,
@@ -22,11 +20,6 @@ import {
22
 
23
  const getData = getSettings('stripe_cc_data');
24
 
25
- const displaySaveCard = (customerId) => {
26
- return isUserLoggedIn(customerId) && getData('saveCardEnabled') &&
27
- !cartContainsSubscription() && !cartContainsPreOrder()
28
- }
29
-
30
  const CreditCardContent = (props) => {
31
  const [error, setError] = useState(false);
32
  useEffect(() => {
@@ -37,6 +30,11 @@ const CreditCardContent = (props) => {
37
  if (error) {
38
  throw new Error(error);
39
  }
 
 
 
 
 
40
  return (
41
  <Elements stripe={loadStripe} options={getData('elementOptions')}>
42
  <CreditCardElement {...props}/>
@@ -51,12 +49,11 @@ const CreditCardElement = (
51
  shippingData,
52
  emitResponse,
53
  eventRegistration,
54
- activePaymentMethod
 
55
  }) => {
56
  const [error, setError] = useStripeError();
57
- const [savePaymentMethod, setSavePaymentMethod] = useState(false);
58
  const [formComplete, setFormComplete] = useState(false);
59
- const onSavePaymentMethod = (checked) => setSavePaymentMethod(checked);
60
  const {onPaymentProcessing} = eventRegistration;
61
  const stripe = useStripe();
62
  const elements = useElements();
@@ -78,7 +75,7 @@ const CreditCardElement = (
78
  emitResponse,
79
  error,
80
  onPaymentProcessing,
81
- savePaymentMethod,
82
  setupIntent,
83
  removeSetupIntent,
84
  getPaymentMethodArgs,
@@ -89,7 +86,7 @@ const CreditCardElement = (
89
  eventRegistration,
90
  responseTypes: emitResponse.responseTypes,
91
  activePaymentMethod,
92
- savePaymentMethod
93
  });
94
 
95
  const onChange = (event) => {
@@ -99,20 +96,26 @@ const CreditCardElement = (
99
  setError(false);
100
  }
101
  }
 
 
 
 
 
 
 
 
 
 
102
  const Tag = getData('customFormActive') ? CustomCardForm : StripeCardForm;
103
  return (
104
  <div className='wc-stripe-card-container'>
105
  <Tag {...{getData, billing, onChange}} onComplete={setFormComplete}/>
106
- {displaySaveCard(billing.customerId) &&
107
- <SavePaymentMethod label={getData('savePaymentMethodLabel')}
108
- onChange={onSavePaymentMethod}
109
- checked={savePaymentMethod}/>}
110
  {getData('installmentsActive') && <Installments
111
  paymentMethodName={getData('name')}
112
- stripe={stripe}
113
  cardFormComplete={formComplete}
114
- getCreatePaymentMethodArgs={getCreatePaymentMethodArgs}
115
- addPaymentMethodData={addPaymentMethodData}/>}
 
116
  </div>
117
  );
118
  }
@@ -130,7 +133,7 @@ registerPaymentMethod({
130
  edit: <PaymentMethod content={CreditCardContent} getData={getData}/>,
131
  supports: {
132
  showSavedCards: getData('showSavedCards'),
133
- showSaveOption: false,
134
  features: getData('features')
135
  }
136
  })
3
  import {
4
  initStripe as loadStripe,
5
  getSettings,
 
 
 
6
  } from '../util';
7
  import {Elements, CardElement, useStripe, useElements, CardNumberElement} from '@stripe/react-stripe-js';
8
+ import {PaymentMethodLabel, PaymentMethod} from '../../components/checkout';
9
  import SavedCardComponent from '../saved-card-component';
10
  import CustomCardForm from './components/custom-card-form';
11
  import StripeCardForm from "./components/stripe-card-form";
12
  import {Installments} from '../../components/checkout';
13
+ import PaymentElementComponent from './payment-element';
14
  import {
15
  useProcessPaymentIntent,
16
  useAfterProcessingPayment,
20
 
21
  const getData = getSettings('stripe_cc_data');
22
 
 
 
 
 
 
23
  const CreditCardContent = (props) => {
24
  const [error, setError] = useState(false);
25
  useEffect(() => {
30
  if (error) {
31
  throw new Error(error);
32
  }
33
+ if (getData('isPaymentElement')) {
34
+ return (
35
+ <PaymentElementComponent {...props}/>
36
+ )
37
+ }
38
  return (
39
  <Elements stripe={loadStripe} options={getData('elementOptions')}>
40
  <CreditCardElement {...props}/>
49
  shippingData,
50
  emitResponse,
51
  eventRegistration,
52
+ activePaymentMethod,
53
+ shouldSavePayment
54
  }) => {
55
  const [error, setError] = useStripeError();
 
56
  const [formComplete, setFormComplete] = useState(false);
 
57
  const {onPaymentProcessing} = eventRegistration;
58
  const stripe = useStripe();
59
  const elements = useElements();
75
  emitResponse,
76
  error,
77
  onPaymentProcessing,
78
+ shouldSavePayment,
79
  setupIntent,
80
  removeSetupIntent,
81
  getPaymentMethodArgs,
86
  eventRegistration,
87
  responseTypes: emitResponse.responseTypes,
88
  activePaymentMethod,
89
+ shouldSavePayment
90
  });
91
 
92
  const onChange = (event) => {
96
  setError(false);
97
  }
98
  }
99
+
100
+ const getPaymentMethod = useCallback(async () => {
101
+ let paymentMethod = null;
102
+ const result = await stripe.createPaymentMethod(getCreatePaymentMethodArgs());
103
+ if (result?.paymentMethod?.id) {
104
+ paymentMethod = result.paymentMethod.id;
105
+ }
106
+ return paymentMethod;
107
+ }, [stripe, getCreatePaymentMethodArgs]);
108
+
109
  const Tag = getData('customFormActive') ? CustomCardForm : StripeCardForm;
110
  return (
111
  <div className='wc-stripe-card-container'>
112
  <Tag {...{getData, billing, onChange}} onComplete={setFormComplete}/>
 
 
 
 
113
  {getData('installmentsActive') && <Installments
114
  paymentMethodName={getData('name')}
 
115
  cardFormComplete={formComplete}
116
+ addPaymentMethodData={addPaymentMethodData}
117
+ getPaymentMethod={getPaymentMethod}/>}
118
+
119
  </div>
120
  );
121
  }
133
  edit: <PaymentMethod content={CreditCardContent} getData={getData}/>,
134
  supports: {
135
  showSavedCards: getData('showSavedCards'),
136
+ showSaveOption: true,
137
  features: getData('features')
138
  }
139
  })
packages/blocks/assets/js/payment-methods/hooks/index.js CHANGED
@@ -6,4 +6,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'
 
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';
10
+ export * from './use-update-payment-intent';
packages/blocks/assets/js/payment-methods/hooks/use-after-process-payment.js CHANGED
@@ -9,7 +9,7 @@ export const useAfterProcessingPayment = (
9
  eventRegistration,
10
  responseTypes,
11
  activePaymentMethod,
12
- savePaymentMethod = false,
13
  messageContext = null
14
  }) => {
15
  const stripe = useStripe();
@@ -28,7 +28,7 @@ export const useAfterProcessingPayment = (
28
  responseTypes,
29
  stripe,
30
  getData,
31
- savePaymentMethod
32
  });
33
  }
34
  return null;
@@ -39,6 +39,6 @@ export const useAfterProcessingPayment = (
39
  responseTypes,
40
  onCheckoutAfterProcessingWithSuccess,
41
  activePaymentMethod,
42
- savePaymentMethod
43
  ]);
44
  }
9
  eventRegistration,
10
  responseTypes,
11
  activePaymentMethod,
12
+ shouldSavePayment = false,
13
  messageContext = null
14
  }) => {
15
  const stripe = useStripe();
28
  responseTypes,
29
  stripe,
30
  getData,
31
+ shouldSavePayment
32
  });
33
  }
34
  return null;
39
  responseTypes,
40
  onCheckoutAfterProcessingWithSuccess,
41
  activePaymentMethod,
42
+ shouldSavePayment
43
  ]);
44
  }
packages/blocks/assets/js/payment-methods/hooks/use-process-payment-intent.js CHANGED
@@ -20,7 +20,7 @@ export const useProcessPaymentIntent = (
20
  paymentType = 'card',
21
  setupIntent = null,
22
  removeSetupIntent = null,
23
- savePaymentMethod = false,
24
  exportedValues = {},
25
  getPaymentMethodArgs = () => ({})
26
  }) => {
@@ -47,12 +47,12 @@ export const useProcessPaymentIntent = (
47
  return {...args, ...currentPaymentMethodArgs.current()};
48
  }, [billingData, paymentType, getPaymentMethodArgs]);
49
 
50
- const getSuccessResponse = useCallback((paymentMethodId, savePaymentMethod) => {
51
  const response = {
52
  meta: {
53
  paymentMethodData: {
54
  [`${getData('name')}_token_key`]: paymentMethodId,
55
- [`${getData('name')}_save_source_key`]: savePaymentMethod,
56
  ...paymentMethodData.current
57
  }
58
  }
@@ -104,7 +104,7 @@ export const useProcessPaymentIntent = (
104
  paymentMethodId = result.paymentMethod.id;
105
  }
106
  }
107
- return ensureSuccessResponse(responseTypes, getSuccessResponse(paymentMethodId, savePaymentMethod));
108
  } catch (e) {
109
  console.log(e);
110
  setPaymentMethod(null);
@@ -120,7 +120,7 @@ export const useProcessPaymentIntent = (
120
  stripe,
121
  setupIntent,
122
  activePaymentMethod,
123
- savePaymentMethod
124
  ]);
125
  return {
126
  setPaymentMethod,
20
  paymentType = 'card',
21
  setupIntent = null,
22
  removeSetupIntent = null,
23
+ shouldSavePayment = false,
24
  exportedValues = {},
25
  getPaymentMethodArgs = () => ({})
26
  }) => {
47
  return {...args, ...currentPaymentMethodArgs.current()};
48
  }, [billingData, paymentType, getPaymentMethodArgs]);
49
 
50
+ const getSuccessResponse = useCallback((paymentMethodId, shouldSavePayment) => {
51
  const response = {
52
  meta: {
53
  paymentMethodData: {
54
  [`${getData('name')}_token_key`]: paymentMethodId,
55
+ [`${getData('name')}_save_source_key`]: shouldSavePayment,
56
  ...paymentMethodData.current
57
  }
58
  }
104
  paymentMethodId = result.paymentMethod.id;
105
  }
106
  }
107
+ return ensureSuccessResponse(responseTypes, getSuccessResponse(paymentMethodId, shouldSavePayment));
108
  } catch (e) {
109
  console.log(e);
110
  setPaymentMethod(null);
120
  stripe,
121
  setupIntent,
122
  activePaymentMethod,
123
+ shouldSavePayment
124
  ]);
125
  return {
126
  setPaymentMethod,
packages/blocks/assets/js/payment-methods/hooks/use-update-payment-intent.js ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {useState, useEffect, useRef, useCallback} from '@wordpress/element';
2
+ import {useStripe, useElements} from "@stripe/react-stripe-js";
3
+ import {ensureErrorResponse, ensureSuccessResponse, getBillingDetailsFromAddress, StripeError, isNextActionRequired, getRoute} from '../util';
4
+ import apiFetch from "@wordpress/api-fetch";
5
+
6
+ export const useUpdatePaymentIntent = (
7
+ {
8
+ clientSecret,
9
+ billingData,
10
+ eventRegistration,
11
+ responseTypes,
12
+ name,
13
+ shouldSavePayment,
14
+ noticeContexts
15
+ }
16
+ ) => {
17
+ const {onPaymentProcessing, onCheckoutAfterProcessingWithSuccess} = eventRegistration;
18
+ const currentData = useRef({billingData});
19
+ const paymentMethodData = useRef({});
20
+ const stripe = useStripe();
21
+ const elements = useElements();
22
+
23
+ const getSuccessResponse = useCallback((paymentMethod, shouldSavePayment) => {
24
+ const response = {
25
+ meta: {
26
+ paymentMethodData: {
27
+ [`${name}_token_key`]: paymentMethod,
28
+ [`${name}_save_source_key`]: shouldSavePayment,
29
+ ...paymentMethodData.current
30
+ }
31
+ }
32
+ }
33
+ return response;
34
+ }, []);
35
+
36
+ const addPaymentMethodData = useCallback((data) => {
37
+ paymentMethodData.current = {...paymentMethodData.current, ...data};
38
+ }, []);
39
+
40
+ const updatePaymentIntent = useCallback(async () => {
41
+ const {billingData} = currentData.current;
42
+ return await stripe.updatePaymentIntent({
43
+ elements,
44
+ params: {
45
+ payment_method_data: {
46
+ billing_details: getBillingDetailsFromAddress(billingData)
47
+ }
48
+ }
49
+ });
50
+ }, [stripe, elements]);
51
+
52
+ const confirmPayment = useCallback(async () => {
53
+ const {billingData} = currentData.current;
54
+ return await stripe.confirmPayment({
55
+ elements,
56
+ confirmParams: {
57
+ payment_method_data: {
58
+ billing_details: getBillingDetailsFromAddress(billingData)
59
+ }
60
+ },
61
+ redirect: 'if_required'
62
+ });
63
+ }, [stripe, elements]);
64
+
65
+ useEffect(() => {
66
+ currentData.current = {billingData};
67
+ });
68
+
69
+ useEffect(() => {
70
+ const unsubscribe = onPaymentProcessing(async () => {
71
+
72
+ try {
73
+ let paymentMethod = null;
74
+ let result = await stripe.retrievePaymentIntent(clientSecret);
75
+ if (result.paymentIntent.status === 'requires_action') {
76
+ paymentMethod = result.paymentIntent.payment_method;
77
+ await confirmPayment();
78
+ } else {
79
+ result = await updatePaymentIntent();
80
+ if (result.error) {
81
+ throw new StripeError(result.error);
82
+ }
83
+ paymentMethod = result.paymentIntent.payment_method;
84
+ }
85
+ return ensureSuccessResponse(responseTypes, getSuccessResponse(paymentMethod, shouldSavePayment));
86
+ } catch (error) {
87
+ return ensureErrorResponse(responseTypes, error, {messageContext: noticeContexts.PAYMENTS});
88
+ }
89
+ });
90
+ return () => unsubscribe();
91
+ }, [
92
+ onPaymentProcessing,
93
+ updatePaymentIntent,
94
+ confirmPayment,
95
+ clientSecret,
96
+ shouldSavePayment
97
+ ]);
98
+
99
+ useEffect(() => {
100
+ const unsubscribe = onCheckoutAfterProcessingWithSuccess(async ({redirectUrl}) => {
101
+ const result = isNextActionRequired(redirectUrl);
102
+ if (result) {
103
+ const {client_secret, order_id, order_key} = result;
104
+ try {
105
+ let response = await confirmPayment();
106
+ if (response.error) {
107
+ throw new StripeError(response.error);
108
+ }
109
+ response = await apiFetch({
110
+ url: getRoute('process/payment'),
111
+ method: 'POST',
112
+ data: {order_id, order_key, [`${name}_save_source_key`]: shouldSavePayment}
113
+ })
114
+ if (response.messages) {
115
+ return ensureErrorResponse(responseTypes, response.messages);
116
+ }
117
+ return ensureSuccessResponse(responseTypes, {
118
+ redirectUrl: response.redirect
119
+ });
120
+ } catch (error) {
121
+ return ensureErrorResponse(responseTypes, error, {messageContext: noticeContexts.PAYMENTS});
122
+ }
123
+ } else {
124
+ return ensureSuccessResponse(responseTypes);
125
+ }
126
+ });
127
+ return () => unsubscribe();
128
+ }, [
129
+ onCheckoutAfterProcessingWithSuccess,
130
+ confirmPayment,
131
+ shouldSavePayment
132
+ ]);
133
+
134
+ return {
135
+ updatePaymentIntent,
136
+ addPaymentMethodData
137
+ }
138
+ }
packages/blocks/assets/js/payment-methods/link/hooks/index.js ADDED
@@ -0,0 +1 @@
 
1
+ export * from './use-link';
packages/blocks/assets/js/payment-methods/link/hooks/use-link.js ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {useEffect, useState, useRef} from '@wordpress/element';
2
+ import {useStripe, useElements} from "@stripe/react-stripe-js";
3
+ import {toCartAddress as mapToCartAddress, ensureSuccessResponse, getBillingDetailsFromAddress} from '../../util';
4
+
5
+ const toCartAddress = mapToCartAddress();
6
+
7
+ export const useLink = (
8
+ {
9
+ email,
10
+ eventRegistration,
11
+ onClick,
12
+ onSubmit,
13
+ isActive,
14
+ responseTypes,
15
+ ...props
16
+ }) => {
17
+ const [link, setLink] = useState();
18
+ const stripe = useStripe();
19
+ const elements = useElements();
20
+ const currentData = useRef();
21
+ const linkData = useRef();
22
+ const {onPaymentProcessing} = eventRegistration;
23
+ useEffect(() => {
24
+ currentData.current = {onClick, onSubmit}
25
+ });
26
+
27
+ useEffect(() => {
28
+ if (stripe && elements) {
29
+ setLink(stripe?.linkAutofillModal(elements));
30
+ }
31
+ }, [stripe, elements]);
32
+
33
+ useEffect(() => {
34
+ if (link) {
35
+ link.launch({email});
36
+ }
37
+ }, [link, email]);
38
+
39
+ useEffect(() => {
40
+ if (link) {
41
+ link.on('autofill', event => {
42
+ linkData.current = event;
43
+ currentData.current.onSubmit();
44
+
45
+ });
46
+ link.on('authenticated', event => {
47
+ currentData.current.onClick();
48
+ })
49
+ }
50
+ }, [link]);
51
+
52
+ useEffect(() => {
53
+ if (isActive) {
54
+ const unsubscribe = onPaymentProcessing(async () => {
55
+ const response = {meta: {}};
56
+ const {shippingAddress = null, billingAddress = null} = linkData.current.value;
57
+ if (billingAddress) {
58
+ response.meta.billingData = toCartAddress({...billingAddress.address, recipient: billingAddress.name})
59
+ }
60
+ if (shippingAddress) {
61
+ response.meta.shippingData = toCartAddress({...shippingAddress.address, recipient: shippingAddress.name})
62
+ }
63
+ // update the payment intent
64
+ try {
65
+ const result = await stripe.updatePaymentIntent({
66
+ elements,
67
+ params: {
68
+ payment_method_data: {
69
+ billing_details: getBillingDetailsFromAddress(response.meta.billingData)
70
+ }
71
+ }
72
+ });
73
+ response.meta.paymentMethodData = {
74
+ stripe_cc_token_key: result.paymentIntent.payment_method,
75
+ stripe_cc_save_source_key: false,
76
+ }
77
+ } catch (error) {
78
+ console.log(error);
79
+ }
80
+ return ensureSuccessResponse(responseTypes, response);
81
+ });
82
+
83
+ return () => unsubscribe();
84
+ }
85
+ }, [isActive, onPaymentProcessing, stripe, elements])
86
+
87
+ return link;
88
+ }
packages/blocks/assets/js/payment-methods/link/index.js ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {useEffect, useState} from '@wordpress/element';
2
+ import {Elements, useStripe, useElements, PaymentElement} from "@stripe/react-stripe-js";
3
+ import {registerExpressPaymentMethod} from '@woocommerce/blocks-registry';
4
+ import {useLink} from './hooks';
5
+ import {getSettings, initStripe as loadStripe, canMakePayment} from "../util";
6
+
7
+ const getData = getSettings('stripe_link_checkout_data');
8
+
9
+ export const LinkComponent = ({cartData, ...props}) => {
10
+ const clientSecret = cartData?.extensions?.stripe_link_checkout?.clientSecret;
11
+ if (clientSecret) {
12
+ return (
13
+ <Elements stripe={loadStripe} options={{clientSecret}}>
14
+ <LinkCheckout {...props}/>
15
+ </Elements>
16
+ );
17
+ }
18
+ return null;
19
+ }
20
+
21
+ const LinkCheckout = (
22
+ {
23
+ billing,
24
+ shipping,
25
+ eventRegistration,
26
+ onClick,
27
+ onSubmit,
28
+ activePaymentMethod,
29
+ emitResponse,
30
+ ...props
31
+ }) => {
32
+ const {billingData, currency} = billing;
33
+ const {responseTypes, noticeContexts} = emitResponse;
34
+ const {email} = billingData;
35
+ const isActive = activePaymentMethod === getData('name');
36
+ useLink({
37
+ email,
38
+ eventRegistration,
39
+ onClick,
40
+ onSubmit,
41
+ isActive,
42
+ responseTypes
43
+ });
44
+ return <div style={{display: 'none'}}><PaymentElement/></div>;
45
+ }
46
+
47
+ registerExpressPaymentMethod({
48
+ name: getData('name'),
49
+ canMakePayment: (props) => {
50
+ return true;
51
+ },
52
+ content: <LinkComponent/>,
53
+ edit: <LinkComponent/>,
54
+ supports: {
55
+ showSavedCards: getData('showSavedCards'),
56
+ showSaveOption: getData('showSaveOption'),
57
+ features: getData('features')
58
+ }
59
+ })
packages/blocks/assets/js/payment-methods/util.js CHANGED
@@ -3,7 +3,7 @@ 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
 
@@ -50,7 +50,7 @@ const PAYMENT_REQUEST_ADDRESS_MAPPINGS = {
50
  }
51
 
52
  export const initStripe = new Promise((resolve, reject) => {
53
- loadStripe(publishableKey, (() => account ? {stripeAccount: account} : {})()).then(stripe => {
54
  resolve(stripe);
55
  }).catch(err => {
56
  resolve({error: err});
@@ -79,8 +79,8 @@ export const ensureSuccessResponse = (responseTypes, data = {}) => {
79
  * @param error
80
  * @returns {{type: *, message: *}}
81
  */
82
- export const ensureErrorResponse = (responseTypes, error) => {
83
- return {type: responseTypes.ERROR, message: getErrorMessage(error)}
84
  };
85
 
86
  /**
@@ -513,4 +513,13 @@ export const versionCompare = (ver1, ver2, compare) => {
513
 
514
  export const isCartPage = () => getSetting('stripeGeneralData').page === 'cart';
515
 
516
- export const isCheckoutPage = () => getSetting('stripeGeneralData').page === 'checkout';
 
 
 
 
 
 
 
 
 
3
  import apiFetch from "@wordpress/api-fetch";
4
  import {getCurrency, formatPrice as wcFormatPrice} from '@woocommerce/price-format';
5
 
6
+ const {publishableKey, stripeParams} = getSetting('stripeGeneralData');
7
  const messages = getSetting('stripeErrorMessages');
8
  const countryLocale = getSetting('countryLocale', {});
9
 
50
  }
51
 
52
  export const initStripe = new Promise((resolve, reject) => {
53
+ loadStripe(publishableKey, stripeParams).then(stripe => {
54
  resolve(stripe);
55
  }).catch(err => {
56
  resolve({error: err});
79
  * @param error
80
  * @returns {{type: *, message: *}}
81
  */
82
+ export const ensureErrorResponse = (responseTypes, error, options = {}) => {
83
+ return {type: responseTypes.ERROR, message: getErrorMessage(error), ...options}
84
  };
85
 
86
  /**
513
 
514
  export const isCartPage = () => getSetting('stripeGeneralData').page === 'cart';
515
 
516
+ export const isCheckoutPage = () => getSetting('stripeGeneralData').page === 'checkout';
517
+
518
+ export const isNextActionRequired = (url) => {
519
+ let match = url.match(/#response=(.+)/);
520
+ let args = null;
521
+ if (match) {
522
+ args = JSON.parse(window.atob(decodeURIComponent(match[1])));
523
+ }
524
+ return args;
525
+ }
packages/blocks/build/commons.js CHANGED
@@ -1,3 +1,3 @@
1
  /*! For license information please see commons.js.LICENSE.txt */
2
- (self.webpackChunkwc_stripe_name_=self.webpackChunkwc_stripe_name_||[]).push([[351],{7228:e=>{e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}},2858:e=>{e.exports=function(e){if(Array.isArray(e))return e}},3646:(e,t,n)=>{var r=n(7228);e.exports=function(e){if(Array.isArray(e))return r(e)}},1506:e=>{e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},8926:e=>{function t(e,t,n,r,a,o,i){try{var s=e[o](i),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).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 s(e){t(i,a,o,s,c,"next",e)}function c(e){t(i,a,o,s,c,"throw",e)}s(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,s=e[Symbol.iterator]();!(r=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==s.return||s.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 s(t){var n="function"==typeof Map?new Map:void 0;return e.exports=s=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)},s(t)}e.exports=s},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,s=e[Symbol.iterator]();!(r=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==s.return||s.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 s(){}s.resetWarningCache=i;var c,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:s,resetWarningCache:i};return n.PropTypes=n,n}()}(c={exports:{}},c.exports),c.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 s={},c=0;c<o.length;c+=1)s[o[c]]=!0;for(var u=0;u<i.length;u+=1)s[i[u]]=!0;var d=Object.keys(s);if(d.length!==o.length)return!1;var m=t,f=n;return d.every((function(t){return e(m[t],f[t])}))},m=function(e){var n=t.useRef(e);return t.useEffect((function(){n.current=e}),[e]),n.current},f=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(f)};var t=f(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),s=t.useRef(!0),c=t.useMemo((function(){return y(n)}),[n]),u=a(t.useState((function(){return{stripe:null,elements:null}})),2),l=u[0],p=u[1],f=m(n),v=m(r);return null!==f&&(f!==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"===c.tag&&(i.current=!0,p({stripe:c.stripe,elements:c.stripe.elements(r)})),"async"===c.tag&&(i.current=!0,c.stripePromise.then((function(e){e&&s.current&&p({stripe:e,elements:e.elements(r)})})))),t.useEffect((function(){return function(){s.current=!1}}),[]),t.useEffect((function(){var e=l.stripe;e&&e._registerWrapper&&e._registerWrapper({name:"react-stripe-js",version:"1.4.0"})}),[l.stripe]),t.createElement(g.Provider,{value:l},o)};v.propTypes={stripe:u.any,options:u.object};var h=function(e){return function(e,t){if(!e)throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(t," in an <Elements> provider."));return e}(t.useContext(g),e)},b=function(e){return(0,e.children)(h("mounts <ElementsConsumer>"))};b.propTypes={children:u.func.isRequired};var P=function(e){var n=t.useRef(e);return t.useEffect((function(){n.current=e}),[e]),function(){n.current&&n.current.apply(n,arguments)}},E=function(e){return l(e)?(e.paymentRequest,r(e,["paymentRequest"])):{}},O=function(){},S=function(e,n){var r,a="".concat((r=e).charAt(0).toUpperCase()+r.slice(1),"Element"),o=n?function(e){h("mounts <".concat(a,">"));var n=e.id,r=e.className;return t.createElement("div",{id:n,className:r})}:function(n){var r=n.id,o=n.className,i=n.options,s=void 0===i?{}:i,c=n.onBlur,u=void 0===c?O:c,l=n.onFocus,p=void 0===l?O:l,m=n.onReady,f=void 0===m?O:m,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),M=t.useRef(null),k=P(f),j=P(u),D=P(p),x=P(_),R=P(g),A=P(b);t.useLayoutEffect((function(){if(null==C.current&&w&&null!=M.current){var t=w.create(e,s);C.current=t,t.mount(M.current),t.on("ready",(function(){return k(t)})),t.on("change",R),t.on("blur",j),t.on("focus",D),t.on("escape",A),t.on("click",x)}}));var I=t.useRef(s);return t.useEffect((function(){I.current&&I.current.paymentRequest!==s.paymentRequest&&console.warn("Unsupported prop change: options.paymentRequest is not a customizable property.");var e=E(s);0===Object.keys(e).length||d(e,E(I.current))||C.current&&(C.current.update(e),I.current=s)}),[s]),t.useLayoutEffect((function(){return function(){C.current&&C.current.destroy()}}),[]),t.createElement("div",{id:r,className:o,ref:M})};return o.propTypes={id:u.string,className:u.string,onChange:u.func,onBlur:u.func,onFocus:u.func,onReady:u.func,onClick:u.func,options:u.object},o.displayName=a,o.__elementType=e,o},_="undefined"==typeof window,w=S("auBankAccount",_),C=S("card",_),M=S("cardNumber",_),k=S("cardExpiry",_),j=S("cardCvc",_),D=S("fpxBank",_),x=S("iban",_),R=S("idealBank",_),A=S("p24Bank",_),I=S("epsBank",_),L=S("paymentRequestButton",_),T=S("afterpayClearpayMessage",_);e.AfterpayClearpayMessageElement=T,e.AuBankAccountElement=w,e.CardCvcElement=j,e.CardElement=C,e.CardExpiryElement=k,e.CardNumberElement=M,e.Elements=v,e.ElementsConsumer=b,e.EpsBankElement=I,e.FpxBankElement=D,e.IbanElement=x,e.IdealBankElement=R,e.P24BankElement=A,e.PaymentRequestButtonElement=L,e.useElements=function(){return h("calls useElements()").elements},e.useStripe=function(){return h("calls useStripe()").stripe},Object.defineProperty(e,"__esModule",{value:!0})}(t,n(3804))},4465:(e,t,n)=>{"use strict";n.r(t),n.d(t,{loadStripe:()=>l});var r="https://js.stripe.com/v3",a=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,o="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",i=null,s=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},c=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;c.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 c.then((function(e){return s(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]}}))}));var s=n(3193);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]}}))}))},3193:(e,t,n)=>{var r=n(3027),a=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Installments=void 0;var o=a(n(7015)),i=a(n(8926)),s=a(n(3038)),c=n(3027),u=n(3163),l=a(n(7606)),p=a(n(4184)),d=n(1134);n(1465);var m=function(e){var t=e.paymentMethodName,n=e.stripe,a=e.getCreatePaymentMethodArgs,p=e.cardFormComplete,m=void 0!==p&&p,g=e.addPaymentMethodData,v=(0,c.useState)(null),h=(0,s.default)(v,2),b=h[0],P=h[1],E=(0,c.useState)(""),O=(0,s.default)(E,2),S=O[0],_=O[1],w=(0,c.useState)(!1),C=(0,s.default)(w,2),M=C[0],k=C[1];return(0,c.useEffect)((0,i.default)(o.default.mark((function e(){var r,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!m){e.next=21;break}return e.prev=1,k(!0),_(""),e.next=6,n.createPaymentMethod(a());case 6:if(!(i=e.sent).error){e.next=9;break}throw new d.StripeError(i.error);case 9:return e.next=11,(0,l.default)({url:(0,d.getRoute)("create/payment_intent"),method:"POST",data:{payment_method_id:i.paymentMethod.id,payment_method:t}});case 11:i=e.sent,P(i.installments),null!==(r=Object.keys(i.installments))&&void 0!==r&&r.length&&_(Object.keys(i.installments)[0]),e.next=18;break;case 16:e.prev=16,e.t0=e.catch(1);case 18:return e.prev=18,k(!1),e.finish(18);case 21:case"end":return e.stop()}}),e,null,[[1,16,18,21]])}))),[m]),r.createElement("div",{className:"wc-stripe-installments__container"},r.createElement("label",null,(0,u.__)("Pay in installments:","woo-stripe-payment"),r.createElement(y,{loading:M})),r.createElement(f,{installment:S,onChange:function(e){_(e.target.value),g({_stripe_installment_plan:e.target.value})},installments:b,isLoading:M}))};t.Installments=m;var f=function(e){var t,n=e.installment,a=e.installments,o=e.onChange,i=e.isLoading;return t=i?r.createElement("option",{value:"",disabled:!0},(0,u.__)("Loading installments...","woo-stripe-payment")):null===a?r.createElement("option",{value:"",disabled:!0},(0,u.__)("Fill out card form for eligibility.","woo-stripe-payment")):Object.keys(a).map((function(e){return r.createElement("option",{key:e,value:e,dangerouslySetInnerHTML:{__html:a[e].text}})})),r.createElement("select",{value:n,onChange:o,className:(0,p.default)({loading:i})},t)},y=function(e){var t=e.loading;return r.createElement("div",{className:"wc-stripe-installment-loader__container"},t&&r.createElement("div",{className:"wc-stripe-installment-loader"},r.createElement("div",null),r.createElement("div",null),r.createElement("div",null)))},g=m;t.default=g},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,s=i.PaymentMethodLabel,c=i.PaymentMethodIcons;return Array.isArray(n)||(n=[n]),r.createElement("span",{className:"wc-stripe-label-container ".concat(a)},r.createElement(s,{text:t}),r.createElement(c,{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)),s=n(3027);function c(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?c(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(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,c=t("description"),p=(0,s.useRef)(null);return(0,s.useEffect)((function(){p.current&&0==p.current.childNodes.length&&p.current.classList.add("no-content")})),r.createElement(r.Fragment,null,c&&r.createElement(l,{desc:c,payment_method:t("name")}),r.createElement("div",{ref:p,className:"wc-stripe-blocks-payment-method-content"},r.createElement(o,u(u({},a),{},{getData:t}))))};var l=function(e){var t=e.desc,n=e.payment_method;return r.createElement("div",{className:"wc-stripe-blocks-payment-method__desc ".concat(n)},r.createElement("p",null,t))}},8744:(e,t,n)=>{var r=n(3027),a=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.RadioControlOption=void 0;var o=a(n(4184)),i=function(e){var t=e.checked,n=e.onChange,a=e.value,i=e.label;return r.createElement("label",{className:(0,o.default)("wc-stripe-blocks-radio-control__option",{"wc-stripe-blocks-radio-control__option-checked":t})},r.createElement("input",{className:"wc-stripe-blocks-radio-control__input",type:"radio",value:a,checked:t,onChange:function(e){return n(e.target.value)}}),r.createElement("div",{className:"wc-stripe-blocks-radio-control__label"},r.createElement("span",null,i)))};t.RadioControlOption=i;var s=i;t.default=s},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)),s=n(3027),c=r(n(7606)),u=n(1134);t.useCreateLinkToken=function(e){var t=e.setValidationError,n=(0,s.useState)(!1),r=(0,i.default)(n,2),l=r[0],p=r[1],d=(0,s.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,c.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,s.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),s=(0,a.useRef)(null),c=(0,a.useCallback)((function(){return new Promise((function(e,t){s.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){s.current.resolve({publicToken:e,metaData:t})},onExit:function(e){s.current.reject(!!e&&(0,i.getErrorMessage)(e.error_message))}}))}),[n]),c}},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)),s=n(3027),c=n(1134);t.useProcessPayment=function(e){var t=e.openLinkPopup,n=e.onPaymentProcessing,r=e.responseTypes,u=e.paymentMethod;(0,s.useEffect)((function(){var e=n((0,i.default)(a.default.mark((function e(){var n,i,s,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,s=i.publicToken,l=i.metaData,(0,c.deleteFromCache)("linkToken"),e.abrupt("return",(0,c.ensureSuccessResponse)(r,{meta:{paymentMethodData:(n={},(0,o.default)(n,"".concat(u,"_token_key"),s),(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,c.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)),s=n(3027),c=n(4222),u=n(1134),l=n(3187),p=a(n(1065)),d=n(7260),m=n(3636),f=n(3163),y=(0,u.getSettings)("stripe_ach_data"),g=function(e){var t=e.getData,n=e.eventRegistration,a=e.components,c=e.emitResponse,l=e.onSubmit,p=((0,i.default)(e,["getData","eventRegistration","components","emitResponse","onSubmit"]),c.responseTypes),f=n.onPaymentProcessing,y=n.onCheckoutAfterProcessingWithError,g=a.ValidationInputError,h=(0,s.useState)(!1),b=(0,o.default)(h,2),P=b[0],E=b[1],O=(0,d.useCreateLinkToken)({setValidationError:E});(0,m.useProcessCheckoutError)({responseTypes:p,subscriber:y});var S=(0,d.useInitializePlaid)({getData:t,linkToken:O,onSubmit:l});return(0,d.useProcessPayment)({openLinkPopup:S,onPaymentProcessing:f,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,f.__)("Test Credentials","woo-stripe-payment")),r.createElement("div",{className:"wc-stripe-blocks-ach__username"},r.createElement("div",null,r.createElement("strong",null,(0,f.__)("username","woo-stripe-payment")),": user_good"),r.createElement("div",null,r.createElement("strong",null,(0,f.__)("password","woo-stripe-payment")),": pass_good"),r.createElement("div",null,r.createElement("strong",null,(0,f.__)("pin","woo-stripe-payment")),": credential_good")))};(0,c.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)),s=n(3027),c=n(4222),u=n(1134),l=n(6664),p=a(n(7082)),d=n(3636),m=(0,u.getSettings)("stripe_applepay_data"),f=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,c=e.billing,u=e.shippingData,p=e.eventRegistration,m=e.emitResponse,f=e.onSubmit,y=e.activePaymentMethod,g=((0,i.default)(e,["getData","onClick","onClose","billing","shippingData","eventRegistration","emitResponse","onSubmit","activePaymentMethod"]),p.onPaymentProcessing),v=m.responseTypes,h=m.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:c,shippingData:u,onPaymentProcessing:g,emitResponse:m,error:E,onSubmit:f,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:c,shippingData:u,eventRegistration:p,setPaymentMethod:S,exportedValues:O,canPay:function(e){return null!=e&&e.applePay}}).paymentRequest,w=(0,s.useCallback)((function(e){_&&(e.preventDefault(),n(),_.show())}),[_,n]);return _?r.createElement("button",{className:"apple-pay-button ".concat(t("buttonStyle")),style:{"-apple-pay-button-type":t("buttonType")},onClick:w}):null},g=function(e){var t=e.getData;return(0,i.default)(e,["getData"]),r.createElement("div",{className:"apple-pay-block-editor"},r.createElement("img",{src:t("editorIcon")}))};(0,c.registerExpressPaymentMethod)({name:m("name"),canMakePayment:function(e){var t=e.cartTotals;if((0,i.default)(e,["cartTotals"]),m("isAdmin"))return!0;var n=t.currency_code,r=t.total_price;return(0,u.canMakePayment)({country:m("countryCode"),currency:n.toLowerCase(),total:{label:m("totalLabel"),amount:parseInt(r)}},(function(e){return null!=e&&e.applePay}))},content:r.createElement(f,{getData:m}),edit:r.createElement(g,{getData:m}),supports:{showSavedCards:m("showSavedCards"),showSaveOption:m("showSaveOption"),features:m("features")}})},7354:(e,t,n)=>{var r=n(3027);n(3110);var a=n(1134),o=n(6664),i=n(3163),s=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(s,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)),s=n(1134),c=n(3027),u=n(6664),l=n(3163),p=n(3636);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m(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 f={focus:"focused",empty:"empty",invalid:"invalid"},y=function(e){var t=e.type,n=e.src;return t?r.createElement("img",{className:"wc-stripe-card ".concat(t),src:n}):null};t.default=function(e){var t=e.getData,n=e.onChange,a=e.onComplete,o=(0,c.useState)(""),d=(0,i.default)(o,2),g=d[0],v=d[1],h=(0,c.useRef)([]),b=(0,c.useState)(null),P=(0,i.default)(b,2),E=P[0],O=P[1],S=(0,u.useElements)(),_=t("customForm"),w=(0,s.getCreditCardForm)(_),C=w.component,M=void 0===C?null:C,k=w.breakpoint,j=void 0===k?475:k,D=t("postalCodeEnabled"),x={},R=(0,c.useRef)({cardNumber:{},cardExpiry:{},cardCvc:{}});["cardNumber","cardExpiry","cardCvc"].forEach((function(e){x[e]=m(m({classes:f},t("cardOptions")),t("customFieldOptions")[e])}));var A=(0,c.useCallback)((function(e){h.current.includes(e)||h.current.push(e)}),[]);(0,p.useBreakpointWidth)({name:"creditCardForm",width:j,node:E,className:"small-form"});var I=(0,c.useCallback)((function(e){for(var n=0,r=Object.keys(t("cards"));n<r.length;n++){var a=r[n];if(a===e)return t("cards")[a]}return""}),[]);return M?r.createElement("div",{className:"wc-stripe-custom-form ".concat(_),ref:O},(0,c.cloneElement)(M,{postalCodeEnabled:D,options:x,onChange:function(e){return A(e),function(t){if(n(t),R.current[t.elementType]=t,"cardNumber"===t.elementType&&("unknown"===t.brand?v(""):v(t.brand)),t.complete){var r=h.current.indexOf(e);if(h.current[r+1]){var o=h.current[r+1];S.getElement(o).focus()}}var i;a((i=R.current,Object.keys(i).filter((function(e){return!!i[e].complete})).length===Object.keys(i).length))}},CardIcon:r.createElement(y,{type:g,src:I(g)})})):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")[_])))}},6835:(e,t,n)=>{var r=n(3027);n(8356);var a=n(1134),o=n(6664),i=n(3163),s=n(3027),c=function(e){var t=e.CardIcon,n=e.options,a=e.onChange;return(0,s.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(c,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),s=n(1134),c=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=e.onComplete,u={card:{}},p=function(){return Object.keys(u).filter((function(e){return!!u[e].complete})).length===Object.keys(u).length},d=(0,c.useMemo)((function(){var e;return l(l({},{value:{postalCode:null==n||null===(e=n.billingData)||void 0===e?void 0:e.postcode},hidePostalCode:(0,s.isFieldRequired)("postcode"),iconStyle:"default"}),t("cardOptions"))}),[n.billingData]);return r.createElement("div",{className:"wc-stripe-inline-form"},r.createElement(i.CardElement,{options:d,onChange:function(e){a(e),u[e.elementType]=e,o(p)}}))}},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),s=n(4222),c=n(1134),u=n(6664),l=n(3187),p=a(n(1065)),d=a(n(3329)),m=a(n(9775)),f=n(3636),y=(0,c.getSettings)("stripe_cc_data"),g=function(e){return(0,c.isUserLoggedIn)(e)&&y("saveCardEnabled")&&!(0,c.cartContainsSubscription)()&&!(0,c.cartContainsPreOrder)()},v=function(e){var t=(0,i.useState)(!1),n=(0,o.default)(t,2),a=n[0],s=n[1];if((0,i.useEffect)((function(){c.initStripe.catch((function(e){s(e)}))}),[s]),a)throw new Error(a);return r.createElement(u.Elements,{stripe:c.initStripe,options:y("elementOptions")},r.createElement(h,e))},h=function(e){var t=e.getData,n=e.billing,a=e.shippingData,s=e.emitResponse,c=e.eventRegistration,p=e.activePaymentMethod,y=(0,f.useStripeError)(),v=(0,o.default)(y,2),h=v[0],b=v[1],P=(0,i.useState)(!1),E=(0,o.default)(P,2),O=E[0],S=E[1],_=(0,i.useState)(!1),w=(0,o.default)(_,2),C=w[0],M=w[1],k=c.onPaymentProcessing,j=(0,u.useStripe)(),D=(0,u.useElements)(),x=(0,i.useCallback)((function(){var e=t("customFormActive")?u.CardNumberElement:u.CardElement;return{card:D.getElement(e)}}),[j,D]),R=(0,f.useSetupIntent)({getData:t,cartTotal:n.cartTotal,setError:b}),A=R.setupIntent,I=R.removeSetupIntent,L=(0,f.useProcessPaymentIntent)({getData:t,billing:n,shippingData:a,emitResponse:s,error:h,onPaymentProcessing:k,savePaymentMethod:O,setupIntent:A,removeSetupIntent:I,getPaymentMethodArgs:x,activePaymentMethod:p}),T=L.getCreatePaymentMethodArgs,N=L.addPaymentMethodData;(0,f.useAfterProcessingPayment)({getData:t,eventRegistration:c,responseTypes:s.responseTypes,activePaymentMethod:p,savePaymentMethod:O});var B=t("customFormActive")?d.default:m.default;return r.createElement("div",{className:"wc-stripe-card-container"},r.createElement(B,{getData:t,billing:n,onChange:function(e){e.error?b(e.error):b(!1)},onComplete:M}),g(n.customerId)&&r.createElement(l.SavePaymentMethod,{label:t("savePaymentMethodLabel"),onChange:function(e){return S(e)},checked:O}),t("installmentsActive")&&r.createElement(l.Installments,{paymentMethodName:t("name"),stripe:j,cardFormComplete:C,getCreatePaymentMethodArgs:T,addPaymentMethodData:N}))};(0,s.registerPaymentMethod)({name:y("name"),label:r.createElement(l.PaymentMethodLabel,{title:y("title"),paymentMethod:y("name"),icons:y("icons")}),ariaLabel:"Credit Cards",canMakePayment:function(){return c.initStripe},content:r.createElement(l.PaymentMethod,{content:v,getData:y}),savedTokenComponent:r.createElement(p.default,{getData:y}),edit:r.createElement(l.PaymentMethod,{content:v,getData:y}),supports:{showSavedCards:y("showSavedCards"),showSaveOption:!1,features:y("features")}})},7082:(e,t,n)=>{var r=n(3027),a=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(4575)),i=a(n(3913)),s=a(n(2205)),c=a(n(8585)),u=a(n(9754));var l=function(e){(0,s.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,c.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)),s=n(3027),c=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,m=e.checkoutStatus,f=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,s.useRef)()),_=h.onSubmit,w=h.emitResponse,C=f.onPaymentProcessing,M=(0,u.useExportedValues)(),k="long"===t("buttonStyle").buttonType?390:300,j=(0,u.useProcessPaymentIntent)({getData:t,billing:a,shippingData:p,onPaymentProcessing:C,emitResponse:w,error:O,exportedValues:M,onSubmit:_,checkoutStatus:m,activePaymentMethod:y}).setPaymentMethod,D=(0,c.usePaymentRequest)({getData:t,publishableKey:l,merchantInfo:b,billing:a,shippingData:p}),x=(0,c.usePaymentsClient)({merchantInfo:b,paymentRequest:D,billing:a,shippingData:p,eventRegistration:f,canMakePayment:d,setErrorMessage:n,onSubmit:_,setPaymentMethod:j,exportedValues:M,onClick:g,onClose:v,getData:t}),R=x.button,A=x.removeButton;return(0,u.useAfterProcessingPayment)({getData:t,eventRegistration:f,responseTypes:w.responseTypes,activePaymentMethod:y}),(0,u.useExpressBreakpointWidth)({payment_method:t("name"),width:k}),(0,s.useEffect)((function(){R&&(A(S.current),S.current.append(R))}),[R]),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),s=n(3097),c=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,m=l.shippingRates,f=t(),y=f.processingCountry,g=f.totalPriceLabel;return(0,i.useMemo)((function(){var e=p(p({},{emailRequired:(0,c.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}}}),s.BASE_PAYMENT_METHOD)],shippingAddressRequired:l.needsShipping,transactionInfo:(0,u.getTransactionInfo)({billing:o,processingCountry:y,totalPriceLabel:g}),callbackIntents:["PAYMENT_AUTHORIZATION"]}),s.BASE_PAYMENT_REQUEST);if(e.allowedPaymentMethods[0].parameters.billingAddressRequired=!0,e.allowedPaymentMethods[0].parameters.billingAddressParameters={format:"FULL",phoneNumberRequired:(0,c.isFieldRequired)("phone",d.country)&&(0,c.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)(m);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)),s=r(n(8926)),c=r(n(3038)),u=n(3027),l=r(n(4306)),p=n(1134),d=n(6664),m=n(8664),f=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,M=(0,u.useState)(),k=(0,c.default)(M,2),j=k[0],D=k[1],x=(0,u.useState)(null),R=(0,c.default)(x,2),A=R[0],I=R[1],L=(0,u.useRef)(r),T=(0,u.useRef)(g),N=(0,d.useStripe)(),B=(0,y.usePaymentEvents)({billing:r,shippingData:g,eventRegistration:h}).addPaymentEvent;(0,u.useEffect)((function(){L.current=r,T.current=g}));var F=(0,u.useCallback)((function(e){var t,n;if(null!=e&&null!==(t=e.paymentMethodData)&&void 0!==t&&null!==(n=t.info)&&void 0!==n&&n.billingAddress){var r,a=e.paymentMethodData.info.billingAddress;(0,p.isAddressValid)(L.current.billingData,["phone","email"])&&(0,p.isEmpty)(null===(r=L.current.billingData)||void 0===r?void 0:r.phone)&&(a={phoneNumber:a.phoneNumber}),O.billingData=L.current.billingData=(0,m.toCartAddress)(a,{email:e.email})}null!=e&&e.shippingAddress&&(O.shippingAddress=(0,m.toCartAddress)(e.shippingAddress))}),[O,n]),q=(0,u.useCallback)((function(e){for(;e.firstChild;)e.removeChild(e.firstChild)}),[A]),X=(0,u.useCallback)((0,s.default)(i.default.mark((function e(){var t,r,a;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return S(),e.prev=1,e.next=4,j.loadPaymentData(n);case 4:return t=e.sent,F(t),r=JSON.parse(t.paymentMethodData.tokenizationData.token),e.next=9,N.createPaymentMethod({type:"card",card:{token:r.id},billing_details:(0,p.getBillingDetailsFromAddress)(L.current.billingData)});case 9:if(!(a=e.sent).error){e.next=12;break}throw new p.StripeError(a.error);case 12:E(a.paymentMethod.id),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(1),"CANCELED"===(null===e.t0||void 0===e.t0?void 0:e.t0.statusCode)?_():(console.log((0,p.getErrorMessage)(e.t0)),P((0,p.getErrorMessage)(e.t0)));case 18:case"end":return e.stop()}}),e,null,[[1,15]])}))),[N,j,S]),V=(0,u.useCallback)((0,s.default)(i.default.mark((function e(){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!j||A||!N){e.next=5;break}return e.next=4,b;case 4:I(j.createButton(v({onClick:X},w("buttonStyle"))));case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.log(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])}))),[N,A,j,X]),U=(0,u.useMemo)((function(){var e={environment:C,merchantInfo:t,paymentDataCallbacks:{onPaymentAuthorized:function(){return Promise.resolve({transactionState:"SUCCESS"})}}};return n.shippingAddressRequired&&(e.paymentDataCallbacks.onPaymentDataChanged=function(e){return new Promise((function(t,n){var r,i=T.current,s=e.shippingAddress,c=e.shippingOptionData,u=(0,m.toCartAddress)(s),d=(0,p.getSelectedShippingOption)(c.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,m.getPaymentRequestUpdate)({billing:r,shippingData:{needsShipping:!0,shippingRates:a.shippingRates},processingCountry:w("processingCountry"),totalPriceLabel:w("totalPriceLabel")}):{error:{reason:"SHIPPING_ADDRESS_UNSERVICEABLE",message:(0,f.__)("Your shipping address is not serviceable.","woo-stripe-payment"),intent:"SHIPPING_ADDRESS"}})}),y&&g),T.current.setShippingAddress(v(v({},T.current.shippingAddress),u)),"shipping_option_unselected"!==c.id&&(r=T.current).setSelectedRates.apply(r,(0,a.default)(d))}))}),e}),[n]);return(0,u.useEffect)((function(){D(new google.payments.api.PaymentsClient(U))}),[U]),(0,u.useEffect)((function(){V()}),[V]),{button:A,removeButton:q}}},5341:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),n(9509);var r=n(9031);Object.keys(r).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===r[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}}))}))},9031:(e,t,n)=>{var r=n(3027),a=n(5318),o=a(n(7154)),i=a(n(6479)),s=a(n(9713)),c=n(4222),u=n(1134),l=n(5516),p=a(n(5212)),d=n(3097),m=a(n(3905)),f=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,s.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 m.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"]),s=n.ValidationInputError,c=(0,l.useErrorMessage)(),d=c.errorMessage,m=c.setErrorMessage;return r.createElement("div",{className:"wc-stripe-gpay-container"},r.createElement(f.Elements,{stripe:u.initStripe},r.createElement(p.default,(0,o.default)({getData:t,canMakePayment:P,setErrorMessage:m},a)),d&&r.createElement(s,{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,c.registerExpressPaymentMethod)({name:b("name"),canMakePayment:function(){return b("isAdmin")?!(0,u.isCartPage)()||b("cartCheckoutEnabled"):!((0,u.isCartPage)()&&!b("cartCheckoutEnabled"))&&u.initStripe.then((function(e){return e.error?e:P}))},content:r.createElement(E,{getData:b}),edit:r.createElement(O,{getData:b}),supports:{showSavedCards:b("showSavedCards"),showSaveOption:b("showSaveOption"),features:b("features")}})},8664:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.toCartAddress=t.getShippingOptions=t.getShippingOptionParameters=t.getPaymentRequestUpdate=t.getTransactionInfo=void 0;var a=r(n(319)),o=n(1134),i=((0,n(2492).getSetting)("stripeGeneralData"),function(e){var t=e.billing,n=e.processingCountry,r=e.totalPriceLabel,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ESTIMATED",i=t.cartTotal,c=t.cartTotalItems,u=t.currency,l={countryCode:n,currencyCode:u.code,totalPriceStatus:a,totalPrice:(0,o.removeNumberPrecision)(i.value,u.minorUnit).toString(),displayItems:s(c,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,s=n.shippingRates,u={newTransactionInfo:i({billing:t,processingCountry:r,totalPriceLabel:a},"FINAL")};return o&&(u.newShippingOptionParameters=c(s)),u};var s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=[],r=["total_tax","total_shipping"];return e.forEach((function(e){(0<e.value||e.key&&r.includes(e.key))&&n.push({label:e.label,type:"LINE_ITEM",price:(0,o.removeNumberPrecision)(e.value,t).toString()})})),n},c=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=c;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 s=n(2343);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 c=n(1500);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 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),s=n(6664),c=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,m=e.messageContext,f=void 0===m?null:m,y=(0,s.useStripe)(),g=n.onCheckoutAfterProcessingWithSuccess,v=n.onCheckoutAfterProcessingWithError;(0,u.useProcessCheckoutError)({responseTypes:r,subscriber:v,messageContext:f}),(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,c.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),s=function(e){var t=e.name,n=e.width,r=e.node,s=e.className,c=(0,o.useState)(window.innerWidth),u=(0,a.default)(c,2),l=u[0],p=u[1],d=(0,o.useCallback)((function(e){var t=(0,i.getFromCache)(e);return t?parseInt(t):0}),[]),m=(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)&&m(t,n),e.clientWidth<n?e.classList.add(s):e.clientWidth>a&&e.classList.remove(s)}}),[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=s,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}),[]);s({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),s=n(1134);function c(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?c(Object(n),!0).forEach((function(t){(0,a.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(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,c=r.onShippingRateSuccess,l=r.onShippingRateFail,p=r.onShippingRateSelectSuccess,d=(0,i.useRef)(t),m=(0,i.useRef)(n),f=(0,i.useState)(null),y=(0,o.default)(f,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=m.current,t=d.current;if(P.onShippingChanged&&!e.isSelectingRate&&!e.shippingRatesLoading){var n=P.onShippingChanged,r=!0;(0,s.hasShippingRates)(e.shippingRates)||(r=!1),n(r,{billing:t,shipping:e}),S("onShippingChanged")}}),[P,S]);return(0,i.useEffect)((function(){d.current=t,m.current=n})),(0,i.useEffect)((function(){g&&g.onShippingChanged&&(g.onShippingChanged(!0,{billing:d.current,shipping:m.current}),v(null))}),[g]),(0,i.useEffect)((function(){var e=c(_),t=p(_),n=l((function(e){e.hasInvalidAddress,e.hasError,P.onShippingChanged&&((0,P.onShippingChanged)(!1),S("onShippingChanged"))}));return function(){e(),n(),t()}}),[P,c,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)),s=n(3027),c=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 m=(0,u.toCartAddress)();t.usePaymentRequest=function(e){var t=e.getData,n=e.onClose,r=e.stripe,o=e.billing,p=e.shippingData,f=e.eventRegistration,y=e.setPaymentMethod,g=e.exportedValues,v=e.canPay,h=(0,c.usePaymentEvents)({billing:o,shippingData:p,eventRegistration:f}).addPaymentEvent,b=(p.shippingAddress,p.needsShipping),P=p.shippingRates,E=o.billingData,O=o.cartTotalItems,S=o.currency,_=o.cartTotal,w=(0,s.useState)(null),C=(0,i.default)(w,2),M=C[0],k=C[1],j=(0,s.useRef)({}),D=(0,s.useRef)(p),x=(0,s.useRef)(o);(0,s.useEffect)((function(){D.current=p,x.current=o}),[p]),(0,s.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)?k(n):k(null)}))}}),[r,_.value,E.country,P,O,S.code]),(0,s.useEffect)((function(){M&&(j.current.requestShipping&&(M.on("shippingaddresschange",A),M.on("shippingoptionchange",I)),M.on("cancel",n),M.on("paymentmethod",L))}),[M,A,n,L]);var R=(0,s.useCallback)((function(e){return function(t,n){var r=n.billing,a=n.shipping,o=r.cartTotal,i=r.cartTotalItems,s=r.currency,c=a.shippingRates;t?e.updateWith({status:"success",total:{amount:o.value,label:o.label,pending:!1},displayItems:(0,u.getDisplayItems)(i,s),shippingOptions:(0,u.getShippingOptions)(c)}):e.updateWith({status:"invalid_shipping_address"})}}),[]),A=(0,s.useCallback)((function(e){var t=e.shippingAddress,n=D.current,r=m(t);n.setShippingAddress(d(d({},n.shippingAddress),r));var a=(0,l.default)((0,u.getIntermediateAddress)(n.shippingAddress),r);h("onShippingChanged",R(e),a)}),[h]),I=(0,s.useCallback)((function(e){var t=e.shippingOption,n=D.current;n.setSelectedRates.apply(n,(0,a.default)((0,u.getSelectedShippingOption)(t.id))),h("onShippingChanged",R(e))}),[h]),L=(0,s.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,s={payerName:r,payerEmail:o,payerPhone:void 0===i?null:i};null!=t&&t.billing_details.address&&(s=m(t.billing_details.address,s)),g.billingData=s,e.shippingAddress&&(g.shippingAddress=m(e.shippingAddress)),y(t.id),e.complete("success")}),[]);return{paymentRequest:M}}},3893:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useProcessCheckoutError=void 0;var r=n(3027);t.useProcessCheckoutError=function(e){var t=e.responseTypes,n=e.subscriber,a=e.messageContext,o=void 0===a?null:a;(0,r.useEffect)((function(){var e=n((function(e){var n;return null!=e&&null!==(n=e.processingResponse.paymentDetails)&&void 0!==n&&n.stripeErrorMessage?{type:t.ERROR,message:e.processingResponse.paymentDetails.stripeErrorMessage,messageContext:o}:null}));return function(){return e()}}),[t,n])}},4332:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.useProcessPaymentIntent=void 0;var a=r(n(7015)),o=r(n(8926)),i=r(n(9713)),s=r(n(3038)),c=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,m=e.emitResponse,f=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,M=e.getPaymentMethodArgs,k=void 0===M?function(){return{}}:M,j=n.billingData,D=r.shippingAddress,x=m.responseTypes,R=(0,c.useState)(null),A=(0,s.default)(R,2),I=A[0],L=A[1],T=(0,u.useStripe)(),N=(0,c.useRef)(k),B=(0,c.useRef)({});(0,c.useEffect)((function(){N.current=k}),[k]);var F=(0,c.useCallback)((function(e){B.current=d(d({},B.current),e)}),[]),q=(0,c.useCallback)((function(){return d(d({},{type:h,billing_details:(0,l.getBillingDetailsFromAddress)(null!=C&&C.billingData?C.billingData:j)}),N.current())}),[j,h,k]),X=(0,c.useCallback)((function(e,n){var r,a={meta:{paymentMethodData:d((r={},(0,i.default)(r,"".concat(t("name"),"_token_key"),e),(0,i.default)(r,"".concat(t("name"),"_save_source_key"),n),r),B.current)}};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,c.useEffect)((function(){I&&"string"==typeof I&&y()}),[I,y]),(0,c.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,!f){e.next=6;break}throw new l.StripeError(f);case 6:if(!P){e.next=16;break}return e.next=9,T.confirmCardSetup(P.client_secret,{payment_method:q()});case 9:if(!(n=e.sent).error){e.next=12;break}throw new l.StripeError(n.error);case 12:r=n.setupIntent.payment_method,O(),e.next=26;break;case 16:if(!I){e.next=20;break}r=I,e.next=26;break;case 20:return e.next=22,T.createPaymentMethod(q());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)(x,X(r,_)));case 29:return e.prev=29,e.t0=e.catch(3),console.log(e.t0),L(null),e.abrupt("return",(0,l.ensureErrorResponse)(x,e.t0.error));case 34:case"end":return e.stop()}}),e,null,[[3,29]])}))));return function(){return e()}}),[I,j,p,T,P,g,_]),{setPaymentMethod:L,getCreatePaymentMethodArgs:q,addPaymentMethodData:F}}},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)),s=n(3027),c=r(n(7606)),u=n(1134);t.useSetupIntent=function(e){var t=e.cartTotal,n=e.setError,r=(0,s.useState)((0,u.getFromCache)("setupIntent")),l=(0,i.default)(r,2),p=l[0],d=l[1];(0,s.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,c.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 m=(0,s.useCallback)((function(){(0,u.deleteFromCache)("setupIntent")}),[t.value]);return{setupIntent:p,removeSetupIntent:m}}},2715:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.useStripeError=void 0;var a=r(n(3038)),o=n(3027);t.useStripeError=function(){var e=(0,o.useState)(!1),t=(0,a.default)(e,2);return[t[0],t[1]]}},6480:(e,t,n)=>{var r=n(3027),a=n(5318),o=a(n(6479)),i=a(n(9713)),s=a(n(3038)),c=n(3027),u=n(4222),l=n(1134),p=n(3539),d=n(3187),m=n(6664),f=n(3163),y=n(8978),g=n(1200);function v(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 h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){(0,i.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var b,P=(0,l.getSettings)("stripe_afterpay_data"),E=function(e){var t=e.total,n=e.currency,r=e.needsShipping,a=!1,o=P("requiredParams"),i=P("accountCountry"),s=!!o.hasOwnProperty(n)&&o[n];return s&&(a=i===(null==s?void 0:s[0])&&r&&t>(null==s?void 0:s[1])&&t<(null==s?void 0:s[2])),a},O=function(e){var t=e.getData,n=(0,c.useState)({amount:t("cartTotal"),currency:t("currency"),isEligible:t("msgOptions").isEligible}),a=(0,s.default)(n,2),o=a[0],i=a[1];return b=i,r.createElement(m.Elements,{stripe:l.initStripe,options:t("elementOptions")},r.createElement("div",{className:"wc-stripe-blocks-afterpay__label"},r.createElement(m.AfterpayClearpayMessageElement,{options:h(h({},t("msgOptions")),{amount:o.amount,currency:o.currency,isEligible:o.isEligible})})))},S=function(e){var t=e.content,n=e.billing,a=e.shippingData,i=(0,o.default)(e,["content","billing","shippingData"]),s=t,u=n.cartTotal,l=n.currency,p=a.needsShipping;return(0,c.useEffect)((function(){b({amount:u.value,currency:l.code,isEligible:p})}),[u.value,l.code,p]),r.createElement(r.Fragment,null,p&&r.createElement("div",{className:"wc-stripe-blocks-payment-method-content"},r.createElement("div",{className:"wc-stripe-blocks-afterpay-offsite__container"},r.createElement("div",{className:"wc-stripe-blocks-afterpay__offsite"},r.createElement("img",{src:P("offSiteSrc")}),r.createElement("p",null,(0,f.sprintf)((0,f.__)('After clicking "%s", you will be redirected to Afterpay to complete your purchase securely.',"woo-stripe-payment"),P("placeOrderButtonLabel"))))),r.createElement(s,h(h({},i),{},{billing:n,shippingData:a}))))},_=function(e){var t=e.cart,n=(e.extensions,e.context,t.cartTotals),a=t.cartNeedsShipping,o=(n.total_price,n.currency_code),i=parseInt(n.total_price),s=parseInt(n.total_price)/Math.pow(10,n.currency_minor_unit);return E({total:s,currency:o,needsShipping:a})?r.createElement(y.TotalsWrapper,null,r.createElement(m.Elements,{stripe:l.initStripe,options:P("elementOptions")},r.createElement("div",{className:"wc-stripe-blocks-afterpay-totals__item wc-block-components-totals-item"},r.createElement(m.AfterpayClearpayMessageElement,{options:h(h({},P("msgOptions")),{amount:i,currency:o,isEligible:a})})))):null};P()&&((0,u.registerPaymentMethod)({name:P("name"),label:r.createElement(O,{getData:P}),ariaLabel:(0,f.__)("Afterpay","woo-stripe-payment"),placeOrderButtonLabel:P("placeOrderButtonLabel"),canMakePayment:(0,p.canMakePayment)(P,(function(e){var t=e.settings,n=e.cartTotals,r=e.cartNeedsShipping,a=n.currency_code,o=n.currency_minor_unit,i=n.total_price;b&&b({amount:parseInt(n.total_price),currency:a,isEligible:r});var s=parseInt(i)/Math.pow(10,o),c=E({total:s,currency:a,needsShipping:r});return!c&&!t("hideIneligible")||c})),content:r.createElement(S,{content:p.LocalPaymentIntentContent,getData:P,confirmationMethod:"confirmAfterpayClearpayPayment"}),edit:r.createElement(d.PaymentMethod,{content:p.LocalPaymentIntentContent,getData:P}),supports:{showSavedCards:!1,showSaveOption:!1,features:P("features")}}),(0,g.registerPlugin)("wc-stripe",{render:function(){return r.createElement(y.ExperimentalOrderMeta,null,r.createElement(_,null))},scope:"woocommerce-checkout"}))},39:(e,t,n)=>{var r=n(3027),a=n(4222),o=n(1134),i=n(3539),s=n(2029),c=n(3187),u=(0,o.getSettings)("stripe_alipay_data");u()&&(0,a.registerPaymentMethod)({name:u("name"),label:r.createElement(s.PaymentMethodLabel,{title:u("title"),paymentMethod:u("name"),icons:u("icon")}),ariaLabel:"Alipay",placeOrderButtonLabel:u("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(u),content:r.createElement(c.PaymentMethod,{content:i.LocalPaymentIntentContent,confirmationMethod:"confirmAlipayPayment",getData:u}),edit:r.createElement(c.PaymentMethod,{content:i.LocalPaymentIntentContent,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),s=n(3187),c=(0,o.getSettings)("stripe_bancontact_data");c()&&(0,a.registerPaymentMethod)({name:c("name"),label:r.createElement(s.PaymentMethodLabel,{title:c("title"),paymentMethod:c("name"),icons:c("icon")}),ariaLabel:"Bancontact",placeOrderButtonLabel:c("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(c),content:r.createElement(s.PaymentMethod,{content:i.LocalPaymentIntentContent,confirmationMethod:"confirmBancontactPayment",getData:c}),edit:r.createElement(s.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:c}),supports:{showSavedCards:!1,showSaveOption:!1,features:c("features")}})},5176:(e,t,n)=>{var r=n(3027),a=n(4222),o=n(1134),i=n(3539),s=n(3187),c=n(6664),u=(0,o.getSettings)("stripe_becs_data"),l=function(e){return r.createElement(r.Fragment,null,r.createElement(s.PaymentMethod,e),r.createElement("div",{className:"wc-stripe-blocks-mandate becs-mandate",dangerouslySetInnerHTML:{__html:e.getData("mandate")}}))};u()&&(0,a.registerPaymentMethod)({name:u("name"),label:r.createElement(s.PaymentMethodLabel,{title:u("title"),paymentMethod:u("name"),icons:u("icon")}),ariaLabel:"BECS",placeOrderButtonLabel:u("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(u),content:r.createElement(l,{content:i.LocalPaymentIntentContent,getData:u,confirmationMethod:"confirmAuBecsDebitPayment",component:c.AuBankAccountElement}),edit:r.createElement(s.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:u}),supports:{showSavedCards:!1,showSaveOption:!1,features:u("features")}})},4990:(e,t,n)=>{var r=n(3027),a=n(5318),o=a(n(7154)),i=a(n(9713)),s=a(n(3038)),c=a(n(6479)),u=n(3027),l=n(3163),p=n(4222),d=a(n(4184)),m=n(1134),f=n(3539),y=n(3187);function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){(0,i.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var h=(0,m.getSettings)("stripe_boleto_data");h()&&(0,p.registerPaymentMethod)({name:h("name"),label:r.createElement(y.PaymentMethodLabel,{title:h("title"),paymentMethod:h("name"),icons:h("icon")}),ariaLabel:"Boleto",placeOrderButtonLabel:h("placeOrderButtonLabel"),canMakePayment:(0,f.canMakePayment)(h),content:r.createElement(y.PaymentMethod,{content:function(e){var t=e.eventRegistration,n=(0,c.default)(e,["eventRegistration"]),a=(0,u.useState)(""),i=(0,s.default)(a,2),p=i[0],y=i[1],g=(0,u.useState)(!1),h=(0,s.default)(g,2),b=h[0],P=h[1],E=t.onPaymentProcessing,O=(0,u.useCallback)((function(){return{boleto:{tax_id:p}}}),[p]);return(0,u.useEffect)((function(){var e=E((function(){return!!p||(0,m.ensureErrorResponse)(n.emitResponse.responseTypes,(0,l.__)("Please enter a valid CPF/CNPJ value","woo-stripe-payment"))}));return function(){return e()}}),[E,p]),r.createElement(r.Fragment,null,r.createElement("div",{className:(0,d.default)("wc-block-components-text-input",{"is-active":b||p})},r.createElement("input",{type:"text",id:"wc-stripe-boleto-tax_id",onChange:function(e){return y(e.target.value)},onFocus:function(){return P(!0)},onBlur:function(){return P(!1)}}),r.createElement("label",{htmlFor:"wc-stripe-boleto-tax_id"},(0,l.__)(" CPF / CNPJ"," woo-stripe-payment"))),(0,m.isTestMode)()&&r.createElement("div",{className:"wc-stripe-boleto__description"},r.createElement("p",null,(0,l.__)("Test mode values","woo-stripe-payment")),r.createElement("div",null,r.createElement("label",null,"CPF:")," ",r.createElement("span",null,"000.000.000-00")),r.createElement("div",null,r.createElement("label",null,"CNPJ:")," ",r.createElement("span",null,"00.000.000/0000-00"))),!(0,m.isTestMode)()&&r.createElement("div",{className:"wc-stripe-boleto__description"},r.createElement("p",null,(0,l.__)("Accepted formats","woo-stripe-payment")),r.createElement("div",null,r.createElement("label",null,"CPF:")," ",r.createElement("span",null,(0,l.__)("XXX.XXX.XXX-XX or XXXXXXXXXXX","woo-stripe-payment"))),r.createElement("div",null,r.createElement("label",null,"CNPJ:")," ",r.createElement("span",null,(0,l.__)("XX.XXX.XXX/XXXX-XX or XXXXXXXXXXXXXX","woo-stripe-payment")))),r.createElement(f.LocalPaymentIntentContent,(0,o.default)({callback:O},v(v({},n),{eventRegistration:t}))))},getData:h,confirmationMethod:"confirmBoletoPayment"}),edit:r.createElement(y.PaymentMethod,{content:f.LocalPaymentIntentContent,getData:h}),supports:{showSavedCards:!1,showSaveOption:!1,features:h("features")}})},4494:(e,t,n)=>{var r=n(3027),a=n(4222),o=n(1134),i=n(3539),s=n(3187),c=n(6664),u=(0,o.getSettings)("stripe_eps_data");u()&&(0,a.registerPaymentMethod)({name:u("name"),label:r.createElement(s.PaymentMethodLabel,{title:u("title"),paymentMethod:u("name"),icons:u("icon")}),ariaLabel:"EPS",placeOrderButtonLabel:u("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(u),content:r.createElement(s.PaymentMethod,{content:i.LocalPaymentIntentContent,confirmationMethod:"confirmEpsPayment",component:c.EpsBankElement,getData:u}),edit:r.createElement(s.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:u}),supports:{showSavedCards:!1,showSaveOption:!1,features:u("features")}})},4031:(e,t,n)=>{var r=n(3027),a=n(4222),o=n(1134),i=n(3539),s=n(3187),c=n(6664),u=(0,o.getSettings)("stripe_fpx_data");u()&&(0,a.registerPaymentMethod)({name:u("name"),label:r.createElement(s.PaymentMethodLabel,{title:u("title"),paymentMethod:u("name"),icons:u("icon")}),ariaLabel:"FPX",placeOrderButtonLabel:u("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(u),content:r.createElement(s.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:u,confirmationMethod:"confirmIdealPayment",component:c.FpxBankElement}),edit:r.createElement(s.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),s=n(3187),c=(0,o.getSettings)("stripe_giropay_data");c()&&(0,a.registerPaymentMethod)({name:c("name"),label:r.createElement(s.PaymentMethodLabel,{title:c("title"),paymentMethod:c("name"),icons:c("icon")}),ariaLabel:"Giropay",placeOrderButtonLabel:c("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(c),content:r.createElement(s.PaymentMethod,{content:i.LocalPaymentIntentContent,confirmationMethod:"confirmGiropayPayment",getData:c}),edit:r.createElement(s.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:c}),supports:{showSavedCards:!1,showSaveOption:!1,features:c("features")}})},3140:(e,t,n)=>{var r=n(3027),a=n(4222),o=n(1134),i=n(3539),s=n(3187),c=(0,o.getSettings)("stripe_grabpay_data");c()&&(0,a.registerPaymentMethod)({name:c("name"),label:r.createElement(s.PaymentMethodLabel,{title:c("title"),paymentMethod:c("name"),icons:c("icon")}),ariaLabel:"GrabPay",placeOrderButtonLabel:c("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(c),content:r.createElement(s.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:c,confirmationMethod:"confirmGrabPayPayment"}),edit:r.createElement(s.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:c}),supports:{showSavedCards:!1,showSaveOption:!1,features:c("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)),s=r(n(8926)),c=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,m=e.confirmationMethod,f=e.getPaymentMethodArgs,y=void 0===f?function(){return{}}:f,g=(0,u.useStripe)(),v=r.onCheckoutAfterProcessingWithSuccess,h=r.onCheckoutAfterProcessingWithError,b=(0,c.useRef)(n),P=(0,c.useRef)(y);(0,c.useEffect)((function(){b.current=n}),[n]),(0,c.useEffect)((function(){P.current=y}),[y]),(0,c.useEffect)((function(){var e=v(function(){var e=(0,s.default)(a.default.mark((function e(n){var r,s,c,u,f,y,v;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.redirectUrl,t("name")!==p){e.next=18;break}if(e.prev=2,!(s=r.match(/#response=(.+)/))){e.next=12;break}return c=JSON.parse(window.atob(decodeURIComponent(s[1]))),u=c.client_secret,f=c.return_url,y=(0,i.default)(c,["client_secret","return_url"]),e.next=8,g[m](u,{payment_method:d({billing_details:(0,l.getBillingDetailsFromAddress)(b.current)},P.current(b.current)),return_url:f});case 8:if(!(v=e.sent).error){e.next=11;break}throw new l.StripeError(v.error);case 11:window.location=decodeURI(y.order_received_url);case 12:e.next=18;break;case 14:return e.prev=14,e.t0=e.catch(2),console.log(e.t0),e.abrupt("return",(0,l.ensureErrorResponse)(o,e.t0.error));case 18:case"end":return e.stop()}}),e,null,[[2,14]])})));return function(t){return e.apply(this,arguments)}}());return function(){return e()}}),[g,v,h])}},878:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.useCreateSource=void 0;var a=r(n(7015)),o=r(n(8926)),i=r(n(9713)),s=r(n(3038)),c=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,m=e.responseTypes,f=e.getSourceArgs,y=void 0!==f&&f,g=e.element,v=void 0!==g&&g,h=(0,c.useState)(!1),b=(0,s.default)(h,2),P=b[0],E=b[1],O=(0,c.useState)(!1),S=(0,s.default)(O,2),_=S[0],w=S[1],C=(0,c.useRef)({billing:n,shippingAddress:r}),M=(0,l.useStripe)(),k=(0,l.useElements)();(0,c.useEffect)((function(){C.current={billing:n,shippingAddress:r}}));var j=(0,c.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,c.useCallback)((function(e){return{meta:{paymentMethodData:(0,i.default)({},"".concat(t("name"),"_token_key"),e)}}}),[]);return(0,c.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)(m,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,M.createSource(k.getElement(v),j());case 8:t=e.sent,e.next=14;break;case 11:return e.next=13,M.createSource(j());case 13:t=e.sent;case 14:if(!t.error){e.next=16;break}throw new u.StripeError(t.error);case 16:return E(t.source),e.abrupt("return",(0,u.ensureSuccessResponse)(m,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)(m,e.t0.error||e.t0));case 24:case"end":return e.stop()}}),e,null,[[2,20]])}))));return function(){return e()}}),[P,d,M,m,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),s=n(3163);t.useValidateCheckout=function(e){var t=e.subscriber,n=e.responseTypes,r=e.component,c=void 0===r?null:r,u=e.msg,l=void 0===u?(0,s.__)("Please enter your payment info before proceeding.","woo-stripe-payment"):u,p=(0,o.useState)(!1),d=(0,a.default)(p,2),m=d[0],f=d[1];return(0,o.useEffect)((function(){var e=t((function(){return!(c&&!m)||(0,i.ensureErrorResponse)(n,l)}));return function(){return e()}}),[t,m,f,n,c]),{isValid:m,setIsValid:f}}},9474:(e,t,n)=>{var r=n(3027),a=n(4222),o=n(1134),i=n(3539),s=n(3187),c=n(6664),u=(0,o.getSettings)("stripe_ideal_data");u()&&(0,a.registerPaymentMethod)({name:u("name"),label:r.createElement(s.PaymentMethodLabel,{title:u("title"),paymentMethod:u("name"),icons:u("icon")}),ariaLabel:"Ideal",placeOrderButtonLabel:u("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(u),content:r.createElement(s.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:u,confirmationMethod:"confirmIdealPayment",component:c.IdealBankElement}),edit:r.createElement(s.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:u}),supports:{showSavedCards:!1,showSaveOption:!1,features:u("features")}})},9738:(e,t,n)=>{n(5142),n(9474),n(3868),n(8641),n(3817),n(4494),n(4784),n(1192),n(7894),n(3766),n(4031),n(5176),n(3140),n(39),n(6480),n(4990),n(5748)},5142:(e,t,n)=>{var r=n(3027),a=n(4222),o=n(1134),i=n(3539),s=n(3187),c=n(3163),u=(0,o.getSettings)("stripe_klarna_data");u()&&(0,a.registerPaymentMethod)({name:u("name"),label:r.createElement(s.PaymentMethodLabel,{title:u("title"),paymentMethod:u("name"),icons:u("icon")}),ariaLabel:"Klarna",placeOrderButtonLabel:u("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(u,(function(e){var t=e.settings,n=e.billingData,r=e.cartTotals,a=n.country,o=r.currency_code,i=t("requiredParams");return[o]in i&&i[o].includes(a)})),content:r.createElement(s.PaymentMethod,{content:function(e){return r.createElement(r.Fragment,null,(0,o.isTestMode)()&&r.createElement("div",{className:"wc-stripe-klarna__testmode"},r.createElement("label",null,(0,c.__)("Test mode sms","woo-stripe-payment"),":")," ",r.createElement("span",null,"123456")),r.createElement(i.LocalPaymentIntentContent,e))},getData:u,confirmationMethod:"confirmKlarnaPayment"}),edit:r.createElement(s.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:u}),supports:{showSavedCards:!1,showSaveOption:!1,features:u("features")}})},3539:(e,t,n)=>{var r=n(3027),a=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.LocalPaymentSourceContent=t.LocalPaymentIntentContent=t.canMakePayment=void 0;var o=a(n(7154)),i=a(n(9713)),s=a(n(6479)),c=n(3027),u=n(6664),l=n(1134),p=n(8522),d=n(3636);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 f(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,i.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.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,s.default)(n,["billingData","cartTotals"]),i=a.currency_code,c=r.country,u=e("countries"),p=e("allowedCountries"),d=e("features"),m=!1;if(e("isAdmin"))m=!0;else{if((0,l.cartContainsSubscription)()&&!d.includes("subscriptions"))return!1;if((0,l.cartContainsPreOrder)()&&!d.includes("pre-orders"))return!1;e("currencies").includes(i)&&(m="all_except"===p?!e("exceptCountries").includes(c):"specific"===p?e("specificCountries").includes(c):!(u.length>0)||u.includes(c)),t&&m&&(m=t(f({settings:e,billingData:r,cartTotals:a},o)))}return m}},t.LocalPaymentIntentContent=function(e){var t=e.getData,n=(0,s.default)(e,["getData"]);return r.createElement(u.Elements,{stripe:l.initStripe,options:t("elementOptions")},r.createElement(g,f(f({},n),{},{getData:t})))},t.LocalPaymentSourceContent=function(e){return r.createElement(u.Elements,{stripe:l.initStripe},r.createElement(y,e))};var y=function(e){var t=e.getData,n=e.billing,a=e.shippingData,o=e.emitResponse,i=e.eventRegistration,s=e.getSourceArgs,c=void 0!==s&&s,u=e.element,l=void 0!==u&&u,d=a.shippingAddress,m=i.onPaymentProcessing,f=(i.onCheckoutAfterProcessingWithError,o.responseTypes),y=(o.noticeContexts,(0,p.useCreateSource)({getData:t,billing:n,shippingAddress:d,onPaymentProcessing:m,responseTypes:f,getSourceArgs:c,element:l}).setIsValid);return l?r.createElement(v,{name:t("name"),options:t("paymentElementOptions"),onChange:function(e){y(e.complete)},element:l}):null},g=function(e){var t=e.getData,n=e.billing,a=e.emitResponse,o=e.eventRegistration,s=e.activePaymentMethod,l=e.confirmationMethod,m=void 0===l?null:l,f=e.component,y=void 0===f?null:f,g=e.callback,h=void 0===g?null:g,b=(0,u.useElements)(),P=n.billingData,E=o.onPaymentProcessing,O=o.onCheckoutAfterProcessingWithError,S=a.responseTypes,_=a.noticeContexts,w=(0,c.useCallback)((function(e){return y?(0,i.default)({},t("paymentType"),b.getElement(y)):h?h(e):{}}),[b,h]),C=(0,p.useValidateCheckout)({subscriber:E,responseTypes:S,component:y}).setIsValid;return(0,p.useAfterProcessLocalPayment)({getData:t,billingData:P,eventRegistration:o,responseTypes:S,activePaymentMethod:s,confirmationMethod:m,getPaymentMethodArgs:w}),(0,d.useProcessCheckoutError)({responseTypes:S,subscriber:O,messageContext:_.PAYMENT}),y?r.createElement(v,{name:t("name"),options:t("paymentElementOptions"),onChange:function(e){return C(!e.empty)},element:y,callback:h}):null},v=function(e){var t=e.name,n=e.onChange,a=e.element,i=e.options,c=(0,s.default)(e,["name","onChange","element","options"]),u=a;return r.createElement("div",{className:"wc-stripe-local-payment-container ".concat(t," ").concat(u.displayName)},r.createElement(u,(0,o.default)({options:i,onChange:n},c)))}},4784:(e,t,n)=>{var r=n(3027),a=n(4222),o=n(1134),i=n(3539),s=n(3187),c=(0,o.getSettings)("stripe_multibanco_data");c()&&(0,a.registerPaymentMethod)({name:c("name"),label:r.createElement(s.PaymentMethodLabel,{title:c("title"),paymentMethod:c("name"),icons:c("icon")}),ariaLabel:"MultiBanco",placeOrderButtonLabel:c("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(c),content:r.createElement(s.PaymentMethod,{content:i.LocalPaymentSourceContent,getData:c}),edit:r.createElement(s.PaymentMethod,{content:i.LocalPaymentSourceContent,getData:c}),supports:{showSavedCards:!1,showSaveOption:!1,features:c("features")}})},5748:(e,t,n)=>{var r=n(3027),a=n(4222),o=n(1134),i=n(3539),s=n(3187),c=(n(6664),(0,o.getSettings)("stripe_oxxo_data"));c()&&(0,a.registerPaymentMethod)({name:c("name"),label:r.createElement(s.PaymentMethodLabel,{title:c("title"),paymentMethod:c("name"),icons:c("icon")}),ariaLabel:"OXXO",placeOrderButtonLabel:c("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(c),content:r.createElement(s.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:c,confirmationMethod:"confirmOxxoPayment"}),edit:r.createElement(s.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:c}),supports:{showSavedCards:!1,showSaveOption:!1,features:c("features")}})},3868:(e,t,n)=>{var r=n(3027),a=n(4222),o=n(1134),i=n(3539),s=n(3187),c=n(6664),u=(0,o.getSettings)("stripe_p24_data");u()&&(0,a.registerPaymentMethod)({name:u("name"),label:r.createElement(s.PaymentMethodLabel,{title:u("title"),paymentMethod:u("name"),icons:u("icon")}),ariaLabel:"P24",placeOrderButtonLabel:u("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(u),content:r.createElement(s.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:u,confirmationMethod:"confirmP24Payment",component:c.P24BankElement}),edit:r.createElement(s.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:u}),supports:{showSavedCards:!1,showSaveOption:!1,features:u("features")}})},1192:(e,t,n)=>{var r,a=n(3027),o=n(4222),i=n(1134),s=n(3187),c=n(3539),u=n(6664),l=(0,i.getSettings)("stripe_sepa_data"),p=(r=s.PaymentMethod,function(e){return a.createElement(a.Fragment,null,a.createElement(r,e),a.createElement("div",{className:"wc-stripe-blocks-mandate sepa-mandate",dangerouslySetInnerHTML:{__html:e.getData("mandate")}}))});l()&&(0,o.registerPaymentMethod)({name:l("name"),label:a.createElement(s.PaymentMethodLabel,{title:l("title"),paymentMethod:l("name"),icons:l("icon")}),ariaLabel:"SEPA",placeOrderButtonLabel:l("placeOrderButtonLabel"),canMakePayment:(0,c.canMakePayment)(l),content:a.createElement(p,{content:c.LocalPaymentIntentContent,getData:l,confirmationMethod:"confirmSepaDebitPayment",component:u.IbanElement}),edit:a.createElement(s.PaymentMethod,{content:c.LocalPaymentIntentContent,getData:l}),supports:{showSavedCards:!1,showSaveOption:!1,features:l("features")}})},7894:(e,t,n)=>{var r=n(3027),a=n(4222),o=n(1134),i=n(3539),s=n(3187),c=(0,o.getSettings)("stripe_sofort_data");c()&&(0,a.registerPaymentMethod)({name:c("name"),label:r.createElement(s.PaymentMethodLabel,{title:c("title"),paymentMethod:c("name"),icons:c("icon")}),ariaLabel:"Sofort",placeOrderButtonLabel:c("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(c),content:r.createElement(s.PaymentMethod,{content:i.LocalPaymentIntentContent,confirmationMethod:"confirmSofortPayment",getData:c,callback:function(e){return{sofort:{country:e.country}}}}),edit:r.createElement(s.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:c}),supports:{showSavedCards:!1,showSaveOption:!1,features:c("features")}})},3766:(e,t,n)=>{var r=n(3027),a=n(5318),o=a(n(7015)),i=a(n(8926)),s=a(n(9713)),c=a(n(3038)),u=n(3027),l=n(4222),p=n(1134),d=n(3187),m=n(3539),f=n(6664),y=n(8522),g=n(3163),v=n(3636),h=(0,p.getSettings)("stripe_wechat_data"),b=function(e){return r.createElement(f.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,s=parseInt(t("qrSize")),c=a.responseTypes,l=o.onPaymentProcessing,d=o.onCheckoutAfterProcessingWithSuccess,m=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")}),v=(f.isValid,f.setIsValid),h=O({getData:t,billing:n,responseTypes:c,subscriber:l}),b=h.source,P=h.error,S=h.deleteSourceFromStorage;return(0,u.useEffect)((function(){var e=d((function(){return S(),(0,p.ensureSuccessResponse)(c)}));return function(){return e()}}),[b,d,S]),(0,u.useEffect)((function(){b&&v(!0)}),[b]),b?r.createElement(E,{text:b.wechat.qr_code_url,width:s,height:s}):P?r.createElement("div",{className:"wechat-validation-error"},r.createElement(m,{errorMessage:(0,p.getErrorMessage)(P)})):(0,p.isAddressValid)(n.billingData)?null:(0,g.__)("Please fill out all the required fields in order to complete the WeChat payment.","woo-stripe-payment")},E=function(e){var t=e.text,n=e.width,a=void 0===n?128:n,o=e.height,i=void 0===o?128:o,s=e.colorDark,c=void 0===s?"#424770":s,l=e.colorLight,d=void 0===l?"#f8fbfd":l,m=e.correctLevel,f=void 0===m?QRCode.CorrectLevel.H:m,y=(0,u.useRef)();return(0,u.useEffect)((function(){new QRCode(y.current,{text:t,width:a,height:i,colorDark:c,colorLight:d,correctLevel:f})}),[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,f.useStripe)(),d=(0,v.useStripeError)(),m=(0,c.default)(d,2),y=m[0],g=m[1],h=(0,u.useState)((0,p.getFromCache)("wechat:source")),b=(0,c.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,s.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]),M=(0,u.useCallback)((function(){(0,p.deleteFromCache)("wechat:source")}),[]);return(0,u.useEffect)((function(){l&&!P&&(clearTimeout(O.current),O.current=setTimeout(C,1e3))}),[l,P,C]),{source:P,setSource:E,error:y,deleteSourceFromStorage:M}};h()&&(0,l.registerPaymentMethod)({name:h("name"),label:r.createElement(d.PaymentMethodLabel,{title:h("title"),paymentMethod:h("name"),icons:h("icon")}),ariaLabel:"WeChat",canMakePayment:(0,m.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)),s=n(3027),c=n(4222),u=n(1134),l=n(3636),p=n(6664),d=(0,u.getSettings)("stripe_payment_request_data"),m=function(e){return r.createElement("div",{className:"wc-stripe-payment-request-container"},r.createElement(p.Elements,{stripe:u.initStripe},r.createElement(f,e)))},f=function(e){var t=e.getData,n=e.onClick,a=e.onClose,c=e.billing,u=e.shippingData,d=e.eventRegistration,m=e.emitResponse,f=e.onSubmit,y=e.activePaymentMethod,g=((0,i.default)(e,["getData","onClick","onClose","billing","shippingData","eventRegistration","emitResponse","onSubmit","activePaymentMethod"]),d.onPaymentProcessing),v=m.responseTypes,h=m.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:c,shippingData:u,onPaymentProcessing:g,emitResponse:m,error:E,onSubmit:f,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:c,shippingData:u,eventRegistration:d,setPaymentMethod:S,exportedValues:O,canPay:function(e){return null!=e&&!e.applePay}}).paymentRequest,w=(0,s.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,s.useRef)();return(0,s.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,c.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(m,{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),s=n(1134);t.default=function(e){var t=e.eventRegistration,n=e.emitResponse,r=e.getData,c=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,s.initStripe;case 3:return o=e.sent,e.next=6,(0,s.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)}}(),[c]);return(0,i.useEffect)((function(){var e=c(l);return function(){return e()}}),[c]),null}},1134:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.isCheckoutPage=t.isCartPage=t.versionCompare=t.deleteFromCache=t.getFromCache=t.storeInCache=t.isTestMode=t.getDefaultSourceArgs=t.cartContainsSubscription=t.cartContainsPreOrder=t.getLocalPaymentMethods=t.registerLocalPaymentMethod=t.canMakePayment=t.getDisplayItems=t.getShippingOptionId=t.getShippingOptions=t.formatPrice=t.filterEmptyValues=t.getIntermediateAddress=t.toCartAddress=t.handleCardAction=t.isUserLoggedIn=t.hasShippingRates=t.getSelectedShippingOption=t.isFieldRequired=t.getLocaleFields=t.isAddressValid=t.removeNumberPrecision=t.isEmpty=t.StripeError=t.getSettings=t.getBillingDetailsFromAddress=t.getErrorMessage=t.ensureErrorResponse=t.ensureSuccessResponse=t.getRoute=t.getCreditCardForm=t.registerCreditCardForm=t.initStripe=void 0;var a=r(n(319)),o=r(n(7015)),i=r(n(8926)),s=r(n(3038)),c=r(n(8)),u=r(n(4575)),l=r(n(2205)),p=r(n(8585)),d=r(n(9754)),m=r(n(5957)),f=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,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(s)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,f.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,M=(0,v.getSetting)("stripeErrorMessages"),k=(0,v.getSetting)("countryLocale",{}),j=/^([\w]+)\:(.+)$/,D=(0,v.getSetting)("stripeGeneralData").routes,x={},R=[],A={recipient:function(e,t){return e.first_name=t.split(" ").slice(0,-1).join(" "),e.last_name=t.split(" ").pop(),e},payerName:function(e,t){return e.first_name=t.split(" ").slice(0,-1).join(" "),e.last_name=t.split(" ").pop(),e},country:"country",addressLine:function(e,t){return t[0]&&(e.address_1=t[0]),t[1]&&(e.address_2=t[1]),e},line1:"address_1",line2:"address_2",city:"city",region:"state",state:"state",postalCode:"postcode",postal_code:"postcode",payerEmail:"email",payerPhone:"phone"},I=new Promise((function(e,t){(0,g.loadStripe)(w,C?{stripeAccount:C}:{}).then((function(t){e(t)})).catch((function(t){e({error:t})}))}));t.initStripe=I,t.registerCreditCardForm=function(e){var t=e.id,n=(0,y.default)(e,["id"]);x[t]=n},t.getCreditCardForm=function(e){return x.hasOwnProperty(e)?x[e]:{}};var L=function(e){return null!=D&&D[e]?D[e]:console.log("".concat(e," is not a valid route"))};t.getRoute=L;var T=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return S({type:e.SUCCESS},t)};t.ensureSuccessResponse=T;var N=function(e,t){return{type:e.ERROR,message:B(t)}};t.ensureErrorResponse=N;var B=function(e){return"string"==typeof e?e:null!=e&&e.code&&null!=M&&M[e.code]?M[e.code]:null!=e&&e.statusCode?null!=M&&M[e.statusCode]?M[e.statusCode]:e.statusMessage:e.message};t.getErrorMessage=B;var F=function(e){var t={name:"".concat(e.first_name," ").concat(e.last_name),address:{city:e.city||null,country:e.country||null,line1:e.address_1||null,line2:e.address_2||null,postal_code:e.postcode||null,state:e.state||null}};return null!=e&&e.phone&&(t.phone=e.phone),null!=e&&e.email&&(t.email=e.email),t};t.getBillingDetailsFromAddress=F,t.getSettings=function(e){return function(t){return t?(0,v.getSetting)(e)[t]:(0,v.getSetting)(e)}};var q=function(e){(0,l.default)(a,e);var t,n,r=(t=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=(0,d.default)(t);if(n){var a=(0,d.default)(this).constructor;e=Reflect.construct(r,arguments,a)}else e=r.apply(this,arguments);return(0,p.default)(this,e)});function a(e){var t;return(0,u.default)(this,a),(t=r.call(this,e.message)).error=e,t}return a}((0,m.default)(Error));t.StripeError=q;var X=function(e){return"string"==typeof e?0==e.length||""==e:Array.isArray(e)?0==array.length:"object"!==(0,c.default)(e)||0==Object.keys(e).length};t.isEmpty=X,t.removeNumberPrecision=function(e,t){return e/Math.pow(10,t)},t.isAddressValid=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=V(e.country),r=0,a=Object.entries(e);r<a.length;r++){var o=(0,s.default)(a[r],2),i=o[0],c=o[1];if(!t.includes(i)&&null!=n&&n[i]&&n[i].required&&X(c))return!1}return!0};var V=function(e){var t=S({},k.default);return e&&null!=k&&k[e]&&(t=Object.entries(k[e]).reduce((function(e,t){var n=(0,s.default)(t,2),r=n[0],a=n[1];return e[r]=S(S({},e[r]),a),e}),t),["phone","email"].forEach((function(e){var n=document.getElementById(e);n&&(t[e]={required:n.required})}))),t};t.getLocaleFields=V,t.isFieldRequired=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=V(t);return[e]in n&&n[e].required},t.getSelectedShippingOption=function(e){var t=e.match(j);if(t){var n=t[1];return[t[2],n]}return[]},t.hasShippingRates=function(e){return e.map((function(e){return e.shipping_rates.length>0})).filter(Boolean).length>0},t.isUserLoggedIn=function(e){return e>0};var U=function(){var e=(0,i.default)(o.default.mark((function e(t,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,h.default)({url:D["sync/intent"],method:"POST",data:{order_id:t,client_secret:n}});case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.log(e.t0);case 8:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(t,n){return e.apply(this,arguments)}}(),W=function(){var e=(0,i.default)(o.default.mark((function e(t){var n,r,a,i,s,c,u,l,p,d,m,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,s=t.savePaymentMethod,c=void 0!==s&&s,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,m=l.order_key,e.next=7,a.handleCardAction(p);case 7:if(!(y=e.sent).error){e.next=11;break}return U(d,p),e.abrupt("return",N(r,y.error));case 11:return g=(0,f.default)({order_id:d,order_key:m},"".concat(i("name"),"_save_source_key"),c),e.next=14,(0,h.default)({url:L("process/payment"),method:"POST",data:g});case 14:if(!(v=e.sent).messages){e.next=17;break}return e.abrupt("return",N(r,v.messages));case 17:return e.abrupt("return",T(r,{redirectUrl:v.redirect}));case 20:return e.abrupt("return",T(r));case 21:e.next=27;break;case 23:return e.prev=23,e.t0=e.catch(1),console.log(e.t0),e.abrupt("return",N(r,e.t0));case 27:case"end":return e.stop()}}),e,null,[[1,23]])})));return function(t){return e.apply(this,arguments)}}();t.handleCardAction=W,t.toCartAddress=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:A;return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={};t=S(S({},t),Y(n));for(var a=0,o=Object.entries(e);a<o.length;a++){var i,c=(0,s.default)(o[a],2),u=c[0],l=c[1];null!==(i=t)&&void 0!==i&&i[u]&&("function"==typeof l?l(r,t[u]):r[l]=t[u])}return r}},t.getIntermediateAddress=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["city","postcode","state","country"],r={},a=P(n);try{for(a.s();!(t=a.n()).done;){var o=t.value;r[o]=e[o]}}catch(e){a.e(e)}finally{a.f()}return r};var Y=function(e){return Object.keys(e).filter((function(t){return Boolean(e[t])})).reduce((function(t,n){return S(S({},t),{},(0,f.default)({},n,e[n]))}),{})};t.filterEmptyValues=Y;var H=function(e,t){var n,r=(0,b.getCurrency)(t),a=r.prefix,o=r.suffix,i=r.decimalSeparator,s=r.minorUnit,c=r.thousandSeparator;if(""==e||void 0===e)return e;e="string"==typeof e?parseInt(e,10):e;var u="",l=(e=(e/=Math.pow(10,s)).toString().replace(".",i)).indexOf(i);l<0?s>0&&(e+="".concat(i).concat(new Array(s+1).join("0"))):(u=e.substr(l+1)).length<s&&(e+=new Array(s-u.length+1).join("0"));var p=e.match(new RegExp("(\\d+)\\".concat(i,"(\\d+)")));return p&&(e=p[1],u=p[2]),e=e.replace(new RegExp("\\B(?=(\\d{3})+(?!\\d))","g"),"".concat(c)),a+(e=(null===(n=u)||void 0===n?void 0:n.length)>0?e+i+u:e)+o};t.formatPrice=H,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,H(e.price,e.currency_code),{id:G(n,e.rate_id),label:t.value,amount:parseInt(e.price,10)}}));t=[].concat((0,a.default)(t),(0,a.default)(r))})),t};var G=function(e,t){return"".concat(e,":").concat(t)};t.getShippingOptionId=G,t.getDisplayItems=function(e,t){t.minorUnit;var n=[],r=["total_tax","total_shipping"];return e.forEach((function(e){(0<e.value||e.key&&r.includes(e.key))&&n.push({label:e.label,pending:!1,amount:e.value})})),n};var z={};t.canMakePayment=function(e,t){var n=e.country,r=e.currency,a=e.total;return new Promise((function(e,o){var i=[n,r,a.amount].reduce((function(e,t){return"".concat(e,"-").concat(t)}));return r?i in z?e(z[i]):I.then((function(s){if(s.error)return o(s.error);s.paymentRequest({country:n,currency:r,total:a}).canMakePayment().then((function(n){return z[i]=t(n),e(z[i])}))})).catch(o):e(!1)}))},t.registerLocalPaymentMethod=function(e){R.push(e)},t.getLocalPaymentMethods=function(){return R},t.cartContainsPreOrder=function(){var e=(0,v.getSetting)("stripePaymentData");return e&&e.pre_order},t.cartContainsSubscription=function(){var e=(0,v.getSetting)("stripePaymentData");return e&&e.subscription},t.getDefaultSourceArgs=function(e){var t=e.type,n=e.amount,r=e.billingData,a=e.currency,o=e.returnUrl;return{type:t,amount:n,currency:a,owner:F(r),redirect:{return_url:o}}},t.isTestMode=function(){return"test"===(0,v.getSetting)("stripeGeneralData").mode};var J=function(e){return"".concat("stripe:").concat(e)};t.storeInCache=function(e,t){var n=Math.floor((new Date).getTime()/1e3)+900;"sessionStorage"in window&&sessionStorage.setItem(J(e),JSON.stringify({value:t,exp:n}))},t.getFromCache=function(e){if("sessionStorage"in window)try{var t=JSON.parse(sessionStorage.getItem(J(e)));if(t){var n=t.value,r=t.exp;if(!(Math.floor((new Date).getTime()/1e3)>r))return n;Q(J(e))}}catch(e){}return null};var Q=function(e){"sessionStorage"in window&&sessionStorage.removeItem(J(e))};t.deleteFromCache=Q,t.versionCompare=function(e,t,n){switch(n){case"<":return e<t;case">":return e>t;case"<=":return e<=t;case">=":return e>=t;case"=":return e==t}return!1},t.isCartPage=function(){return"cart"===(0,v.getSetting)("stripeGeneralData").page},t.isCheckoutPage=function(){return"checkout"===(0,v.getSetting)("stripeGeneralData").page}},4184:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function a(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var o=typeof n;if("string"===o||"number"===o)e.push(n);else if(Array.isArray(n)&&n.length){var i=a.apply(null,n);i&&e.push(i)}else if("object"===o)for(var s in n)r.call(n,s)&&n[s]&&e.push(s)}}return e.join(" ")}e.exports?(a.default=a,e.exports=a):void 0===(n=function(){return a}.apply(t,[]))||(e.exports=n)}()},1127:()=>{},1465:()=>{},7776:()=>{},4836:()=>{},85:()=>{},3110:()=>{},8356:()=>{},5773:()=>{},9509:()=>{},3139:()=>{}}]);
3
  //# sourceMappingURL=commons.js.map
1
  /*! For license information please see commons.js.LICENSE.txt */
2
+ (self.webpackChunkwc_stripe=self.webpackChunkwc_stripe||[]).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 s=e[o](i),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).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 s(e){t(i,a,o,s,c,"next",e)}function c(e){t(i,a,o,s,c,"throw",e)}s(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,s=e[Symbol.iterator]();!(r=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==s.return||s.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 s(t){var n="function"==typeof Map?new Map:void 0;return e.exports=s=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)},s(t)}e.exports=s},6664:function(e,t,n){!function(e,t){"use strict";t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;function n(){}function r(){}r.resetWarningCache=n;var a,o,i=(a=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 a={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:r,resetWarningCache:n};return a.PropTypes=a,a}()},a(o={exports:{}},o.exports),o.exports);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 c(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){l(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}function u(e){return u="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},u(e)}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=n){var r,a,o=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){s=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(s)throw a}}return o}}(e,t)||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)||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 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}var m=function(e){var n=t.useRef(e);return t.useEffect((function(){n.current=e}),[e]),n.current},f=function(e){return null!==e&&"object"===u(e)},y="[object Object]",g=function e(t,n){if(!f(t)||!f(n))return t===n;var r=Array.isArray(t);if(r!==Array.isArray(n))return!1;var a=Object.prototype.toString.call(t)===y;if(a!==(Object.prototype.toString.call(n)===y))return!1;if(!a&&!r)return t===n;var o=Object.keys(t),i=Object.keys(n);if(o.length!==i.length)return!1;for(var s={},c=0;c<o.length;c+=1)s[o[c]]=!0;for(var u=0;u<i.length;u+=1)s[i[u]]=!0;var l=Object.keys(s);if(l.length!==o.length)return!1;var p=t,d=n;return l.every((function(t){return e(p[t],d[t])}))},v=function(e,t,n){return f(e)?Object.keys(e).reduce((function(r,a){var o=!f(t)||!g(e[a],t[a]);return n.includes(a)?(o&&console.warn("Unsupported prop change: options.".concat(a," is not a mutable property.")),r):o?c(c({},r||{}),{},l({},a,e[a])):r}),null):null},b=function(e){if(null===e||f(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.")},h=function(e){if(function(e){return f(e)&&"function"==typeof e.then}(e))return{tag:"async",stripePromise:Promise.resolve(e).then(b)};var t=b(e);return null===t?{tag:"empty"}:{tag:"sync",stripe:t}},P=t.createContext(null);P.displayName="ElementsContext";var E=function(e){var n=e.stripe,r=e.options,a=e.children,o=t.useMemo((function(){return h(n)}),[n]),i=p(t.useState((function(){return{stripe:"sync"===o.tag?o.stripe:null,elements:"sync"===o.tag?o.stripe.elements(r):null}})),2),s=i[0],c=i[1];t.useEffect((function(){var e=!0;return"async"!==o.tag||s.stripe?"sync"!==o.tag||s.stripe||c({stripe:o.stripe,elements:o.stripe.elements(r)}):o.stripePromise.then((function(t){t&&e&&c({stripe:t,elements:t.elements(r)})})),function(){e=!1}}),[o,s,r]);var u=m(n);t.useEffect((function(){null!==u&&u!==n&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.")}),[u,n]);var l=m(r);return t.useEffect((function(){if(s.elements){var e=v(r,l,["clientSecret","fonts"]);e&&s.elements.update(e)}}),[r,l,s.elements]),t.useEffect((function(){var e=s.stripe;e&&e._registerWrapper&&e.registerAppInfo&&(e._registerWrapper({name:"react-stripe-js",version:"1.8.0"}),e.registerAppInfo({name:"react-stripe-js",version:"1.8.0",url:"https://stripe.com/docs/stripe-js/react"}))}),[s.stripe]),t.createElement(P.Provider,{value:s},a)};E.propTypes={stripe:i.any,options:i.object};var O=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(P),e)},S=function(e){return(0,e.children)(O("mounts <ElementsConsumer>"))};S.propTypes={children:i.func.isRequired};var _=function(e){var n=t.useRef(e);return t.useEffect((function(){n.current=e}),[e]),function(){n.current&&n.current.apply(n,arguments)}},w=function(){},C=function(e,n){var r,a="".concat((r=e).charAt(0).toUpperCase()+r.slice(1),"Element"),o=n?function(e){O("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,s=void 0===i?{}:i,c=n.onBlur,u=void 0===c?w:c,l=n.onFocus,p=void 0===l?w:l,d=n.onReady,f=void 0===d?w:d,y=n.onChange,g=void 0===y?w:y,b=n.onEscape,h=void 0===b?w:b,P=n.onClick,E=void 0===P?w:P,S=O("mounts <".concat(a,">")).elements,C=t.useRef(null),k=t.useRef(null),M=_(f),j=_(u),D=_(p),x=_(E),R=_(g),A=_(h);t.useLayoutEffect((function(){if(null==C.current&&S&&null!=k.current){var t=S.create(e,s);C.current=t,t.mount(k.current),t.on("ready",(function(){return M(t)})),t.on("change",R),t.on("blur",j),t.on("focus",D),t.on("escape",A),t.on("click",x)}}));var I=m(s);return t.useEffect((function(){if(C.current){var e=v(s,I,["paymentRequest"]);e&&C.current.update(e)}}),[s,I]),t.useLayoutEffect((function(){return function(){C.current&&(C.current.destroy(),C.current=null)}}),[]),t.createElement("div",{id:r,className:o,ref:k})};return o.propTypes={id:i.string,className:i.string,onChange:i.func,onBlur:i.func,onFocus:i.func,onReady:i.func,onClick:i.func,options:i.object},o.displayName=a,o.__elementType=e,o},k="undefined"==typeof window,M=C("auBankAccount",k),j=C("card",k),D=C("cardNumber",k),x=C("cardExpiry",k),R=C("cardCvc",k),A=C("fpxBank",k),I=C("iban",k),L=C("idealBank",k),T=C("p24Bank",k),N=C("epsBank",k),B=C("payment",k),F=C("paymentRequestButton",k),q=C("linkAuthentication",k),X=C("shippingAddress",k),U=C("affirmMessage",k),V=C("afterpayClearpayMessage",k);e.AffirmMessageElement=U,e.AfterpayClearpayMessageElement=V,e.AuBankAccountElement=M,e.CardCvcElement=R,e.CardElement=j,e.CardExpiryElement=x,e.CardNumberElement=D,e.Elements=E,e.ElementsConsumer=S,e.EpsBankElement=N,e.FpxBankElement=A,e.IbanElement=I,e.IdealBankElement=L,e.LinkAuthenticationElement=q,e.P24BankElement=T,e.PaymentElement=B,e.PaymentRequestButtonElement=F,e.ShippingAddressElement=X,e.useElements=function(){return O("calls useElements()").elements},e.useStripe=function(){return O("calls useStripe()").stripe},Object.defineProperty(e,"__esModule",{value:!0})}(t,n(9196))},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,s=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},c=Promise.resolve().then((function(){return e=null,null!==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)}))),i;var e})),u=!1;c.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 c.then((function(e){return s(e,t,r)}))}},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(8744);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(4901);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(3193);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]}}))}))},3193:(e,t,n)=>{var r=n(9307),a=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Installments=void 0;var o=a(n(1284)),i=a(n(8926)),s=a(n(3038)),c=n(9307),u=n(5736),l=a(n(6989)),p=a(n(4184)),d=n(1134);n(1465);var m=function(e){var t=e.paymentMethodName,n=(e.getCreatePaymentMethodArgs,e.cardFormComplete),a=void 0!==n&&n,p=e.addPaymentMethodData,m=void 0===p?null:p,g=e.getPaymentMethod,v=(0,c.useState)(null),b=(0,s.default)(v,2),h=b[0],P=b[1],E=(0,c.useState)(""),O=(0,s.default)(E,2),S=O[0],_=O[1],w=(0,c.useState)(!1),C=(0,s.default)(w,2),k=C[0],M=C[1];return(0,c.useEffect)((function(){a&&(M(!0),_(""),g().then(function(){var e=(0,i.default)(o.default.mark((function e(n){var r,a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n){e.next=6;break}return e.next=3,(0,l.default)({url:(0,d.getRoute)("create/payment_intent"),method:"POST",data:{payment_method_id:n,payment_method:t}});case 3:a=e.sent,P(a.installments),null!==(r=Object.keys(a.installments))&&void 0!==r&&r.length&&_(Object.keys(a.installments)[0]);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){})).finally((function(){return M(!1)})))}),[a,g]),r.createElement("div",{className:"wc-stripe-installments__container"},r.createElement("label",null,(0,u.__)("Pay in installments:","woo-stripe-payment"),r.createElement(y,{loading:k})),r.createElement(f,{installment:S,onChange:function(e){_(e.target.value),m&&m({_stripe_installment_plan:e.target.value})},installments:h,isLoading:k}))};t.Installments=m;var f=function(e){var t,n=e.installment,a=e.installments,o=e.onChange,i=e.isLoading;return t=i?r.createElement("option",{value:"",disabled:!0},(0,u.__)("Loading installments...","woo-stripe-payment")):null===a?r.createElement("option",{value:"",disabled:!0},(0,u.__)("Fill out card form for eligibility.","woo-stripe-payment")):Object.keys(a).map((function(e){return r.createElement("option",{key:e,value:e,dangerouslySetInnerHTML:{__html:a[e].text}})})),r.createElement("select",{value:n,onChange:o,className:(0,p.default)({loading:i})},t)},y=function(e){var t=e.loading;return r.createElement("div",{className:"wc-stripe-installment-loader__container"},t&&r.createElement("div",{className:"wc-stripe-installment-loader"},r.createElement("div",null),r.createElement("div",null),r.createElement("div",null)))},g=m;t.default=g},2029:(e,t,n)=>{var r=n(9307),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,s=i.PaymentMethodLabel,c=i.PaymentMethodIcons;return Array.isArray(n)||(n=[n]),r.createElement("span",{className:"wc-stripe-label-container ".concat(a)},r.createElement(s,{text:t}),r.createElement(c,{icons:n,align:"left"}))}},4901:(e,t,n)=>{var r=n(9307),a=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.PaymentMethod=void 0;var o=a(n(9713)),i=a(n(6479)),s=n(9307);function c(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?c(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(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,c=t("description"),p=(0,s.useRef)(null);return(0,s.useEffect)((function(){p.current&&0==p.current.childNodes.length&&p.current.classList.add("no-content")})),r.createElement(r.Fragment,null,c&&r.createElement(l,{desc:c,payment_method:t("name")}),r.createElement("div",{ref:p,className:"wc-stripe-blocks-payment-method-content"},r.createElement(o,u(u({},a),{},{getData:t}))))};var l=function(e){var t=e.desc,n=e.payment_method;return r.createElement("div",{className:"wc-stripe-blocks-payment-method__desc ".concat(n)},r.createElement("p",null,t))}},8744:(e,t,n)=>{var r=n(9307),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 s=i;t.default=s},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(1284)),o=r(n(8926)),i=r(n(3038)),s=n(9307),c=r(n(6989)),u=n(1134);t.useCreateLinkToken=function(e){var t=e.setValidationError,n=(0,s.useState)(!1),r=(0,i.default)(n,2),l=r[0],p=r[1],d=(0,s.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,c.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,s.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(9307),o=r(n(9625)),i=n(1134);t.useInitializePlaid=function(e){var t=e.getData,n=e.linkToken,r=(0,a.useRef)(null),s=(0,a.useRef)(null),c=(0,a.useCallback)((function(){return new Promise((function(e,t){s.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){s.current.resolve({publicToken:e,metaData:t})},onExit:function(e){s.current.reject(!!e&&(0,i.getErrorMessage)(e.error_message))}}))}),[n]),c}},5201:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.useProcessPayment=void 0;var a=r(n(1284)),o=r(n(9713)),i=r(n(8926)),s=n(9307),c=n(1134);t.useProcessPayment=function(e){var t=e.openLinkPopup,n=e.onPaymentProcessing,r=e.responseTypes,u=e.paymentMethod;(0,s.useEffect)((function(){var e=n((0,i.default)(a.default.mark((function e(){var n,i,s,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,s=i.publicToken,l=i.metaData,(0,c.deleteFromCache)("linkToken"),e.abrupt("return",(0,c.ensureSuccessResponse)(r,{meta:{paymentMethodData:(n={},(0,o.default)(n,"".concat(u,"_token_key"),s),(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,c.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(9307),a=n(5318),o=a(n(3038)),i=a(n(6479)),s=n(9307),c=n(4613),u=n(1134),l=n(3187),p=a(n(1065)),d=n(7260),m=n(3636),f=n(5736),y=(0,u.getSettings)("stripe_ach_data"),g=function(e){var t=e.getData,n=e.eventRegistration,a=e.components,c=e.emitResponse,l=e.onSubmit,p=((0,i.default)(e,["getData","eventRegistration","components","emitResponse","onSubmit"]),c.responseTypes),f=n.onPaymentProcessing,y=n.onCheckoutAfterProcessingWithError,g=a.ValidationInputError,b=a.LoadingMask,h=(0,s.useState)(!1),P=(0,o.default)(h,2),E=P[0],O=P[1],S=(0,d.useCreateLinkToken)({setValidationError:O});(0,m.useProcessCheckoutError)({responseTypes:p,subscriber:y});var _=(0,d.useInitializePlaid)({getData:t,linkToken:S,onSubmit:l});return(0,d.useProcessPayment)({openLinkPopup:_,onPaymentProcessing:f,responseTypes:p,paymentMethod:t("name")}),r.createElement(b,{isLoading:!E&&!S,showSpinner:!0},u.isTestMode&&r.createElement(v,null),E&&r.createElement(g,{errorMessage:E}))},v=function(){return r.createElement("div",{className:"wc-stripe-blocks-ach__creds"},r.createElement("label",{className:"wc-stripe-blocks-ach__creds-label"},(0,f.__)("Test Credentials","woo-stripe-payment")),r.createElement("div",{className:"wc-stripe-blocks-ach__username"},r.createElement("div",null,r.createElement("strong",null,(0,f.__)("username","woo-stripe-payment")),": user_good"),r.createElement("div",null,r.createElement("strong",null,(0,f.__)("password","woo-stripe-payment")),": pass_good"),r.createElement("div",null,r.createElement("strong",null,(0,f.__)("pin","woo-stripe-payment")),": credential_good")))};(0,c.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(9307),a=n(5318),o=a(n(3038)),i=a(n(6479)),s=n(9307),c=n(4613),u=n(1134),l=n(6664),p=a(n(7082)),d=n(3636),m=(0,u.getSettings)("stripe_applepay_data"),f=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,c=e.billing,u=e.shippingData,p=e.eventRegistration,m=e.emitResponse,f=e.onSubmit,y=e.activePaymentMethod,g=((0,i.default)(e,["getData","onClick","onClose","billing","shippingData","eventRegistration","emitResponse","onSubmit","activePaymentMethod"]),p.onPaymentProcessing),v=m.responseTypes,b=m.noticeContexts,h=(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:c,shippingData:u,onPaymentProcessing:g,emitResponse:m,error:E,onSubmit:f,activePaymentMethod:y,exportedValues:O}).setPaymentMethod;(0,d.useAfterProcessingPayment)({getData:t,eventRegistration:p,responseTypes:v,activePaymentMethod:y,messageContext:b.EXPRESS_PAYMENTS});var _=(0,d.usePaymentRequest)({getData:t,onClose:a,stripe:h,billing:c,shippingData:u,eventRegistration:p,setPaymentMethod:S,exportedValues:O,canPay:function(e){return null!=e&&e.applePay}}).paymentRequest,w=(0,s.useCallback)((function(e){_&&(e.preventDefault(),n(),_.show())}),[_,n]);return _?r.createElement("button",{className:"apple-pay-button ".concat(t("buttonStyle")),style:{"-apple-pay-button-type":t("buttonType")},onClick:w}):null},g=function(e){var t=e.getData;return(0,i.default)(e,["getData"]),r.createElement("div",{className:"apple-pay-block-editor"},r.createElement("img",{src:t("editorIcon")}))};(0,c.registerExpressPaymentMethod)({name:m("name"),canMakePayment:function(e){var t=e.cartTotals;if((0,i.default)(e,["cartTotals"]),m("isAdmin"))return!0;var n=t.currency_code,r=t.total_price;return(0,u.canMakePayment)({country:m("countryCode"),currency:n.toLowerCase(),total:{label:m("totalLabel"),amount:parseInt(r)}},(function(e){return null!=e&&e.applePay}))},content:r.createElement(f,{getData:m}),edit:r.createElement(g,{getData:m}),supports:{showSavedCards:m("showSavedCards"),showSaveOption:m("showSaveOption"),features:m("features")}})},7354:(e,t,n)=>{var r=n(9307);n(3110);var a=n(1134),o=n(6664),i=n(5736),s=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(s,null)})},3329:(e,t,n)=>{var r=n(9307),a=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(9713)),i=a(n(3038)),s=n(1134),c=n(9307),u=n(6664),l=n(5736),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 m(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 f={focus:"focused",empty:"empty",invalid:"invalid"},y=function(e){var t=e.type,n=e.src;return t?r.createElement("img",{className:"wc-stripe-card ".concat(t),src:n}):null};t.default=function(e){var t=e.getData,n=e.onChange,a=e.onComplete,o=(0,c.useState)(""),d=(0,i.default)(o,2),g=d[0],v=d[1],b=(0,c.useRef)([]),h=(0,c.useState)(null),P=(0,i.default)(h,2),E=P[0],O=P[1],S=(0,u.useElements)(),_=t("customForm"),w=(0,s.getCreditCardForm)(_),C=w.component,k=void 0===C?null:C,M=w.breakpoint,j=void 0===M?475:M,D=t("postalCodeEnabled"),x={},R=(0,c.useRef)({cardNumber:{},cardExpiry:{},cardCvc:{}});["cardNumber","cardExpiry","cardCvc"].forEach((function(e){x[e]=m(m({classes:f},t("cardOptions")),t("customFieldOptions")[e])}));var A=(0,c.useCallback)((function(e){b.current.includes(e)||b.current.push(e)}),[]);(0,p.useBreakpointWidth)({name:"creditCardForm",width:j,node:E,className:"small-form"});var I=(0,c.useCallback)((function(e){for(var n=0,r=Object.keys(t("cards"));n<r.length;n++){var a=r[n];if(a===e)return t("cards")[a]}return""}),[]);return k?r.createElement("div",{className:"wc-stripe-custom-form ".concat(_),ref:O},(0,c.cloneElement)(k,{postalCodeEnabled:D,options:x,onChange:function(e){return A(e),function(t){if(n(t),R.current[t.elementType]=t,"cardNumber"===t.elementType&&("unknown"===t.brand?v(""):v(t.brand)),t.complete){var r=b.current.indexOf(e);if(b.current[r+1]){var o=b.current[r+1];S.getElement(o).focus()}}var i;a((i=R.current,Object.keys(i).filter((function(e){return!!i[e].complete})).length===Object.keys(i).length))}},CardIcon:r.createElement(y,{type:g,src:I(g)})})):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")[_])))}},6835:(e,t,n)=>{var r=n(9307);n(8356);var a=n(1134),o=n(6664),i=n(5736),s=n(9307),c=function(e){var t=e.CardIcon,n=e.options,a=e.onChange;return(0,s.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(c,null),breakpoint:375})},9775:(e,t,n)=>{var r=n(9307),a=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(9713)),i=n(6664),s=n(1134),c=n(9307);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=e.onComplete,u={card:{}},p=(0,c.useMemo)((function(){var e;return l(l({},{value:{postalCode:null==n||null===(e=n.billingData)||void 0===e?void 0:e.postcode},hidePostalCode:(0,s.isFieldRequired)("postcode"),iconStyle:"default"}),t("cardOptions"))}),[n.billingData]);return r.createElement("div",{className:"wc-stripe-inline-form"},r.createElement(i.CardElement,{options:p,onChange:function(e){a(e),u[e.elementType]=e,o(Object.keys(u).filter((function(e){return!!u[e].complete})).length===Object.keys(u).length)}}))}},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)},4664:(e,t,n)=>{var r=n(9307),a=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.PaymentElementComponent=void 0;var o=a(n(1284)),i=a(n(8926)),s=a(n(3038)),c=a(n(7154)),u=a(n(9713)),l=a(n(6479)),p=n(9307),d=n(6664),m=n(1134),f=n(3187),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,u.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var b=(0,m.getSettings)("stripe_cc_data"),h=function(e){var t,n,a=e.cartData,o=(0,l.default)(e,["cartData"]),i=null==a||null===(t=a.extensions)||void 0===t||null===(n=t.stripe_cc)||void 0===n?void 0:n.clientSecret;return r.createElement(r.Fragment,null,r.createElement(d.Elements,{stripe:m.initStripe,options:v(v({},b("elementOptions")),{},{clientSecret:i})},r.createElement(P,(0,c.default)({},o,{clientSecret:i}))))};t.PaymentElementComponent=h;var P=function(e){e.onComplete;var t=e.clientSecret,n=(0,l.default)(e,["onComplete","clientSecret"]),a=(0,p.useState)(!1),c=(0,s.default)(a,2),u=c[0],m=c[1],g=b("installmentsActive"),v=((0,d.useElements)(),(0,d.useStripe)()),h=n.billing.billingData,P=n.eventRegistration,E=n.emitResponse,O=n.shouldSavePayment,S=(P.onPaymentProcessing,P.onCheckoutAfterProcessingWithError),_=E.responseTypes,w=E.noticeContexts,C=b("name"),k=(0,p.useCallback)((function(e){m(e.complete)}),[]),M=(0,y.useUpdatePaymentIntent)({clientSecret:t,billingData:h,eventRegistration:P,responseTypes:_,shouldSavePayment:O,noticeContexts:w,name:C}),j=M.updatePaymentIntent,D=M.addPaymentMethodData;(0,y.useProcessCheckoutError)({responseTypes:_,subscriber:S,messageContext:w.PAYMENTS});var x=(0,p.useCallback)((0,i.default)(o.default.mark((function e(){var t,n,r;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=null,e.next=3,j();case 3:return null!=(r=e.sent)&&null!==(t=r.paymentIntent)&&void 0!==t&&t.payment_method&&(n=r.paymentIntent.payment_method),e.abrupt("return",n);case 6:case"end":return e.stop()}}),e)}))),[j]);return r.createElement(r.Fragment,null,r.createElement(d.PaymentElement,{options:{fields:{billingDetails:"never"},wallets:{applePay:"never",googlePay:"never"}},onChange:k}),g&&r.createElement(f.Installments,{paymentMethodName:b("name"),stripe:v,cardFormComplete:u,getPaymentMethod:x,addPaymentMethodData:D}))},E=h;t.default=E},7205:(e,t,n)=>{var r=n(9307),a=n(5318),o=a(n(1284)),i=a(n(8926)),s=a(n(3038)),c=n(9307),u=n(4613),l=n(1134),p=n(6664),d=n(3187),m=a(n(1065)),f=a(n(3329)),y=a(n(9775)),g=a(n(4664)),v=n(3636),b=(0,l.getSettings)("stripe_cc_data"),h=function(e){var t=(0,c.useState)(!1),n=(0,s.default)(t,2),a=n[0],o=n[1];if((0,c.useEffect)((function(){l.initStripe.catch((function(e){o(e)}))}),[o]),a)throw new Error(a);return b("isPaymentElement")?r.createElement(g.default,e):r.createElement(p.Elements,{stripe:l.initStripe,options:b("elementOptions")},r.createElement(P,e))},P=function(e){var t=e.getData,n=e.billing,a=e.shippingData,u=e.emitResponse,l=e.eventRegistration,m=e.activePaymentMethod,g=e.shouldSavePayment,b=(0,v.useStripeError)(),h=(0,s.default)(b,2),P=h[0],E=h[1],O=(0,c.useState)(!1),S=(0,s.default)(O,2),_=S[0],w=S[1],C=l.onPaymentProcessing,k=(0,p.useStripe)(),M=(0,p.useElements)(),j=(0,c.useCallback)((function(){var e=t("customFormActive")?p.CardNumberElement:p.CardElement;return{card:M.getElement(e)}}),[k,M]),D=(0,v.useSetupIntent)({getData:t,cartTotal:n.cartTotal,setError:E}),x=D.setupIntent,R=D.removeSetupIntent,A=(0,v.useProcessPaymentIntent)({getData:t,billing:n,shippingData:a,emitResponse:u,error:P,onPaymentProcessing:C,shouldSavePayment:g,setupIntent:x,removeSetupIntent:R,getPaymentMethodArgs:j,activePaymentMethod:m}),I=A.getCreatePaymentMethodArgs,L=A.addPaymentMethodData;(0,v.useAfterProcessingPayment)({getData:t,eventRegistration:l,responseTypes:u.responseTypes,activePaymentMethod:m,shouldSavePayment:g});var T=(0,c.useCallback)((0,i.default)(o.default.mark((function e(){var t,n,r;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=null,e.next=3,k.createPaymentMethod(I());case 3:return null!=(r=e.sent)&&null!==(t=r.paymentMethod)&&void 0!==t&&t.id&&(n=r.paymentMethod.id),e.abrupt("return",n);case 6:case"end":return e.stop()}}),e)}))),[k,I]),N=t("customFormActive")?f.default:y.default;return r.createElement("div",{className:"wc-stripe-card-container"},r.createElement(N,{getData:t,billing:n,onChange:function(e){e.error?E(e.error):E(!1)},onComplete:w}),t("installmentsActive")&&r.createElement(d.Installments,{paymentMethodName:t("name"),cardFormComplete:_,addPaymentMethodData:L,getPaymentMethod:T}))};(0,u.registerPaymentMethod)({name:b("name"),label:r.createElement(d.PaymentMethodLabel,{title:b("title"),paymentMethod:b("name"),icons:b("icons")}),ariaLabel:"Credit Cards",canMakePayment:function(){return l.initStripe},content:r.createElement(d.PaymentMethod,{content:h,getData:b}),savedTokenComponent:r.createElement(m.default,{getData:b}),edit:r.createElement(d.PaymentMethod,{content:h,getData:b}),supports:{showSavedCards:b("showSavedCards"),showSaveOption:!0,features:b("features")}})},7082:(e,t,n)=>{var r=n(9307),a=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(4575)),i=a(n(3913)),s=a(n(2205)),c=a(n(8585)),u=a(n(9754));var l=function(e){(0,s.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,c.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(9307).Component);t.default=l},5212:(e,t,n)=>{var r=n(9307),a=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(3038)),i=a(n(6479)),s=n(9307),c=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,m=e.checkoutStatus,f=e.eventRegistration,y=e.activePaymentMethod,g=e.onClick,v=e.onClose,b=(0,i.default)(e,["getData","setErrorMessage","billing","shippingData","canMakePayment","checkoutStatus","eventRegistration","activePaymentMethod","onClick","onClose"]),h={merchantId:t("merchantId"),merchantName:t("merchantName")},P=(0,u.useStripeError)(),E=(0,o.default)(P,2),O=E[0],S=(E[1],(0,s.useRef)()),_=b.onSubmit,w=b.emitResponse,C=f.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:m,activePaymentMethod:y}).setPaymentMethod,D=(0,c.usePaymentRequest)({getData:t,publishableKey:l,merchantInfo:h,billing:a,shippingData:p}),x=(0,c.usePaymentsClient)({merchantInfo:h,paymentRequest:D,billing:a,shippingData:p,eventRegistration:f,canMakePayment:d,setErrorMessage:n,onSubmit:_,setPaymentMethod:j,exportedValues:k,onClick:g,onClose:v,getData:t}),R=x.button,A=x.removeButton;return(0,u.useAfterProcessingPayment)({getData:t,eventRegistration:f,responseTypes:w.responseTypes,activePaymentMethod:y}),(0,u.useExpressBreakpointWidth)({payment_method:t("name"),width:M}),(0,s.useEffect)((function(){R&&(A(S.current),S.current.append(R))}),[R]),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(9307);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(9307),s=n(3097),c=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,m=l.shippingRates,f=t(),y=f.processingCountry,g=f.totalPriceLabel;return(0,i.useMemo)((function(){var e=p(p({},{emailRequired:(0,c.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}}}),s.BASE_PAYMENT_METHOD)],shippingAddressRequired:l.needsShipping,transactionInfo:(0,u.getTransactionInfo)({billing:o,processingCountry:y,totalPriceLabel:g}),callbackIntents:["PAYMENT_AUTHORIZATION"]}),s.BASE_PAYMENT_REQUEST);if(e.allowedPaymentMethods[0].parameters.billingAddressRequired=!0,e.allowedPaymentMethods[0].parameters.billingAddressParameters={format:"FULL",phoneNumberRequired:(0,c.isFieldRequired)("phone",d.country)&&(0,c.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)(m);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(1284)),s=r(n(8926)),c=r(n(3038)),u=n(9307),l=r(n(9127)),p=n(1134),d=n(6664),m=n(8664),f=n(5736),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,b=e.eventRegistration,h=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,c.default)(k,2),j=M[0],D=M[1],x=(0,u.useState)(null),R=(0,c.default)(x,2),A=R[0],I=R[1],L=(0,u.useRef)(r),T=(0,u.useRef)(g),N=(0,d.useStripe)(),B=(0,y.usePaymentEvents)({billing:r,shippingData:g,eventRegistration:b}).addPaymentEvent;(0,u.useEffect)((function(){L.current=r,T.current=g}));var F=(0,u.useCallback)((function(e){var t,n;if(null!=e&&null!==(t=e.paymentMethodData)&&void 0!==t&&null!==(n=t.info)&&void 0!==n&&n.billingAddress){var r,a=e.paymentMethodData.info.billingAddress;(0,p.isAddressValid)(L.current.billingData,["phone","email"])&&(0,p.isEmpty)(null===(r=L.current.billingData)||void 0===r?void 0:r.phone)&&(a={phoneNumber:a.phoneNumber}),O.billingData=L.current.billingData=(0,m.toCartAddress)(a,{email:e.email})}null!=e&&e.shippingAddress&&(O.shippingAddress=(0,m.toCartAddress)(e.shippingAddress))}),[O,n]),q=(0,u.useCallback)((function(e){for(;e.firstChild;)e.removeChild(e.firstChild)}),[A]),X=(0,u.useCallback)((0,s.default)(i.default.mark((function e(){var t,r,a;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return S(),e.prev=1,e.next=4,j.loadPaymentData(n);case 4:return t=e.sent,F(t),r=JSON.parse(t.paymentMethodData.tokenizationData.token),e.next=9,N.createPaymentMethod({type:"card",card:{token:r.id},billing_details:(0,p.getBillingDetailsFromAddress)(L.current.billingData)});case 9:if(!(a=e.sent).error){e.next=12;break}throw new p.StripeError(a.error);case 12:E(a.paymentMethod.id),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(1),"CANCELED"===(null===e.t0||void 0===e.t0?void 0:e.t0.statusCode)?_():(console.log((0,p.getErrorMessage)(e.t0)),P((0,p.getErrorMessage)(e.t0)));case 18:case"end":return e.stop()}}),e,null,[[1,15]])}))),[N,j,S]),U=(0,u.useCallback)((0,s.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,h;case 4:I(j.createButton(v({onClick:X},w("buttonStyle"))));case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.log(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])}))),[N,A,j,X]),V=(0,u.useMemo)((function(){var e={environment:C,merchantInfo:t,paymentDataCallbacks:{onPaymentAuthorized:function(){return Promise.resolve({transactionState:"SUCCESS"})}}};return n.shippingAddressRequired&&(e.paymentDataCallbacks.onPaymentDataChanged=function(e){return new Promise((function(t,n){var r,i=T.current,s=e.shippingAddress,c=e.shippingOptionData,u=(0,m.toCartAddress)(s),d=(0,p.getSelectedShippingOption)(c.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,m.getPaymentRequestUpdate)({billing:r,shippingData:{needsShipping:!0,shippingRates:a.shippingRates},processingCountry:w("processingCountry"),totalPriceLabel:w("totalPriceLabel")}):{error:{reason:"SHIPPING_ADDRESS_UNSERVICEABLE",message:(0,f.__)("Your shipping address is not serviceable.","woo-stripe-payment"),intent:"SHIPPING_ADDRESS"}})}),y&&g),T.current.setShippingAddress(v(v({},T.current.shippingAddress),u)),"shipping_option_unselected"!==c.id&&(r=T.current).setSelectedRates.apply(r,(0,a.default)(d))}))}),e}),[n]);return(0,u.useEffect)((function(){D(new google.payments.api.PaymentsClient(V))}),[V]),(0,u.useEffect)((function(){U()}),[U]),{button:A,removeButton:q}}},5341:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),n(9509);var r=n(9031);Object.keys(r).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===r[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}}))}))},9031:(e,t,n)=>{var r=n(9307),a=n(5318),o=a(n(7154)),i=a(n(6479)),s=a(n(9713)),c=n(4613),u=n(1134),l=n(5516),p=a(n(5212)),d=n(3097),m=a(n(1417)),f=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,s.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,b,h=(0,u.getSettings)("stripe_googlepay_data"),P=(v=new m.default.payments.api.PaymentsClient({environment:h("environment"),merchantInfo:{merchantId:h("merchantId"),merchantName:h("merchantName")}}),b=g(g({},d.BASE_PAYMENT_REQUEST),{},{allowedPaymentMethods:[d.BASE_PAYMENT_METHOD]}),v.isReadyToPay(b).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"]),s=n.ValidationInputError,c=(0,l.useErrorMessage)(),d=c.errorMessage,m=c.setErrorMessage;return r.createElement("div",{className:"wc-stripe-gpay-container"},r.createElement(f.Elements,{stripe:u.initStripe},r.createElement(p.default,(0,o.default)({getData:t,canMakePayment:P,setErrorMessage:m},a)),d&&r.createElement(s,{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,c.registerExpressPaymentMethod)({name:h("name"),canMakePayment:function(){return h("isAdmin")?!(0,u.isCartPage)()||h("cartCheckoutEnabled"):!((0,u.isCartPage)()&&!h("cartCheckoutEnabled"))&&u.initStripe.then((function(e){return e.error?e:P}))},content:r.createElement(E,{getData:h}),edit:r.createElement(O,{getData:h}),supports:{showSavedCards:h("showSavedCards"),showSaveOption:h("showSaveOption"),features:h("features")}})},8664:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.toCartAddress=t.getShippingOptions=t.getShippingOptionParameters=t.getPaymentRequestUpdate=t.getTransactionInfo=void 0;var a=r(n(319)),o=n(1134),i=((0,n(4617).getSetting)("stripeGeneralData"),function(e){var t=e.billing,n=e.processingCountry,r=e.totalPriceLabel,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ESTIMATED",i=t.cartTotal,c=t.cartTotalItems,u=t.currency,l={countryCode:n,currencyCode:u.code,totalPriceStatus:a,totalPrice:(0,o.removeNumberPrecision)(i.value,u.minorUnit).toString(),displayItems:s(c,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,s=n.shippingRates,u={newTransactionInfo:i({billing:t,processingCountry:r,totalPriceLabel:a},"FINAL")};return o&&(u.newShippingOptionParameters=c(s)),u};var s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=[],r=["total_tax","total_shipping"];return e.forEach((function(e){(0<e.value||e.key&&r.includes(e.key))&&n.push({label:e.label,type:"LINE_ITEM",price:(0,o.removeNumberPrecision)(e.value,t).toString()})})),n},c=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=c;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 s=n(2343);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 c=n(1500);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 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]}}))}));var d=n(1225);Object.keys(d).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in t&&t[e]===d[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return d[e]}}))}))},1261:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.useAfterProcessingPayment=void 0;var a=r(n(1284)),o=r(n(8926)),i=n(9307),s=n(6664),c=n(1134),u=n(3893);t.useAfterProcessingPayment=function(e){var t=e.getData,n=e.eventRegistration,r=e.responseTypes,l=e.activePaymentMethod,p=e.shouldSavePayment,d=void 0!==p&&p,m=e.messageContext,f=void 0===m?null:m,y=(0,s.useStripe)(),g=n.onCheckoutAfterProcessingWithSuccess,v=n.onCheckoutAfterProcessingWithError;(0,u.useProcessCheckoutError)({responseTypes:r,subscriber:v,messageContext:f}),(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,c.handleCardAction)({redirectUrl:o,responseTypes:r,stripe:y,getData:t,shouldSavePayment: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(9307),i=n(1134),s=function(e){var t=e.name,n=e.width,r=e.node,s=e.className,c=(0,o.useState)(window.innerWidth),u=(0,a.default)(c,2),l=u[0],p=u[1],d=(0,o.useCallback)((function(e){var t=(0,i.getFromCache)(e);return t?parseInt(t):0}),[]),m=(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)&&m(t,n),e.clientWidth<n?e.classList.add(s):e.clientWidth>a&&e.classList.remove(s)}}),[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=s,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}),[]);s({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(9307);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(9307),s=n(1134);function c(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?c(Object(n),!0).forEach((function(t){(0,a.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(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,c=r.onShippingRateSuccess,l=r.onShippingRateFail,p=r.onShippingRateSelectSuccess,d=(0,i.useRef)(t),m=(0,i.useRef)(n),f=(0,i.useState)(null),y=(0,o.default)(f,2),g=y[0],v=y[1],b=(0,i.useState)({onShippingChanged:!1}),h=(0,o.default)(b,2),P=h[0],E=h[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=m.current,t=d.current;if(P.onShippingChanged&&!e.isSelectingRate&&!e.shippingRatesLoading){var n=P.onShippingChanged,r=!0;(0,s.hasShippingRates)(e.shippingRates)||(r=!1),n(r,{billing:t,shipping:e}),S("onShippingChanged")}}),[P,S]);return(0,i.useEffect)((function(){d.current=t,m.current=n})),(0,i.useEffect)((function(){g&&g.onShippingChanged&&(g.onShippingChanged(!0,{billing:d.current,shipping:m.current}),v(null))}),[g]),(0,i.useEffect)((function(){var e=c(_),t=p(_),n=l((function(e){e.hasInvalidAddress,e.hasError,P.onShippingChanged&&((0,P.onShippingChanged)(!1),S("onShippingChanged"))}));return function(){e(),n(),t()}}),[P,c,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)),s=n(9307),c=n(6095),u=n(1134),l=r(n(9127));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 m=(0,u.toCartAddress)();t.usePaymentRequest=function(e){var t=e.getData,n=e.onClose,r=e.stripe,o=e.billing,p=e.shippingData,f=e.eventRegistration,y=e.setPaymentMethod,g=e.exportedValues,v=e.canPay,b=(0,c.usePaymentEvents)({billing:o,shippingData:p,eventRegistration:f}).addPaymentEvent,h=(p.shippingAddress,p.needsShipping),P=p.shippingRates,E=o.billingData,O=o.cartTotalItems,S=o.currency,_=o.cartTotal,w=(0,s.useState)(null),C=(0,i.default)(w,2),k=C[0],M=C[1],j=(0,s.useRef)({}),D=(0,s.useRef)(p),x=(0,s.useRef)(o);(0,s.useEffect)((function(){D.current=p,x.current=o}),[p]),(0,s.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:h,displayItems:(0,u.getDisplayItems)(O,S)};e.requestShipping&&(e.shippingOptions=(0,u.getShippingOptions)(P)),j.current=e;var n=r.paymentRequest(j.current);n.canMakePayment().then((function(e){v(e)?M(n):M(null)}))}}),[r,_.value,E.country,P,O,S.code]),(0,s.useEffect)((function(){k&&(j.current.requestShipping&&(k.on("shippingaddresschange",A),k.on("shippingoptionchange",I)),k.on("cancel",n),k.on("paymentmethod",L))}),[k,A,n,L]);var R=(0,s.useCallback)((function(e){return function(t,n){var r=n.billing,a=n.shipping,o=r.cartTotal,i=r.cartTotalItems,s=r.currency,c=a.shippingRates;t?e.updateWith({status:"success",total:{amount:o.value,label:o.label,pending:!1},displayItems:(0,u.getDisplayItems)(i,s),shippingOptions:(0,u.getShippingOptions)(c)}):e.updateWith({status:"invalid_shipping_address"})}}),[]),A=(0,s.useCallback)((function(e){var t=e.shippingAddress,n=D.current,r=m(t);n.setShippingAddress(d(d({},n.shippingAddress),r));var a=(0,l.default)((0,u.getIntermediateAddress)(n.shippingAddress),r);b("onShippingChanged",R(e),a)}),[b]),I=(0,s.useCallback)((function(e){var t=e.shippingOption,n=D.current;n.setSelectedRates.apply(n,(0,a.default)((0,u.getSelectedShippingOption)(t.id))),b("onShippingChanged",R(e))}),[b]),L=(0,s.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,s={payerName:r,payerEmail:o,payerPhone:void 0===i?null:i};null!=t&&t.billing_details.address&&(s=m(t.billing_details.address,s)),g.billingData=s,e.shippingAddress&&(g.shippingAddress=m(e.shippingAddress)),y(t.id),e.complete("success")}),[]);return{paymentRequest:k}}},3893:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useProcessCheckoutError=void 0;var r=n(9307);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(1284)),o=r(n(8926)),i=r(n(9713)),s=r(n(3038)),c=n(9307),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,m=e.emitResponse,f=e.error,y=e.onSubmit,g=e.activePaymentMethod,v=e.paymentType,b=void 0===v?"card":v,h=e.setupIntent,P=void 0===h?null:h,E=e.removeSetupIntent,O=void 0===E?null:E,S=e.shouldSavePayment,_=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,x=m.responseTypes,R=(0,c.useState)(null),A=(0,s.default)(R,2),I=A[0],L=A[1],T=(0,u.useStripe)(),N=(0,c.useRef)(M),B=(0,c.useRef)({});(0,c.useEffect)((function(){N.current=M}),[M]);var F=(0,c.useCallback)((function(e){B.current=d(d({},B.current),e)}),[]),q=(0,c.useCallback)((function(){return d(d({},{type:b,billing_details:(0,l.getBillingDetailsFromAddress)(null!=C&&C.billingData?C.billingData:j)}),N.current())}),[j,b,M]),X=(0,c.useCallback)((function(e,n){var r,a={meta:{paymentMethodData:d((r={},(0,i.default)(r,"".concat(t("name"),"_token_key"),e),(0,i.default)(r,"".concat(t("name"),"_save_source_key"),n),r),B.current)}};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,c.useEffect)((function(){I&&"string"==typeof I&&y()}),[I,y]),(0,c.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,!f){e.next=6;break}throw new l.StripeError(f);case 6:if(!P){e.next=16;break}return e.next=9,T.confirmCardSetup(P.client_secret,{payment_method:q()});case 9:if(!(n=e.sent).error){e.next=12;break}throw new l.StripeError(n.error);case 12:r=n.setupIntent.payment_method,O(),e.next=26;break;case 16:if(!I){e.next=20;break}r=I,e.next=26;break;case 20:return e.next=22,T.createPaymentMethod(q());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)(x,X(r,_)));case 29:return e.prev=29,e.t0=e.catch(3),console.log(e.t0),L(null),e.abrupt("return",(0,l.ensureErrorResponse)(x,e.t0.error));case 34:case"end":return e.stop()}}),e,null,[[3,29]])}))));return function(){return e()}}),[I,j,p,T,P,g,_]),{setPaymentMethod:L,getCreatePaymentMethodArgs:q,addPaymentMethodData:F}}},6107:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.useSetupIntent=void 0;var a=r(n(1284)),o=r(n(8926)),i=r(n(3038)),s=n(9307),c=r(n(6989)),u=n(1134);t.useSetupIntent=function(e){var t=e.cartTotal,n=e.setError,r=(0,s.useState)((0,u.getFromCache)("setupIntent")),l=(0,i.default)(r,2),p=l[0],d=l[1];(0,s.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,c.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 m=(0,s.useCallback)((function(){(0,u.deleteFromCache)("setupIntent")}),[t.value]);return{setupIntent:p,removeSetupIntent:m}}},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(9307);t.useStripeError=function(){var e=(0,o.useState)(!1),t=(0,a.default)(e,2);return[t[0],t[1]]}},1225:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.useUpdatePaymentIntent=void 0;var a=r(n(1284)),o=r(n(8926)),i=r(n(9713)),s=n(9307),c=n(6664),u=n(1134),l=r(n(6989));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.useUpdatePaymentIntent=function(e){var t=e.clientSecret,n=e.billingData,r=e.eventRegistration,p=e.responseTypes,m=e.name,f=e.shouldSavePayment,y=e.noticeContexts,g=r.onPaymentProcessing,v=r.onCheckoutAfterProcessingWithSuccess,b=(0,s.useRef)({billingData:n}),h=(0,s.useRef)({}),P=(0,c.useStripe)(),E=(0,c.useElements)(),O=(0,s.useCallback)((function(e,t){var n;return{meta:{paymentMethodData:d((n={},(0,i.default)(n,"".concat(m,"_token_key"),e),(0,i.default)(n,"".concat(m,"_save_source_key"),t),n),h.current)}}}),[]),S=(0,s.useCallback)((function(e){h.current=d(d({},h.current),e)}),[]),_=(0,s.useCallback)((0,o.default)(a.default.mark((function e(){var t;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=b.current.billingData,e.next=3,P.updatePaymentIntent({elements:E,params:{payment_method_data:{billing_details:(0,u.getBillingDetailsFromAddress)(t)}}});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)}))),[P,E]),w=(0,s.useCallback)((0,o.default)(a.default.mark((function e(){var t;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=b.current.billingData,e.next=3,P.confirmPayment({elements:E,confirmParams:{payment_method_data:{billing_details:(0,u.getBillingDetailsFromAddress)(t)}},redirect:"if_required"});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)}))),[P,E]);return(0,s.useEffect)((function(){b.current={billingData:n}})),(0,s.useEffect)((function(){var e=g((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:return e.prev=0,n=null,e.next=4,P.retrievePaymentIntent(t);case 4:if("requires_action"!==(r=e.sent).paymentIntent.status){e.next=11;break}return n=r.paymentIntent.payment_method,e.next=9,w();case 9:e.next=17;break;case 11:return e.next=13,_();case 13:if(!(r=e.sent).error){e.next=16;break}throw new u.StripeError(r.error);case 16:n=r.paymentIntent.payment_method;case 17:return e.abrupt("return",(0,u.ensureSuccessResponse)(p,O(n,f)));case 20:return e.prev=20,e.t0=e.catch(0),e.abrupt("return",(0,u.ensureErrorResponse)(p,e.t0,{messageContext:y.PAYMENTS}));case 23:case"end":return e.stop()}}),e,null,[[0,20]])}))));return function(){return e()}}),[g,_,w,t,f]),(0,s.useEffect)((function(){var e=v(function(){var e=(0,o.default)(a.default.mark((function e(t){var n,r,o,s,c;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.redirectUrl,!(r=(0,u.isNextActionRequired)(n))){e.next=23;break}return r.client_secret,o=r.order_id,s=r.order_key,e.prev=4,e.next=7,w();case 7:if(!(c=e.sent).error){e.next=10;break}throw new u.StripeError(c.error);case 10:return e.next=12,(0,l.default)({url:(0,u.getRoute)("process/payment"),method:"POST",data:(0,i.default)({order_id:o,order_key:s},"".concat(m,"_save_source_key"),f)});case 12:if(!(c=e.sent).messages){e.next=15;break}return e.abrupt("return",(0,u.ensureErrorResponse)(p,c.messages));case 15:return e.abrupt("return",(0,u.ensureSuccessResponse)(p,{redirectUrl:c.redirect}));case 18:return e.prev=18,e.t0=e.catch(4),e.abrupt("return",(0,u.ensureErrorResponse)(p,e.t0,{messageContext:y.PAYMENTS}));case 21:e.next=24;break;case 23:return e.abrupt("return",(0,u.ensureSuccessResponse)(p));case 24:case"end":return e.stop()}}),e,null,[[4,18]])})));return function(t){return e.apply(this,arguments)}}());return function(){return e()}}),[v,w,f]),{updatePaymentIntent:_,addPaymentMethodData:S}}},318:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=n(9874);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]}}))}))},9874:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.useLink=void 0;var a=r(n(1284)),o=r(n(9713)),i=r(n(8926)),s=r(n(3038)),c=r(n(6479)),u=n(9307),l=n(6664),p=n(1134);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 m(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 f=(0,p.toCartAddress)();t.useLink=function(e){var t=e.email,n=e.eventRegistration,r=e.onClick,o=e.onSubmit,d=e.isActive,y=e.responseTypes,g=((0,c.default)(e,["email","eventRegistration","onClick","onSubmit","isActive","responseTypes"]),(0,u.useState)()),v=(0,s.default)(g,2),b=v[0],h=v[1],P=(0,l.useStripe)(),E=(0,l.useElements)(),O=(0,u.useRef)(),S=(0,u.useRef)(),_=n.onPaymentProcessing;return(0,u.useEffect)((function(){O.current={onClick:r,onSubmit:o}})),(0,u.useEffect)((function(){P&&E&&h(null==P?void 0:P.linkAutofillModal(E))}),[P,E]),(0,u.useEffect)((function(){b&&b.launch({email:t})}),[b,t]),(0,u.useEffect)((function(){b&&(b.on("autofill",(function(e){S.current=e,O.current.onSubmit()})),b.on("authenticated",(function(e){O.current.onClick()})))}),[b]),(0,u.useEffect)((function(){if(d){var e=_((0,i.default)(a.default.mark((function e(){var t,n,r,o,i,s,c;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={meta:{}},n=S.current.value,r=n.shippingAddress,o=void 0===r?null:r,i=n.billingAddress,(s=void 0===i?null:i)&&(t.meta.billingData=f(m(m({},s.address),{},{recipient:s.name}))),o&&(t.meta.shippingData=f(m(m({},o.address),{},{recipient:o.name}))),e.prev=4,e.next=7,P.updatePaymentIntent({elements:E,params:{payment_method_data:{billing_details:(0,p.getBillingDetailsFromAddress)(t.meta.billingData)}}});case 7:c=e.sent,t.meta.paymentMethodData={stripe_cc_token_key:c.paymentIntent.payment_method,stripe_cc_save_source_key:!1},e.next=14;break;case 11:e.prev=11,e.t0=e.catch(4),console.log(e.t0);case 14:return e.abrupt("return",(0,p.ensureSuccessResponse)(y,t));case 15:case"end":return e.stop()}}),e,null,[[4,11]])}))));return function(){return e()}}}),[d,_,P,E]),b}},3474:(e,t,n)=>{var r=n(9307),a=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.LinkComponent=void 0;var o=a(n(6479)),i=(n(9307),n(6664)),s=n(4613),c=n(318),u=n(1134),l=(0,u.getSettings)("stripe_link_checkout_data"),p=function(e){var t,n,a=e.cartData,s=(0,o.default)(e,["cartData"]),c=null==a||null===(t=a.extensions)||void 0===t||null===(n=t.stripe_link_checkout)||void 0===n?void 0:n.clientSecret;return c?r.createElement(i.Elements,{stripe:u.initStripe,options:{clientSecret:c}},r.createElement(d,s)):null};t.LinkComponent=p;var d=function(e){var t=e.billing,n=(e.shipping,e.eventRegistration),a=e.onClick,s=e.onSubmit,u=e.activePaymentMethod,p=e.emitResponse,d=((0,o.default)(e,["billing","shipping","eventRegistration","onClick","onSubmit","activePaymentMethod","emitResponse"]),t.billingData),m=(t.currency,p.responseTypes),f=(p.noticeContexts,d.email),y=u===l("name");return(0,c.useLink)({email:f,eventRegistration:n,onClick:a,onSubmit:s,isActive:y,responseTypes:m}),r.createElement("div",{style:{display:"none"}},r.createElement(i.PaymentElement,null))};(0,s.registerExpressPaymentMethod)({name:l("name"),canMakePayment:function(e){return!0},content:r.createElement(p,null),edit:r.createElement(p,null),supports:{showSavedCards:l("showSavedCards"),showSaveOption:l("showSaveOption"),features:l("features")}})},6480:(e,t,n)=>{var r=n(9307),a=n(5318),o=a(n(6479)),i=a(n(9713)),s=a(n(3038)),c=n(9307),u=n(4613),l=n(1134),p=n(3539),d=n(3187),m=n(6664),f=n(5736),y=n(3554),g=n(8817);function v(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 b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){(0,i.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var h,P=(0,l.getSettings)("stripe_afterpay_data"),E=function(e){var t=e.total,n=e.currency,r=e.needsShipping,a=!1,o=P("requiredParams"),i=P("accountCountry"),s=!!o.hasOwnProperty(n)&&o[n];return s&&(a=i===(null==s?void 0:s[0])&&r&&t>(null==s?void 0:s[1])&&t<(null==s?void 0:s[2])),a},O=function(e){var t=e.getData,n=(0,c.useState)({amount:t("cartTotal"),currency:t("currency"),isEligible:t("msgOptions").isEligible}),a=(0,s.default)(n,2),o=a[0],i=a[1];return h=i,r.createElement(m.Elements,{stripe:l.initStripe,options:t("elementOptions")},r.createElement("div",{className:"wc-stripe-blocks-afterpay__label"},r.createElement(m.AfterpayClearpayMessageElement,{options:b(b({},t("msgOptions")),{amount:o.amount,currency:o.currency,isEligible:o.isEligible})})))},S=function(e){var t=e.content,n=e.billing,a=e.shippingData,i=(0,o.default)(e,["content","billing","shippingData"]),s=t,u=n.cartTotal,l=n.currency,p=a.needsShipping;return(0,c.useEffect)((function(){h({amount:u.value,currency:l.code,isEligible:p})}),[u.value,l.code,p]),r.createElement(r.Fragment,null,p&&r.createElement("div",{className:"wc-stripe-blocks-payment-method-content"},r.createElement("div",{className:"wc-stripe-blocks-afterpay-offsite__container"},r.createElement("div",{className:"wc-stripe-blocks-afterpay__offsite"},r.createElement("img",{src:P("offSiteSrc")}),r.createElement("p",null,(0,f.sprintf)((0,f.__)('After clicking "%s", you will be redirected to Afterpay to complete your purchase securely.',"woo-stripe-payment"),P("placeOrderButtonLabel"))))),r.createElement(s,b(b({},i),{},{billing:n,shippingData:a}))))},_=function(e){var t=e.cart,n=(e.extensions,e.context,t.cartTotals),a=t.cartNeedsShipping,o=(n.total_price,n.currency_code),i=parseInt(n.total_price),s=parseInt(n.total_price)/Math.pow(10,n.currency_minor_unit);return E({total:s,currency:o,needsShipping:a})?r.createElement(y.TotalsWrapper,null,r.createElement(m.Elements,{stripe:l.initStripe,options:P("elementOptions")},r.createElement("div",{className:"wc-stripe-blocks-afterpay-totals__item wc-block-components-totals-item"},r.createElement(m.AfterpayClearpayMessageElement,{options:b(b({},P("msgOptions")),{amount:i,currency:o,isEligible:a})})))):null};P()&&((0,u.registerPaymentMethod)({name:P("name"),label:r.createElement(O,{getData:P}),ariaLabel:(0,f.__)("Afterpay","woo-stripe-payment"),placeOrderButtonLabel:P("placeOrderButtonLabel"),canMakePayment:(0,p.canMakePayment)(P,(function(e){var t=e.settings,n=e.cartTotals,r=e.cartNeedsShipping,a=n.currency_code,o=n.currency_minor_unit,i=n.total_price;h&&h({amount:parseInt(n.total_price),currency:a,isEligible:r});var s=parseInt(i)/Math.pow(10,o),c=E({total:s,currency:a,needsShipping:r});return!c&&!t("hideIneligible")||c})),content:r.createElement(S,{content:p.LocalPaymentIntentContent,getData:P,confirmationMethod:"confirmAfterpayClearpayPayment"}),edit:r.createElement(d.PaymentMethod,{content:p.LocalPaymentIntentContent,getData:P}),supports:{showSavedCards:!1,showSaveOption:!1,features:P("features")}}),(0,g.registerPlugin)("wc-stripe",{render:function(){return r.createElement(y.ExperimentalOrderMeta,null,r.createElement(_,null))},scope:"woocommerce-checkout"}))},39:(e,t,n)=>{var r=n(9307),a=n(4613),o=n(1134),i=n(3539),s=n(2029),c=n(3187),u=(0,o.getSettings)("stripe_alipay_data");u()&&(0,a.registerPaymentMethod)({name:u("name"),label:r.createElement(s.PaymentMethodLabel,{title:u("title"),paymentMethod:u("name"),icons:u("icon")}),ariaLabel:"Alipay",placeOrderButtonLabel:u("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(u),content:r.createElement(c.PaymentMethod,{content:i.LocalPaymentIntentContent,confirmationMethod:"confirmAlipayPayment",getData:u}),edit:r.createElement(c.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:u}),supports:{showSavedCards:!1,showSaveOption:!1,features:u("features")}})},8641:(e,t,n)=>{var r=n(9307),a=n(4613),o=n(1134),i=n(3539),s=n(3187),c=(0,o.getSettings)("stripe_bancontact_data");c()&&(0,a.registerPaymentMethod)({name:c("name"),label:r.createElement(s.PaymentMethodLabel,{title:c("title"),paymentMethod:c("name"),icons:c("icon")}),ariaLabel:"Bancontact",placeOrderButtonLabel:c("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(c),content:r.createElement(s.PaymentMethod,{content:i.LocalPaymentIntentContent,confirmationMethod:"confirmBancontactPayment",getData:c}),edit:r.createElement(s.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:c}),supports:{showSavedCards:!1,showSaveOption:!1,features:c("features")}})},5176:(e,t,n)=>{var r=n(9307),a=n(4613),o=n(1134),i=n(3539),s=n(3187),c=n(6664),u=(0,o.getSettings)("stripe_becs_data"),l=function(e){return r.createElement(r.Fragment,null,r.createElement(s.PaymentMethod,e),r.createElement("div",{className:"wc-stripe-blocks-mandate becs-mandate",dangerouslySetInnerHTML:{__html:e.getData("mandate")}}))};u()&&(0,a.registerPaymentMethod)({name:u("name"),label:r.createElement(s.PaymentMethodLabel,{title:u("title"),paymentMethod:u("name"),icons:u("icon")}),ariaLabel:"BECS",placeOrderButtonLabel:u("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(u),content:r.createElement(l,{content:i.LocalPaymentIntentContent,getData:u,confirmationMethod:"confirmAuBecsDebitPayment",component:c.AuBankAccountElement}),edit:r.createElement(s.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:u}),supports:{showSavedCards:!1,showSaveOption:!1,features:u("features")}})},4990:(e,t,n)=>{var r=n(9307),a=n(5318),o=a(n(7154)),i=a(n(9713)),s=a(n(3038)),c=a(n(6479)),u=n(9307),l=n(5736),p=n(4613),d=a(n(4184)),m=n(1134),f=n(3539),y=n(3187);function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){(0,i.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var b=(0,m.getSettings)("stripe_boleto_data");b()&&(0,p.registerPaymentMethod)({name:b("name"),label:r.createElement(y.PaymentMethodLabel,{title:b("title"),paymentMethod:b("name"),icons:b("icon")}),ariaLabel:"Boleto",placeOrderButtonLabel:b("placeOrderButtonLabel"),canMakePayment:(0,f.canMakePayment)(b),content:r.createElement(y.PaymentMethod,{content:function(e){var t=e.eventRegistration,n=(0,c.default)(e,["eventRegistration"]),a=(0,u.useState)(""),i=(0,s.default)(a,2),p=i[0],y=i[1],g=(0,u.useState)(!1),b=(0,s.default)(g,2),h=b[0],P=b[1],E=t.onPaymentProcessing,O=(0,u.useCallback)((function(){return{boleto:{tax_id:p}}}),[p]);return(0,u.useEffect)((function(){var e=E((function(){return!!p||(0,m.ensureErrorResponse)(n.emitResponse.responseTypes,(0,l.__)("Please enter a valid CPF/CNPJ value","woo-stripe-payment"))}));return function(){return e()}}),[E,p]),r.createElement(r.Fragment,null,r.createElement("div",{className:(0,d.default)("wc-block-components-text-input",{"is-active":h||p})},r.createElement("input",{type:"text",id:"wc-stripe-boleto-tax_id",onChange:function(e){return y(e.target.value)},onFocus:function(){return P(!0)},onBlur:function(){return P(!1)}}),r.createElement("label",{htmlFor:"wc-stripe-boleto-tax_id"},(0,l.__)(" CPF / CNPJ"," woo-stripe-payment"))),(0,m.isTestMode)()&&r.createElement("div",{className:"wc-stripe-boleto__description"},r.createElement("p",null,(0,l.__)("Test mode values","woo-stripe-payment")),r.createElement("div",null,r.createElement("label",null,"CPF:")," ",r.createElement("span",null,"000.000.000-00")),r.createElement("div",null,r.createElement("label",null,"CNPJ:")," ",r.createElement("span",null,"00.000.000/0000-00"))),!(0,m.isTestMode)()&&r.createElement("div",{className:"wc-stripe-boleto__description"},r.createElement("p",null,(0,l.__)("Accepted formats","woo-stripe-payment")),r.createElement("div",null,r.createElement("label",null,"CPF:")," ",r.createElement("span",null,(0,l.__)("XXX.XXX.XXX-XX or XXXXXXXXXXX","woo-stripe-payment"))),r.createElement("div",null,r.createElement("label",null,"CNPJ:")," ",r.createElement("span",null,(0,l.__)("XX.XXX.XXX/XXXX-XX or XXXXXXXXXXXXXX","woo-stripe-payment")))),r.createElement(f.LocalPaymentIntentContent,(0,o.default)({callback:O},v(v({},n),{eventRegistration:t}))))},getData:b,confirmationMethod:"confirmBoletoPayment"}),edit:r.createElement(y.PaymentMethod,{content:f.LocalPaymentIntentContent,getData:b}),supports:{showSavedCards:!1,showSaveOption:!1,features:b("features")}})},4494:(e,t,n)=>{var r=n(9307),a=n(4613),o=n(1134),i=n(3539),s=n(3187),c=n(6664),u=(0,o.getSettings)("stripe_eps_data");u()&&(0,a.registerPaymentMethod)({name:u("name"),label:r.createElement(s.PaymentMethodLabel,{title:u("title"),paymentMethod:u("name"),icons:u("icon")}),ariaLabel:"EPS",placeOrderButtonLabel:u("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(u),content:r.createElement(s.PaymentMethod,{content:i.LocalPaymentIntentContent,confirmationMethod:"confirmEpsPayment",component:c.EpsBankElement,getData:u}),edit:r.createElement(s.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:u}),supports:{showSavedCards:!1,showSaveOption:!1,features:u("features")}})},4031:(e,t,n)=>{var r=n(9307),a=n(4613),o=n(1134),i=n(3539),s=n(3187),c=n(6664),u=(0,o.getSettings)("stripe_fpx_data");u()&&(0,a.registerPaymentMethod)({name:u("name"),label:r.createElement(s.PaymentMethodLabel,{title:u("title"),paymentMethod:u("name"),icons:u("icon")}),ariaLabel:"FPX",placeOrderButtonLabel:u("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(u),content:r.createElement(s.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:u,confirmationMethod:"confirmIdealPayment",component:c.FpxBankElement}),edit:r.createElement(s.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:u}),supports:{showSavedCards:!1,showSaveOption:!1,features:u("features")}})},3817:(e,t,n)=>{var r=n(9307),a=n(4613),o=n(1134),i=n(3539),s=n(3187),c=(0,o.getSettings)("stripe_giropay_data");c()&&(0,a.registerPaymentMethod)({name:c("name"),label:r.createElement(s.PaymentMethodLabel,{title:c("title"),paymentMethod:c("name"),icons:c("icon")}),ariaLabel:"Giropay",placeOrderButtonLabel:c("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(c),content:r.createElement(s.PaymentMethod,{content:i.LocalPaymentIntentContent,confirmationMethod:"confirmGiropayPayment",getData:c}),edit:r.createElement(s.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:c}),supports:{showSavedCards:!1,showSaveOption:!1,features:c("features")}})},3140:(e,t,n)=>{var r=n(9307),a=n(4613),o=n(1134),i=n(3539),s=n(3187),c=(0,o.getSettings)("stripe_grabpay_data");c()&&(0,a.registerPaymentMethod)({name:c("name"),label:r.createElement(s.PaymentMethodLabel,{title:c("title"),paymentMethod:c("name"),icons:c("icon")}),ariaLabel:"GrabPay",placeOrderButtonLabel:c("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(c),content:r.createElement(s.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:c,confirmationMethod:"confirmGrabPayPayment"}),edit:r.createElement(s.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:c}),supports:{showSavedCards:!1,showSaveOption:!1,features:c("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(1284)),o=r(n(9713)),i=r(n(6479)),s=r(n(8926)),c=n(9307),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,m=e.confirmationMethod,f=e.getPaymentMethodArgs,y=void 0===f?function(){return{}}:f,g=(0,u.useStripe)(),v=r.onCheckoutAfterProcessingWithSuccess,b=r.onCheckoutAfterProcessingWithError,h=(0,c.useRef)(n),P=(0,c.useRef)(y);(0,c.useEffect)((function(){h.current=n}),[n]),(0,c.useEffect)((function(){P.current=y}),[y]),(0,c.useEffect)((function(){var e=v(function(){var e=(0,s.default)(a.default.mark((function e(n){var r,s,c,u,f,y,v;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.redirectUrl,t("name")!==p){e.next=18;break}if(e.prev=2,!(s=r.match(/#response=(.+)/))){e.next=12;break}return c=JSON.parse(window.atob(decodeURIComponent(s[1]))),u=c.client_secret,f=c.return_url,y=(0,i.default)(c,["client_secret","return_url"]),e.next=8,g[m](u,{payment_method:d({billing_details:(0,l.getBillingDetailsFromAddress)(h.current)},P.current(h.current)),return_url:f});case 8:if(!(v=e.sent).error){e.next=11;break}throw new l.StripeError(v.error);case 11:window.location=decodeURI(y.order_received_url);case 12:e.next=18;break;case 14:return e.prev=14,e.t0=e.catch(2),console.log(e.t0),e.abrupt("return",(0,l.ensureErrorResponse)(o,e.t0.error));case 18:case"end":return e.stop()}}),e,null,[[2,14]])})));return function(t){return e.apply(this,arguments)}}());return function(){return e()}}),[g,v,b])}},878:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.useCreateSource=void 0;var a=r(n(1284)),o=r(n(8926)),i=r(n(9713)),s=r(n(3038)),c=n(9307),u=n(1134),l=n(6664),p=n(5736);t.useCreateSource=function(e){var t=e.getData,n=e.billing,r=e.shippingAddress,d=e.onPaymentProcessing,m=e.responseTypes,f=e.getSourceArgs,y=void 0!==f&&f,g=e.element,v=void 0!==g&&g,b=(0,c.useState)(!1),h=(0,s.default)(b,2),P=h[0],E=h[1],O=(0,c.useState)(!1),S=(0,s.default)(O,2),_=S[0],w=S[1],C=(0,c.useRef)({billing:n,shippingAddress:r}),k=(0,l.useStripe)(),M=(0,l.useElements)();(0,c.useEffect)((function(){C.current={billing:n,shippingAddress:r}}));var j=(0,c.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,c.useCallback)((function(e){return{meta:{paymentMethodData:(0,i.default)({},"".concat(t("name"),"_token_key"),e)}}}),[]);return(0,c.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)(m,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)(m,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)(m,e.t0.error||e.t0));case 24:case"end":return e.stop()}}),e,null,[[2,20]])}))));return function(){return e()}}),[P,d,k,m,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(9307),i=n(1134),s=n(5736);t.useValidateCheckout=function(e){var t=e.subscriber,n=e.responseTypes,r=e.component,c=void 0===r?null:r,u=e.msg,l=void 0===u?(0,s.__)("Please enter your payment info before proceeding.","woo-stripe-payment"):u,p=(0,o.useState)(!1),d=(0,a.default)(p,2),m=d[0],f=d[1];return(0,o.useEffect)((function(){var e=t((function(){return!(c&&!m)||(0,i.ensureErrorResponse)(n,l)}));return function(){return e()}}),[t,m,f,n,c]),{isValid:m,setIsValid:f}}},9474:(e,t,n)=>{var r=n(9307),a=n(4613),o=n(1134),i=n(3539),s=n(3187),c=n(6664),u=(0,o.getSettings)("stripe_ideal_data");u()&&(0,a.registerPaymentMethod)({name:u("name"),label:r.createElement(s.PaymentMethodLabel,{title:u("title"),paymentMethod:u("name"),icons:u("icon")}),ariaLabel:"Ideal",placeOrderButtonLabel:u("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(u),content:r.createElement(s.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:u,confirmationMethod:"confirmIdealPayment",component:c.IdealBankElement}),edit:r.createElement(s.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:u}),supports:{showSavedCards:!1,showSaveOption:!1,features:u("features")}})},9738:(e,t,n)=>{n(5142),n(9474),n(3868),n(8641),n(3817),n(4494),n(4784),n(1192),n(7894),n(3766),n(4031),n(5176),n(3140),n(39),n(6480),n(4990),n(5748)},5142:(e,t,n)=>{var r=n(9307),a=n(4613),o=n(1134),i=n(3539),s=n(3187),c=n(5736),u=(0,o.getSettings)("stripe_klarna_data");u()&&(0,a.registerPaymentMethod)({name:u("name"),label:r.createElement(s.PaymentMethodLabel,{title:u("title"),paymentMethod:u("name"),icons:u("icon")}),ariaLabel:"Klarna",placeOrderButtonLabel:u("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(u,(function(e){var t=e.settings,n=e.billingData,r=e.cartTotals,a=n.country,o=r.currency_code,i=t("requiredParams");return[o]in i&&i[o].includes(a)})),content:r.createElement(s.PaymentMethod,{content:function(e){return r.createElement(r.Fragment,null,(0,o.isTestMode)()&&r.createElement("div",{className:"wc-stripe-klarna__testmode"},r.createElement("label",null,(0,c.__)("Test mode sms","woo-stripe-payment"),":")," ",r.createElement("span",null,"123456")),r.createElement(i.LocalPaymentIntentContent,e))},getData:u,confirmationMethod:"confirmKlarnaPayment"}),edit:r.createElement(s.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:u}),supports:{showSavedCards:!1,showSaveOption:!1,features:u("features")}})},3539:(e,t,n)=>{var r=n(9307),a=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.LocalPaymentSourceContent=t.LocalPaymentIntentContent=t.canMakePayment=void 0;var o=a(n(7154)),i=a(n(9713)),s=a(n(6479)),c=n(9307),u=n(6664),l=n(1134),p=n(8522),d=n(3636);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 f(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,i.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.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,s.default)(n,["billingData","cartTotals"]),i=a.currency_code,c=r.country,u=e("countries"),p=e("allowedCountries"),d=e("features"),m=!1;if(e("isAdmin"))m=!0;else{if((0,l.cartContainsSubscription)()&&!d.includes("subscriptions"))return!1;if((0,l.cartContainsPreOrder)()&&!d.includes("pre-orders"))return!1;e("currencies").includes(i)&&(m="all_except"===p?!e("exceptCountries").includes(c):"specific"===p?e("specificCountries").includes(c):!(u.length>0)||u.includes(c)),t&&m&&(m=t(f({settings:e,billingData:r,cartTotals:a},o)))}return m}},t.LocalPaymentIntentContent=function(e){var t=e.getData,n=(0,s.default)(e,["getData"]);return r.createElement(u.Elements,{stripe:l.initStripe,options:t("elementOptions")},r.createElement(g,f(f({},n),{},{getData:t})))},t.LocalPaymentSourceContent=function(e){return r.createElement(u.Elements,{stripe:l.initStripe},r.createElement(y,e))};var y=function(e){var t=e.getData,n=e.billing,a=e.shippingData,o=e.emitResponse,i=e.eventRegistration,s=e.getSourceArgs,c=void 0!==s&&s,u=e.element,l=void 0!==u&&u,d=a.shippingAddress,m=i.onPaymentProcessing,f=(i.onCheckoutAfterProcessingWithError,o.responseTypes),y=(o.noticeContexts,(0,p.useCreateSource)({getData:t,billing:n,shippingAddress:d,onPaymentProcessing:m,responseTypes:f,getSourceArgs:c,element:l}).setIsValid);return l?r.createElement(v,{name:t("name"),options:t("paymentElementOptions"),onChange:function(e){y(e.complete)},element:l}):null},g=function(e){var t=e.getData,n=e.billing,a=e.emitResponse,o=e.eventRegistration,s=e.activePaymentMethod,l=e.confirmationMethod,m=void 0===l?null:l,f=e.component,y=void 0===f?null:f,g=e.callback,b=void 0===g?null:g,h=(0,u.useElements)(),P=n.billingData,E=o.onPaymentProcessing,O=o.onCheckoutAfterProcessingWithError,S=a.responseTypes,_=a.noticeContexts,w=(0,c.useCallback)((function(e){return y?(0,i.default)({},t("paymentType"),h.getElement(y)):b?b(e):{}}),[h,b]),C=(0,p.useValidateCheckout)({subscriber:E,responseTypes:S,component:y}).setIsValid;return(0,p.useAfterProcessLocalPayment)({getData:t,billingData:P,eventRegistration:o,responseTypes:S,activePaymentMethod:s,confirmationMethod:m,getPaymentMethodArgs:w}),(0,d.useProcessCheckoutError)({responseTypes:S,subscriber:O,messageContext:_.PAYMENT}),y?r.createElement(v,{name:t("name"),options:t("paymentElementOptions"),onChange:function(e){return C(!e.empty)},element:y,callback:b}):null},v=function(e){var t=e.name,n=e.onChange,a=e.element,i=e.options,c=(0,s.default)(e,["name","onChange","element","options"]),u=a;return r.createElement("div",{className:"wc-stripe-local-payment-container ".concat(t," ").concat(u.displayName)},r.createElement(u,(0,o.default)({options:i,onChange:n},c)))}},4784:(e,t,n)=>{var r=n(9307),a=n(4613),o=n(1134),i=n(3539),s=n(3187),c=(0,o.getSettings)("stripe_multibanco_data");c()&&(0,a.registerPaymentMethod)({name:c("name"),label:r.createElement(s.PaymentMethodLabel,{title:c("title"),paymentMethod:c("name"),icons:c("icon")}),ariaLabel:"MultiBanco",placeOrderButtonLabel:c("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(c),content:r.createElement(s.PaymentMethod,{content:i.LocalPaymentSourceContent,getData:c}),edit:r.createElement(s.PaymentMethod,{content:i.LocalPaymentSourceContent,getData:c}),supports:{showSavedCards:!1,showSaveOption:!1,features:c("features")}})},5748:(e,t,n)=>{var r=n(9307),a=n(4613),o=n(1134),i=n(3539),s=n(3187),c=(n(6664),(0,o.getSettings)("stripe_oxxo_data"));c()&&(0,a.registerPaymentMethod)({name:c("name"),label:r.createElement(s.PaymentMethodLabel,{title:c("title"),paymentMethod:c("name"),icons:c("icon")}),ariaLabel:"OXXO",placeOrderButtonLabel:c("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(c),content:r.createElement(s.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:c,confirmationMethod:"confirmOxxoPayment"}),edit:r.createElement(s.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:c}),supports:{showSavedCards:!1,showSaveOption:!1,features:c("features")}})},3868:(e,t,n)=>{var r=n(9307),a=n(4613),o=n(1134),i=n(3539),s=n(3187),c=n(6664),u=(0,o.getSettings)("stripe_p24_data");u()&&(0,a.registerPaymentMethod)({name:u("name"),label:r.createElement(s.PaymentMethodLabel,{title:u("title"),paymentMethod:u("name"),icons:u("icon")}),ariaLabel:"P24",placeOrderButtonLabel:u("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(u),content:r.createElement(s.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:u,confirmationMethod:"confirmP24Payment",component:c.P24BankElement}),edit:r.createElement(s.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:u}),supports:{showSavedCards:!1,showSaveOption:!1,features:u("features")}})},1192:(e,t,n)=>{var r,a=n(9307),o=n(4613),i=n(1134),s=n(3187),c=n(3539),u=n(6664),l=(0,i.getSettings)("stripe_sepa_data"),p=(r=s.PaymentMethod,function(e){return a.createElement(a.Fragment,null,a.createElement(r,e),a.createElement("div",{className:"wc-stripe-blocks-mandate sepa-mandate",dangerouslySetInnerHTML:{__html:e.getData("mandate")}}))});l()&&(0,o.registerPaymentMethod)({name:l("name"),label:a.createElement(s.PaymentMethodLabel,{title:l("title"),paymentMethod:l("name"),icons:l("icon")}),ariaLabel:"SEPA",placeOrderButtonLabel:l("placeOrderButtonLabel"),canMakePayment:(0,c.canMakePayment)(l),content:a.createElement(p,{content:c.LocalPaymentIntentContent,getData:l,confirmationMethod:"confirmSepaDebitPayment",component:u.IbanElement}),edit:a.createElement(s.PaymentMethod,{content:c.LocalPaymentIntentContent,getData:l}),supports:{showSavedCards:!1,showSaveOption:!1,features:l("features")}})},7894:(e,t,n)=>{var r=n(9307),a=n(4613),o=n(1134),i=n(3539),s=n(3187),c=(0,o.getSettings)("stripe_sofort_data");c()&&(0,a.registerPaymentMethod)({name:c("name"),label:r.createElement(s.PaymentMethodLabel,{title:c("title"),paymentMethod:c("name"),icons:c("icon")}),ariaLabel:"Sofort",placeOrderButtonLabel:c("placeOrderButtonLabel"),canMakePayment:(0,i.canMakePayment)(c),content:r.createElement(s.PaymentMethod,{content:i.LocalPaymentIntentContent,confirmationMethod:"confirmSofortPayment",getData:c,callback:function(e){return{sofort:{country:e.country}}}}),edit:r.createElement(s.PaymentMethod,{content:i.LocalPaymentIntentContent,getData:c}),supports:{showSavedCards:!1,showSaveOption:!1,features:c("features")}})},3766:(e,t,n)=>{var r=n(9307),a=n(5318),o=a(n(1284)),i=a(n(8926)),s=a(n(9713)),c=a(n(3038)),u=n(9307),l=n(4613),p=n(1134),d=n(3187),m=n(3539),f=n(6664),y=n(8522),g=n(5736),v=n(3636),b=(0,p.getSettings)("stripe_wechat_data"),h=function(e){return r.createElement(f.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,s=parseInt(t("qrSize")),c=a.responseTypes,l=o.onPaymentProcessing,d=o.onCheckoutAfterProcessingWithSuccess,m=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")}),v=(f.isValid,f.setIsValid),b=O({getData:t,billing:n,responseTypes:c,subscriber:l}),h=b.source,P=b.error,S=b.deleteSourceFromStorage;return(0,u.useEffect)((function(){var e=d((function(){return S(),(0,p.ensureSuccessResponse)(c)}));return function(){return e()}}),[h,d,S]),(0,u.useEffect)((function(){h&&v(!0)}),[h]),h?r.createElement(E,{text:h.wechat.qr_code_url,width:s,height:s}):P?r.createElement("div",{className:"wechat-validation-error"},r.createElement(m,{errorMessage:(0,p.getErrorMessage)(P)})):(0,p.isAddressValid)(n.billingData)?null:(0,g.__)("Please fill out all the required fields in order to complete the WeChat payment.","woo-stripe-payment")},E=function(e){var t=e.text,n=e.width,a=void 0===n?128:n,o=e.height,i=void 0===o?128:o,s=e.colorDark,c=void 0===s?"#424770":s,l=e.colorLight,d=void 0===l?"#f8fbfd":l,m=e.correctLevel,f=void 0===m?QRCode.CorrectLevel.H:m,y=(0,u.useRef)();return(0,u.useEffect)((function(){new QRCode(y.current,{text:t,width:a,height:i,colorDark:c,colorLight:d,correctLevel:f})}),[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,f.useStripe)(),d=(0,v.useStripeError)(),m=(0,c.default)(d,2),y=m[0],g=m[1],b=(0,u.useState)((0,p.getFromCache)("wechat:source")),h=(0,c.default)(b,2),P=h[0],E=h[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,s.default)({},"".concat(t("name"),"_token_key"),P.id)}})}));return function(){return e()}}),[P,a]);var C=(0,u.useCallback)((0,i.default)(o.default.mark((function e(){var n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,y||!(0,p.isAddressValid)(_)){e.next=9;break}return e.next=4,l.createSource((0,p.getDefaultSourceArgs)({type:t("paymentType"),amount:S.value,billingData:_,currency:w.code,returnUrl:t("returnUrl")}));case 4:if(!(n=e.sent).error){e.next=7;break}throw new p.StripeError(n.error);case 7:E(n.source),(0,p.storeInCache)("wechat:source",n.source);case 9:e.next=15;break;case 11:e.prev=11,e.t0=e.catch(0),console.log("error: ",e.t0),g(e.t0.error);case 15:case"end":return e.stop()}}),e,null,[[0,11]])}))),[l,P,S.value,_,w,y]),k=(0,u.useCallback)((function(){(0,p.deleteFromCache)("wechat:source")}),[]);return(0,u.useEffect)((function(){l&&!P&&(clearTimeout(O.current),O.current=setTimeout(C,1e3))}),[l,P,C]),{source:P,setSource:E,error:y,deleteSourceFromStorage:k}};b()&&(0,l.registerPaymentMethod)({name:b("name"),label:r.createElement(d.PaymentMethodLabel,{title:b("title"),paymentMethod:b("name"),icons:b("icon")}),ariaLabel:"WeChat",canMakePayment:(0,m.canMakePayment)(b),content:r.createElement(d.PaymentMethod,{content:h,getData:b}),edit:r.createElement(d.PaymentMethod,{content:h,getData:b}),supports:{showSavedCards:!1,showSaveOption:!1,features:b("features")}})},5180:(e,t,n)=>{n(3139),n(3726)},3726:(e,t,n)=>{var r=n(9307),a=n(5318),o=a(n(3038)),i=a(n(6479)),s=n(9307),c=n(4613),u=n(1134),l=n(3636),p=n(6664),d=(0,u.getSettings)("stripe_payment_request_data"),m=function(e){return r.createElement("div",{className:"wc-stripe-payment-request-container"},r.createElement(p.Elements,{stripe:u.initStripe},r.createElement(f,e)))},f=function(e){var t=e.getData,n=e.onClick,a=e.onClose,c=e.billing,u=e.shippingData,d=e.eventRegistration,m=e.emitResponse,f=e.onSubmit,y=e.activePaymentMethod,g=((0,i.default)(e,["getData","onClick","onClose","billing","shippingData","eventRegistration","emitResponse","onSubmit","activePaymentMethod"]),d.onPaymentProcessing),v=m.responseTypes,b=m.noticeContexts,h=(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:c,shippingData:u,onPaymentProcessing:g,emitResponse:m,error:E,onSubmit:f,activePaymentMethod:y,exportedValues:O}).setPaymentMethod;(0,l.useAfterProcessingPayment)({getData:t,eventRegistration:d,responseTypes:v,activePaymentMethod:y,messageContext:b.EXPRESS_PAYMENTS});var _=(0,l.usePaymentRequest)({getData:t,onClose:a,stripe:h,billing:c,shippingData:u,eventRegistration:d,setPaymentMethod:S,exportedValues:O,canPay:function(e){return null!=e&&!e.applePay}}).paymentRequest,w=(0,s.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,s.useRef)();return(0,s.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,c.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(m,{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(1284)),o=r(n(8926)),i=n(9307),s=n(1134);t.default=function(e){var t=e.eventRegistration,n=e.emitResponse,r=e.getData,c=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,s.initStripe;case 3:return o=e.sent,e.next=6,(0,s.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)}}(),[c]);return(0,i.useEffect)((function(){var e=c(l);return function(){return e()}}),[c]),null}},1134:(e,t,n)=>{var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.isNextActionRequired=t.isCheckoutPage=t.isCartPage=t.versionCompare=t.deleteFromCache=t.getFromCache=t.storeInCache=t.isTestMode=t.getDefaultSourceArgs=t.cartContainsSubscription=t.cartContainsPreOrder=t.getLocalPaymentMethods=t.registerLocalPaymentMethod=t.canMakePayment=t.getDisplayItems=t.getShippingOptionId=t.getShippingOptions=t.formatPrice=t.filterEmptyValues=t.getIntermediateAddress=t.toCartAddress=t.handleCardAction=t.isUserLoggedIn=t.hasShippingRates=t.getSelectedShippingOption=t.isFieldRequired=t.getLocaleFields=t.isAddressValid=t.removeNumberPrecision=t.isEmpty=t.StripeError=t.getSettings=t.getBillingDetailsFromAddress=t.getErrorMessage=t.ensureErrorResponse=t.ensureSuccessResponse=t.getRoute=t.getCreditCardForm=t.registerCreditCardForm=t.initStripe=void 0;var a=r(n(319)),o=r(n(1284)),i=r(n(8926)),s=r(n(3038)),c=r(n(8)),u=r(n(4575)),l=r(n(2205)),p=r(n(8585)),d=r(n(9754)),m=r(n(5957)),f=r(n(9713)),y=r(n(6479)),g=n(4465),v=n(4617),b=r(n(6989)),h=n(4293);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,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(s)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,f.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=_.stripeParams,k=(0,v.getSetting)("stripeErrorMessages"),M=(0,v.getSetting)("countryLocale",{}),j=/^([\w]+)\:(.+)$/,D=(0,v.getSetting)("stripeGeneralData").routes,x={},R=[],A={recipient:function(e,t){return e.first_name=t.split(" ").slice(0,-1).join(" "),e.last_name=t.split(" ").pop(),e},payerName:function(e,t){return e.first_name=t.split(" ").slice(0,-1).join(" "),e.last_name=t.split(" ").pop(),e},country:"country",addressLine:function(e,t){return t[0]&&(e.address_1=t[0]),t[1]&&(e.address_2=t[1]),e},line1:"address_1",line2:"address_2",city:"city",region:"state",state:"state",postalCode:"postcode",postal_code:"postcode",payerEmail:"email",payerPhone:"phone"},I=new Promise((function(e,t){(0,g.loadStripe)(w,C).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"]);x[t]=n},t.getCreditCardForm=function(e){return x.hasOwnProperty(e)?x[e]:{}};var L=function(e){return null!=D&&D[e]?D[e]:console.log("".concat(e," is not a valid route"))};t.getRoute=L;var T=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return S({type:e.SUCCESS},t)};t.ensureSuccessResponse=T;var N=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return S({type:e.ERROR,message:B(t)},n)};t.ensureErrorResponse=N;var B=function(e){return"string"==typeof e?e:null!=e&&e.code&&null!=k&&k[e.code]?k[e.code]:null!=e&&e.statusCode?null!=k&&k[e.statusCode]?k[e.statusCode]:e.statusMessage:e.message};t.getErrorMessage=B;var F=function(e){var t={name:"".concat(e.first_name," ").concat(e.last_name),address:{city:e.city||null,country:e.country||null,line1:e.address_1||null,line2:e.address_2||null,postal_code:e.postcode||null,state:e.state||null}};return null!=e&&e.phone&&(t.phone=e.phone),null!=e&&e.email&&(t.email=e.email),t};t.getBillingDetailsFromAddress=F,t.getSettings=function(e){return function(t){return t?(0,v.getSetting)(e)[t]:(0,v.getSetting)(e)}};var q=function(e){(0,l.default)(a,e);var t,n,r=(t=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=(0,d.default)(t);if(n){var a=(0,d.default)(this).constructor;e=Reflect.construct(r,arguments,a)}else e=r.apply(this,arguments);return(0,p.default)(this,e)});function a(e){var t;return(0,u.default)(this,a),(t=r.call(this,e.message)).error=e,t}return a}((0,m.default)(Error));t.StripeError=q;var X=function(e){return"string"==typeof e?0==e.length||""==e:Array.isArray(e)?0==array.length:"object"!==(0,c.default)(e)||0==Object.keys(e).length};t.isEmpty=X,t.removeNumberPrecision=function(e,t){return e/Math.pow(10,t)},t.isAddressValid=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=U(e.country),r=0,a=Object.entries(e);r<a.length;r++){var o=(0,s.default)(a[r],2),i=o[0],c=o[1];if(!t.includes(i)&&null!=n&&n[i]&&n[i].required&&X(c))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,s.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 V=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,b.default)({url:D["sync/intent"],method:"POST",data:{order_id:t,client_secret:n}});case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.log(e.t0);case 8:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(t,n){return e.apply(this,arguments)}}(),W=function(){var e=(0,i.default)(o.default.mark((function e(t){var n,r,a,i,s,c,u,l,p,d,m,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,s=t.savePaymentMethod,c=void 0!==s&&s,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,m=l.order_key,e.next=7,a.handleCardAction(p);case 7:if(!(y=e.sent).error){e.next=11;break}return V(d,p),e.abrupt("return",N(r,y.error));case 11:return g=(0,f.default)({order_id:d,order_key:m},"".concat(i("name"),"_save_source_key"),c),e.next=14,(0,b.default)({url:L("process/payment"),method:"POST",data:g});case 14:if(!(v=e.sent).messages){e.next=17;break}return e.abrupt("return",N(r,v.messages));case 17:return e.abrupt("return",T(r,{redirectUrl:v.redirect}));case 20:return e.abrupt("return",T(r));case 21:e.next=27;break;case 23:return e.prev=23,e.t0=e.catch(1),console.log(e.t0),e.abrupt("return",N(r,e.t0));case 27:case"end":return e.stop()}}),e,null,[[1,23]])})));return function(t){return e.apply(this,arguments)}}();t.handleCardAction=W,t.toCartAddress=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:A;return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={};t=S(S({},t),Y(n));for(var a=0,o=Object.entries(e);a<o.length;a++){var i,c=(0,s.default)(o[a],2),u=c[0],l=c[1];null!==(i=t)&&void 0!==i&&i[u]&&("function"==typeof l?l(r,t[u]):r[l]=t[u])}return r}},t.getIntermediateAddress=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["city","postcode","state","country"],r={},a=P(n);try{for(a.s();!(t=a.n()).done;){var o=t.value;r[o]=e[o]}}catch(e){a.e(e)}finally{a.f()}return r};var Y=function(e){return Object.keys(e).filter((function(t){return Boolean(e[t])})).reduce((function(t,n){return S(S({},t),{},(0,f.default)({},n,e[n]))}),{})};t.filterEmptyValues=Y;var H=function(e,t){var n,r=(0,h.getCurrency)(t),a=r.prefix,o=r.suffix,i=r.decimalSeparator,s=r.minorUnit,c=r.thousandSeparator;if(""==e||void 0===e)return e;e="string"==typeof e?parseInt(e,10):e;var u="",l=(e=(e/=Math.pow(10,s)).toString().replace(".",i)).indexOf(i);l<0?s>0&&(e+="".concat(i).concat(new Array(s+1).join("0"))):(u=e.substr(l+1)).length<s&&(e+=new Array(s-u.length+1).join("0"));var p=e.match(new RegExp("(\\d+)\\".concat(i,"(\\d+)")));return p&&(e=p[1],u=p[2]),e=e.replace(new RegExp("\\B(?=(\\d{3})+(?!\\d))","g"),"".concat(c)),a+(e=(null===(n=u)||void 0===n?void 0:n.length)>0?e+i+u:e)+o};t.formatPrice=H,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,H(e.price,e.currency_code),{id:G(n,e.rate_id),label:t.value,amount:parseInt(e.price,10)}}));t=[].concat((0,a.default)(t),(0,a.default)(r))})),t};var G=function(e,t){return"".concat(e,":").concat(t)};t.getShippingOptionId=G,t.getDisplayItems=function(e,t){t.minorUnit;var n=[],r=["total_tax","total_shipping"];return e.forEach((function(e){(0<e.value||e.key&&r.includes(e.key))&&n.push({label:e.label,pending:!1,amount:e.value})})),n};var J={};t.canMakePayment=function(e,t){var n=e.country,r=e.currency,a=e.total;return new Promise((function(e,o){var i=[n,r,a.amount].reduce((function(e,t){return"".concat(e,"-").concat(t)}));return r?i in J?e(J[i]):I.then((function(s){if(s.error)return o(s.error);s.paymentRequest({country:n,currency:r,total:a}).canMakePayment().then((function(n){return J[i]=t(n),e(J[i])}))})).catch(o):e(!1)}))},t.registerLocalPaymentMethod=function(e){R.push(e)},t.getLocalPaymentMethods=function(){return R},t.cartContainsPreOrder=function(){var e=(0,v.getSetting)("stripePaymentData");return e&&e.pre_order},t.cartContainsSubscription=function(){var e=(0,v.getSetting)("stripePaymentData");return e&&e.subscription},t.getDefaultSourceArgs=function(e){var t=e.type,n=e.amount,r=e.billingData,a=e.currency,o=e.returnUrl;return{type:t,amount:n,currency:a,owner:F(r),redirect:{return_url:o}}},t.isTestMode=function(){return"test"===(0,v.getSetting)("stripeGeneralData").mode};var z=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(z(e),JSON.stringify({value:t,exp:n}))},t.getFromCache=function(e){if("sessionStorage"in window)try{var t=JSON.parse(sessionStorage.getItem(z(e)));if(t){var n=t.value,r=t.exp;if(!(Math.floor((new Date).getTime()/1e3)>r))return n;Q(z(e))}}catch(e){}return null};var Q=function(e){"sessionStorage"in window&&sessionStorage.removeItem(z(e))};t.deleteFromCache=Q,t.versionCompare=function(e,t,n){switch(n){case"<":return e<t;case">":return e>t;case"<=":return e<=t;case">=":return e>=t;case"=":return e==t}return!1},t.isCartPage=function(){return"cart"===(0,v.getSetting)("stripeGeneralData").page},t.isCheckoutPage=function(){return"checkout"===(0,v.getSetting)("stripeGeneralData").page},t.isNextActionRequired=function(e){var t=e.match(/#response=(.+)/),n=null;return t&&(n=JSON.parse(window.atob(decodeURIComponent(t[1])))),n}},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 s in n)r.call(n,s)&&n[s]&&e.push(s)}}return e.join(" ")}e.exports?(a.default=a,e.exports=a):void 0===(n=function(){return a}.apply(t,[]))||(e.exports=n)}()},1465:()=>{},7776:()=>{},4836:()=>{},85:()=>{},3110:()=>{},8356:()=>{},5773:()=>{},9509:()=>{},3139:()=>{}}]);
3
  //# sourceMappingURL=commons.js.map
packages/blocks/build/commons.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/arrayLikeToArray.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/arrayWithHoles.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/assertThisInitialized.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/asyncToGenerator.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/classCallCheck.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/construct.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/createClass.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/defineProperty.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/extends.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/getPrototypeOf.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/inherits.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/interopRequireDefault.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/isNativeFunction.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/iterableToArray.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/nonIterableRest.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/nonIterableSpread.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/objectWithoutProperties.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/setPrototypeOf.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/slicedToArray.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/toConsumableArray.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/typeof.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js","webpack://wc_stripe.[name]/./node_modules/@babel/runtime/helpers/wrapNativeSuper.js","webpack://wc_stripe.[name]/./node_modules/@stripe/react-stripe-js/dist/react-stripe.umd.js","webpack://wc_stripe.[name]/./node_modules/@stripe/stripe-js/dist/stripe.esm.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/components/checkout/checkbox/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/components/checkout/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/components/checkout/installments/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/components/checkout/payment-method-label/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/components/checkout/payment-method/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/components/checkout/radio-option/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/ach/hooks/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/ach/hooks/use-create-link-token.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/ach/hooks/use-initialize-plaid.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/ach/hooks/use-process-payment.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/ach/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/ach/payment-method.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/applepay/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/applepay/payment-method.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/credit-card/components/bootstrap/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/credit-card/components/custom-card-form.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/credit-card/components/simple/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/credit-card/components/stripe-card-form.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/credit-card/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/credit-card/payment-method.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/error-boundary.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/googlepay/button.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/googlepay/constants.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/googlepay/hooks/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/googlepay/hooks/use-error-message.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/googlepay/hooks/use-payment-request.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/googlepay/hooks/use-payments-client.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/googlepay/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/googlepay/payment-method.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/googlepay/util.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/hooks/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/hooks/use-after-process-payment.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/hooks/use-breakpoint-width.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/hooks/use-exported-values.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/hooks/use-payment-events.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/hooks/use-payment-request.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/hooks/use-process-checkout-error.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/hooks/use-process-payment-intent.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/hooks/use-setup-intent.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/hooks/use-stripe-error.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/afterpay.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/alipay.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/bancontact.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/becs.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/boleto.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/eps.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/fpx.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/giropay.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/grabpay.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/hooks/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/hooks/use-after-process-local-payment.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/hooks/use-create-source.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/hooks/use-validate-checkout.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/ideal.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/klarna.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/local-payment-method.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/multibanco.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/oxxo.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/p24.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/sepa.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/sofort.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/local-payment/wechat.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/payment-request/index.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/payment-request/payment-method.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/saved-card-component.js","webpack://wc_stripe.[name]/./packages/blocks/assets/js/payment-methods/util.js","webpack://wc_stripe.[name]/./node_modules/classnames/index.js"],"names":["module","exports","arr","len","length","i","arr2","Array","isArray","arrayLikeToArray","self","ReferenceError","asyncGeneratorStep","gen","resolve","reject","_next","_throw","key","arg","info","value","error","done","Promise","then","fn","this","args","arguments","apply","err","undefined","instance","Constructor","TypeError","setPrototypeOf","isNativeReflectConstruct","_construct","Parent","Class","Reflect","construct","a","push","Function","bind","prototype","_defineProperties","target","props","descriptor","enumerable","configurable","writable","Object","defineProperty","protoProps","staticProps","obj","_extends","assign","source","hasOwnProperty","call","_getPrototypeOf","o","getPrototypeOf","__proto__","subClass","superClass","create","constructor","__esModule","toString","indexOf","sham","Proxy","Date","e","iter","Symbol","iterator","from","_arr","_n","_d","_e","_s","_i","next","objectWithoutPropertiesLoose","excluded","getOwnPropertySymbols","sourceSymbolKeys","propertyIsEnumerable","sourceKeys","keys","_typeof","assertThisInitialized","_setPrototypeOf","p","arrayWithHoles","iterableToArrayLimit","unsupportedIterableToArray","nonIterableRest","arrayWithoutHoles","iterableToArray","nonIterableSpread","minLen","n","slice","name","test","isNativeFunction","_wrapNativeSuper","_cache","Map","has","get","set","Wrapper","React","_objectWithoutProperties","_objectWithoutPropertiesLoose","_slicedToArray","_arrayWithHoles","_iterableToArrayLimit","_arrayLikeToArray","_unsupportedIterableToArray","_nonIterableRest","emptyFunction","emptyFunctionWithReset","resetWarningCache","propTypes","shim","propName","componentName","location","propFullName","secret","Error","getShim","isRequired","ReactPropTypes","array","bool","func","number","object","string","symbol","any","arrayOf","element","elementType","instanceOf","node","objectOf","oneOf","oneOfType","shape","exact","checkPropTypes","PropTypes","factoryWithThrowingShims","isUnknownObject","raw","PLAIN_OBJECT_STR","isEqual","left","right","leftArray","leftPlainObject","leftKeys","rightKeys","keySet","allKeys","l","r","every","usePrevious","ref","useRef","useEffect","current","validateStripe","maybeStripe","elements","createToken","createPaymentMethod","confirmCardPayment","parseStripeProp","isPromise","tag","stripePromise","stripe","ElementsContext","createContext","displayName","Elements","_ref","rawStripeProp","options","children","_final","isMounted","parsed","useMemo","_React$useState2","useState","ctx","setContext","prevStripe","prevOptions","console","warn","anyStripe","_registerWrapper","version","createElement","Provider","useElementsContextWithUseCase","useCaseMessage","useCase","concat","parseElementsContext","useContext","ElementsConsumer","_ref2","useCallbackReference","cb","extractUpdateableOptions","paymentRequest","noop","createElementComponent","type","isServer","str","charAt","toUpperCase","Element","id","className","_ref$options","_ref$onBlur","onBlur","_ref$onFocus","onFocus","_ref$onReady","onReady","_ref$onChange","onChange","_ref$onEscape","onEscape","_ref$onClick","onClick","elementRef","domNode","callOnReady","callOnBlur","callOnFocus","callOnClick","callOnChange","callOnEscape","useLayoutEffect","mount","on","updateableOptions","update","destroy","__elementType","window","AuBankAccountElement","CardElement","CardNumberElement","CardExpiryElement","CardCvcElement","FpxBankElement","IbanElement","IdealBankElement","P24BankElement","EpsBankElement","PaymentRequestButtonElement","AfterpayClearpayMessageElement","useElements","useStripe","factory","V3_URL","V3_URL_REGEX","EXISTING_SCRIPT_MESSAGE","initStripe","startTime","registerWrapper","stripePromise$1","params","Stripe","script","scripts","document","querySelectorAll","src","findScript","queryString","advancedFraudSignals","headOrBody","head","body","appendChild","injectScript","addEventListener","loadCalled","loadStripe","_len","_key","now","label","checked","aria-hidden","xmlns","viewBox","d","Installments","paymentMethodName","getCreatePaymentMethodArgs","cardFormComplete","addPaymentMethodData","installments","setInstallments","installment","setInstallment","loading","setLoading","result","StripeError","url","getRoute","method","data","payment_method_id","paymentMethod","payment_method","__","Loader","InstallmentOptions","_stripe_installment_plan","isLoading","OPTIONS","disabled","map","dangerouslySetInnerHTML","__html","text","title","icons","components","Label","PaymentMethodLabel","Icons","PaymentMethodIcons","align","getData","content","Content","desc","el","childNodes","classList","add","Description","RadioControlOption","event","setValidationError","linkToken","setLinkToken","useCallback","response","token","storeInCache","getFromCache","linkHandler","resolvePopup","openLinkPopup","open","Plaid","clientName","env","product","selectAccount","countryCodes","onSuccess","publicToken","metaData","onExit","getErrorMessage","error_message","onPaymentProcessing","responseTypes","unsubscribe","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","preventDefault","show","style","ApplePayEdit","registerExpressPaymentMethod","currency","total_price","country","toLowerCase","total","amount","parseInt","Bootstrap","CardIcon","htmlFor","registerCreditCardForm","breakpoint","component","classes","focus","empty","invalid","eventChange","onComplete","cardType","setCardType","elementOrder","container","setContainer","getCreditCardForm","CardForm","postalCodeEnabled","elementStatus","forEach","setElementOrder","includes","useBreakpointWidth","getCardIconSrc","cloneElement","brand","complete","idx","nextElement","getElement","status","filter","sprintf","SimpleForm","data-tid","card","isFormComplete","cardOptions","postalCode","billingData","postcode","hidePostalCode","isFieldRequired","iconStyle","displaySaveCard","customerId","isUserLoggedIn","cartContainsSubscription","cartContainsPreOrder","CreditCardContent","setError","catch","CreditCardElement","savePaymentMethod","setSavePaymentMethod","formComplete","setFormComplete","getPaymentMethodArgs","elType","useSetupIntent","cartTotal","setupIntent","removeSetupIntent","Tag","CustomCardForm","StripeCardForm","SavePaymentMethod","state","hasError","errorInfo","setState","componentStack","Component","publishableKey","setErrorMessage","checkoutStatus","merchantInfo","merchantId","merchantName","buttonContainer","buttonType","usePaymentsClient","button","removeButton","append","parameters","allowedAuthMethods","allowedCardNetworks","assuranceDetailsRequired","apiVersion","apiVersionMinor","shippingRates","processingCountry","totalPriceLabel","emailRequired","isEmpty","email","allowedPaymentMethods","tokenizationSpecification","gateway","BASE_PAYMENT_METHOD","shippingAddressRequired","needsShipping","transactionInfo","getTransactionInfo","callbackIntents","BASE_PAYMENT_REQUEST","billingAddressRequired","billingAddressParameters","format","phoneNumberRequired","phone","shippingOptionRequired","shippingOptionParameters","getShippingOptionParameters","shippingOptions","cartTotalItems","environment","paymentsClient","setPaymentsClient","setButton","currentBilling","currentShipping","addPaymentEvent","usePaymentEvents","setAddressData","paymentData","billingAddress","isAddressValid","phoneNumber","toCartAddress","shippingAddress","parentElement","firstChild","removeChild","loadPaymentData","parse","tokenizationData","billing_details","getBillingDetailsFromAddress","statusCode","log","createButton","paymentOptions","paymentDataCallbacks","onPaymentAuthorized","transactionState","onPaymentDataChanged","shipping","address","shippingOptionData","intermediateAddress","selectedRates","getSelectedShippingOption","addressEqual","getIntermediateAddress","shippingEqual","success","getPaymentRequestUpdate","reason","message","intent","setShippingAddress","setSelectedRates","google","payments","api","PaymentsClient","isReadyToPayRequest","isReadyToPay","GooglePayContent","useErrorMessage","GooglePayEdit","isCartPage","getSetting","countryCode","currencyCode","code","totalPriceStatus","totalPrice","removeNumberPrecision","minorUnit","displayItems","getDisplayItems","newTransactionInfo","newShippingOptionParameters","unit","items","item","price","getShippingOptions","defaultSelectedOptionId","option","shift","shippingPackage","shipping_rates","rate","selected","getShippingOptionId","rate_id","rates","txt","innerHTML","formatPrice","description","first_name","split","join","last_name","pop","address1","address2","locality","administrativeArea","onCheckoutAfterProcessingWithSuccess","unsubscribeAfterProcessingWithSuccess","redirectUrl","handleCardAction","innerWidth","windowWidth","setWindowWith","getMaxWidth","maxWidth","setMaxWidth","clientWidth","remove","handleResize","removeEventListener","getElementById","parentNode","onShippingRateSuccess","onShippingRateFail","onShippingRateSelectSuccess","handler","setHandler","onShippingChanged","paymentEvents","setPaymentEvent","execute","removePaymentEvent","isSelectingRate","shippingRatesLoading","hasShippingRates","unsubscribeShippingRateSuccess","unsubscribeShippingRateSelectSuccess","unsubscribeShippingRateFail","hasInvalidAddress","setPaymentRequest","paymentRequestOptions","pending","requestPayerName","requestPayerEmail","requestPayerPhone","requestShipping","onShippingAddressChange","onShippingOptionChange","onPaymentMethodReceived","updatePaymentEvent","updateWith","shippingOption","paymentResponse","payerName","payerEmail","payerPhone","processingResponse","paymentDetails","stripeErrorMessage","ERROR","paymentType","currentPaymentMethodArgs","getSuccessResponse","paymentMethodId","unsubscribeProcessingPayment","confirmCardSetup","client_secret","setSetupIntent","createSetupIntent","variablesHandler","isAvailable","available","requiredParams","accountCountry","requiredParamObj","isEligible","variables","setVariables","AfterpayPaymentMethod","OrderItemMessaging","cart","extensions","context","cartNeedsShipping","currency_minor_unit","TotalsWrapper","settings","LocalPaymentIntentContent","confirmationMethod","registerPlugin","render","ExperimentalOrderMeta","scope","BecsPaymentMethod","taxId","setTaxId","isActive","setIsActive","callback","boleto","tax_id","currentBillingData","match","atob","decodeURIComponent","return_url","order","decodeURI","order_received_url","getSourceArgs","setSource","isValid","setIsValid","currentValues","getSourceArgsInternal","getDefaultSourceArgs","returnUrl","getSuccessData","sourceId","createSource","msg","countries","LocalPaymentIntentMethod","LocalPaymentSourceMethod","useCreateSource","LocalPaymentElementContainer","useValidateCheckout","useAfterProcessLocalPayment","PAYMENT","LocalPaymentSourceContent","SepaPaymentMethod","sofort","WeChatComponent","WeChatPaymentMethod","size","deleteSourceFromStorage","QRCodeComponent","wechat","qr_code_url","height","colorDark","colorLight","correctLevel","QRCode","CorrectLevel","H","createSourceTimeoutId","clearTimeout","setTimeout","PaymentRequestContent","PaymentRequestButton","paymentRequestButton","PaymentRequestEdit","canvas","scale","devicePixelRatio","getContext","beginPath","arc","Math","PI","fillStyle","fill","handleSuccessResult","unsubscribeOnCheckoutAfterProcessingWithSuccess","account","messages","countryLocale","SHIPPING_OPTION_REGEX","routes","creditCardForms","localPaymentMethods","PAYMENT_REQUEST_ADDRESS_MAPPINGS","recipient","addressLine","address_1","address_2","line1","line2","city","region","postal_code","stripeAccount","route","SUCCESS","statusMessage","exclude","fields","getLocaleFields","entries","required","localeFields","default","reduce","locale","field","packageIdx","Boolean","syncPaymentIntentWithOrder","order_id","order_key","redirect","address_mappings","cartAddress","filterEmptyValues","cartKey","values","getCurrency","prefix","suffix","decimalSeparator","thousandSeparator","fractional","index","replace","substr","RegExp","sort","packageId","rateId","cartItems","pre_order","subscription","owner","mode","getCacheKey","exp","floor","getTime","sessionStorage","setItem","getItem","removeItem","ver1","ver2","compare","page","hasOwn","classNames","argType","inner"],"mappings":";8FAUAA,EAAOC,QAVP,SAA2BC,EAAKC,IACnB,MAAPA,GAAeA,EAAMD,EAAIE,UAAQD,EAAMD,EAAIE,QAE/C,IAAK,IAAIC,EAAI,EAAGC,EAAO,IAAIC,MAAMJ,GAAME,EAAIF,EAAKE,IAC9CC,EAAKD,GAAKH,EAAIG,GAGhB,OAAOC,I,SCHTN,EAAO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Um5B,QAKhB,KAFwB,EAAF,WACtB,OAAOA,GACP,QAFoB,OAEpB,aAxCH,I","file":"commons.js","sourcesContent":["function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}\n\nmodule.exports = _arrayLikeToArray;","function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nmodule.exports = _arrayWithHoles;","var arrayLikeToArray = require(\"./arrayLikeToArray\");\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return arrayLikeToArray(arr);\n}\n\nmodule.exports = _arrayWithoutHoles;","function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nmodule.exports = _assertThisInitialized;","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nfunction _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}\n\nmodule.exports = _asyncToGenerator;","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck;","var setPrototypeOf = require(\"./setPrototypeOf\");\n\nvar isNativeReflectConstruct = require(\"./isNativeReflectConstruct\");\n\nfunction _construct(Parent, args, Class) {\n if (isNativeReflectConstruct()) {\n module.exports = _construct = Reflect.construct;\n } else {\n module.exports = _construct = function _construct(Parent, args, Class) {\n var a = [null];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n }\n\n return _construct.apply(null, arguments);\n}\n\nmodule.exports = _construct;","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nmodule.exports = _createClass;","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty;","function _extends() {\n module.exports = _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nmodule.exports = _extends;","function _getPrototypeOf(o) {\n module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nmodule.exports = _getPrototypeOf;","var setPrototypeOf = require(\"./setPrototypeOf\");\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}\n\nmodule.exports = _inherits;","function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\n\nmodule.exports = _interopRequireDefault;","function _isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n}\n\nmodule.exports = _isNativeFunction;","function _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nmodule.exports = _isNativeReflectConstruct;","function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter);\n}\n\nmodule.exports = _iterableToArray;","function _iterableToArrayLimit(arr, i) {\n if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nmodule.exports = _iterableToArrayLimit;","function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nmodule.exports = _nonIterableRest;","function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nmodule.exports = _nonIterableSpread;","var objectWithoutPropertiesLoose = require(\"./objectWithoutPropertiesLoose\");\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nmodule.exports = _objectWithoutProperties;","function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nmodule.exports = _objectWithoutPropertiesLoose;","var _typeof = require(\"@babel/runtime/helpers/typeof\");\n\nvar assertThisInitialized = require(\"./assertThisInitialized\");\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return assertThisInitialized(self);\n}\n\nmodule.exports = _possibleConstructorReturn;","function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nmodule.exports = _setPrototypeOf;","var arrayWithHoles = require(\"./arrayWithHoles\");\n\nvar iterableToArrayLimit = require(\"./iterableToArrayLimit\");\n\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray\");\n\nvar nonIterableRest = require(\"./nonIterableRest\");\n\nfunction _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}\n\nmodule.exports = _slicedToArray;","var arrayWithoutHoles = require(\"./arrayWithoutHoles\");\n\nvar iterableToArray = require(\"./iterableToArray\");\n\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray\");\n\nvar nonIterableSpread = require(\"./nonIterableSpread\");\n\nfunction _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}\n\nmodule.exports = _toConsumableArray;","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;","var arrayLikeToArray = require(\"./arrayLikeToArray\");\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}\n\nmodule.exports = _unsupportedIterableToArray;","var getPrototypeOf = require(\"./getPrototypeOf\");\n\nvar setPrototypeOf = require(\"./setPrototypeOf\");\n\nvar isNativeFunction = require(\"./isNativeFunction\");\n\nvar construct = require(\"./construct\");\n\nfunction _wrapNativeSuper(Class) {\n var _cache = typeof Map === \"function\" ? new Map() : undefined;\n\n module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !isNativeFunction(Class)) return Class;\n\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n\n _cache.set(Class, Wrapper);\n }\n\n function Wrapper() {\n return construct(Class, arguments, getPrototypeOf(this).constructor);\n }\n\n Wrapper.prototype = Object.create(Class.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n return setPrototypeOf(Wrapper, Class);\n };\n\n return _wrapNativeSuper(Class);\n}\n\nmodule.exports = _wrapNativeSuper;","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :\n typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) :\n (global = global || self, factory(global.ReactStripe = {}, global.React));\n}(this, (function (exports, React) { 'use strict';\n\n React = React && Object.prototype.hasOwnProperty.call(React, 'default') ? React['default'] : React;\n\n function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n }\n\n function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n }\n\n function _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n }\n\n function _slicedToArray(arr, i) {\n return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();\n }\n\n function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n }\n\n function _iterableToArrayLimit(arr, i) {\n if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n }\n\n function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n }\n\n function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n }\n\n function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }\n\n function createCommonjsModule(fn, module) {\n \treturn module = { exports: {} }, fn(module, module.exports), module.exports;\n }\n\n /**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n var ReactPropTypesSecret_1 = ReactPropTypesSecret;\n\n function emptyFunction() {}\n\n function emptyFunctionWithReset() {}\n\n emptyFunctionWithReset.resetWarningCache = emptyFunction;\n\n var factoryWithThrowingShims = function () {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret_1) {\n // It is still safe when called from React.\n return;\n }\n\n var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types');\n err.name = 'Invariant Violation';\n throw err;\n }\n shim.isRequired = shim;\n\n function getShim() {\n return shim;\n }\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n\n var ReactPropTypes = {\n array: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n ReactPropTypes.PropTypes = ReactPropTypes;\n return ReactPropTypes;\n };\n\n var propTypes = createCommonjsModule(function (module) {\n /**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = factoryWithThrowingShims();\n }\n });\n\n var isUnknownObject = function isUnknownObject(raw) {\n return raw !== null && _typeof(raw) === 'object';\n };\n var isPromise = function isPromise(raw) {\n return isUnknownObject(raw) && typeof raw.then === 'function';\n }; // We are using types to enforce the `stripe` prop in this lib,\n // but in an untyped integration `stripe` could be anything, so we need\n // to do some sanity validation to prevent type errors.\n\n var isStripe = function isStripe(raw) {\n return isUnknownObject(raw) && typeof raw.elements === 'function' && typeof raw.createToken === 'function' && typeof raw.createPaymentMethod === 'function' && typeof raw.confirmCardPayment === 'function';\n };\n\n var PLAIN_OBJECT_STR = '[object Object]';\n var isEqual = function isEqual(left, right) {\n if (!isUnknownObject(left) || !isUnknownObject(right)) {\n return left === right;\n }\n\n var leftArray = Array.isArray(left);\n var rightArray = Array.isArray(right);\n if (leftArray !== rightArray) return false;\n var leftPlainObject = Object.prototype.toString.call(left) === PLAIN_OBJECT_STR;\n var rightPlainObject = Object.prototype.toString.call(right) === PLAIN_OBJECT_STR;\n if (leftPlainObject !== rightPlainObject) return false;\n if (!leftPlainObject && !leftArray) return false;\n var leftKeys = Object.keys(left);\n var rightKeys = Object.keys(right);\n if (leftKeys.length !== rightKeys.length) return false;\n var keySet = {};\n\n for (var i = 0; i < leftKeys.length; i += 1) {\n keySet[leftKeys[i]] = true;\n }\n\n for (var _i = 0; _i < rightKeys.length; _i += 1) {\n keySet[rightKeys[_i]] = true;\n }\n\n var allKeys = Object.keys(keySet);\n\n if (allKeys.length !== leftKeys.length) {\n return false;\n }\n\n var l = left;\n var r = right;\n\n var pred = function pred(key) {\n return isEqual(l[key], r[key]);\n };\n\n return allKeys.every(pred);\n };\n\n var usePrevious = function usePrevious(value) {\n var ref = React.useRef(value);\n React.useEffect(function () {\n ref.current = value;\n }, [value]);\n return ref.current;\n };\n\n var INVALID_STRIPE_ERROR = 'Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.'; // We are using types to enforce the `stripe` prop in this lib, but in a real\n // integration `stripe` could be anything, so we need to do some sanity\n // validation to prevent type errors.\n\n var validateStripe = function validateStripe(maybeStripe) {\n if (maybeStripe === null || isStripe(maybeStripe)) {\n return maybeStripe;\n }\n\n throw new Error(INVALID_STRIPE_ERROR);\n };\n\n var parseStripeProp = function parseStripeProp(raw) {\n if (isPromise(raw)) {\n return {\n tag: 'async',\n stripePromise: Promise.resolve(raw).then(validateStripe)\n };\n }\n\n var stripe = validateStripe(raw);\n\n if (stripe === null) {\n return {\n tag: 'empty'\n };\n }\n\n return {\n tag: 'sync',\n stripe: stripe\n };\n };\n\n var ElementsContext = /*#__PURE__*/React.createContext(null);\n ElementsContext.displayName = 'ElementsContext';\n var parseElementsContext = function parseElementsContext(ctx, useCase) {\n if (!ctx) {\n throw new Error(\"Could not find Elements context; You need to wrap the part of your app that \".concat(useCase, \" in an <Elements> provider.\"));\n }\n\n return ctx;\n };\n /**\n * The `Elements` provider allows you to use [Element components](https://stripe.com/docs/stripe-js/react#element-components) and access the [Stripe object](https://stripe.com/docs/js/initializing) in any nested component.\n * Render an `Elements` provider at the root of your React app so that it is available everywhere you need it.\n *\n * To use the `Elements` provider, call `loadStripe` from `@stripe/stripe-js` with your publishable key.\n * The `loadStripe` function will asynchronously load the Stripe.js script and initialize a `Stripe` object.\n * Pass the returned `Promise` to `Elements`.\n *\n * @docs https://stripe.com/docs/stripe-js/react#elements-provider\n */\n\n var Elements = function Elements(_ref) {\n var rawStripeProp = _ref.stripe,\n options = _ref.options,\n children = _ref.children;\n\n var _final = React.useRef(false);\n\n var isMounted = React.useRef(true);\n var parsed = React.useMemo(function () {\n return parseStripeProp(rawStripeProp);\n }, [rawStripeProp]);\n\n var _React$useState = React.useState(function () {\n return {\n stripe: null,\n elements: null\n };\n }),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n ctx = _React$useState2[0],\n setContext = _React$useState2[1];\n\n var prevStripe = usePrevious(rawStripeProp);\n var prevOptions = usePrevious(options);\n\n if (prevStripe !== null) {\n if (prevStripe !== rawStripeProp) {\n console.warn('Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.');\n }\n\n if (!isEqual(options, prevOptions)) {\n console.warn('Unsupported prop change on Elements: You cannot change the `options` prop after setting the `stripe` prop.');\n }\n }\n\n if (!_final.current) {\n if (parsed.tag === 'sync') {\n _final.current = true;\n setContext({\n stripe: parsed.stripe,\n elements: parsed.stripe.elements(options)\n });\n }\n\n if (parsed.tag === 'async') {\n _final.current = true;\n parsed.stripePromise.then(function (stripe) {\n if (stripe && isMounted.current) {\n // Only update Elements context if the component is still mounted\n // and stripe is not null. We allow stripe to be null to make\n // handling SSR easier.\n setContext({\n stripe: stripe,\n elements: stripe.elements(options)\n });\n }\n });\n }\n }\n\n React.useEffect(function () {\n return function () {\n isMounted.current = false;\n };\n }, []);\n React.useEffect(function () {\n var anyStripe = ctx.stripe;\n\n if (!anyStripe || !anyStripe._registerWrapper) {\n return;\n }\n\n anyStripe._registerWrapper({\n name: 'react-stripe-js',\n version: \"1.4.0\"\n });\n }, [ctx.stripe]);\n return /*#__PURE__*/React.createElement(ElementsContext.Provider, {\n value: ctx\n }, children);\n };\n Elements.propTypes = {\n stripe: propTypes.any,\n options: propTypes.object\n };\n var useElementsContextWithUseCase = function useElementsContextWithUseCase(useCaseMessage) {\n var ctx = React.useContext(ElementsContext);\n return parseElementsContext(ctx, useCaseMessage);\n };\n /**\n * @docs https://stripe.com/docs/stripe-js/react#useelements-hook\n */\n\n var useElements = function useElements() {\n var _useElementsContextWi = useElementsContextWithUseCase('calls useElements()'),\n elements = _useElementsContextWi.elements;\n\n return elements;\n };\n /**\n * @docs https://stripe.com/docs/stripe-js/react#usestripe-hook\n */\n\n var useStripe = function useStripe() {\n var _useElementsContextWi2 = useElementsContextWithUseCase('calls useStripe()'),\n stripe = _useElementsContextWi2.stripe;\n\n return stripe;\n };\n /**\n * @docs https://stripe.com/docs/stripe-js/react#elements-consumer\n */\n\n var ElementsConsumer = function ElementsConsumer(_ref2) {\n var children = _ref2.children;\n var ctx = useElementsContextWithUseCase('mounts <ElementsConsumer>'); // Assert to satisfy the busted React.FC return type (it should be ReactNode)\n\n return children(ctx);\n };\n ElementsConsumer.propTypes = {\n children: propTypes.func.isRequired\n };\n\n var useCallbackReference = function useCallbackReference(cb) {\n var ref = React.useRef(cb);\n React.useEffect(function () {\n ref.current = cb;\n }, [cb]);\n return function () {\n if (ref.current) {\n ref.current.apply(ref, arguments);\n }\n };\n };\n\n var extractUpdateableOptions = function extractUpdateableOptions(options) {\n if (!isUnknownObject(options)) {\n return {};\n }\n\n var _ = options.paymentRequest,\n rest = _objectWithoutProperties(options, [\"paymentRequest\"]);\n\n return rest;\n };\n\n var noop = function noop() {};\n\n var capitalized = function capitalized(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n };\n\n var createElementComponent = function createElementComponent(type, isServer) {\n var displayName = \"\".concat(capitalized(type), \"Element\");\n\n var ClientElement = function ClientElement(_ref) {\n var id = _ref.id,\n className = _ref.className,\n _ref$options = _ref.options,\n options = _ref$options === void 0 ? {} : _ref$options,\n _ref$onBlur = _ref.onBlur,\n onBlur = _ref$onBlur === void 0 ? noop : _ref$onBlur,\n _ref$onFocus = _ref.onFocus,\n onFocus = _ref$onFocus === void 0 ? noop : _ref$onFocus,\n _ref$onReady = _ref.onReady,\n onReady = _ref$onReady === void 0 ? noop : _ref$onReady,\n _ref$onChange = _ref.onChange,\n onChange = _ref$onChange === void 0 ? noop : _ref$onChange,\n _ref$onEscape = _ref.onEscape,\n onEscape = _ref$onEscape === void 0 ? noop : _ref$onEscape,\n _ref$onClick = _ref.onClick,\n onClick = _ref$onClick === void 0 ? noop : _ref$onClick;\n\n var _useElementsContextWi = useElementsContextWithUseCase(\"mounts <\".concat(displayName, \">\")),\n elements = _useElementsContextWi.elements;\n\n var elementRef = React.useRef(null);\n var domNode = React.useRef(null);\n var callOnReady = useCallbackReference(onReady);\n var callOnBlur = useCallbackReference(onBlur);\n var callOnFocus = useCallbackReference(onFocus);\n var callOnClick = useCallbackReference(onClick);\n var callOnChange = useCallbackReference(onChange);\n var callOnEscape = useCallbackReference(onEscape);\n React.useLayoutEffect(function () {\n if (elementRef.current == null && elements && domNode.current != null) {\n var element = elements.create(type, options);\n elementRef.current = element;\n element.mount(domNode.current);\n element.on('ready', function () {\n return callOnReady(element);\n });\n element.on('change', callOnChange);\n element.on('blur', callOnBlur);\n element.on('focus', callOnFocus);\n element.on('escape', callOnEscape); // Users can pass an an onClick prop on any Element component\n // just as they could listen for the `click` event on any Element,\n // but only the PaymentRequestButton will actually trigger the event.\n\n element.on('click', callOnClick);\n }\n });\n var prevOptions = React.useRef(options);\n React.useEffect(function () {\n if (prevOptions.current && prevOptions.current.paymentRequest !== options.paymentRequest) {\n console.warn('Unsupported prop change: options.paymentRequest is not a customizable property.');\n }\n\n var updateableOptions = extractUpdateableOptions(options);\n\n if (Object.keys(updateableOptions).length !== 0 && !isEqual(updateableOptions, extractUpdateableOptions(prevOptions.current))) {\n if (elementRef.current) {\n elementRef.current.update(updateableOptions);\n prevOptions.current = options;\n }\n }\n }, [options]);\n React.useLayoutEffect(function () {\n return function () {\n if (elementRef.current) {\n elementRef.current.destroy();\n }\n };\n }, []);\n return /*#__PURE__*/React.createElement(\"div\", {\n id: id,\n className: className,\n ref: domNode\n });\n }; // Only render the Element wrapper in a server environment.\n\n\n var ServerElement = function ServerElement(props) {\n // Validate that we are in the right context by calling useElementsContextWithUseCase.\n useElementsContextWithUseCase(\"mounts <\".concat(displayName, \">\"));\n var id = props.id,\n className = props.className;\n return /*#__PURE__*/React.createElement(\"div\", {\n id: id,\n className: className\n });\n };\n\n var Element = isServer ? ServerElement : ClientElement;\n Element.propTypes = {\n id: propTypes.string,\n className: propTypes.string,\n onChange: propTypes.func,\n onBlur: propTypes.func,\n onFocus: propTypes.func,\n onReady: propTypes.func,\n onClick: propTypes.func,\n options: propTypes.object\n };\n Element.displayName = displayName;\n Element.__elementType = type;\n return Element;\n };\n\n var isServer = typeof window === 'undefined';\n /**\n * Requires beta access:\n * Contact [Stripe support](https://support.stripe.com/) for more information.\n *\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var AuBankAccountElement = createElementComponent('auBankAccount', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var CardElement = createElementComponent('card', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var CardNumberElement = createElementComponent('cardNumber', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var CardExpiryElement = createElementComponent('cardExpiry', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var CardCvcElement = createElementComponent('cardCvc', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var FpxBankElement = createElementComponent('fpxBank', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var IbanElement = createElementComponent('iban', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var IdealBankElement = createElementComponent('idealBank', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var P24BankElement = createElementComponent('p24Bank', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var EpsBankElement = createElementComponent('epsBank', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var PaymentRequestButtonElement = createElementComponent('paymentRequestButton', isServer);\n /**\n * @docs https://stripe.com/docs/stripe-js/react#element-components\n */\n\n var AfterpayClearpayMessageElement = createElementComponent('afterpayClearpayMessage', isServer);\n\n exports.AfterpayClearpayMessageElement = AfterpayClearpayMessageElement;\n exports.AuBankAccountElement = AuBankAccountElement;\n exports.CardCvcElement = CardCvcElement;\n exports.CardElement = CardElement;\n exports.CardExpiryElement = CardExpiryElement;\n exports.CardNumberElement = CardNumberElement;\n exports.Elements = Elements;\n exports.ElementsConsumer = ElementsConsumer;\n exports.EpsBankElement = EpsBankElement;\n exports.FpxBankElement = FpxBankElement;\n exports.IbanElement = IbanElement;\n exports.IdealBankElement = IdealBankElement;\n exports.P24BankElement = P24BankElement;\n exports.PaymentRequestButtonElement = PaymentRequestButtonElement;\n exports.useElements = useElements;\n exports.useStripe = useStripe;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n","var V3_URL = 'https://js.stripe.com/v3';\nvar V3_URL_REGEX = /^https:\\/\\/js\\.stripe\\.com\\/v3\\/?(\\?.*)?$/;\nvar EXISTING_SCRIPT_MESSAGE = 'loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used';\nvar findScript = function findScript() {\n var scripts = document.querySelectorAll(\"script[src^=\\\"\".concat(V3_URL, \"\\\"]\"));\n\n for (var i = 0; i < scripts.length; i++) {\n var script = scripts[i];\n\n if (!V3_URL_REGEX.test(script.src)) {\n continue;\n }\n\n return script;\n }\n\n return null;\n};\n\nvar injectScript = function injectScript(params) {\n var queryString = params && !params.advancedFraudSignals ? '?advancedFraudSignals=false' : '';\n var script = document.createElement('script');\n script.src = \"\".concat(V3_URL).concat(queryString);\n var headOrBody = document.head || document.body;\n\n if (!headOrBody) {\n throw new Error('Expected document.body not to be null. Stripe.js requires a <body> element.');\n }\n\n headOrBody.appendChild(script);\n return script;\n};\n\nvar registerWrapper = function registerWrapper(stripe, startTime) {\n if (!stripe || !stripe._registerWrapper) {\n return;\n }\n\n stripe._registerWrapper({\n name: 'stripe-js',\n version: \"1.12.1\",\n startTime: startTime\n });\n};\n\nvar stripePromise = null;\nvar loadScript = function loadScript(params) {\n // Ensure that we only attempt to load Stripe.js at most once\n if (stripePromise !== null) {\n return stripePromise;\n }\n\n stripePromise = new Promise(function (resolve, reject) {\n if (typeof window === 'undefined') {\n // Resolve to null when imported server side. This makes the module\n // safe to import in an isomorphic code base.\n resolve(null);\n return;\n }\n\n if (window.Stripe && params) {\n console.warn(EXISTING_SCRIPT_MESSAGE);\n }\n\n if (window.Stripe) {\n resolve(window.Stripe);\n return;\n }\n\n try {\n var script = findScript();\n\n if (script && params) {\n console.warn(EXISTING_SCRIPT_MESSAGE);\n } else if (!script) {\n script = injectScript(params);\n }\n\n script.addEventListener('load', function () {\n if (window.Stripe) {\n resolve(window.Stripe);\n } else {\n reject(new Error('Stripe.js not available'));\n }\n });\n script.addEventListener('error', function () {\n reject(new Error('Failed to load Stripe.js'));\n });\n } catch (error) {\n reject(error);\n return;\n }\n });\n return stripePromise;\n};\nvar initStripe = function initStripe(maybeStripe, args, startTime) {\n if (maybeStripe === null) {\n return null;\n }\n\n var stripe = maybeStripe.apply(undefined, args);\n registerWrapper(stripe, startTime);\n return stripe;\n};\n\n// own script injection.\n\nvar stripePromise$1 = Promise.resolve().then(function () {\n return loadScript(null);\n});\nvar loadCalled = false;\nstripePromise$1[\"catch\"](function (err) {\n if (!loadCalled) {\n console.warn(err);\n }\n});\nvar loadStripe = function loadStripe() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n loadCalled = true;\n var startTime = Date.now();\n return stripePromise$1.then(function (maybeStripe) {\n return initStripe(maybeStripe, args, startTime);\n });\n};\n\nexport { loadStripe };\n","import classNames from 'classnames';\r\nimport './styles.scss';\r\n\r\nexport const SavePaymentMethod = ({label, onChange, checked}) => {\r\n return (\r\n <div className='wc-stripe-save-payment-method'>\r\n <label>\r\n <input type='checkbox' onChange={(e) => onChange(e.target.checked)}/>\r\n <svg\r\n className={classNames('wc-stripe-components-checkbox__mark', {checked: checked})}\r\n aria-hidden=\"true\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n viewBox=\"0 0 24 20\">\r\n <path d=\"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z\"/>\r\n </svg>\r\n </label>\r\n <span>{label}</span>\r\n </div>\r\n )\r\n}","export * from './payment-method-label';\r\nexport * from './checkbox';\r\nexport * from './radio-option';\r\nexport * from './payment-method';\r\nexport * from './installments';","import {useState, useRef, useEffect} from '@wordpress/element';\r\nimport {__} from '@wordpress/i18n';\r\nimport apiFetch from '@wordpress/api-fetch';\r\nimport classnames from 'classnames';\r\nimport {StripeError, getRoute} from \"../../../payment-methods/util\";\r\nimport './style.scss';\r\n\r\nexport const Installments = (\r\n {\r\n paymentMethodName,\r\n stripe,\r\n getCreatePaymentMethodArgs,\r\n cardFormComplete = false,\r\n addPaymentMethodData\r\n }) => {\r\n const [installments, setInstallments] = useState(null);\r\n const [installment, setInstallment] = useState('');\r\n const [loading, setLoading] = useState(false);\r\n const onInstallmentSelected = (e) => {\r\n setInstallment(e.target.value);\r\n addPaymentMethodData({_stripe_installment_plan: e.target.value});\r\n }\r\n useEffect(async () => {\r\n if (cardFormComplete) {\r\n // fetch the installments\r\n try {\r\n setLoading(true);\r\n setInstallment('');\r\n let result = await stripe.createPaymentMethod(getCreatePaymentMethodArgs());\r\n if (result.error) {\r\n throw new StripeError(result.error);\r\n }\r\n // fetch the installment plans\r\n result = await apiFetch({\r\n url: getRoute('create/payment_intent'),\r\n method: 'POST',\r\n data: {payment_method_id: result.paymentMethod.id, payment_method: paymentMethodName}\r\n });\r\n setInstallments(result.installments);\r\n if (Object.keys(result.installments)?.length) {\r\n setInstallment(Object.keys(result.installments)[0]);\r\n }\r\n } catch (error) {\r\n\r\n } finally {\r\n setLoading(false);\r\n }\r\n }\r\n }, [cardFormComplete]);\r\n\r\n return (\r\n <div className='wc-stripe-installments__container'>\r\n <label>\r\n {__('Pay in installments:', 'woo-stripe-payment')}\r\n <Loader loading={loading}/>\r\n </label>\r\n <InstallmentOptions\r\n installment={installment}\r\n onChange={onInstallmentSelected}\r\n installments={installments}\r\n isLoading={loading}/>\r\n </div>\r\n )\r\n}\r\n\r\nconst InstallmentOptions = ({installment, installments, onChange, isLoading}) => {\r\n let OPTIONS = null;\r\n if (isLoading) {\r\n OPTIONS = <option value=\"\" disabled>{__('Loading installments...', 'woo-stripe-payment')}</option>\r\n } else {\r\n if (installments === null) {\r\n OPTIONS = <option value=\"\" disabled>{__('Fill out card form for eligibility.', 'woo-stripe-payment')}</option>\r\n } else {\r\n OPTIONS = Object.keys(installments).map(id => {\r\n return <option key={id} value={id} dangerouslySetInnerHTML={{__html: installments[id].text}}/>\r\n });\r\n }\r\n }\r\n return (\r\n <select value={installment} onChange={onChange} className={classnames({loading: isLoading})}>\r\n {OPTIONS}\r\n </select>\r\n );\r\n}\r\n\r\nconst Loader = ({loading}) => {\r\n return (\r\n <div className=\"wc-stripe-installment-loader__container\">\r\n {loading && <div className=\"wc-stripe-installment-loader\">\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n </div>}\r\n </div>\r\n );\r\n}\r\nexport default Installments;","import './style.scss';\r\n\r\nexport const PaymentMethodLabel = ({title, icons, paymentMethod, ...props}) => {\r\n const {PaymentMethodLabel: Label, PaymentMethodIcons: Icons} = props.components;\r\n if (!Array.isArray(icons)) {\r\n icons = [icons];\r\n }\r\n return (\r\n <span className={`wc-stripe-label-container ${paymentMethod}`}>\r\n <Label text={title}/>\r\n <Icons icons={icons} align='left'/>\r\n </span>\r\n )\r\n}","import {useEffect, useRef} from '@wordpress/element';\r\n\r\nexport const PaymentMethod = ({getData, content, ...props}) => {\r\n const Content = content;\r\n const desc = getData('description');\r\n const el = useRef(null);\r\n useEffect(() => {\r\n if (el.current && el.current.childNodes.length == 0) {\r\n el.current.classList.add('no-content');\r\n }\r\n });\r\n return (\r\n <>\r\n {desc && <Description desc={desc} payment_method={getData('name')}/>}\r\n <div ref={el} className='wc-stripe-blocks-payment-method-content'>\r\n <Content {...{...props, getData}}/>\r\n </div>\r\n </>);\r\n}\r\n\r\nconst Description = ({desc, payment_method}) => {\r\n return (\r\n <div className={`wc-stripe-blocks-payment-method__desc ${payment_method}`}>\r\n <p>{desc}</p>\r\n </div>\r\n )\r\n}","import 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((e) => {\r\n if (paymentRequest) {\r\n e.preventDefault();\r\n onClick();\r\n paymentRequest.show();\r\n }\r\n }, [paymentRequest, onClick]);\r\n\r\n if (paymentRequest) {\r\n return (\r\n <button\r\n className={`apple-pay-button ${getData('buttonStyle')}`}\r\n style={{\r\n '-apple-pay-button-type': getData('buttonType')\r\n }}\r\n onClick={handleClick}/>\r\n\r\n )\r\n }\r\n return null;\r\n}\r\n\r\nconst ApplePayEdit = ({getData, ...props}) => {\r\n return (\r\n <div className={'apple-pay-block-editor'}>\r\n <img src={getData('editorIcon')}/>\r\n </div>\r\n )\r\n}\r\n\r\nregisterExpressPaymentMethod({\r\n name: getData('name'),\r\n canMakePayment: ({cartTotals, ...props}) => {\r\n if (getData('isAdmin')) {\r\n return true;\r\n }\r\n const {currency_code: currency, total_price} = cartTotals;\r\n return canMakePayment({\r\n country: getData('countryCode'),\r\n currency: currency.toLowerCase(),\r\n total: {\r\n label: getData('totalLabel'),\r\n amount: parseInt(total_price)\r\n }\r\n }, (result) => result != null && result.applePay);\r\n },\r\n content: <ApplePayContent getData={getData}/>,\r\n edit: <ApplePayEdit getData={getData}/>,\r\n supports: {\r\n showSavedCards: getData('showSavedCards'),\r\n showSaveOption: getData('showSaveOption'),\r\n features: getData('features')\r\n }\r\n})","import './style.scss';\r\nimport {registerCreditCardForm} from \"@paymentplugins/stripe/util\";\r\nimport {CardNumberElement, CardExpiryElement, CardCvcElement} from '@stripe/react-stripe-js';\r\nimport {__} from \"@wordpress/i18n\";\r\n\r\nconst Bootstrap = ({CardIcon, options, onChange}) => {\r\n return (\r\n <div className='wc-stripe-bootstrap-form'>\r\n <div className='row'>\r\n <div className='col-md-6 mb-3'>\r\n <CardNumberElement className='md-form md-outline stripe-input' options={options['cardNumber']}\r\n onChange={onChange(CardNumberElement)}/>\r\n <label htmlFor=\"stripe-card-number\">{__('Card Number', 'woo-stripe-payment')}</label>\r\n {CardIcon}\r\n </div>\r\n <div className='col-md-3 mb-3'>\r\n <CardExpiryElement className='md-form md-outline stripe-input' options={options['cardExpiry']}\r\n onChange={onChange(CardExpiryElement)}/>\r\n <label htmlFor=\"stripe-exp\">{__('Exp', 'woo-stripe-payment')}</label>\r\n </div>\r\n <div className='col-md-3 mb-3'>\r\n <CardCvcElement className=\"md-form md-outline stripe-input\" options={options['cardCvc']}\r\n onChange={onChange(CardCvcElement)}/>\r\n <label htmlFor=\"stripe-cvv\">{__('CVV', 'woo-stripe-payment')}</label>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nregisterCreditCardForm({\r\n id: 'bootstrap',\r\n breakpoint: 475,\r\n component: <Bootstrap/>\r\n})","import {getCreditCardForm} from \"../../util\";\r\nimport {cloneElement, useRef, useCallback, useEffect, useState} from '@wordpress/element';\r\nimport {useElements, CardNumberElement, CardExpiryElement, CardCvcElement} from '@stripe/react-stripe-js';\r\nimport {sprintf, __} from '@wordpress/i18n';\r\nimport {useBreakpointWidth} from \"../../hooks\";\r\n\r\nconst classes = {\r\n focus: 'focused',\r\n empty: 'empty',\r\n invalid: 'invalid'\r\n}\r\n\r\nconst CustomCardForm = (\r\n {\r\n getData,\r\n onChange: eventChange,\r\n onComplete\r\n }) => {\r\n const [cardType, setCardType] = useState('');\r\n const elementOrder = useRef([]);\r\n const [container, setContainer] = useState(null);\r\n const elements = useElements();\r\n const id = getData('customForm');\r\n const {component: CardForm = null, breakpoint = 475} = getCreditCardForm(id);\r\n const postalCodeEnabled = getData('postalCodeEnabled');\r\n const options = {};\r\n const elementStatus = useRef({'cardNumber': {}, 'cardExpiry': {}, 'cardCvc': {}});\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 elementStatus.current[event.elementType] = 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 onComplete(isFormComplete());\r\n }\r\n }\r\n\r\n const isFormComplete = () => {\r\n let status = elementStatus.current;\r\n return Object.keys(status).filter(key => !!status[key].complete).length === Object.keys(status).length;\r\n }\r\n\r\n const setElementOrder = useCallback((element) => {\r\n if (!elementOrder.current.includes(element)) {\r\n elementOrder.current.push(element);\r\n }\r\n }, []);\r\n\r\n useBreakpointWidth({name: 'creditCardForm', width: breakpoint, node: container, className: 'small-form'});\r\n\r\n const getCardIconSrc = useCallback((type) => {\r\n for (let id of Object.keys(getData('cards'))) {\r\n if (id === type) {\r\n return getData('cards')[id];\r\n }\r\n }\r\n return '';\r\n }, []);\r\n\r\n if (!CardForm) {\r\n return (\r\n <div className='wc-stripe-custom-form-error'>\r\n <p>{sprintf(__('%s is not a valid blocks Stripe custom form. Please choose another custom form option in the Credit Card Settings.', 'woo-stripe-payment'), getData('customFormLabels')[id])}</p>\r\n </div>\r\n )\r\n }\r\n return (\r\n <div className={`wc-stripe-custom-form ${id}`} ref={setContainer}>\r\n {cloneElement(CardForm, {\r\n postalCodeEnabled,\r\n options,\r\n onChange,\r\n CardIcon: <CardIcon type={cardType} src={getCardIconSrc(cardType)}/>\r\n })}\r\n </div>\r\n )\r\n\r\n}\r\n\r\nconst CardIcon = ({type, src}) => {\r\n if (type) {\r\n return <img className={`wc-stripe-card ${type}`} src={src}/>\r\n }\r\n return null;\r\n}\r\n\r\nexport default CustomCardForm;\r\n","import './style.scss';\r\nimport {registerCreditCardForm} from \"@paymentplugins/stripe/util\";\r\nimport {CardNumberElement, CardExpiryElement, CardCvcElement} from '@stripe/react-stripe-js';\r\nimport {__} from \"@wordpress/i18n\";\r\nimport {useEffect, useCallback, useRef} from '@wordpress/element';\r\n\r\nconst SimpleForm = ({CardIcon, options, onChange}) => {\r\n useEffect(() => {\r\n }, []);\r\n return (\r\n <div className='wc-stripe-simple-form'>\r\n <div className=\"row\">\r\n <div className=\"field\">\r\n <div className='field-item'>\r\n <CardNumberElement id=\"stripe-card-number\" className=\"input empty\"\r\n options={options['cardNumber']}\r\n onChange={onChange(CardNumberElement)}/>\r\n <label htmlFor=\"stripe-card-number\"\r\n data-tid=\"\">{__('Card Number', 'woo-stripe-payment')}</label>\r\n <div className=\"baseline\"></div>\r\n {CardIcon}\r\n </div>\r\n </div>\r\n </div>\r\n <div className=\"row\">\r\n <div className=\"field half-width\">\r\n <div className='field-item'>\r\n <CardExpiryElement id=\"stripe-exp\" className=\"input empty\" options={options['cardExpiry']}\r\n onChange={onChange(CardExpiryElement)}/>\r\n <label htmlFor=\"stripe-exp\"\r\n data-tid=\"\">{__('Expiration', 'woo-stripe-payment')}</label>\r\n <div className=\"baseline\"></div>\r\n </div>\r\n </div>\r\n <div className=\"field half-width cvc\">\r\n <div className='field-item'>\r\n <CardCvcElement id=\"stripe-cvv\" className=\"input empty\" options={options['cardCvc']}\r\n onChange={onChange(CardCvcElement)}/>\r\n <label htmlFor=\"stripe-cvv\"\r\n data-tid=\"\">{__('CVV', 'woo-stripe-payment')}</label>\r\n <div className=\"baseline\"></div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nregisterCreditCardForm({\r\n id: 'simple',\r\n component: <SimpleForm/>,\r\n breakpoint: 375\r\n})","import {CardElement} from \"@stripe/react-stripe-js\";\r\nimport {isFieldRequired} from \"../../util\";\r\nimport {useMemo} from '@wordpress/element';\r\n\r\nconst StripeCardForm = ({getData, billing, onChange: eventChange, onComplete}) => {\r\n const elementStatus = {card: {}};\r\n const onChange = (event) => {\r\n eventChange(event);\r\n elementStatus[event.elementType] = event;\r\n onComplete(isFormComplete);\r\n }\r\n const isFormComplete = () => {\r\n return Object.keys(elementStatus).filter(type => !!elementStatus[type].complete).length === Object.keys(elementStatus).length;\r\n }\r\n const cardOptions = useMemo(() => {\r\n return {\r\n ...{\r\n value: {\r\n postalCode: billing?.billingData?.postcode\r\n },\r\n hidePostalCode: isFieldRequired('postcode'),\r\n iconStyle: 'default'\r\n }, ...getData('cardOptions')\r\n };\r\n }, [billing.billingData]);\r\n return (\r\n <div className='wc-stripe-inline-form'>\r\n <CardElement options={cardOptions} onChange={onChange}/>\r\n </div>\r\n )\r\n}\r\n\r\nexport default StripeCardForm;","import './style.scss';\r\n\r\nexport * from './payment-method';\r\n\r\nimport './components/bootstrap';\r\nimport './components/simple';\r\n","import {useEffect, useState, useCallback, useMemo} from '@wordpress/element';\r\nimport {registerPaymentMethod} from '@woocommerce/blocks-registry';\r\nimport {\r\n initStripe as loadStripe,\r\n getSettings,\r\n isUserLoggedIn,\r\n cartContainsSubscription,\r\n cartContainsPreOrder\r\n} from '../util';\r\nimport {Elements, CardElement, useStripe, useElements, CardNumberElement} from '@stripe/react-stripe-js';\r\nimport {PaymentMethodLabel, PaymentMethod, SavePaymentMethod} from '../../components/checkout';\r\nimport SavedCardComponent from '../saved-card-component';\r\nimport CustomCardForm from './components/custom-card-form';\r\nimport StripeCardForm from \"./components/stripe-card-form\";\r\nimport {Installments} from '../../components/checkout';\r\nimport {\r\n useProcessPaymentIntent,\r\n useAfterProcessingPayment,\r\n useSetupIntent,\r\n useStripeError\r\n} from \"../hooks\";\r\n\r\nconst getData = getSettings('stripe_cc_data');\r\n\r\nconst displaySaveCard = (customerId) => {\r\n return isUserLoggedIn(customerId) && getData('saveCardEnabled') &&\r\n !cartContainsSubscription() && !cartContainsPreOrder()\r\n}\r\n\r\nconst CreditCardContent = (props) => {\r\n const [error, setError] = useState(false);\r\n useEffect(() => {\r\n loadStripe.catch(error => {\r\n setError(error);\r\n })\r\n }, [setError]);\r\n if (error) {\r\n throw new Error(error);\r\n }\r\n return (\r\n <Elements stripe={loadStripe} options={getData('elementOptions')}>\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 [formComplete, setFormComplete] = 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 const {getCreatePaymentMethodArgs, addPaymentMethodData} = 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}} onComplete={setFormComplete}/>\r\n {displaySaveCard(billing.customerId) &&\r\n <SavePaymentMethod label={getData('savePaymentMethodLabel')}\r\n onChange={onSavePaymentMethod}\r\n checked={savePaymentMethod}/>}\r\n {getData('installmentsActive') && <Installments\r\n paymentMethodName={getData('name')}\r\n stripe={stripe}\r\n cardFormComplete={formComplete}\r\n getCreatePaymentMethodArgs={getCreatePaymentMethodArgs}\r\n addPaymentMethodData={addPaymentMethodData}/>}\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, useAfterProcessingPayment\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 useAfterProcessingPayment({\r\n getData,\r\n eventRegistration,\r\n responseTypes: emitResponse.responseTypes,\r\n activePaymentMethod\r\n });\r\n\r\n useExpressBreakpointWidth({payment_method: getData('name'), width});\r\n\r\n useEffect(() => {\r\n if (button) {\r\n // prevent button duplicates\r\n removeButton(buttonContainer.current);\r\n buttonContainer.current.append(button);\r\n }\r\n }, [button]);\r\n\r\n return (\r\n <div className='wc-stripe-gpay-button-container' ref={buttonContainer}></div>\r\n )\r\n}\r\n\r\nexport default GooglePayButton;","export const BASE_PAYMENT_METHOD = {\r\n type: 'CARD',\r\n parameters: {\r\n allowedAuthMethods: [\"PAN_ONLY\"],\r\n allowedCardNetworks: [\"AMEX\", \"DISCOVER\", \"INTERAC\", \"JCB\", \"MASTERCARD\", \"VISA\"],\r\n assuranceDetailsRequired: true\r\n }\r\n};\r\n\r\nexport const BASE_PAYMENT_REQUEST = {\r\n apiVersion: 2,\r\n apiVersionMinor: 0\r\n}","export * from './use-payments-client';\r\nexport * from './use-payment-request';\r\nexport * from './use-error-message';","import {useState} from '@wordpress/element';\r\n\r\nexport const useErrorMessage = () => {\r\n const [errorMessage, setErrorMessage] = useState(false);\r\n return {errorMessage, setErrorMessage};\r\n}","import {useState, useEffect, useMemo} from '@wordpress/element';\r\nimport {BASE_PAYMENT_REQUEST, BASE_PAYMENT_METHOD} from \"../constants\";\r\nimport {isEmpty, isFieldRequired} from \"../../util\";\r\nimport {getTransactionInfo, getShippingOptionParameters} from \"../util\";\r\n\r\nexport const usePaymentRequest = ({getData, publishableKey, merchantInfo, billing, shippingData}) => {\r\n const {billingData} = billing;\r\n const {shippingRates} = shippingData;\r\n const {processingCountry, totalPriceLabel} = getData();\r\n\r\n const paymentRequest = useMemo(() => {\r\n let options = {\r\n ...{\r\n emailRequired: isEmpty(billingData.email),\r\n merchantInfo,\r\n allowedPaymentMethods: [{\r\n ...{\r\n type: 'CARD',\r\n tokenizationSpecification: {\r\n type: \"PAYMENT_GATEWAY\",\r\n parameters: {\r\n gateway: 'stripe',\r\n \"stripe:version\": \"2018-10-31\",\r\n \"stripe:publishableKey\": publishableKey\r\n }\r\n }\r\n }, ...BASE_PAYMENT_METHOD\r\n }],\r\n shippingAddressRequired: shippingData.needsShipping,\r\n transactionInfo: getTransactionInfo({\r\n billing,\r\n processingCountry,\r\n totalPriceLabel\r\n }),\r\n callbackIntents: ['PAYMENT_AUTHORIZATION']\r\n }, ...BASE_PAYMENT_REQUEST\r\n };\r\n options.allowedPaymentMethods[0].parameters.billingAddressRequired = true;\r\n options.allowedPaymentMethods[0].parameters.billingAddressParameters = {\r\n format: 'FULL',\r\n phoneNumberRequired: isFieldRequired('phone', billingData.country) && isEmpty(billingData.phone)\r\n };\r\n if (options.shippingAddressRequired) {\r\n options.callbackIntents = [...options.callbackIntents, ...['SHIPPING_ADDRESS', 'SHIPPING_OPTION']];\r\n options.shippingOptionRequired = true;\r\n const shippingOptionParameters = getShippingOptionParameters(shippingRates);\r\n if (shippingOptionParameters.shippingOptions.length > 0) {\r\n options = {...options, shippingOptionParameters};\r\n }\r\n }\r\n return options;\r\n }, [\r\n billing.cartTotal,\r\n billing.cartTotalItems,\r\n billingData,\r\n shippingData\r\n ]);\r\n return paymentRequest;\r\n}","import {useState, useEffect, useCallback, useMemo, useRef} from '@wordpress/element';\r\nimport isShallowEqual from \"@wordpress/is-shallow-equal\";\r\nimport {\r\n getErrorMessage,\r\n getSelectedShippingOption,\r\n getBillingDetailsFromAddress,\r\n isAddressValid,\r\n isEmpty,\r\n StripeError,\r\n getIntermediateAddress\r\n} from \"../../util\";\r\nimport {useStripe} from \"@stripe/react-stripe-js\";\r\nimport {getPaymentRequestUpdate, toCartAddress} from \"../util\";\r\nimport {__} from \"@wordpress/i18n\";\r\nimport {usePaymentEvents} from \"../../hooks\";\r\n\r\nexport const usePaymentsClient = (\r\n {\r\n merchantInfo,\r\n paymentRequest,\r\n billing,\r\n shippingData,\r\n eventRegistration,\r\n canMakePayment,\r\n setErrorMessage,\r\n setPaymentMethod,\r\n exportedValues,\r\n onClick,\r\n onClose,\r\n getData\r\n }) => {\r\n const {environment} = getData();\r\n const [paymentsClient, setPaymentsClient] = useState();\r\n const [button, setButton] = useState(null);\r\n const currentBilling = useRef(billing);\r\n const currentShipping = useRef(shippingData);\r\n const stripe = useStripe();\r\n const {addPaymentEvent} = usePaymentEvents({\r\n billing,\r\n shippingData,\r\n eventRegistration\r\n });\r\n useEffect(() => {\r\n currentBilling.current = billing;\r\n currentShipping.current = shippingData;\r\n });\r\n\r\n const setAddressData = useCallback((paymentData) => {\r\n if (paymentData?.paymentMethodData?.info?.billingAddress) {\r\n let billingAddress = paymentData.paymentMethodData.info.billingAddress;\r\n if (isAddressValid(currentBilling.current.billingData, ['phone', 'email']) && isEmpty(currentBilling.current.billingData?.phone)) {\r\n billingAddress = {phoneNumber: billingAddress.phoneNumber};\r\n }\r\n exportedValues.billingData = currentBilling.current.billingData = toCartAddress(billingAddress, {email: paymentData.email});\r\n }\r\n if (paymentData?.shippingAddress) {\r\n exportedValues.shippingAddress = toCartAddress(paymentData.shippingAddress);\r\n }\r\n }, [exportedValues, paymentRequest]);\r\n\r\n const removeButton = useCallback((parentElement) => {\r\n while (parentElement.firstChild) {\r\n parentElement.removeChild(parentElement.firstChild);\r\n }\r\n }, [button]);\r\n const handleClick = useCallback(async () => {\r\n onClick();\r\n try {\r\n let paymentData = await paymentsClient.loadPaymentData(paymentRequest);\r\n\r\n // set the address data so it can be used during the checkout process\r\n setAddressData(paymentData);\r\n\r\n const data = JSON.parse(paymentData.paymentMethodData.tokenizationData.token);\r\n\r\n let result = await stripe.createPaymentMethod({\r\n type: 'card',\r\n card: {token: data.id},\r\n billing_details: getBillingDetailsFromAddress(currentBilling.current.billingData)\r\n });\r\n\r\n if (result.error) {\r\n throw new StripeError(result.error);\r\n }\r\n\r\n setPaymentMethod(result.paymentMethod.id);\r\n } catch (err) {\r\n if (err?.statusCode === \"CANCELED\") {\r\n onClose();\r\n } else {\r\n console.log(getErrorMessage(err));\r\n setErrorMessage(getErrorMessage(err));\r\n }\r\n }\r\n }, [\r\n stripe,\r\n paymentsClient,\r\n onClick\r\n ]);\r\n\r\n const createButton = useCallback(async () => {\r\n try {\r\n if (paymentsClient && !button && stripe) {\r\n await canMakePayment;\r\n setButton(paymentsClient.createButton({\r\n onClick: handleClick,\r\n ...getData('buttonStyle')\r\n }));\r\n }\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }, [\r\n stripe,\r\n button,\r\n paymentsClient,\r\n handleClick\r\n ]);\r\n\r\n const paymentOptions = useMemo(() => {\r\n let options = {\r\n environment,\r\n merchantInfo,\r\n paymentDataCallbacks: {\r\n onPaymentAuthorized: () => Promise.resolve({transactionState: \"SUCCESS\"})\r\n }\r\n }\r\n if (paymentRequest.shippingAddressRequired) {\r\n options.paymentDataCallbacks.onPaymentDataChanged = (paymentData) => {\r\n return new Promise((resolve, reject) => {\r\n const shipping = currentShipping.current;\r\n const {shippingAddress: address, shippingOptionData} = paymentData;\r\n const intermediateAddress = toCartAddress(address);\r\n // pass the Promise resolve to a ref so it persists beyond the re-render\r\n const selectedRates = getSelectedShippingOption(shippingOptionData.id);\r\n const addressEqual = isShallowEqual(getIntermediateAddress(shipping.shippingAddress), intermediateAddress);\r\n const shippingEqual = isShallowEqual(shipping.selectedRates, {\r\n [selectedRates[1]]: selectedRates[0]\r\n });\r\n addPaymentEvent('onShippingChanged', (success, {billing, shipping}) => {\r\n if (success) {\r\n resolve(getPaymentRequestUpdate({\r\n billing,\r\n shippingData: {\r\n needsShipping: true,\r\n shippingRates: shipping.shippingRates\r\n },\r\n processingCountry: getData('processingCountry'),\r\n totalPriceLabel: getData('totalPriceLabel')\r\n }))\r\n } else {\r\n resolve({\r\n error: {\r\n reason: 'SHIPPING_ADDRESS_UNSERVICEABLE',\r\n message: __('Your shipping address is not serviceable.', 'woo-stripe-payment'),\r\n intent: 'SHIPPING_ADDRESS'\r\n }\r\n });\r\n }\r\n }, addressEqual && shippingEqual);\r\n currentShipping.current.setShippingAddress({...currentShipping.current.shippingAddress, ...intermediateAddress});\r\n if (shippingOptionData.id !== 'shipping_option_unselected') {\r\n currentShipping.current.setSelectedRates(...selectedRates);\r\n }\r\n })\r\n }\r\n }\r\n return options;\r\n }, [paymentRequest]);\r\n\r\n useEffect(() => {\r\n setPaymentsClient(new google.payments.api.PaymentsClient(paymentOptions));\r\n }, [paymentOptions]);\r\n\r\n useEffect(() => {\r\n createButton();\r\n }, [createButton])\r\n\r\n return {\r\n button,\r\n removeButton\r\n };\r\n}","import './style.scss';\r\n\r\nexport * from './payment-method';","import {registerExpressPaymentMethod} from '@woocommerce/blocks-registry';\r\nimport {getSettings, initStripe as loadStripe, isCartPage} from '../util';\r\nimport {useErrorMessage} from \"./hooks\";\r\nimport GooglePayButton from './button';\r\nimport {BASE_PAYMENT_METHOD, BASE_PAYMENT_REQUEST} from './constants';\r\nimport google from '@googlepay';\r\nimport {Elements} from \"@stripe/react-stripe-js\";\r\n\r\nconst getData = getSettings('stripe_googlepay_data');\r\n\r\nconst canMakePayment = (() => {\r\n const paymentsClient = new google.payments.api.PaymentsClient({\r\n environment: getData('environment'),\r\n merchantInfo: {\r\n merchantId: getData('merchantId'),\r\n merchantName: getData('merchantName')\r\n }\r\n });\r\n const isReadyToPayRequest = {...BASE_PAYMENT_REQUEST, allowedPaymentMethods: [BASE_PAYMENT_METHOD]};\r\n return paymentsClient.isReadyToPay(isReadyToPayRequest).then(() => {\r\n return true;\r\n }).catch(err => {\r\n console.log(err);\r\n return false;\r\n })\r\n})();\r\n\r\nconst GooglePayContent = ({getData, components, ...props}) => {\r\n const {ValidationInputError} = components;\r\n const {errorMessage, setErrorMessage} = useErrorMessage();\r\n return (\r\n <div className='wc-stripe-gpay-container'>\r\n <Elements stripe={loadStripe}>\r\n <GooglePayButton getData={getData}\r\n canMakePayment={canMakePayment}\r\n setErrorMessage={setErrorMessage}\r\n {...props}/>\r\n {errorMessage && <ValidationInputError errorMessage={errorMessage}/>}\r\n </Elements>\r\n </div>\r\n )\r\n}\r\n\r\nconst GooglePayEdit = ({getData, ...props}) => {\r\n const buttonType = getData('buttonStyle').buttonType;\r\n const src = getData('editorIcons')?.[buttonType] || 'long';\r\n return (\r\n <div className={`gpay-block-editor ${buttonType}`}>\r\n <img src={src}/>\r\n </div>\r\n )\r\n}\r\n\r\nregisterExpressPaymentMethod({\r\n name: getData('name'),\r\n canMakePayment: () => {\r\n if (getData('isAdmin')) {\r\n if (isCartPage()) {\r\n return getData('cartCheckoutEnabled');\r\n }\r\n return true;\r\n }\r\n if (isCartPage() && !getData('cartCheckoutEnabled')) {\r\n return false;\r\n }\r\n return loadStripe.then(stripe => {\r\n if (stripe.error) {\r\n return stripe;\r\n }\r\n return canMakePayment;\r\n });\r\n },\r\n content: <GooglePayContent getData={getData}/>,\r\n edit: <GooglePayEdit getData={getData}/>,\r\n supports: {\r\n showSavedCards: getData('showSavedCards'),\r\n showSaveOption: getData('showSaveOption'),\r\n features: getData('features')\r\n }\r\n})","import {getShippingOptionId, removeNumberPrecision, toCartAddress as mapAddressToCartAddress} from \"../util\";\r\nimport {formatPrice} from '../util';\r\nimport {getSetting} from '@woocommerce/settings'\r\n\r\nconst generalData = getSetting('stripeGeneralData');\r\n\r\nconst ADDRESS_MAPPINGS = {\r\n name: (address, name) => {\r\n address.first_name = name.split(' ').slice(0, -1).join(' ');\r\n address.last_name = name.split(' ').pop();\r\n return address;\r\n },\r\n countryCode: 'country',\r\n address1: 'address_1',\r\n address2: 'address_2',\r\n locality: 'city',\r\n administrativeArea: 'state',\r\n postalCode: 'postcode',\r\n email: 'email',\r\n phoneNumber: 'phone'\r\n}\r\n\r\nexport const getTransactionInfo = ({billing, processingCountry, totalPriceLabel}, status = 'ESTIMATED') => {\r\n const {cartTotal, cartTotalItems, currency} = billing;\r\n const transactionInfo = {\r\n countryCode: processingCountry,\r\n currencyCode: currency.code,\r\n totalPriceStatus: status,\r\n totalPrice: removeNumberPrecision(cartTotal.value, currency.minorUnit).toString(),\r\n displayItems: getDisplayItems(cartTotalItems, currency.minorUnit),\r\n totalPriceLabel\r\n }\r\n return transactionInfo;\r\n}\r\n\r\nexport const getPaymentRequestUpdate = ({billing, shippingData, processingCountry, totalPriceLabel}) => {\r\n const {needsShipping, shippingRates} = shippingData;\r\n let update = {\r\n newTransactionInfo: getTransactionInfo({\r\n billing, processingCountry, totalPriceLabel\r\n }, 'FINAL')\r\n }\r\n if (needsShipping) {\r\n update.newShippingOptionParameters = getShippingOptionParameters(shippingRates);\r\n }\r\n return update;\r\n}\r\n\r\n/**\r\n * Return an array of line item objects\r\n * @param cartTotalItems\r\n * @param unit\r\n * @returns {[]}\r\n */\r\nconst getDisplayItems = (cartTotalItems, unit = 2) => {\r\n let items = [];\r\n const keys = ['total_tax', 'total_shipping'];\r\n cartTotalItems.forEach(item => {\r\n if (0 < item.value || (item.key && keys.includes(item.key))) {\r\n items.push({\r\n label: item.label,\r\n type: 'LINE_ITEM',\r\n price: removeNumberPrecision(item.value, unit).toString()\r\n });\r\n }\r\n })\r\n return items;\r\n}\r\n\r\nexport const getShippingOptionParameters = (shippingRates) => {\r\n const shippingOptions = getShippingOptions(shippingRates);\r\n const shippingOptionIds = shippingOptions.map(option => option.id);\r\n let defaultSelectedOptionId = shippingOptionIds.slice(0, 1).shift();\r\n shippingRates.forEach((shippingPackage, idx) => {\r\n shippingPackage.shipping_rates.forEach(rate => {\r\n if (rate.selected) {\r\n defaultSelectedOptionId = getShippingOptionId(idx, rate.rate_id);\r\n }\r\n });\r\n });\r\n return {\r\n shippingOptions,\r\n defaultSelectedOptionId,\r\n }\r\n}\r\n\r\n//id label description\r\nexport const getShippingOptions = (shippingRates) => {\r\n let options = [];\r\n shippingRates.forEach((shippingPackage, idx) => {\r\n let rates = shippingPackage.shipping_rates.map(rate => {\r\n let txt = document.createElement('textarea');\r\n txt.innerHTML = rate.name;\r\n let price = formatPrice(rate.price, rate.currency_code);\r\n return {\r\n id: getShippingOptionId(idx, rate.rate_id),\r\n label: txt.value,\r\n description: `${price}`\r\n }\r\n });\r\n options = [...options, ...rates];\r\n });\r\n return options;\r\n}\r\n\r\nexport const toCartAddress = mapAddressToCartAddress(ADDRESS_MAPPINGS);\r\n","export * from './use-process-payment-intent';\r\nexport * from './use-after-process-payment';\r\nexport * from './use-setup-intent';\r\nexport * from './use-stripe-error';\r\nexport * from './use-exported-values';\r\nexport * from './use-payment-request';\r\nexport * from './use-payment-events';\r\nexport * from './use-breakpoint-width';\r\nexport * from './use-process-checkout-error'","import {useEffect} from '@wordpress/element'\r\nimport {useStripe} from \"@stripe/react-stripe-js\";\r\nimport {handleCardAction} from \"../util\";\r\nimport {useProcessCheckoutError} from \"./use-process-checkout-error\";\r\n\r\nexport const useAfterProcessingPayment = (\r\n {\r\n getData,\r\n eventRegistration,\r\n responseTypes,\r\n activePaymentMethod,\r\n savePaymentMethod = false,\r\n messageContext = null\r\n }) => {\r\n const stripe = useStripe();\r\n const {onCheckoutAfterProcessingWithSuccess, onCheckoutAfterProcessingWithError} = eventRegistration;\r\n useProcessCheckoutError({\r\n responseTypes,\r\n subscriber: onCheckoutAfterProcessingWithError,\r\n messageContext\r\n });\r\n useEffect(() => {\r\n let unsubscribeAfterProcessingWithSuccess = onCheckoutAfterProcessingWithSuccess(async ({redirectUrl}) => {\r\n if (getData('name') === activePaymentMethod) {\r\n //check if response is in redirect. If so, open modal\r\n return await handleCardAction({\r\n redirectUrl,\r\n responseTypes,\r\n stripe,\r\n getData,\r\n savePaymentMethod\r\n });\r\n }\r\n return null;\r\n })\r\n return () => unsubscribeAfterProcessingWithSuccess()\r\n }, [\r\n stripe,\r\n responseTypes,\r\n onCheckoutAfterProcessingWithSuccess,\r\n activePaymentMethod,\r\n savePaymentMethod\r\n ]);\r\n}","import {useState, useEffect, useCallback} from '@wordpress/element';\r\nimport {storeInCache, getFromCache} from \"../util\";\r\n\r\nexport const useBreakpointWidth = (\r\n {\r\n name,\r\n width,\r\n node,\r\n className\r\n }) => {\r\n const [windowWidth, setWindowWith] = useState(window.innerWidth);\r\n const getMaxWidth = useCallback((name) => {\r\n const maxWidth = getFromCache(name);\r\n return maxWidth ? parseInt(maxWidth) : 0;\r\n }, []);\r\n const setMaxWidth = useCallback((name, width) => storeInCache(name, width), []);\r\n\r\n useEffect(() => {\r\n const el = typeof node === 'function' ? node() : node;\r\n\r\n if (el) {\r\n const maxWidth = getMaxWidth(name);\r\n if (!maxWidth || width > maxWidth) {\r\n setMaxWidth(name, width);\r\n }\r\n if (el.clientWidth < width) {\r\n el.classList.add(className);\r\n } else {\r\n if (el.clientWidth > maxWidth) {\r\n el.classList.remove(className);\r\n }\r\n }\r\n }\r\n }, [windowWidth, node]);\r\n useEffect(() => {\r\n const handleResize = () => setWindowWith(window.innerWidth);\r\n window.addEventListener('resize', handleResize);\r\n return () => window.removeEventListener('resize', handleResize);\r\n });\r\n}\r\n\r\nexport const useExpressBreakpointWidth = (\r\n {\r\n payment_method,\r\n width\r\n }) => {\r\n const node = useCallback(() => {\r\n const el = document.getElementById(`express-payment-method-${payment_method}`);\r\n return el ? el.parentNode : null;\r\n }, []);\r\n useBreakpointWidth({\r\n name: 'expressMaxWidth',\r\n width,\r\n node,\r\n className: 'wc-stripe-express__sm'\r\n });\r\n\r\n}","import {useRef} from '@wordpress/element';\r\n\r\nexport const useExportedValues = () => {\r\n const exportedValues = useRef({});\r\n return exportedValues.current;\r\n}","import {useEffect, useCallback, useRef, useState} from '@wordpress/element';\r\nimport {hasShippingRates} from '../util';\r\n\r\nexport const usePaymentEvents = (\r\n {\r\n billing,\r\n shippingData,\r\n eventRegistration\r\n }) => {\r\n const {onShippingRateSuccess, onShippingRateFail, onShippingRateSelectSuccess} = eventRegistration;\r\n const currentBilling = useRef(billing);\r\n const currentShipping = useRef(shippingData);\r\n const [handler, setHandler] = useState(null);\r\n const [paymentEvents, setPaymentEvent] = useState({\r\n onShippingChanged: false\r\n });\r\n const addPaymentEvent = useCallback((name, handler, execute = false) => {\r\n if (execute) {\r\n setHandler({[name]: handler});\r\n } else {\r\n setPaymentEvent({...paymentEvents, [name]: handler});\r\n }\r\n }, [paymentEvents, setPaymentEvent]);\r\n const removePaymentEvent = useCallback((name) => {\r\n if (paymentEvents[name]) {\r\n delete paymentEvents[name];\r\n setPaymentEvent(paymentEvents);\r\n }\r\n }, [paymentEvents]);\r\n\r\n const onShippingChanged = useCallback(() => {\r\n const shipping = currentShipping.current;\r\n const billing = currentBilling.current;\r\n if (paymentEvents.onShippingChanged && !shipping.isSelectingRate && !shipping.shippingRatesLoading) {\r\n const handler = paymentEvents.onShippingChanged;\r\n let success = true;\r\n if (!hasShippingRates(shipping.shippingRates)) {\r\n success = false;\r\n }\r\n handler(success, {\r\n billing,\r\n shipping\r\n });\r\n removePaymentEvent('onShippingChanged');\r\n }\r\n }, [paymentEvents, removePaymentEvent]);\r\n\r\n useEffect(() => {\r\n currentBilling.current = billing;\r\n currentShipping.current = shippingData;\r\n });\r\n\r\n useEffect(() => {\r\n if (handler) {\r\n if (handler.onShippingChanged) {\r\n handler.onShippingChanged(true, {\r\n billing: currentBilling.current,\r\n shipping: currentShipping.current\r\n })\r\n setHandler(null);\r\n }\r\n }\r\n }, [handler]);\r\n\r\n useEffect(() => {\r\n const unsubscribeShippingRateSuccess = onShippingRateSuccess(onShippingChanged);\r\n const unsubscribeShippingRateSelectSuccess = onShippingRateSelectSuccess(onShippingChanged);\r\n const unsubscribeShippingRateFail = onShippingRateFail(({hasInvalidAddress, hasError}) => {\r\n if (paymentEvents.onShippingChanged) {\r\n const handler = paymentEvents.onShippingChanged;\r\n handler(false);\r\n removePaymentEvent('onShippingChanged');\r\n }\r\n });\r\n\r\n return () => {\r\n unsubscribeShippingRateSuccess();\r\n unsubscribeShippingRateFail();\r\n unsubscribeShippingRateSelectSuccess();\r\n }\r\n }, [\r\n paymentEvents,\r\n onShippingRateSuccess,\r\n onShippingRateFail,\r\n onShippingRateSelectSuccess\r\n ]);\r\n\r\n return {addPaymentEvent, removePaymentEvent};\r\n}","import {useState, useEffect, useRef, useCallback} from '@wordpress/element';\r\nimport {usePaymentEvents} from './use-payment-events';\r\nimport {getIntermediateAddress} from '../util';\r\nimport isShallowEqual from '@wordpress/is-shallow-equal';\r\nimport {\r\n getDisplayItems,\r\n getShippingOptions,\r\n getSelectedShippingOption,\r\n isFieldRequired,\r\n toCartAddress as mapToCartAddress\r\n} from \"../util\";\r\n\r\nconst toCartAddress = mapToCartAddress();\r\n\r\nexport const usePaymentRequest = (\r\n {\r\n getData,\r\n onClose,\r\n stripe,\r\n billing,\r\n shippingData,\r\n eventRegistration,\r\n setPaymentMethod,\r\n exportedValues,\r\n canPay\r\n }) => {\r\n const {addPaymentEvent} = usePaymentEvents({\r\n billing,\r\n shippingData,\r\n eventRegistration\r\n });\r\n const {shippingAddress, needsShipping, shippingRates} = shippingData;\r\n const {billingData, cartTotalItems, currency, cartTotal} = billing;\r\n const [paymentRequest, setPaymentRequest] = useState(null);\r\n const paymentRequestOptions = useRef({});\r\n const currentShipping = useRef(shippingData)\r\n const currentBilling = useRef(billing);\r\n\r\n useEffect(() => {\r\n currentShipping.current = shippingData;\r\n currentBilling.current = billing;\r\n }, [shippingData]);\r\n\r\n useEffect(() => {\r\n if (stripe) {\r\n const options = {\r\n country: getData('countryCode'),\r\n currency: currency?.code.toLowerCase(),\r\n total: {\r\n amount: cartTotal.value,\r\n label: cartTotal.label,\r\n pending: true\r\n },\r\n requestPayerName: true,\r\n requestPayerEmail: isFieldRequired('email', billingData.country),\r\n requestPayerPhone: isFieldRequired('phone', billingData.country),\r\n requestShipping: needsShipping,\r\n displayItems: getDisplayItems(cartTotalItems, currency)\r\n }\r\n if (options.requestShipping) {\r\n options.shippingOptions = getShippingOptions(shippingRates);\r\n }\r\n paymentRequestOptions.current = options;\r\n const paymentRequest = stripe.paymentRequest(paymentRequestOptions.current);\r\n paymentRequest.canMakePayment().then(result => {\r\n if (canPay(result)) {\r\n setPaymentRequest(paymentRequest);\r\n } else {\r\n setPaymentRequest(null);\r\n }\r\n });\r\n }\r\n }, [\r\n stripe,\r\n cartTotal.value,\r\n billingData.country,\r\n shippingRates,\r\n cartTotalItems,\r\n currency.code\r\n ]);\r\n\r\n useEffect(() => {\r\n if (paymentRequest) {\r\n if (paymentRequestOptions.current.requestShipping) {\r\n paymentRequest.on('shippingaddresschange', onShippingAddressChange);\r\n paymentRequest.on('shippingoptionchange', onShippingOptionChange);\r\n }\r\n paymentRequest.on('cancel', onClose);\r\n paymentRequest.on('paymentmethod', onPaymentMethodReceived);\r\n }\r\n }, [\r\n paymentRequest,\r\n onShippingAddressChange,\r\n onClose,\r\n onPaymentMethodReceived\r\n ]);\r\n\r\n const updatePaymentEvent = useCallback((event) => (success, {billing, shipping}) => {\r\n const {cartTotal, cartTotalItems, currency} = billing;\r\n const {shippingRates} = shipping;\r\n if (success) {\r\n event.updateWith({\r\n status: 'success',\r\n total: {\r\n amount: cartTotal.value,\r\n label: cartTotal.label,\r\n pending: false\r\n },\r\n displayItems: getDisplayItems(cartTotalItems, currency),\r\n shippingOptions: getShippingOptions(shippingRates)\r\n });\r\n } else {\r\n event.updateWith({status: 'invalid_shipping_address'});\r\n }\r\n }, []);\r\n\r\n const onShippingAddressChange = useCallback(event => {\r\n const {shippingAddress} = event;\r\n const shipping = currentShipping.current;\r\n const intermediateAddress = toCartAddress(shippingAddress);\r\n shipping.setShippingAddress({...shipping.shippingAddress, ...intermediateAddress});\r\n const addressEqual = isShallowEqual(getIntermediateAddress(shipping.shippingAddress), intermediateAddress);\r\n addPaymentEvent('onShippingChanged', updatePaymentEvent(event), addressEqual);\r\n }, [addPaymentEvent]);\r\n\r\n const onShippingOptionChange = useCallback(event => {\r\n const {shippingOption} = event;\r\n const shipping = currentShipping.current;\r\n shipping.setSelectedRates(...getSelectedShippingOption(shippingOption.id));\r\n addPaymentEvent('onShippingChanged', updatePaymentEvent(event));\r\n }, [addPaymentEvent]);\r\n\r\n const onPaymentMethodReceived = useCallback((paymentResponse) => {\r\n const {paymentMethod, payerName = null, payerEmail = null, payerPhone = null} = paymentResponse;\r\n // set address data\r\n let billingData = {payerName, payerEmail, payerPhone};\r\n if (paymentMethod?.billing_details.address) {\r\n billingData = toCartAddress(paymentMethod.billing_details.address, billingData);\r\n }\r\n exportedValues.billingData = billingData;\r\n\r\n if (paymentResponse.shippingAddress) {\r\n exportedValues.shippingAddress = toCartAddress(paymentResponse.shippingAddress);\r\n }\r\n\r\n // set payment method\r\n setPaymentMethod(paymentMethod.id);\r\n paymentResponse.complete(\"success\");\r\n }, []);\r\n\r\n return {paymentRequest};\r\n}","import {useEffect} from '@wordpress/element';\r\n\r\nexport const useProcessCheckoutError = (\r\n {\r\n responseTypes,\r\n subscriber,\r\n messageContext = null\r\n }) => {\r\n useEffect(() => {\r\n const unsubscribe = subscriber((data) => {\r\n if (data?.processingResponse.paymentDetails?.stripeErrorMessage) {\r\n return {\r\n type: responseTypes.ERROR,\r\n message: data.processingResponse.paymentDetails.stripeErrorMessage,\r\n messageContext\r\n };\r\n }\r\n return null;\r\n });\r\n return () => unsubscribe();\r\n }, [responseTypes, subscriber]);\r\n}","import {useEffect, useState, useCallback, useRef} from '@wordpress/element';\r\nimport {useStripe} from '@stripe/react-stripe-js';\r\nimport {\r\n ensureSuccessResponse,\r\n ensureErrorResponse,\r\n getBillingDetailsFromAddress,\r\n StripeError\r\n} from '../util';\r\n\r\nexport const useProcessPaymentIntent = (\r\n {\r\n getData,\r\n billing,\r\n shippingData,\r\n onPaymentProcessing,\r\n emitResponse,\r\n error,\r\n onSubmit,\r\n activePaymentMethod,\r\n paymentType = 'card',\r\n setupIntent = null,\r\n removeSetupIntent = null,\r\n savePaymentMethod = false,\r\n exportedValues = {},\r\n getPaymentMethodArgs = () => ({})\r\n }) => {\r\n const {billingData} = billing;\r\n const {shippingAddress} = shippingData;\r\n const {responseTypes} = emitResponse;\r\n const [paymentMethod, setPaymentMethod] = useState(null);\r\n const stripe = useStripe();\r\n const currentPaymentMethodArgs = useRef(getPaymentMethodArgs);\r\n const paymentMethodData = useRef({});\r\n useEffect(() => {\r\n currentPaymentMethodArgs.current = getPaymentMethodArgs;\r\n }, [getPaymentMethodArgs]);\r\n\r\n const addPaymentMethodData = useCallback((data) => {\r\n paymentMethodData.current = {...paymentMethodData.current, ...data};\r\n }, []);\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 ...paymentMethodData.current\r\n }\r\n }\r\n }\r\n if (exportedValues?.billingData) {\r\n response.meta.billingData = exportedValues.billingData;\r\n }\r\n if (exportedValues?.shippingAddress) {\r\n response.meta.shippingData = {address: exportedValues.shippingAddress};\r\n }\r\n return response;\r\n }, [billingData, shippingAddress]);\r\n\r\n useEffect(() => {\r\n if (paymentMethod && typeof paymentMethod === 'string') {\r\n onSubmit();\r\n }\r\n }, [paymentMethod, onSubmit]);\r\n\r\n useEffect(() => {\r\n const unsubscribeProcessingPayment = onPaymentProcessing(async () => {\r\n if (activePaymentMethod !== getData('name')) {\r\n return null;\r\n }\r\n let [result, paymentMethodId] = [null, null];\r\n try {\r\n if (error) {\r\n throw new StripeError(error);\r\n }\r\n if (setupIntent) {\r\n result = await stripe.confirmCardSetup(setupIntent.client_secret, {\r\n payment_method: getCreatePaymentMethodArgs()\r\n });\r\n if (result.error) {\r\n throw new StripeError(result.error);\r\n }\r\n paymentMethodId = result.setupIntent.payment_method;\r\n removeSetupIntent();\r\n } else {\r\n // payment method has already been created.\r\n if (paymentMethod) {\r\n paymentMethodId = paymentMethod;\r\n } else {\r\n //create the payment method\r\n result = await stripe.createPaymentMethod(getCreatePaymentMethodArgs());\r\n if (result.error) {\r\n throw new StripeError(result.error);\r\n }\r\n paymentMethodId = result.paymentMethod.id;\r\n }\r\n }\r\n return ensureSuccessResponse(responseTypes, getSuccessResponse(paymentMethodId, savePaymentMethod));\r\n } catch (e) {\r\n console.log(e);\r\n setPaymentMethod(null);\r\n return ensureErrorResponse(responseTypes, e.error);\r\n }\r\n\r\n });\r\n return () => unsubscribeProcessingPayment();\r\n }, [\r\n paymentMethod,\r\n billingData,\r\n onPaymentProcessing,\r\n stripe,\r\n setupIntent,\r\n activePaymentMethod,\r\n savePaymentMethod\r\n ]);\r\n return {\r\n setPaymentMethod,\r\n getCreatePaymentMethodArgs,\r\n addPaymentMethodData\r\n };\r\n}","import {useEffect, useState, useCallback} from '@wordpress/element';\r\nimport apiFetch from \"@wordpress/api-fetch\";\r\nimport {\r\n getSettings,\r\n getRoute,\r\n cartContainsPreOrder,\r\n cartContainsSubscription,\r\n getFromCache,\r\n storeInCache,\r\n deleteFromCache\r\n} from '../util';\r\n\r\nexport const useSetupIntent = (\r\n {\r\n cartTotal,\r\n setError\r\n }) => {\r\n const [setupIntent, setSetupIntent] = useState(getFromCache('setupIntent'));\r\n\r\n useEffect(() => {\r\n const createSetupIntent = async () => {\r\n if (setupIntent) {\r\n return;\r\n }\r\n // only create intent under certain conditions\r\n let result = await apiFetch({\r\n url: getRoute('create/setup_intent'),\r\n method: 'POST'\r\n });\r\n if (result.code) {\r\n setError(result.message);\r\n } else {\r\n storeInCache('setupIntent', result.intent);\r\n setSetupIntent(result.intent);\r\n }\r\n }\r\n if (cartContainsPreOrder() || (cartContainsSubscription() && cartTotal.value == 0)) {\r\n if (!setupIntent) {\r\n createSetupIntent();\r\n }\r\n } else {\r\n setSetupIntent(null);\r\n }\r\n }, [cartTotal.value]);\r\n const removeSetupIntent = useCallback(() => {\r\n deleteFromCache('setupIntent');\r\n }, [cartTotal.value]);\r\n return {setupIntent, removeSetupIntent};\r\n}","import {useState} from '@wordpress/element'\r\n\r\nexport const useStripeError = () => {\r\n const [error, setError] = useState(false);\r\n return [error, setError];\r\n}","import {useState, useEffect} from '@wordpress/element';\r\nimport {registerPaymentMethod} from '@woocommerce/blocks-registry';\r\nimport {getSettings, initStripe} from \"../util\";\r\nimport {LocalPaymentIntentContent} from './local-payment-method';\r\nimport {PaymentMethod} from \"../../components/checkout\";\r\nimport {canMakePayment} from \"./local-payment-method\";\r\nimport {AfterpayClearpayMessageElement, Elements} from \"@stripe/react-stripe-js\";\r\nimport {sprintf, __} from '@wordpress/i18n';\r\nimport {ExperimentalOrderMeta, TotalsWrapper} from '@woocommerce/blocks-checkout';\r\nimport {registerPlugin} from '@wordpress/plugins';\r\n\r\nconst getData = getSettings('stripe_afterpay_data');\r\nlet variablesHandler;\r\nconst setVariablesHandler = (handler) => {\r\n variablesHandler = handler;\r\n}\r\n\r\nconst isAvailable = ({total, currency, needsShipping}) => {\r\n let available = false;\r\n const requiredParams = getData('requiredParams');\r\n const accountCountry = getData('accountCountry');\r\n const requiredParamObj = requiredParams.hasOwnProperty(currency) ? requiredParams[currency] : false;\r\n if (requiredParamObj) {\r\n available = accountCountry === requiredParamObj?.[0] && needsShipping && (total > requiredParamObj?.[1] && total < requiredParamObj?.[2]);\r\n }\r\n return available;\r\n}\r\n\r\nconst PaymentMethodLabel = ({getData}) => {\r\n const [variables, setVariables] = useState({\r\n amount: getData('cartTotal'),\r\n currency: getData('currency'),\r\n isEligible: getData('msgOptions').isEligible\r\n });\r\n setVariablesHandler(setVariables);\r\n return (\r\n <Elements stripe={initStripe} options={getData('elementOptions')}>\r\n <div className='wc-stripe-blocks-afterpay__label'>\r\n <AfterpayClearpayMessageElement options={{\r\n ...getData('msgOptions'),\r\n ...{\r\n amount: variables.amount,\r\n currency: variables.currency,\r\n isEligible: variables.isEligible\r\n }\r\n }}/>\r\n </div>\r\n </Elements>\r\n );\r\n}\r\n\r\nconst AfterpayPaymentMethod = ({content, billing, shippingData, ...props}) => {\r\n const Content = content;\r\n const {cartTotal, currency} = billing;\r\n const {needsShipping} = shippingData\r\n useEffect(() => {\r\n variablesHandler({\r\n amount: cartTotal.value,\r\n currency: currency.code,\r\n isEligible: needsShipping\r\n });\r\n }, [\r\n cartTotal.value,\r\n currency.code,\r\n needsShipping\r\n ]);\r\n return (\r\n <>\r\n {needsShipping &&\r\n <div className='wc-stripe-blocks-payment-method-content'>\r\n <div className=\"wc-stripe-blocks-afterpay-offsite__container\">\r\n <div className=\"wc-stripe-blocks-afterpay__offsite\">\r\n <img src={getData('offSiteSrc')}/>\r\n <p>{sprintf(__('After clicking \"%s\", you will be redirected to Afterpay to complete your purchase securely.', 'woo-stripe-payment'), getData('placeOrderButtonLabel'))}</p>\r\n </div>\r\n </div>\r\n <Content {...{...props, billing, shippingData}}/>\r\n </div>}\r\n </>\r\n );\r\n}\r\n\r\nconst OrderItemMessaging = ({cart, extensions, context}) => {\r\n const {cartTotals, cartNeedsShipping: needsShipping} = cart;\r\n const {total_price, currency_code: currency} = cartTotals;\r\n const amount = parseInt(cartTotals.total_price);\r\n const total = parseInt(cartTotals.total_price) / (10 ** cartTotals.currency_minor_unit);\r\n if (!isAvailable({total, currency, needsShipping})) {\r\n return null;\r\n }\r\n return (\r\n <TotalsWrapper>\r\n <Elements stripe={initStripe} options={getData('elementOptions')}>\r\n <div className='wc-stripe-blocks-afterpay-totals__item wc-block-components-totals-item'>\r\n <AfterpayClearpayMessageElement options={{\r\n ...getData('msgOptions'),\r\n ...{\r\n amount,\r\n currency,\r\n isEligible: needsShipping\r\n }\r\n }}/>\r\n </div>\r\n </Elements>\r\n </TotalsWrapper>\r\n );\r\n}\r\n\r\nif (getData()) {\r\n registerPaymentMethod({\r\n name: getData('name'),\r\n label: <PaymentMethodLabel\r\n getData={getData}/>,\r\n ariaLabel: __('Afterpay', 'woo-stripe-payment'),\r\n placeOrderButtonLabel: getData('placeOrderButtonLabel'),\r\n canMakePayment: canMakePayment(getData, ({settings, cartTotals, cartNeedsShipping}) => {\r\n const {currency_code: currency, currency_minor_unit, total_price} = cartTotals;\r\n if (variablesHandler) {\r\n variablesHandler({\r\n amount: parseInt(cartTotals.total_price),\r\n currency,\r\n isEligible: cartNeedsShipping\r\n });\r\n }\r\n const total = parseInt(total_price) / (10 ** currency_minor_unit);\r\n const available = isAvailable({total, currency, needsShipping: cartNeedsShipping});\r\n if (!available && !settings('hideIneligible')) {\r\n return true;\r\n }\r\n return available;\r\n }),\r\n content: <AfterpayPaymentMethod\r\n content={LocalPaymentIntentContent}\r\n getData={getData}\r\n confirmationMethod={'confirmAfterpayClearpayPayment'}/>,\r\n edit: <PaymentMethod content={LocalPaymentIntentContent} getData={getData}/>,\r\n supports: {\r\n showSavedCards: false,\r\n showSaveOption: false,\r\n features: getData('features')\r\n }\r\n });\r\n\r\n const render = () => {\r\n return (\r\n <ExperimentalOrderMeta>\r\n <OrderItemMessaging/>\r\n </ExperimentalOrderMeta>\r\n )\r\n }\r\n registerPlugin('wc-stripe', {\r\n render: render,\r\n scope: 'woocommerce-checkout'\r\n })\r\n}","import {registerPaymentMethod} from '@woocommerce/blocks-registry';\r\nimport {getSettings} from \"../util\";\r\nimport {canMakePayment, LocalPaymentIntentContent} from './local-payment-method';\r\nimport {PaymentMethodLabel} from \"../../components/checkout/payment-method-label\";\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={LocalPaymentIntentContent}\r\n confirmationMethod={'confirmAlipayPayment'}\r\n getData={getData}/>,\r\n edit: <PaymentMethod\r\n content={LocalPaymentIntentContent}\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 {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_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={LocalPaymentIntentContent}\r\n confirmationMethod={'confirmBancontactPayment'}\r\n getData={getData}/>,\r\n edit: <PaymentMethod\r\n content={LocalPaymentIntentContent}\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\nconst BecsPaymentMethod = (props) => {\r\n return (\r\n <>\r\n <PaymentMethod {...props} />\r\n <div className={'wc-stripe-blocks-mandate becs-mandate'}\r\n dangerouslySetInnerHTML={{__html: props.getData('mandate')}}/>\r\n </>\r\n );\r\n}\r\n\r\nif (getData()) {\r\n registerPaymentMethod({\r\n name: getData('name'),\r\n label: <PaymentMethodLabel\r\n title={getData('title')}\r\n paymentMethod={getData('name')}\r\n icons={getData('icon')}/>,\r\n ariaLabel: 'BECS',\r\n placeOrderButtonLabel: getData('placeOrderButtonLabel'),\r\n canMakePayment: canMakePayment(getData),\r\n content: <BecsPaymentMethod\r\n content={LocalPaymentIntentContent}\r\n getData={getData}\r\n confirmationMethod={'confirmAuBecsDebitPayment'}\r\n component={AuBankAccountElement}/>,\r\n edit: <PaymentMethod content={LocalPaymentIntentContent} getData={getData}/>,\r\n supports: {\r\n showSavedCards: false,\r\n showSaveOption: false,\r\n features: getData('features')\r\n }\r\n })\r\n}","import {useState, useEffect, useCallback} from '@wordpress/element';\r\nimport {__} from '@wordpress/i18n';\r\nimport {registerPaymentMethod} from '@woocommerce/blocks-registry';\r\nimport classnames from 'classnames';\r\nimport {ensureErrorResponse, getSettings, isTestMode} from \"../util\";\r\nimport {LocalPaymentIntentContent} from './local-payment-method';\r\nimport {PaymentMethodLabel, PaymentMethod} from \"../../components/checkout\";\r\nimport {canMakePayment} from \"./local-payment-method\";\r\n\r\nconst getData = getSettings('stripe_boleto_data');\r\n\r\nconst BoletoPaymentMethodContainer = ({eventRegistration, ...props}) => {\r\n const [taxId, setTaxId] = useState('');\r\n const [isActive, setIsActive] = useState(false);\r\n const {onPaymentProcessing} = eventRegistration;\r\n const callback = useCallback(() => {\r\n return {\r\n boleto: {\r\n tax_id: taxId\r\n }\r\n };\r\n }, [taxId]);\r\n\r\n useEffect(() => {\r\n const unsubscribe = onPaymentProcessing(() => {\r\n if (!taxId) {\r\n return ensureErrorResponse(props.emitResponse.responseTypes, __('Please enter a valid CPF/CNPJ value', 'woo-stripe-payment'));\r\n }\r\n return true;\r\n })\r\n return () => unsubscribe();\r\n }, [onPaymentProcessing, taxId]);\r\n return (\r\n <>\r\n <div className={classnames('wc-block-components-text-input', {\r\n 'is-active': isActive || taxId\r\n })}>\r\n <input\r\n type='text'\r\n id='wc-stripe-boleto-tax_id'\r\n onChange={(e) => setTaxId(e.target.value)}\r\n onFocus={() => setIsActive(true)}\r\n onBlur={() => setIsActive(false)}/>\r\n <label htmlFor='wc-stripe-boleto-tax_id'>{__(' CPF / CNPJ', ' woo-stripe-payment')}</label>\r\n </div>\r\n {isTestMode() &&\r\n <div className='wc-stripe-boleto__description'>\r\n <p>{__('Test mode values', 'woo-stripe-payment')}</p>\r\n <div>\r\n <label>CPF:</label>&nbsp;<span>000.000.000-00</span>\r\n </div>\r\n <div>\r\n <label>CNPJ:</label>&nbsp;<span>00.000.000/0000-00</span>\r\n </div>\r\n </div>}\r\n {!isTestMode() &&\r\n <div className=\"wc-stripe-boleto__description\">\r\n <p>{__('Accepted formats', 'woo-stripe-payment')}</p>\r\n <div>\r\n <label>CPF:</label>&nbsp;\r\n <span>{__('XXX.XXX.XXX-XX or XXXXXXXXXXX', 'woo-stripe-payment')}</span>\r\n </div>\r\n <div>\r\n <label>CNPJ:</label>&nbsp;\r\n <span>{__('XX.XXX.XXX/XXXX-XX or XXXXXXXXXXXXXX', 'woo-stripe-payment')}</span>\r\n </div>\r\n </div>}\r\n <LocalPaymentIntentContent callback={callback} {...{...props, ...{eventRegistration}}}/>\r\n </>\r\n )\r\n}\r\n\r\nif (getData()) {\r\n registerPaymentMethod({\r\n name: getData('name'),\r\n label: <PaymentMethodLabel\r\n title={getData('title')}\r\n paymentMethod={getData('name')}\r\n icons={getData('icon')}/>,\r\n ariaLabel: 'Boleto',\r\n placeOrderButtonLabel: getData('placeOrderButtonLabel'),\r\n canMakePayment: canMakePayment(getData),\r\n content: <PaymentMethod\r\n content={BoletoPaymentMethodContainer}\r\n getData={getData}\r\n confirmationMethod={'confirmBoletoPayment'}/>,\r\n edit: <PaymentMethod content={LocalPaymentIntentContent} getData={getData}/>,\r\n supports: {\r\n showSavedCards: false,\r\n showSaveOption: false,\r\n features: getData('features')\r\n }\r\n })\r\n}","import {registerPaymentMethod} from '@woocommerce/blocks-registry';\r\nimport {getSettings} from \"../util\";\r\nimport {canMakePayment, LocalPaymentIntentContent} from './local-payment-method';\r\nimport {PaymentMethodLabel, PaymentMethod} from \"../../components/checkout\";\r\nimport {EpsBankElement} from \"@stripe/react-stripe-js\";\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\r\n content={LocalPaymentIntentContent}\r\n confirmationMethod={'confirmEpsPayment'}\r\n component={EpsBankElement}\r\n getData={getData}/>,\r\n edit: <PaymentMethod content={LocalPaymentIntentContent} getData={getData}/>,\r\n supports: {\r\n showSavedCards: false,\r\n showSaveOption: false,\r\n features: getData('features')\r\n }\r\n })\r\n}","import {registerPaymentMethod} from '@woocommerce/blocks-registry';\r\nimport {getSettings} from \"../util\";\r\nimport {LocalPaymentIntentContent} from './local-payment-method';\r\nimport {PaymentMethodLabel, PaymentMethod} from \"../../components/checkout\";\r\nimport {canMakePayment} from \"./local-payment-method\";\r\nimport {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 {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_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\r\n content={LocalPaymentIntentContent}\r\n confirmationMethod={'confirmGiropayPayment'}\r\n getData={getData}/>,\r\n edit: <PaymentMethod content={LocalPaymentIntentContent} getData={getData}/>,\r\n supports: {\r\n showSavedCards: false,\r\n showSaveOption: false,\r\n features: getData('features')\r\n }\r\n })\r\n}","import {registerPaymentMethod} from '@woocommerce/blocks-registry';\r\nimport {getSettings} from \"../util\";\r\nimport {LocalPaymentIntentContent} from './local-payment-method';\r\nimport {PaymentMethodLabel, PaymentMethod} from \"../../components/checkout\";\r\nimport {canMakePayment} from \"./local-payment-method\";\r\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(currentBillingData.current)\r\n },\r\n return_url\r\n });\r\n if (result.error) {\r\n throw new StripeError(result.error);\r\n }\r\n window.location = decodeURI(order.order_received_url);\r\n }\r\n } catch (e) {\r\n console.log(e);\r\n return ensureErrorResponse(responseTypes, e.error);\r\n }\r\n }\r\n })\r\n return () => unsubscribeAfterProcessingWithSuccess();\r\n }, [\r\n stripe,\r\n onCheckoutAfterProcessingWithSuccess,\r\n onCheckoutAfterProcessingWithError\r\n ]);\r\n}","import {useState, useEffect, useRef, useCallback} from '@wordpress/element';\r\nimport {\r\n getDefaultSourceArgs,\r\n ensureSuccessResponse,\r\n ensureErrorResponse,\r\n StripeError\r\n} from \"../../util\";\r\nimport {useStripe, useElements} from \"@stripe/react-stripe-js\";\r\nimport {__} from '@wordpress/i18n';\r\n\r\nexport const useCreateSource = (\r\n {\r\n getData,\r\n billing,\r\n shippingAddress,\r\n onPaymentProcessing,\r\n responseTypes,\r\n getSourceArgs = false,\r\n element = false\r\n }) => {\r\n const [source, setSource] = useState(false);\r\n const [isValid, setIsValid] = useState(false);\r\n const currentValues = useRef({\r\n billing,\r\n shippingAddress,\r\n });\r\n const stripe = useStripe();\r\n const elements = useElements();\r\n useEffect(() => {\r\n currentValues.current = {\r\n billing,\r\n shippingAddress\r\n }\r\n });\r\n\r\n const getSourceArgsInternal = useCallback(() => {\r\n const {billing} = currentValues.current;\r\n const {cartTotal, currency, billingData} = billing;\r\n let args = getDefaultSourceArgs({\r\n type: getData('paymentType'),\r\n amount: cartTotal.value,\r\n billingData,\r\n currency: currency.code,\r\n returnUrl: getData('returnUrl')\r\n });\r\n if (getSourceArgs) {\r\n args = getSourceArgs(args, {billingData});\r\n }\r\n return args;\r\n }, []);\r\n\r\n const getSuccessData = useCallback((sourceId) => {\r\n return {\r\n meta: {\r\n paymentMethodData: {\r\n [`${getData('name')}_token_key`]: sourceId\r\n }\r\n }\r\n }\r\n }, []);\r\n\r\n useEffect(() => {\r\n const unsubscribe = onPaymentProcessing(async () => {\r\n if (source) {\r\n return ensureSuccessResponse(responseTypes, getSuccessData(source.id));\r\n }\r\n // create the source\r\n try {\r\n let result;\r\n if (element) {\r\n // validate the element\r\n if (!isValid) {\r\n throw __('Please enter your payment info before proceeding.', 'woo-stripe-payment');\r\n }\r\n result = await stripe.createSource(elements.getElement(element), getSourceArgsInternal());\r\n } else {\r\n result = await stripe.createSource(getSourceArgsInternal());\r\n }\r\n if (result.error) {\r\n throw new StripeError(result.error);\r\n }\r\n setSource(result.source);\r\n return ensureSuccessResponse(responseTypes, getSuccessData(result.source.id));\r\n } catch (err) {\r\n console.log(err);\r\n return ensureErrorResponse(responseTypes, err.error || err);\r\n }\r\n });\r\n return () => unsubscribe();\r\n }, [\r\n source,\r\n onPaymentProcessing,\r\n stripe,\r\n responseTypes,\r\n element,\r\n isValid,\r\n setIsValid\r\n ]);\r\n return {setIsValid};\r\n}","import {useEffect, useRef, useState} from '@wordpress/element';\r\nimport {ensureErrorResponse} from \"../../util\";\r\nimport {__} from \"@wordpress/i18n\";\r\n\r\nexport const useValidateCheckout = (\r\n {\r\n subscriber,\r\n responseTypes,\r\n component = null,\r\n msg = __('Please enter your payment info before proceeding.', 'woo-stripe-payment')\r\n }) => {\r\n const [isValid, setIsValid] = useState(false);\r\n\r\n useEffect(() => {\r\n const unsubscribe = subscriber(() => {\r\n if (component && !isValid) {\r\n return ensureErrorResponse(responseTypes, msg);\r\n }\r\n return true;\r\n });\r\n return () => unsubscribe();\r\n }, [\r\n subscriber,\r\n isValid,\r\n setIsValid,\r\n responseTypes,\r\n component\r\n ]);\r\n return {isValid, setIsValid};\r\n}","import {registerPaymentMethod} from '@woocommerce/blocks-registry';\r\nimport {getSettings} from \"../util\";\r\nimport {LocalPaymentIntentContent} from './local-payment-method';\r\nimport {PaymentMethodLabel, PaymentMethod} from \"../../components/checkout\";\r\nimport {canMakePayment} from \"./local-payment-method\";\r\nimport {IdealBankElement} from \"@stripe/react-stripe-js\";\r\n\r\nconst getData = getSettings('stripe_ideal_data');\r\n\r\nif (getData()) {\r\n registerPaymentMethod({\r\n name: getData('name'),\r\n label: <PaymentMethodLabel\r\n title={getData('title')}\r\n paymentMethod={getData('name')}\r\n icons={getData('icon')}/>,\r\n ariaLabel: 'Ideal',\r\n placeOrderButtonLabel: getData('placeOrderButtonLabel'),\r\n canMakePayment: canMakePayment(getData),\r\n content: <PaymentMethod\r\n content={LocalPaymentIntentContent}\r\n getData={getData}\r\n confirmationMethod={'confirmIdealPayment'}\r\n component={IdealBankElement}/>,\r\n edit: <PaymentMethod content={LocalPaymentIntentContent} getData={getData}/>,\r\n supports: {\r\n showSavedCards: false,\r\n showSaveOption: false,\r\n features: getData('features')\r\n }\r\n })\r\n}","import './klarna';\r\nimport './ideal';\r\nimport './p24';\r\nimport './bancontact';\r\nimport './giropay';\r\nimport './eps';\r\nimport './multibanco';\r\nimport './sepa';\r\nimport './sofort';\r\nimport './wechat';\r\nimport './fpx';\r\nimport './becs';\r\nimport './grabpay';\r\nimport './alipay'\r\nimport './afterpay';\r\nimport './boleto';\r\nimport './oxxo';","import {registerPaymentMethod} from '@woocommerce/blocks-registry';\r\nimport {getSettings, isTestMode} from \"../util\";\r\nimport {LocalPaymentIntentContent} from './local-payment-method';\r\nimport {PaymentMethodLabel, PaymentMethod} from \"../../components/checkout\";\r\nimport {canMakePayment} from \"./local-payment-method\";\r\nimport {__} from \"@wordpress/i18n\";\r\n\r\nconst getData = getSettings('stripe_klarna_data');\r\n\r\nconst KlarnaPaymentMethod = (props) => {\r\n return (\r\n <>\r\n {isTestMode() &&\r\n <div className=\"wc-stripe-klarna__testmode\">\r\n <label>{__('Test mode sms', 'woo-stripe-payment')}:</label>&nbsp;<span>123456</span>\r\n </div>}\r\n <LocalPaymentIntentContent {...props}/>\r\n </>\r\n )\r\n}\r\n\r\nif (getData()) {\r\n registerPaymentMethod({\r\n name: getData('name'),\r\n label: <PaymentMethodLabel\r\n title={getData('title')}\r\n paymentMethod={getData('name')}\r\n icons={getData('icon')}/>,\r\n ariaLabel: '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 content={KlarnaPaymentMethod}\r\n getData={getData}\r\n confirmationMethod={'confirmKlarnaPayment'}/>,\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 {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 = ({getData, ...props}) => {\r\n return (\r\n <Elements stripe={loadStripe} options={getData('elementOptions')}>\r\n <LocalPaymentIntentMethod {...{...props, getData}}/>\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('paymentElementOptions')}\r\n onChange={onChange}\r\n element={element}/>\r\n )\r\n }\r\n return null;\r\n}\r\n\r\nconst LocalPaymentIntentMethod = (\r\n {\r\n getData,\r\n billing,\r\n emitResponse,\r\n eventRegistration,\r\n activePaymentMethod,\r\n confirmationMethod = null,\r\n component = null,\r\n callback = null\r\n }) => {\r\n const elements = useElements();\r\n const {billingData} = billing;\r\n const {onPaymentProcessing, onCheckoutAfterProcessingWithError} = eventRegistration;\r\n const {responseTypes, noticeContexts} = emitResponse;\r\n const getPaymentMethodArgs = useCallback((billingData) => {\r\n if (component) {\r\n return {\r\n [getData('paymentType')]: elements.getElement(component)\r\n }\r\n } else if (callback) {\r\n return callback(billingData);\r\n }\r\n return {};\r\n }, [\r\n elements,\r\n callback\r\n ]);\r\n const {setIsValid} = useValidateCheckout({\r\n subscriber: onPaymentProcessing,\r\n responseTypes,\r\n component\r\n }\r\n );\r\n\r\n useAfterProcessLocalPayment({\r\n getData,\r\n billingData,\r\n eventRegistration,\r\n responseTypes,\r\n activePaymentMethod,\r\n confirmationMethod,\r\n getPaymentMethodArgs\r\n });\r\n useProcessCheckoutError({\r\n responseTypes,\r\n subscriber: onCheckoutAfterProcessingWithError,\r\n messageContext: noticeContexts.PAYMENT\r\n });\r\n if (component) {\r\n const onChange = (event) => setIsValid(!event.empty)\r\n return (\r\n <LocalPaymentElementContainer\r\n name={getData('name')}\r\n options={getData('paymentElementOptions')}\r\n onChange={onChange}\r\n element={component}\r\n callback={callback}/>\r\n )\r\n }\r\n return null;\r\n}\r\n\r\nconst LocalPaymentElementContainer = ({name, onChange, element, options, ...props}) => {\r\n const Tag = element;\r\n return (\r\n <div className={`wc-stripe-local-payment-container ${name} ${Tag.displayName}`}>\r\n <Tag options={options} onChange={onChange} {...props}/>\r\n </div>\r\n )\r\n}","import {registerPaymentMethod} from '@woocommerce/blocks-registry';\r\nimport {getSettings} from \"../util\";\r\nimport {LocalPaymentSourceContent} from './local-payment-method';\r\nimport {PaymentMethodLabel, PaymentMethod} from \"../../components/checkout\";\r\nimport {canMakePayment} from \"./local-payment-method\";\r\n\r\nconst getData = getSettings('stripe_multibanco_data');\r\n\r\nif (getData()) {\r\n registerPaymentMethod({\r\n name: getData('name'),\r\n label: <PaymentMethodLabel\r\n title={getData('title')}\r\n paymentMethod={getData('name')}\r\n icons={getData('icon')}/>,\r\n ariaLabel: 'MultiBanco',\r\n placeOrderButtonLabel: getData('placeOrderButtonLabel'),\r\n canMakePayment: canMakePayment(getData),\r\n content: <PaymentMethod content={LocalPaymentSourceContent} getData={getData}/>,\r\n edit: <PaymentMethod content={LocalPaymentSourceContent} getData={getData}/>,\r\n supports: {\r\n showSavedCards: false,\r\n showSaveOption: false,\r\n features: getData('features')\r\n }\r\n })\r\n}\r\n","import {registerPaymentMethod} from '@woocommerce/blocks-registry';\r\nimport {getSettings} from \"../util\";\r\nimport {LocalPaymentIntentContent} from './local-payment-method';\r\nimport {PaymentMethodLabel, PaymentMethod} from \"../../components/checkout\";\r\nimport {canMakePayment} from \"./local-payment-method\";\r\nimport {IdealBankElement} from \"@stripe/react-stripe-js\";\r\n\r\nconst getData = getSettings('stripe_oxxo_data');\r\n\r\nif (getData()) {\r\n registerPaymentMethod({\r\n name: getData('name'),\r\n label: <PaymentMethodLabel\r\n title={getData('title')}\r\n paymentMethod={getData('name')}\r\n icons={getData('icon')}/>,\r\n ariaLabel: 'OXXO',\r\n placeOrderButtonLabel: getData('placeOrderButtonLabel'),\r\n canMakePayment: canMakePayment(getData),\r\n content: <PaymentMethod\r\n content={LocalPaymentIntentContent}\r\n getData={getData}\r\n confirmationMethod={'confirmOxxoPayment'}/>,\r\n edit: <PaymentMethod content={LocalPaymentIntentContent} getData={getData}/>,\r\n supports: {\r\n showSavedCards: false,\r\n showSaveOption: false,\r\n features: getData('features')\r\n }\r\n })\r\n}","import {registerPaymentMethod} from '@woocommerce/blocks-registry';\r\nimport {getSettings} from \"../util\";\r\nimport {LocalPaymentIntentContent} from './local-payment-method';\r\nimport {PaymentMethodLabel, PaymentMethod} from \"../../components/checkout\";\r\nimport {canMakePayment} from \"./local-payment-method\";\r\nimport {P24BankElement} from \"@stripe/react-stripe-js\";\r\n\r\nconst getData = getSettings('stripe_p24_data');\r\n\r\nif (getData()) {\r\n registerPaymentMethod({\r\n name: getData('name'),\r\n label: <PaymentMethodLabel\r\n title={getData('title')}\r\n paymentMethod={getData('name')}\r\n icons={getData('icon')}/>,\r\n ariaLabel: 'P24',\r\n placeOrderButtonLabel: getData('placeOrderButtonLabel'),\r\n canMakePayment: canMakePayment(getData),\r\n content: <PaymentMethod\r\n content={LocalPaymentIntentContent}\r\n getData={getData}\r\n confirmationMethod={'confirmP24Payment'}\r\n component={P24BankElement}/>,\r\n edit: <PaymentMethod content={LocalPaymentIntentContent} getData={getData}/>,\r\n supports: {\r\n showSavedCards: false,\r\n showSaveOption: false,\r\n features: getData('features')\r\n }\r\n })\r\n}\r\n","import {registerPaymentMethod} from '@woocommerce/blocks-registry';\r\nimport {getSettings, cartContainsPreOrder, cartContainsSubscription} from \"../util\";\r\nimport {PaymentMethodLabel, PaymentMethod} from \"../../components/checkout\";\r\nimport {canMakePayment, LocalPaymentIntentContent} 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 LocalPaymentMethod = (PaymentMethod) => (props) => {\r\n return (\r\n <>\r\n <PaymentMethod {...props}/>\r\n <div className={'wc-stripe-blocks-mandate sepa-mandate'}\r\n dangerouslySetInnerHTML={{__html: props.getData('mandate')}}/>\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={LocalPaymentIntentContent}\r\n getData={getData}\r\n confirmationMethod={'confirmSepaDebitPayment'}\r\n component={IbanElement}/>,\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 {canMakePayment, LocalPaymentIntentContent} from './local-payment-method';\r\nimport {PaymentMethodLabel, PaymentMethod} from \"../../components/checkout\";\r\n\r\nconst getData = getSettings('stripe_sofort_data');\r\n\r\nconst getConfirmationArgs = (billingData) => {\r\n return {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={LocalPaymentIntentContent}\r\n confirmationMethod={'confirmSofortPayment'}\r\n getData={getData}\r\n callback={getConfirmationArgs}/>,\r\n edit: <PaymentMethod content={LocalPaymentIntentContent} getData={getData}/>,\r\n supports: {\r\n showSavedCards: false,\r\n showSaveOption: false,\r\n features: getData('features')\r\n }\r\n })\r\n}\r\n","import {useEffect, useRef, useState, useCallback} from '@wordpress/element';\r\nimport {registerPaymentMethod} from '@woocommerce/blocks-registry';\r\nimport {\r\n getSettings,\r\n initStripe as loadStripe,\r\n getDefaultSourceArgs,\r\n isAddressValid,\r\n StripeError,\r\n isTestMode,\r\n ensureSuccessResponse,\r\n getErrorMessage,\r\n storeInCache,\r\n getFromCache,\r\n deleteFromCache\r\n} from \"../util\";\r\nimport {PaymentMethodLabel, PaymentMethod} from \"../../components/checkout\";\r\nimport {canMakePayment} from \"./local-payment-method\";\r\nimport {Elements} from \"@stripe/react-stripe-js\";\r\nimport {useValidateCheckout} from \"./hooks\";\r\nimport {__} from '@wordpress/i18n';\r\n//import QRCode from 'QRCode';\r\nimport {useStripe} from \"@stripe/react-stripe-js\";\r\nimport {useStripeError} from \"../hooks\";\r\n\r\nconst getData = getSettings('stripe_wechat_data');\r\n\r\nconst WeChatComponent = (props) => {\r\n return (\r\n <Elements stripe={loadStripe}>\r\n <WeChatPaymentMethod {...props}/>\r\n </Elements>\r\n )\r\n}\r\n\r\nconst WeChatPaymentMethod = (\r\n {\r\n getData,\r\n billing,\r\n shippingData,\r\n emitResponse,\r\n eventRegistration,\r\n components\r\n }) => {\r\n const size = parseInt(getData('qrSize'));\r\n const {responseTypes} = emitResponse;\r\n const {onPaymentProcessing, onCheckoutAfterProcessingWithSuccess} = eventRegistration;\r\n const {ValidationInputError} = components;\r\n const {isValid, setIsValid} = useValidateCheckout({\r\n subscriber: eventRegistration.onPaymentProcessing,\r\n responseTypes: emitResponse.responseTypes,\r\n msg: __('Please scan your QR code to continue with payment.', 'woo-stripe-payment')\r\n });\r\n\r\n const {source, error, deleteSourceFromStorage} = useCreateSource({\r\n getData,\r\n billing,\r\n responseTypes,\r\n subscriber: onPaymentProcessing\r\n })\r\n\r\n /**\r\n * delete the source from storage once payment is successful.\r\n * If test mode, redirect to the Stripe test url.\r\n * If live mode, redirect to the return Url.\r\n */\r\n useEffect(() => {\r\n const unsubscribe = onCheckoutAfterProcessingWithSuccess(() => {\r\n deleteSourceFromStorage();\r\n return ensureSuccessResponse(responseTypes);\r\n });\r\n return () => unsubscribe();\r\n }, [\r\n source,\r\n onCheckoutAfterProcessingWithSuccess,\r\n deleteSourceFromStorage\r\n ]);\r\n\r\n useEffect(() => {\r\n if (source) {\r\n setIsValid(true);\r\n }\r\n }, [source]);\r\n\r\n if (source) {\r\n return (\r\n <QRCodeComponent text={source.wechat.qr_code_url} width={size} height={size}/>\r\n );\r\n } else if (error) {\r\n return (\r\n <div className='wechat-validation-error'>\r\n <ValidationInputError errorMessage={getErrorMessage(error)}/>\r\n </div>\r\n );\r\n } else {\r\n // if billing address is not valid\r\n if (!isAddressValid(billing.billingData)) {\r\n return __('Please fill out all the required fields in order to complete the WeChat payment.', 'woo-stripe-payment');\r\n }\r\n }\r\n return null;\r\n}\r\n\r\nconst QRCodeComponent = (\r\n {\r\n text,\r\n width = 128,\r\n height = 128,\r\n colorDark = '#424770',\r\n colorLight = '#f8fbfd',\r\n correctLevel = QRCode.CorrectLevel.H\r\n }) => {\r\n const el = useRef();\r\n useEffect(() => {\r\n new QRCode(el.current, {\r\n text,\r\n width,\r\n height,\r\n colorDark,\r\n colorLight,\r\n correctLevel\r\n })\r\n }, [el]);\r\n return (\r\n <>\r\n <div id='wc-stripe-block-qrcode' ref={el}></div>\r\n {isTestMode() && <p>\r\n {__('Test mode: Click the Place Order button to proceed.', 'woo-stripe-payment')}\r\n </p>}\r\n {!isTestMode() && <p>\r\n {__('Scan the QR code using your WeChat app. Once scanned click the Place Order button.', 'woo-stripe-payment')}\r\n </p>}\r\n </>\r\n )\r\n}\r\n\r\nconst useCreateSource = (\r\n {\r\n getData,\r\n billing,\r\n responseTypes,\r\n subscriber\r\n }) => {\r\n const stripe = useStripe();\r\n const [error, setError] = useStripeError();\r\n const [source, setSource] = useState(getFromCache('wechat:source'));\r\n const createSourceTimeoutId = useRef(null);\r\n const {cartTotal, billingData, currency} = billing;\r\n\r\n useEffect(() => {\r\n const unsubscribe = subscriber(() => {\r\n return ensureSuccessResponse(responseTypes, {\r\n meta: {\r\n paymentMethodData: {\r\n [`${getData('name')}_token_key`]: source.id\r\n }\r\n }\r\n })\r\n });\r\n return () => unsubscribe();\r\n }, [source, subscriber]);\r\n\r\n const createSource = useCallback(async () => {\r\n // validate the billing fields. If valid, create the source.\r\n try {\r\n if (!error && isAddressValid(billingData)) {\r\n let result = await stripe.createSource(getDefaultSourceArgs({\r\n type: getData('paymentType'),\r\n amount: cartTotal.value,\r\n billingData,\r\n currency: currency.code,\r\n returnUrl: getData('returnUrl')\r\n }));\r\n if (result.error) {\r\n throw new StripeError(result.error);\r\n }\r\n setSource(result.source);\r\n storeInCache('wechat:source', result.source);\r\n }\r\n } catch (err) {\r\n console.log('error: ', err);\r\n setError(err.error);\r\n }\r\n }, [\r\n stripe,\r\n source,\r\n cartTotal.value,\r\n billingData,\r\n currency,\r\n error\r\n ]);\r\n const deleteSourceFromStorage = useCallback(() => {\r\n deleteFromCache('wechat:source');\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (stripe && !source) {\r\n // if there is an existing request, cancel it.\r\n clearTimeout(createSourceTimeoutId.current);\r\n createSourceTimeoutId.current = setTimeout(createSource, 1000);\r\n }\r\n }, [\r\n stripe,\r\n source,\r\n createSource\r\n ]);\r\n\r\n return {source, setSource, error, deleteSourceFromStorage};\r\n}\r\n\r\n\r\nif (getData()) {\r\n registerPaymentMethod({\r\n name: getData('name'),\r\n label: <PaymentMethodLabel\r\n title={getData('title')}\r\n paymentMethod={getData('name')}\r\n icons={getData('icon')}/>,\r\n ariaLabel: 'WeChat',\r\n canMakePayment: canMakePayment(getData),\r\n content: <PaymentMethod content={WeChatComponent} getData={getData}/>,\r\n edit: <PaymentMethod content={WeChatComponent} getData={getData}/>,\r\n supports: {\r\n showSavedCards: false,\r\n showSaveOption: false,\r\n features: getData('features')\r\n }\r\n })\r\n}\r\n","import './style.scss';\r\n\r\nimport './payment-method';","import {useMemo, useEffect, useRef} from '@wordpress/element';\r\nimport {registerExpressPaymentMethod} from '@woocommerce/blocks-registry';\r\nimport {getSettings, initStripe as loadStripe, canMakePayment} from \"../util\";\r\nimport {useBreakpointWidth, useExpressBreakpointWidth} from '../hooks';\r\nimport {Elements, PaymentRequestButtonElement, useStripe} from \"@stripe/react-stripe-js\";\r\nimport {\r\n usePaymentRequest,\r\n useProcessPaymentIntent,\r\n useExportedValues,\r\n useAfterProcessingPayment,\r\n useStripeError\r\n} from '../hooks';\r\n\r\nconst getData = getSettings('stripe_payment_request_data');\r\n\r\nconst PaymentRequestContent = (props) => {\r\n return (\r\n <div className='wc-stripe-payment-request-container'>\r\n <Elements stripe={loadStripe}>\r\n <PaymentRequestButton {...props}/>\r\n </Elements>\r\n </div>\r\n );\r\n}\r\n\r\nconst PaymentRequestButton = (\r\n {\r\n getData,\r\n onClick,\r\n onClose,\r\n billing,\r\n shippingData,\r\n eventRegistration,\r\n emitResponse,\r\n onSubmit,\r\n activePaymentMethod,\r\n ...props\r\n }) => {\r\n const {onPaymentProcessing} = eventRegistration;\r\n const {responseTypes, noticeContexts} = emitResponse;\r\n const stripe = useStripe();\r\n const [error] = useStripeError();\r\n const canPay = (result) => result != null && !result.applePay;\r\n const exportedValues = useExportedValues();\r\n useExpressBreakpointWidth({payment_method: getData('name'), width: 300});\r\n const {setPaymentMethod} = useProcessPaymentIntent({\r\n getData,\r\n billing,\r\n shippingData,\r\n onPaymentProcessing,\r\n emitResponse,\r\n error,\r\n onSubmit,\r\n activePaymentMethod,\r\n exportedValues\r\n });\r\n useAfterProcessingPayment({\r\n getData,\r\n eventRegistration,\r\n responseTypes,\r\n activePaymentMethod,\r\n messageContext: noticeContexts.EXPRESS_PAYMENTS\r\n });\r\n const {paymentRequest} = usePaymentRequest({\r\n getData,\r\n onClose,\r\n stripe,\r\n billing,\r\n shippingData,\r\n eventRegistration,\r\n setPaymentMethod,\r\n exportedValues,\r\n canPay\r\n });\r\n\r\n const options = useMemo(() => {\r\n return {\r\n paymentRequest,\r\n style: {\r\n paymentRequestButton: getData('paymentRequestButton')\r\n }\r\n }\r\n }, [paymentRequest]);\r\n\r\n if (paymentRequest) {\r\n return (\r\n <PaymentRequestButtonElement options={options} onClick={onClick}/>\r\n )\r\n }\r\n return null;\r\n}\r\n\r\nconst PaymentRequestEdit = ({getData, ...props}) => {\r\n const canvas = useRef();\r\n useEffect(() => {\r\n const scale = window.devicePixelRatio;\r\n canvas.current.width = 20 * scale;\r\n canvas.current.height = 20 * scale;\r\n let ctx = canvas.current.getContext('2d');\r\n ctx.scale(scale, scale);\r\n ctx.beginPath();\r\n ctx.arc(10, 10, 10, 0, 2 * Math.PI);\r\n ctx.fillStyle = '#986fff';\r\n ctx.fill();\r\n });\r\n return (\r\n <div className='payment-request-block-editor'>\r\n <div className={'icon-container'}>\r\n <span>Buy now</span>\r\n <canvas className='PaymentRequestButton-icon' ref={canvas}/>\r\n <i className={'payment-request-arrow'}></i>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nregisterExpressPaymentMethod({\r\n name: getData('name'),\r\n canMakePayment: ({cartTotals}) => {\r\n if (getData('isAdmin')) {\r\n return true;\r\n }\r\n const {currency_code: currency, total_price} = cartTotals;\r\n return canMakePayment({\r\n country: getData('countryCode'),\r\n currency: currency.toLowerCase(),\r\n total: {\r\n label: getData('totalLabel'),\r\n amount: parseInt(total_price)\r\n }\r\n }, (result) => result != null && !result.applePay);\r\n },\r\n content: <PaymentRequestContent getData={getData}/>,\r\n edit: <PaymentRequestEdit getData={getData}/>,\r\n supports: {\r\n showSavedCards: getData('showSavedCards'),\r\n showSaveOption: getData('showSaveOption'),\r\n features: getData('features')\r\n }\r\n});","import {useEffect, useCallback} from '@wordpress/element';\r\nimport {initStripe as loadStripe, getSettings, handleCardAction} from '@paymentplugins/stripe/util';\r\n\r\nconst SavedCardComponent = (\r\n {\r\n eventRegistration,\r\n emitResponse,\r\n getData\r\n }) => {\r\n const {onCheckoutAfterProcessingWithSuccess} = eventRegistration;\r\n const {responseTypes} = emitResponse;\r\n const handleSuccessResult = useCallback(async ({redirectUrl}) => {\r\n const stripe = await loadStripe;\r\n return await handleCardAction({redirectUrl, getData, stripe, responseTypes});\r\n }, [onCheckoutAfterProcessingWithSuccess]);\r\n\r\n useEffect(() => {\r\n const unsubscribeOnCheckoutAfterProcessingWithSuccess = onCheckoutAfterProcessingWithSuccess(handleSuccessResult);\r\n return () => unsubscribeOnCheckoutAfterProcessingWithSuccess();\r\n }, [\r\n onCheckoutAfterProcessingWithSuccess\r\n ]);\r\n return null;\r\n}\r\n\r\nexport default SavedCardComponent;\r\n","import {loadStripe} from '@stripe/stripe-js';\r\nimport {getSetting} from '@woocommerce/settings'\r\nimport apiFetch from \"@wordpress/api-fetch\";\r\nimport {getCurrency, formatPrice as wcFormatPrice} from '@woocommerce/price-format';\r\n\r\nconst {publishableKey, account} = getSetting('stripeGeneralData');\r\nconst messages = getSetting('stripeErrorMessages');\r\nconst countryLocale = getSetting('countryLocale', {});\r\n\r\nconst SHIPPING_OPTION_REGEX = /^([\\w]+)\\:(.+)$/;\r\n\r\nconst routes = getSetting('stripeGeneralData').routes;\r\n\r\nconst creditCardForms = {};\r\n\r\nconst localPaymentMethods = [];\r\n\r\nconst CACHE_PREFIX = 'stripe:';\r\n\r\nconst PAYMENT_REQUEST_ADDRESS_MAPPINGS = {\r\n recipient: (address, name) => {\r\n address.first_name = name.split(' ').slice(0, -1).join(' ');\r\n address.last_name = name.split(' ').pop();\r\n return address;\r\n },\r\n payerName: (address, name) => {\r\n address.first_name = name.split(' ').slice(0, -1).join(' ');\r\n address.last_name = name.split(' ').pop();\r\n return address;\r\n },\r\n country: 'country',\r\n addressLine: (address, value) => {\r\n if (value[0]) {\r\n address.address_1 = value[0];\r\n }\r\n if (value[1]) {\r\n address.address_2 = value[1];\r\n }\r\n return address;\r\n },\r\n line1: 'address_1',\r\n line2: 'address_2',\r\n city: 'city',\r\n region: 'state',\r\n state: 'state',\r\n postalCode: 'postcode',\r\n postal_code: 'postcode',\r\n payerEmail: 'email',\r\n payerPhone: 'phone'\r\n}\r\n\r\nexport const initStripe = new Promise((resolve, reject) => {\r\n loadStripe(publishableKey, (() => account ? {stripeAccount: account} : {})()).then(stripe => {\r\n resolve(stripe);\r\n }).catch(err => {\r\n resolve({error: err});\r\n });\r\n});\r\n\r\nexport const registerCreditCardForm = ({id, ...props}) => {\r\n creditCardForms[id] = props;\r\n}\r\n\r\nexport const getCreditCardForm = (id) => {\r\n return creditCardForms.hasOwnProperty(id) ? creditCardForms[id] : {};\r\n}\r\n\r\nexport const getRoute = (route) => {\r\n return routes?.[route] ? routes[route] : console.log(`${route} is not a valid route`);\r\n}\r\n\r\nexport const ensureSuccessResponse = (responseTypes, data = {}) => {\r\n return {type: responseTypes.SUCCESS, ...data};\r\n}\r\n\r\n/**\r\n * Returns a formatted error object used by observers\r\n * @param responseTypes\r\n * @param error\r\n * @returns {{type: *, message: *}}\r\n */\r\nexport const ensureErrorResponse = (responseTypes, error) => {\r\n return {type: responseTypes.ERROR, message: getErrorMessage(error)}\r\n};\r\n\r\n/**\r\n * Return a customized error message.\r\n * @param error\r\n */\r\nexport const getErrorMessage = (error) => {\r\n if (typeof error == 'string') {\r\n return error;\r\n }\r\n if (error?.code && messages?.[error.code]) {\r\n return messages[error.code];\r\n }\r\n if (error?.statusCode) {\r\n return messages?.[error.statusCode] ? messages[error.statusCode] : error.statusMessage;\r\n }\r\n return error.message;\r\n}\r\n\r\n/**\r\n * Return a Stripe formatted billing_details object from a WC address\r\n * @param billingAddress\r\n */\r\nexport const getBillingDetailsFromAddress = (billingAddress) => {\r\n let billing_details = {\r\n name: `${billingAddress.first_name} ${billingAddress.last_name}`,\r\n address: {\r\n city: billingAddress.city || null,\r\n country: billingAddress.country || null,\r\n line1: billingAddress.address_1 || null,\r\n line2: billingAddress.address_2 || null,\r\n postal_code: billingAddress.postcode || null,\r\n state: billingAddress.state || null\r\n }\r\n }\r\n if (billingAddress?.phone) {\r\n billing_details.phone = billingAddress.phone;\r\n }\r\n if (billingAddress?.email) {\r\n billing_details.email = billingAddress.email;\r\n }\r\n return billing_details;\r\n}\r\n\r\nexport const getSettings = (name) => (key) => {\r\n if (key) {\r\n return getSetting(name)[key];\r\n }\r\n return getSetting(name);\r\n}\r\n\r\nexport class StripeError extends Error {\r\n constructor(error) {\r\n super(error.message);\r\n this.error = error;\r\n }\r\n}\r\n\r\n/**\r\n * Returns true if the provided value is empty.\r\n * @param value\r\n * @returns {boolean}\r\n */\r\nexport const isEmpty = (value) => {\r\n if (typeof value === 'string') {\r\n return value.length == 0 || value == '';\r\n }\r\n if (Array.isArray(value)) {\r\n return array.length == 0;\r\n }\r\n if (typeof value === 'object') {\r\n return Object.keys(value).length == 0;\r\n }\r\n if (typeof value === 'undefined') {\r\n return true;\r\n }\r\n return true;\r\n}\r\n\r\nexport const removeNumberPrecision = (value, unit) => {\r\n return value / 10 ** unit;\r\n}\r\n\r\n/**\r\n *\r\n * @param address\r\n * @param country\r\n */\r\nexport const isAddressValid = (address, exclude = []) => {\r\n const fields = getLocaleFields(address.country);\r\n for (const [key, value] of Object.entries(address)) {\r\n if (!exclude.includes(key) && fields?.[key] && fields[key].required) {\r\n if (isEmpty(value)) {\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n}\r\n\r\nexport const getLocaleFields = (country) => {\r\n let localeFields = {...countryLocale.default};\r\n if (country && countryLocale?.[country]) {\r\n localeFields = Object.entries(countryLocale[country]).reduce((locale, [key, value]) => {\r\n locale[key] = {...locale[key], ...value}\r\n return locale;\r\n }, localeFields);\r\n ['phone', 'email'].forEach(key => {\r\n let node = document.getElementById(key);\r\n if (node) {\r\n localeFields[key] = {required: node.required};\r\n }\r\n });\r\n }\r\n return localeFields;\r\n}\r\n\r\n/**\r\n * Return true if the field is required by the cart\r\n * @param field\r\n * @param country\r\n * @returns {boolean|*}\r\n */\r\nexport const isFieldRequired = (field, country = false) => {\r\n const fields = getLocaleFields(country);\r\n return [field] in fields && fields[field].required;\r\n}\r\n\r\nexport const getSelectedShippingOption = (id) => {\r\n const result = id.match(SHIPPING_OPTION_REGEX);\r\n if (result) {\r\n const {1: packageIdx, 2: rate} = result;\r\n return [rate, packageIdx];\r\n }\r\n return [];\r\n}\r\n\r\nexport const hasShippingRates = (shippingRates) => {\r\n return shippingRates.map(rate => {\r\n return rate.shipping_rates.length > 0;\r\n }).filter(Boolean).length > 0;\r\n}\r\n\r\n/**\r\n * Return true if the customer is logged in.\r\n * @param customerId\r\n * @returns {boolean}\r\n */\r\nexport const isUserLoggedIn = (customerId) => {\r\n return customerId > 0;\r\n}\r\n\r\nconst syncPaymentIntentWithOrder = async (order_id, client_secret) => {\r\n try {\r\n await apiFetch({\r\n url: routes['sync/intent'],\r\n method: 'POST',\r\n data: {order_id, client_secret}\r\n })\r\n } catch (error) {\r\n console.log(error);\r\n }\r\n}\r\n\r\nexport const handleCardAction = async (\r\n {\r\n redirectUrl,\r\n responseTypes,\r\n stripe,\r\n getData,\r\n savePaymentMethod = false\r\n }) => {\r\n try {\r\n let match = redirectUrl.match(/#response=(.+)/)\r\n if (match) {\r\n let {client_secret, order_id, order_key} = JSON.parse(window.atob(decodeURIComponent(match[1])));\r\n let result = await stripe.handleCardAction(client_secret);\r\n if (result.error) {\r\n syncPaymentIntentWithOrder(order_id, client_secret);\r\n return ensureErrorResponse(responseTypes, result.error);\r\n }\r\n // success so finish processing order then redirect to thank you page\r\n let data = {order_id, order_key, [`${getData('name')}_save_source_key`]: savePaymentMethod};\r\n let response = await apiFetch({\r\n url: getRoute('process/payment'),\r\n method: 'POST',\r\n data\r\n })\r\n if (response.messages) {\r\n return ensureErrorResponse(responseTypes, response.messages);\r\n }\r\n return ensureSuccessResponse(responseTypes, {\r\n redirectUrl: response.redirect\r\n });\r\n } else {\r\n return ensureSuccessResponse(responseTypes);\r\n }\r\n } catch (err) {\r\n console.log(err);\r\n return ensureErrorResponse(responseTypes, err);\r\n }\r\n}\r\n\r\n/**\r\n * Convert a payment wallet address to a WC cart address.\r\n * @param address_mappings\r\n * @returns {function(*, *=): {}}\r\n */\r\nexport const toCartAddress = (address_mappings = PAYMENT_REQUEST_ADDRESS_MAPPINGS) => (address, args = {}) => {\r\n const cartAddress = {};\r\n address = {...address, ...filterEmptyValues(args)};\r\n for (let [key, cartKey] of Object.entries(address_mappings)) {\r\n if (address?.[key]) {\r\n if (typeof cartKey === 'function') {\r\n cartKey(cartAddress, address[key]);\r\n } else {\r\n cartAddress[cartKey] = address[key];\r\n }\r\n }\r\n }\r\n return cartAddress;\r\n}\r\n\r\n/**\r\n * Given a WC formatted address, return only the intermediate address values\r\n * @param address\r\n * @param fields\r\n */\r\nexport const getIntermediateAddress = (address, fields = ['city', 'postcode', 'state', 'country']) => {\r\n const intermediateAddress = {};\r\n for (let key of fields) {\r\n intermediateAddress[key] = address[key];\r\n }\r\n return intermediateAddress;\r\n}\r\n\r\n/**\r\n *\r\n * @param values\r\n * @returns {{}|{[p: string]: *}}\r\n */\r\nexport const filterEmptyValues = (values) => {\r\n return Object.keys(values).filter(key => Boolean(values[key])).reduce((obj, key) => ({\r\n ...obj,\r\n [key]: values[key]\r\n }), {});\r\n}\r\n\r\nexport const formatPrice = (price, currencyCode) => {\r\n const {prefix, suffix, decimalSeparator, minorUnit, thousandSeparator} = getCurrency(currencyCode);\r\n if (price == '' || price === undefined) {\r\n return price;\r\n }\r\n\r\n price = typeof price === 'string' ? parseInt(price, 10) : price;\r\n price = price / 10 ** minorUnit;\r\n price = price.toString().replace('.', decimalSeparator);\r\n let fractional = '';\r\n const index = price.indexOf(decimalSeparator);\r\n if (index < 0) {\r\n if (minorUnit > 0) {\r\n price += `${decimalSeparator}${new Array(minorUnit + 1).join('0')}`;\r\n }\r\n } else {\r\n fractional = price.substr(index + 1);\r\n if (fractional.length < minorUnit) {\r\n price += new Array(minorUnit - fractional.length + 1).join('0');\r\n }\r\n }\r\n\r\n // separate out price and decimals so thousands separator can be added.\r\n const match = price.match(new RegExp(`(\\\\d+)\\\\${decimalSeparator}(\\\\d+)`));\r\n if (match) {\r\n ({1: price, 2: fractional} = match);\r\n }\r\n price = price.replace(new RegExp(`\\\\B(?=(\\\\d{3})+(?!\\\\d))`, 'g'), `${thousandSeparator}`);\r\n price = fractional?.length > 0 ? price + decimalSeparator + fractional : price;\r\n price = prefix + price + suffix;\r\n return price;\r\n}\r\n\r\nexport const getShippingOptions = (shippingRates) => {\r\n let options = [];\r\n shippingRates.forEach((shippingPackage, idx) => {\r\n // sort by selected rate\r\n shippingPackage.shipping_rates.sort((rate) => {\r\n return rate.selected ? -1 : 1;\r\n });\r\n let rates = shippingPackage.shipping_rates.map(rate => {\r\n let txt = document.createElement('textarea');\r\n txt.innerHTML = rate.name;\r\n let price = formatPrice(rate.price, rate.currency_code);\r\n return {\r\n id: getShippingOptionId(idx, rate.rate_id),\r\n label: txt.value,\r\n //detail: `${price}`,\r\n amount: parseInt(rate.price, 10)\r\n }\r\n });\r\n options = [...options, ...rates];\r\n });\r\n return options;\r\n}\r\n\r\nexport const getShippingOptionId = (packageId, rateId) => `${packageId}:${rateId}`\r\n\r\nexport const getDisplayItems = (cartItems, {minorUnit}) => {\r\n let items = [];\r\n const keys = ['total_tax', 'total_shipping'];\r\n cartItems.forEach(item => {\r\n if (0 < item.value || (item.key && keys.includes(item.key))) {\r\n items.push({\r\n label: item.label,\r\n pending: false,\r\n amount: item.value\r\n });\r\n }\r\n })\r\n return items;\r\n}\r\n\r\nconst canPay = {};\r\n\r\nexport const canMakePayment = ({country, currency, total}, callback) => {\r\n return new Promise((resolve, reject) => {\r\n const key = [country, currency, total.amount].reduce((key, value) => `${key}-${value}`);\r\n if (!currency) {\r\n return resolve(false);\r\n }\r\n if (key in canPay) {\r\n return resolve(canPay[key]);\r\n }\r\n return initStripe.then(stripe => {\r\n if (stripe.error) {\r\n return reject(stripe.error);\r\n }\r\n const request = stripe.paymentRequest({\r\n country,\r\n currency,\r\n total\r\n });\r\n request.canMakePayment().then(result => {\r\n canPay[key] = callback(result);\r\n return resolve(canPay[key]);\r\n });\r\n }).catch(reject);\r\n });\r\n};\r\n\r\nexport const registerLocalPaymentMethod = (paymentMethod) => {\r\n localPaymentMethods.push(paymentMethod);\r\n}\r\n\r\nexport const getLocalPaymentMethods = () => localPaymentMethods;\r\n\r\nexport const cartContainsPreOrder = () => {\r\n const data = getSetting('stripePaymentData');\r\n return data && data.pre_order;\r\n}\r\n\r\nexport const cartContainsSubscription = () => {\r\n const data = getSetting('stripePaymentData');\r\n return data && data.subscription;\r\n}\r\n\r\nexport const getDefaultSourceArgs = ({type, amount, billingData, currency, returnUrl}) => {\r\n return {\r\n type,\r\n amount,\r\n currency,\r\n owner: getBillingDetailsFromAddress(billingData),\r\n redirect: {\r\n return_url: returnUrl\r\n }\r\n }\r\n}\r\n\r\nexport const isTestMode = () => {\r\n return getSetting('stripeGeneralData').mode === 'test';\r\n}\r\n\r\nconst getCacheKey = (key) => `${CACHE_PREFIX}${key}`;\r\n\r\nexport const storeInCache = (key, value) => {\r\n const exp = Math.floor(new Date().getTime() / 1000) + (60 * 15);\r\n if ('sessionStorage' in window) {\r\n sessionStorage.setItem(getCacheKey(key), JSON.stringify({value, exp}));\r\n }\r\n}\r\n\r\nexport const getFromCache = (key) => {\r\n if ('sessionStorage' in window) {\r\n try {\r\n const item = JSON.parse(sessionStorage.getItem(getCacheKey(key)));\r\n if (item) {\r\n const {value, exp} = item;\r\n if (Math.floor(new Date().getTime() / 1000) > exp) {\r\n deleteFromCache(getCacheKey(key));\r\n } else {\r\n return value;\r\n }\r\n }\r\n } catch (err) {\r\n }\r\n }\r\n return null;\r\n}\r\n\r\nexport const deleteFromCache = (key) => {\r\n if ('sessionStorage' in window) {\r\n sessionStorage.removeItem(getCacheKey(key));\r\n }\r\n}\r\n\r\nexport const versionCompare = (ver1, ver2, compare) => {\r\n switch (compare) {\r\n case '<':\r\n return ver1 < ver2;\r\n case '>':\r\n return ver1 > ver2;\r\n case '<=':\r\n return ver1 <= ver2;\r\n case '>=':\r\n return ver1 >= ver2;\r\n case '=':\r\n return ver1 == ver2;\r\n }\r\n return false;\r\n}\r\n\r\nexport const isCartPage = () => getSetting('stripeGeneralData').page === 'cart';\r\n\r\nexport const isCheckoutPage = () => getSetting('stripeGeneralData').page === 'checkout';","/*!\n Copyright (c) 2017 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg) && arg.length) {\n\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\tif (inner) {\n\t\t\t\t\tclasses.push(inner);\n\t\t\t\t}\n\t\t\t}