Version Description
- 2021-02-05 =
- Fix - Checkout and cart blocks aren't usable in editor when WooCommerce Payments is enabled.
- Fix - Missing global config error in Checkout block integration, and incompatibility with latest block API.
Download this release
Release Info
Developer | automattic |
Plugin | WooCommerce Payments – Fully Integrated Solution Built and Supported by Woo |
Version | 1.9.2 |
Comparing to | |
See all releases |
Code changes from version 1.9.1 to 1.9.2
- changelog.txt +4 -0
- dist/blocks-checkout.asset.php +1 -1
- dist/blocks-checkout.js +1 -1
- dist/checkout.asset.php +1 -1
- dist/checkout.js +1 -1
- includes/class-wc-payment-gateway-wcpay.php +1 -0
- includes/class-wc-payments-blocks-payment-method.php +8 -0
- readme.txt +5 -1
- vendor/autoload.php +1 -1
- vendor/autoload_packages.php +1 -1
- vendor/composer/InstalledVersions.php +6 -6
- vendor/composer/autoload_real.php +7 -7
- vendor/composer/autoload_static.php +4 -4
- vendor/composer/installed.php +6 -6
- vendor/jetpack-autoloader/class-autoloader-handler.php +1 -1
- vendor/jetpack-autoloader/class-autoloader-locator.php +1 -1
- vendor/jetpack-autoloader/class-autoloader.php +1 -1
- vendor/jetpack-autoloader/class-container.php +1 -1
- vendor/jetpack-autoloader/class-hook-manager.php +1 -1
- vendor/jetpack-autoloader/class-latest-autoloader-guard.php +1 -1
- vendor/jetpack-autoloader/class-manifest-reader.php +1 -1
- vendor/jetpack-autoloader/class-path-processor.php +1 -1
- vendor/jetpack-autoloader/class-plugin-locator.php +1 -1
- vendor/jetpack-autoloader/class-plugins-handler.php +1 -1
- vendor/jetpack-autoloader/class-version-loader.php +1 -1
- vendor/jetpack-autoloader/class-version-selector.php +1 -1
- woocommerce-payments.php +1 -1
changelog.txt
CHANGED
@@ -1,5 +1,9 @@
|
|
1 |
*** WooCommerce Payments Changelog ***
|
2 |
|
|
|
|
|
|
|
|
|
3 |
= 1.9.1 - 2021-02-03 =
|
4 |
* Fix - Incompatibility with WC Subscriptions.
|
5 |
* Fix - Missing order causing broken transactions list.
|
1 |
*** WooCommerce Payments Changelog ***
|
2 |
|
3 |
+
= 1.9.2 - 2021-02-05 =
|
4 |
+
* Fix - Checkout and cart blocks aren't usable in editor when WooCommerce Payments is enabled.
|
5 |
+
* Fix - Missing global config error in Checkout block integration, and incompatibility with latest block API.
|
6 |
+
|
7 |
= 1.9.1 - 2021-02-03 =
|
8 |
* Fix - Incompatibility with WC Subscriptions.
|
9 |
* Fix - Missing order causing broken transactions list.
|
dist/blocks-checkout.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('react', 'wc-blocks-registry', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('react', 'wc-blocks-registry', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '18625ddbf4eb52358944cc33b9979cde');
|
dist/blocks-checkout.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(e,t){for(var n in t)e[n]=t[n]}(this,function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=87)}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},17:function(e,t){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}},2:function(e,t,n){var r=n(17);e.exports=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),o.forEach((function(t){r(e,t,n[t])}))}return e}},24:function(e,t,n){var r=n(40),o=n(41),i=n(42);e.exports=function(e,t){return r(e)||o(e,t)||i()}},25:function(e,t){!function(){e.exports=this.React}()},27:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return o}));var r=function(e){return(wcpay_config||wc.wcSettings.getSetting("woocommerce_payments_data"))[e]||null},o=function(e,t){if("undefined"!=typeof wcpay_config)wcpay_config[e]=t;else{var n=wc.wcSettings.getSetting("woocommerce_payments_data");n[e]=t,wc.wcSettings.setSetting("woocommerce_payments_data",n)}}},29:function(e,t){function n(e,t,n,r,o,i,u){try{var a=e[i](u),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}e.exports=function(e){return function(){var t=this,r=arguments;return new Promise((function(o,i){var u=e.apply(t,r);function a(e){n(u,o,i,a,c,"next",e)}function c(e){n(u,o,i,a,c,"throw",e)}a(void 0)}))}}},31:function(e,t){function n(){return e.exports=n=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},n.apply(this,arguments)}e.exports=n},33:function(e,t,n){"use strict";var r={};n.r(r),n.d(r,"src",(function(){return i})),n.d(r,"init",(function(){return u}));var o={};n.r(o),n.d(o,"src",(function(){return a}));var i="https://cdn.sift.com/s.js",u=function(e){var t=e.beacon_key,n=e.session_id,r=e.user_id,o=window._sift=window._sift||[];o.push(["_setAccount",t]),o.push(["_setUserId",r]),o.push(["_setSessionId",n]),o.push(["_trackPageview"])},a="https://js.stripe.com/v3",c={sift:r,stripe:o};t.a=function(e){for(var t in e){var n=c[t];if(n&&e[t]&&(n.init&&n.init(e[t]),!document.querySelector('[src="'.concat(n.src,'"]')))){var r=document.createElement("script");r.src=n.src,r.async=!0,document.body.appendChild(r)}}}},36:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r="woocommerce_payments"},40:function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},41:function(e,t){e.exports=function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var u,a=e[Symbol.iterator]();!(r=(u=a.next()).done)&&(n.push(u.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==a.return||a.return()}finally{if(o)throw i}}return n}},42:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},47:function(e,t,n){var r=n(63);e.exports=function(e,t){if(null==e)return{};var n,o,i=r(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(o=0;o<u.length;o++)n=u[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}},5:function(e,t){!function(){e.exports=this.regeneratorRuntime}()},52:function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},53:function(e,t){function n(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,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}},58:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(24),o=n.n(r),i=n(2),u=n.n(i),a=n(52),c=n.n(a),s=n(53),p=n.n(s),f=n(27),l=function(){function e(t,n){c()(this,e),this.options=t,this.stripe=null,this.request=n}return p()(e,[{key:"getStripe",value:function(){if(!this.stripe){var e=this.options,t=e.publishableKey,n=e.accountId;this.stripe=new Stripe(t,{stripeAccount:n})}return this.stripe}},{key:"generatePaymentMethodRequest",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getStripe();return new(function(){function r(){c()(this,r),this.args=u()(u()({type:"card"},e),{},{billing_details:{address:{}}})}return p()(r,[{key:"prepareValue",value:function(e,n){if(void 0!==n&&0!==n.length||(n=t[e]),void 0!==n&&0<n.length)return n}},{key:"setBillingDetail",value:function(e,t){var n=this.prepareValue(e,t);void 0!==n&&(this.args.billing_details[e]=n)}},{key:"setAddressDetail",value:function(e,t){var n=this.prepareValue(e,t);void 0!==n&&(this.args.billing_details.address[e]=n)}},{key:"send",value:function(){return n.createPaymentMethod(this.args).then((function(e){if(e.error)throw e.error;return e}))}}]),r}())}},{key:"confirmIntent",value:function(e,t){var n=this,r=e.match(/#wcpay-confirm-(pi|si):(.+):(.+):(.+)$/);if(!r)return!0;var i="si"===r[1],u=r[2],a=r[3];Object(f.b)("updateOrderStatusNonce",r[4]);var c=e.indexOf("order-pay"),s=-1<c,p=s&&e.substring(c).match(/\d+/);return p&&(u=p[0]),{request:(i?this.getStripe().confirmCardSetup(a):this.getStripe().confirmCardPayment(a)).then((function(e){var r=e.paymentIntent&&e.paymentIntent.id||e.setupIntent&&e.setupIntent.id||e.error&&e.error.payment_intent&&e.error.payment_intent.id||e.error.setup_intent&&e.error.setup_intent.id;return[n.request(Object(f.a)("ajaxUrl"),{action:"update_order_status",order_id:u,_ajax_nonce:Object(f.a)("updateOrderStatusNonce"),intent_id:r,payment_method_id:t||null}),e.error]})).then((function(e){var t=o()(e,2),n=t[0],r=t[1];if(r)throw r;return n.then((function(e){var t=JSON.parse(e);if(t.error)throw t.error;return t.return_url}))})),isOrderPage:s}}},{key:"setupIntent",value:function(e){var t=this;return this.request(Object(f.a)("ajaxUrl"),{action:"create_setup_intent","wcpay-payment-method":e,_ajax_nonce:Object(f.a)("createSetupIntentNonce")}).then((function(e){if(!e.success)throw e.data.error;return"succeeded"===e.data.status?e.data:t.getStripe().confirmCardSetup(e.data.client_secret).then((function(e){var t=e.setupIntent,n=e.error;if(n)throw n;return t}))}))}}]),e}()},59: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,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var u,a=e[Symbol.iterator]();!(r=(u=a.next()).done)&&(n.push(u.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==a.return||a.return()}finally{if(o)throw i}}return n}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function i(){}function u(){}t=t&&t.hasOwnProperty("default")?t.default:t,u.resetWarningCache=i;var a=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){e.exports=function(){function e(e,t,n,r,o,i){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==i){var u=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 u.name="Invariant Violation",u}}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:u,resetWarningCache:i};return n.PropTypes=n,n}()})),c=function(e){return null!==e&&"object"===n(e)},s=function e(t,n){if(!c(t)||!c(n))return t===n;var r=Array.isArray(t);if(r!==Array.isArray(n))return!1;var o="[object Object]"===Object.prototype.toString.call(t);if(o!==("[object Object]"===Object.prototype.toString.call(n)))return!1;if(!o&&!r)return!1;var i=Object.keys(t),u=Object.keys(n);if(i.length!==u.length)return!1;for(var a={},s=0;s<i.length;s+=1)a[i[s]]=!0;for(var p=0;p<u.length;p+=1)a[u[p]]=!0;var f=Object.keys(a);if(f.length!==i.length)return!1;var l=t,d=n;return f.every((function(t){return e(l[t],d[t])}))},p=function(e){var n=t.useRef(e);return t.useEffect((function(){n.current=e}),[e]),n.current},f=function(e){if(null===e||c(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.")},l=function(e){if(function(e){return c(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}},d=t.createContext(null);d.displayName="ElementsContext";var y=function(e){var n=e.stripe,r=e.options,i=e.children,u=t.useRef(!1),a=t.useRef(!0),c=t.useMemo((function(){return l(n)}),[n]),f=o(t.useState((function(){return{stripe:null,elements:null}})),2),y=f[0],m=f[1],h=p(n),v=p(r);return null!==h&&(h!==n&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it."),s(r,v)||console.warn("Unsupported prop change on Elements: You cannot change the `options` prop after setting the `stripe` prop.")),u.current||("sync"===c.tag&&(u.current=!0,m({stripe:c.stripe,elements:c.stripe.elements(r)})),"async"===c.tag&&(u.current=!0,c.stripePromise.then((function(e){e&&a.current&&m({stripe:e,elements:e.elements(r)})})))),t.useEffect((function(){return function(){a.current=!1}}),[]),t.useEffect((function(){var e=y.stripe;e&&e._registerWrapper&&e._registerWrapper({name:"react-stripe-js",version:"1.1.2"})}),[y.stripe]),t.createElement(d.Provider,{value:y},i)};y.propTypes={stripe:a.any,options:a.object};var m=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(d),e)},h=function(e){return(0,e.children)(m("mounts <ElementsConsumer>"))};h.propTypes={children:a.func.isRequired};var v=function(e){var n=t.useRef(e);return t.useEffect((function(){n.current=e}),[e]),function(){n.current&&n.current.apply(n,arguments)}},b=function(e){return c(e)?(e.paymentRequest,r(e,["paymentRequest"])):{}},g=function(){},O=function(e,n){var r,o="".concat((r=e).charAt(0).toUpperCase()+r.slice(1),"Element"),i=n?function(e){m("mounts <".concat(o,">"));var n=e.id,r=e.className;return t.createElement("div",{id:n,className:r})}:function(n){var r=n.id,i=n.className,u=n.options,a=void 0===u?{}:u,c=n.onBlur,p=void 0===c?g:c,f=n.onFocus,l=void 0===f?g:f,d=n.onReady,y=void 0===d?g:d,h=n.onChange,O=void 0===h?g:h,w=n.onEscape,j=void 0===w?g:w,_=n.onClick,E=void 0===_?g:_,x=m("mounts <".concat(o,">")).elements,S=t.useRef(null),P=t.useRef(null),k=v(y),C=v(p),R=v(l),I=v(E),A=v(O),T=v(j);t.useLayoutEffect((function(){if(null==S.current&&x&&null!=P.current){var t=x.create(e,a);S.current=t,t.mount(P.current),t.on("ready",(function(){return k(t)})),t.on("change",A),t.on("blur",C),t.on("focus",R),t.on("escape",T),t.on("click",I)}}));var D=t.useRef(a);return t.useEffect((function(){D.current&&D.current.paymentRequest!==a.paymentRequest&&console.warn("Unsupported prop change: options.paymentRequest is not a customizable property.");var e=b(a);0===Object.keys(e).length||s(e,b(D.current))||S.current&&(S.current.update(e),D.current=a)}),[a]),t.useEffect((function(){return function(){S.current&&S.current.destroy()}}),[]),t.createElement("div",{id:r,className:i,ref:P})};return i.propTypes={id:a.string,className:a.string,onChange:a.func,onBlur:a.func,onFocus:a.func,onReady:a.func,onClick:a.func,options:a.object},i.displayName=o,i.__elementType=e,i},w="undefined"==typeof window,j=O("auBankAccount",w),_=O("card",w),E=O("cardNumber",w),x=O("cardExpiry",w),S=O("cardCvc",w),P=O("fpxBank",w),k=O("iban",w),C=O("idealBank",w),R=O("paymentRequestButton",w);e.AuBankAccountElement=j,e.CardCvcElement=S,e.CardElement=_,e.CardExpiryElement=x,e.CardNumberElement=E,e.Elements=y,e.ElementsConsumer=h,e.FpxBankElement=P,e.IbanElement=k,e.IdealBankElement=C,e.PaymentRequestButtonElement=R,e.useElements=function(){return m("calls useElements()").elements},e.useStripe=function(){return m("calls useStripe()").stripe},Object.defineProperty(e,"__esModule",{value:!0})}(t,n(25))},63:function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}},73:function(e,t){!function(){e.exports=this.wc.wcBlocksRegistry}()},87:function(e,t,n){"use strict";n.r(t);var r=n(0),o=n(1),i=n(73),u=n(36),a=n(27),c=n(58),s=n(31),p=n.n(s),f=n(47),l=n.n(f),d=n(24),y=n.n(d),m=n(59),h=n(5),v=n.n(h),b=n(29),g=n.n(b),O=function(){var e=g()(v.a.mark((function e(t,n,r){var o,i,a;return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(o=t.generatePaymentMethodRequest(n)).setBillingDetail("name",(r.first_name+" "+r.last_name).trim()),o.setBillingDetail("email",r.email),o.setBillingDetail("phone",r.phone),o.setAddressDetail("city",r.city),o.setAddressDetail("country",r.country),o.setAddressDetail("line1",r.address_1),o.setAddressDetail("line2",r.address_2),o.setAddressDetail("postal_code",r.postcode),o.setAddressDetail("state",r.state),e.prev=10,e.next=13,o.send();case 13:return i=e.sent,a=i.paymentMethod.id,e.abrupt("return",{type:"success",meta:{paymentMethodData:{paymentMethod:u.a,"wcpay-payment-method":a}}});case 18:return e.prev=18,e.t0=e.catch(10),e.abrupt("return",{type:"error",message:e.t0.message});case 21:case"end":return e.stop()}}),e,null,[[10,18]])})));return function(t,n,r){return e.apply(this,arguments)}}();function w(){return(w=g()(v.a.mark((function e(t,n,r){var o,i,u,a;return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=n.redirect,e.prev=1,!0!==(i=t.confirmIntent(o))){e.next=5;break}return e.abrupt("return",{type:"success",redirectUrl:o});case 5:return u=i.request,e.next=8,u;case 8:return a=e.sent,e.abrupt("return",{type:"success",redirectUrl:a});case 12:return e.prev=12,e.t0=e.catch(1),e.abrupt("return",{type:"error",message:e.t0.message,messageContext:r.noticeContexts.PAYMENTS});case 15:case"end":return e.stop()}}),e,null,[[1,12]])})))).apply(this,arguments)}var j=function(e){var t=e.api,n=e.activePaymentMethod,o=e.stripe,i=e.elements,a=e.billing.billingData,c=e.eventRegistration,s=c.onPaymentProcessing,p=c.onCheckoutAfterProcessingWithSuccess,f=e.emitResponse,l=Object(r.useState)(null),d=y()(l,2),h=d[0],v=d[1];Object(r.useEffect)((function(){return s((function(){if(u.a===n){if(h)return{type:"error",message:h};var e=i.getElement(m.CardElement);return O(t,{card:e},a)}}))}),[i,o,n]),Object(r.useEffect)((function(){return p((function(e){var n=e.processingResponse.paymentDetails;return function(e,t,n){return w.apply(this,arguments)}(t,n,f)}))}),[i,o]);return Object(r.createElement)(m.CardElement,{options:{hidePostalCode:!0,classes:{base:"wcpay-card-mounted"}},onChange:function(e){var t=e.error;v(t?t.message:null)}})},_=function(e){var t=e.api,n=l()(e,["api"]);return Object(r.createElement)(m.Elements,{stripe:t.getStripe()},Object(r.createElement)(m.ElementsConsumer,null,(function(e){var o=e.elements,i=e.stripe;return Object(r.createElement)(j,p()({api:t,elements:o,stripe:i},n))})))};function E(){return(E=g()(v.a.mark((function e(t,n){var r,o,i;return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(o in r=new FormData,n)r.append(o,n[o]);return e.next=4,fetch(t,{method:"POST",body:r});case 4:return i=e.sent,e.abrupt("return",i.text());case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var x=n(33),S=new c.a({publishableKey:Object(a.a)("publishableKey"),accountId:Object(a.a)("accountId")},(function(e,t){return E.apply(this,arguments)}));Object(i.registerPaymentMethod)((function(e){return new e({name:u.a,content:Object(r.createElement)(_,{api:S}),edit:Object(r.createElement)(_,{api:S}),canMakePayment:function(){return!!S.getStripe()},paymentMethodId:u.a,label:Object(o.__)("Credit Card","woocommerce-payments"),ariaLabel:Object(o.__)("Credit Card","woocommerce-payments")})})),window.addEventListener("load",(function(){Object(x.a)(Object(a.a)("fraudServices"))}))}}));
|
1 |
+
!function(e,t){for(var n in t)e[n]=t[n]}(this,function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=87)}({0:function(e,t){!function(){e.exports=this.wp.element}()},1:function(e,t){!function(){e.exports=this.wp.i18n}()},17:function(e,t){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}},2:function(e,t,n){var r=n(17);e.exports=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),o.forEach((function(t){r(e,t,n[t])}))}return e}},24:function(e,t,n){var r=n(40),o=n(41),i=n(42);e.exports=function(e,t){return r(e)||o(e,t)||i()}},25:function(e,t){!function(){e.exports=this.React}()},27:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return o}));var r=function(e){return("undefined"!=typeof wcpay_config?wcpay_config:wc.wcSettings.getSetting("woocommerce_payments_data"))[e]||null},o=function(e,t){if("undefined"!=typeof wcpay_config)wcpay_config[e]=t;else{var n=wc.wcSettings.getSetting("woocommerce_payments_data");n[e]=t,wc.wcSettings.setSetting("woocommerce_payments_data",n)}}},29:function(e,t){function n(e,t,n,r,o,i,u){try{var a=e[i](u),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}e.exports=function(e){return function(){var t=this,r=arguments;return new Promise((function(o,i){var u=e.apply(t,r);function a(e){n(u,o,i,a,c,"next",e)}function c(e){n(u,o,i,a,c,"throw",e)}a(void 0)}))}}},31:function(e,t){function n(){return e.exports=n=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},n.apply(this,arguments)}e.exports=n},33:function(e,t,n){"use strict";var r={};n.r(r),n.d(r,"src",(function(){return i})),n.d(r,"init",(function(){return u}));var o={};n.r(o),n.d(o,"src",(function(){return a}));var i="https://cdn.sift.com/s.js",u=function(e){var t=e.beacon_key,n=e.session_id,r=e.user_id,o=window._sift=window._sift||[];o.push(["_setAccount",t]),o.push(["_setUserId",r]),o.push(["_setSessionId",n]),o.push(["_trackPageview"])},a="https://js.stripe.com/v3",c={sift:r,stripe:o};t.a=function(e){for(var t in e){var n=c[t];if(n&&e[t]&&(n.init&&n.init(e[t]),!document.querySelector('[src="'.concat(n.src,'"]')))){var r=document.createElement("script");r.src=n.src,r.async=!0,document.body.appendChild(r)}}}},36:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r="woocommerce_payments"},40:function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},41:function(e,t){e.exports=function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var u,a=e[Symbol.iterator]();!(r=(u=a.next()).done)&&(n.push(u.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==a.return||a.return()}finally{if(o)throw i}}return n}},42:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},47:function(e,t,n){var r=n(63);e.exports=function(e,t){if(null==e)return{};var n,o,i=r(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(o=0;o<u.length;o++)n=u[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}},5:function(e,t){!function(){e.exports=this.regeneratorRuntime}()},52:function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},53:function(e,t){function n(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,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}},58:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(24),o=n.n(r),i=n(2),u=n.n(i),a=n(52),c=n.n(a),s=n(53),p=n.n(s),f=n(27),l=function(){function e(t,n){c()(this,e),this.options=t,this.stripe=null,this.request=n}return p()(e,[{key:"getStripe",value:function(){if(!this.stripe){var e=this.options,t=e.publishableKey,n=e.accountId;this.stripe=new Stripe(t,{stripeAccount:n})}return this.stripe}},{key:"generatePaymentMethodRequest",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getStripe();return new(function(){function r(){c()(this,r),this.args=u()(u()({type:"card"},e),{},{billing_details:{address:{}}})}return p()(r,[{key:"prepareValue",value:function(e,n){if(void 0!==n&&0!==n.length||(n=t[e]),void 0!==n&&0<n.length)return n}},{key:"setBillingDetail",value:function(e,t){var n=this.prepareValue(e,t);void 0!==n&&(this.args.billing_details[e]=n)}},{key:"setAddressDetail",value:function(e,t){var n=this.prepareValue(e,t);void 0!==n&&(this.args.billing_details.address[e]=n)}},{key:"send",value:function(){return n.createPaymentMethod(this.args).then((function(e){if(e.error)throw e.error;return e}))}}]),r}())}},{key:"confirmIntent",value:function(e,t){var n=this,r=e.match(/#wcpay-confirm-(pi|si):(.+):(.+):(.+)$/);if(!r)return!0;var i="si"===r[1],u=r[2],a=r[3];Object(f.b)("updateOrderStatusNonce",r[4]);var c=e.indexOf("order-pay"),s=-1<c,p=s&&e.substring(c).match(/\d+/);return p&&(u=p[0]),{request:(i?this.getStripe().confirmCardSetup(a):this.getStripe().confirmCardPayment(a)).then((function(e){var r=e.paymentIntent&&e.paymentIntent.id||e.setupIntent&&e.setupIntent.id||e.error&&e.error.payment_intent&&e.error.payment_intent.id||e.error.setup_intent&&e.error.setup_intent.id;return[n.request(Object(f.a)("ajaxUrl"),{action:"update_order_status",order_id:u,_ajax_nonce:Object(f.a)("updateOrderStatusNonce"),intent_id:r,payment_method_id:t||null}),e.error]})).then((function(e){var t=o()(e,2),n=t[0],r=t[1];if(r)throw r;return n.then((function(e){var t=JSON.parse(e);if(t.error)throw t.error;return t.return_url}))})),isOrderPage:s}}},{key:"setupIntent",value:function(e){var t=this;return this.request(Object(f.a)("ajaxUrl"),{action:"create_setup_intent","wcpay-payment-method":e,_ajax_nonce:Object(f.a)("createSetupIntentNonce")}).then((function(e){if(!e.success)throw e.data.error;return"succeeded"===e.data.status?e.data:t.getStripe().confirmCardSetup(e.data.client_secret).then((function(e){var t=e.setupIntent,n=e.error;if(n)throw n;return t}))}))}}]),e}()},59: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,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var u,a=e[Symbol.iterator]();!(r=(u=a.next()).done)&&(n.push(u.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==a.return||a.return()}finally{if(o)throw i}}return n}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function i(){}function u(){}t=t&&t.hasOwnProperty("default")?t.default:t,u.resetWarningCache=i;var a=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){e.exports=function(){function e(e,t,n,r,o,i){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==i){var u=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 u.name="Invariant Violation",u}}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:u,resetWarningCache:i};return n.PropTypes=n,n}()})),c=function(e){return null!==e&&"object"===n(e)},s=function e(t,n){if(!c(t)||!c(n))return t===n;var r=Array.isArray(t);if(r!==Array.isArray(n))return!1;var o="[object Object]"===Object.prototype.toString.call(t);if(o!==("[object Object]"===Object.prototype.toString.call(n)))return!1;if(!o&&!r)return!1;var i=Object.keys(t),u=Object.keys(n);if(i.length!==u.length)return!1;for(var a={},s=0;s<i.length;s+=1)a[i[s]]=!0;for(var p=0;p<u.length;p+=1)a[u[p]]=!0;var f=Object.keys(a);if(f.length!==i.length)return!1;var l=t,d=n;return f.every((function(t){return e(l[t],d[t])}))},p=function(e){var n=t.useRef(e);return t.useEffect((function(){n.current=e}),[e]),n.current},f=function(e){if(null===e||c(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.")},l=function(e){if(function(e){return c(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}},d=t.createContext(null);d.displayName="ElementsContext";var y=function(e){var n=e.stripe,r=e.options,i=e.children,u=t.useRef(!1),a=t.useRef(!0),c=t.useMemo((function(){return l(n)}),[n]),f=o(t.useState((function(){return{stripe:null,elements:null}})),2),y=f[0],m=f[1],h=p(n),v=p(r);return null!==h&&(h!==n&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it."),s(r,v)||console.warn("Unsupported prop change on Elements: You cannot change the `options` prop after setting the `stripe` prop.")),u.current||("sync"===c.tag&&(u.current=!0,m({stripe:c.stripe,elements:c.stripe.elements(r)})),"async"===c.tag&&(u.current=!0,c.stripePromise.then((function(e){e&&a.current&&m({stripe:e,elements:e.elements(r)})})))),t.useEffect((function(){return function(){a.current=!1}}),[]),t.useEffect((function(){var e=y.stripe;e&&e._registerWrapper&&e._registerWrapper({name:"react-stripe-js",version:"1.1.2"})}),[y.stripe]),t.createElement(d.Provider,{value:y},i)};y.propTypes={stripe:a.any,options:a.object};var m=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(d),e)},h=function(e){return(0,e.children)(m("mounts <ElementsConsumer>"))};h.propTypes={children:a.func.isRequired};var v=function(e){var n=t.useRef(e);return t.useEffect((function(){n.current=e}),[e]),function(){n.current&&n.current.apply(n,arguments)}},b=function(e){return c(e)?(e.paymentRequest,r(e,["paymentRequest"])):{}},g=function(){},O=function(e,n){var r,o="".concat((r=e).charAt(0).toUpperCase()+r.slice(1),"Element"),i=n?function(e){m("mounts <".concat(o,">"));var n=e.id,r=e.className;return t.createElement("div",{id:n,className:r})}:function(n){var r=n.id,i=n.className,u=n.options,a=void 0===u?{}:u,c=n.onBlur,p=void 0===c?g:c,f=n.onFocus,l=void 0===f?g:f,d=n.onReady,y=void 0===d?g:d,h=n.onChange,O=void 0===h?g:h,w=n.onEscape,j=void 0===w?g:w,_=n.onClick,E=void 0===_?g:_,x=m("mounts <".concat(o,">")).elements,S=t.useRef(null),P=t.useRef(null),k=v(y),C=v(p),R=v(l),I=v(E),A=v(O),T=v(j);t.useLayoutEffect((function(){if(null==S.current&&x&&null!=P.current){var t=x.create(e,a);S.current=t,t.mount(P.current),t.on("ready",(function(){return k(t)})),t.on("change",A),t.on("blur",C),t.on("focus",R),t.on("escape",T),t.on("click",I)}}));var D=t.useRef(a);return t.useEffect((function(){D.current&&D.current.paymentRequest!==a.paymentRequest&&console.warn("Unsupported prop change: options.paymentRequest is not a customizable property.");var e=b(a);0===Object.keys(e).length||s(e,b(D.current))||S.current&&(S.current.update(e),D.current=a)}),[a]),t.useEffect((function(){return function(){S.current&&S.current.destroy()}}),[]),t.createElement("div",{id:r,className:i,ref:P})};return i.propTypes={id:a.string,className:a.string,onChange:a.func,onBlur:a.func,onFocus:a.func,onReady:a.func,onClick:a.func,options:a.object},i.displayName=o,i.__elementType=e,i},w="undefined"==typeof window,j=O("auBankAccount",w),_=O("card",w),E=O("cardNumber",w),x=O("cardExpiry",w),S=O("cardCvc",w),P=O("fpxBank",w),k=O("iban",w),C=O("idealBank",w),R=O("paymentRequestButton",w);e.AuBankAccountElement=j,e.CardCvcElement=S,e.CardElement=_,e.CardExpiryElement=x,e.CardNumberElement=E,e.Elements=y,e.ElementsConsumer=h,e.FpxBankElement=P,e.IbanElement=k,e.IdealBankElement=C,e.PaymentRequestButtonElement=R,e.useElements=function(){return m("calls useElements()").elements},e.useStripe=function(){return m("calls useStripe()").stripe},Object.defineProperty(e,"__esModule",{value:!0})}(t,n(25))},63:function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}},73:function(e,t){!function(){e.exports=this.wc.wcBlocksRegistry}()},87:function(e,t,n){"use strict";n.r(t);var r=n(0),o=n(1),i=n(73),u=n(36),a=n(27),c=n(58),s=n(31),p=n.n(s),f=n(47),l=n.n(f),d=n(24),y=n.n(d),m=n(59),h=n(5),v=n.n(h),b=n(29),g=n.n(b),O=function(){var e=g()(v.a.mark((function e(t,n,r){var o,i,a;return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(o=t.generatePaymentMethodRequest(n)).setBillingDetail("name",(r.first_name+" "+r.last_name).trim()),o.setBillingDetail("email",r.email),o.setBillingDetail("phone",r.phone),o.setAddressDetail("city",r.city),o.setAddressDetail("country",r.country),o.setAddressDetail("line1",r.address_1),o.setAddressDetail("line2",r.address_2),o.setAddressDetail("postal_code",r.postcode),o.setAddressDetail("state",r.state),e.prev=10,e.next=13,o.send();case 13:return i=e.sent,a=i.paymentMethod.id,e.abrupt("return",{type:"success",meta:{paymentMethodData:{paymentMethod:u.a,"wcpay-payment-method":a}}});case 18:return e.prev=18,e.t0=e.catch(10),e.abrupt("return",{type:"error",message:e.t0.message});case 21:case"end":return e.stop()}}),e,null,[[10,18]])})));return function(t,n,r){return e.apply(this,arguments)}}();function w(){return(w=g()(v.a.mark((function e(t,n,r){var o,i,u,a;return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=n.redirect,e.prev=1,!0!==(i=t.confirmIntent(o))){e.next=5;break}return e.abrupt("return",{type:"success",redirectUrl:o});case 5:return u=i.request,e.next=8,u;case 8:return a=e.sent,e.abrupt("return",{type:"success",redirectUrl:a});case 12:return e.prev=12,e.t0=e.catch(1),e.abrupt("return",{type:"error",message:e.t0.message,messageContext:r.noticeContexts.PAYMENTS});case 15:case"end":return e.stop()}}),e,null,[[1,12]])})))).apply(this,arguments)}var j=function(e){var t=e.api,n=e.activePaymentMethod,o=e.stripe,i=e.elements,a=e.billing.billingData,c=e.eventRegistration,s=c.onPaymentProcessing,p=c.onCheckoutAfterProcessingWithSuccess,f=e.emitResponse,l=Object(r.useState)(null),d=y()(l,2),h=d[0],v=d[1];Object(r.useEffect)((function(){return s((function(){if(u.a===n){if(h)return{type:"error",message:h};var e=i.getElement(m.CardElement);return O(t,{card:e},a)}}))}),[i,o,n]),Object(r.useEffect)((function(){return p((function(e){var n=e.processingResponse.paymentDetails;return function(e,t,n){return w.apply(this,arguments)}(t,n,f)}))}),[i,o]);return Object(r.createElement)(m.CardElement,{options:{hidePostalCode:!0,classes:{base:"wcpay-card-mounted"}},onChange:function(e){var t=e.error;v(t?t.message:null)}})},_=function(e){var t=e.api,n=l()(e,["api"]);return Object(r.createElement)(m.Elements,{stripe:t.getStripe()},Object(r.createElement)(m.ElementsConsumer,null,(function(e){var o=e.elements,i=e.stripe;return Object(r.createElement)(j,p()({api:t,elements:o,stripe:i},n))})))};function E(){return(E=g()(v.a.mark((function e(t,n){var r,o,i;return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(o in r=new FormData,n)r.append(o,n[o]);return e.next=4,fetch(t,{method:"POST",body:r});case 4:return i=e.sent,e.abrupt("return",i.text());case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var x=n(33),S=new c.a({publishableKey:Object(a.a)("publishableKey"),accountId:Object(a.a)("accountId")},(function(e,t){return E.apply(this,arguments)}));Object(i.registerPaymentMethod)((function(e){return new e({name:u.a,content:Object(r.createElement)(_,{api:S}),edit:Object(r.createElement)(_,{api:S}),canMakePayment:function(){return!!S.getStripe()},paymentMethodId:u.a,label:Object(o.__)("Credit Card","woocommerce-payments"),ariaLabel:Object(o.__)("Credit Card","woocommerce-payments"),supports:{features:Object(a.a)("features")}})})),window.addEventListener("load",(function(){Object(x.a)(Object(a.a)("fraudServices"))}))}}));
|
dist/checkout.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('wp-polyfill'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('wp-polyfill'), 'version' => '22d6043164a13dca3701f1b68ad053e1');
|
dist/checkout.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(e,t){for(var n in t)e[n]=t[n]}(this,function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=88)}({17:function(e,t){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}},2:function(e,t,n){var r=n(17);e.exports=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),o.forEach((function(t){r(e,t,n[t])}))}return e}},24:function(e,t,n){var r=n(40),o=n(41),i=n(42);e.exports=function(e,t){return r(e)||o(e,t)||i()}},27:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return o}));var r=function(e){return(wcpay_config||wc.wcSettings.getSetting("woocommerce_payments_data"))[e]||null},o=function(e,t){if("undefined"!=typeof wcpay_config)wcpay_config[e]=t;else{var n=wc.wcSettings.getSetting("woocommerce_payments_data");n[e]=t,wc.wcSettings.setSetting("woocommerce_payments_data",n)}}},33:function(e,t,n){"use strict";var r={};n.r(r),n.d(r,"src",(function(){return i})),n.d(r,"init",(function(){return c}));var o={};n.r(o),n.d(o,"src",(function(){return a}));var i="https://cdn.sift.com/s.js",c=function(e){var t=e.beacon_key,n=e.session_id,r=e.user_id,o=window._sift=window._sift||[];o.push(["_setAccount",t]),o.push(["_setUserId",r]),o.push(["_setSessionId",n]),o.push(["_trackPageview"])},a="https://js.stripe.com/v3",s={sift:r,stripe:o};t.a=function(e){for(var t in e){var n=s[t];if(n&&e[t]&&(n.init&&n.init(e[t]),!document.querySelector('[src="'.concat(n.src,'"]')))){var r=document.createElement("script");r.src=n.src,r.async=!0,document.body.appendChild(r)}}}},36:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r="woocommerce_payments"},40:function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},41:function(e,t){e.exports=function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var c,a=e[Symbol.iterator]();!(r=(c=a.next()).done)&&(n.push(c.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==a.return||a.return()}finally{if(o)throw i}}return n}},42:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},52:function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},53:function(e,t){function n(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,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}},58:function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var r=n(24),o=n.n(r),i=n(2),c=n.n(i),a=n(52),s=n.n(a),u=n(53),l=n.n(u),d=n(27),f=function(){function e(t,n){s()(this,e),this.options=t,this.stripe=null,this.request=n}return l()(e,[{key:"getStripe",value:function(){if(!this.stripe){var e=this.options,t=e.publishableKey,n=e.accountId;this.stripe=new Stripe(t,{stripeAccount:n})}return this.stripe}},{key:"generatePaymentMethodRequest",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getStripe();return new(function(){function r(){s()(this,r),this.args=c()(c()({type:"card"},e),{},{billing_details:{address:{}}})}return l()(r,[{key:"prepareValue",value:function(e,n){if(void 0!==n&&0!==n.length||(n=t[e]),void 0!==n&&0<n.length)return n}},{key:"setBillingDetail",value:function(e,t){var n=this.prepareValue(e,t);void 0!==n&&(this.args.billing_details[e]=n)}},{key:"setAddressDetail",value:function(e,t){var n=this.prepareValue(e,t);void 0!==n&&(this.args.billing_details.address[e]=n)}},{key:"send",value:function(){return n.createPaymentMethod(this.args).then((function(e){if(e.error)throw e.error;return e}))}}]),r}())}},{key:"confirmIntent",value:function(e,t){var n=this,r=e.match(/#wcpay-confirm-(pi|si):(.+):(.+):(.+)$/);if(!r)return!0;var i="si"===r[1],c=r[2],a=r[3];Object(d.b)("updateOrderStatusNonce",r[4]);var s=e.indexOf("order-pay"),u=-1<s,l=u&&e.substring(s).match(/\d+/);return l&&(c=l[0]),{request:(i?this.getStripe().confirmCardSetup(a):this.getStripe().confirmCardPayment(a)).then((function(e){var r=e.paymentIntent&&e.paymentIntent.id||e.setupIntent&&e.setupIntent.id||e.error&&e.error.payment_intent&&e.error.payment_intent.id||e.error.setup_intent&&e.error.setup_intent.id;return[n.request(Object(d.a)("ajaxUrl"),{action:"update_order_status",order_id:c,_ajax_nonce:Object(d.a)("updateOrderStatusNonce"),intent_id:r,payment_method_id:t||null}),e.error]})).then((function(e){var t=o()(e,2),n=t[0],r=t[1];if(r)throw r;return n.then((function(e){var t=JSON.parse(e);if(t.error)throw t.error;return t.return_url}))})),isOrderPage:u}}},{key:"setupIntent",value:function(e){var t=this;return this.request(Object(d.a)("ajaxUrl"),{action:"create_setup_intent","wcpay-payment-method":e,_ajax_nonce:Object(d.a)("createSetupIntentNonce")}).then((function(e){if(!e.success)throw e.data.error;return"succeeded"===e.data.status?e.data:t.getStripe().confirmCardSetup(e.data.client_secret).then((function(e){var t=e.setupIntent,n=e.error;if(n)throw n;return t}))}))}}]),e}()},88:function(e,t,n){"use strict";n.r(t);var r=n(36),o=n(27),i=n(58),c=n(33);jQuery((function(e){Object(c.a)(Object(o.a)("fraudServices"));var t=Object(o.a)("publishableKey");if(t){var n=new i.a({publishableKey:t,accountId:Object(o.a)("accountId")},(function(e,t){return new Promise((function(n,r){jQuery.post(e,t).then(n).fail(r)}))})),a=n.getStripe().elements(),s={},u=a.create("card",{hidePostalCode:!0,classes:{base:"wcpay-card-mounted"}});e(document.body).on("updated_checkout",(function(){e("#wcpay-card-element").length&&!e("#wcpay-card-element").children().length&&(u.unmount(),u.mount("#wcpay-card-element"))})),(e("form#add_payment_method").length||e("form#order_review").length)&&u.mount("#wcpay-card-element"),u.addEventListener("change",(function(t){var n=e("#wcpay-errors");t.error?n.html('<ul class="woocommerce-error"><li /></ul>').find("li").text(t.error.message):n.empty()}));var l,d=function(e){e.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},f=function(t){var n='<ul class="woocommerce-error" role="alert">'+t+"</ul>",r=e(".woocommerce-notices-wrapper, form.checkout").first();if(r.length){e(".woocommerce-NoticeGroup-checkout, .woocommerce-error, .woocommerce-message").remove(),r.prepend('<div class="woocommerce-NoticeGroup woocommerce-NoticeGroup-checkout">'+n+"</div>"),r.find(".input-text, select, input:checkbox").trigger("validate").blur();var o=e(".woocommerce-NoticeGroup-checkout");o.length||(o=r),e.scroll_to_notices(o),e(document.body).trigger("checkout_error")}},p=function(t,r){n.setupIntent(r.id).then((function(n){t.append(e('<input type="hidden" />').attr("id","wcpay-setup-intent").attr("name","wcpay-setup-intent").val(n.id));var r=e.blockUI.defaults.ignoreIfBlocked;e.blockUI.defaults.ignoreIfBlocked=!0,t.removeClass("processing").submit(),e.blockUI.defaults.ignoreIfBlocked=r})).catch((function(e){l=null,t.removeClass("processing").unblock(),f(e.message)}))},m=function(t,n){var r=n.id;e("#wcpay-payment-method").val(r),t.removeClass("processing").submit()},h=function(t,r,o){if(!l){d(t);var i=n.generatePaymentMethodRequest({card:u},s);return o&&(i.setBillingDetail("name",(e("#billing_first_name").val()+" "+e("#billing_last_name").val()).trim()),i.setBillingDetail("email",e("#billing_email").val()),i.setBillingDetail("phone",e("#billing_phone").val()),i.setAddressDetail("city",e("#billing_city").val()),i.setAddressDetail("country",e("#billing_country").val()),i.setAddressDetail("line1",e("#billing_address_1").val()),i.setAddressDetail("line2",e("#billing_address_2").val()),i.setAddressDetail("postal_code",e("#billing_postcode").val()),i.setAddressDetail("state",e("#billing_state").val())),i.send().then((function(e){var n=e.paymentMethod;l=!0,r(t,n)})).catch((function(e){t.removeClass("processing").unblock(),f(e.message)})),!1}l=null},y=function(){var t=e("#wcpay-payment-method").val(),r=e("#wc-woocommerce_payments-new-payment-method").is(":checked"),i=n.confirmIntent(window.location.href,r?t:null);if(!0!==i){var c=i.request;i.isOrderPage&&(d(e("#order_review")),e("#payment").hide(500)),history.replaceState("",document.title,window.location.pathname+window.location.search),c.then((function(e){window.location=e})).catch((function(t){e("form.checkout").removeClass("processing").unblock(),e("#order_review").removeClass("processing").unblock(),e("#payment").show(500);var n=t.message;t instanceof Error&&(n=Object(o.a)("genericErrorMessage")),f(n)}))}};e("form.checkout").on("checkout_place_order_"+r.a,(function(){if(!v())return h(e(this),m,!0)})),e("#order_review").on("submit",(function(){if(e("#payment_method_woocommerce_payments").is(":checked")&&!v())return h(e("#order_review"),m,!0)})),e("form#add_payment_method").on("submit",(function(){if(!e("#wcpay-setup-intent").val())return h(e("form#add_payment_method"),p,!1)})),y(),window.addEventListener("hashchange",(function(){window.location.hash.startsWith("#wcpay-confirm-")&&y()}))}function v(){return e("#wc-woocommerce_payments-payment-token-new").length&&!e("#wc-woocommerce_payments-payment-token-new").is(":checked")}}))}}));
|
1 |
+
!function(e,t){for(var n in t)e[n]=t[n]}(this,function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=88)}({17:function(e,t){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}},2:function(e,t,n){var r=n(17);e.exports=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),o.forEach((function(t){r(e,t,n[t])}))}return e}},24:function(e,t,n){var r=n(40),o=n(41),i=n(42);e.exports=function(e,t){return r(e)||o(e,t)||i()}},27:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return o}));var r=function(e){return("undefined"!=typeof wcpay_config?wcpay_config:wc.wcSettings.getSetting("woocommerce_payments_data"))[e]||null},o=function(e,t){if("undefined"!=typeof wcpay_config)wcpay_config[e]=t;else{var n=wc.wcSettings.getSetting("woocommerce_payments_data");n[e]=t,wc.wcSettings.setSetting("woocommerce_payments_data",n)}}},33:function(e,t,n){"use strict";var r={};n.r(r),n.d(r,"src",(function(){return i})),n.d(r,"init",(function(){return c}));var o={};n.r(o),n.d(o,"src",(function(){return a}));var i="https://cdn.sift.com/s.js",c=function(e){var t=e.beacon_key,n=e.session_id,r=e.user_id,o=window._sift=window._sift||[];o.push(["_setAccount",t]),o.push(["_setUserId",r]),o.push(["_setSessionId",n]),o.push(["_trackPageview"])},a="https://js.stripe.com/v3",s={sift:r,stripe:o};t.a=function(e){for(var t in e){var n=s[t];if(n&&e[t]&&(n.init&&n.init(e[t]),!document.querySelector('[src="'.concat(n.src,'"]')))){var r=document.createElement("script");r.src=n.src,r.async=!0,document.body.appendChild(r)}}}},36:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r="woocommerce_payments"},40:function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},41:function(e,t){e.exports=function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var c,a=e[Symbol.iterator]();!(r=(c=a.next()).done)&&(n.push(c.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==a.return||a.return()}finally{if(o)throw i}}return n}},42:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},52:function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},53:function(e,t){function n(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,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}},58:function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var r=n(24),o=n.n(r),i=n(2),c=n.n(i),a=n(52),s=n.n(a),u=n(53),l=n.n(u),d=n(27),f=function(){function e(t,n){s()(this,e),this.options=t,this.stripe=null,this.request=n}return l()(e,[{key:"getStripe",value:function(){if(!this.stripe){var e=this.options,t=e.publishableKey,n=e.accountId;this.stripe=new Stripe(t,{stripeAccount:n})}return this.stripe}},{key:"generatePaymentMethodRequest",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getStripe();return new(function(){function r(){s()(this,r),this.args=c()(c()({type:"card"},e),{},{billing_details:{address:{}}})}return l()(r,[{key:"prepareValue",value:function(e,n){if(void 0!==n&&0!==n.length||(n=t[e]),void 0!==n&&0<n.length)return n}},{key:"setBillingDetail",value:function(e,t){var n=this.prepareValue(e,t);void 0!==n&&(this.args.billing_details[e]=n)}},{key:"setAddressDetail",value:function(e,t){var n=this.prepareValue(e,t);void 0!==n&&(this.args.billing_details.address[e]=n)}},{key:"send",value:function(){return n.createPaymentMethod(this.args).then((function(e){if(e.error)throw e.error;return e}))}}]),r}())}},{key:"confirmIntent",value:function(e,t){var n=this,r=e.match(/#wcpay-confirm-(pi|si):(.+):(.+):(.+)$/);if(!r)return!0;var i="si"===r[1],c=r[2],a=r[3];Object(d.b)("updateOrderStatusNonce",r[4]);var s=e.indexOf("order-pay"),u=-1<s,l=u&&e.substring(s).match(/\d+/);return l&&(c=l[0]),{request:(i?this.getStripe().confirmCardSetup(a):this.getStripe().confirmCardPayment(a)).then((function(e){var r=e.paymentIntent&&e.paymentIntent.id||e.setupIntent&&e.setupIntent.id||e.error&&e.error.payment_intent&&e.error.payment_intent.id||e.error.setup_intent&&e.error.setup_intent.id;return[n.request(Object(d.a)("ajaxUrl"),{action:"update_order_status",order_id:c,_ajax_nonce:Object(d.a)("updateOrderStatusNonce"),intent_id:r,payment_method_id:t||null}),e.error]})).then((function(e){var t=o()(e,2),n=t[0],r=t[1];if(r)throw r;return n.then((function(e){var t=JSON.parse(e);if(t.error)throw t.error;return t.return_url}))})),isOrderPage:u}}},{key:"setupIntent",value:function(e){var t=this;return this.request(Object(d.a)("ajaxUrl"),{action:"create_setup_intent","wcpay-payment-method":e,_ajax_nonce:Object(d.a)("createSetupIntentNonce")}).then((function(e){if(!e.success)throw e.data.error;return"succeeded"===e.data.status?e.data:t.getStripe().confirmCardSetup(e.data.client_secret).then((function(e){var t=e.setupIntent,n=e.error;if(n)throw n;return t}))}))}}]),e}()},88:function(e,t,n){"use strict";n.r(t);var r=n(36),o=n(27),i=n(58),c=n(33);jQuery((function(e){Object(c.a)(Object(o.a)("fraudServices"));var t=Object(o.a)("publishableKey");if(t){var n=new i.a({publishableKey:t,accountId:Object(o.a)("accountId")},(function(e,t){return new Promise((function(n,r){jQuery.post(e,t).then(n).fail(r)}))})),a=n.getStripe().elements(),s={},u=a.create("card",{hidePostalCode:!0,classes:{base:"wcpay-card-mounted"}});e(document.body).on("updated_checkout",(function(){e("#wcpay-card-element").length&&!e("#wcpay-card-element").children().length&&(u.unmount(),u.mount("#wcpay-card-element"))})),(e("form#add_payment_method").length||e("form#order_review").length)&&u.mount("#wcpay-card-element"),u.addEventListener("change",(function(t){var n=e("#wcpay-errors");t.error?n.html('<ul class="woocommerce-error"><li /></ul>').find("li").text(t.error.message):n.empty()}));var l,d=function(e){e.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},f=function(t){var n='<ul class="woocommerce-error" role="alert">'+t+"</ul>",r=e(".woocommerce-notices-wrapper, form.checkout").first();if(r.length){e(".woocommerce-NoticeGroup-checkout, .woocommerce-error, .woocommerce-message").remove(),r.prepend('<div class="woocommerce-NoticeGroup woocommerce-NoticeGroup-checkout">'+n+"</div>"),r.find(".input-text, select, input:checkbox").trigger("validate").blur();var o=e(".woocommerce-NoticeGroup-checkout");o.length||(o=r),e.scroll_to_notices(o),e(document.body).trigger("checkout_error")}},p=function(t,r){n.setupIntent(r.id).then((function(n){t.append(e('<input type="hidden" />').attr("id","wcpay-setup-intent").attr("name","wcpay-setup-intent").val(n.id));var r=e.blockUI.defaults.ignoreIfBlocked;e.blockUI.defaults.ignoreIfBlocked=!0,t.removeClass("processing").submit(),e.blockUI.defaults.ignoreIfBlocked=r})).catch((function(e){l=null,t.removeClass("processing").unblock(),f(e.message)}))},m=function(t,n){var r=n.id;e("#wcpay-payment-method").val(r),t.removeClass("processing").submit()},h=function(t,r,o){if(!l){d(t);var i=n.generatePaymentMethodRequest({card:u},s);return o&&(i.setBillingDetail("name",(e("#billing_first_name").val()+" "+e("#billing_last_name").val()).trim()),i.setBillingDetail("email",e("#billing_email").val()),i.setBillingDetail("phone",e("#billing_phone").val()),i.setAddressDetail("city",e("#billing_city").val()),i.setAddressDetail("country",e("#billing_country").val()),i.setAddressDetail("line1",e("#billing_address_1").val()),i.setAddressDetail("line2",e("#billing_address_2").val()),i.setAddressDetail("postal_code",e("#billing_postcode").val()),i.setAddressDetail("state",e("#billing_state").val())),i.send().then((function(e){var n=e.paymentMethod;l=!0,r(t,n)})).catch((function(e){t.removeClass("processing").unblock(),f(e.message)})),!1}l=null},y=function(){var t=e("#wcpay-payment-method").val(),r=e("#wc-woocommerce_payments-new-payment-method").is(":checked"),i=n.confirmIntent(window.location.href,r?t:null);if(!0!==i){var c=i.request;i.isOrderPage&&(d(e("#order_review")),e("#payment").hide(500)),history.replaceState("",document.title,window.location.pathname+window.location.search),c.then((function(e){window.location=e})).catch((function(t){e("form.checkout").removeClass("processing").unblock(),e("#order_review").removeClass("processing").unblock(),e("#payment").show(500);var n=t.message;t instanceof Error&&(n=Object(o.a)("genericErrorMessage")),f(n)}))}};e("form.checkout").on("checkout_place_order_"+r.a,(function(){if(!v())return h(e(this),m,!0)})),e("#order_review").on("submit",(function(){if(e("#payment_method_woocommerce_payments").is(":checked")&&!v())return h(e("#order_review"),m,!0)})),e("form#add_payment_method").on("submit",(function(){if(!e("#wcpay-setup-intent").val())return h(e("form#add_payment_method"),p,!1)})),y(),window.addEventListener("hashchange",(function(){window.location.hash.startsWith("#wcpay-confirm-")&&y()}))}function v(){return e("#wc-woocommerce_payments-payment-token-new").length&&!e("#wc-woocommerce_payments-payment-token-new").is(":checked")}}))}}));
|
includes/class-wc-payment-gateway-wcpay.php
CHANGED
@@ -328,6 +328,7 @@ class WC_Payment_Gateway_WCPay extends WC_Payment_Gateway_CC {
|
|
328 |
'createSetupIntentNonce' => wp_create_nonce( 'wcpay_create_setup_intent_nonce' ),
|
329 |
'genericErrorMessage' => __( 'There was a problem processing the payment. Please check your email inbox and refresh the page to try again.', 'woocommerce-payments' ),
|
330 |
'fraudServices' => $this->account->get_fraud_services_config(),
|
|
|
331 |
];
|
332 |
}
|
333 |
|
328 |
'createSetupIntentNonce' => wp_create_nonce( 'wcpay_create_setup_intent_nonce' ),
|
329 |
'genericErrorMessage' => __( 'There was a problem processing the payment. Please check your email inbox and refresh the page to try again.', 'woocommerce-payments' ),
|
330 |
'fraudServices' => $this->account->get_fraud_services_config(),
|
331 |
+
'features' => $this->supports,
|
332 |
];
|
333 |
}
|
334 |
|
includes/class-wc-payments-blocks-payment-method.php
CHANGED
@@ -34,6 +34,14 @@ class WC_Payments_Blocks_Payment_Method extends AbstractPaymentMethodType {
|
|
34 |
* @return string[] A list of script handles.
|
35 |
*/
|
36 |
public function get_payment_method_script_handles() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
wp_register_script(
|
38 |
'wc-payment-method-wcpay',
|
39 |
plugins_url( 'dist/blocks-checkout.js', WCPAY_PLUGIN_FILE ),
|
34 |
* @return string[] A list of script handles.
|
35 |
*/
|
36 |
public function get_payment_method_script_handles() {
|
37 |
+
wp_register_script(
|
38 |
+
'stripe',
|
39 |
+
'https://js.stripe.com/v3/',
|
40 |
+
[],
|
41 |
+
'3.0',
|
42 |
+
true
|
43 |
+
);
|
44 |
+
|
45 |
wp_register_script(
|
46 |
'wc-payment-method-wcpay',
|
47 |
plugins_url( 'dist/blocks-checkout.js', WCPAY_PLUGIN_FILE ),
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: woocommerce, payment, payment request, credit card, automattic
|
|
4 |
Requires at least: 5.3
|
5 |
Tested up to: 5.6
|
6 |
Requires PHP: 7.0
|
7 |
-
Stable tag: 1.9.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -101,6 +101,10 @@ Please note that our support for the checkout block is still experimental and th
|
|
101 |
|
102 |
== Changelog ==
|
103 |
|
|
|
|
|
|
|
|
|
104 |
= 1.9.1 - 2021-02-03 =
|
105 |
* Fix - Incompatibility with WC Subscriptions.
|
106 |
* Fix - Missing order causing broken transactions list.
|
4 |
Requires at least: 5.3
|
5 |
Tested up to: 5.6
|
6 |
Requires PHP: 7.0
|
7 |
+
Stable tag: 1.9.2
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
101 |
|
102 |
== Changelog ==
|
103 |
|
104 |
+
= 1.9.2 - 2021-02-05 =
|
105 |
+
* Fix - Checkout and cart blocks aren't usable in editor when WooCommerce Payments is enabled.
|
106 |
+
* Fix - Missing global config error in Checkout block integration, and incompatibility with latest block API.
|
107 |
+
|
108 |
= 1.9.1 - 2021-02-03 =
|
109 |
* Fix - Incompatibility with WC Subscriptions.
|
110 |
* Fix - Missing order causing broken transactions list.
|
vendor/autoload.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInit81194ca3ca789c8afd8559be278e6f56::getLoader();
|
vendor/autoload_packages.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
-
namespace Automattic\Jetpack\Autoloader\
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp81194ca3ca789c8afd8559be278e6f56;
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
vendor/composer/InstalledVersions.php
CHANGED
@@ -25,12 +25,12 @@ class InstalledVersions
|
|
25 |
private static $installed = array (
|
26 |
'root' =>
|
27 |
array (
|
28 |
-
'pretty_version' => 'dev-
|
29 |
-
'version' => 'dev-
|
30 |
'aliases' =>
|
31 |
array (
|
32 |
),
|
33 |
-
'reference' => '
|
34 |
'name' => 'woocommerce/payments',
|
35 |
),
|
36 |
'versions' =>
|
@@ -145,12 +145,12 @@ private static $installed = array (
|
|
145 |
),
|
146 |
'woocommerce/payments' =>
|
147 |
array (
|
148 |
-
'pretty_version' => 'dev-
|
149 |
-
'version' => 'dev-
|
150 |
'aliases' =>
|
151 |
array (
|
152 |
),
|
153 |
-
'reference' => '
|
154 |
),
|
155 |
),
|
156 |
);
|
25 |
private static $installed = array (
|
26 |
'root' =>
|
27 |
array (
|
28 |
+
'pretty_version' => 'dev-release/1.9.2',
|
29 |
+
'version' => 'dev-release/1.9.2',
|
30 |
'aliases' =>
|
31 |
array (
|
32 |
),
|
33 |
+
'reference' => 'bc800dd98a2b60e6c1eb4e83cbd3523c730a2e18',
|
34 |
'name' => 'woocommerce/payments',
|
35 |
),
|
36 |
'versions' =>
|
145 |
),
|
146 |
'woocommerce/payments' =>
|
147 |
array (
|
148 |
+
'pretty_version' => 'dev-release/1.9.2',
|
149 |
+
'version' => 'dev-release/1.9.2',
|
150 |
'aliases' =>
|
151 |
array (
|
152 |
),
|
153 |
+
'reference' => 'bc800dd98a2b60e6c1eb4e83cbd3523c730a2e18',
|
154 |
),
|
155 |
),
|
156 |
);
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -24,15 +24,15 @@ class ComposerAutoloaderInitec81757a9e0161f15b3a11de7d165e53
|
|
24 |
|
25 |
require __DIR__ . '/platform_check.php';
|
26 |
|
27 |
-
spl_autoload_register(array('
|
28 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
29 |
-
spl_autoload_unregister(array('
|
30 |
|
31 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
32 |
if ($useStaticLoader) {
|
33 |
require __DIR__ . '/autoload_static.php';
|
34 |
|
35 |
-
call_user_func(\Composer\Autoload\
|
36 |
} else {
|
37 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
38 |
foreach ($map as $namespace => $path) {
|
@@ -53,19 +53,19 @@ class ComposerAutoloaderInitec81757a9e0161f15b3a11de7d165e53
|
|
53 |
$loader->register(true);
|
54 |
|
55 |
if ($useStaticLoader) {
|
56 |
-
$includeFiles = Composer\Autoload\
|
57 |
} else {
|
58 |
$includeFiles = require __DIR__ . '/autoload_files.php';
|
59 |
}
|
60 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
61 |
-
|
62 |
}
|
63 |
|
64 |
return $loader;
|
65 |
}
|
66 |
}
|
67 |
|
68 |
-
function
|
69 |
{
|
70 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
71 |
require $file;
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInit81194ca3ca789c8afd8559be278e6f56
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
24 |
|
25 |
require __DIR__ . '/platform_check.php';
|
26 |
|
27 |
+
spl_autoload_register(array('ComposerAutoloaderInit81194ca3ca789c8afd8559be278e6f56', 'loadClassLoader'), true, true);
|
28 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
29 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit81194ca3ca789c8afd8559be278e6f56', 'loadClassLoader'));
|
30 |
|
31 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
32 |
if ($useStaticLoader) {
|
33 |
require __DIR__ . '/autoload_static.php';
|
34 |
|
35 |
+
call_user_func(\Composer\Autoload\ComposerStaticInit81194ca3ca789c8afd8559be278e6f56::getInitializer($loader));
|
36 |
} else {
|
37 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
38 |
foreach ($map as $namespace => $path) {
|
53 |
$loader->register(true);
|
54 |
|
55 |
if ($useStaticLoader) {
|
56 |
+
$includeFiles = Composer\Autoload\ComposerStaticInit81194ca3ca789c8afd8559be278e6f56::$files;
|
57 |
} else {
|
58 |
$includeFiles = require __DIR__ . '/autoload_files.php';
|
59 |
}
|
60 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
61 |
+
composerRequire81194ca3ca789c8afd8559be278e6f56($fileIdentifier, $file);
|
62 |
}
|
63 |
|
64 |
return $loader;
|
65 |
}
|
66 |
}
|
67 |
|
68 |
+
function composerRequire81194ca3ca789c8afd8559be278e6f56($fileIdentifier, $file)
|
69 |
{
|
70 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
71 |
require $file;
|
vendor/composer/autoload_static.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
-
class
|
8 |
{
|
9 |
public static $files = array (
|
10 |
'bce4ecd6aabb2a2948e06d0e2c4ea9a6' => __DIR__ . '/..' . '/automattic/jetpack-connection/legacy/load-ixr.php',
|
@@ -72,9 +72,9 @@ class ComposerStaticInitec81757a9e0161f15b3a11de7d165e53
|
|
72 |
public static function getInitializer(ClassLoader $loader)
|
73 |
{
|
74 |
return \Closure::bind(function () use ($loader) {
|
75 |
-
$loader->prefixLengthsPsr4 =
|
76 |
-
$loader->prefixDirsPsr4 =
|
77 |
-
$loader->classMap =
|
78 |
|
79 |
}, null, ClassLoader::class);
|
80 |
}
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
+
class ComposerStaticInit81194ca3ca789c8afd8559be278e6f56
|
8 |
{
|
9 |
public static $files = array (
|
10 |
'bce4ecd6aabb2a2948e06d0e2c4ea9a6' => __DIR__ . '/..' . '/automattic/jetpack-connection/legacy/load-ixr.php',
|
72 |
public static function getInitializer(ClassLoader $loader)
|
73 |
{
|
74 |
return \Closure::bind(function () use ($loader) {
|
75 |
+
$loader->prefixLengthsPsr4 = ComposerStaticInit81194ca3ca789c8afd8559be278e6f56::$prefixLengthsPsr4;
|
76 |
+
$loader->prefixDirsPsr4 = ComposerStaticInit81194ca3ca789c8afd8559be278e6f56::$prefixDirsPsr4;
|
77 |
+
$loader->classMap = ComposerStaticInit81194ca3ca789c8afd8559be278e6f56::$classMap;
|
78 |
|
79 |
}, null, ClassLoader::class);
|
80 |
}
|
vendor/composer/installed.php
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
<?php return array (
|
2 |
'root' =>
|
3 |
array (
|
4 |
-
'pretty_version' => 'dev-
|
5 |
-
'version' => 'dev-
|
6 |
'aliases' =>
|
7 |
array (
|
8 |
),
|
9 |
-
'reference' => '
|
10 |
'name' => 'woocommerce/payments',
|
11 |
),
|
12 |
'versions' =>
|
@@ -121,12 +121,12 @@
|
|
121 |
),
|
122 |
'woocommerce/payments' =>
|
123 |
array (
|
124 |
-
'pretty_version' => 'dev-
|
125 |
-
'version' => 'dev-
|
126 |
'aliases' =>
|
127 |
array (
|
128 |
),
|
129 |
-
'reference' => '
|
130 |
),
|
131 |
),
|
132 |
);
|
1 |
<?php return array (
|
2 |
'root' =>
|
3 |
array (
|
4 |
+
'pretty_version' => 'dev-release/1.9.2',
|
5 |
+
'version' => 'dev-release/1.9.2',
|
6 |
'aliases' =>
|
7 |
array (
|
8 |
),
|
9 |
+
'reference' => 'bc800dd98a2b60e6c1eb4e83cbd3523c730a2e18',
|
10 |
'name' => 'woocommerce/payments',
|
11 |
),
|
12 |
'versions' =>
|
121 |
),
|
122 |
'woocommerce/payments' =>
|
123 |
array (
|
124 |
+
'pretty_version' => 'dev-release/1.9.2',
|
125 |
+
'version' => 'dev-release/1.9.2',
|
126 |
'aliases' =>
|
127 |
array (
|
128 |
),
|
129 |
+
'reference' => 'bc800dd98a2b60e6c1eb4e83cbd3523c730a2e18',
|
130 |
),
|
131 |
),
|
132 |
);
|
vendor/jetpack-autoloader/class-autoloader-handler.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
-
namespace Automattic\Jetpack\Autoloader\
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp81194ca3ca789c8afd8559be278e6f56;
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
vendor/jetpack-autoloader/class-autoloader-locator.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
-
namespace Automattic\Jetpack\Autoloader\
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp81194ca3ca789c8afd8559be278e6f56;
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
vendor/jetpack-autoloader/class-autoloader.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
-
namespace Automattic\Jetpack\Autoloader\
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp81194ca3ca789c8afd8559be278e6f56;
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
vendor/jetpack-autoloader/class-container.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
-
namespace Automattic\Jetpack\Autoloader\
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp81194ca3ca789c8afd8559be278e6f56;
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
vendor/jetpack-autoloader/class-hook-manager.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
-
namespace Automattic\Jetpack\Autoloader\
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp81194ca3ca789c8afd8559be278e6f56;
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
vendor/jetpack-autoloader/class-latest-autoloader-guard.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
-
namespace Automattic\Jetpack\Autoloader\
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp81194ca3ca789c8afd8559be278e6f56;
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
vendor/jetpack-autoloader/class-manifest-reader.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
-
namespace Automattic\Jetpack\Autoloader\
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp81194ca3ca789c8afd8559be278e6f56;
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
vendor/jetpack-autoloader/class-path-processor.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
-
namespace Automattic\Jetpack\Autoloader\
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp81194ca3ca789c8afd8559be278e6f56;
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
vendor/jetpack-autoloader/class-plugin-locator.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
-
namespace Automattic\Jetpack\Autoloader\
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp81194ca3ca789c8afd8559be278e6f56;
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
vendor/jetpack-autoloader/class-plugins-handler.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
-
namespace Automattic\Jetpack\Autoloader\
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp81194ca3ca789c8afd8559be278e6f56;
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
vendor/jetpack-autoloader/class-version-loader.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
-
namespace Automattic\Jetpack\Autoloader\
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp81194ca3ca789c8afd8559be278e6f56;
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
vendor/jetpack-autoloader/class-version-selector.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
-
namespace Automattic\Jetpack\Autoloader\
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
5 |
* @package automattic/jetpack-autoloader
|
6 |
*/
|
7 |
|
8 |
+
namespace Automattic\Jetpack\Autoloader\jp81194ca3ca789c8afd8559be278e6f56;
|
9 |
|
10 |
// phpcs:ignore
|
11 |
|
woocommerce-payments.php
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
* WC requires at least: 4.0
|
11 |
* WC tested up to: 5.0
|
12 |
* Requires WP: 5.3
|
13 |
-
* Version: 1.9.
|
14 |
*
|
15 |
* @package WooCommerce\Payments
|
16 |
*/
|
10 |
* WC requires at least: 4.0
|
11 |
* WC tested up to: 5.0
|
12 |
* Requires WP: 5.3
|
13 |
+
* Version: 1.9.2
|
14 |
*
|
15 |
* @package WooCommerce\Payments
|
16 |
*/
|