Payment Plugins for Stripe WooCommerce - Version 3.2.2

Version Description

  • Fixed - 403 for logged out user when link-token fetched on checkout page
  • Added - Payment method format for GPay. Example: Visa 1111 (Google Pay)
  • Added - Filter for product and cart page checkout so 3rd party plugins can add custom fields to checkout process
  • Updated - Stripe PHP lib version to 7.52.0
Download this release

Release Info

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

Code changes from version 3.2.1 to 3.2.2

Files changed (32) hide show
  1. assets/js/admin/meta-boxes-product-data.js +125 -122
  2. assets/js/frontend/ach-payments.js +2 -1
  3. assets/js/frontend/wc-stripe.js +29 -19
  4. assets/js/frontend/wc-stripe.min.js +2 -2
  5. i18n/languages/woo-stripe-payment.pot +62 -33
  6. includes/class-stripe.php +1 -1
  7. includes/class-wc-stripe-frontend-scripts.php +1 -0
  8. includes/controllers/class-wc-stripe-controller-plaid.php +3 -3
  9. includes/gateways/settings/googlepay-settings.php +1 -1
  10. includes/tokens/class-wc-payment-token-stripe-cc.php +2 -2
  11. includes/tokens/class-wc-payment-token-stripe-googlepay.php +10 -0
  12. includes/traits/wc-stripe-controller-traits.php +15 -0
  13. readme.txt +6 -1
  14. stripe-payments.php +1 -1
  15. vendor/autoload.php +1 -1
  16. vendor/composer/autoload_real.php +4 -4
  17. vendor/composer/autoload_static.php +3 -3
  18. vendor/composer/installed.json +6 -6
  19. vendor/stripe/stripe-php/CHANGELOG.md +9 -0
  20. vendor/stripe/stripe-php/VERSION +1 -1
  21. vendor/stripe/stripe-php/lib/BankAccount.php +1 -0
  22. vendor/stripe/stripe-php/lib/Card.php +2 -2
  23. vendor/stripe/stripe-php/lib/Charge.php +1 -1
  24. vendor/stripe/stripe-php/lib/Checkout/Session.php +6 -1
  25. vendor/stripe/stripe-php/lib/Issuing/Dispute.php +23 -0
  26. vendor/stripe/stripe-php/lib/Issuing/Transaction.php +1 -0
  27. vendor/stripe/stripe-php/lib/PaymentIntent.php +1 -1
  28. vendor/stripe/stripe-php/lib/PaymentMethod.php +1 -0
  29. vendor/stripe/stripe-php/lib/Reporting/ReportRun.php +1 -1
  30. vendor/stripe/stripe-php/lib/Service/Issuing/DisputeService.php +20 -0
  31. vendor/stripe/stripe-php/lib/Stripe.php +1 -1
  32. vendor/stripe/stripe-php/lib/WebhookSignature.php +1 -1
assets/js/admin/meta-boxes-product-data.js CHANGED
@@ -1,133 +1,136 @@
1
- (function($) {
2
- function Product() {
3
- this.init();
4
- }
5
 
6
- Product.prototype.params = {
7
- loadingClass: 'woocommerce-input-toggle--loading',
8
- enabledClass: 'woocommerce-input-toggle--enabled',
9
- disabledClass: 'woocommerce-input-toggle--disabled'
10
- }
11
 
12
- Product.prototype.init = function() {
13
- $('table.wc_gateways').sortable({
14
- items: 'tr',
15
- axis: 'y',
16
- cursor: 'move',
17
- scrollSensitivity: 40,
18
- forcePlaceholderSize: true,
19
- helper: 'clone',
20
- opacity: 0.65,
21
- placeholder: 'wc-metabox-sortable-placeholder',
22
- start: function(event, ui) {
23
- ui.item.css('background-color', '#f6f6f6');
24
- },
25
- stop: function(event, ui) {
26
- ui.item.removeAttr('style');
27
- }
28
- });
 
 
 
29
 
30
- $('table.wc_gateways').find('.wc-move-down, .wc-move-up').on('click', this.move_gateway.bind(this));
31
- $('table.wc_gateways .wc-stripe-product-gateway-enabled').on('click', this.enable_gateway.bind(this));
32
- $('.wc-stripe-save-product-data').on('click', this.save.bind(this));
33
- $('#stripe_product_data select').on('change', this.setting_changed.bind(this));
34
- }
35
 
36
- /**
37
- * [Move the payment gateway up or down]
38
- * @return {[type]} [description]
39
- */
40
- Product.prototype.move_gateway = function(e) {
41
- var $this = $(e.currentTarget);
42
- var $row = $this.closest('tr');
43
 
44
- var moveDown = $this.is('.wc-move-down');
45
 
46
- if (moveDown) {
47
- var $next = $row.next('tr');
48
- if ($next && $next.length) {
49
- $next.after($row);
50
- }
51
- } else {
52
- var $prev = $row.prev('tr');
53
- if ($prev && $prev.length) {
54
- $prev.before($row);
55
- }
56
- }
57
- this.setting_changed();
58
- }
59
 
60
- Product.prototype.setting_changed = function() {
61
- $('#wc_stripe_update_product').val('true');
62
- }
63
 
64
- /**
65
- * [enable_gateway description]
66
- * @param {[type]} e [description]
67
- * @return {[type]} [description]
68
- */
69
- Product.prototype.enable_gateway = function(e) {
70
- e.preventDefault();
71
- var $el = $(e.currentTarget),
72
- $row = $el.closest('tr'),
73
- $toggle = $el.find('.woocommerce-input-toggle');
74
- $toggle.addClass(this.params.loadingClass);
75
- $.ajax({
76
- url: wc_stripe_product_params.routes.enable_gateway,
77
- method: 'POST',
78
- dataType: 'json',
79
- data: {
80
- _wpnonce: wc_stripe_product_params._wpnonce,
81
- product_id: $('#post_ID').val(),
82
- gateway_id: $row.data('gateway_id')
83
- }
84
- }).done(function(response) {
85
- $toggle.removeClass(this.params.loadingClass);
86
- if (response.enabled) {
87
- $toggle.addClass(this.params.enabledClass).removeClass(this.params.disabledClass);
88
- } else {
89
- $toggle.removeClass(this.params.enabledClass).addClass(this.params.disabledClass);
90
- }
91
- }.bind(this)).fail(function(xhr, errorStatus, errorThrown) {
92
- $toggle.removeClass(this.params.loadingClass);
93
- }.bind(this))
94
- }
95
 
96
- Product.prototype.save = function(e) {
97
- e.preventDefault();
98
- var $button = $(e.currentTarget);
99
- var gateways = [],
100
- charge_types = [];
101
- $('[name^="stripe_gateway_order"]').each(function(idx, el) {
102
- gateways.push($(el).val());
103
- });
104
- $('[name^="stripe_capture_type"]').each(function(idx, el) {
105
- charge_types.push({
106
- gateway: $(el).closest('tr').data('gateway_id'),
107
- value: $(el).val()
108
- });
109
- })
110
- $button.toggleClass('disabled').prop('disabled', true);
111
- $button.next('.spinner').toggleClass('is-active');
112
- $.ajax({
113
- url: wc_stripe_product_params.routes.save,
114
- method: 'POST',
115
- dataType: 'json',
116
- data: {
117
- _wpnonce: wc_stripe_product_params._wpnonce,
118
- gateways: gateways,
119
- charge_types: charge_types,
120
- product_id: $('#post_ID').val(),
121
- position: $('#_stripe_button_position').val()
122
- }
123
- }).done(function(response) {
124
- $button.toggleClass('disabled').prop('disabled', false);
125
- $button.next('.spinner').toggleClass('is-active');
126
- }).fail(function(xhr, errorStatus, errorthrown) {
127
- $button.toggleClass('disabled').prop('disabled', false);
128
- $button.next('.spinner').toggleClass('is-active');
129
- }.bind(this))
130
- }
131
 
132
- new Product();
133
  }(jQuery))
1
+ (function ($) {
2
+ function Product() {
3
+ this.init();
4
+ }
5
 
6
+ Product.prototype.params = {
7
+ loadingClass: 'woocommerce-input-toggle--loading',
8
+ enabledClass: 'woocommerce-input-toggle--enabled',
9
+ disabledClass: 'woocommerce-input-toggle--disabled'
10
+ }
11
 
12
+ Product.prototype.init = function () {
13
+ $('table.wc_gateways').sortable({
14
+ items: 'tr',
15
+ axis: 'y',
16
+ cursor: 'move',
17
+ scrollSensitivity: 40,
18
+ forcePlaceholderSize: true,
19
+ helper: 'clone',
20
+ opacity: 0.65,
21
+ placeholder: 'wc-metabox-sortable-placeholder',
22
+ start: function (event, ui) {
23
+ ui.item.css('background-color', '#f6f6f6');
24
+ },
25
+ stop: function (event, ui) {
26
+ ui.item.removeAttr('style');
27
+ },
28
+ change: function () {
29
+ this.setting_changed();
30
+ }.bind(this)
31
+ });
32
 
33
+ $('table.wc_gateways').find('.wc-move-down, .wc-move-up').on('click', this.move_gateway.bind(this));
34
+ $('table.wc_gateways .wc-stripe-product-gateway-enabled').on('click', this.enable_gateway.bind(this));
35
+ $('.wc-stripe-save-product-data').on('click', this.save.bind(this));
36
+ $('#stripe_product_data select').on('change', this.setting_changed.bind(this));
37
+ }
38
 
39
+ /**
40
+ * [Move the payment gateway up or down]
41
+ * @return {[type]} [description]
42
+ */
43
+ Product.prototype.move_gateway = function (e) {
44
+ var $this = $(e.currentTarget);
45
+ var $row = $this.closest('tr');
46
 
47
+ var moveDown = $this.is('.wc-move-down');
48
 
49
+ if (moveDown) {
50
+ var $next = $row.next('tr');
51
+ if ($next && $next.length) {
52
+ $next.after($row);
53
+ }
54
+ } else {
55
+ var $prev = $row.prev('tr');
56
+ if ($prev && $prev.length) {
57
+ $prev.before($row);
58
+ }
59
+ }
60
+ this.setting_changed();
61
+ }
62
 
63
+ Product.prototype.setting_changed = function () {
64
+ $('#wc_stripe_update_product').val('true');
65
+ }
66
 
67
+ /**
68
+ * [enable_gateway description]
69
+ * @param {[type]} e [description]
70
+ * @return {[type]} [description]
71
+ */
72
+ Product.prototype.enable_gateway = function (e) {
73
+ e.preventDefault();
74
+ var $el = $(e.currentTarget),
75
+ $row = $el.closest('tr'),
76
+ $toggle = $el.find('.woocommerce-input-toggle');
77
+ $toggle.addClass(this.params.loadingClass);
78
+ $.ajax({
79
+ url: wc_stripe_product_params.routes.enable_gateway,
80
+ method: 'POST',
81
+ dataType: 'json',
82
+ data: {
83
+ _wpnonce: wc_stripe_product_params._wpnonce,
84
+ product_id: $('#post_ID').val(),
85
+ gateway_id: $row.data('gateway_id')
86
+ }
87
+ }).done(function (response) {
88
+ $toggle.removeClass(this.params.loadingClass);
89
+ if (response.enabled) {
90
+ $toggle.addClass(this.params.enabledClass).removeClass(this.params.disabledClass);
91
+ } else {
92
+ $toggle.removeClass(this.params.enabledClass).addClass(this.params.disabledClass);
93
+ }
94
+ }.bind(this)).fail(function (xhr, errorStatus, errorThrown) {
95
+ $toggle.removeClass(this.params.loadingClass);
96
+ }.bind(this))
97
+ }
98
 
99
+ Product.prototype.save = function (e) {
100
+ e.preventDefault();
101
+ var $button = $(e.currentTarget);
102
+ var gateways = [],
103
+ charge_types = [];
104
+ $('[name^="stripe_gateway_order"]').each(function (idx, el) {
105
+ gateways.push($(el).val());
106
+ });
107
+ $('[name^="stripe_capture_type"]').each(function (idx, el) {
108
+ charge_types.push({
109
+ gateway: $(el).closest('tr').data('gateway_id'),
110
+ value: $(el).val()
111
+ });
112
+ })
113
+ $button.toggleClass('disabled').prop('disabled', true);
114
+ $button.next('.spinner').toggleClass('is-active');
115
+ $.ajax({
116
+ url: wc_stripe_product_params.routes.save,
117
+ method: 'POST',
118
+ dataType: 'json',
119
+ data: {
120
+ _wpnonce: wc_stripe_product_params._wpnonce,
121
+ gateways: gateways,
122
+ charge_types: charge_types,
123
+ product_id: $('#post_ID').val(),
124
+ position: $('#_stripe_button_position').val()
125
+ }
126
+ }).done(function (response) {
127
+ $button.toggleClass('disabled').prop('disabled', false);
128
+ $button.next('.spinner').toggleClass('is-active');
129
+ }).fail(function (xhr, errorStatus, errorthrown) {
130
+ $button.toggleClass('disabled').prop('disabled', false);
131
+ $button.next('.spinner').toggleClass('is-active');
132
+ }.bind(this))
133
+ }
134
 
135
+ new Product();
136
  }(jQuery))
assets/js/frontend/ach-payments.js CHANGED
@@ -29,6 +29,7 @@
29
  this.set_nonce(public_token);
30
  this.set_metadata(metadata);
31
  this.fields.toFormFields();
 
32
  this.get_form().submit();
33
  }.bind(this),
34
  onExit: function (err, metadata) {
@@ -76,7 +77,7 @@
76
  $.post({
77
  url: this.params.routes.link_token,
78
  dataType: 'json',
79
- data: {_wpnonce: this.params.rest_nonce}
80
  }).done(function (response) {
81
  resolve(response.token);
82
  }.bind(this)).fail(function (xhr, textStatus, errorThrown) {
29
  this.set_nonce(public_token);
30
  this.set_metadata(metadata);
31
  this.fields.toFormFields();
32
+ $('#place_order').text($('#place_order').data('value'));
33
  this.get_form().submit();
34
  }.bind(this),
35
  onExit: function (err, metadata) {
77
  $.post({
78
  url: this.params.routes.link_token,
79
  dataType: 'json',
80
+ data: {wp_rest_nonce: this.params.rest_nonce}
81
  }).done(function (response) {
82
  resolve(response.token);
83
  }.bind(this)).fail(function (xhr, textStatus, errorThrown) {
assets/js/frontend/wc-stripe.js CHANGED
@@ -221,21 +221,26 @@
221
 
222
 
223
  wc_stripe.BaseGateway.prototype.block = function () {
224
- $.blockUI({
225
- message: null,
226
- overlayCSS: {
227
- background: '#fff',
228
- opacity: 0.6
229
- }
230
- });
231
- };
 
 
 
232
  /**
233
  * @return {[type]}
234
  */
235
 
236
 
237
  wc_stripe.BaseGateway.prototype.unblock = function () {
238
- $.unblockUI();
 
 
239
  };
240
  /**
241
  * @return {[type]}
@@ -583,7 +588,7 @@
583
  };
584
 
585
  wc_stripe.BaseGateway.prototype.serialize_fields = function () {
586
- return this.fields.toJson();
587
  };
588
  /**
589
  * @param {[type]}
@@ -819,13 +824,16 @@
819
 
820
 
821
  wc_stripe.CheckoutGateway.prototype.block = function () {
822
- $('form.checkout').block({
823
- message: null,
824
- overlayCSS: {
825
- background: '#fff',
826
- opacity: 0.6
827
- }
828
- });
 
 
 
829
  };
830
  /**
831
  * @return {[type]}
@@ -833,7 +841,9 @@
833
 
834
 
835
  wc_stripe.CheckoutGateway.prototype.unblock = function () {
836
- $('form.checkout').unblock();
 
 
837
  };
838
 
839
  wc_stripe.CheckoutGateway.prototype.hide_place_order = function () {
@@ -984,7 +994,7 @@
984
 
985
  $('form.cart').on('found_variation', this.found_variation.bind(this));
986
  $('form.cart').on('reset_data', this.reset_variation_data.bind(this));
987
- this.buttonWidth = $('div.quantity').outerWidth(true) + $('.single_add_to_cart_button').outerWidth();
988
  var marginLeft = $('.single_add_to_cart_button').css('marginLeft');
989
 
990
  if (marginLeft) {
221
 
222
 
223
  wc_stripe.BaseGateway.prototype.block = function () {
224
+ if ($().block) {
225
+ $.blockUI({
226
+ message: null,
227
+ overlayCSS: {
228
+ background: '#fff',
229
+ opacity: 0.6
230
+ }
231
+ });
232
+ }
233
+ ;
234
+ }
235
  /**
236
  * @return {[type]}
237
  */
238
 
239
 
240
  wc_stripe.BaseGateway.prototype.unblock = function () {
241
+ if ($().block) {
242
+ $.unblockUI();
243
+ }
244
  };
245
  /**
246
  * @return {[type]}
588
  };
589
 
590
  wc_stripe.BaseGateway.prototype.serialize_fields = function () {
591
+ return $.extend({}, this.fields.toJson(), $(document.body).triggerHandler('wc_stripe_process_checkout_data', [this, this.fields]));
592
  };
593
  /**
594
  * @param {[type]}
824
 
825
 
826
  wc_stripe.CheckoutGateway.prototype.block = function () {
827
+ if ($().block) {
828
+ $('form.checkout').block({
829
+ message: null,
830
+ overlayCSS: {
831
+ background: '#fff',
832
+ opacity: 0.6
833
+ }
834
+ });
835
+ }
836
+
837
  };
838
  /**
839
  * @return {[type]}
841
 
842
 
843
  wc_stripe.CheckoutGateway.prototype.unblock = function () {
844
+ if ($().block) {
845
+ $('form.checkout').unblock();
846
+ }
847
  };
848
 
849
  wc_stripe.CheckoutGateway.prototype.hide_place_order = function () {
994
 
995
  $('form.cart').on('found_variation', this.found_variation.bind(this));
996
  $('form.cart').on('reset_data', this.reset_variation_data.bind(this));
997
+ this.buttonWidth = $('form.cart div.quantity').outerWidth(true) + $('.single_add_to_cart_button').outerWidth();
998
  var marginLeft = $('.single_add_to_cart_button').css('marginLeft');
999
 
1000
  if (marginLeft) {
assets/js/frontend/wc-stripe.min.js CHANGED
@@ -1,5 +1,5 @@
1
- (function(a,b){a.wc_stripe={};var c=null;"undefined"==typeof wc_stripe_checkout_fields&&(a.wc_stripe_checkout_fields=[]),wc_stripe.BaseGateway=function(a,d){this.params=a,this.gateway_id=this.params.gateway_id,this.container="undefined"==typeof d?"li.payment_method_".concat(this.gateway_id):d,b(this.container).length||(this.container=".payment_method_".concat(this.gateway_id)),this.token_selector=this.params.token_selector,this.saved_method_selector=this.params.saved_method_selector,this.payment_token_received=!1,this.stripe=c,this.elements=c.elements(b.extend({},{locale:"auto"},this.get_element_options())),this.fields=f,this.initialize()},wc_stripe.BaseGateway.prototype.get_page=function(){return wc_stripe_params_v3.page},wc_stripe.BaseGateway.prototype.set_nonce=function(a){this.fields.set(this.gateway_id+"_token_key",a),b(this.token_selector).val(a)},wc_stripe.BaseGateway.prototype.get_element_options=function(){return{}},wc_stripe.BaseGateway.prototype.initialize=function(){},wc_stripe.BaseGateway.prototype.create_button=function(){},wc_stripe.BaseGateway.prototype.is_gateway_selected=function(){return b("[name=\"payment_method\"]:checked").val()===this.gateway_id},wc_stripe.BaseGateway.prototype.is_saved_method_selected=function(){return this.is_gateway_selected()&&"saved"===b("[name=\""+this.gateway_id+"_payment_type_key\"]:checked").val()},wc_stripe.BaseGateway.prototype.has_checkout_error=function(){return 0<b("#wc_stripe_checkout_error").length&&this.is_gateway_selected()},wc_stripe.BaseGateway.prototype.submit_error=function(a){a=this.get_error_message(a),-1==a.indexOf("</ul>")&&(a="<div class=\"woocommerce-error\">"+a+"</div>"),this.submit_message(a)},wc_stripe.BaseGateway.prototype.submit_error_code=function(a){console.log(a)},wc_stripe.BaseGateway.prototype.get_error_message=function(a){return"object"==typeof a&&a.code&&(wc_stripe_messages[a.code]?a=wc_stripe_messages[a.code]:a=a.message),a},wc_stripe.BaseGateway.prototype.submit_message=function(a){b(".woocommerce-error, .woocommerce-message, .woocommerce-info").remove();var c=b(this.message_container);c.closest("form").length&&(c=c.closest("form")),c.prepend(a),c.removeClass("processing").unblock(),c.find(".input-text, select, input:checkbox").blur(),b.scroll_to_notices?b.scroll_to_notices(c):b("html, body").animate({scrollTop:c.offset().top-100},1e3)},wc_stripe.BaseGateway.prototype.get_first_name=function(a){return b("#"+a+"_first_name").val()},wc_stripe.BaseGateway.prototype.get_last_name=function(a){return b("#"+a+"_last_name").val()},wc_stripe.BaseGateway.prototype.should_save_method=function(){return b("#"+this.gateway_id+"_save_source_key").is(":checked")},wc_stripe.BaseGateway.prototype.is_add_payment_method_page=function(){return"add_payment_method"===this.get_page()||b(document.body).hasClass("woocommerce-add-payment-method")},wc_stripe.BaseGateway.prototype.is_change_payment_method=function(){return"change_payment_method"===this.get_page()},wc_stripe.BaseGateway.prototype.get_selected_payment_method=function(){return b(this.saved_method_selector).val()},wc_stripe.BaseGateway.prototype.needs_shipping=function(){return this.get_gateway_data().needs_shipping},wc_stripe.BaseGateway.prototype.get_currency=function(){return this.get_gateway_data().currency},wc_stripe.BaseGateway.prototype.get_gateway_data=function(){return b(this.container).find(".woocommerce_".concat(this.gateway_id,"_gateway_data")).data("gateway")},wc_stripe.BaseGateway.prototype.set_gateway_data=function(a){b(this.container).find(".woocommerce_".concat(this.gateway_id,"_gateway_data")).data("gateway",a)},wc_stripe.BaseGateway.prototype.get_customer_name=function(a){return this.fields.get(a+"_first_name")+" "+this.fields.get(a+"_last_name")},wc_stripe.BaseGateway.prototype.get_customer_email=function(){return this.fields.get("billing_email")},wc_stripe.BaseGateway.prototype.get_address_field_hash=function(a){for(var b=["_first_name","_last_name","_address_1","_address_2","_postcode","_city","_state","_country"],c="",d=0;d<b.length;d++)c+=this.fields.get(a+b[d])+"_";return c},wc_stripe.BaseGateway.prototype.block=function(){b.blockUI({message:null,overlayCSS:{background:"#fff",opacity:.6}})},wc_stripe.BaseGateway.prototype.unblock=function(){b.unblockUI()},wc_stripe.BaseGateway.prototype.get_form=function(){return b(this.token_selector).closest("form")},wc_stripe.BaseGateway.prototype.get_total_price=function(){return this.get_gateway_data().total},wc_stripe.BaseGateway.prototype.get_total_price_cents=function(){return this.get_gateway_data().total_cents},wc_stripe.BaseGateway.prototype.set_total_price=function(a){var b=this.get_gateway_data();b.total=a,this.set_gateway_data(b)},wc_stripe.BaseGateway.prototype.set_total_price_cents=function(a){var b=this.get_gateway_data();b.total_cents=a,this.set_gateway_data(b)},wc_stripe.BaseGateway.prototype.set_payment_method=function(a){b("[name=\"payment_method\"][value=\""+a+"\"]").prop("checked",!0).trigger("click")},wc_stripe.BaseGateway.prototype.set_selected_shipping_methods=function(a){if(this.fields.set("shipping_method",a),a&&b("[name^=\"shipping_method\"]").length)for(var c in a){var d=a[c];b("[name=\"shipping_method["+c+"]\"][value=\""+d+"\"]").prop("checked",!0).trigger("change")}},wc_stripe.BaseGateway.prototype.on_token_received=function(a){this.payment_token_received=!0,this.set_nonce(a.id),this.process_checkout()},wc_stripe.BaseGateway.prototype.createPaymentRequest=function(){try{this.paymentRequest=c.paymentRequest(this.get_payment_request_options())}catch(a){return void this.submit_error(a.message)}this.needs_shipping()&&(this.paymentRequest.on("shippingaddresschange",this.update_shipping_address.bind(this)),this.paymentRequest.on("shippingoptionchange",this.update_shipping_method.bind(this))),this.paymentRequest.on("paymentmethod",this.on_payment_method_received.bind(this))},wc_stripe.BaseGateway.prototype.get_payment_request_options=function(){var a={country:this.params.country_code,currency:this.get_currency().toLowerCase(),total:{amount:this.get_total_price_cents(),label:this.params.total_label,pending:!0},requestPayerName:!0,requestPayerEmail:this.fields.requestFieldInWallet("billing_email"),requestPayerPhone:this.fields.requestFieldInWallet("billing_phone"),requestShipping:this.needs_shipping()},b=this.get_display_items(),c=this.get_shipping_options();return b&&(a.displayItems=b),this.needs_shipping()&&c&&(a.shippingOptions=c),a},wc_stripe.BaseGateway.prototype.get_payment_request_update=function(a){var c={currency:this.get_currency().toLowerCase(),total:{amount:parseInt(this.get_total_price_cents()),label:this.params.total_label,pending:!0}},d=this.get_display_items(),e=this.get_shipping_options();return d&&(c.displayItems=d),this.needs_shipping()&&e&&(c.shippingOptions=e),a&&(c=b.extend(!0,{},c,a)),c},wc_stripe.BaseGateway.prototype.get_display_items=function(){return this.get_gateway_data().items},wc_stripe.BaseGateway.prototype.set_display_items=function(a){var b=this.get_gateway_data();b.items=a,this.set_gateway_data(b)},wc_stripe.BaseGateway.prototype.get_shipping_options=function(){return this.get_gateway_data().shipping_options},wc_stripe.BaseGateway.prototype.set_shipping_options=function(a){var b=this.get_gateway_data();b.shipping_options=a,this.set_gateway_data(b)},wc_stripe.BaseGateway.prototype.map_address=function(a){return{city:a.city,postcode:a.postalCode,state:a.region,country:a.country}},wc_stripe.BaseGateway.prototype.on_payment_method_received=function(b){try{this.payment_response=b,this.populate_checkout_fields(b),b.complete("success"),this.on_token_received(b.paymentMethod)}catch(b){a.alert(b)}},wc_stripe.BaseGateway.prototype.populate_checkout_fields=function(a){this.set_nonce(a.paymentMethod.id),this.update_addresses(a)},wc_stripe.BaseGateway.prototype.update_addresses=function(a){a.payerName&&this.fields.set("name",a.payerName,"billing"),a.payerEmail&&this.fields.set("email",a.payerEmail,"billing"),a.payerPhone&&this.fields.set("phone",a.payerPhone,"billing"),a.shippingAddress&&this.populate_shipping_fields(a.shippingAddress),a.paymentMethod.billing_details.address&&this.populate_billing_fields(a.paymentMethod.billing_details.address)},wc_stripe.BaseGateway.prototype.populate_address_fields=function(a,b){for(var c in a)this.fields.set(c,a[c],b)},wc_stripe.BaseGateway.prototype.populate_billing_fields=function(a){this.populate_address_fields(a,"billing")},wc_stripe.BaseGateway.prototype.populate_shipping_fields=function(a){this.populate_address_fields(a,"shipping")},wc_stripe.BaseGateway.prototype.address_mappings=function(){return new wc_stripe.CheckoutFields},wc_stripe.BaseGateway.prototype.ajax_before_send=function(a){0<this.params.user_id&&a.setRequestHeader("X-WP-Nonce",this.params.rest_nonce)},wc_stripe.BaseGateway.prototype.process_checkout=function(){return new Promise(function(){this.block(),b.ajax({url:this.params.routes.checkout,method:"POST",dataType:"json",data:b.extend({},this.serialize_fields(),{payment_method:this.gateway_id,page_id:this.get_page()}),beforeSend:this.ajax_before_send.bind(this)}).done(function(b){return b.reload?void a.location.reload():void("success"===b.result?a.location=b.redirect:(b.messages&&this.submit_error(b.messages),this.unblock()))}.bind(this)).fail(function(a,b,c){this.unblock(),this.submit_error(c)}.bind(this))}.bind(this))},wc_stripe.BaseGateway.prototype.serialize_form=function(a){var c=a.find("input").filter(function(a,c){return!b(c).is("[name^=\"add-to-cart\"]")}.bind(this)).serializeArray(),d={};for(var e in c){var f=c[e];d[f.name]=f.value}return d.payment_method=this.gateway_id,d},wc_stripe.BaseGateway.prototype.serialize_fields=function(){return this.fields.toJson()},wc_stripe.BaseGateway.prototype.map_shipping_methods=function(a){var b={};if("default"!==a){var c=a.match(/^([\w+]):(.+)$/);1<c.length&&(b[c[1]]=c[2])}return b},wc_stripe.BaseGateway.prototype.maybe_set_ship_to_different=function(){b("[name=\"ship_to_different_address\"]").length&&b("[name=\"ship_to_different_address\"]").prop("checked",this.get_address_field_hash("billing")!==this.get_address_field_hash("shipping")).trigger("change")},wc_stripe.BaseGateway.prototype.update_shipping_address=function(a){return new Promise(function(c,d){b.ajax({url:this.params.routes.shipping_address,method:"POST",dataType:"json",data:{address:this.map_address(a.shippingAddress),payment_method:this.gateway_id,page_id:this.get_page()},beforeSend:this.ajax_before_send.bind(this)}).done(function(b){b.code?(a.updateWith(b.data.newData),d(b.data)):(a.updateWith(b.data.newData),this.fields.set("shipping_method",data.shipping_method),c(b.data))}.bind(this)).fail(function(){}.bind(this))}.bind(this))},wc_stripe.BaseGateway.prototype.update_shipping_method=function(a){return new Promise(function(c,d){b.ajax({url:this.params.routes.shipping_method,method:"POST",dataType:"json",data:{shipping_method:a.shippingOption.id,payment_method:this.gateway_id,page_id:this.get_page()},beforeSend:this.ajax_before_send.bind(this)}).done(function(b){b.code?(a.updateWith(b.data.newData),d(b.data)):(this.set_selected_shipping_methods(b.data.shipping_methods),a.updateWith(b.data.newData),c(b.data))}.bind(this)).fail(function(a,b,c){this.submit_error(c)}.bind(this))}.bind(this))},wc_stripe.CheckoutGateway=function(){// events for showing gateway payment buttons
2
  this.message_container="li.payment_method_"+this.gateway_id,this.banner_container="li.banner_payment_method_"+this.gateway_id,b(document.body).on("update_checkout",this.update_checkout.bind(this)),b(document.body).on("updated_checkout",this.updated_checkout.bind(this)),b(document.body).on("cfw_updated_checkout",this.updated_checkout.bind(this)),b(document.body).on("checkout_error",this.checkout_error.bind(this)),b(this.token_selector).closest("form").on("checkout_place_order_"+this.gateway_id,this.checkout_place_order.bind(this)),b(document.body).on("wc_stripe_new_method_"+this.gateway_id,this.on_show_new_methods.bind(this)),b(document.body).on("wc_stripe_saved_method_"+this.gateway_id,this.on_show_saved_methods.bind(this)),b(document.body).on("wc_stripe_payment_method_selected",this.on_payment_method_selected.bind(this)),this.banner_enabled()&&b(".woocommerce-billing-fields").length&&b(".wc-stripe-banner-checkout").css("max-width",b(".woocommerce-billing-fields").outerWidth(!0)),this.order_review()},wc_stripe.CheckoutGateway.prototype.order_review=function(){var b=a.location.href,c=b.match(/order_review.+payment_method=([\w]+).+payment_nonce=(.+)/);if(c&&1<c.length){var d=c[1],e=c[2];this.gateway_id===d&&(this.payment_token_received=!0,this.set_nonce(e),this.set_use_new_option(!0))}},wc_stripe.CheckoutGateway.prototype.update_shipping_address=function(){return wc_stripe.BaseGateway.prototype.update_shipping_address.apply(this,arguments).then(function(a){// populate the checkout fields with the address
3
- this.populate_address_fields(a.address,this.get_shipping_prefix()),this.fields.toFormFields({update_shipping_method:!1})}.bind(this))},wc_stripe.CheckoutGateway.prototype.get_shipping_prefix=function(){return this.needs_shipping()&&0<b("[name=\"ship_to_different_address\"]").length&&b("[name=\"ship_to_different_address\"]").is(":checked")?"shipping":"billing"},wc_stripe.CheckoutGateway.prototype.updated_checkout=function(){},wc_stripe.CheckoutGateway.prototype.update_checkout=function(){},wc_stripe.CheckoutGateway.prototype.checkout_error=function(){this.has_checkout_error()&&(this.payment_token_received=!1,this.payment_response=null,this.show_payment_button(),this.hide_place_order())},wc_stripe.CheckoutGateway.prototype.is_valid_checkout=function(){return!b("[name=\"terms\"]").length||b("[name=\"terms\"]").is(":checked")},wc_stripe.CheckoutGateway.prototype.get_payment_method=function(){return b("[name=\"payment_method\"]:checked").val()},wc_stripe.CheckoutGateway.prototype.set_use_new_option=function(a){b("#"+this.gateway_id+"_use_new").prop("checked",a).trigger("change")},wc_stripe.CheckoutGateway.prototype.checkout_place_order=function(){return this.is_valid_checkout()?!!this.is_saved_method_selected()||this.payment_token_received:(this.submit_error(this.params.messages.terms),!1)},wc_stripe.CheckoutGateway.prototype.on_token_received=function(a){this.payment_token_received=!0,this.set_nonce(a.id),this.hide_payment_button(),this.show_place_order()},wc_stripe.CheckoutGateway.prototype.block=function(){b("form.checkout").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},wc_stripe.CheckoutGateway.prototype.unblock=function(){b("form.checkout").unblock()},wc_stripe.CheckoutGateway.prototype.hide_place_order=function(){b("#place_order").addClass("wc-stripe-hide")},wc_stripe.CheckoutGateway.prototype.show_place_order=function(){b("#place_order").removeClass("wc-stripe-hide")},wc_stripe.CheckoutGateway.prototype.on_show_new_methods=function(){this.payment_token_received?(this.show_place_order(),this.hide_payment_button()):(this.hide_place_order(),this.show_payment_button())},wc_stripe.CheckoutGateway.prototype.on_show_saved_methods=function(){this.hide_payment_button(),this.show_place_order()},wc_stripe.CheckoutGateway.prototype.show_payment_button=function(){this.$button&&this.$button.show()},wc_stripe.CheckoutGateway.prototype.hide_payment_button=function(){this.$button&&this.$button.hide()},wc_stripe.CheckoutGateway.prototype.trigger_payment_method_selected=function(){this.on_payment_method_selected(null,b("[name=\"payment_method\"]:checked").val())},wc_stripe.CheckoutGateway.prototype.on_payment_method_selected=function(a,b){b===this.gateway_id?this.payment_token_received||this.is_saved_method_selected()?(this.hide_payment_button(),this.show_place_order()):(this.show_payment_button(),this.hide_place_order()):(this.hide_payment_button(),0>b.indexOf("stripe_")&&this.show_place_order())},wc_stripe.CheckoutGateway.prototype.banner_enabled=function(){return"1"===this.params.banner_enabled},wc_stripe.CheckoutGateway.prototype.checkout_fields_valid=function(){function a(a,d){for(var e in d){var f=d[e];if(-1<e.indexOf(a)&&f.required&&b("#"+e).length){var g=b("#"+e).val();if("undefined"==typeof g||null===g||0==g.length)return void(c=!1)}}}if("undefined"==typeof wc_stripe_checkout_fields||"checkout"!==this.get_page())return!0;var c=!0;return a("billing",wc_stripe_checkout_fields),this.needs_shipping()&&b("#ship-to-different-address-checkbox").is(":checked")&&a("shipping",wc_stripe_checkout_fields),c&&(c=this.is_valid_checkout()),c},wc_stripe.ProductGateway=function(){this.message_container="div.product",b("form.cart").on("found_variation",this.found_variation.bind(this)),b("form.cart").on("reset_data",this.reset_variation_data.bind(this)),this.buttonWidth=b("div.quantity").outerWidth(!0)+b(".single_add_to_cart_button").outerWidth();var a=b(".single_add_to_cart_button").css("marginLeft");a&&(this.buttonWidth+=parseInt(a.replace("px",""))),b(this.container).css("max-width",this.buttonWidth+"px")},wc_stripe.ProductGateway.prototype.get_quantity=function(){return parseInt(b("[name=\"quantity\"]").val())},wc_stripe.ProductGateway.prototype.set_rest_nonce=function(a,b){this.params.rest_nonce=b},wc_stripe.ProductGateway.prototype.found_variation=function(a,b){var c=this.get_gateway_data();c.product.price=b.display_price,c.needs_shipping=!b.is_virtual,c.product.variation=b,this.set_gateway_data(c)},wc_stripe.ProductGateway.prototype.reset_variation_data=function(){var a=this.get_product_data();a.variation=!1,this.set_product_data(a),this.disable_payment_button()},wc_stripe.ProductGateway.prototype.disable_payment_button=function(){this.$button&&this.get_button().prop("disabled",!0).addClass("disabled")},wc_stripe.ProductGateway.prototype.enable_payment_button=function(){this.$button&&this.get_button().prop("disabled",!1).removeClass("disabled")},wc_stripe.ProductGateway.prototype.get_button=function(){return this.$button},wc_stripe.ProductGateway.prototype.is_variable_product=function(){return 0<b("[name=\"variation_id\"]").length},wc_stripe.ProductGateway.prototype.variable_product_selected=function(){return!1!==this.get_product_data().variation},wc_stripe.ProductGateway.prototype.get_product_data=function(){return this.get_gateway_data().product},wc_stripe.ProductGateway.prototype.set_product_data=function(a){var b=this.get_gateway_data();b.product=a,this.set_gateway_data(b)},wc_stripe.ProductGateway.prototype.add_to_cart=function(){return new Promise(function(a,c){this.block(),b.ajax({url:this.params.routes.add_to_cart,method:"POST",dataType:"json",data:{product_id:this.get_product_data().id,variation_id:this.is_variable_product()?b("[name=\"variation_id\"]").val():0,qty:b("[name=\"quantity\"]").val(),payment_method:this.gateway_id,page_id:this.get_page()},beforeSend:this.ajax_before_send.bind(this)}).done(function(b){this.unblock(),b.code?(this.submit_error(b.message),c(b)):(this.set_total_price(b.data.total),this.set_total_price_cents(b.data.totalCents),this.set_display_items(b.data.displayItems),a(b.data))}.bind(this)).fail(function(a,b,c){this.unblock(),this.submit_error(c)}.bind(this))}.bind(this))},wc_stripe.ProductGateway.prototype.cart_calculation=function(a){return new Promise(function(c,d){b.ajax({url:this.params.routes.cart_calculation,method:"POST",dataType:"json",data:{product_id:this.get_product_data().id,variation_id:this.is_variable_product()&&a?a:0,qty:b("[name=\"quantity\"]").val(),payment_method:this.gateway_id},beforeSend:this.ajax_before_send.bind(this)}).done(function(a){a.code?(this.cart_calculation_error=!0,d(a)):(this.set_total_price(a.data.total),this.set_total_price_cents(a.data.totalCents),this.set_display_items(a.data.displayItems),c(a.data))}.bind(this)).fail(function(){}.bind(this))}.bind(this))},wc_stripe.CartGateway=function(){// cart events
4
  this.message_container="div.woocommerce",b(document.body).on("updated_wc_div",this.updated_html.bind(this)),b(document.body).on("updated_cart_totals",this.updated_html.bind(this)),b(document.body).on("wc_cart_emptied",this.cart_emptied.bind(this))},wc_stripe.CartGateway.prototype.submit_error=function(a){this.submit_message(this.get_error_message(a))},wc_stripe.CartGateway.prototype.updated_html=function(){},wc_stripe.CartGateway.prototype.cart_emptied=function(){},wc_stripe.CartGateway.prototype.add_cart_totals_class=function(){b(".cart_totals").addClass("stripe_cart_gateway_active")},wc_stripe.GooglePay=function(){};var d={apiVersion:2,apiVersionMinor:0},e={type:"CARD",parameters:{allowedAuthMethods:["PAN_ONLY"],allowedCardNetworks:["AMEX","DISCOVER","INTERAC","JCB","MASTERCARD","VISA"]}};wc_stripe.GooglePay.prototype.update_addresses=function(a){this.populate_billing_fields(a.paymentMethodData.info.billingAddress),a.shippingAddress&&this.populate_shipping_fields(a.shippingAddress),a.email&&this.fields.set("email",a.email,"billing")},wc_stripe.GooglePay.prototype.map_address=function(a){return{city:a.locality,postcode:a.postalCode,state:a.administrativeArea,country:a.countryCode}},wc_stripe.GooglePay.prototype.update_payment_data=function(a){return new Promise(function(c,d){var e="default"==a.shippingOptionData.id?null:a.shippingOptionData.id;b.when(b.ajax({url:this.params.routes.payment_data,dataType:"json",method:"POST",data:{shipping_address:this.map_address(a.shippingAddress),shipping_method:e,page_id:this.get_page()},beforeSend:this.ajax_before_send.bind(this)})).done(function(a){a.code?d(a.data.data):c(a.data)}.bind(this)).fail(function(){d()}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.on_payment_data_changed=function(a){return new Promise(function(b){this.update_payment_data(a).then(function(c){b(c.paymentRequestUpdate),this.set_selected_shipping_methods(c.shipping_methods),this.payment_data_updated(c,a)}.bind(this))["catch"](function(a){b(a)}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.payment_data_updated=function(){},wc_stripe.GooglePay.prototype.get_merchant_info=function(){var a={merchantId:this.params.merchant_id,merchantName:this.params.merchant_name};return"TEST"===this.params.environment&&delete a.merchantId,a},wc_stripe.GooglePay.prototype.get_payment_options=function(){var a={environment:this.params.environment,merchantInfo:this.get_merchant_info()};return a.paymentDataCallbacks=this.needs_shipping()?{onPaymentDataChanged:this.on_payment_data_changed.bind(this),onPaymentAuthorized:function(){return new Promise(function(a){a({transactionState:"SUCCESS"})}.bind(this))}.bind(this)}:{onPaymentAuthorized:function(){return new Promise(function(a){a({transactionState:"SUCCESS"})}.bind(this))}},a},wc_stripe.GooglePay.prototype.build_payment_request=function(){var a=b.extend({},d,{emailRequired:function(){return"checkout"===this.get_page()?this.fields.required("billing_email")&&this.fields.isEmpty("billing_email"):"order_pay"!==this.get_page()&&this.fields.required("billing_email")}.bind(this)(),merchantInfo:this.get_merchant_info(),allowedPaymentMethods:[b.extend({type:"CARD",tokenizationSpecification:{type:"PAYMENT_GATEWAY",parameters:{gateway:"stripe","stripe:version":"2018-10-31","stripe:publishableKey":this.params.api_key}}},e)],shippingAddressRequired:this.needs_shipping(),transactionInfo:{currencyCode:this.get_currency(),totalPriceStatus:"ESTIMATED",totalPrice:this.get_total_price().toString(),displayItems:this.get_display_items(),totalPriceLabel:this.params.total_price_label}});return a.allowedPaymentMethods[0].parameters.billingAddressRequired=!0,a.allowedPaymentMethods[0].parameters.billingAddressParameters={format:"FULL",phoneNumberRequired:function(){return"checkout"===this.get_page()?this.fields.required("billing_phone")&&this.fields.isEmpty("billing_phone"):"order_pay"!==this.get_page()&&this.fields.required("billing_phone")}.bind(this)()},this.needs_shipping()?(a.shippingAddressParameters={},a.shippingOptionRequired=!0,a.shippingOptionParameters={shippingOptions:this.get_shipping_options()},a.callbackIntents=["SHIPPING_ADDRESS","SHIPPING_OPTION","PAYMENT_AUTHORIZATION"]):a.callbackIntents=["PAYMENT_AUTHORIZATION"],a},wc_stripe.GooglePay.prototype.createPaymentsClient=function(){this.paymentsClient=new google.payments.api.PaymentsClient(this.get_payment_options())},wc_stripe.GooglePay.prototype.isReadyToPay=function(){return new Promise(function(a){var c=b.extend({},d);c.allowedPaymentMethods=[e],this.paymentsClient.isReadyToPay(c).then(function(){this.can_pay=!0,this.create_button(),a()}.bind(this))["catch"](function(a){this.submit_error(a)}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.create_button=function(){this.$button&&this.$button.remove(),this.$button=b(this.paymentsClient.createButton({onClick:this.start.bind(this),buttonColor:this.params.button_color,buttonType:this.params.button_style})),this.$button.addClass("gpay-button-container")},wc_stripe.GooglePay.prototype.start=function(){// always recreate the paymentClient to ensure latest data is used.
5
  this.createPaymentsClient(),this.paymentsClient.loadPaymentData(this.build_payment_request()).then(function(a){var b=JSON.parse(a.paymentMethodData.tokenizationData.token);this.update_addresses(a),this.on_token_received(b)}.bind(this))["catch"](function(a){"CANCELED"===a.statusCode||(a.statusMessage&&-1<a.statusMessage.indexOf("paymentDataRequest.callbackIntent")?this.submit_error_code("DEVELOPER_ERROR_WHITELIST"):this.submit_error(a.statusMessage))}.bind(this))},wc_stripe.ApplePay=function(){},wc_stripe.ApplePay.prototype.initialize=function(){var a=".apple-pay-button";0>["checkout","order_pay"].indexOf(this.get_page())&&(a=this.container+" .apple-pay-button"),b(document.body).on("click",a,this.start.bind(this)),this.createPaymentRequest(),this.canMakePayment()},wc_stripe.ApplePay.prototype.create_button=function(){this.$button&&this.$button.remove(),this.$button=b(this.params.button),this.append_button()},wc_stripe.ApplePay.prototype.canMakePayment=function(){return new Promise(function(a){this.paymentRequest.canMakePayment().then(function(c){c&&c.applePay&&(this.can_pay=!0,this.create_button(),b(this.container).show(),a(c))}.bind(this))}.bind(this))},wc_stripe.ApplePay.prototype.start=function(a){a.preventDefault(),this.paymentRequest.update(this.get_payment_request_update({total:{pending:!1}})),this.paymentRequest.show()},wc_stripe.PaymentRequest=function(){},wc_stripe.PaymentRequest.prototype.initialize=function(){this.createPaymentRequest(),this.canMakePayment(),this.createPaymentRequestButton(),this.paymentRequestButton.on("click",this.button_click.bind(this))},wc_stripe.PaymentRequest.prototype.button_click=function(){},wc_stripe.PaymentRequest.prototype.createPaymentRequestButton=function(){this.paymentRequestButton=this.elements.create("paymentRequestButton",{paymentRequest:this.paymentRequest,style:{paymentRequestButton:{type:this.params.button.type,theme:this.params.button.theme,height:this.params.button.height}}})},wc_stripe.PaymentRequest.prototype.canMakePayment=function(){return new Promise(function(a){this.paymentRequest.canMakePayment().then(function(c){c&&!c.applePay&&(this.can_pay=!0,this.create_button(),b(this.container).show(),a(c))}.bind(this))}.bind(this))},wc_stripe.PaymentRequest.prototype.create_button=function(){this.paymentRequestButton.mount("#wc-stripe-payment-request-container")},wc_stripe.CheckoutFields=function(a,c){this.params=a,this.page=c,this.fields=new Map(Object.keys(this.params).map(function(a){return[a,this.params[a].value]}.bind(this))),"checkout"===c&&(b("form.checkout").on("change",".input-text, select",this.onChange.bind(this)),b("form.checkout").on("change","[name=\"ship_to_different_address\"]",this.on_ship_to_address_change.bind(this)),this.init_i18n())},wc_stripe.CheckoutFields.prototype.init_i18n=function(){this.locales="undefined"==typeof wc_address_i18n_params?null:b.parseJSON(wc_address_i18n_params.locale.replace(/&quot;/g,"\""))},wc_stripe.CheckoutFields.prototype.onChange=function(a){try{var b=a.currentTarget.name,c=a.currentTarget.value;this.fields.set(b,c),("billing_country"===b||"shipping_country"===b)&&this.update_required_fields(c,b)}catch(a){console.log(a)}},wc_stripe.CheckoutFields.prototype.update_required_fields=function(a,c){if(this.locales){var d=-1<c.indexOf("billing_")?"billing_":"shipping_",e="undefined"==typeof this.locales[a]?this.locales["default"]:this.locales[a],f=b.extend(!0,{},this.locales["default"],e);for(var g in f){var h=d+g;this.params[h]&&(this.params[h]=b.extend(!0,{},this.params[h],f[g]))}}},wc_stripe.CheckoutFields.prototype.on_ship_to_address_change=function(a){b(a.currentTarget).is(":checked")&&this.update_required_fields(b("shipping_country"),"shipping_country")},wc_stripe.CheckoutFields.prototype.requestFieldInWallet=function(a){if("checkout"===this.page)return this.required(a)&&this.isEmpty(a);return"order_pay"!==this.page&&this.required(a)},wc_stripe.CheckoutFields.prototype.set=function(a,b,c){this[a]&&"function"==typeof this[a]?this[a]().set.call(this,b,c):this.fields.set(a,b)},wc_stripe.CheckoutFields.prototype.get=function(a,b){if(this[a]&&"function"==typeof this[a])var c=this[a]().get.call(this,b);else{var c=this.fields.get(a);("undefined"==typeof c||null===c||""===c)&&"undefined"!=typeof b&&(c=b)}return"undefined"==typeof c?"":c},wc_stripe.CheckoutFields.prototype.required=function(a){return!!(this.params[a]&&"undefined"!=typeof this.params[a].required)&&this.params[a].required},wc_stripe.CheckoutFields.prototype.isEmpty=function(a){if(this.fields.has(a)){var b=this.fields.get(a);return"undefined"==typeof b||null===b||"string"==typeof b&&0===b.trim().length}return!0},wc_stripe.CheckoutFields.prototype.name=function(){return{set:function(a,b){var c=a.split(" ");this.fields.set(b+"_first_name",c[0]),this.fields.set(b+"_last_name",c[1])},get:function(a){return this.fields.get(a+"_first_name")+" "+this.fields.get(a+"_last_name")}}},wc_stripe.CheckoutFields.prototype.payerName=function(){return wc_stripe.CheckoutFields.prototype.name.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.email=function(){return{set:function(a,b){this.fields.set(b+"_email",a)},get:function(a){return this.fields.get(a+"_email")}}},wc_stripe.CheckoutFields.prototype.payerEmail=function(){return wc_stripe.CheckoutFields.prototype.email.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.phone=function(){return{set:function(a,b){this.fields.set(b+"_phone",a)},get:function(a){return this.fields.get(a+"_phone")}}},wc_stripe.CheckoutFields.prototype.payerPhone=function(){return wc_stripe.CheckoutFields.prototype.phone.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.phoneNumber=function(){return wc_stripe.CheckoutFields.prototype.phone.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.recipient=function(){return{set:function(a,b){var c=a.split(" ");0<c.length&&this.fields.set(b+"_first_name",c[0]),1<c.length&&this.fields.set(b+"_last_name",c[1])},get:function(a){return this.fields.get(a+"_first_name")+" "+this.fields.get(a+"_last_name")}}},wc_stripe.CheckoutFields.prototype.country=function(){return{set:function(a,b){this.fields.set(b+"_country",a)},get:function(a){return this.fields.get(a+"_country")}}},wc_stripe.CheckoutFields.prototype.countryCode=function(){return wc_stripe.CheckoutFields.prototype.country.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.address1=function(){return{set:function(a,b){this.fields.set(b+"_address_1",a)},get:function(a){return this.fields.get(a+"_address_1")}}},wc_stripe.CheckoutFields.prototype.address2=function(){return{set:function(a,b){this.fields.set(b+"_address_2",a)},get:function(a){this.fields.get(a+"_address_2")}}},wc_stripe.CheckoutFields.prototype.line1=function(){return wc_stripe.CheckoutFields.prototype.address1.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.line2=function(){return wc_stripe.CheckoutFields.prototype.address2.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.addressLine=function(){return{set:function(a,b){0<a.length&&this.fields.set(b+"_address_1",a[0]),1<a.length&&this.fields.set(b+"_address_2",a[1])},get:function(a){return[this.fields.get(a+"_address_1"),this.fields.get(a+"_address_2")]}}},wc_stripe.CheckoutFields.prototype.state=function(){return{set:function(a,c){a=a.toUpperCase(),2<a.length&&"checkout"===this.page&&b("#"+c+"_state option").each(function(){var c=b(this),d=c.text().toUpperCase();a===d&&(a=c.val())}),this.fields.set(c+"_state",a)},get:function(a){return this.fields.get(a+"_state")}}},wc_stripe.CheckoutFields.prototype.region=function(){return wc_stripe.CheckoutFields.prototype.state.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.administrativeArea=function(){return wc_stripe.CheckoutFields.prototype.state.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.city=function(){return{set:function(a,b){this.fields.set(b+"_city",a)},get:function(a){this.fields.get(a+"_city")}}},wc_stripe.CheckoutFields.prototype.locality=function(){return wc_stripe.CheckoutFields.prototype.city.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.postcode=function(){return{set:function(a,b){this.fields.set(b+"_postcode",a)},get:function(a){this.fields.get(a+"_postcode")}}},wc_stripe.CheckoutFields.prototype.postal_code=function(){return wc_stripe.CheckoutFields.prototype.postcode.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.postalCode=function(){return wc_stripe.CheckoutFields.prototype.postcode.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.toJson=function(){var a={};return this.fields.forEach(function(b,c){a[c]=b}),a},wc_stripe.CheckoutFields.prototype.toFormFields=function(a){var c=[];this.fields.forEach(function(a,d){var e="[name=\""+d+"\"]";b(e).length&&""!==a&&(b(e).val()!==a&&b(e).is("select")&&c.push(e),b(e).val(a))}),0<c.length&&b(c.join(",")).trigger("change"),"undefined"!=typeof a&&b(document.body).trigger("update_checkout",a)};try{c=Stripe(wc_stripe_params_v3.api_key,{stripeAccount:wc_stripe_params_v3.account})}catch(b){return a.alert(b),void console.log(b)}var f=new wc_stripe.CheckoutFields(wc_stripe_checkout_fields,wc_stripe_params_v3.page)})(window,jQuery);
1
+ (function(a,b){a.wc_stripe={};var c=null;"undefined"==typeof wc_stripe_checkout_fields&&(a.wc_stripe_checkout_fields=[]),wc_stripe.BaseGateway=function(a,d){this.params=a,this.gateway_id=this.params.gateway_id,this.container="undefined"==typeof d?"li.payment_method_".concat(this.gateway_id):d,b(this.container).length||(this.container=".payment_method_".concat(this.gateway_id)),this.token_selector=this.params.token_selector,this.saved_method_selector=this.params.saved_method_selector,this.payment_token_received=!1,this.stripe=c,this.elements=c.elements(b.extend({},{locale:"auto"},this.get_element_options())),this.fields=f,this.initialize()},wc_stripe.BaseGateway.prototype.get_page=function(){return wc_stripe_params_v3.page},wc_stripe.BaseGateway.prototype.set_nonce=function(a){this.fields.set(this.gateway_id+"_token_key",a),b(this.token_selector).val(a)},wc_stripe.BaseGateway.prototype.get_element_options=function(){return{}},wc_stripe.BaseGateway.prototype.initialize=function(){},wc_stripe.BaseGateway.prototype.create_button=function(){},wc_stripe.BaseGateway.prototype.is_gateway_selected=function(){return b("[name=\"payment_method\"]:checked").val()===this.gateway_id},wc_stripe.BaseGateway.prototype.is_saved_method_selected=function(){return this.is_gateway_selected()&&"saved"===b("[name=\""+this.gateway_id+"_payment_type_key\"]:checked").val()},wc_stripe.BaseGateway.prototype.has_checkout_error=function(){return 0<b("#wc_stripe_checkout_error").length&&this.is_gateway_selected()},wc_stripe.BaseGateway.prototype.submit_error=function(a){a=this.get_error_message(a),-1==a.indexOf("</ul>")&&(a="<div class=\"woocommerce-error\">"+a+"</div>"),this.submit_message(a)},wc_stripe.BaseGateway.prototype.submit_error_code=function(a){console.log(a)},wc_stripe.BaseGateway.prototype.get_error_message=function(a){return"object"==typeof a&&a.code&&(wc_stripe_messages[a.code]?a=wc_stripe_messages[a.code]:a=a.message),a},wc_stripe.BaseGateway.prototype.submit_message=function(a){b(".woocommerce-error, .woocommerce-message, .woocommerce-info").remove();var c=b(this.message_container);c.closest("form").length&&(c=c.closest("form")),c.prepend(a),c.removeClass("processing").unblock(),c.find(".input-text, select, input:checkbox").blur(),b.scroll_to_notices?b.scroll_to_notices(c):b("html, body").animate({scrollTop:c.offset().top-100},1e3)},wc_stripe.BaseGateway.prototype.get_first_name=function(a){return b("#"+a+"_first_name").val()},wc_stripe.BaseGateway.prototype.get_last_name=function(a){return b("#"+a+"_last_name").val()},wc_stripe.BaseGateway.prototype.should_save_method=function(){return b("#"+this.gateway_id+"_save_source_key").is(":checked")},wc_stripe.BaseGateway.prototype.is_add_payment_method_page=function(){return"add_payment_method"===this.get_page()||b(document.body).hasClass("woocommerce-add-payment-method")},wc_stripe.BaseGateway.prototype.is_change_payment_method=function(){return"change_payment_method"===this.get_page()},wc_stripe.BaseGateway.prototype.get_selected_payment_method=function(){return b(this.saved_method_selector).val()},wc_stripe.BaseGateway.prototype.needs_shipping=function(){return this.get_gateway_data().needs_shipping},wc_stripe.BaseGateway.prototype.get_currency=function(){return this.get_gateway_data().currency},wc_stripe.BaseGateway.prototype.get_gateway_data=function(){return b(this.container).find(".woocommerce_".concat(this.gateway_id,"_gateway_data")).data("gateway")},wc_stripe.BaseGateway.prototype.set_gateway_data=function(a){b(this.container).find(".woocommerce_".concat(this.gateway_id,"_gateway_data")).data("gateway",a)},wc_stripe.BaseGateway.prototype.get_customer_name=function(a){return this.fields.get(a+"_first_name")+" "+this.fields.get(a+"_last_name")},wc_stripe.BaseGateway.prototype.get_customer_email=function(){return this.fields.get("billing_email")},wc_stripe.BaseGateway.prototype.get_address_field_hash=function(a){for(var b=["_first_name","_last_name","_address_1","_address_2","_postcode","_city","_state","_country"],c="",d=0;d<b.length;d++)c+=this.fields.get(a+b[d])+"_";return c},wc_stripe.BaseGateway.prototype.block=function(){b().block&&b.blockUI({message:null,overlayCSS:{background:"#fff",opacity:.6}})},wc_stripe.BaseGateway.prototype.unblock=function(){b().block&&b.unblockUI()},wc_stripe.BaseGateway.prototype.get_form=function(){return b(this.token_selector).closest("form")},wc_stripe.BaseGateway.prototype.get_total_price=function(){return this.get_gateway_data().total},wc_stripe.BaseGateway.prototype.get_total_price_cents=function(){return this.get_gateway_data().total_cents},wc_stripe.BaseGateway.prototype.set_total_price=function(a){var b=this.get_gateway_data();b.total=a,this.set_gateway_data(b)},wc_stripe.BaseGateway.prototype.set_total_price_cents=function(a){var b=this.get_gateway_data();b.total_cents=a,this.set_gateway_data(b)},wc_stripe.BaseGateway.prototype.set_payment_method=function(a){b("[name=\"payment_method\"][value=\""+a+"\"]").prop("checked",!0).trigger("click")},wc_stripe.BaseGateway.prototype.set_selected_shipping_methods=function(a){if(this.fields.set("shipping_method",a),a&&b("[name^=\"shipping_method\"]").length)for(var c in a){var d=a[c];b("[name=\"shipping_method["+c+"]\"][value=\""+d+"\"]").prop("checked",!0).trigger("change")}},wc_stripe.BaseGateway.prototype.on_token_received=function(a){this.payment_token_received=!0,this.set_nonce(a.id),this.process_checkout()},wc_stripe.BaseGateway.prototype.createPaymentRequest=function(){try{this.paymentRequest=c.paymentRequest(this.get_payment_request_options())}catch(a){return void this.submit_error(a.message)}this.needs_shipping()&&(this.paymentRequest.on("shippingaddresschange",this.update_shipping_address.bind(this)),this.paymentRequest.on("shippingoptionchange",this.update_shipping_method.bind(this))),this.paymentRequest.on("paymentmethod",this.on_payment_method_received.bind(this))},wc_stripe.BaseGateway.prototype.get_payment_request_options=function(){var a={country:this.params.country_code,currency:this.get_currency().toLowerCase(),total:{amount:this.get_total_price_cents(),label:this.params.total_label,pending:!0},requestPayerName:!0,requestPayerEmail:this.fields.requestFieldInWallet("billing_email"),requestPayerPhone:this.fields.requestFieldInWallet("billing_phone"),requestShipping:this.needs_shipping()},b=this.get_display_items(),c=this.get_shipping_options();return b&&(a.displayItems=b),this.needs_shipping()&&c&&(a.shippingOptions=c),a},wc_stripe.BaseGateway.prototype.get_payment_request_update=function(a){var c={currency:this.get_currency().toLowerCase(),total:{amount:parseInt(this.get_total_price_cents()),label:this.params.total_label,pending:!0}},d=this.get_display_items(),e=this.get_shipping_options();return d&&(c.displayItems=d),this.needs_shipping()&&e&&(c.shippingOptions=e),a&&(c=b.extend(!0,{},c,a)),c},wc_stripe.BaseGateway.prototype.get_display_items=function(){return this.get_gateway_data().items},wc_stripe.BaseGateway.prototype.set_display_items=function(a){var b=this.get_gateway_data();b.items=a,this.set_gateway_data(b)},wc_stripe.BaseGateway.prototype.get_shipping_options=function(){return this.get_gateway_data().shipping_options},wc_stripe.BaseGateway.prototype.set_shipping_options=function(a){var b=this.get_gateway_data();b.shipping_options=a,this.set_gateway_data(b)},wc_stripe.BaseGateway.prototype.map_address=function(a){return{city:a.city,postcode:a.postalCode,state:a.region,country:a.country}},wc_stripe.BaseGateway.prototype.on_payment_method_received=function(b){try{this.payment_response=b,this.populate_checkout_fields(b),b.complete("success"),this.on_token_received(b.paymentMethod)}catch(b){a.alert(b)}},wc_stripe.BaseGateway.prototype.populate_checkout_fields=function(a){this.set_nonce(a.paymentMethod.id),this.update_addresses(a)},wc_stripe.BaseGateway.prototype.update_addresses=function(a){a.payerName&&this.fields.set("name",a.payerName,"billing"),a.payerEmail&&this.fields.set("email",a.payerEmail,"billing"),a.payerPhone&&this.fields.set("phone",a.payerPhone,"billing"),a.shippingAddress&&this.populate_shipping_fields(a.shippingAddress),a.paymentMethod.billing_details.address&&this.populate_billing_fields(a.paymentMethod.billing_details.address)},wc_stripe.BaseGateway.prototype.populate_address_fields=function(a,b){for(var c in a)this.fields.set(c,a[c],b)},wc_stripe.BaseGateway.prototype.populate_billing_fields=function(a){this.populate_address_fields(a,"billing")},wc_stripe.BaseGateway.prototype.populate_shipping_fields=function(a){this.populate_address_fields(a,"shipping")},wc_stripe.BaseGateway.prototype.address_mappings=function(){return new wc_stripe.CheckoutFields},wc_stripe.BaseGateway.prototype.ajax_before_send=function(a){0<this.params.user_id&&a.setRequestHeader("X-WP-Nonce",this.params.rest_nonce)},wc_stripe.BaseGateway.prototype.process_checkout=function(){return new Promise(function(){this.block(),b.ajax({url:this.params.routes.checkout,method:"POST",dataType:"json",data:b.extend({},this.serialize_fields(),{payment_method:this.gateway_id,page_id:this.get_page()}),beforeSend:this.ajax_before_send.bind(this)}).done(function(b){return b.reload?void a.location.reload():void("success"===b.result?a.location=b.redirect:(b.messages&&this.submit_error(b.messages),this.unblock()))}.bind(this)).fail(function(a,b,c){this.unblock(),this.submit_error(c)}.bind(this))}.bind(this))},wc_stripe.BaseGateway.prototype.serialize_form=function(a){var c=a.find("input").filter(function(a,c){return!b(c).is("[name^=\"add-to-cart\"]")}.bind(this)).serializeArray(),d={};for(var e in c){var f=c[e];d[f.name]=f.value}return d.payment_method=this.gateway_id,d},wc_stripe.BaseGateway.prototype.serialize_fields=function(){return b.extend({},this.fields.toJson(),b(document.body).triggerHandler("wc_stripe_process_checkout_data",[this,this.fields]))},wc_stripe.BaseGateway.prototype.map_shipping_methods=function(a){var b={};if("default"!==a){var c=a.match(/^([\w+]):(.+)$/);1<c.length&&(b[c[1]]=c[2])}return b},wc_stripe.BaseGateway.prototype.maybe_set_ship_to_different=function(){b("[name=\"ship_to_different_address\"]").length&&b("[name=\"ship_to_different_address\"]").prop("checked",this.get_address_field_hash("billing")!==this.get_address_field_hash("shipping")).trigger("change")},wc_stripe.BaseGateway.prototype.update_shipping_address=function(a){return new Promise(function(c,d){b.ajax({url:this.params.routes.shipping_address,method:"POST",dataType:"json",data:{address:this.map_address(a.shippingAddress),payment_method:this.gateway_id,page_id:this.get_page()},beforeSend:this.ajax_before_send.bind(this)}).done(function(b){b.code?(a.updateWith(b.data.newData),d(b.data)):(a.updateWith(b.data.newData),this.fields.set("shipping_method",data.shipping_method),c(b.data))}.bind(this)).fail(function(){}.bind(this))}.bind(this))},wc_stripe.BaseGateway.prototype.update_shipping_method=function(a){return new Promise(function(c,d){b.ajax({url:this.params.routes.shipping_method,method:"POST",dataType:"json",data:{shipping_method:a.shippingOption.id,payment_method:this.gateway_id,page_id:this.get_page()},beforeSend:this.ajax_before_send.bind(this)}).done(function(b){b.code?(a.updateWith(b.data.newData),d(b.data)):(this.set_selected_shipping_methods(b.data.shipping_methods),a.updateWith(b.data.newData),c(b.data))}.bind(this)).fail(function(a,b,c){this.submit_error(c)}.bind(this))}.bind(this))},wc_stripe.CheckoutGateway=function(){// events for showing gateway payment buttons
2
  this.message_container="li.payment_method_"+this.gateway_id,this.banner_container="li.banner_payment_method_"+this.gateway_id,b(document.body).on("update_checkout",this.update_checkout.bind(this)),b(document.body).on("updated_checkout",this.updated_checkout.bind(this)),b(document.body).on("cfw_updated_checkout",this.updated_checkout.bind(this)),b(document.body).on("checkout_error",this.checkout_error.bind(this)),b(this.token_selector).closest("form").on("checkout_place_order_"+this.gateway_id,this.checkout_place_order.bind(this)),b(document.body).on("wc_stripe_new_method_"+this.gateway_id,this.on_show_new_methods.bind(this)),b(document.body).on("wc_stripe_saved_method_"+this.gateway_id,this.on_show_saved_methods.bind(this)),b(document.body).on("wc_stripe_payment_method_selected",this.on_payment_method_selected.bind(this)),this.banner_enabled()&&b(".woocommerce-billing-fields").length&&b(".wc-stripe-banner-checkout").css("max-width",b(".woocommerce-billing-fields").outerWidth(!0)),this.order_review()},wc_stripe.CheckoutGateway.prototype.order_review=function(){var b=a.location.href,c=b.match(/order_review.+payment_method=([\w]+).+payment_nonce=(.+)/);if(c&&1<c.length){var d=c[1],e=c[2];this.gateway_id===d&&(this.payment_token_received=!0,this.set_nonce(e),this.set_use_new_option(!0))}},wc_stripe.CheckoutGateway.prototype.update_shipping_address=function(){return wc_stripe.BaseGateway.prototype.update_shipping_address.apply(this,arguments).then(function(a){// populate the checkout fields with the address
3
+ this.populate_address_fields(a.address,this.get_shipping_prefix()),this.fields.toFormFields({update_shipping_method:!1})}.bind(this))},wc_stripe.CheckoutGateway.prototype.get_shipping_prefix=function(){return this.needs_shipping()&&0<b("[name=\"ship_to_different_address\"]").length&&b("[name=\"ship_to_different_address\"]").is(":checked")?"shipping":"billing"},wc_stripe.CheckoutGateway.prototype.updated_checkout=function(){},wc_stripe.CheckoutGateway.prototype.update_checkout=function(){},wc_stripe.CheckoutGateway.prototype.checkout_error=function(){this.has_checkout_error()&&(this.payment_token_received=!1,this.payment_response=null,this.show_payment_button(),this.hide_place_order())},wc_stripe.CheckoutGateway.prototype.is_valid_checkout=function(){return!b("[name=\"terms\"]").length||b("[name=\"terms\"]").is(":checked")},wc_stripe.CheckoutGateway.prototype.get_payment_method=function(){return b("[name=\"payment_method\"]:checked").val()},wc_stripe.CheckoutGateway.prototype.set_use_new_option=function(a){b("#"+this.gateway_id+"_use_new").prop("checked",a).trigger("change")},wc_stripe.CheckoutGateway.prototype.checkout_place_order=function(){return this.is_valid_checkout()?!!this.is_saved_method_selected()||this.payment_token_received:(this.submit_error(this.params.messages.terms),!1)},wc_stripe.CheckoutGateway.prototype.on_token_received=function(a){this.payment_token_received=!0,this.set_nonce(a.id),this.hide_payment_button(),this.show_place_order()},wc_stripe.CheckoutGateway.prototype.block=function(){b().block&&b("form.checkout").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},wc_stripe.CheckoutGateway.prototype.unblock=function(){b().block&&b("form.checkout").unblock()},wc_stripe.CheckoutGateway.prototype.hide_place_order=function(){b("#place_order").addClass("wc-stripe-hide")},wc_stripe.CheckoutGateway.prototype.show_place_order=function(){b("#place_order").removeClass("wc-stripe-hide")},wc_stripe.CheckoutGateway.prototype.on_show_new_methods=function(){this.payment_token_received?(this.show_place_order(),this.hide_payment_button()):(this.hide_place_order(),this.show_payment_button())},wc_stripe.CheckoutGateway.prototype.on_show_saved_methods=function(){this.hide_payment_button(),this.show_place_order()},wc_stripe.CheckoutGateway.prototype.show_payment_button=function(){this.$button&&this.$button.show()},wc_stripe.CheckoutGateway.prototype.hide_payment_button=function(){this.$button&&this.$button.hide()},wc_stripe.CheckoutGateway.prototype.trigger_payment_method_selected=function(){this.on_payment_method_selected(null,b("[name=\"payment_method\"]:checked").val())},wc_stripe.CheckoutGateway.prototype.on_payment_method_selected=function(a,b){b===this.gateway_id?this.payment_token_received||this.is_saved_method_selected()?(this.hide_payment_button(),this.show_place_order()):(this.show_payment_button(),this.hide_place_order()):(this.hide_payment_button(),0>b.indexOf("stripe_")&&this.show_place_order())},wc_stripe.CheckoutGateway.prototype.banner_enabled=function(){return"1"===this.params.banner_enabled},wc_stripe.CheckoutGateway.prototype.checkout_fields_valid=function(){function a(a,d){for(var e in d){var f=d[e];if(-1<e.indexOf(a)&&f.required&&b("#"+e).length){var g=b("#"+e).val();if("undefined"==typeof g||null===g||0==g.length)return void(c=!1)}}}if("undefined"==typeof wc_stripe_checkout_fields||"checkout"!==this.get_page())return!0;var c=!0;return a("billing",wc_stripe_checkout_fields),this.needs_shipping()&&b("#ship-to-different-address-checkbox").is(":checked")&&a("shipping",wc_stripe_checkout_fields),c&&(c=this.is_valid_checkout()),c},wc_stripe.ProductGateway=function(){this.message_container="div.product",b("form.cart").on("found_variation",this.found_variation.bind(this)),b("form.cart").on("reset_data",this.reset_variation_data.bind(this)),this.buttonWidth=b("form.cart div.quantity").outerWidth(!0)+b(".single_add_to_cart_button").outerWidth();var a=b(".single_add_to_cart_button").css("marginLeft");a&&(this.buttonWidth+=parseInt(a.replace("px",""))),b(this.container).css("max-width",this.buttonWidth+"px")},wc_stripe.ProductGateway.prototype.get_quantity=function(){return parseInt(b("[name=\"quantity\"]").val())},wc_stripe.ProductGateway.prototype.set_rest_nonce=function(a,b){this.params.rest_nonce=b},wc_stripe.ProductGateway.prototype.found_variation=function(a,b){var c=this.get_gateway_data();c.product.price=b.display_price,c.needs_shipping=!b.is_virtual,c.product.variation=b,this.set_gateway_data(c)},wc_stripe.ProductGateway.prototype.reset_variation_data=function(){var a=this.get_product_data();a.variation=!1,this.set_product_data(a),this.disable_payment_button()},wc_stripe.ProductGateway.prototype.disable_payment_button=function(){this.$button&&this.get_button().prop("disabled",!0).addClass("disabled")},wc_stripe.ProductGateway.prototype.enable_payment_button=function(){this.$button&&this.get_button().prop("disabled",!1).removeClass("disabled")},wc_stripe.ProductGateway.prototype.get_button=function(){return this.$button},wc_stripe.ProductGateway.prototype.is_variable_product=function(){return 0<b("[name=\"variation_id\"]").length},wc_stripe.ProductGateway.prototype.variable_product_selected=function(){return!1!==this.get_product_data().variation},wc_stripe.ProductGateway.prototype.get_product_data=function(){return this.get_gateway_data().product},wc_stripe.ProductGateway.prototype.set_product_data=function(a){var b=this.get_gateway_data();b.product=a,this.set_gateway_data(b)},wc_stripe.ProductGateway.prototype.add_to_cart=function(){return new Promise(function(a,c){this.block(),b.ajax({url:this.params.routes.add_to_cart,method:"POST",dataType:"json",data:{product_id:this.get_product_data().id,variation_id:this.is_variable_product()?b("[name=\"variation_id\"]").val():0,qty:b("[name=\"quantity\"]").val(),payment_method:this.gateway_id,page_id:this.get_page()},beforeSend:this.ajax_before_send.bind(this)}).done(function(b){this.unblock(),b.code?(this.submit_error(b.message),c(b)):(this.set_total_price(b.data.total),this.set_total_price_cents(b.data.totalCents),this.set_display_items(b.data.displayItems),a(b.data))}.bind(this)).fail(function(a,b,c){this.unblock(),this.submit_error(c)}.bind(this))}.bind(this))},wc_stripe.ProductGateway.prototype.cart_calculation=function(a){return new Promise(function(c,d){b.ajax({url:this.params.routes.cart_calculation,method:"POST",dataType:"json",data:{product_id:this.get_product_data().id,variation_id:this.is_variable_product()&&a?a:0,qty:b("[name=\"quantity\"]").val(),payment_method:this.gateway_id},beforeSend:this.ajax_before_send.bind(this)}).done(function(a){a.code?(this.cart_calculation_error=!0,d(a)):(this.set_total_price(a.data.total),this.set_total_price_cents(a.data.totalCents),this.set_display_items(a.data.displayItems),c(a.data))}.bind(this)).fail(function(){}.bind(this))}.bind(this))},wc_stripe.CartGateway=function(){// cart events
4
  this.message_container="div.woocommerce",b(document.body).on("updated_wc_div",this.updated_html.bind(this)),b(document.body).on("updated_cart_totals",this.updated_html.bind(this)),b(document.body).on("wc_cart_emptied",this.cart_emptied.bind(this))},wc_stripe.CartGateway.prototype.submit_error=function(a){this.submit_message(this.get_error_message(a))},wc_stripe.CartGateway.prototype.updated_html=function(){},wc_stripe.CartGateway.prototype.cart_emptied=function(){},wc_stripe.CartGateway.prototype.add_cart_totals_class=function(){b(".cart_totals").addClass("stripe_cart_gateway_active")},wc_stripe.GooglePay=function(){};var d={apiVersion:2,apiVersionMinor:0},e={type:"CARD",parameters:{allowedAuthMethods:["PAN_ONLY"],allowedCardNetworks:["AMEX","DISCOVER","INTERAC","JCB","MASTERCARD","VISA"]}};wc_stripe.GooglePay.prototype.update_addresses=function(a){this.populate_billing_fields(a.paymentMethodData.info.billingAddress),a.shippingAddress&&this.populate_shipping_fields(a.shippingAddress),a.email&&this.fields.set("email",a.email,"billing")},wc_stripe.GooglePay.prototype.map_address=function(a){return{city:a.locality,postcode:a.postalCode,state:a.administrativeArea,country:a.countryCode}},wc_stripe.GooglePay.prototype.update_payment_data=function(a){return new Promise(function(c,d){var e="default"==a.shippingOptionData.id?null:a.shippingOptionData.id;b.when(b.ajax({url:this.params.routes.payment_data,dataType:"json",method:"POST",data:{shipping_address:this.map_address(a.shippingAddress),shipping_method:e,page_id:this.get_page()},beforeSend:this.ajax_before_send.bind(this)})).done(function(a){a.code?d(a.data.data):c(a.data)}.bind(this)).fail(function(){d()}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.on_payment_data_changed=function(a){return new Promise(function(b){this.update_payment_data(a).then(function(c){b(c.paymentRequestUpdate),this.set_selected_shipping_methods(c.shipping_methods),this.payment_data_updated(c,a)}.bind(this))["catch"](function(a){b(a)}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.payment_data_updated=function(){},wc_stripe.GooglePay.prototype.get_merchant_info=function(){var a={merchantId:this.params.merchant_id,merchantName:this.params.merchant_name};return"TEST"===this.params.environment&&delete a.merchantId,a},wc_stripe.GooglePay.prototype.get_payment_options=function(){var a={environment:this.params.environment,merchantInfo:this.get_merchant_info()};return a.paymentDataCallbacks=this.needs_shipping()?{onPaymentDataChanged:this.on_payment_data_changed.bind(this),onPaymentAuthorized:function(){return new Promise(function(a){a({transactionState:"SUCCESS"})}.bind(this))}.bind(this)}:{onPaymentAuthorized:function(){return new Promise(function(a){a({transactionState:"SUCCESS"})}.bind(this))}},a},wc_stripe.GooglePay.prototype.build_payment_request=function(){var a=b.extend({},d,{emailRequired:function(){return"checkout"===this.get_page()?this.fields.required("billing_email")&&this.fields.isEmpty("billing_email"):"order_pay"!==this.get_page()&&this.fields.required("billing_email")}.bind(this)(),merchantInfo:this.get_merchant_info(),allowedPaymentMethods:[b.extend({type:"CARD",tokenizationSpecification:{type:"PAYMENT_GATEWAY",parameters:{gateway:"stripe","stripe:version":"2018-10-31","stripe:publishableKey":this.params.api_key}}},e)],shippingAddressRequired:this.needs_shipping(),transactionInfo:{currencyCode:this.get_currency(),totalPriceStatus:"ESTIMATED",totalPrice:this.get_total_price().toString(),displayItems:this.get_display_items(),totalPriceLabel:this.params.total_price_label}});return a.allowedPaymentMethods[0].parameters.billingAddressRequired=!0,a.allowedPaymentMethods[0].parameters.billingAddressParameters={format:"FULL",phoneNumberRequired:function(){return"checkout"===this.get_page()?this.fields.required("billing_phone")&&this.fields.isEmpty("billing_phone"):"order_pay"!==this.get_page()&&this.fields.required("billing_phone")}.bind(this)()},this.needs_shipping()?(a.shippingAddressParameters={},a.shippingOptionRequired=!0,a.shippingOptionParameters={shippingOptions:this.get_shipping_options()},a.callbackIntents=["SHIPPING_ADDRESS","SHIPPING_OPTION","PAYMENT_AUTHORIZATION"]):a.callbackIntents=["PAYMENT_AUTHORIZATION"],a},wc_stripe.GooglePay.prototype.createPaymentsClient=function(){this.paymentsClient=new google.payments.api.PaymentsClient(this.get_payment_options())},wc_stripe.GooglePay.prototype.isReadyToPay=function(){return new Promise(function(a){var c=b.extend({},d);c.allowedPaymentMethods=[e],this.paymentsClient.isReadyToPay(c).then(function(){this.can_pay=!0,this.create_button(),a()}.bind(this))["catch"](function(a){this.submit_error(a)}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.create_button=function(){this.$button&&this.$button.remove(),this.$button=b(this.paymentsClient.createButton({onClick:this.start.bind(this),buttonColor:this.params.button_color,buttonType:this.params.button_style})),this.$button.addClass("gpay-button-container")},wc_stripe.GooglePay.prototype.start=function(){// always recreate the paymentClient to ensure latest data is used.
5
  this.createPaymentsClient(),this.paymentsClient.loadPaymentData(this.build_payment_request()).then(function(a){var b=JSON.parse(a.paymentMethodData.tokenizationData.token);this.update_addresses(a),this.on_token_received(b)}.bind(this))["catch"](function(a){"CANCELED"===a.statusCode||(a.statusMessage&&-1<a.statusMessage.indexOf("paymentDataRequest.callbackIntent")?this.submit_error_code("DEVELOPER_ERROR_WHITELIST"):this.submit_error(a.statusMessage))}.bind(this))},wc_stripe.ApplePay=function(){},wc_stripe.ApplePay.prototype.initialize=function(){var a=".apple-pay-button";0>["checkout","order_pay"].indexOf(this.get_page())&&(a=this.container+" .apple-pay-button"),b(document.body).on("click",a,this.start.bind(this)),this.createPaymentRequest(),this.canMakePayment()},wc_stripe.ApplePay.prototype.create_button=function(){this.$button&&this.$button.remove(),this.$button=b(this.params.button),this.append_button()},wc_stripe.ApplePay.prototype.canMakePayment=function(){return new Promise(function(a){this.paymentRequest.canMakePayment().then(function(c){c&&c.applePay&&(this.can_pay=!0,this.create_button(),b(this.container).show(),a(c))}.bind(this))}.bind(this))},wc_stripe.ApplePay.prototype.start=function(a){a.preventDefault(),this.paymentRequest.update(this.get_payment_request_update({total:{pending:!1}})),this.paymentRequest.show()},wc_stripe.PaymentRequest=function(){},wc_stripe.PaymentRequest.prototype.initialize=function(){this.createPaymentRequest(),this.canMakePayment(),this.createPaymentRequestButton(),this.paymentRequestButton.on("click",this.button_click.bind(this))},wc_stripe.PaymentRequest.prototype.button_click=function(){},wc_stripe.PaymentRequest.prototype.createPaymentRequestButton=function(){this.paymentRequestButton=this.elements.create("paymentRequestButton",{paymentRequest:this.paymentRequest,style:{paymentRequestButton:{type:this.params.button.type,theme:this.params.button.theme,height:this.params.button.height}}})},wc_stripe.PaymentRequest.prototype.canMakePayment=function(){return new Promise(function(a){this.paymentRequest.canMakePayment().then(function(c){c&&!c.applePay&&(this.can_pay=!0,this.create_button(),b(this.container).show(),a(c))}.bind(this))}.bind(this))},wc_stripe.PaymentRequest.prototype.create_button=function(){this.paymentRequestButton.mount("#wc-stripe-payment-request-container")},wc_stripe.CheckoutFields=function(a,c){this.params=a,this.page=c,this.fields=new Map(Object.keys(this.params).map(function(a){return[a,this.params[a].value]}.bind(this))),"checkout"===c&&(b("form.checkout").on("change",".input-text, select",this.onChange.bind(this)),b("form.checkout").on("change","[name=\"ship_to_different_address\"]",this.on_ship_to_address_change.bind(this)),this.init_i18n())},wc_stripe.CheckoutFields.prototype.init_i18n=function(){this.locales="undefined"==typeof wc_address_i18n_params?null:b.parseJSON(wc_address_i18n_params.locale.replace(/&quot;/g,"\""))},wc_stripe.CheckoutFields.prototype.onChange=function(a){try{var b=a.currentTarget.name,c=a.currentTarget.value;this.fields.set(b,c),("billing_country"===b||"shipping_country"===b)&&this.update_required_fields(c,b)}catch(a){console.log(a)}},wc_stripe.CheckoutFields.prototype.update_required_fields=function(a,c){if(this.locales){var d=-1<c.indexOf("billing_")?"billing_":"shipping_",e="undefined"==typeof this.locales[a]?this.locales["default"]:this.locales[a],f=b.extend(!0,{},this.locales["default"],e);for(var g in f){var h=d+g;this.params[h]&&(this.params[h]=b.extend(!0,{},this.params[h],f[g]))}}},wc_stripe.CheckoutFields.prototype.on_ship_to_address_change=function(a){b(a.currentTarget).is(":checked")&&this.update_required_fields(b("shipping_country"),"shipping_country")},wc_stripe.CheckoutFields.prototype.requestFieldInWallet=function(a){if("checkout"===this.page)return this.required(a)&&this.isEmpty(a);return"order_pay"!==this.page&&this.required(a)},wc_stripe.CheckoutFields.prototype.set=function(a,b,c){this[a]&&"function"==typeof this[a]?this[a]().set.call(this,b,c):this.fields.set(a,b)},wc_stripe.CheckoutFields.prototype.get=function(a,b){if(this[a]&&"function"==typeof this[a])var c=this[a]().get.call(this,b);else{var c=this.fields.get(a);("undefined"==typeof c||null===c||""===c)&&"undefined"!=typeof b&&(c=b)}return"undefined"==typeof c?"":c},wc_stripe.CheckoutFields.prototype.required=function(a){return!!(this.params[a]&&"undefined"!=typeof this.params[a].required)&&this.params[a].required},wc_stripe.CheckoutFields.prototype.isEmpty=function(a){if(this.fields.has(a)){var b=this.fields.get(a);return"undefined"==typeof b||null===b||"string"==typeof b&&0===b.trim().length}return!0},wc_stripe.CheckoutFields.prototype.name=function(){return{set:function(a,b){var c=a.split(" ");this.fields.set(b+"_first_name",c[0]),this.fields.set(b+"_last_name",c[1])},get:function(a){return this.fields.get(a+"_first_name")+" "+this.fields.get(a+"_last_name")}}},wc_stripe.CheckoutFields.prototype.payerName=function(){return wc_stripe.CheckoutFields.prototype.name.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.email=function(){return{set:function(a,b){this.fields.set(b+"_email",a)},get:function(a){return this.fields.get(a+"_email")}}},wc_stripe.CheckoutFields.prototype.payerEmail=function(){return wc_stripe.CheckoutFields.prototype.email.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.phone=function(){return{set:function(a,b){this.fields.set(b+"_phone",a)},get:function(a){return this.fields.get(a+"_phone")}}},wc_stripe.CheckoutFields.prototype.payerPhone=function(){return wc_stripe.CheckoutFields.prototype.phone.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.phoneNumber=function(){return wc_stripe.CheckoutFields.prototype.phone.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.recipient=function(){return{set:function(a,b){var c=a.split(" ");0<c.length&&this.fields.set(b+"_first_name",c[0]),1<c.length&&this.fields.set(b+"_last_name",c[1])},get:function(a){return this.fields.get(a+"_first_name")+" "+this.fields.get(a+"_last_name")}}},wc_stripe.CheckoutFields.prototype.country=function(){return{set:function(a,b){this.fields.set(b+"_country",a)},get:function(a){return this.fields.get(a+"_country")}}},wc_stripe.CheckoutFields.prototype.countryCode=function(){return wc_stripe.CheckoutFields.prototype.country.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.address1=function(){return{set:function(a,b){this.fields.set(b+"_address_1",a)},get:function(a){return this.fields.get(a+"_address_1")}}},wc_stripe.CheckoutFields.prototype.address2=function(){return{set:function(a,b){this.fields.set(b+"_address_2",a)},get:function(a){this.fields.get(a+"_address_2")}}},wc_stripe.CheckoutFields.prototype.line1=function(){return wc_stripe.CheckoutFields.prototype.address1.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.line2=function(){return wc_stripe.CheckoutFields.prototype.address2.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.addressLine=function(){return{set:function(a,b){0<a.length&&this.fields.set(b+"_address_1",a[0]),1<a.length&&this.fields.set(b+"_address_2",a[1])},get:function(a){return[this.fields.get(a+"_address_1"),this.fields.get(a+"_address_2")]}}},wc_stripe.CheckoutFields.prototype.state=function(){return{set:function(a,c){a=a.toUpperCase(),2<a.length&&"checkout"===this.page&&b("#"+c+"_state option").each(function(){var c=b(this),d=c.text().toUpperCase();a===d&&(a=c.val())}),this.fields.set(c+"_state",a)},get:function(a){return this.fields.get(a+"_state")}}},wc_stripe.CheckoutFields.prototype.region=function(){return wc_stripe.CheckoutFields.prototype.state.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.administrativeArea=function(){return wc_stripe.CheckoutFields.prototype.state.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.city=function(){return{set:function(a,b){this.fields.set(b+"_city",a)},get:function(a){this.fields.get(a+"_city")}}},wc_stripe.CheckoutFields.prototype.locality=function(){return wc_stripe.CheckoutFields.prototype.city.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.postcode=function(){return{set:function(a,b){this.fields.set(b+"_postcode",a)},get:function(a){this.fields.get(a+"_postcode")}}},wc_stripe.CheckoutFields.prototype.postal_code=function(){return wc_stripe.CheckoutFields.prototype.postcode.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.postalCode=function(){return wc_stripe.CheckoutFields.prototype.postcode.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.toJson=function(){var a={};return this.fields.forEach(function(b,c){a[c]=b}),a},wc_stripe.CheckoutFields.prototype.toFormFields=function(a){var c=[];this.fields.forEach(function(a,d){var e="[name=\""+d+"\"]";b(e).length&&""!==a&&(b(e).val()!==a&&b(e).is("select")&&c.push(e),b(e).val(a))}),0<c.length&&b(c.join(",")).trigger("change"),"undefined"!=typeof a&&b(document.body).trigger("update_checkout",a)};try{c=Stripe(wc_stripe_params_v3.api_key,{stripeAccount:wc_stripe_params_v3.account})}catch(b){return a.alert(b),void console.log(b)}var f=new wc_stripe.CheckoutFields(wc_stripe_checkout_fields,wc_stripe_params_v3.page)})(window,jQuery);
i18n/languages/woo-stripe-payment.pot CHANGED
@@ -2,14 +2,14 @@
2
  # This file is distributed under the same license as the Stripe For WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Stripe For WooCommerce 3.2.1\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: 2020-09-01T03:03:02+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"
@@ -32,6 +32,7 @@ msgstr ""
32
 
33
  #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:105
34
  #: includes/admin/meta-boxes/views/html-product-data.php:14
 
35
  #: includes/gateways/settings/ach-settings.php:9
36
  #: includes/gateways/settings/applepay-settings.php:11
37
  #: includes/gateways/settings/cc-settings.php:4
@@ -45,6 +46,7 @@ msgid "If enabled, your site can accept %s payments through Stripe."
45
  msgstr ""
46
 
47
  #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:114
 
48
  #: includes/gateways/settings/ach-settings.php:66
49
  #: includes/gateways/settings/applepay-settings.php:20
50
  #: includes/gateways/settings/cc-settings.php:17
@@ -55,6 +57,7 @@ msgstr ""
55
 
56
  #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:118
57
  #: includes/admin/meta-boxes/views/html-charge-data-subview.php:47
 
58
  #: includes/gateways/settings/ach-settings.php:70
59
  #: includes/gateways/settings/applepay-settings.php:24
60
  #: includes/gateways/settings/cc-settings.php:21
@@ -64,6 +67,7 @@ msgid "Title"
64
  msgstr ""
65
 
66
  #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:124
 
67
  #: includes/gateways/settings/ach-settings.php:76
68
  #: includes/gateways/settings/applepay-settings.php:30
69
  #: includes/gateways/settings/cc-settings.php:27
@@ -73,6 +77,7 @@ msgid "Description"
73
  msgstr ""
74
 
75
  #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:127
 
76
  #: includes/gateways/settings/ach-settings.php:79
77
  #: includes/gateways/settings/applepay-settings.php:33
78
  #: includes/gateways/settings/cc-settings.php:30
@@ -660,7 +665,7 @@ msgstr ""
660
  msgid "Your payment is being processed and your order status will be updated once the funds are received."
661
  msgstr ""
662
 
663
- #: includes/class-wc-stripe-frontend-scripts.php:75
664
  msgid "No matches found"
665
  msgstr ""
666
 
@@ -1099,102 +1104,122 @@ msgstr ""
1099
  msgid "Scan the QR code using your WeChat app. Once scanned click the Place Order button."
1100
  msgstr ""
1101
 
 
1102
  #: includes/gateways/settings/ach-settings.php:5
1103
  msgid "For US customers only."
1104
  msgstr ""
1105
 
 
1106
  #: includes/gateways/settings/ach-settings.php:6
1107
  msgid "Read through our %1$sdocumentation%2$s to configure ACH payments"
1108
  msgstr ""
1109
 
 
1110
  #: includes/gateways/settings/ach-settings.php:14
1111
  msgid "If enabled, your site can accept ACH payments through Stripe."
1112
  msgstr ""
1113
 
 
1114
  #: includes/gateways/settings/ach-settings.php:18
1115
  msgid "Plaid Environment"
1116
  msgstr ""
1117
 
 
1118
  #: includes/gateways/settings/ach-settings.php:21
1119
  msgid "Sandbox"
1120
  msgstr ""
1121
 
 
1122
  #: includes/gateways/settings/ach-settings.php:22
1123
  msgid "Development"
1124
  msgstr ""
1125
 
 
1126
  #: includes/gateways/settings/ach-settings.php:23
1127
  msgid "Production"
1128
  msgstr ""
1129
 
1130
- #: includes/gateways/settings/ach-settings.php:26
1131
- msgid "The active Plaid environment. You must set API mode to live to use Plaid's development environment."
1132
- msgstr ""
1133
-
1134
- #: includes/gateways/settings/ach-settings.php:36
1135
- msgid "ID that identifies your Plaid account."
1136
- msgstr ""
1137
-
1138
- #: includes/gateways/settings/ach-settings.php:44
1139
- msgid "Sandbox Secret"
1140
- msgstr ""
1141
-
1142
- #: includes/gateways/settings/ach-settings.php:47
1143
- msgid "Key that acts as a password when connecting to Plaid's sandbox environment."
1144
- msgstr ""
1145
-
1146
- #: includes/gateways/settings/ach-settings.php:51
1147
- msgid "Development Secret"
1148
- msgstr ""
1149
-
1150
- #: includes/gateways/settings/ach-settings.php:54
1151
- msgid "Development allows you to test real bank credentials with test transactions."
1152
- msgstr ""
1153
-
1154
- #: includes/gateways/settings/ach-settings.php:58
1155
- msgid "Production Secret"
1156
- msgstr ""
1157
-
1158
- #: includes/gateways/settings/ach-settings.php:61
1159
- msgid "Key that acts as a password when connecting to Plaid's production environment."
1160
  msgstr ""
1161
 
 
1162
  #: includes/gateways/settings/ach-settings.php:71
1163
  msgid "ACH Payment"
1164
  msgstr ""
1165
 
 
1166
  #: includes/gateways/settings/ach-settings.php:84
1167
  msgid "Client Name"
1168
  msgstr ""
1169
 
 
1170
  #: includes/gateways/settings/ach-settings.php:86
1171
  msgid "The name that appears on the ACH payment screen."
1172
  msgstr ""
1173
 
 
1174
  #: includes/gateways/settings/ach-settings.php:90
1175
  msgid "ACH Display"
1176
  msgstr ""
1177
 
 
1178
  #: includes/gateways/settings/ach-settings.php:100
1179
  msgid "ACH Fee"
1180
  msgstr ""
1181
 
 
1182
  #: includes/gateways/settings/ach-settings.php:110
1183
  msgid "None"
1184
  msgstr ""
1185
 
 
1186
  #: includes/gateways/settings/ach-settings.php:111
1187
  msgid "Amount"
1188
  msgstr ""
1189
 
 
1190
  #: includes/gateways/settings/ach-settings.php:112
1191
  msgid "Percentage"
1192
  msgstr ""
1193
 
 
1194
  #: includes/gateways/settings/ach-settings.php:115
1195
  msgid "You can assign a fee to the order for ACH payments. Amount is a static amount and percentage is a percentage of the cart amount."
1196
  msgstr ""
1197
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1198
  #: includes/gateways/settings/applepay-settings.php:5
1199
  msgid "Register Domain"
1200
  msgstr ""
@@ -1578,6 +1603,10 @@ msgstr ""
1578
  msgid "Card Type"
1579
  msgstr ""
1580
 
 
 
 
 
1581
  #: includes/tokens/class-wc-payment-token-stripe-local-payment.php:30
1582
  msgid "Gateway Title"
1583
  msgstr ""
2
  # This file is distributed under the same license as the Stripe For WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Stripe For WooCommerce 3.2.2\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: 2020-09-17T20:01:51+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"
32
 
33
  #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:105
34
  #: includes/admin/meta-boxes/views/html-product-data.php:14
35
+ #: includes/gateways/settings/ach-settings-v2.php:9
36
  #: includes/gateways/settings/ach-settings.php:9
37
  #: includes/gateways/settings/applepay-settings.php:11
38
  #: includes/gateways/settings/cc-settings.php:4
46
  msgstr ""
47
 
48
  #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:114
49
+ #: includes/gateways/settings/ach-settings-v2.php:64
50
  #: includes/gateways/settings/ach-settings.php:66
51
  #: includes/gateways/settings/applepay-settings.php:20
52
  #: includes/gateways/settings/cc-settings.php:17
57
 
58
  #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:118
59
  #: includes/admin/meta-boxes/views/html-charge-data-subview.php:47
60
+ #: includes/gateways/settings/ach-settings-v2.php:68
61
  #: includes/gateways/settings/ach-settings.php:70
62
  #: includes/gateways/settings/applepay-settings.php:24
63
  #: includes/gateways/settings/cc-settings.php:21
67
  msgstr ""
68
 
69
  #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:124
70
+ #: includes/gateways/settings/ach-settings-v2.php:74
71
  #: includes/gateways/settings/ach-settings.php:76
72
  #: includes/gateways/settings/applepay-settings.php:30
73
  #: includes/gateways/settings/cc-settings.php:27
77
  msgstr ""
78
 
79
  #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:127
80
+ #: includes/gateways/settings/ach-settings-v2.php:77
81
  #: includes/gateways/settings/ach-settings.php:79
82
  #: includes/gateways/settings/applepay-settings.php:33
83
  #: includes/gateways/settings/cc-settings.php:30
665
  msgid "Your payment is being processed and your order status will be updated once the funds are received."
666
  msgstr ""
667
 
668
+ #: includes/class-wc-stripe-frontend-scripts.php:76
669
  msgid "No matches found"
670
  msgstr ""
671
 
1104
  msgid "Scan the QR code using your WeChat app. Once scanned click the Place Order button."
1105
  msgstr ""
1106
 
1107
+ #: includes/gateways/settings/ach-settings-v2.php:5
1108
  #: includes/gateways/settings/ach-settings.php:5
1109
  msgid "For US customers only."
1110
  msgstr ""
1111
 
1112
+ #: includes/gateways/settings/ach-settings-v2.php:6
1113
  #: includes/gateways/settings/ach-settings.php:6
1114
  msgid "Read through our %1$sdocumentation%2$s to configure ACH payments"
1115
  msgstr ""
1116
 
1117
+ #: includes/gateways/settings/ach-settings-v2.php:14
1118
  #: includes/gateways/settings/ach-settings.php:14
1119
  msgid "If enabled, your site can accept ACH payments through Stripe."
1120
  msgstr ""
1121
 
1122
+ #: includes/gateways/settings/ach-settings-v2.php:18
1123
  #: includes/gateways/settings/ach-settings.php:18
1124
  msgid "Plaid Environment"
1125
  msgstr ""
1126
 
1127
+ #: includes/gateways/settings/ach-settings-v2.php:20
1128
  #: includes/gateways/settings/ach-settings.php:21
1129
  msgid "Sandbox"
1130
  msgstr ""
1131
 
1132
+ #: includes/gateways/settings/ach-settings-v2.php:21
1133
  #: includes/gateways/settings/ach-settings.php:22
1134
  msgid "Development"
1135
  msgstr ""
1136
 
1137
+ #: includes/gateways/settings/ach-settings-v2.php:22
1138
  #: includes/gateways/settings/ach-settings.php:23
1139
  msgid "Production"
1140
  msgstr ""
1141
 
1142
+ #: includes/gateways/settings/ach-settings-v2.php:24
1143
+ msgid "This setting determines the Plaid environment you are connecting with. When you are ready to accept live transactions, switch this option to Production.<br><strong>Production</strong> - accept live ACH payments <br><strong>Development</strong> - use real bank login details with test transactions <br><strong>Sandbox</strong> - test integration using test credentials"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1144
  msgstr ""
1145
 
1146
+ #: includes/gateways/settings/ach-settings-v2.php:69
1147
  #: includes/gateways/settings/ach-settings.php:71
1148
  msgid "ACH Payment"
1149
  msgstr ""
1150
 
1151
+ #: includes/gateways/settings/ach-settings-v2.php:82
1152
  #: includes/gateways/settings/ach-settings.php:84
1153
  msgid "Client Name"
1154
  msgstr ""
1155
 
1156
+ #: includes/gateways/settings/ach-settings-v2.php:84
1157
  #: includes/gateways/settings/ach-settings.php:86
1158
  msgid "The name that appears on the ACH payment screen."
1159
  msgstr ""
1160
 
1161
+ #: includes/gateways/settings/ach-settings-v2.php:88
1162
  #: includes/gateways/settings/ach-settings.php:90
1163
  msgid "ACH Display"
1164
  msgstr ""
1165
 
1166
+ #: includes/gateways/settings/ach-settings-v2.php:98
1167
  #: includes/gateways/settings/ach-settings.php:100
1168
  msgid "ACH Fee"
1169
  msgstr ""
1170
 
1171
+ #: includes/gateways/settings/ach-settings-v2.php:108
1172
  #: includes/gateways/settings/ach-settings.php:110
1173
  msgid "None"
1174
  msgstr ""
1175
 
1176
+ #: includes/gateways/settings/ach-settings-v2.php:109
1177
  #: includes/gateways/settings/ach-settings.php:111
1178
  msgid "Amount"
1179
  msgstr ""
1180
 
1181
+ #: includes/gateways/settings/ach-settings-v2.php:110
1182
  #: includes/gateways/settings/ach-settings.php:112
1183
  msgid "Percentage"
1184
  msgstr ""
1185
 
1186
+ #: includes/gateways/settings/ach-settings-v2.php:113
1187
  #: includes/gateways/settings/ach-settings.php:115
1188
  msgid "You can assign a fee to the order for ACH payments. Amount is a static amount and percentage is a percentage of the cart amount."
1189
  msgstr ""
1190
 
1191
+ #: includes/gateways/settings/ach-settings.php:26
1192
+ msgid "The active Plaid environment. You must set API mode to live to use Plaid's development environment."
1193
+ msgstr ""
1194
+
1195
+ #: includes/gateways/settings/ach-settings.php:36
1196
+ msgid "ID that identifies your Plaid account."
1197
+ msgstr ""
1198
+
1199
+ #: includes/gateways/settings/ach-settings.php:44
1200
+ msgid "Sandbox Secret"
1201
+ msgstr ""
1202
+
1203
+ #: includes/gateways/settings/ach-settings.php:47
1204
+ msgid "Key that acts as a password when connecting to Plaid's sandbox environment."
1205
+ msgstr ""
1206
+
1207
+ #: includes/gateways/settings/ach-settings.php:51
1208
+ msgid "Development Secret"
1209
+ msgstr ""
1210
+
1211
+ #: includes/gateways/settings/ach-settings.php:54
1212
+ msgid "Development allows you to test real bank credentials with test transactions."
1213
+ msgstr ""
1214
+
1215
+ #: includes/gateways/settings/ach-settings.php:58
1216
+ msgid "Production Secret"
1217
+ msgstr ""
1218
+
1219
+ #: includes/gateways/settings/ach-settings.php:61
1220
+ msgid "Key that acts as a password when connecting to Plaid's production environment."
1221
+ msgstr ""
1222
+
1223
  #: includes/gateways/settings/applepay-settings.php:5
1224
  msgid "Register Domain"
1225
  msgstr ""
1603
  msgid "Card Type"
1604
  msgstr ""
1605
 
1606
+ #: includes/tokens/class-wc-payment-token-stripe-googlepay.php:25
1607
+ msgid "Gateway Name"
1608
+ msgstr ""
1609
+
1610
  #: includes/tokens/class-wc-payment-token-stripe-local-payment.php:30
1611
  msgid "Gateway Title"
1612
  msgstr ""
includes/class-stripe.php CHANGED
@@ -25,7 +25,7 @@ class WC_Stripe_Manager {
25
  *
26
  * @var string
27
  */
28
- public $version = '3.2.1';
29
 
30
  /**
31
  *
25
  *
26
  * @var string
27
  */
28
+ public $version = '3.2.2';
29
 
30
  /**
31
  *
includes/class-wc-stripe-frontend-scripts.php CHANGED
@@ -67,6 +67,7 @@ class WC_Stripe_Frontend_Scripts {
67
  'api_key' => wc_stripe_get_publishable_key(),
68
  'account' => wc_stripe_get_account_id(),
69
  'page' => $this->get_page_id(),
 
70
  ),
71
  'wc_stripe_params_v3'
72
  );
67
  'api_key' => wc_stripe_get_publishable_key(),
68
  'account' => wc_stripe_get_account_id(),
69
  'page' => $this->get_page_id(),
70
+ 'version' => wc_stripe()->version()
71
  ),
72
  'wc_stripe_params_v3'
73
  );
includes/controllers/class-wc-stripe-controller-plaid.php CHANGED
@@ -9,8 +9,9 @@ class WC_Stripe_Controller_Plaid extends WC_Stripe_Rest_Controller {
9
 
10
  public function register_routes() {
11
  register_rest_route( $this->rest_uri(), 'link-token', array(
12
- 'methods' => WP_REST_Server::CREATABLE,
13
- 'callback' => array( $this, 'get_link_token' )
 
14
  ) );
15
  }
16
 
@@ -18,7 +19,6 @@ class WC_Stripe_Controller_Plaid extends WC_Stripe_Rest_Controller {
18
  * @param WP_REST_Request $request
19
  */
20
  public function get_link_token( $request ) {
21
- $this->frontend_includes();
22
  /**
23
  * @var WC_Payment_Gateway_Stripe_ACH $gateway
24
  */
9
 
10
  public function register_routes() {
11
  register_rest_route( $this->rest_uri(), 'link-token', array(
12
+ 'methods' => WP_REST_Server::CREATABLE,
13
+ 'callback' => array( $this, 'get_link_token' ),
14
+ 'permission_callback' => array( $this, 'validate_rest_nonce' )
15
  ) );
16
  }
17
 
19
  * @param WP_REST_Request $request
20
  */
21
  public function get_link_token( $request ) {
 
22
  /**
23
  * @var WC_Payment_Gateway_Stripe_ACH $gateway
24
  */
includes/gateways/settings/googlepay-settings.php CHANGED
@@ -56,7 +56,7 @@ return array(
56
  'class' => 'wc-enhanced-select',
57
  'options' => wp_list_pluck( $this->get_method_formats(), 'example' ),
58
  'value' => '',
59
- 'default' => 'type_ending_in',
60
  'desc_tip' => true,
61
  'description' => __( 'This option allows you to customize how the credit card will display for your customers on orders, subscriptions, etc.' ),
62
  ),
56
  'class' => 'wc-enhanced-select',
57
  'options' => wp_list_pluck( $this->get_method_formats(), 'example' ),
58
  'value' => '',
59
+ 'default' => 'gpay_name',
60
  'desc_tip' => true,
61
  'description' => __( 'This option allows you to customize how the credit card will display for your customers on orders, subscriptions, etc.' ),
62
  ),
includes/tokens/class-wc-payment-token-stripe-cc.php CHANGED
@@ -85,7 +85,7 @@ class WC_Payment_Token_Stripe_CC extends WC_Payment_Token_Stripe {
85
  }
86
 
87
  public function get_formats() {
88
- return array(
89
  'type_ending_in' => array(
90
  'label' => __( 'Type Ending In', 'woo-stripe-payment' ),
91
  'example' => 'Visa ending in 1111',
@@ -121,6 +121,6 @@ class WC_Payment_Token_Stripe_CC extends WC_Payment_Token_Stripe {
121
  'example' => 'Visa',
122
  'format' => '{brand}',
123
  ),
124
- );
125
  }
126
  }
85
  }
86
 
87
  public function get_formats() {
88
+ return apply_filters( 'wc_stripe_get_token_formats', array(
89
  'type_ending_in' => array(
90
  'label' => __( 'Type Ending In', 'woo-stripe-payment' ),
91
  'example' => 'Visa ending in 1111',
121
  'example' => 'Visa',
122
  'format' => '{brand}',
123
  ),
124
+ ) );
125
  }
126
  }
includes/tokens/class-wc-payment-token-stripe-googlepay.php CHANGED
@@ -18,4 +18,14 @@ class WC_Payment_Token_Stripe_GooglePay extends WC_Payment_Token_Stripe_CC {
18
  protected $type = 'Stripe_GooglePay';
19
 
20
  protected $stripe_payment_type = 'source';
 
 
 
 
 
 
 
 
 
 
21
  }
18
  protected $type = 'Stripe_GooglePay';
19
 
20
  protected $stripe_payment_type = 'source';
21
+
22
+ public function get_formats() {
23
+ return array(
24
+ 'gpay_name' => array(
25
+ 'label' => __( 'Gateway Name', 'woo-stripe-payment' ),
26
+ 'example' => 'Visa 1111 (Google Pay)',
27
+ 'format' => '{brand} {last4} (Google Pay)'
28
+ )
29
+ ) + parent::get_formats();
30
+ }
31
  }
includes/traits/wc-stripe-controller-traits.php CHANGED
@@ -80,4 +80,19 @@ trait WC_Stripe_Controller_Frontend_Trait {
80
  WC()->cart->get_cart();
81
  WC()->payment_gateways();
82
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  }
80
  WC()->cart->get_cart();
81
  WC()->payment_gateways();
82
  }
83
+
84
+ /**
85
+ * @param $request
86
+ *
87
+ * @return bool|WP_Error
88
+ * @since 3.2.2
89
+ */
90
+ public function validate_rest_nonce( $request ) {
91
+ $this->frontend_includes();
92
+ if ( ! isset( $request['wp_rest_nonce'] ) || ! wp_verify_nonce( $request['wp_rest_nonce'], 'wp_rest' ) ) {
93
+ return new WP_Error( 'rest_cookie_invalid_nonce', __( 'Cookie nonce is invalid' ), array( 'status' => 403 ) );
94
+ }
95
+
96
+ return true;
97
+ }
98
  }
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: 5.5
6
  Requires PHP: 5.6
7
- Stable tag: 3.2.1
8
  Copyright: Payment Plugins
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -58,6 +58,11 @@ If you're site is not loading over https, then Stripe won't render the Payment R
58
  8. Edit payment gateways on the product page
59
 
60
  == Changelog ==
 
 
 
 
 
61
  = 3.2.1 =
62
  * Updated - Plaid Link integration to use new Link Token
63
  * Updated - Convert state long name i.e. Texas = TX in case address is not abbreviated in wallet
4
  Requires at least: 3.0.1
5
  Tested up to: 5.5
6
  Requires PHP: 5.6
7
+ Stable tag: 3.2.2
8
  Copyright: Payment Plugins
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
58
  8. Edit payment gateways on the product page
59
 
60
  == Changelog ==
61
+ = 3.2.2 =
62
+ * Fixed - 403 for logged out user when link-token fetched on checkout page
63
+ * Added - Payment method format for GPay. Example: Visa 1111 (Google Pay)
64
+ * Added - Filter for product and cart page checkout so 3rd party plugins can add custom fields to checkout process
65
+ * Updated - Stripe PHP lib version to 7.52.0
66
  = 3.2.1 =
67
  * Updated - Plaid Link integration to use new Link Token
68
  * Updated - Convert state long name i.e. Texas = TX in case address is not abbreviated in wallet
stripe-payments.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Stripe For WooCommerce
4
  * Plugin URI: https://docs.paymentplugins.com/wc-stripe/config/
5
  * Description: Accept credit cards, Google Pay, Apple Pay, ACH, Klarna and more using Stripe.
6
- * Version: 3.2.1
7
  * Author: Payment Plugins, support@paymentplugins.com
8
  * Text Domain: woo-stripe-payment
9
  * Domain Path: /i18n/languages/
3
  * Plugin Name: Stripe For WooCommerce
4
  * Plugin URI: https://docs.paymentplugins.com/wc-stripe/config/
5
  * Description: Accept credit cards, Google Pay, Apple Pay, ACH, Klarna and more using Stripe.
6
+ * Version: 3.2.2
7
  * Author: Payment Plugins, support@paymentplugins.com
8
  * Text Domain: woo-stripe-payment
9
  * Domain Path: /i18n/languages/
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInitd8b5642c0fbdda03c8f0b20e89e630ae::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit9cfb6f50dc46731d97046cbb38624809::getLoader();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInitd8b5642c0fbdda03c8f0b20e89e630ae
6
  {
7
  private static $loader;
8
 
@@ -22,15 +22,15 @@ class ComposerAutoloaderInitd8b5642c0fbdda03c8f0b20e89e630ae
22
  return self::$loader;
23
  }
24
 
25
- spl_autoload_register(array('ComposerAutoloaderInitd8b5642c0fbdda03c8f0b20e89e630ae', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
- spl_autoload_unregister(array('ComposerAutoloaderInitd8b5642c0fbdda03c8f0b20e89e630ae', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require_once __DIR__ . '/autoload_static.php';
32
 
33
- call_user_func(\Composer\Autoload\ComposerStaticInitd8b5642c0fbdda03c8f0b20e89e630ae::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit9cfb6f50dc46731d97046cbb38624809
6
  {
7
  private static $loader;
8
 
22
  return self::$loader;
23
  }
24
 
25
+ spl_autoload_register(array('ComposerAutoloaderInit9cfb6f50dc46731d97046cbb38624809', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
+ spl_autoload_unregister(array('ComposerAutoloaderInit9cfb6f50dc46731d97046cbb38624809', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require_once __DIR__ . '/autoload_static.php';
32
 
33
+ call_user_func(\Composer\Autoload\ComposerStaticInit9cfb6f50dc46731d97046cbb38624809::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInitd8b5642c0fbdda03c8f0b20e89e630ae
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'S' =>
@@ -23,8 +23,8 @@ class ComposerStaticInitd8b5642c0fbdda03c8f0b20e89e630ae
23
  public static function getInitializer(ClassLoader $loader)
24
  {
25
  return \Closure::bind(function () use ($loader) {
26
- $loader->prefixLengthsPsr4 = ComposerStaticInitd8b5642c0fbdda03c8f0b20e89e630ae::$prefixLengthsPsr4;
27
- $loader->prefixDirsPsr4 = ComposerStaticInitd8b5642c0fbdda03c8f0b20e89e630ae::$prefixDirsPsr4;
28
 
29
  }, null, ClassLoader::class);
30
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit9cfb6f50dc46731d97046cbb38624809
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'S' =>
23
  public static function getInitializer(ClassLoader $loader)
24
  {
25
  return \Closure::bind(function () use ($loader) {
26
+ $loader->prefixLengthsPsr4 = ComposerStaticInit9cfb6f50dc46731d97046cbb38624809::$prefixLengthsPsr4;
27
+ $loader->prefixDirsPsr4 = ComposerStaticInit9cfb6f50dc46731d97046cbb38624809::$prefixDirsPsr4;
28
 
29
  }, null, ClassLoader::class);
30
  }
vendor/composer/installed.json CHANGED
@@ -1,17 +1,17 @@
1
  [
2
  {
3
  "name": "stripe/stripe-php",
4
- "version": "v7.50.0",
5
- "version_normalized": "7.50.0.0",
6
  "source": {
7
  "type": "git",
8
  "url": "https://github.com/stripe/stripe-php.git",
9
- "reference": "0195e3dcc34123df9a441069dbf08db17c3b025d"
10
  },
11
  "dist": {
12
  "type": "zip",
13
- "url": "https://api.github.com/repos/stripe/stripe-php/zipball/0195e3dcc34123df9a441069dbf08db17c3b025d",
14
- "reference": "0195e3dcc34123df9a441069dbf08db17c3b025d",
15
  "shasum": ""
16
  },
17
  "require": {
@@ -27,7 +27,7 @@
27
  "squizlabs/php_codesniffer": "^3.3",
28
  "symfony/process": "~3.4"
29
  },
30
- "time": "2020-08-28T20:17:35+00:00",
31
  "type": "library",
32
  "extra": {
33
  "branch-alias": {
1
  [
2
  {
3
  "name": "stripe/stripe-php",
4
+ "version": "v7.52.0",
5
+ "version_normalized": "7.52.0.0",
6
  "source": {
7
  "type": "git",
8
  "url": "https://github.com/stripe/stripe-php.git",
9
+ "reference": "51e95c514aff45616dff09791ca5b2f10cf5c4e8"
10
  },
11
  "dist": {
12
  "type": "zip",
13
+ "url": "https://api.github.com/repos/stripe/stripe-php/zipball/51e95c514aff45616dff09791ca5b2f10cf5c4e8",
14
+ "reference": "51e95c514aff45616dff09791ca5b2f10cf5c4e8",
15
  "shasum": ""
16
  },
17
  "require": {
27
  "squizlabs/php_codesniffer": "^3.3",
28
  "symfony/process": "~3.4"
29
  },
30
+ "time": "2020-09-08T19:29:20+00:00",
31
  "type": "library",
32
  "extra": {
33
  "branch-alias": {
vendor/stripe/stripe-php/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
  # Changelog
2
 
 
 
 
 
 
 
 
 
 
3
  ## 7.50.0 - 2020-08-28
4
  * [#1005](https://github.com/stripe/stripe-php/pull/1005) Updated PHPDocs
5
 
1
  # Changelog
2
 
3
+ ## 7.52.0 - 2020-09-08
4
+ * [#1010](https://github.com/stripe/stripe-php/pull/1010) Update PHPDocs
5
+
6
+ ## 7.51.0 - 2020-09-02
7
+ * [#1007](https://github.com/stripe/stripe-php/pull/1007) Multiple API changes
8
+ * Add support for the Issuing Dispute Submit API
9
+ * Add constants for `payment_status` on Checkout `Session`
10
+ * [#1003](https://github.com/stripe/stripe-php/pull/1003) Add trim to getSignatures to allow for leading whitespace.
11
+
12
  ## 7.50.0 - 2020-08-28
13
  * [#1005](https://github.com/stripe/stripe-php/pull/1005) Updated PHPDocs
14
 
vendor/stripe/stripe-php/VERSION CHANGED
@@ -1 +1 @@
1
- 7.50.0
1
+ 7.52.0
vendor/stripe/stripe-php/lib/BankAccount.php CHANGED
@@ -23,6 +23,7 @@ namespace Stripe;
23
  * @property null|string|\Stripe\Account $account The ID of the account that the bank account is associated with.
24
  * @property null|string $account_holder_name The name of the person or business that owns the bank account.
25
  * @property null|string $account_holder_type The type of entity that holds the account. This can be either <code>individual</code> or <code>company</code>.
 
26
  * @property null|string $bank_name Name of the bank associated with the routing number (e.g., <code>WELLS FARGO</code>).
27
  * @property string $country Two-letter ISO code representing the country the bank account is located in.
28
  * @property string $currency Three-letter <a href="https://stripe.com/docs/payouts">ISO code for the currency</a> paid out to the bank account.
23
  * @property null|string|\Stripe\Account $account The ID of the account that the bank account is associated with.
24
  * @property null|string $account_holder_name The name of the person or business that owns the bank account.
25
  * @property null|string $account_holder_type The type of entity that holds the account. This can be either <code>individual</code> or <code>company</code>.
26
+ * @property null|string[] $available_payout_methods A set of available payout methods for this bank account. Only values from this set should be passed as the <code>method</code> when creating a payout.
27
  * @property null|string $bank_name Name of the bank associated with the routing number (e.g., <code>WELLS FARGO</code>).
28
  * @property string $country Two-letter ISO code representing the country the bank account is located in.
29
  * @property string $currency Three-letter <a href="https://stripe.com/docs/payouts">ISO code for the currency</a> paid out to the bank account.
vendor/stripe/stripe-php/lib/Card.php CHANGED
@@ -23,12 +23,12 @@ namespace Stripe;
23
  * @property null|string $address_state State/County/Province/Region.
24
  * @property null|string $address_zip ZIP or postal code.
25
  * @property null|string $address_zip_check If <code>address_zip</code> was provided, results of the check: <code>pass</code>, <code>fail</code>, <code>unavailable</code>, or <code>unchecked</code>.
26
- * @property null|string[] $available_payout_methods A set of available payout methods for this card. Will be either <code>[&quot;standard&quot;]</code> or <code>[&quot;standard&quot;, &quot;instant&quot;]</code>. Only values from this set should be passed as the <code>method</code> when creating a transfer.
27
  * @property string $brand Card brand. Can be <code>American Express</code>, <code>Diners Club</code>, <code>Discover</code>, <code>JCB</code>, <code>MasterCard</code>, <code>UnionPay</code>, <code>Visa</code>, or <code>Unknown</code>.
28
  * @property null|string $country Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.
29
  * @property null|string $currency
30
  * @property null|string|\Stripe\Customer $customer The customer that this card belongs to. This attribute will not be in the card object if the card belongs to an account or recipient instead.
31
- * @property null|string $cvc_check If a CVC was provided, results of the check: <code>pass</code>, <code>fail</code>, <code>unavailable</code>, or <code>unchecked</code>.
32
  * @property null|bool $default_for_currency Whether this card is the default external account for its currency.
33
  * @property null|string $dynamic_last4 (For tokenized numbers only.) The last four digits of the device account number.
34
  * @property int $exp_month Two-digit number representing the card's expiration month.
23
  * @property null|string $address_state State/County/Province/Region.
24
  * @property null|string $address_zip ZIP or postal code.
25
  * @property null|string $address_zip_check If <code>address_zip</code> was provided, results of the check: <code>pass</code>, <code>fail</code>, <code>unavailable</code>, or <code>unchecked</code>.
26
+ * @property null|string[] $available_payout_methods A set of available payout methods for this card. Only values from this set should be passed as the <code>method</code> when creating a payout.
27
  * @property string $brand Card brand. Can be <code>American Express</code>, <code>Diners Club</code>, <code>Discover</code>, <code>JCB</code>, <code>MasterCard</code>, <code>UnionPay</code>, <code>Visa</code>, or <code>Unknown</code>.
28
  * @property null|string $country Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.
29
  * @property null|string $currency
30
  * @property null|string|\Stripe\Customer $customer The customer that this card belongs to. This attribute will not be in the card object if the card belongs to an account or recipient instead.
31
+ * @property null|string $cvc_check If a CVC was provided, results of the check: <code>pass</code>, <code>fail</code>, <code>unavailable</code>, or <code>unchecked</code>. A result of unchecked indicates that CVC was provided but hasn't been checked yet. Checks are typically performed when attaching a card to a Customer object, or when creating a charge. For more details, see <a href="https://support.stripe.com/questions/check-if-a-card-is-valid-without-a-charge">Check if a card is valid without a charge</a>.
32
  * @property null|bool $default_for_currency Whether this card is the default external account for its currency.
33
  * @property null|string $dynamic_last4 (For tokenized numbers only.) The last four digits of the device account number.
34
  * @property int $exp_month Two-digit number representing the card's expiration month.
vendor/stripe/stripe-php/lib/Charge.php CHANGED
@@ -19,7 +19,7 @@ namespace Stripe;
19
  * @property int $amount_refunded Amount in %s refunded (can be less than the amount attribute on the charge if a partial refund was issued).
20
  * @property null|string|\Stripe\StripeObject $application ID of the Connect application that created the charge.
21
  * @property null|string|\Stripe\ApplicationFee $application_fee The application fee (if any) for the charge. <a href="https://stripe.com/docs/connect/direct-charges#collecting-fees">See the Connect documentation</a> for details.
22
- * @property null|int $application_fee_amount The amount of the application fee (if any) for the charge. <a href="https://stripe.com/docs/connect/direct-charges#collecting-fees">See the Connect documentation</a> for details.
23
  * @property null|string|\Stripe\BalanceTransaction $balance_transaction ID of the balance transaction that describes the impact of this charge on your account balance (not including refunds or disputes).
24
  * @property \Stripe\StripeObject $billing_details
25
  * @property null|string $calculated_statement_descriptor The full statement descriptor that is passed to card networks, and that is displayed on your customers' credit card and bank statements. Allows you to see what the statement descriptor looks like after the static and dynamic portions are combined.
19
  * @property int $amount_refunded Amount in %s refunded (can be less than the amount attribute on the charge if a partial refund was issued).
20
  * @property null|string|\Stripe\StripeObject $application ID of the Connect application that created the charge.
21
  * @property null|string|\Stripe\ApplicationFee $application_fee The application fee (if any) for the charge. <a href="https://stripe.com/docs/connect/direct-charges#collecting-fees">See the Connect documentation</a> for details.
22
+ * @property null|int $application_fee_amount The amount of the application fee (if any) requested for the charge. <a href="https://stripe.com/docs/connect/direct-charges#collecting-fees">See the Connect documentation</a> for details.
23
  * @property null|string|\Stripe\BalanceTransaction $balance_transaction ID of the balance transaction that describes the impact of this charge on your account balance (not including refunds or disputes).
24
  * @property \Stripe\StripeObject $billing_details
25
  * @property null|string $calculated_statement_descriptor The full statement descriptor that is passed to card networks, and that is displayed on your customers' credit card and bank statements. Allows you to see what the statement descriptor looks like after the static and dynamic portions are combined.
vendor/stripe/stripe-php/lib/Checkout/Session.php CHANGED
@@ -37,9 +37,10 @@ namespace Stripe\Checkout;
37
  * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
38
  * @property null|string $locale The IETF language tag of the locale Checkout is displayed in. If blank or <code>auto</code>, the browser's locale is used.
39
  * @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
40
- * @property null|string $mode The mode of the Checkout Session, one of <code>payment</code>, <code>setup</code>, or <code>subscription</code>.
41
  * @property null|string|\Stripe\PaymentIntent $payment_intent The ID of the PaymentIntent for Checkout Sessions in <code>payment</code> mode.
42
  * @property string[] $payment_method_types A list of the types of payment methods (e.g. card) this Checkout Session is allowed to accept.
 
43
  * @property null|string|\Stripe\SetupIntent $setup_intent The ID of the SetupIntent for Checkout Sessions in <code>setup</code> mode.
44
  * @property null|\Stripe\StripeObject $shipping Shipping information for this Checkout Session.
45
  * @property null|\Stripe\StripeObject $shipping_address_collection When set, provides configuration for Checkout to collect a shipping address from a customer.
@@ -60,6 +61,10 @@ class Session extends \Stripe\ApiResource
60
  const BILLING_ADDRESS_COLLECTION_AUTO = 'auto';
61
  const BILLING_ADDRESS_COLLECTION_REQUIRED = 'required';
62
 
 
 
 
 
63
  const SUBMIT_TYPE_AUTO = 'auto';
64
  const SUBMIT_TYPE_BOOK = 'book';
65
  const SUBMIT_TYPE_DONATE = 'donate';
37
  * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
38
  * @property null|string $locale The IETF language tag of the locale Checkout is displayed in. If blank or <code>auto</code>, the browser's locale is used.
39
  * @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
40
+ * @property string $mode The mode of the Checkout Session, one of <code>payment</code>, <code>setup</code>, or <code>subscription</code>.
41
  * @property null|string|\Stripe\PaymentIntent $payment_intent The ID of the PaymentIntent for Checkout Sessions in <code>payment</code> mode.
42
  * @property string[] $payment_method_types A list of the types of payment methods (e.g. card) this Checkout Session is allowed to accept.
43
+ * @property string $payment_status The payment status of the Checkout Session, one of <code>paid</code>, <code>unpaid</code>, or <code>no_payment_required</code>. You can use this value to decide when to fulfill your customer's order.
44
  * @property null|string|\Stripe\SetupIntent $setup_intent The ID of the SetupIntent for Checkout Sessions in <code>setup</code> mode.
45
  * @property null|\Stripe\StripeObject $shipping Shipping information for this Checkout Session.
46
  * @property null|\Stripe\StripeObject $shipping_address_collection When set, provides configuration for Checkout to collect a shipping address from a customer.
61
  const BILLING_ADDRESS_COLLECTION_AUTO = 'auto';
62
  const BILLING_ADDRESS_COLLECTION_REQUIRED = 'required';
63
 
64
+ const PAYMENT_STATUS_NO_PAYMENT_REQUIRED = 'no_payment_required';
65
+ const PAYMENT_STATUS_PAID = 'paid';
66
+ const PAYMENT_STATUS_UNPAID = 'unpaid';
67
+
68
  const SUBMIT_TYPE_AUTO = 'auto';
69
  const SUBMIT_TYPE_BOOK = 'book';
70
  const SUBMIT_TYPE_DONATE = 'donate';
vendor/stripe/stripe-php/lib/Issuing/Dispute.php CHANGED
@@ -15,8 +15,14 @@ namespace Stripe\Issuing;
15
  *
16
  * @property string $id Unique identifier for the object.
17
  * @property string $object String representing the object's type. Objects of the same type share the same value.
 
18
  * @property null|\Stripe\BalanceTransaction[] $balance_transactions List of balance transactions associated with the dispute.
 
 
 
19
  * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
 
 
20
  * @property string|\Stripe\Issuing\Transaction $transaction The transaction being disputed.
21
  */
22
  class Dispute extends \Stripe\ApiResource
@@ -27,4 +33,21 @@ class Dispute extends \Stripe\ApiResource
27
  use \Stripe\ApiOperations\Create;
28
  use \Stripe\ApiOperations\Retrieve;
29
  use \Stripe\ApiOperations\Update;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  }
15
  *
16
  * @property string $id Unique identifier for the object.
17
  * @property string $object String representing the object's type. Objects of the same type share the same value.
18
+ * @property int $amount Disputed amount. Usually the amount of the <code>disputed_transaction</code>, but can differ (usually because of currency fluctuation).
19
  * @property null|\Stripe\BalanceTransaction[] $balance_transactions List of balance transactions associated with the dispute.
20
+ * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
21
+ * @property string $currency The currency the <code>disputed_transaction</code> was made in.
22
+ * @property \Stripe\StripeObject $evidence
23
  * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
24
+ * @property \Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
25
+ * @property string $status Current status of the dispute.
26
  * @property string|\Stripe\Issuing\Transaction $transaction The transaction being disputed.
27
  */
28
  class Dispute extends \Stripe\ApiResource
33
  use \Stripe\ApiOperations\Create;
34
  use \Stripe\ApiOperations\Retrieve;
35
  use \Stripe\ApiOperations\Update;
36
+
37
+ /**
38
+ * @param null|array $params
39
+ * @param null|array|string $opts
40
+ *
41
+ * @throws \Stripe\Exception\ApiErrorException if the request fails
42
+ *
43
+ * @return Dispute the submited dispute
44
+ */
45
+ public function submit($params = null, $opts = null)
46
+ {
47
+ $url = $this->instanceUrl() . '/submit';
48
+ list($response, $opts) = $this->_request('post', $url, $params, $opts);
49
+ $this->refreshFrom($response, $opts);
50
+
51
+ return $this;
52
+ }
53
  }
vendor/stripe/stripe-php/lib/Issuing/Transaction.php CHANGED
@@ -24,6 +24,7 @@ namespace Stripe\Issuing;
24
  * @property null|string|\Stripe\Issuing\Cardholder $cardholder The cardholder to whom this transaction belongs.
25
  * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
26
  * @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
 
27
  * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
28
  * @property int $merchant_amount The amount that the merchant will receive, denominated in <code>merchant_currency</code> and in the <a href="https://stripe.com/docs/currencies#zero-decimal">smallest currency unit</a>. It will be different from <code>amount</code> if the merchant is taking payment in a different currency.
29
  * @property string $merchant_currency The currency with which the merchant is taking payment.
24
  * @property null|string|\Stripe\Issuing\Cardholder $cardholder The cardholder to whom this transaction belongs.
25
  * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
26
  * @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
27
+ * @property null|string|\Stripe\Issuing\Dispute $dispute If you've disputed the transaction, the ID of the dispute.
28
  * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
29
  * @property int $merchant_amount The amount that the merchant will receive, denominated in <code>merchant_currency</code> and in the <a href="https://stripe.com/docs/currencies#zero-decimal">smallest currency unit</a>. It will be different from <code>amount</code> if the merchant is taking payment in a different currency.
30
  * @property string $merchant_currency The currency with which the merchant is taking payment.
vendor/stripe/stripe-php/lib/PaymentIntent.php CHANGED
@@ -24,7 +24,7 @@ namespace Stripe;
24
  * @property int $amount_capturable Amount that can be captured from this PaymentIntent.
25
  * @property int $amount_received Amount that was collected by this PaymentIntent.
26
  * @property null|string|\Stripe\StripeObject $application ID of the Connect application that created the PaymentIntent.
27
- * @property null|int $application_fee_amount The amount of the application fee (if any) for the resulting payment. See the PaymentIntents <a href="https://stripe.com/docs/payments/connected-accounts">use case for connected accounts</a> for details.
28
  * @property null|int $canceled_at Populated when <code>status</code> is <code>canceled</code>, this is the time at which the PaymentIntent was canceled. Measured in seconds since the Unix epoch.
29
  * @property null|string $cancellation_reason Reason for cancellation of this PaymentIntent, either user-provided (<code>duplicate</code>, <code>fraudulent</code>, <code>requested_by_customer</code>, or <code>abandoned</code>) or generated by Stripe internally (<code>failed_invoice</code>, <code>void_invoice</code>, or <code>automatic</code>).
30
  * @property string $capture_method Controls when the funds will be captured from the customer's account.
24
  * @property int $amount_capturable Amount that can be captured from this PaymentIntent.
25
  * @property int $amount_received Amount that was collected by this PaymentIntent.
26
  * @property null|string|\Stripe\StripeObject $application ID of the Connect application that created the PaymentIntent.
27
+ * @property null|int $application_fee_amount The amount of the application fee (if any) requested for the resulting payment. See the PaymentIntents <a href="https://stripe.com/docs/payments/connected-accounts">use case for connected accounts</a> for details.
28
  * @property null|int $canceled_at Populated when <code>status</code> is <code>canceled</code>, this is the time at which the PaymentIntent was canceled. Measured in seconds since the Unix epoch.
29
  * @property null|string $cancellation_reason Reason for cancellation of this PaymentIntent, either user-provided (<code>duplicate</code>, <code>fraudulent</code>, <code>requested_by_customer</code>, or <code>abandoned</code>) or generated by Stripe internally (<code>failed_invoice</code>, <code>void_invoice</code>, or <code>automatic</code>).
30
  * @property string $capture_method Controls when the funds will be captured from the customer's account.
vendor/stripe/stripe-php/lib/PaymentMethod.php CHANGED
@@ -36,6 +36,7 @@ namespace Stripe;
36
  * @property \Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
37
  * @property \Stripe\StripeObject $p24
38
  * @property \Stripe\StripeObject $sepa_debit
 
39
  * @property string $type The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type.
40
  */
41
  class PaymentMethod extends ApiResource
36
  * @property \Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
37
  * @property \Stripe\StripeObject $p24
38
  * @property \Stripe\StripeObject $sepa_debit
39
+ * @property \Stripe\StripeObject $sofort
40
  * @property string $type The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type.
41
  */
42
  class PaymentMethod extends ApiResource
vendor/stripe/stripe-php/lib/Reporting/ReportRun.php CHANGED
@@ -22,7 +22,7 @@ namespace Stripe\Reporting;
22
  * @property null|string $error If something should go wrong during the run, a message about the failure (populated when <code>status=failed</code>).
23
  * @property bool $livemode Always <code>true</code>: reports can only be run on live-mode data.
24
  * @property \Stripe\StripeObject $parameters
25
- * @property string $report_type The ID of the <a href="https://stripe.com/docs/reporting/statements/api#report-types">report type</a> to run, such as <code>&quot;balance.summary.1&quot;</code>.
26
  * @property null|\Stripe\File $result The file object representing the result of the report run (populated when <code>status=succeeded</code>).
27
  * @property string $status Status of this report run. This will be <code>pending</code> when the run is initially created. When the run finishes, this will be set to <code>succeeded</code> and the <code>result</code> field will be populated. Rarely, we may encounter an error, at which point this will be set to <code>failed</code> and the <code>error</code> field will be populated.
28
  * @property null|int $succeeded_at Timestamp at which this run successfully finished (populated when <code>status=succeeded</code>). Measured in seconds since the Unix epoch.
22
  * @property null|string $error If something should go wrong during the run, a message about the failure (populated when <code>status=failed</code>).
23
  * @property bool $livemode Always <code>true</code>: reports can only be run on live-mode data.
24
  * @property \Stripe\StripeObject $parameters
25
+ * @property string $report_type The ID of the <a href="https://stripe.com/docs/reports/report-types">report type</a> to run, such as <code>&quot;balance.summary.1&quot;</code>.
26
  * @property null|\Stripe\File $result The file object representing the result of the report run (populated when <code>status=succeeded</code>).
27
  * @property string $status Status of this report run. This will be <code>pending</code> when the run is initially created. When the run finishes, this will be set to <code>succeeded</code> and the <code>result</code> field will be populated. Rarely, we may encounter an error, at which point this will be set to <code>failed</code> and the <code>error</code> field will be populated.
28
  * @property null|int $succeeded_at Timestamp at which this run successfully finished (populated when <code>status=succeeded</code>). Measured in seconds since the Unix epoch.
vendor/stripe/stripe-php/lib/Service/Issuing/DisputeService.php CHANGED
@@ -58,6 +58,26 @@ class DisputeService extends \Stripe\Service\AbstractService
58
  return $this->request('get', $this->buildPath('/v1/issuing/disputes/%s', $id), $params, $opts);
59
  }
60
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  /**
62
  * Updates the specified Issuing <code>Dispute</code> object by setting the values
63
  * of the parameters passed. Any parameters not provided will be left unchanged.
58
  return $this->request('get', $this->buildPath('/v1/issuing/disputes/%s', $id), $params, $opts);
59
  }
60
 
61
+ /**
62
+ * Submits an Issuing <code>Dispute</code> to the card network. Stripe validates
63
+ * that all evidence fields required for the dispute’s reason are present. For more
64
+ * details, see <a
65
+ * href="/docs/issuing/purchases/disputes#dispute-reasons-and-evidence">Dispute
66
+ * reasons and evidence</a>.
67
+ *
68
+ * @param string $id
69
+ * @param null|array $params
70
+ * @param null|array|\Stripe\Util\RequestOptions $opts
71
+ *
72
+ * @throws \Stripe\Exception\ApiErrorException if the request fails
73
+ *
74
+ * @return \Stripe\Issuing\Dispute
75
+ */
76
+ public function submit($id, $params = null, $opts = null)
77
+ {
78
+ return $this->request('post', $this->buildPath('/v1/issuing/disputes/%s/submit', $id), $params, $opts);
79
+ }
80
+
81
  /**
82
  * Updates the specified Issuing <code>Dispute</code> object by setting the values
83
  * of the parameters passed. Any parameters not provided will be left unchanged.
vendor/stripe/stripe-php/lib/Stripe.php CHANGED
@@ -58,7 +58,7 @@ class Stripe
58
  /** @var float Initial delay between retries, in seconds */
59
  private static $initialNetworkRetryDelay = 0.5;
60
 
61
- const VERSION = '7.50.0';
62
 
63
  /**
64
  * @return string the API key used for requests
58
  /** @var float Initial delay between retries, in seconds */
59
  private static $initialNetworkRetryDelay = 0.5;
60
 
61
+ const VERSION = '7.52.0';
62
 
63
  /**
64
  * @return string the API key used for requests
vendor/stripe/stripe-php/lib/WebhookSignature.php CHANGED
@@ -115,7 +115,7 @@ abstract class WebhookSignature
115
 
116
  foreach ($items as $item) {
117
  $itemParts = \explode('=', $item, 2);
118
- if ($itemParts[0] === $scheme) {
119
  \array_push($signatures, $itemParts[1]);
120
  }
121
  }
115
 
116
  foreach ($items as $item) {
117
  $itemParts = \explode('=', $item, 2);
118
+ if (\trim($itemParts[0]) === $scheme) {
119
  \array_push($signatures, $itemParts[1]);
120
  }
121
  }