Payment Plugins for Stripe WooCommerce - Version 3.3.28

Version Description

  • 9/26/22 =
  • Fixed - ACH javascript files not included in version 3.3.27 build
  • Updated - Removed admin feedback code
Download this release

Release Info

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

Code changes from version 3.3.27 to 3.3.28

assets/build/ach-connections.asset.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php return array('dependencies' => array('@paymentplugins/wc-stripe', 'jquery', 'wp-polyfill'), 'version' => '4224d0603ed1e9050412d4367f1bdedc');
assets/build/ach-connections.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},707:e=>{"use strict";e.exports=window.wc_stripe}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}(()=>{var e=r(318),t=e(r(713)),n=e(r(567)),o=r(707);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}function s(e){o.BaseGateway.call(this,e),o.CheckoutGateway.call(this)}s.prototype.initialize=function(){window.addEventListener("hashchange",this.hashchange.bind(this)),(0,n.default)(document.body).on("payment_method_selected",this.payment_method_selected.bind(this)),(0,n.default)(document.body).on("click","#place_order",this.on_order_pay.bind(this))},s.prototype.checkout_place_order=function(){return this.payment_token_received=!0,o.CheckoutGateway.prototype.checkout_place_order.apply(this)},s.prototype.on_order_pay=function(e){var t=this;if(this.is_gateway_selected())if(this.is_change_payment_method()){var r=this.params,n=r.order_id,o=r.order_key;e.preventDefault(),this.create_setup_intent({order_id:n,order_key:o}).then((function(e){var r=e.setup_intent;t.handle_payment_method_setup({order_id:n,order_key:o,client_secret:r.client_secret})}))}else this.is_current_page("order_pay")&&(e.preventDefault(),this.process_order_pay())},s.prototype.handle_next_action=function(e){var t=this,r=e.client_secret;this.stripe.collectBankAccountForPayment({clientSecret:r,params:{payment_method_type:"us_bank_account",payment_method_data:{billing_details:{name:this.get_customer_name(this.get_billing_prefix()),email:this.fields.get("billing_email",null)}}}}).then((function(r){var n=r.paymentIntent,o=r.error;if(o)return t.submit_error(o);"requires_confirmation"===n.status?t.do_payment_confirmation(e):t.cancel_payment_processing()}))},s.prototype.handle_payment_method_setup=function(e){var t=this,r=e.client_secret;this.stripe.collectBankAccountForSetup({clientSecret:r,params:{payment_method_type:"us_bank_account",payment_method_data:{billing_details:{name:this.get_customer_name(this.get_billing_prefix()),email:this.fields.get("billing_email",null)}}}}).then((function(r){var n=r.setupIntent,o=r.error;if(o)return t.submit_error(o);"requires_confirmation"===n.status?t.do_setup_confirmation(e):t.cancel_payment_processing()}))},s.prototype.do_payment_confirmation=function(e){var t=this,r=e.client_secret,n=e.order_id,o=e.order_key;this.stripe.confirmUsBankAccountPayment(r).then((function(e){var r=e.paymentIntent,i=e.error;if(i)return t.submit_error(i);if("requires_payment_method"===r.status)t.cancel_payment_processing();else{if("requires_action"===r.status)return t.cancel_payment_processing(),t.submit_error({code:"ach_instant_only"});"processing"===r.status&&(t.set_nonce(r.payment_method),t.is_current_page("order_pay")?t.get_form().trigger("submit"):t.process_payment(n,o))}}))},s.prototype.do_setup_confirmation=function(e){var t=this,r=e.client_secret,n=e.order_id,o=e.order_key;this.stripe.confirmUsBankAccountSetup(r).then((function(e){var r=e.setupIntent,i=e.error;if(i)return t.submit_error(i);if("requires_payment_method"===r.status)t.cancel_payment_processing();else{if("requires_action"===r.status)return t.cancel_payment_processing(),t.submit_error({code:"ach_instant_only"});"succeeded"===r.status&&(t.set_nonce(r.payment_method),t.is_current_page("order_pay")||t.is_change_payment_method()?t.get_form().trigger("submit"):t.process_payment(n,o))}}))},s.prototype.hide_place_order=function(){},s.prototype.cancel_payment_processing=function(){var e;(0,n.default)(this.container).closest("form").removeClass("processing"),null===(e=(0,n.default)(this.container).closest("form"))||void 0===e||e.unblock()},s.prototype.fees_enabled=function(){return"1"==this.params.fees_enabled},s.prototype.payment_method_selected=function(){this.fees_enabled()&&(0,n.default)(document.body).trigger("update_checkout")},s.prototype.create_setup_intent=function(e){var t=this;return new Promise((function(r,o){n.default.ajax({method:"POST",dataType:"json",data:a({payment_method:t.gateway_id},e),url:t.params.routes.base_path.replace("%s","wc-stripe/v1/subscriptions/setup-intent"),beforeSend:t.ajax_before_send.bind(t)}).done((function(e){e.code?o(e.message):r(e)})).fail((function(e,r,n){t.submit_error(n)}))}))},s.prototype=a(a(a({},o.BaseGateway.prototype),o.CheckoutGateway.prototype),s.prototype),new s(wc_stripe_ach_connections_params)})()})();
2
+ //# sourceMappingURL=ach-connections.js.map
assets/build/ach-connections.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"file":"ach-connections.js","mappings":"qBAeAA,EAAOC,QAfP,SAAyBC,EAAKC,EAAKC,GAYjC,OAXID,KAAOD,EACTG,OAAOC,eAAeJ,EAAKC,EAAK,CAC9BC,MAAOA,EACPG,YAAY,EACZC,cAAc,EACdC,UAAU,IAGZP,EAAIC,GAAOC,EAGNF,I,QCNTF,EAAOC,QANP,SAAgCC,GAC9B,OAAOA,GAAOA,EAAIQ,WAAaR,EAAM,CACnC,QAAWA,K,qBCFfF,EAAOC,QAAUU,OAAe,Q,qBCAhCX,EAAOC,QAAUU,OAAkB,YCC/BC,E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c,MAEbE,MAAK,SAACC,EAAKC,EAAYC,GACtB,EAAKzC,aAAayC,UAK9BzF,EAAUM,UAAV,SAA0BJ,EAAAA,YAAYI,WAAcD,EAAAA,gBAAgBC,WAAcN,EAAUM,WAE5F,IAAIN,EAAU0F,mC","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/external window [\"wc_stripe\"]","webpack://woo-stripe-payment/webpack/bootstrap","webpack://woo-stripe-payment/./assets/js/frontend/ach-connections.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\"];","module.exports = window[\"wc_stripe\"];","// 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';\nimport {BaseGateway, CheckoutGateway} from '@paymentplugins/wc-stripe';\n\nfunction StripeACH(params) {\n BaseGateway.call(this, params);\n CheckoutGateway.call(this);\n}\n\n\nStripeACH.prototype.initialize = function () {\n window.addEventListener('hashchange', this.hashchange.bind(this));\n $(document.body).on('payment_method_selected', this.payment_method_selected.bind(this));\n $(document.body).on('click', '#place_order', this.on_order_pay.bind(this));\n}\n\nStripeACH.prototype.checkout_place_order = function () {\n this.payment_token_received = true;\n return CheckoutGateway.prototype.checkout_place_order.apply(this);\n}\n\nStripeACH.prototype.on_order_pay = function (e) {\n if (this.is_gateway_selected()) {\n // create the setup intent.\n if (this.is_change_payment_method()) {\n const {order_id, order_key} = this.params;\n e.preventDefault();\n this.create_setup_intent({order_id, order_key}).then(({setup_intent}) => {\n this.handle_payment_method_setup({\n order_id,\n order_key,\n client_secret: setup_intent.client_secret\n });\n });\n } else if (this.is_current_page('order_pay')) {\n e.preventDefault();\n this.process_order_pay();\n }\n }\n}\n\nStripeACH.prototype.handle_next_action = function (data) {\n const {client_secret} = data;\n this.stripe.collectBankAccountForPayment({\n clientSecret: client_secret,\n params: {\n payment_method_type: 'us_bank_account',\n payment_method_data: {\n billing_details: {\n name: this.get_customer_name(this.get_billing_prefix()),\n email: this.fields.get('billing_email', null),\n },\n },\n }\n }).then(({paymentIntent, error}) => {\n if (error) {\n return this.submit_error(error);\n }\n // show the mandate confirmation\n if (paymentIntent.status === \"requires_confirmation\") {\n this.do_payment_confirmation(data);\n } else {\n this.cancel_payment_processing();\n }\n });\n}\n\nStripeACH.prototype.handle_payment_method_setup = function (data) {\n const {client_secret} = data;\n this.stripe.collectBankAccountForSetup({\n clientSecret: client_secret,\n params: {\n payment_method_type: 'us_bank_account',\n payment_method_data: {\n billing_details: {\n name: this.get_customer_name(this.get_billing_prefix()),\n email: this.fields.get('billing_email', null),\n },\n },\n }\n }).then(({setupIntent, error}) => {\n if (error) {\n return this.submit_error(error);\n }\n // show the mandate confirmation\n if (setupIntent.status === \"requires_confirmation\") {\n this.do_setup_confirmation(data);\n } else {\n this.cancel_payment_processing();\n }\n });\n}\n\nStripeACH.prototype.do_payment_confirmation = function ({client_secret, order_id, order_key}) {\n this.stripe.confirmUsBankAccountPayment(client_secret).then(({paymentIntent, error}) => {\n if (error) {\n return this.submit_error(error);\n }\n if (paymentIntent.status === 'requires_payment_method') {\n this.cancel_payment_processing();\n } else if (paymentIntent.status === 'requires_action') {\n // paymentIntent?.next_action?.type === 'verify_with_microdeposits'\n // todo - eventually support microdeposits. For now, show a message\n this.cancel_payment_processing();\n return this.submit_error({code: 'ach_instant_only'});\n } else if (paymentIntent.status === 'processing') {\n this.set_nonce(paymentIntent.payment_method);\n if (this.is_current_page('order_pay')) {\n this.get_form().trigger('submit');\n } else {\n this.process_payment(order_id, order_key);\n }\n }\n });\n}\n\nStripeACH.prototype.do_setup_confirmation = function ({client_secret, order_id, order_key}) {\n this.stripe.confirmUsBankAccountSetup(client_secret).then(({setupIntent, error}) => {\n if (error) {\n return this.submit_error(error);\n }\n if (setupIntent.status === 'requires_payment_method') {\n this.cancel_payment_processing();\n } else if (setupIntent.status === 'requires_action') {\n // paymentIntent?.next_action?.type === 'verify_with_microdeposits'\n // todo - eventually support microdeposits. For now, show a message\n this.cancel_payment_processing();\n return this.submit_error({code: 'ach_instant_only'});\n } else if (setupIntent.status === 'succeeded') {\n this.set_nonce(setupIntent.payment_method);\n if (this.is_current_page('order_pay') || this.is_change_payment_method()) {\n this.get_form().trigger('submit');\n } else {\n this.process_payment(order_id, order_key);\n }\n }\n });\n}\n\nStripeACH.prototype.hide_place_order = function () {\n}\n\nStripeACH.prototype.cancel_payment_processing = function () {\n $(this.container).closest('form').removeClass('processing');\n $(this.container).closest('form')?.unblock();\n}\n\nStripeACH.prototype.fees_enabled = function () {\n return this.params.fees_enabled == \"1\";\n}\n\nStripeACH.prototype.payment_method_selected = function () {\n if (this.fees_enabled()) {\n $(document.body).trigger('update_checkout');\n }\n}\n\nStripeACH.prototype.create_setup_intent = function (data) {\n return new Promise((resolve, reject) => {\n $.ajax({\n method: 'POST',\n dataType: 'json',\n data: {payment_method: this.gateway_id, ...data},\n url: this.params.routes.base_path.replace('%s', 'wc-stripe/v1/subscriptions/setup-intent'),\n beforeSend: this.ajax_before_send.bind(this)\n }).done(response => {\n if (response.code) {\n reject(response.message);\n } else {\n resolve(response);\n }\n }).fail((xhr, textStatus, errorThrown) => {\n this.submit_error(errorThrown);\n });\n })\n}\n\nStripeACH.prototype = {...BaseGateway.prototype, ...CheckoutGateway.prototype, ...StripeACH.prototype};\n\nnew StripeACH(wc_stripe_ach_connections_params);"],"names":["module","exports","obj","key","value","Object","defineProperty","enumerable","configurable","writable","__esModule","window","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","StripeACH","params","BaseGateway","call","this","CheckoutGateway","prototype","initialize","addEventListener","hashchange","bind","document","body","on","payment_method_selected","on_order_pay","checkout_place_order","payment_token_received","apply","e","is_gateway_selected","is_change_payment_method","order_id","order_key","preventDefault","create_setup_intent","then","setup_intent","handle_payment_method_setup","client_secret","is_current_page","process_order_pay","handle_next_action","data","stripe","collectBankAccountForPayment","clientSecret","payment_method_type","payment_method_data","billing_details","name","get_customer_name","get_billing_prefix","email","fields","get","paymentIntent","error","submit_error","status","do_payment_confirmation","cancel_payment_processing","collectBankAccountForSetup","setupIntent","do_setup_confirmation","confirmUsBankAccountPayment","code","set_nonce","payment_method","get_form","trigger","process_payment","confirmUsBankAccountSetup","hide_place_order","container","closest","removeClass","unblock","fees_enabled","Promise","resolve","reject","$","ajax","method","dataType","gateway_id","url","routes","base_path","replace","beforeSend","ajax_before_send","done","response","message","fail","xhr","textStatus","errorThrown","wc_stripe_ach_connections_params"],"sourceRoot":""}
assets/js/frontend/ach-connections.js ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import $ from 'jquery';
2
+ import {BaseGateway, CheckoutGateway} from '@paymentplugins/wc-stripe';
3
+
4
+ function StripeACH(params) {
5
+ BaseGateway.call(this, params);
6
+ CheckoutGateway.call(this);
7
+ }
8
+
9
+
10
+ StripeACH.prototype.initialize = function () {
11
+ window.addEventListener('hashchange', this.hashchange.bind(this));
12
+ $(document.body).on('payment_method_selected', this.payment_method_selected.bind(this));
13
+ $(document.body).on('click', '#place_order', this.on_order_pay.bind(this));
14
+ }
15
+
16
+ StripeACH.prototype.checkout_place_order = function () {
17
+ this.payment_token_received = true;
18
+ return CheckoutGateway.prototype.checkout_place_order.apply(this);
19
+ }
20
+
21
+ StripeACH.prototype.on_order_pay = function (e) {
22
+ if (this.is_gateway_selected()) {
23
+ // create the setup intent.
24
+ if (this.is_change_payment_method()) {
25
+ const {order_id, order_key} = this.params;
26
+ e.preventDefault();
27
+ this.create_setup_intent({order_id, order_key}).then(({setup_intent}) => {
28
+ this.handle_payment_method_setup({
29
+ order_id,
30
+ order_key,
31
+ client_secret: setup_intent.client_secret
32
+ });
33
+ });
34
+ } else if (this.is_current_page('order_pay')) {
35
+ e.preventDefault();
36
+ this.process_order_pay();
37
+ }
38
+ }
39
+ }
40
+
41
+ StripeACH.prototype.handle_next_action = function (data) {
42
+ const {client_secret} = data;
43
+ this.stripe.collectBankAccountForPayment({
44
+ clientSecret: client_secret,
45
+ params: {
46
+ payment_method_type: 'us_bank_account',
47
+ payment_method_data: {
48
+ billing_details: {
49
+ name: this.get_customer_name(this.get_billing_prefix()),
50
+ email: this.fields.get('billing_email', null),
51
+ },
52
+ },
53
+ }
54
+ }).then(({paymentIntent, error}) => {
55
+ if (error) {
56
+ return this.submit_error(error);
57
+ }
58
+ // show the mandate confirmation
59
+ if (paymentIntent.status === "requires_confirmation") {
60
+ this.do_payment_confirmation(data);
61
+ } else {
62
+ this.cancel_payment_processing();
63
+ }
64
+ });
65
+ }
66
+
67
+ StripeACH.prototype.handle_payment_method_setup = function (data) {
68
+ const {client_secret} = data;
69
+ this.stripe.collectBankAccountForSetup({
70
+ clientSecret: client_secret,
71
+ params: {
72
+ payment_method_type: 'us_bank_account',
73
+ payment_method_data: {
74
+ billing_details: {
75
+ name: this.get_customer_name(this.get_billing_prefix()),
76
+ email: this.fields.get('billing_email', null),
77
+ },
78
+ },
79
+ }
80
+ }).then(({setupIntent, error}) => {
81
+ if (error) {
82
+ return this.submit_error(error);
83
+ }
84
+ // show the mandate confirmation
85
+ if (setupIntent.status === "requires_confirmation") {
86
+ this.do_setup_confirmation(data);
87
+ } else {
88
+ this.cancel_payment_processing();
89
+ }
90
+ });
91
+ }
92
+
93
+ StripeACH.prototype.do_payment_confirmation = function ({client_secret, order_id, order_key}) {
94
+ this.stripe.confirmUsBankAccountPayment(client_secret).then(({paymentIntent, error}) => {
95
+ if (error) {
96
+ return this.submit_error(error);
97
+ }
98
+ if (paymentIntent.status === 'requires_payment_method') {
99
+ this.cancel_payment_processing();
100
+ } else if (paymentIntent.status === 'requires_action') {
101
+ // paymentIntent?.next_action?.type === 'verify_with_microdeposits'
102
+ // todo - eventually support microdeposits. For now, show a message
103
+ this.cancel_payment_processing();
104
+ return this.submit_error({code: 'ach_instant_only'});
105
+ } else if (paymentIntent.status === 'processing') {
106
+ this.set_nonce(paymentIntent.payment_method);
107
+ if (this.is_current_page('order_pay')) {
108
+ this.get_form().trigger('submit');
109
+ } else {
110
+ this.process_payment(order_id, order_key);
111
+ }
112
+ }
113
+ });
114
+ }
115
+
116
+ StripeACH.prototype.do_setup_confirmation = function ({client_secret, order_id, order_key}) {
117
+ this.stripe.confirmUsBankAccountSetup(client_secret).then(({setupIntent, error}) => {
118
+ if (error) {
119
+ return this.submit_error(error);
120
+ }
121
+ if (setupIntent.status === 'requires_payment_method') {
122
+ this.cancel_payment_processing();
123
+ } else if (setupIntent.status === 'requires_action') {
124
+ // paymentIntent?.next_action?.type === 'verify_with_microdeposits'
125
+ // todo - eventually support microdeposits. For now, show a message
126
+ this.cancel_payment_processing();
127
+ return this.submit_error({code: 'ach_instant_only'});
128
+ } else if (setupIntent.status === 'succeeded') {
129
+ this.set_nonce(setupIntent.payment_method);
130
+ if (this.is_current_page('order_pay') || this.is_change_payment_method()) {
131
+ this.get_form().trigger('submit');
132
+ } else {
133
+ this.process_payment(order_id, order_key);
134
+ }
135
+ }
136
+ });
137
+ }
138
+
139
+ StripeACH.prototype.hide_place_order = function () {
140
+ }
141
+
142
+ StripeACH.prototype.cancel_payment_processing = function () {
143
+ $(this.container).closest('form').removeClass('processing');
144
+ $(this.container).closest('form')?.unblock();
145
+ }
146
+
147
+ StripeACH.prototype.fees_enabled = function () {
148
+ return this.params.fees_enabled == "1";
149
+ }
150
+
151
+ StripeACH.prototype.payment_method_selected = function () {
152
+ if (this.fees_enabled()) {
153
+ $(document.body).trigger('update_checkout');
154
+ }
155
+ }
156
+
157
+ StripeACH.prototype.create_setup_intent = function (data) {
158
+ return new Promise((resolve, reject) => {
159
+ $.ajax({
160
+ method: 'POST',
161
+ dataType: 'json',
162
+ data: {payment_method: this.gateway_id, ...data},
163
+ url: this.params.routes.base_path.replace('%s', 'wc-stripe/v1/subscriptions/setup-intent'),
164
+ beforeSend: this.ajax_before_send.bind(this)
165
+ }).done(response => {
166
+ if (response.code) {
167
+ reject(response.message);
168
+ } else {
169
+ resolve(response);
170
+ }
171
+ }).fail((xhr, textStatus, errorThrown) => {
172
+ this.submit_error(errorThrown);
173
+ });
174
+ })
175
+ }
176
+
177
+ StripeACH.prototype = {...BaseGateway.prototype, ...CheckoutGateway.prototype, ...StripeACH.prototype};
178
+
179
+ new StripeACH(wc_stripe_ach_connections_params);
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.27\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-09-25T16:05:07+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"
@@ -300,7 +300,7 @@ msgstr ""
300
  msgid "You do not have permissions to access this resource."
301
  msgstr ""
302
 
303
- #: includes/admin/class-wc-stripe-admin-assets.php:73
304
  msgid "Are you sure you want to delete your connection data?"
305
  msgstr ""
306
 
@@ -1026,7 +1026,7 @@ msgstr ""
1026
  msgid "Payment authorization failed. Please select another payment method."
1027
  msgstr ""
1028
 
1029
- #: includes/class-wc-stripe-rest-api.php:46
1030
  msgid "%1$s is an invalid controller name."
1031
  msgstr ""
1032
 
@@ -1764,7 +1764,6 @@ msgstr ""
1764
 
1765
  #: includes/gateways/settings/ach-settings.php:40
1766
  #: includes/tokens/class-wc-payment-token-stripe-ach.php:104
1767
- #: includes/tokens/class-wc-payment-token-stripe-plaid.php:92
1768
  msgid "Bank Payment"
1769
  msgstr ""
1770
 
@@ -2203,18 +2202,14 @@ msgstr ""
2203
  #: includes/tokens/class-wc-payment-token-stripe-ach.php:82
2204
  #: includes/tokens/class-wc-payment-token-stripe-ach.php:87
2205
  #: includes/tokens/class-wc-payment-token-stripe-cc.php:96
2206
- #: includes/tokens/class-wc-payment-token-stripe-plaid.php:70
2207
- #: includes/tokens/class-wc-payment-token-stripe-plaid.php:75
2208
  msgid "Type Ending In"
2209
  msgstr ""
2210
 
2211
  #: includes/tokens/class-wc-payment-token-stripe-ach.php:84
2212
- #: includes/tokens/class-wc-payment-token-stripe-plaid.php:72
2213
  msgid "{bank_name} ending in {last4}"
2214
  msgstr ""
2215
 
2216
  #: includes/tokens/class-wc-payment-token-stripe-ach.php:89
2217
- #: includes/tokens/class-wc-payment-token-stripe-plaid.php:77
2218
  msgid "{bank_name} **** {last4}"
2219
  msgstr ""
2220
 
@@ -2222,7 +2217,6 @@ msgstr ""
2222
  #: includes/tokens/class-wc-payment-token-stripe-becs.php:63
2223
  #: includes/tokens/class-wc-payment-token-stripe-cc.php:131
2224
  #: includes/tokens/class-wc-payment-token-stripe-local-payment.php:34
2225
- #: includes/tokens/class-wc-payment-token-stripe-plaid.php:80
2226
  #: includes/tokens/class-wc-payment-token-stripe-sepa.php:63
2227
  msgid "Gateway Title"
2228
  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.28\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-09-26T20:41:53+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"
300
  msgid "You do not have permissions to access this resource."
301
  msgstr ""
302
 
303
+ #: includes/admin/class-wc-stripe-admin-assets.php:72
304
  msgid "Are you sure you want to delete your connection data?"
305
  msgstr ""
306
 
1026
  msgid "Payment authorization failed. Please select another payment method."
1027
  msgstr ""
1028
 
1029
+ #: includes/class-wc-stripe-rest-api.php:45
1030
  msgid "%1$s is an invalid controller name."
1031
  msgstr ""
1032
 
1764
 
1765
  #: includes/gateways/settings/ach-settings.php:40
1766
  #: includes/tokens/class-wc-payment-token-stripe-ach.php:104
 
1767
  msgid "Bank Payment"
1768
  msgstr ""
1769
 
2202
  #: includes/tokens/class-wc-payment-token-stripe-ach.php:82
2203
  #: includes/tokens/class-wc-payment-token-stripe-ach.php:87
2204
  #: includes/tokens/class-wc-payment-token-stripe-cc.php:96
 
 
2205
  msgid "Type Ending In"
2206
  msgstr ""
2207
 
2208
  #: includes/tokens/class-wc-payment-token-stripe-ach.php:84
 
2209
  msgid "{bank_name} ending in {last4}"
2210
  msgstr ""
2211
 
2212
  #: includes/tokens/class-wc-payment-token-stripe-ach.php:89
 
2213
  msgid "{bank_name} **** {last4}"
2214
  msgstr ""
2215
 
2217
  #: includes/tokens/class-wc-payment-token-stripe-becs.php:63
2218
  #: includes/tokens/class-wc-payment-token-stripe-cc.php:131
2219
  #: includes/tokens/class-wc-payment-token-stripe-local-payment.php:34
 
2220
  #: includes/tokens/class-wc-payment-token-stripe-sepa.php:63
2221
  msgid "Gateway Title"
2222
  msgstr ""
includes/admin/class-wc-stripe-admin-assets.php CHANGED
@@ -16,7 +16,6 @@ class WC_Stripe_Admin_Assets {
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/';
@@ -103,32 +102,6 @@ class WC_Stripe_Admin_Assets {
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( '/wc-stripe/v1/admin/feedback' )
129
- ] );
130
- } );
131
- }*/
132
  }
133
 
134
  public static function localize_scripts() {
16
  }
17
 
18
  public function enqueue_scripts() {
 
19
  $screen = get_current_screen();
20
  $screen_id = $screen ? $screen->id : '';
21
  $js_path = stripe_wc()->assets_url() . 'js/';
102
  }
103
  }
104
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  }
106
 
107
  public static function localize_scripts() {
includes/class-stripe.php CHANGED
@@ -26,7 +26,7 @@ class WC_Stripe_Manager {
26
  *
27
  * @var string
28
  */
29
- public $version = '3.3.27';
30
 
31
  /**
32
  *
26
  *
27
  * @var string
28
  */
29
+ public $version = '3.3.28';
30
 
31
  /**
32
  *
includes/class-wc-stripe-rest-api.php CHANGED
@@ -16,7 +16,6 @@ defined( 'ABSPATH' ) || exit();
16
  * @property WC_Stripe_Rest_Controller $product_data
17
  * @property WC_Stripe_Rest_Controller $source
18
  * @property \WC_Stripe_Rest_Controller $signup
19
- * @property \WC_Stripe_Rest_Controller $feedback
20
  */
21
  class WC_Stripe_Rest_API {
22
 
@@ -67,7 +66,6 @@ class WC_Stripe_Rest_API {
67
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/controllers/class-wc-stripe-controller-product-data.php';
68
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/controllers/class-wc-stripe-controller-source.php';
69
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/controllers/class-wc-stripe-controller-signup.php';
70
- include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/controllers/class-wc-stripe-controller-feedback.php';
71
 
72
  foreach ( $this->get_controllers() as $key => $class_name ) {
73
  if ( class_exists( $class_name ) ) {
@@ -98,8 +96,7 @@ class WC_Stripe_Rest_API {
98
  'webhook' => 'WC_Stripe_Controller_Webhook',
99
  'product_data' => 'WC_Stripe_Controller_Product_Data',
100
  'source' => 'WC_Stripe_Controller_Source',
101
- 'signup' => 'WC_Stripe_Controller_SignUp',
102
- 'feedback' => 'WC_Stripe_Controller_Feedback'
103
  );
104
 
105
  /**
16
  * @property WC_Stripe_Rest_Controller $product_data
17
  * @property WC_Stripe_Rest_Controller $source
18
  * @property \WC_Stripe_Rest_Controller $signup
 
19
  */
20
  class WC_Stripe_Rest_API {
21
 
66
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/controllers/class-wc-stripe-controller-product-data.php';
67
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/controllers/class-wc-stripe-controller-source.php';
68
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/controllers/class-wc-stripe-controller-signup.php';
 
69
 
70
  foreach ( $this->get_controllers() as $key => $class_name ) {
71
  if ( class_exists( $class_name ) ) {
96
  'webhook' => 'WC_Stripe_Controller_Webhook',
97
  'product_data' => 'WC_Stripe_Controller_Product_Data',
98
  'source' => 'WC_Stripe_Controller_Source',
99
+ 'signup' => 'WC_Stripe_Controller_SignUp'
 
100
  );
101
 
102
  /**
includes/class-wc-stripe-update.php CHANGED
@@ -25,7 +25,7 @@ class WC_Stripe_Update {
25
  '3.3.21' => 'update-3.3.21.php',
26
  '3.3.23' => 'update-3.3.23.php',
27
  '3.3.24' => 'update-3.3.24.php',
28
- '3.3.27' => 'update-3.3.27.php'
29
  );
30
 
31
  public static function init() {
25
  '3.3.21' => 'update-3.3.21.php',
26
  '3.3.23' => 'update-3.3.23.php',
27
  '3.3.24' => 'update-3.3.24.php',
28
+ '3.3.28' => 'update-3.3.28.php'
29
  );
30
 
31
  public static function init() {
includes/updates/update-3.3.28.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ defined( 'ABSPATH' ) || exit();
4
+
5
+ if ( function_exists( 'WC' ) ) {
6
+ $plaid_settings = get_option( 'woocommerce_stripe_plaid_settings', false );
7
+
8
+ // only update if the plaid settings don't exist.
9
+ if ( ! $plaid_settings ) {
10
+ // ensure the update doesn't timeout
11
+ wc_set_time_limit( 0 );
12
+ $ach_gateway = WC()->payment_gateways()->payment_gateways()['stripe_ach'];
13
+ if ( $ach_gateway ) {
14
+ $plaid_settings = $ach_gateway->settings;
15
+
16
+ $new_settings = [
17
+ 'enabled' => $ach_gateway->get_option( 'enabled' ),
18
+ 'title_text' => $ach_gateway->get_option( 'title_text' ),
19
+ 'description' => $ach_gateway->get_option( 'description' ),
20
+ 'order_button_text' => $ach_gateway->get_option( 'order_button_text' ),
21
+ 'business_name' => $ach_gateway->get_option( 'client_name' ),
22
+ 'method_format' => $ach_gateway->get_option( 'method_format' ),
23
+ 'order_status' => $ach_gateway->get_option( 'order_status' ),
24
+ 'fee' => $ach_gateway->get_option( 'fee' )
25
+ ];
26
+
27
+ // If plaid was enabled, add an option to the new settings
28
+ if ( wc_string_to_bool( $ach_gateway->get_option( 'enabled' ) ) ) {
29
+ $new_settings['plaid_enabled'] = 'yes';
30
+ }
31
+
32
+ // rename the stripe_ach settings to stripe_plaid
33
+ update_option( 'woocommerce_stripe_plaid_settings', $plaid_settings );
34
+
35
+ update_option( 'woocommerce_stripe_ach_settings', $new_settings );
36
+ }
37
+ }
38
+ }
packages/subscriptions/src/Rest/Routes/ChangePaymentMethodRoute.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace PaymentPlugins\Stripe\WooCommerceSubscriptions\Rest\Routes;
4
+
5
+ class ChangePaymentMethodRoute extends \WC_Stripe_Rest_Controller {
6
+
7
+ protected $namespace = 'subscriptions';
8
+
9
+ public function register_routes() {
10
+ register_rest_route( $this->rest_uri(), 'setup-intent', [
11
+ 'methods' => \WP_REST_Server::CREATABLE,
12
+ 'permission_callback' => '__return_true',
13
+ 'callback' => [ $this, 'create_setup_intent' ],
14
+ 'args' => [ 'payment_method' => [ 'required' => true ] ]
15
+ ] );
16
+ }
17
+
18
+ public function create_setup_intent( \WP_REST_Request $request ) {
19
+ try {
20
+ $order = wc_get_order( absint( $request->get_param( 'order_id' ) ) );
21
+
22
+ // validate the order key
23
+ if ( ! $order->key_is_valid( $request->get_param( 'order_key' ) ) ) {
24
+ throw new Exception( __( 'Invalid order key.', 'woo-stripe-payment' ) );
25
+ }
26
+ /**
27
+ * @var \WC_Payment_Gateway_Stripe $payment_method
28
+ */
29
+ $payment_method = WC()->payment_gateways()->payment_gateways()[ $request['payment_method'] ];
30
+ $args = [
31
+ 'confirm' => false,
32
+ 'usage' => 'off_session',
33
+ 'payment_method_types' => [ $payment_method->get_payment_method_type() ],
34
+ 'customer' => wc_stripe_get_customer_id( $order->get_customer_id() ),
35
+ 'metadata' => [
36
+ 'gateway_id' => $payment_method->id,
37
+ 'order_id' => $order->get_id()
38
+ ],
39
+ ];
40
+ $setup_intent = $payment_method->gateway->setupIntents->create( $args );
41
+ if ( is_wp_error( $setup_intent ) ) {
42
+ throw new \Exception( $setup_intent->get_error_message() );
43
+ }
44
+
45
+ return \rest_ensure_response( [ 'setup_intent' => $setup_intent ] );
46
+ } catch ( \Exception $e ) {
47
+ return new \WP_Error( 'setup-intent-error', $e->getMessage(), [ 'status' => 200 ] );
48
+ }
49
+ }
50
+
51
+ }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: stripe, ach, klarna, credit card, apple pay, google pay, ideal, sepa, sofo
4
  Requires at least: 3.0.1
5
  Tested up to: 6.0
6
  Requires PHP: 5.6
7
- Stable tag: 3.3.27
8
  Copyright: Payment Plugins
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -62,7 +62,10 @@ If you're site is not loading over https, then Stripe won't render the Payment R
62
  9. Stripe Link for high conversion
63
 
64
  == Changelog ==
65
- = 3.3.27 - 9/21/22 =
 
 
 
66
  * Fixed - Cast float to payment balance fee and net values
67
  * Fixed - If refund is created in stripe.com dashboard, always take the latest refund from the list of refunds.
68
  * Updated - WC tested up to 6.9
4
  Requires at least: 3.0.1
5
  Tested up to: 6.0
6
  Requires PHP: 5.6
7
+ Stable tag: 3.3.28
8
  Copyright: Payment Plugins
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
62
  9. Stripe Link for high conversion
63
 
64
  == Changelog ==
65
+ = 3.3.28 - 9/26/22 =
66
+ * Fixed - ACH javascript files not included in version 3.3.27 build
67
+ * Updated - Removed admin feedback code
68
+ = 3.3.27 - 9/25/22 =
69
  * Fixed - Cast float to payment balance fee and net values
70
  * Fixed - If refund is created in stripe.com dashboard, always take the latest refund from the list of refunds.
71
  * Updated - WC tested up to 6.9
stripe-payments.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Payment Plugins for Stripe WooCommerce
5
  * Plugin URI: https://docs.paymentplugins.com/wc-stripe/config/
6
  * Description: Accept Credit Cards, Google Pay, Apple Pay, ACH, Klarna and more using Stripe.
7
- * Version: 3.3.27
8
  * Author: Payment Plugins, support@paymentplugins.com
9
  * Text Domain: woo-stripe-payment
10
  * Domain Path: /i18n/languages/
4
  * Plugin Name: Payment Plugins for Stripe WooCommerce
5
  * Plugin URI: https://docs.paymentplugins.com/wc-stripe/config/
6
  * Description: Accept Credit Cards, Google Pay, Apple Pay, ACH, Klarna and more using Stripe.
7
+ * Version: 3.3.28
8
  * Author: Payment Plugins, support@paymentplugins.com
9
  * Text Domain: woo-stripe-payment
10
  * Domain Path: /i18n/languages/
templates/checkout/ach-connections.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @var \WC_Payment_Gateway_Stripe_ACH $gateway
4
+ */
5
+
6
+ ?>
7
+ <div id="wc-stripe-ach-container">
8
+ <p class="wc-stripe-ach__mandate">
9
+ <?php echo esc_html( $gateway->get_mandate_text() ) ?>
10
+ </p>
11
+ </div>
vendor/autoload.php CHANGED
@@ -9,4 +9,4 @@ if (PHP_VERSION_ID < 50600) {
9
 
10
  require_once __DIR__ . '/composer/autoload_real.php';
11
 
12
- return ComposerAutoloaderInit218d904b16550f1c042df93b0763feef::getLoader();
9
 
10
  require_once __DIR__ . '/composer/autoload_real.php';
11
 
12
+ return ComposerAutoloaderInit8dff8be76da399e845ffbeeee3ec1397::getLoader();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit218d904b16550f1c042df93b0763feef
6
  {
7
  private static $loader;
8
 
@@ -24,12 +24,12 @@ class ComposerAutoloaderInit218d904b16550f1c042df93b0763feef
24
 
25
  require __DIR__ . '/platform_check.php';
26
 
27
- spl_autoload_register(array('ComposerAutoloaderInit218d904b16550f1c042df93b0763feef', 'loadClassLoader'), true, true);
28
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
29
- spl_autoload_unregister(array('ComposerAutoloaderInit218d904b16550f1c042df93b0763feef', 'loadClassLoader'));
30
 
31
  require __DIR__ . '/autoload_static.php';
32
- call_user_func(\Composer\Autoload\ComposerStaticInit218d904b16550f1c042df93b0763feef::getInitializer($loader));
33
 
34
  $loader->register(true);
35
 
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit8dff8be76da399e845ffbeeee3ec1397
6
  {
7
  private static $loader;
8
 
24
 
25
  require __DIR__ . '/platform_check.php';
26
 
27
+ spl_autoload_register(array('ComposerAutoloaderInit8dff8be76da399e845ffbeeee3ec1397', 'loadClassLoader'), true, true);
28
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
29
+ spl_autoload_unregister(array('ComposerAutoloaderInit8dff8be76da399e845ffbeeee3ec1397', 'loadClassLoader'));
30
 
31
  require __DIR__ . '/autoload_static.php';
32
+ call_user_func(\Composer\Autoload\ComposerStaticInit8dff8be76da399e845ffbeeee3ec1397::getInitializer($loader));
33
 
34
  $loader->register(true);
35
 
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit218d904b16550f1c042df93b0763feef
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'S' =>
@@ -70,9 +70,9 @@ class ComposerStaticInit218d904b16550f1c042df93b0763feef
70
  public static function getInitializer(ClassLoader $loader)
71
  {
72
  return \Closure::bind(function () use ($loader) {
73
- $loader->prefixLengthsPsr4 = ComposerStaticInit218d904b16550f1c042df93b0763feef::$prefixLengthsPsr4;
74
- $loader->prefixDirsPsr4 = ComposerStaticInit218d904b16550f1c042df93b0763feef::$prefixDirsPsr4;
75
- $loader->classMap = ComposerStaticInit218d904b16550f1c042df93b0763feef::$classMap;
76
 
77
  }, null, ClassLoader::class);
78
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit8dff8be76da399e845ffbeeee3ec1397
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'S' =>
70
  public static function getInitializer(ClassLoader $loader)
71
  {
72
  return \Closure::bind(function () use ($loader) {
73
+ $loader->prefixLengthsPsr4 = ComposerStaticInit8dff8be76da399e845ffbeeee3ec1397::$prefixLengthsPsr4;
74
+ $loader->prefixDirsPsr4 = ComposerStaticInit8dff8be76da399e845ffbeeee3ec1397::$prefixDirsPsr4;
75
+ $loader->classMap = ComposerStaticInit8dff8be76da399e845ffbeeee3ec1397::$classMap;
76
 
77
  }, null, ClassLoader::class);
78
  }
vendor/composer/installed.php CHANGED
@@ -3,7 +3,7 @@
3
  'name' => '__root__',
4
  'pretty_version' => 'dev-master',
5
  'version' => 'dev-master',
6
- 'reference' => 'e12028a6cf77d4faa613367271af66654797aed2',
7
  'type' => 'library',
8
  'install_path' => __DIR__ . '/../../',
9
  'aliases' => array(),
@@ -13,7 +13,7 @@
13
  '__root__' => array(
14
  'pretty_version' => 'dev-master',
15
  'version' => 'dev-master',
16
- 'reference' => 'e12028a6cf77d4faa613367271af66654797aed2',
17
  'type' => 'library',
18
  'install_path' => __DIR__ . '/../../',
19
  'aliases' => array(),
3
  'name' => '__root__',
4
  'pretty_version' => 'dev-master',
5
  'version' => 'dev-master',
6
+ 'reference' => '334d4afcae7a5ac6709623a4c12494c8ff196798',
7
  'type' => 'library',
8
  'install_path' => __DIR__ . '/../../',
9
  'aliases' => array(),
13
  '__root__' => array(
14
  'pretty_version' => 'dev-master',
15
  'version' => 'dev-master',
16
+ 'reference' => '334d4afcae7a5ac6709623a4c12494c8ff196798',
17
  'type' => 'library',
18
  'install_path' => __DIR__ . '/../../',
19
  'aliases' => array(),