Payment Plugins for Stripe WooCommerce - Version 3.0.5

Version Description

  • Added - ACH payment support
  • Added - New credit card form
  • Fixed - Klarna error if item totals don't equal order total.
  • Updated - API version to 2019-12-03
  • Updated - Local payment logic.
Download this release

Release Info

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

Code changes from version 3.0.4 to 3.0.5

Files changed (37) hide show
  1. assets/css/stripe.css +6 -0
  2. assets/img/ach.svg +6 -0
  3. assets/js/admin/admin-settings.js +24 -0
  4. assets/js/frontend/ach-payments.js +62 -0
  5. assets/js/frontend/cc-forms.js +71 -0
  6. assets/js/frontend/credit-card.js +34 -23
  7. assets/js/frontend/local-payment.js +17 -6
  8. i18n/languages/woo-stripe-payment.pot +231 -68
  9. includes/abstract/abstract-wc-payment-gateway-stripe-charge.php +20 -10
  10. includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php +2 -27
  11. includes/abstract/abstract-wc-payment-gateway-stripe.php +68 -10
  12. includes/abstract/abstract-wc-stripe-settings.php +13 -0
  13. includes/admin/class-wc-stripe-admin-assets.php +2 -1
  14. includes/admin/meta-boxes/views/html-charge-data-subview.php +1 -1
  15. includes/admin/settings/class-wc-stripe-api-settings.php +8 -1
  16. includes/admin/views/html-button.php +13 -0
  17. includes/class-stripe.php +4 -1
  18. includes/class-wc-stripe-frontend-scripts.php +2 -1
  19. includes/class-wc-stripe-gateway.php +40 -3
  20. includes/class-wc-stripe-redirect-handler.php +15 -10
  21. includes/controllers/class-wc-stripe-controller-gateway-settings.php +56 -0
  22. includes/controllers/class-wc-stripe-controller-webhook.php +1 -0
  23. includes/gateways/class-wc-payment-gateway-stripe-ach.php +175 -0
  24. includes/gateways/class-wc-payment-gateway-stripe-klarna.php +2 -8
  25. includes/gateways/settings/ach-settings.php +78 -0
  26. includes/gateways/settings/applepay-settings.php +1 -1
  27. includes/tokens/class-wc-payment-token-stripe-ach.php +69 -0
  28. includes/wc-stripe-functions.php +60 -3
  29. includes/wc-stripe-hooks.php +1 -0
  30. includes/wc-stripe-webhook-functions.php +37 -20
  31. readme.txt +12 -4
  32. stripe-payments.php +3 -3
  33. templates/cc-forms/bootstrap.php +7 -7
  34. templates/cc-forms/inline.php +2 -1
  35. templates/cc-forms/minimalist.php +271 -0
  36. templates/cc-forms/simple.php +1 -1
  37. templates/checkout/ach.php +14 -0
assets/css/stripe.css CHANGED
@@ -230,6 +230,12 @@ li.payment_method_stripe_googlepay label:first-of-type img[src*=googlepay_standa
230
  width: 60px;
231
  max-height: 35px;
232
  }
 
 
 
 
 
 
233
  .gpay-button:hover{
234
  background-origin: content-box;
235
  background-position: center center;
230
  width: 60px;
231
  max-height: 35px;
232
  }
233
+ li.payment_method_stripe_ach label:first-of-type img{
234
+ width: 32px;
235
+ height: 32px;
236
+ min-width: 32px;
237
+ min-height: 32px;
238
+ }
239
  .gpay-button:hover{
240
  background-origin: content-box;
241
  background-position: center center;
assets/img/ach.svg ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Svg Vector Icons : http://www.onlinewebfonts.com/icon -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="none" class="SVGInline-svg SVGInline--cleaned-svg SVG-svg BrandIcon-svg BrandIcon--size--20-svg" height="" viewBox="5 5 22 22" width="" style="height: 100px; width: 100px;">
5
+ <g fill="none" fill-rule="evenodd">
6
+ <path d="M7.274 13.5a1.25 1.25 0 0 1-.649-2.333C7.024 10.937 10.15 9.215 16 6c5.851 3.215 8.976 4.937 9.375 5.167a1.25 1.25 0 0 1-.65 2.333zm12.476 10v-8.125h3.75V23.5H25a1 1 0 0 1 1 1V26H6v-1.5a1 1 0 0 1 1-1h1.5v-8.125h3.75V23.5h1.875v-8.125h3.75V23.5z" fill="#0877d2"></path></g></svg>
assets/js/admin/admin-settings.js CHANGED
@@ -17,6 +17,8 @@ jQuery(function($) {
17
 
18
  $('.api-register-domain').on('click', this.register_domain.bind(this));
19
 
 
 
20
  this.display_children();
21
  }
22
 
@@ -94,6 +96,28 @@ jQuery(function($) {
94
  }.bind(this))
95
  }
96
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
  /**
98
  * [block description]
99
  * @param {[type]} $el [description]
17
 
18
  $('.api-register-domain').on('click', this.register_domain.bind(this));
19
 
20
+ $('.wc-stripe-create-webhook').on('click', this.create_webhook.bind(this));
21
+
22
  this.display_children();
23
  }
24
 
96
  }.bind(this))
97
  }
98
 
99
+ Settings.prototype.create_webhook = function(e) {
100
+ e.preventDefault();
101
+ this.block();
102
+ $.ajax({
103
+ url: this.params.routes.create_webhook,
104
+ dataType: 'json',
105
+ method: 'POST',
106
+ data: { _wpnonce: this.params.rest_nonce }
107
+ }).done(function(response) {
108
+ this.unblock();
109
+ if (response.code) {
110
+ window.alert(response.message);
111
+ } else {
112
+ $('#woocommerce_stripe_api_webhook_secret').val(response.secret);
113
+ window.alert(response.message);
114
+ }
115
+ }.bind(this)).fail(function(xhr, textStatus, errorThrown) {
116
+ this.unblock();
117
+ window.alert(errorThrown);
118
+ }.bind(this))
119
+ }
120
+
121
  /**
122
  * [block description]
123
  * @param {[type]} $el [description]
assets/js/frontend/ach-payments.js ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function($, wc_stripe) {
2
+
3
+ function ACH() {
4
+ wc_stripe.BaseGateway.call(this, wc_stripe_ach_params);
5
+ wc_stripe.CheckoutGateway.call(this);
6
+ this.metadata_key = this.params.metadata_key;
7
+ }
8
+
9
+ ACH.prototype = $.extend({}, wc_stripe.BaseGateway.prototype, wc_stripe.CheckoutGateway.prototype);
10
+
11
+ ACH.prototype.initialize = function() {
12
+ $(document.body).on('click', '#place_order', this.place_order.bind(this));
13
+ this.init_plaid();
14
+ }
15
+
16
+ ACH.prototype.init_plaid = function() {
17
+ this.linkHandler = Plaid.create({
18
+ env: this.params.env,
19
+ clientName: this.params.client_name,
20
+ key: this.params.public_key,
21
+ product: ['auth'],
22
+ selectAccount: true,
23
+ countryCodes: ['US'],
24
+ onSuccess: function(public_token, metadata) {
25
+ // serialize metadata and submit form
26
+ this.payment_token_received = true;
27
+ this.set_nonce(public_token);
28
+ this.set_metadata(metadata);
29
+ $(this.container).closest('form').submit();
30
+ }.bind(this),
31
+ onExit: function(err, metadata) {
32
+ if (err != null) {
33
+ this.submit_error(err.error_message);
34
+ }
35
+ }.bind(this)
36
+ });
37
+ }
38
+
39
+ ACH.prototype.place_order = function(e) {
40
+ if (this.is_gateway_selected()) {
41
+ if (!this.payment_token_received) {
42
+ e.preventDefault();
43
+ this.linkHandler.open();
44
+ }
45
+ }
46
+ }
47
+
48
+ ACH.prototype.hide_place_order = function() {
49
+
50
+ }
51
+
52
+ ACH.prototype.show_payment_button = function() {
53
+ wc_stripe.CheckoutGateway.prototype.show_place_order.apply(this, arguments);
54
+ }
55
+
56
+ ACH.prototype.set_metadata = function(metadata) {
57
+ $(this.metadata_key).val(JSON.stringify(metadata));
58
+ }
59
+
60
+ new ACH();
61
+
62
+ }(jQuery, window.wc_stripe))
assets/js/frontend/cc-forms.js ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function($) {
2
+ function minimalist() {
3
+ this.index = 1;
4
+ this.total_steps = $('.wc-stripe-steps').data('steps');
5
+ this.updateSteppers();
6
+ this.updateStyles();
7
+ $(document.body).on('click', '.wc-stripe-back', this.prev.bind(this))
8
+ .on('click', '.wc-stripe-next', this.next.bind(this))
9
+ .on('updated_checkout', this.updated_checkout.bind(this));
10
+ }
11
+
12
+ minimalist.prototype.next = function(e) {
13
+ e.preventDefault();
14
+ this.index++;
15
+ $('.wc-stripe-minimalist-form .field-container[data-index="' + this.index + '"]').removeClass('field-container--hidden');
16
+ $('.wc-stripe-minimalist-form .field-container[data-index="' + (this.index - 1) + '"]').addClass('field-container--hidden');
17
+ this.updateSteppers();
18
+ }
19
+
20
+ minimalist.prototype.prev = function(e) {
21
+ e.preventDefault();
22
+ this.index--;
23
+ $('.wc-stripe-minimalist-form .field-container[data-index="' + (this.index + 1) + '"]').addClass('field-container--hidden');;
24
+ $('.wc-stripe-minimalist-form .field-container[data-index="' + this.index + '"]').removeClass('field-container--hidden');
25
+ this.updateSteppers();
26
+ }
27
+
28
+ minimalist.prototype.updateText = function() {
29
+ var text = $('.wc-stripe-step').data('text');
30
+ $('.wc-stripe-step').text(text.replace('%s', this.index));
31
+ }
32
+
33
+ minimalist.prototype.updateSteppers = function() {
34
+ if (this.index == 1) {
35
+ $('.wc-stripe-back').hide();
36
+ } else if (this.index == this.total_steps) {
37
+ $('.wc-stripe-next').hide();
38
+ } else {
39
+ $('.wc-stripe-next').show();
40
+ $('.wc-stripe-back').show();
41
+ }
42
+ this.updateText();
43
+ }
44
+
45
+ minimalist.prototype.updated_checkout = function() {
46
+ $('.wc-stripe-minimalist-form .field-container[data-index="' + this.index + '"]').removeClass('field-container--hidden');
47
+ this.updateSteppers();
48
+ this.updateStyles();
49
+ }
50
+
51
+ minimalist.prototype.updateStyles = function() {
52
+ if (wc_stripe.credit_card) {
53
+ var width = $('ul.payment_methods').outerWidth();
54
+ if ($('ul.payment_methods').outerWidth() < 400) {
55
+ var options = {
56
+ style: {
57
+ base: {
58
+ fontSize: '18px'
59
+ }
60
+ }
61
+ };
62
+ wc_stripe.credit_card.cardNumber.update(options);
63
+ wc_stripe.credit_card.cardExpiry.update(options);
64
+ wc_stripe.credit_card.cardCvc.update(options);
65
+ $('ul.payment_methods').addClass('wc-stripe-sm');
66
+ }
67
+ }
68
+ }
69
+
70
+ new minimalist();
71
+ }(jQuery))
assets/js/frontend/credit-card.js CHANGED
@@ -9,6 +9,7 @@
9
  wc_stripe.BaseGateway.call(this, wc_stripe_credit_card_params);
10
  wc_stripe.CheckoutGateway.call(this);
11
  window.addEventListener('hashchange', this.hashChange.bind(this));
 
12
  }
13
 
14
  const elementClasses = {
@@ -17,8 +18,7 @@
17
  invalid: 'invalid'
18
  }
19
 
20
- CC.prototype = $.extend({}, wc_stripe.BaseGateway.prototype,
21
- wc_stripe.CheckoutGateway.prototype);
22
 
23
  /**
24
  *
@@ -73,9 +73,18 @@
73
  value: {
74
  postalCode: $('#billing_postcode').val()
75
  },
 
76
  style: this.params.style,
77
  iconStyle: 'default'
78
  });
 
 
 
 
 
 
 
 
79
  }
80
  // setup a timeout so CC element is always rendered.
81
  setInterval(this.create_card_element.bind(this), 2000);
@@ -142,7 +151,7 @@
142
  }
143
  }.bind(this))
144
  $('#stripe-postal-code').on('change', this.validate_postal_field.bind(this));
145
- $('#stripe-postal-code').trigger('keyup');
146
  }
147
  }
148
  } else {
@@ -197,7 +206,12 @@
197
  if (this.is_gateway_selected()) {
198
  if (this.is_add_payment_method_page() || (this.get_total_price_cents() == 0 && !this.is_saved_method_selected())) {
199
  e.preventDefault();
200
- this.stripe.handleCardSetup(this.client_secret, this.is_custom_form() ? this.cardNumber : this.card).then(function(result) {
 
 
 
 
 
201
  if (result.error) {
202
  this.submit_error(result.error.message);
203
  return;
@@ -205,26 +219,23 @@
205
  this.on_setup_intent_received(result.setupIntent.payment_method);
206
  }.bind(this))
207
  } else {
208
- if (!this.payment_token_received &&
209
- !this.is_saved_method_selected()) {
210
  e.preventDefault();
211
- this.stripe.createPaymentMethod(
212
- 'card',
213
- this.is_custom_form() ? this.cardNumber : this.card, {
214
- billing_details: {
215
- name: $('#billing_first_name').val() + ' ' + $('#billing_last_name').val(),
216
- email: $('#billing_email').val(),
217
- phone: $('#billing_phone').val(),
218
- address: {
219
- city: $('#billing_city').val(),
220
- country: $('#billing_country').val(),
221
- line1: $('#billing_address_1').val(),
222
- line2: $('#billing_address_2').val(),
223
- postal_code: this.get_postal_code(),
224
- state: $('#billing_state').val()
225
- }
226
  }
227
- }).then(function(result) {
 
228
  if (result.error) {
229
  this.submit_error(result.error.message);
230
  return;
@@ -328,7 +339,7 @@
328
  }
329
  return $('#billing_postcode').val();
330
  }
331
- return null;
332
  }
333
 
334
  CC.prototype.card_number_change = function(data) {
9
  wc_stripe.BaseGateway.call(this, wc_stripe_credit_card_params);
10
  wc_stripe.CheckoutGateway.call(this);
11
  window.addEventListener('hashchange', this.hashChange.bind(this));
12
+ wc_stripe.credit_card = this;
13
  }
14
 
15
  const elementClasses = {
18
  invalid: 'invalid'
19
  }
20
 
21
+ CC.prototype = $.extend({}, wc_stripe.BaseGateway.prototype, wc_stripe.CheckoutGateway.prototype);
 
22
 
23
  /**
24
  *
73
  value: {
74
  postalCode: $('#billing_postcode').val()
75
  },
76
+ hidePostalCode: $('#billing_postcode').length > 0,
77
  style: this.params.style,
78
  iconStyle: 'default'
79
  });
80
+ $(document.body).on('change', '#billing_postcode', function(e) {
81
+ if (this.card) {
82
+ this.card.update({ value: $('#billing_postcode').val() });
83
+ }
84
+ }.bind(this));
85
+ this.card.addEventListener('change', function(event) {
86
+
87
+ }.bind(this))
88
  }
89
  // setup a timeout so CC element is always rendered.
90
  setInterval(this.create_card_element.bind(this), 2000);
151
  }
152
  }.bind(this))
153
  $('#stripe-postal-code').on('change', this.validate_postal_field.bind(this));
154
+ $('#stripe-postal-code').trigger('change');
155
  }
156
  }
157
  } else {
206
  if (this.is_gateway_selected()) {
207
  if (this.is_add_payment_method_page() || (this.get_total_price_cents() == 0 && !this.is_saved_method_selected())) {
208
  e.preventDefault();
209
+ this.stripe.confirmCardSetup(this.client_secret, {
210
+ payment_method: {
211
+ card: this.is_custom_form() ? this.cardNumber : this.card,
212
+ billing_details: $.extend({}, this.is_custom_form() ? { address: { postal_code: $('#stripe-postal-code').val() } } : {})
213
+ }
214
+ }).then(function(result) {
215
  if (result.error) {
216
  this.submit_error(result.error.message);
217
  return;
219
  this.on_setup_intent_received(result.setupIntent.payment_method);
220
  }.bind(this))
221
  } else {
222
+ if (!this.payment_token_received && !this.is_saved_method_selected()) {
 
223
  e.preventDefault();
224
+ this.stripe.createPaymentMethod('card', this.is_custom_form() ? this.cardNumber : this.card, {
225
+ billing_details: {
226
+ name: $('#billing_first_name').val() + ' ' + $('#billing_last_name').val(),
227
+ email: $('#billing_email').val(),
228
+ phone: $('#billing_phone').val(),
229
+ address: {
230
+ city: $('#billing_city').val(),
231
+ country: $('#billing_country').val(),
232
+ line1: $('#billing_address_1').val(),
233
+ line2: $('#billing_address_2').val(),
234
+ postal_code: this.get_postal_code(),
235
+ state: $('#billing_state').val()
 
 
 
236
  }
237
+ }
238
+ }).then(function(result) {
239
  if (result.error) {
240
  this.submit_error(result.error.message);
241
  return;
339
  }
340
  return $('#billing_postcode').val();
341
  }
342
+ return $('#billing_postcode').val();
343
  }
344
 
345
  CC.prototype.card_number_change = function(data) {
assets/js/frontend/local-payment.js CHANGED
@@ -19,13 +19,15 @@
19
  this.mount_button();
20
  }
21
 
 
 
22
  /**
23
  * [createSource description]
24
  * @return {[type]} [description]
25
  */
26
  LocalPayment.prototype.createSource = function() {
27
  return new Promise(function(resolve, reject) {
28
- this.stripe.createSource(this.element, this.getSourceArgs()).then(function(result) {
29
  if (result.error) {
30
  this.submit_error(result.error.message);
31
  } else {
@@ -34,9 +36,15 @@
34
  $(this.container).closest('form').submit();
35
  }
36
  resolve();
37
- }.bind(this)).catch(function(e) {
38
- this.submit_error(e.message);
39
- }.bind(this))
 
 
 
 
 
 
40
  }.bind(this));
41
  }
42
 
@@ -80,7 +88,8 @@
80
  amount: this.get_total_price_cents(),
81
  currency: this.get_currency(),
82
  owner: {
83
- name: this.get_customer_name('#billing')
 
84
  },
85
  redirect: {
86
  return_url: this.params.return_url
@@ -94,7 +103,7 @@
94
 
95
  LocalPayment.prototype.mount_button = function() {
96
  var id = '#wc_stripe_local_payment_' + this.gateway_id;
97
- if ($(id).length) {
98
  $(id).empty();
99
  if (!this.element) {
100
  this.element = this.elements.create(this.elementType, this.params.element_params);
@@ -235,6 +244,8 @@
235
  var params = wc_stripe_local_payment_params.gateways[i];
236
  if (types[params.local_payment_type]) {
237
  new types[params.local_payment_type](params);
 
 
238
  }
239
  }
240
 
19
  this.mount_button();
20
  }
21
 
22
+ LocalPayment.prototype.elementType = null;
23
+
24
  /**
25
  * [createSource description]
26
  * @return {[type]} [description]
27
  */
28
  LocalPayment.prototype.createSource = function() {
29
  return new Promise(function(resolve, reject) {
30
+ var handler = function(result) {
31
  if (result.error) {
32
  this.submit_error(result.error.message);
33
  } else {
36
  $(this.container).closest('form').submit();
37
  }
38
  resolve();
39
+ }.bind(this);
40
+ if (this.elementType == null) {
41
+ this.payment_token_received = true;
42
+ $(this.container).closest('form').submit();
43
+ } else {
44
+ this.stripe.createSource(this.element, this.getSourceArgs()).then(handler).catch(function(e) {
45
+ this.submit_error(e.message);
46
+ }.bind(this))
47
+ }
48
  }.bind(this));
49
  }
50
 
88
  amount: this.get_total_price_cents(),
89
  currency: this.get_currency(),
90
  owner: {
91
+ name: this.get_customer_name('#billing'),
92
+ email: $('#billing_email').val()
93
  },
94
  redirect: {
95
  return_url: this.params.return_url
103
 
104
  LocalPayment.prototype.mount_button = function() {
105
  var id = '#wc_stripe_local_payment_' + this.gateway_id;
106
+ if ($(id).length && this.elementType != null) {
107
  $(id).empty();
108
  if (!this.element) {
109
  this.element = this.elements.create(this.elementType, this.params.element_params);
244
  var params = wc_stripe_local_payment_params.gateways[i];
245
  if (types[params.local_payment_type]) {
246
  new types[params.local_payment_type](params);
247
+ } else {
248
+ new LocalPayment(params);
249
  }
250
  }
251
 
i18n/languages/woo-stripe-payment.pot CHANGED
@@ -2,7 +2,7 @@
2
  msgid ""
3
  msgstr ""
4
  "Project-Id-Version: woo-stripe-payment\n"
5
- "POT-Creation-Date: 2019-12-05 13:48-0800\n"
6
  "PO-Revision-Date: 2019-08-16 14:27-0700\n"
7
  "Last-Translator: \n"
8
  "Language-Team: \n"
@@ -18,84 +18,93 @@ msgstr ""
18
  "X-Poedit-SearchPath-1: templates\n"
19
  "X-Poedit-SearchPath-2: stripe-payments.php\n"
20
 
21
- #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:64
22
  #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:53
23
  #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:71
 
24
  #, php-format
25
  msgid "Error processing payment. Reason: %s"
26
  msgstr ""
27
 
28
- #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:66
29
  #, php-format
30
  msgid "Error processing payment. Reason: %s. Code: %s"
31
  msgstr ""
32
 
33
- #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:77
 
 
 
 
 
 
 
34
  #, php-format
35
  msgid "Order charge successful in Stripe. Charge: %s. Payment Method: %s"
36
  msgstr ""
37
 
38
- #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:121
39
  #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:196
40
  #, php-format
41
  msgid "Order amount captured in Stripe. Amount: %s"
42
  msgstr ""
43
 
44
- #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:125
45
  #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:200
46
  #, php-format
47
  msgid "Error capturing charge in Stripe. Reason: %s"
48
  msgstr ""
49
 
50
- #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:137
51
  #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:221
52
  #, php-format
53
  msgid "Error voiding charge. Reason: %s"
54
  msgstr ""
55
 
56
- #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:139
57
  #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:223
58
  msgid "Charge voided in Stripe."
59
  msgstr ""
60
 
61
- #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:166
62
  #, php-format
63
  msgid ""
64
  "Recurring payment for subscription failed. Reason: %s. Payment method: %s"
65
  msgstr ""
66
 
67
- #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:170
68
  #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:262
69
  #, php-format
70
  msgid "Recurring payment captured in Stripe. Payment method: %s"
71
  msgstr ""
72
 
73
- #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:172
74
- #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:210
75
  #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:264
76
  #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:330
77
  #, php-format
78
  msgid "Recurring payment authorized in Stripe. Payment method: %s"
79
  msgstr ""
80
 
81
- #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:184
82
  #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:296
83
  #, php-format
84
  msgid "Error deleting Stripe card. Token Id: %s"
85
  msgstr ""
86
 
87
- #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:204
88
  #, php-format
89
  msgid ""
90
  "Pre-order payment for subscription failed. Reason: %s. Payment method: %s"
91
  msgstr ""
92
 
93
- #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:208
94
  #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:328
95
  #, php-format
96
  msgid "Pre-order payment captured in Stripe. Payment method: %s"
97
  msgstr ""
98
 
 
99
  #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:76
100
  #, php-format
101
  msgid "Error creating payment source. Reason: %s"
@@ -149,12 +158,12 @@ msgstr ""
149
  msgid "Pre-order payment for order failed. Reason: %s"
150
  msgstr ""
151
 
152
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:292
153
  msgid ""
154
  "Please read and accept the terms and conditions to proceed with your order."
155
  msgstr ""
156
 
157
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:305
158
  #: includes/controllers/class-wc-stripe-controller-cart.php:99
159
  #: includes/controllers/class-wc-stripe-controller-cart.php:139
160
  #: includes/controllers/class-wc-stripe-controller-googlepay.php:116
@@ -162,61 +171,61 @@ msgstr ""
162
  msgid "Total"
163
  msgstr ""
164
 
165
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:363
166
  #, php-format
167
  msgid "Error saving your payment method. Reason: %s"
168
  msgstr ""
169
 
170
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:374
171
  #, php-format
172
  msgid "Error saving payment method. Reason: %s"
173
  msgstr ""
174
 
175
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:386
176
  msgid "Transaction Id cannot be empty."
177
  msgstr ""
178
 
179
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:393
180
  #, php-format
181
  msgid "Order refunded in Stripe. Amount: %s"
182
  msgstr ""
183
 
184
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:578
185
  #: includes/admin/meta-boxes/views/html-order-pay.php:42
186
  msgid "New Card"
187
  msgstr ""
188
 
189
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:582
190
  #: includes/admin/meta-boxes/views/html-order-pay.php:30
191
  msgid "Saved Cards"
192
  msgstr ""
193
 
194
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:779
195
  #, php-format
196
  msgid "Attemp to save payment method failed. Reason: %s"
197
  msgstr ""
198
 
199
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:799
200
  msgid ""
201
  "We were not able to save your payment method. To prevent billing issues with "
202
  "your subscription, please add a payment method to the subscription."
203
  msgstr ""
204
 
205
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:801
206
  #, php-format
207
  msgid "We were not able to save your payment method. Reason: %s"
208
  msgstr ""
209
 
210
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:833
211
  msgid "Payment Method Token"
212
  msgstr ""
213
 
214
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:859
215
  #, php-format
216
  msgid "Error saving payment method for subscription. Reason: %s"
217
  msgstr ""
218
 
219
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:908
220
  #, php-format
221
  msgid "Order %s from %s"
222
  msgstr ""
@@ -318,6 +327,7 @@ msgstr ""
318
  #: includes/gateways/class-wc-payment-gateway-stripe-sepa.php:46
319
  #: includes/gateways/class-wc-payment-gateway-stripe-sofort.php:49
320
  #: includes/gateways/class-wc-payment-gateway-stripe-wechat.php:48
 
321
  #: includes/gateways/settings/applepay-settings.php:16
322
  #: includes/gateways/settings/cc-settings.php:16
323
  #: includes/gateways/settings/googlepay-settings.php:30
@@ -331,7 +341,7 @@ msgid "Type"
331
  msgstr ""
332
 
333
  #: includes/admin/meta-boxes/views/html-charge-data-subview.php:56
334
- #: templates/cc-forms/bootstrap.php:16
335
  msgid "Exp"
336
  msgstr ""
337
 
@@ -443,10 +453,19 @@ msgid "Live Secret Key"
443
  msgstr ""
444
 
445
  #: includes/admin/settings/class-wc-stripe-api-settings.php:84
446
- msgid "Webhook url"
 
447
  msgstr ""
448
 
449
  #: includes/admin/settings/class-wc-stripe-api-settings.php:87
 
 
 
 
 
 
 
 
450
  #, php-format
451
  msgid ""
452
  "<strong>Important:</strong> the webhook url is called by Stripe when events "
@@ -455,11 +474,11 @@ msgid ""
455
  "%sWebhook guide%s"
456
  msgstr ""
457
 
458
- #: includes/admin/settings/class-wc-stripe-api-settings.php:91
459
  msgid "Webhook Secret"
460
  msgstr ""
461
 
462
- #: includes/admin/settings/class-wc-stripe-api-settings.php:92
463
  #, php-format
464
  msgid ""
465
  "The webhook secret is used to authenticate webhooks sent from Stripe. It "
@@ -467,11 +486,11 @@ msgid ""
467
  "guide%s"
468
  msgstr ""
469
 
470
- #: includes/admin/settings/class-wc-stripe-api-settings.php:95
471
  msgid "Debug Log"
472
  msgstr ""
473
 
474
- #: includes/admin/settings/class-wc-stripe-api-settings.php:99
475
  msgid ""
476
  "When enabled, the plugin logs important errors and info that can help you "
477
  "troubleshoot potential issues."
@@ -561,26 +580,20 @@ msgid ""
561
  "the funds are received."
562
  msgstr ""
563
 
564
- #: includes/class-wc-stripe-gateway.php:182
565
  #, php-format
566
  msgid "Error capturing charge. Reason: %s"
567
  msgstr ""
568
 
569
- #: includes/class-wc-stripe-redirect-handler.php:50
570
  #, php-format
571
  msgid "Error retrieving payment source. Reason: %s"
572
  msgstr ""
573
 
574
- #: includes/class-wc-stripe-redirect-handler.php:54
575
  msgid "Payment authorization failed. Please select another payment method."
576
  msgstr ""
577
 
578
- #: includes/class-wc-stripe-redirect-handler.php:61
579
- msgid ""
580
- "Status updated to on hold. Charge will be created when source.chargeable "
581
- "webhook received."
582
- msgstr ""
583
-
584
  #: includes/class-wc-stripe-rest-api.php:42
585
  #, php-format
586
  msgid "%1$s is an invalid controller name."
@@ -601,18 +614,34 @@ msgstr ""
601
  msgid "Please review your order details then click Place Order."
602
  msgstr ""
603
 
604
- #: includes/controllers/class-wc-stripe-controller-gateway-settings.php:54
605
  msgid ""
606
  "You cannot register your domain until you have configured your Live API keys."
607
  msgstr ""
608
 
609
- #: includes/controllers/class-wc-stripe-controller-gateway-settings.php:61
610
  #, php-format
611
  msgid ""
612
  "Domain %s registered successfully. You can confirm in your Stripe Dashboard "
613
  "at https://dashboard.stripe.com/account/apple_pay."
614
  msgstr ""
615
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
616
  #: includes/controllers/class-wc-stripe-controller-googlepay.php:83
617
  msgid "Your shipping address is not serviceable."
618
  msgstr ""
@@ -641,11 +670,27 @@ msgstr ""
641
  msgid "Error creating payment intent. Reason: %s"
642
  msgstr ""
643
 
644
- #: includes/controllers/class-wc-stripe-controller-webhook.php:41
645
  #: includes/controllers/class-wc-stripe-controller-webhook.php:42
 
646
  msgid "Invalid signaute received. Verify that your webhook secret is correct."
647
  msgstr ""
648
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
649
  #: includes/gateways/class-wc-payment-gateway-stripe-applepay.php:14
650
  #: includes/gateways/settings/applepay-settings.php:17
651
  msgid "Apple Pay"
@@ -684,6 +729,7 @@ msgstr ""
684
  #: includes/gateways/class-wc-payment-gateway-stripe-sepa.php:35
685
  #: includes/gateways/class-wc-payment-gateway-stripe-sofort.php:38
686
  #: includes/gateways/class-wc-payment-gateway-stripe-wechat.php:37
 
687
  #: includes/gateways/settings/applepay-settings.php:7
688
  #: includes/gateways/settings/cc-settings.php:4
689
  #: includes/gateways/settings/googlepay-settings.php:10
@@ -705,6 +751,7 @@ msgstr ""
705
  #: includes/gateways/class-wc-payment-gateway-stripe-sepa.php:43
706
  #: includes/gateways/class-wc-payment-gateway-stripe-sofort.php:46
707
  #: includes/gateways/class-wc-payment-gateway-stripe-wechat.php:45
 
708
  #: includes/gateways/settings/applepay-settings.php:13
709
  #: includes/gateways/settings/cc-settings.php:13
710
  #: includes/gateways/settings/googlepay-settings.php:16
@@ -727,6 +774,7 @@ msgstr ""
727
  #: includes/gateways/class-wc-payment-gateway-stripe-sepa.php:52
728
  #: includes/gateways/class-wc-payment-gateway-stripe-sofort.php:55
729
  #: includes/gateways/class-wc-payment-gateway-stripe-wechat.php:54
 
730
  #: includes/gateways/settings/applepay-settings.php:22
731
  #: includes/gateways/settings/cc-settings.php:22
732
  #: includes/gateways/settings/googlepay-settings.php:36
@@ -744,6 +792,7 @@ msgstr ""
744
  #: includes/gateways/class-wc-payment-gateway-stripe-sepa.php:54
745
  #: includes/gateways/class-wc-payment-gateway-stripe-sofort.php:57
746
  #: includes/gateways/class-wc-payment-gateway-stripe-wechat.php:56
 
747
  #: includes/gateways/settings/applepay-settings.php:24
748
  #: includes/gateways/settings/cc-settings.php:24
749
  #: includes/gateways/settings/googlepay-settings.php:38
@@ -835,7 +884,7 @@ msgid "Shipping"
835
  msgstr ""
836
 
837
  #: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:114
838
- #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:194
839
  #: includes/wc-stripe-functions.php:358
840
  msgid "Tax"
841
  msgstr ""
@@ -889,15 +938,15 @@ msgstr ""
889
  msgid "Title of the Klarna gateway"
890
  msgstr ""
891
 
892
- #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:221
893
  msgid "Pay Now"
894
  msgstr ""
895
 
896
- #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:222
897
  msgid "Pay Later"
898
  msgstr ""
899
 
900
- #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:223
901
  msgid "Pay Over Time"
902
  msgstr ""
903
 
@@ -1009,6 +1058,92 @@ msgstr ""
1009
  msgid "Title of the WeChat gateway"
1010
  msgstr ""
1011
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1012
  #: includes/gateways/settings/applepay-settings.php:4
1013
  msgid "Register Domain"
1014
  msgstr ""
@@ -1029,10 +1164,7 @@ msgid "If enabled, your site can accept Apple Pay payments through Stripe."
1029
  msgstr ""
1030
 
1031
  #: includes/gateways/settings/applepay-settings.php:19
1032
- #: includes/gateways/settings/cc-settings.php:19
1033
- #: includes/gateways/settings/googlepay-settings.php:33
1034
- #: includes/gateways/settings/payment-request-settings.php:20
1035
- msgid "Title of the credit card gateway"
1036
  msgstr ""
1037
 
1038
  #: includes/gateways/settings/applepay-settings.php:28
@@ -1042,15 +1174,6 @@ msgstr ""
1042
  msgid "Credit Card Display"
1043
  msgstr ""
1044
 
1045
- #: includes/gateways/settings/applepay-settings.php:34
1046
- #: includes/gateways/settings/cc-settings.php:34
1047
- #: includes/gateways/settings/googlepay-settings.php:48
1048
- #: includes/gateways/settings/payment-request-settings.php:35
1049
- msgid ""
1050
- "This option allows you to customize how the credit card will display for "
1051
- "your customers on orders, subscriptions, etc."
1052
- msgstr ""
1053
-
1054
  #: includes/gateways/settings/applepay-settings.php:44
1055
  #: includes/gateways/settings/cc-settings.php:44
1056
  #: includes/gateways/settings/payment-request-settings.php:45
@@ -1172,6 +1295,12 @@ msgstr ""
1172
  msgid "%sTest cards%s"
1173
  msgstr ""
1174
 
 
 
 
 
 
 
1175
  #: includes/gateways/settings/cc-settings.php:58
1176
  msgid "Allow Credit Card Save"
1177
  msgstr ""
@@ -1453,10 +1582,20 @@ msgstr ""
1453
  msgid "The height of the button. Max height is 64"
1454
  msgstr ""
1455
 
 
 
1456
  #: includes/tokens/class-wc-payment-token-stripe-cc.php:90
1457
  msgid "Type Ending In"
1458
  msgstr ""
1459
 
 
 
 
 
 
 
 
 
1460
  #: includes/tokens/class-wc-payment-token-stripe-cc.php:92
1461
  msgid "{brand} ending in {last4}"
1462
  msgstr ""
@@ -1502,13 +1641,21 @@ msgid "Simple form"
1502
  msgstr ""
1503
 
1504
  #: includes/wc-stripe-functions.php:705
 
 
 
 
1505
  msgid "Inline Form"
1506
  msgstr ""
1507
 
1508
- #: includes/wc-stripe-functions.php:741
1509
  msgid "Rounded Form"
1510
  msgstr ""
1511
 
 
 
 
 
1512
  #: stripe-payments.php:16
1513
  #, php-format
1514
  msgid "Your PHP version is %s but Stripe requires version 5.4+."
@@ -1519,13 +1666,13 @@ msgid "or"
1519
  msgstr ""
1520
 
1521
  #: templates/cc-forms/bootstrap.php:10 templates/cc-forms/inline.php:10
1522
- #: templates/cc-forms/simple.php:12
1523
  msgid "Card Number"
1524
  msgstr ""
1525
 
1526
  #: templates/cc-forms/bootstrap.php:20 templates/cc-forms/inline.php:18
1527
- #: templates/cc-forms/simple.php:26
1528
- msgid "CVC"
1529
  msgstr ""
1530
 
1531
  #: templates/cc-forms/bootstrap.php:25 templates/cc-forms/inline.php:23
@@ -1537,10 +1684,26 @@ msgstr ""
1537
  msgid "Exp Date"
1538
  msgstr ""
1539
 
 
 
 
 
1540
  #: templates/cc-forms/simple.php:20
1541
  msgid "Expiration"
1542
  msgstr ""
1543
 
 
 
 
 
 
 
 
 
 
 
 
 
1544
  #: templates/checkout/credit-card.php:17
1545
  msgid "Save Card"
1546
  msgstr ""
2
  msgid ""
3
  msgstr ""
4
  "Project-Id-Version: woo-stripe-payment\n"
5
+ "POT-Creation-Date: 2019-12-17 21:50-0800\n"
6
  "PO-Revision-Date: 2019-08-16 14:27-0700\n"
7
  "Last-Translator: \n"
8
  "Language-Team: \n"
18
  "X-Poedit-SearchPath-1: templates\n"
19
  "X-Poedit-SearchPath-2: stripe-payments.php\n"
20
 
21
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:69
22
  #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:53
23
  #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:71
24
+ #: includes/gateways/class-wc-payment-gateway-stripe-ach.php:96
25
  #, php-format
26
  msgid "Error processing payment. Reason: %s"
27
  msgstr ""
28
 
29
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:71
30
  #, php-format
31
  msgid "Error processing payment. Reason: %s. Code: %s"
32
  msgstr ""
33
 
34
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:79
35
+ #, php-format
36
+ msgid ""
37
+ "Charge %s is pending. Payment Method: %s. Payment will be completed once "
38
+ "charge.succeeded webhook received from Stripe."
39
+ msgstr ""
40
+
41
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:87
42
  #, php-format
43
  msgid "Order charge successful in Stripe. Charge: %s. Payment Method: %s"
44
  msgstr ""
45
 
46
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:133
47
  #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:196
48
  #, php-format
49
  msgid "Order amount captured in Stripe. Amount: %s"
50
  msgstr ""
51
 
52
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:137
53
  #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:200
54
  #, php-format
55
  msgid "Error capturing charge in Stripe. Reason: %s"
56
  msgstr ""
57
 
58
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:147
59
  #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:221
60
  #, php-format
61
  msgid "Error voiding charge. Reason: %s"
62
  msgstr ""
63
 
64
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:149
65
  #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:223
66
  msgid "Charge voided in Stripe."
67
  msgstr ""
68
 
69
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:176
70
  #, php-format
71
  msgid ""
72
  "Recurring payment for subscription failed. Reason: %s. Payment method: %s"
73
  msgstr ""
74
 
75
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:180
76
  #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:262
77
  #, php-format
78
  msgid "Recurring payment captured in Stripe. Payment method: %s"
79
  msgstr ""
80
 
81
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:182
82
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:220
83
  #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:264
84
  #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:330
85
  #, php-format
86
  msgid "Recurring payment authorized in Stripe. Payment method: %s"
87
  msgstr ""
88
 
89
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:194
90
  #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:296
91
  #, php-format
92
  msgid "Error deleting Stripe card. Token Id: %s"
93
  msgstr ""
94
 
95
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:214
96
  #, php-format
97
  msgid ""
98
  "Pre-order payment for subscription failed. Reason: %s. Payment method: %s"
99
  msgstr ""
100
 
101
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:218
102
  #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:328
103
  #, php-format
104
  msgid "Pre-order payment captured in Stripe. Payment method: %s"
105
  msgstr ""
106
 
107
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:75
108
  #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:76
109
  #, php-format
110
  msgid "Error creating payment source. Reason: %s"
158
  msgid "Pre-order payment for order failed. Reason: %s"
159
  msgstr ""
160
 
161
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:294
162
  msgid ""
163
  "Please read and accept the terms and conditions to proceed with your order."
164
  msgstr ""
165
 
166
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:307
167
  #: includes/controllers/class-wc-stripe-controller-cart.php:99
168
  #: includes/controllers/class-wc-stripe-controller-cart.php:139
169
  #: includes/controllers/class-wc-stripe-controller-googlepay.php:116
171
  msgid "Total"
172
  msgstr ""
173
 
174
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:365
175
  #, php-format
176
  msgid "Error saving your payment method. Reason: %s"
177
  msgstr ""
178
 
179
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:376
180
  #, php-format
181
  msgid "Error saving payment method. Reason: %s"
182
  msgstr ""
183
 
184
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:388
185
  msgid "Transaction Id cannot be empty."
186
  msgstr ""
187
 
188
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:395
189
  #, php-format
190
  msgid "Order refunded in Stripe. Amount: %s"
191
  msgstr ""
192
 
193
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:589
194
  #: includes/admin/meta-boxes/views/html-order-pay.php:42
195
  msgid "New Card"
196
  msgstr ""
197
 
198
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:593
199
  #: includes/admin/meta-boxes/views/html-order-pay.php:30
200
  msgid "Saved Cards"
201
  msgstr ""
202
 
203
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:802
204
  #, php-format
205
  msgid "Attemp to save payment method failed. Reason: %s"
206
  msgstr ""
207
 
208
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:822
209
  msgid ""
210
  "We were not able to save your payment method. To prevent billing issues with "
211
  "your subscription, please add a payment method to the subscription."
212
  msgstr ""
213
 
214
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:824
215
  #, php-format
216
  msgid "We were not able to save your payment method. Reason: %s"
217
  msgstr ""
218
 
219
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:856
220
  msgid "Payment Method Token"
221
  msgstr ""
222
 
223
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:882
224
  #, php-format
225
  msgid "Error saving payment method for subscription. Reason: %s"
226
  msgstr ""
227
 
228
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:935
229
  #, php-format
230
  msgid "Order %s from %s"
231
  msgstr ""
327
  #: includes/gateways/class-wc-payment-gateway-stripe-sepa.php:46
328
  #: includes/gateways/class-wc-payment-gateway-stripe-sofort.php:49
329
  #: includes/gateways/class-wc-payment-gateway-stripe-wechat.php:48
330
+ #: includes/gateways/settings/ach-settings.php:52
331
  #: includes/gateways/settings/applepay-settings.php:16
332
  #: includes/gateways/settings/cc-settings.php:16
333
  #: includes/gateways/settings/googlepay-settings.php:30
341
  msgstr ""
342
 
343
  #: includes/admin/meta-boxes/views/html-charge-data-subview.php:56
344
+ #: templates/cc-forms/bootstrap.php:16 templates/cc-forms/minimalist.php:26
345
  msgid "Exp"
346
  msgstr ""
347
 
453
  msgstr ""
454
 
455
  #: includes/admin/settings/class-wc-stripe-api-settings.php:84
456
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:85
457
+ msgid "Generate Webhook"
458
  msgstr ""
459
 
460
  #: includes/admin/settings/class-wc-stripe-api-settings.php:87
461
+ msgid "Click this button to configure webhooks automatically."
462
+ msgstr ""
463
+
464
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:91
465
+ msgid "Webhook url"
466
+ msgstr ""
467
+
468
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:94
469
  #, php-format
470
  msgid ""
471
  "<strong>Important:</strong> the webhook url is called by Stripe when events "
474
  "%sWebhook guide%s"
475
  msgstr ""
476
 
477
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:98
478
  msgid "Webhook Secret"
479
  msgstr ""
480
 
481
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:99
482
  #, php-format
483
  msgid ""
484
  "The webhook secret is used to authenticate webhooks sent from Stripe. It "
486
  "guide%s"
487
  msgstr ""
488
 
489
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:102
490
  msgid "Debug Log"
491
  msgstr ""
492
 
493
+ #: includes/admin/settings/class-wc-stripe-api-settings.php:106
494
  msgid ""
495
  "When enabled, the plugin logs important errors and info that can help you "
496
  "troubleshoot potential issues."
580
  "the funds are received."
581
  msgstr ""
582
 
583
+ #: includes/class-wc-stripe-gateway.php:193
584
  #, php-format
585
  msgid "Error capturing charge. Reason: %s"
586
  msgstr ""
587
 
588
+ #: includes/class-wc-stripe-redirect-handler.php:45
589
  #, php-format
590
  msgid "Error retrieving payment source. Reason: %s"
591
  msgstr ""
592
 
593
+ #: includes/class-wc-stripe-redirect-handler.php:49
594
  msgid "Payment authorization failed. Please select another payment method."
595
  msgstr ""
596
 
 
 
 
 
 
 
597
  #: includes/class-wc-stripe-rest-api.php:42
598
  #, php-format
599
  msgid "%1$s is an invalid controller name."
614
  msgid "Please review your order details then click Place Order."
615
  msgstr ""
616
 
617
+ #: includes/controllers/class-wc-stripe-controller-gateway-settings.php:62
618
  msgid ""
619
  "You cannot register your domain until you have configured your Live API keys."
620
  msgstr ""
621
 
622
+ #: includes/controllers/class-wc-stripe-controller-gateway-settings.php:69
623
  #, php-format
624
  msgid ""
625
  "Domain %s registered successfully. You can confirm in your Stripe Dashboard "
626
  "at https://dashboard.stripe.com/account/apple_pay."
627
  msgstr ""
628
 
629
+ #: includes/controllers/class-wc-stripe-controller-gateway-settings.php:90
630
+ msgid "You must configure your secret key before creating webhooks."
631
+ msgstr ""
632
+
633
+ #: includes/controllers/class-wc-stripe-controller-gateway-settings.php:99
634
+ msgid ""
635
+ "There is already a webhook configured for this site. If you want to delete "
636
+ "the webhook, login to your Stripe Dashboard."
637
+ msgstr ""
638
+
639
+ #: includes/controllers/class-wc-stripe-controller-gateway-settings.php:120
640
+ msgid ""
641
+ "Webhook created in Stripe. You can test your webhook by logging in to the "
642
+ "Stripe dashboard"
643
+ msgstr ""
644
+
645
  #: includes/controllers/class-wc-stripe-controller-googlepay.php:83
646
  msgid "Your shipping address is not serviceable."
647
  msgstr ""
670
  msgid "Error creating payment intent. Reason: %s"
671
  msgstr ""
672
 
 
673
  #: includes/controllers/class-wc-stripe-controller-webhook.php:42
674
+ #: includes/controllers/class-wc-stripe-controller-webhook.php:43
675
  msgid "Invalid signaute received. Verify that your webhook secret is correct."
676
  msgstr ""
677
 
678
+ #: includes/gateways/class-wc-payment-gateway-stripe-ach.php:19
679
+ msgid "ACH"
680
+ msgstr ""
681
+
682
+ #: includes/gateways/class-wc-payment-gateway-stripe-ach.php:22
683
+ msgid "Stripe ACH"
684
+ msgstr ""
685
+
686
+ #: includes/gateways/class-wc-payment-gateway-stripe-ach.php:23
687
+ msgid "ACH gateway that integrates with your Stripe account."
688
+ msgstr ""
689
+
690
+ #: includes/gateways/class-wc-payment-gateway-stripe-ach.php:25
691
+ msgid "Bank Payment"
692
+ msgstr ""
693
+
694
  #: includes/gateways/class-wc-payment-gateway-stripe-applepay.php:14
695
  #: includes/gateways/settings/applepay-settings.php:17
696
  msgid "Apple Pay"
729
  #: includes/gateways/class-wc-payment-gateway-stripe-sepa.php:35
730
  #: includes/gateways/class-wc-payment-gateway-stripe-sofort.php:38
731
  #: includes/gateways/class-wc-payment-gateway-stripe-wechat.php:37
732
+ #: includes/gateways/settings/ach-settings.php:7
733
  #: includes/gateways/settings/applepay-settings.php:7
734
  #: includes/gateways/settings/cc-settings.php:4
735
  #: includes/gateways/settings/googlepay-settings.php:10
751
  #: includes/gateways/class-wc-payment-gateway-stripe-sepa.php:43
752
  #: includes/gateways/class-wc-payment-gateway-stripe-sofort.php:46
753
  #: includes/gateways/class-wc-payment-gateway-stripe-wechat.php:45
754
+ #: includes/gateways/settings/ach-settings.php:49
755
  #: includes/gateways/settings/applepay-settings.php:13
756
  #: includes/gateways/settings/cc-settings.php:13
757
  #: includes/gateways/settings/googlepay-settings.php:16
774
  #: includes/gateways/class-wc-payment-gateway-stripe-sepa.php:52
775
  #: includes/gateways/class-wc-payment-gateway-stripe-sofort.php:55
776
  #: includes/gateways/class-wc-payment-gateway-stripe-wechat.php:54
777
+ #: includes/gateways/settings/ach-settings.php:58
778
  #: includes/gateways/settings/applepay-settings.php:22
779
  #: includes/gateways/settings/cc-settings.php:22
780
  #: includes/gateways/settings/googlepay-settings.php:36
792
  #: includes/gateways/class-wc-payment-gateway-stripe-sepa.php:54
793
  #: includes/gateways/class-wc-payment-gateway-stripe-sofort.php:57
794
  #: includes/gateways/class-wc-payment-gateway-stripe-wechat.php:56
795
+ #: includes/gateways/settings/ach-settings.php:60
796
  #: includes/gateways/settings/applepay-settings.php:24
797
  #: includes/gateways/settings/cc-settings.php:24
798
  #: includes/gateways/settings/googlepay-settings.php:38
884
  msgstr ""
885
 
886
  #: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:114
887
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:187
888
  #: includes/wc-stripe-functions.php:358
889
  msgid "Tax"
890
  msgstr ""
938
  msgid "Title of the Klarna gateway"
939
  msgstr ""
940
 
941
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:214
942
  msgid "Pay Now"
943
  msgstr ""
944
 
945
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:215
946
  msgid "Pay Later"
947
  msgstr ""
948
 
949
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:216
950
  msgid "Pay Over Time"
951
  msgstr ""
952
 
1058
  msgid "Title of the WeChat gateway"
1059
  msgstr ""
1060
 
1061
+ #: includes/gateways/settings/ach-settings.php:4
1062
+ msgid "For US customers only."
1063
+ msgstr ""
1064
+
1065
+ #: includes/gateways/settings/ach-settings.php:4
1066
+ #, php-format
1067
+ msgid "Read through our %sdocumentation%s to configure ACH payments"
1068
+ msgstr ""
1069
+
1070
+ #: includes/gateways/settings/ach-settings.php:10
1071
+ msgid "If enabled, your site can accept ACH payments through Stripe."
1072
+ msgstr ""
1073
+
1074
+ #: includes/gateways/settings/ach-settings.php:13
1075
+ msgid "Plaid Keys"
1076
+ msgstr ""
1077
+
1078
+ #: includes/gateways/settings/ach-settings.php:16
1079
+ msgid "Client ID"
1080
+ msgstr ""
1081
+
1082
+ #: includes/gateways/settings/ach-settings.php:18
1083
+ msgid "ID that identifies your Plaid account."
1084
+ msgstr ""
1085
+
1086
+ #: includes/gateways/settings/ach-settings.php:22
1087
+ msgid "Public Key"
1088
+ msgstr ""
1089
+
1090
+ #: includes/gateways/settings/ach-settings.php:24
1091
+ msgid "Used to identify ACH payments initiated from your site."
1092
+ msgstr ""
1093
+
1094
+ #: includes/gateways/settings/ach-settings.php:28
1095
+ msgid "Plaid Secrets"
1096
+ msgstr ""
1097
+
1098
+ #: includes/gateways/settings/ach-settings.php:31
1099
+ msgid "Sandbox Secret"
1100
+ msgstr ""
1101
+
1102
+ #: includes/gateways/settings/ach-settings.php:33
1103
+ msgid ""
1104
+ "Key that acts as a password when connecting to Plaid's sandbox environment."
1105
+ msgstr ""
1106
+
1107
+ #: includes/gateways/settings/ach-settings.php:43
1108
+ msgid "Production Secret"
1109
+ msgstr ""
1110
+
1111
+ #: includes/gateways/settings/ach-settings.php:45
1112
+ msgid ""
1113
+ "Key that acts as a password when connecting to Plaid's production "
1114
+ "environment."
1115
+ msgstr ""
1116
+
1117
+ #: includes/gateways/settings/ach-settings.php:53
1118
+ msgid "ACH Payment"
1119
+ msgstr ""
1120
+
1121
+ #: includes/gateways/settings/ach-settings.php:55
1122
+ msgid "Title of the ACH gateway"
1123
+ msgstr ""
1124
+
1125
+ #: includes/gateways/settings/ach-settings.php:64
1126
+ msgid "Client Name"
1127
+ msgstr ""
1128
+
1129
+ #: includes/gateways/settings/ach-settings.php:66
1130
+ msgid "The name that appears on the ACH payment screen."
1131
+ msgstr ""
1132
+
1133
+ #: includes/gateways/settings/ach-settings.php:70
1134
+ msgid "ACH Display"
1135
+ msgstr ""
1136
+
1137
+ #: includes/gateways/settings/ach-settings.php:76
1138
+ #: includes/gateways/settings/applepay-settings.php:34
1139
+ #: includes/gateways/settings/cc-settings.php:34
1140
+ #: includes/gateways/settings/googlepay-settings.php:48
1141
+ #: includes/gateways/settings/payment-request-settings.php:35
1142
+ msgid ""
1143
+ "This option allows you to customize how the credit card will display for "
1144
+ "your customers on orders, subscriptions, etc."
1145
+ msgstr ""
1146
+
1147
  #: includes/gateways/settings/applepay-settings.php:4
1148
  msgid "Register Domain"
1149
  msgstr ""
1164
  msgstr ""
1165
 
1166
  #: includes/gateways/settings/applepay-settings.php:19
1167
+ msgid "Title of the Apple Pay gateway"
 
 
 
1168
  msgstr ""
1169
 
1170
  #: includes/gateways/settings/applepay-settings.php:28
1174
  msgid "Credit Card Display"
1175
  msgstr ""
1176
 
 
 
 
 
 
 
 
 
 
1177
  #: includes/gateways/settings/applepay-settings.php:44
1178
  #: includes/gateways/settings/cc-settings.php:44
1179
  #: includes/gateways/settings/payment-request-settings.php:45
1295
  msgid "%sTest cards%s"
1296
  msgstr ""
1297
 
1298
+ #: includes/gateways/settings/cc-settings.php:19
1299
+ #: includes/gateways/settings/googlepay-settings.php:33
1300
+ #: includes/gateways/settings/payment-request-settings.php:20
1301
+ msgid "Title of the credit card gateway"
1302
+ msgstr ""
1303
+
1304
  #: includes/gateways/settings/cc-settings.php:58
1305
  msgid "Allow Credit Card Save"
1306
  msgstr ""
1582
  msgid "The height of the button. Max height is 64"
1583
  msgstr ""
1584
 
1585
+ #: includes/tokens/class-wc-payment-token-stripe-ach.php:58
1586
+ #: includes/tokens/class-wc-payment-token-stripe-ach.php:63
1587
  #: includes/tokens/class-wc-payment-token-stripe-cc.php:90
1588
  msgid "Type Ending In"
1589
  msgstr ""
1590
 
1591
+ #: includes/tokens/class-wc-payment-token-stripe-ach.php:60
1592
+ msgid "{bank_name} ending in {last4}"
1593
+ msgstr ""
1594
+
1595
+ #: includes/tokens/class-wc-payment-token-stripe-ach.php:65
1596
+ msgid "{bank_name} **** {last4}"
1597
+ msgstr ""
1598
+
1599
  #: includes/tokens/class-wc-payment-token-stripe-cc.php:92
1600
  msgid "{brand} ending in {last4}"
1601
  msgstr ""
1641
  msgstr ""
1642
 
1643
  #: includes/wc-stripe-functions.php:705
1644
+ msgid "Minimalist form"
1645
+ msgstr ""
1646
+
1647
+ #: includes/wc-stripe-functions.php:739
1648
  msgid "Inline Form"
1649
  msgstr ""
1650
 
1651
+ #: includes/wc-stripe-functions.php:775
1652
  msgid "Rounded Form"
1653
  msgstr ""
1654
 
1655
+ #: includes/wc-stripe-webhook-functions.php:64
1656
+ msgid "Charge.succeeded webhook recieved. Payment has been completed."
1657
+ msgstr ""
1658
+
1659
  #: stripe-payments.php:16
1660
  #, php-format
1661
  msgid "Your PHP version is %s but Stripe requires version 5.4+."
1666
  msgstr ""
1667
 
1668
  #: templates/cc-forms/bootstrap.php:10 templates/cc-forms/inline.php:10
1669
+ #: templates/cc-forms/minimalist.php:22 templates/cc-forms/simple.php:12
1670
  msgid "Card Number"
1671
  msgstr ""
1672
 
1673
  #: templates/cc-forms/bootstrap.php:20 templates/cc-forms/inline.php:18
1674
+ #: templates/cc-forms/minimalist.php:30 templates/cc-forms/simple.php:26
1675
+ msgid "CVV"
1676
  msgstr ""
1677
 
1678
  #: templates/cc-forms/bootstrap.php:25 templates/cc-forms/inline.php:23
1684
  msgid "Exp Date"
1685
  msgstr ""
1686
 
1687
+ #: templates/cc-forms/minimalist.php:35
1688
+ msgid "Postal"
1689
+ msgstr ""
1690
+
1691
  #: templates/cc-forms/simple.php:20
1692
  msgid "Expiration"
1693
  msgstr ""
1694
 
1695
+ #: templates/checkout/ach.php:10
1696
+ msgid "sandbox testing credentials"
1697
+ msgstr ""
1698
+
1699
+ #: templates/checkout/ach.php:11
1700
+ msgid "username"
1701
+ msgstr ""
1702
+
1703
+ #: templates/checkout/ach.php:12
1704
+ msgid "password"
1705
+ msgstr ""
1706
+
1707
  #: templates/checkout/credit-card.php:17
1708
  msgid "Save Card"
1709
  msgstr ""
includes/abstract/abstract-wc-payment-gateway-stripe-charge.php CHANGED
@@ -43,11 +43,16 @@ abstract class WC_Payment_Gateway_Stripe_Charge extends WC_Payment_Gateway_Strip
43
  * can only be used once. Save the token then it can be used.
44
  */
45
  if ($this->should_save_payment_method ( $order )) {
46
- if (is_wp_error ( $this->save_payment_method ( $this->get_new_source_id (), $order ) )) {
47
  $this->set_payment_save_error ( $order, $this->wp_error );
48
  }
49
  }
50
 
 
 
 
 
 
51
  $args = $this->get_order_charge_args ( $order );
52
 
53
  $customer_id = wc_stripe_get_customer_id ( $order->get_user_id () );
@@ -66,15 +71,22 @@ abstract class WC_Payment_Gateway_Stripe_Charge extends WC_Payment_Gateway_Strip
66
  $order->add_order_note ( sprintf ( __ ( 'Error processing payment. Reason: %s. Code: %s', 'woo-stripe-payment' ), $charge->get_error_message (), $charge->get_error_code () ) );
67
  return $this->order_error ();
68
  }
69
- if ($charge->captured) {
70
- $order->payment_complete ( $charge->id );
 
 
 
 
71
  } else {
72
- $order_status = $this->get_option ( 'order_status' );
73
- $order->update_status ( apply_filters ( 'wc_stripe_authorized_order_status', 'default' === $order_status ? 'processing' : $order_status, $order, $this ) );
 
 
 
 
 
74
  }
75
- $this->save_order_meta ( $order, $charge );
76
 
77
- $order->add_order_note ( sprintf ( __ ( 'Order charge successful in Stripe. Charge: %s. Payment Method: %s', 'woo-stripe-payment' ), $order->get_transaction_id (), $order->get_payment_method_title () ) );
78
  WC ()->cart->empty_cart ();
79
 
80
  return array( 'result' => 'success',
@@ -122,9 +134,7 @@ abstract class WC_Payment_Gateway_Stripe_Charge extends WC_Payment_Gateway_Strip
122
  'currency' => $order->get_currency ()
123
  ) ) ) );
124
  } else {
125
- $order->add_order_note ( sprintf ( __ ( 'Error capturing charge in Stripe. Reason: %s', 'woo-stripe-payment' ), wc_price ( $amount, array(
126
- 'currency' => $order->get_currency ()
127
- ) ) ) );
128
  }
129
  return $result;
130
  }
43
  * can only be used once. Save the token then it can be used.
44
  */
45
  if ($this->should_save_payment_method ( $order )) {
46
+ if (is_wp_error ( $this->save_payment_method ( $this->get_new_source_token (), $order ) )) {
47
  $this->set_payment_save_error ( $order, $this->wp_error );
48
  }
49
  }
50
 
51
+ /**
52
+ * Set a lock on the order so webhooks don't cause issues with payment processing.
53
+ */
54
+ $this->set_order_lock ( $order );
55
+
56
  $args = $this->get_order_charge_args ( $order );
57
 
58
  $customer_id = wc_stripe_get_customer_id ( $order->get_user_id () );
71
  $order->add_order_note ( sprintf ( __ ( 'Error processing payment. Reason: %s. Code: %s', 'woo-stripe-payment' ), $charge->get_error_message (), $charge->get_error_code () ) );
72
  return $this->order_error ();
73
  }
74
+
75
+ $this->save_order_meta ( $order, $charge );
76
+
77
+ // pending status is for asynchronous payment methods
78
+ if ('pending' === $charge->status) {
79
+ $order->update_status ( apply_filters ( 'wc_stripe_pending_charge_status', 'on-hold', $order, $this ), sprintf ( __ ( 'Charge %s is pending. Payment Method: %s. Payment will be completed once charge.succeeded webhook received from Stripe.', 'woo-stripe-payment' ), $order->get_transaction_id (), $order->get_payment_method_title () ) );
80
  } else {
81
+ if ($charge->captured) {
82
+ $order->payment_complete ( $charge->id );
83
+ } else {
84
+ $order_status = $this->get_option ( 'order_status' );
85
+ $order->update_status ( apply_filters ( 'wc_stripe_authorized_order_status', 'default' === $order_status ? 'processing' : $order_status, $order, $this ) );
86
+ }
87
+ $order->add_order_note ( sprintf ( __ ( 'Order charge successful in Stripe. Charge: %s. Payment Method: %s', 'woo-stripe-payment' ), $order->get_transaction_id (), $order->get_payment_method_title () ) );
88
  }
 
89
 
 
90
  WC ()->cart->empty_cart ();
91
 
92
  return array( 'result' => 'success',
134
  'currency' => $order->get_currency ()
135
  ) ) ) );
136
  } else {
137
+ $order->add_order_note ( sprintf ( __ ( 'Error capturing charge in Stripe. Reason: %s', 'woo-stripe-payment' ), $result->get_error_message () ) );
 
 
138
  }
139
  return $result;
140
  }
includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php CHANGED
@@ -56,10 +56,9 @@ abstract class WC_Payment_Gateway_Stripe_Local_Payment extends WC_Payment_Gatewa
56
  }
57
 
58
  public function process_payment($order_id) {
 
59
  if (! $this->processing_payment) {
60
- $order = wc_get_order ( $order_id );
61
-
62
- $source_id = $this->get_new_source_id ();
63
  if (! empty ( $source_id )) {
64
  // source was created client side.
65
  $source = $this->gateway->fetch_payment_source ( $source_id );
@@ -216,28 +215,4 @@ abstract class WC_Payment_Gateway_Stripe_Local_Payment extends WC_Payment_Gatewa
216
  }
217
  return $desc;
218
  }
219
-
220
- /**
221
- *
222
- * @param WC_Order $order
223
- */
224
- public function set_order_lock($order) {
225
- update_post_meta ( $order->get_id (), '_stripe_lock', true );
226
- }
227
-
228
- /**
229
- *
230
- * @param WC_Order $order
231
- */
232
- public function release_order_lock($order) {
233
- delete_post_meta ( $order->get_id (), '_stripe_lock' );
234
- }
235
-
236
- /**
237
- *
238
- * @param WC_Order $order
239
- */
240
- public function has_order_lock($order) {
241
- return get_post_meta ( $order->get_id (), '_stripe_lock', true );
242
- }
243
  }
56
  }
57
 
58
  public function process_payment($order_id) {
59
+ $order = wc_get_order ( $order_id );
60
  if (! $this->processing_payment) {
61
+ $source_id = $this->get_new_source_token ();
 
 
62
  if (! empty ( $source_id )) {
63
  // source was created client side.
64
  $source = $this->gateway->fetch_payment_source ( $source_id );
215
  }
216
  return $desc;
217
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
218
  }
includes/abstract/abstract-wc-payment-gateway-stripe.php CHANGED
@@ -54,12 +54,14 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
54
  */
55
  protected $payment_method_token = null;
56
 
 
 
57
  /**
58
  * Is the payment method synchronous or asynchronous
59
  *
60
  * @var bool
61
  */
62
- protected $synchronous = true;
63
 
64
  /**
65
  *
@@ -74,10 +76,10 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
74
  $this->payment_type_key = $this->id . '_payment_type_key';
75
  $this->payment_intent_key = $this->id . '_payment_intent_key';
76
  $this->has_fields = true;
77
- $this->title = $this->get_option ( 'title_text' );
78
- $this->description = $this->get_option ( 'description' );
79
  $this->init_form_fields ();
80
  $this->init_settings ();
 
 
81
  $this->hooks ();
82
  $this->init_supports ();
83
  $this->gateway = new WC_Stripe_Gateway ();
@@ -316,7 +318,7 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
316
  if ($this->use_saved_source ()) {
317
  return $this->get_saved_source_id ();
318
  }
319
- return $this->get_new_source_id ();
320
  }
321
 
322
  /**
@@ -358,7 +360,7 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
358
  $customer_id = $this->create_customer ( get_current_user_id () );
359
  }
360
  try {
361
- $result = $this->create_payment_method ( $this->get_new_source_id (), $customer_id );
362
  if (is_wp_error ( $result )) {
363
  wc_add_notice ( sprintf ( __ ( 'Error saving your payment method. Reason: %s', 'woo-stripe-payment' ), $result->get_error_message () ), 'error' );
364
  return array( 'result' => 'error'
@@ -492,7 +494,7 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
492
  if ($this->payment_method_token) {
493
  return $this->payment_method_token;
494
  }
495
- return $this->get_new_source_id ();
496
  }
497
  }
498
 
@@ -507,8 +509,17 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
507
  return ( ! empty ( $_POST[ $this->payment_type_key ] ) && $_POST[ $this->payment_type_key ] === 'saved' ) || $this->payment_method_token;
508
  }
509
 
 
 
 
 
 
510
  public function get_new_source_id() {
511
- return ! empty ( $_POST[ $this->token_key ] ) ? $_POST[ $this->token_key ] : '';
 
 
 
 
512
  }
513
 
514
  public function get_saved_source_id() {
@@ -728,6 +739,18 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
728
  return ob_get_clean ();
729
  }
730
 
 
 
 
 
 
 
 
 
 
 
 
 
731
  public function generate_description_html($key, $data) {
732
  $field_key = $this->get_field_key ( $key );
733
  $data = wp_parse_args ( $data, array(
@@ -854,7 +877,7 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
854
  if ($new_payment_method === $this->id) {
855
  // customer is using a new payment method so we need to save it.
856
  if (! $this->use_saved_source ()) {
857
- $result = $this->save_payment_method ( $this->get_new_source_id (), $subscription );
858
  if (is_wp_error ( $result )) {
859
  wc_add_notice ( sprintf ( __ ( 'Error saving payment method for subscription. Reason: %s', 'woo-stripe-payment' ), $result->get_error_message () ), 'error' );
860
  // redirect to change payment method page.
@@ -900,6 +923,10 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
900
  $this->payment_method_token = $id;
901
  }
902
 
 
 
 
 
903
  /**
904
  *
905
  * @param WC_Order $order
@@ -926,7 +953,7 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
926
  public function process_zero_total_order($order) {
927
  // save payment method if necessary
928
  if ($this->should_save_payment_method ( $order )) {
929
- $result = $this->save_payment_method ( $this->get_new_source_id (), $order );
930
  if (is_wp_error ( $result )) {
931
  return $this->order_error ();
932
  }
@@ -950,7 +977,7 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
950
  public function process_pre_order($order) {
951
  // maybe save payment method
952
  if (! $this->use_saved_source ()) {
953
- $result = $this->save_payment_method ( $this->get_new_source_id (), $order );
954
  if (is_wp_error ( $result )) {
955
  return $this->order_error ();
956
  }
@@ -1007,4 +1034,35 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
1007
  protected function pre_order_requires_tokenization($order) {
1008
  return WC_Pre_Orders_Order::order_requires_payment_tokenization ( $order );
1009
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1010
  }
54
  */
55
  protected $payment_method_token = null;
56
 
57
+ protected $new_source_token = null;
58
+
59
  /**
60
  * Is the payment method synchronous or asynchronous
61
  *
62
  * @var bool
63
  */
64
+ public $synchronous = true;
65
 
66
  /**
67
  *
76
  $this->payment_type_key = $this->id . '_payment_type_key';
77
  $this->payment_intent_key = $this->id . '_payment_intent_key';
78
  $this->has_fields = true;
 
 
79
  $this->init_form_fields ();
80
  $this->init_settings ();
81
+ $this->title = $this->get_option ( 'title_text' );
82
+ $this->description = $this->get_option ( 'description' );
83
  $this->hooks ();
84
  $this->init_supports ();
85
  $this->gateway = new WC_Stripe_Gateway ();
318
  if ($this->use_saved_source ()) {
319
  return $this->get_saved_source_id ();
320
  }
321
+ return $this->get_new_source_token ();
322
  }
323
 
324
  /**
360
  $customer_id = $this->create_customer ( get_current_user_id () );
361
  }
362
  try {
363
+ $result = $this->create_payment_method ( $this->get_new_source_token (), $customer_id );
364
  if (is_wp_error ( $result )) {
365
  wc_add_notice ( sprintf ( __ ( 'Error saving your payment method. Reason: %s', 'woo-stripe-payment' ), $result->get_error_message () ), 'error' );
366
  return array( 'result' => 'error'
494
  if ($this->payment_method_token) {
495
  return $this->payment_method_token;
496
  }
497
+ return $this->get_new_source_token ();
498
  }
499
  }
500
 
509
  return ( ! empty ( $_POST[ $this->payment_type_key ] ) && $_POST[ $this->payment_type_key ] === 'saved' ) || $this->payment_method_token;
510
  }
511
 
512
+ /**
513
+ *
514
+ * @deprecated
515
+ *
516
+ */
517
  public function get_new_source_id() {
518
+ return $this->get_new_source_token ();
519
+ }
520
+
521
+ public function get_new_source_token() {
522
+ return null != $this->new_source_token ? $this->new_source_token : ( ! empty ( $_POST[ $this->token_key ] ) ? $_POST[ $this->token_key ] : '' );
523
  }
524
 
525
  public function get_saved_source_id() {
739
  return ob_get_clean ();
740
  }
741
 
742
+ public function generate_stripe_button_html($key, $data) {
743
+ $field_key = $this->get_field_key ( $key );
744
+ $data = wp_parse_args ( $data, array(
745
+ 'title' => '', 'class' => '', 'style' => '',
746
+ 'description' => '', 'desc_tip' => false,
747
+ 'id' => 'wc-stripe-button_' . $key
748
+ ) );
749
+ ob_start ();
750
+ include wc_stripe ()->plugin_path () . 'includes/admin/views/html-button.php';
751
+ return ob_get_clean ();
752
+ }
753
+
754
  public function generate_description_html($key, $data) {
755
  $field_key = $this->get_field_key ( $key );
756
  $data = wp_parse_args ( $data, array(
877
  if ($new_payment_method === $this->id) {
878
  // customer is using a new payment method so we need to save it.
879
  if (! $this->use_saved_source ()) {
880
+ $result = $this->save_payment_method ( $this->get_new_source_token (), $subscription );
881
  if (is_wp_error ( $result )) {
882
  wc_add_notice ( sprintf ( __ ( 'Error saving payment method for subscription. Reason: %s', 'woo-stripe-payment' ), $result->get_error_message () ), 'error' );
883
  // redirect to change payment method page.
923
  $this->payment_method_token = $id;
924
  }
925
 
926
+ public function set_new_source_token($token) {
927
+ $this->new_source_token = $token;
928
+ }
929
+
930
  /**
931
  *
932
  * @param WC_Order $order
953
  public function process_zero_total_order($order) {
954
  // save payment method if necessary
955
  if ($this->should_save_payment_method ( $order )) {
956
+ $result = $this->save_payment_method ( $this->get_new_source_token (), $order );
957
  if (is_wp_error ( $result )) {
958
  return $this->order_error ();
959
  }
977
  public function process_pre_order($order) {
978
  // maybe save payment method
979
  if (! $this->use_saved_source ()) {
980
+ $result = $this->save_payment_method ( $this->get_new_source_token (), $order );
981
  if (is_wp_error ( $result )) {
982
  return $this->order_error ();
983
  }
1034
  protected function pre_order_requires_tokenization($order) {
1035
  return WC_Pre_Orders_Order::order_requires_payment_tokenization ( $order );
1036
  }
1037
+
1038
+ /**
1039
+ * Sets a lock on the order.
1040
+ * Default behavior is a 2 minute lock.
1041
+ *
1042
+ * @param WC_Order|int $order
1043
+ */
1044
+ public function set_order_lock($order) {
1045
+ set_transient ( '_stripe_lock_order_' . ( is_object ( $order ) ? $order->get_id () : $order ), apply_filters ( 'wc_stripe_set_order_lock', time () + 2 * MINUTE_IN_SECONDS ) );
1046
+ }
1047
+
1048
+ /**
1049
+ * Removes the lock on the order
1050
+ *
1051
+ * @param WC_Order|int $order
1052
+ */
1053
+ public function release_order_lock($order) {
1054
+ delete_transient ( '_stripe_lock_order_' . ( is_object ( $order ) ? $order->get_id () : $order ) );
1055
+ }
1056
+
1057
+ /**
1058
+ * Returns true of the order has been locked.
1059
+ * If the lock exists and is greater than current time
1060
+ * method returns true;
1061
+ *
1062
+ * @param WC_Order|int $order
1063
+ */
1064
+ public function has_order_lock($order) {
1065
+ $lock = get_transient ( '_stripe_lock_order_' . ( is_object ( $order ) ? $order->get_id () : $order ) );
1066
+ return $lock != false;
1067
+ }
1068
  }
includes/abstract/abstract-wc-stripe-settings.php CHANGED
@@ -87,4 +87,17 @@ abstract class WC_Stripe_Settings_API extends WC_Settings_API {
87
  include wc_stripe ()->plugin_path () . 'includes/admin/views/html-paragraph.php';
88
  return ob_get_clean ();
89
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  }
87
  include wc_stripe ()->plugin_path () . 'includes/admin/views/html-paragraph.php';
88
  return ob_get_clean ();
89
  }
90
+
91
+ public function generate_stripe_button_html($key, $data) {
92
+ $field_key = $this->get_field_key ( $key );
93
+ $data = wp_parse_args ( $data, array(
94
+ 'title' => '', 'class' => '', 'style' => '',
95
+ 'description' => '', 'desc_tip' => false,
96
+ 'id' => 'wc-stripe-button_' . $key,
97
+ 'disabled' => false, 'css' => ''
98
+ ) );
99
+ ob_start ();
100
+ include wc_stripe ()->plugin_path () . 'includes/admin/views/html-button.php';
101
+ return ob_get_clean ();
102
+ }
103
  }
includes/admin/class-wc-stripe-admin-assets.php CHANGED
@@ -47,7 +47,8 @@ class WC_Stripe_Admin_Assets {
47
  ;
48
  wp_localize_script ( 'wc-stripe-admin-settings', 'wc_stripe_setting_params', [
49
  'routes' => [
50
- 'apple_domain' => wc_stripe ()->rest_api->settings->rest_url ( 'apple-domain' )
 
51
  ],
52
  'rest_nonce' => wp_create_nonce ( 'wp_rest' )
53
  ] );
47
  ;
48
  wp_localize_script ( 'wc-stripe-admin-settings', 'wc_stripe_setting_params', [
49
  'routes' => [
50
+ 'apple_domain' => wc_stripe ()->rest_api->settings->rest_url ( 'apple-domain' ),
51
+ 'create_webhook' => wc_stripe ()->rest_api->settings->rest_url ( 'create-webook' )
52
  ],
53
  'rest_nonce' => wp_create_nonce ( 'wp_rest' )
54
  ] );
includes/admin/meta-boxes/views/html-charge-data-subview.php CHANGED
@@ -4,7 +4,7 @@
4
  */
5
  ?>
6
  <?php if(!$order->has_status('cancelled')):?>
7
- <?php if($charge->status === 'pending' || ($charge->status === 'succeeded' && !$charge->captured)):?>
8
  <div class="charge-actions">
9
  <h2><?php _e('Actions', 'woo-stripe-payment')?></h2>
10
  <div>
4
  */
5
  ?>
6
  <?php if(!$order->has_status('cancelled')):?>
7
+ <?php if(($charge->status === 'pending' && !$charge->captured) || ($charge->status === 'succeeded' && !$charge->captured)):?>
8
  <div class="charge-actions">
9
  <h2><?php _e('Actions', 'woo-stripe-payment')?></h2>
10
  <div>
includes/admin/settings/class-wc-stripe-api-settings.php CHANGED
@@ -79,6 +79,13 @@ class WC_Stripe_API_Settings extends WC_Stripe_Settings_API {
79
  )
80
  )
81
  ),
 
 
 
 
 
 
 
82
  'webhook_url' => array(
83
  'type' => 'paragraph',
84
  'title' => __ ( 'Webhook url', 'woo-stripe-payment' ),
@@ -89,7 +96,7 @@ class WC_Stripe_API_Settings extends WC_Stripe_Settings_API {
89
  'webhook_secret' => array(
90
  'type' => 'password',
91
  'title' => __ ( 'Webhook Secret', 'woo-stripe-payment' ),
92
- 'description' => sprintf(__ ( 'The webhook secret is used to authenticate webhooks sent from Stripe. It ensures no 3rd party can send you events, pretending to be Stripe. %sWebhook guide%s', 'woo-stripe-payment' ), '<a target="_blank" href="https://docs.paymentplugins.com/wc-stripe/config/#/webhooks?id=configure-webhooks">', '</a>')
93
  ),
94
  'debug_log' => array(
95
  'title' => __ ( 'Debug Log', 'woo-stripe-payment' ),
79
  )
80
  )
81
  ),
82
+ 'webhook_button' => array(
83
+ 'type' => 'stripe_button',
84
+ 'title' => __ ( 'Generate Webhook', 'woo-stripe-payment' ),
85
+ 'label' => __ ( 'Generate Webhook', 'woo-stripe-payment' ),
86
+ 'class' => 'wc-stripe-create-webhook button-secondary',
87
+ 'description' => __ ( 'Click this button to configure webhooks automatically.', 'woo-stripe-payment' )
88
+ ),
89
  'webhook_url' => array(
90
  'type' => 'paragraph',
91
  'title' => __ ( 'Webhook url', 'woo-stripe-payment' ),
96
  'webhook_secret' => array(
97
  'type' => 'password',
98
  'title' => __ ( 'Webhook Secret', 'woo-stripe-payment' ),
99
+ 'description' => sprintf ( __ ( 'The webhook secret is used to authenticate webhooks sent from Stripe. It ensures no 3rd party can send you events, pretending to be Stripe. %sWebhook guide%s', 'woo-stripe-payment' ), '<a target="_blank" href="https://docs.paymentplugins.com/wc-stripe/config/#/webhooks?id=configure-webhooks">', '</a>' )
100
  ),
101
  'debug_log' => array(
102
  'title' => __ ( 'Debug Log', 'woo-stripe-payment' ),
includes/admin/views/html-button.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <tr valign="top">
2
+ <th scope="row" class="titledesc">
3
+ <label for="<?php echo esc_attr( $field_key ); ?>"><?php echo wp_kses_post( $data['title'] ); ?> <?php echo $this->get_tooltip_html( $data ); // WPCS: XSS ok. ?></label>
4
+ </th>
5
+ <td class="forminp">
6
+ <fieldset>
7
+ <legend class="screen-reader-text"><span><?php echo wp_kses_post( $data['title'] ); ?></span></legend>
8
+ <label for="<?php echo esc_attr( $field_key ); ?>">
9
+ <button type="submit" <?php disabled( $data['disabled'], true ); ?> class="<?php echo esc_attr( $data['class'] ); ?>" name="<?php echo esc_attr( $field_key ); ?>" id="<?php echo esc_attr( $field_key ); ?>" style="<?php echo esc_attr( $data['css'] ); ?>" value="<?php echo $field_key?>" <?php echo $this->get_custom_attribute_html( $data ); // WPCS: XSS ok. ?>><?php echo wp_kses_post( $data['label'] ); ?></button></label><br/>
10
+ <?php echo $this->get_description_html( $data ); // WPCS: XSS ok. ?>
11
+ </fieldset>
12
+ </td>
13
+ </tr>
includes/class-stripe.php CHANGED
@@ -21,7 +21,7 @@ class WC_Stripe_Manager {
21
  *
22
  * @var string
23
  */
24
- public $version = '3.0.4';
25
 
26
  /**
27
  *
@@ -134,6 +134,7 @@ class WC_Stripe_Manager {
134
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/gateways/class-wc-payment-gateway-stripe-cc.php';
135
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/gateways/class-wc-payment-gateway-stripe-applepay.php';
136
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/gateways/class-wc-payment-gateway-stripe-googlepay.php';
 
137
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/gateways/class-wc-payment-gateway-stripe-payment-request.php';
138
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/gateways/class-wc-payment-gateway-stripe-ideal.php';
139
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/gateways/class-wc-payment-gateway-stripe-p24.php';
@@ -152,6 +153,7 @@ class WC_Stripe_Manager {
152
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/tokens/class-wc-payment-token-stripe-applepay.php';
153
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/tokens/class-wc-payment-token-stripe-googlepay.php';
154
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/tokens/class-wc-payment-token-stripe-local-payment.php';
 
155
 
156
  // main classes
157
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/class-wc-stripe-frontend-scripts.php';
@@ -171,6 +173,7 @@ class WC_Stripe_Manager {
171
  'WC_Payment_Gateway_Stripe_ApplePay',
172
  'WC_Payment_Gateway_Stripe_GooglePay',
173
  'WC_Payment_Gateway_Stripe_Payment_Request',
 
174
  'WC_Payment_Gateway_Stripe_Ideal',
175
  'WC_Payment_Gateway_Stripe_P24',
176
  'WC_Payment_Gateway_Stripe_Klarna',
21
  *
22
  * @var string
23
  */
24
+ public $version = '3.0.5';
25
 
26
  /**
27
  *
134
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/gateways/class-wc-payment-gateway-stripe-cc.php';
135
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/gateways/class-wc-payment-gateway-stripe-applepay.php';
136
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/gateways/class-wc-payment-gateway-stripe-googlepay.php';
137
+ include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/gateways/class-wc-payment-gateway-stripe-ach.php';
138
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/gateways/class-wc-payment-gateway-stripe-payment-request.php';
139
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/gateways/class-wc-payment-gateway-stripe-ideal.php';
140
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/gateways/class-wc-payment-gateway-stripe-p24.php';
153
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/tokens/class-wc-payment-token-stripe-applepay.php';
154
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/tokens/class-wc-payment-token-stripe-googlepay.php';
155
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/tokens/class-wc-payment-token-stripe-local-payment.php';
156
+ include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/tokens/class-wc-payment-token-stripe-ach.php';
157
 
158
  // main classes
159
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/class-wc-stripe-frontend-scripts.php';
173
  'WC_Payment_Gateway_Stripe_ApplePay',
174
  'WC_Payment_Gateway_Stripe_GooglePay',
175
  'WC_Payment_Gateway_Stripe_Payment_Request',
176
+ 'WC_Payment_Gateway_Stripe_ACH',
177
  'WC_Payment_Gateway_Stripe_Ideal',
178
  'WC_Payment_Gateway_Stripe_P24',
179
  'WC_Payment_Gateway_Stripe_Klarna',
includes/class-wc-stripe-frontend-scripts.php CHANGED
@@ -17,7 +17,8 @@ class WC_Stripe_Frontend_Scripts {
17
 
18
  public $global_scripts = array(
19
  'external' => 'https://js.stripe.com/v3/',
20
- 'gpay' => 'https://pay.google.com/gp/p/js/pay.js'
 
21
  );
22
 
23
  public function __construct() {
17
 
18
  public $global_scripts = array(
19
  'external' => 'https://js.stripe.com/v3/',
20
+ 'gpay' => 'https://pay.google.com/gp/p/js/pay.js',
21
+ 'plaid' => 'https://cdn.plaid.com/link/v2/stable/link-initialize.js'
22
  );
23
 
24
  public function __construct() {
includes/class-wc-stripe-gateway.php CHANGED
@@ -13,11 +13,22 @@ use Stripe\ApiOperations\All;
13
  */
14
  class WC_Stripe_Gateway {
15
 
16
- public function __construct() {}
 
 
 
 
 
 
 
 
 
 
 
17
 
18
  public static function init() {
19
  \Stripe\Stripe::setAppInfo ( 'Wordpress woo-stripe-payment', wc_stripe ()->version (), 'https://wordpress.org/plugins/woo-stripe-payment/', 'pp_partner_FdPtriN2Q7JLOe' );
20
- \Stripe\Stripe::setApiVersion ( '2019-11-05' );
21
  }
22
 
23
  /**
@@ -380,11 +391,37 @@ class WC_Stripe_Gateway {
380
  ], $this->get_api_options ( $mode ) );
381
  } catch ( \Stripe\Error\Base $e ) {
382
  $err = $e->getJsonBody ()[ 'error' ];
383
- return new WP_Error ( 'source-error', $err[ 'message' ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
384
  }
385
  }
386
 
387
  private function get_api_options($mode = '') {
 
 
 
388
  return apply_filters ( 'wc_stripe_api_options', [
389
  'api_key' => wc_stripe_get_secret_key ( $mode )
390
  ] );
13
  */
14
  class WC_Stripe_Gateway {
15
 
16
+ /**
17
+ *
18
+ * @since 3.0.5
19
+ * @var Stripe mode (test, live)
20
+ */
21
+ private $mode = null;
22
+
23
+ public function __construct($mode = null) {
24
+ if (null != $mode) {
25
+ $this->mode = $mode;
26
+ }
27
+ }
28
 
29
  public static function init() {
30
  \Stripe\Stripe::setAppInfo ( 'Wordpress woo-stripe-payment', wc_stripe ()->version (), 'https://wordpress.org/plugins/woo-stripe-payment/', 'pp_partner_FdPtriN2Q7JLOe' );
31
+ \Stripe\Stripe::setApiVersion ( '2019-12-03' );
32
  }
33
 
34
  /**
391
  ], $this->get_api_options ( $mode ) );
392
  } catch ( \Stripe\Error\Base $e ) {
393
  $err = $e->getJsonBody ()[ 'error' ];
394
+ return new WP_Error ( 'domain-error', $err[ 'message' ] );
395
+ }
396
+ }
397
+
398
+ public function webhooks($mode = '') {
399
+ try {
400
+ return \Stripe\WebhookEndpoint::all ( [
401
+ 'limit' => 100
402
+ ], $this->get_api_options ( $mode ) );
403
+ } catch ( \Stripe\Error\Base $e ) {
404
+ $err = $e->getJsonBody ()[ 'error' ];
405
+ return new WP_Error ( 'webhook-error', $err[ 'message' ] );
406
+ }
407
+ }
408
+
409
+ public function create_webhook($url, $events, $mode = '') {
410
+ try {
411
+ return \Stripe\WebhookEndpoint::create ( [
412
+ 'url' => $url,
413
+ 'enabled_events' => $events
414
+ ], $this->get_api_options ( $mode ) );
415
+ } catch ( \Stripe\Error\Base $e ) {
416
+ $err = $e->getJsonBody ()[ 'error' ];
417
+ return new WP_Error ( 'webhook-error', $err[ 'message' ] );
418
  }
419
  }
420
 
421
  private function get_api_options($mode = '') {
422
+ if (empty ( $mode ) && $this->mode != null) {
423
+ $mode = $this->mode;
424
+ }
425
  return apply_filters ( 'wc_stripe_api_options', [
426
  'api_key' => wc_stripe_get_secret_key ( $mode )
427
  ] );
includes/class-wc-stripe-redirect-handler.php CHANGED
@@ -37,11 +37,6 @@ class WC_Stripe_Redirect_Handler {
37
  */
38
  $payment_method = WC ()->payment_gateways ()->payment_gateways ()[ $order->get_payment_method () ];
39
 
40
- if ($payment_method->has_order_lock ( $order )) {
41
- wp_safe_redirect ( $order->get_checkout_order_received_url () );
42
- exit ();
43
- }
44
- // $payment_method = wc_clean ( $_GET[ 'wc-stripe-local-gateway' ] );
45
  // first do some validations on the source
46
  $stripe_gateway = new WC_Stripe_Gateway ();
47
 
@@ -53,13 +48,23 @@ class WC_Stripe_Redirect_Handler {
53
  if ('failed' === $source->status) {
54
  wc_add_notice ( __ ( 'Payment authorization failed. Please select another payment method.', 'woo-stripe-payment' ), 'error' );
55
  return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  }
57
  }
58
- $transaction_id = $order->get_transaction_id ();
59
- // if there is no transaction ID then the order hasn't been processed via webhooks yet.
60
- if (! $transaction_id) {
61
- $order->update_status ( 'on-hold', __ ( 'Status updated to on hold. Charge will be created when source.chargeable webhook received.', 'woo-stripe-payment' ) );
62
- }
63
  wp_safe_redirect ( $order->get_checkout_order_received_url () );
64
  exit ();
65
  }
37
  */
38
  $payment_method = WC ()->payment_gateways ()->payment_gateways ()[ $order->get_payment_method () ];
39
 
 
 
 
 
 
40
  // first do some validations on the source
41
  $stripe_gateway = new WC_Stripe_Gateway ();
42
 
48
  if ('failed' === $source->status) {
49
  wc_add_notice ( __ ( 'Payment authorization failed. Please select another payment method.', 'woo-stripe-payment' ), 'error' );
50
  return;
51
+ } elseif ('chargeable' === $source->status) {
52
+ if ($payment_method->has_order_lock ( $order )) {
53
+ wp_safe_redirect ( $order->get_checkout_order_received_url () );
54
+ exit ();
55
+ }
56
+ // source can be charged synchronously
57
+ $payment_method->set_new_source_token ( $source->id );
58
+ $payment_method->processing_payment = true;
59
+ $payment_method->set_order_lock ( $order );
60
+ wc_stripe_log_info ( 'processing from redirect handler.' );
61
+ $result = $payment_method->process_payment ( $order_id );
62
+ if ($result[ 'result' ] === 'success') {
63
+ wp_safe_redirect ( $result[ 'redirect' ] );
64
+ die ();
65
+ }
66
  }
67
  }
 
 
 
 
 
68
  wp_safe_redirect ( $order->get_checkout_order_received_url () );
69
  exit ();
70
  }
includes/controllers/class-wc-stripe-controller-gateway-settings.php CHANGED
@@ -18,6 +18,14 @@ class WC_Stripe_Controller_Gateway_Settings extends WC_Stripe_Rest_Controller {
18
  'admin_permission_check'
19
  )
20
  ] );
 
 
 
 
 
 
 
 
21
  }
22
 
23
  /**
@@ -66,4 +74,52 @@ class WC_Stripe_Controller_Gateway_Settings extends WC_Stripe_Rest_Controller {
66
  ] );
67
  }
68
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  }
18
  'admin_permission_check'
19
  )
20
  ] );
21
+ register_rest_route ( $this->rest_uri (), 'create-webook', [
22
+ 'methods' => WP_REST_Server::CREATABLE,
23
+ 'callback' => [ $this, 'create_webhook'
24
+ ],
25
+ 'permission_callback' => array( $this,
26
+ 'admin_permission_check'
27
+ )
28
+ ] );
29
  }
30
 
31
  /**
74
  ] );
75
  }
76
  }
77
+
78
+ /**
79
+ * Create a Stripe webhook for the site.
80
+ *
81
+ * @param WP_REST_Request $request
82
+ */
83
+ public function create_webhook($request) {
84
+ $url = wc_stripe ()->rest_api->webhook->rest_url ( 'webhook' );
85
+ $api_settings = wc_stripe ()->api_settings;
86
+ $gateway = new WC_Stripe_Gateway ( $api_settings->get_option ( 'mode' ) );
87
+ // first fetch all webhooks
88
+ $private_key = wc_stripe_get_secret_key ( $api_settings->get_option ( 'mode' ) );
89
+ if (empty ( $private_key )) {
90
+ return new WP_Error ( 'webhook-error', __ ( 'You must configure your secret key before creating webhooks.', 'woo-stripe-payment' ), [
91
+ 'status' => 200
92
+ ] );
93
+ }
94
+ $webhooks = $gateway->webhooks ();
95
+ if (! is_wp_error ( $webhooks )) {
96
+ // validate that the webhook hasn't already been created.
97
+ foreach ( $webhooks->data as $webhook ) {
98
+ if ($webhook[ 'url' ] === $url) {
99
+ return new WP_Error ( 'webhook-error', __ ( 'There is already a webhook configured for this site. If you want to delete the webhook, login to your Stripe Dashboard.', 'woo-stripe-payment' ), [
100
+ 'status' => 200
101
+ ] );
102
+ }
103
+ }
104
+ }
105
+
106
+ // create the webhooks and save it to the api settings.
107
+ $webhook = $gateway->create_webhook ( $url, apply_filters ( 'wc_stripe_webhook_events', [
108
+ 'charge.failed', 'charge.succeeded',
109
+ 'source.chargeable'
110
+ ] ) );
111
+ if (is_wp_error ( $webhook )) {
112
+ return new WP_Error ( $webhook->get_error_code (), $webhook->get_error_message (), [
113
+ 'status' => 200
114
+ ] );
115
+ } else {
116
+ $api_settings->update_option ( 'webhook_url', $webhook[ 'url' ] );
117
+ $api_settings->update_option ( 'webhook_secret', $webhook[ 'secret' ] );
118
+ $api_settings->update_option ( 'webhook_id', $webhook[ 'id' ] );
119
+ return rest_ensure_response ( [
120
+ 'message' => __ ( 'Webhook created in Stripe. You can test your webhook by logging in to the Stripe dashboard', 'woo-stripe-payment' ),
121
+ 'secret' => $api_settings->get_option ( 'webhook_secret' )
122
+ ] );
123
+ }
124
+ }
125
  }
includes/controllers/class-wc-stripe-controller-webhook.php CHANGED
@@ -29,6 +29,7 @@ class WC_Stripe_Controller_Webhook extends WC_Stripe_Rest_Controller {
29
  $header = isset ( $_SERVER[ 'HTTP_STRIPE_SIGNATURE' ] ) ? $_SERVER[ 'HTTP_STRIPE_SIGNATURE' ] : '';
30
  try {
31
  $event = \Stripe\Webhook::constructEvent ( $payload, $header, $this->secret );
 
32
  wc_stripe_log_info ( sprintf ( 'Webhook notficiation received: Event: %s. Payload: %s', $event->type, print_r ( $payload, true ) ) );
33
  $type = $event->type;
34
  $type = str_replace ( '.', '_', $type );
29
  $header = isset ( $_SERVER[ 'HTTP_STRIPE_SIGNATURE' ] ) ? $_SERVER[ 'HTTP_STRIPE_SIGNATURE' ] : '';
30
  try {
31
  $event = \Stripe\Webhook::constructEvent ( $payload, $header, $this->secret );
32
+ //$event = \Stripe\StripeObject::constructFrom(json_decode($payload, true));
33
  wc_stripe_log_info ( sprintf ( 'Webhook notficiation received: Event: %s. Payload: %s', $event->type, print_r ( $payload, true ) ) );
34
  $type = $event->type;
35
  $type = str_replace ( '.', '_', $type );
includes/gateways/class-wc-payment-gateway-stripe-ach.php ADDED
@@ -0,0 +1,175 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Gateway that processes ACH payments. Only available for U.S. based merchants at this time.
4
+ * @since 3.0.5
5
+ * @author Payment Plugins
6
+ * @package Stripe/Gateways
7
+ *
8
+ */
9
+ class WC_Payment_Gateway_Stripe_ACH extends WC_Payment_Gateway_Stripe_Charge {
10
+
11
+ /**
12
+ *
13
+ * @var object
14
+ */
15
+ public $metadata_key = '';
16
+
17
+ public function __construct() {
18
+ $this->synchronous = false;
19
+ $this->id = 'stripe_ach';
20
+ $this->tab_title = __ ( 'ACH', 'woo-stripe-payment' );
21
+ $this->template_name = 'ach.php';
22
+ $this->token_type = 'Stripe_ACH';
23
+ $this->method_title = __ ( 'Stripe ACH', 'woo-stripe-payment' );
24
+ $this->method_description = __ ( 'ACH gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
25
+ $this->icon = wc_stripe ()->assets_url ( 'img/ach.svg' );
26
+ $this->order_button_text = __ ( 'Bank Payment', 'woo-stripe-payment' );
27
+ $this->metadata_key = $this->id . '_metadata';
28
+ parent::__construct ();
29
+ $this->settings[ 'charge_type' ] = 'capture';
30
+ }
31
+
32
+ /**
33
+ *
34
+ * {@inheritDoc}
35
+ *
36
+ * @see WC_Payment_Gateway::is_available()
37
+ */
38
+ public function is_available() {
39
+ $is_available = parent::is_available ();
40
+ return $is_available && get_woocommerce_currency () == 'USD';
41
+ }
42
+
43
+ /**
44
+ *
45
+ * {@inheritDoc}
46
+ *
47
+ * @see WC_Payment_Gateway_Stripe::init_supports()
48
+ */
49
+ public function init_supports() {
50
+ $this->supports = [ 'tokenization', 'products',
51
+ 'refunds'
52
+ ];
53
+ }
54
+
55
+ /**
56
+ *
57
+ * {@inheritDoc}
58
+ *
59
+ * @see WC_Payment_Gateway_Stripe::enqueue_checkout_scripts()
60
+ */
61
+ public function enqueue_checkout_scripts($scripts) {
62
+ $scripts->enqueue_script ( 'ach', $scripts->assets_url ( 'js/frontend/ach-payments.js' ), array(
63
+ $scripts->get_handle ( 'external' ),
64
+ $scripts->get_handle ( 'plaid' )
65
+ ) );
66
+ $scripts->localize_script ( 'ach', $this->get_localized_params () );
67
+ }
68
+
69
+ public function get_localized_params() {
70
+ return array_merge_recursive ( parent::get_localized_params (), array(
71
+ 'env' => $this->get_plaid_environment (),
72
+ 'client_name' => $this->get_option ( 'client_name' ),
73
+ 'public_key' => $this->get_option ( 'public_key' ),
74
+ 'metadata_key' => '[name="' . $this->metadata_key . '"]'
75
+ ) );
76
+ }
77
+
78
+ /**
79
+ *
80
+ * {@inheritDoc}
81
+ *
82
+ * @see WC_Payment_Gateway_Stripe_Charge::process_payment()
83
+ */
84
+ public function process_payment($order_id) {
85
+ $order = wc_get_order ( $order_id );
86
+
87
+ // generate the access token first.
88
+ try {
89
+ $result = $this->fetch_access_token ( $this->get_public_token () );
90
+
91
+ $result = $this->fetch_bank_token ( $result->access_token );
92
+
93
+ $this->set_new_source_token ( $result->stripe_bank_account_token );
94
+
95
+ return parent::process_payment ( $order_id );
96
+ } catch ( Exception $e ) {
97
+ wc_add_notice ( sprintf ( __ ( 'Error processing payment. Reason: %s', 'woo-stripe-payment' ), $e->getMessage () ), 'error' );
98
+ }
99
+ }
100
+
101
+ private function do_api_request($uri, $body, $method = 'POST') {
102
+ $response = wp_safe_remote_post ( $this->get_plaid_url ( $uri ), [
103
+ 'headers' => [
104
+ 'Content-Type' => 'application/json'
105
+ ], 'body' => wp_json_encode ( $body ),
106
+ 'data_format' => 'body'
107
+ ] );
108
+ if (is_wp_error ( $response )) {
109
+ throw new Exception ( $response->get_error_message () );
110
+ } else {
111
+ $body = json_decode ( $response[ 'body' ] );
112
+ if ($response[ 'response' ][ 'code' ] > 299) {
113
+ throw new Exception ( $body->error_message );
114
+ } else {
115
+ return $body;
116
+ }
117
+ }
118
+ }
119
+
120
+ private function fetch_access_token($public_token) {
121
+ $env = $this->get_plaid_environment ();
122
+ return $this->do_api_request ( 'item/public_token/exchange', [
123
+ 'client_id' => $this->get_option ( 'client_id' ),
124
+ 'secret' => $this->get_option ( "{$env}_secret" ),
125
+ 'public_token' => $public_token
126
+ ] );
127
+ }
128
+
129
+ private function fetch_bank_token($access_token) {
130
+ $env = $this->get_plaid_environment ();
131
+ return $this->do_api_request ( 'processor/stripe/bank_account_token/create', [
132
+ 'client_id' => $this->get_option ( 'client_id' ),
133
+ 'secret' => $this->get_option ( "{$env}_secret" ),
134
+ 'access_token' => $access_token,
135
+ 'account_id' => $this->get_metadata ()[ 'account_id' ]
136
+ ] );
137
+ }
138
+
139
+ /**
140
+ * Return the base plaid api url.
141
+ *
142
+ * @return string
143
+ */
144
+ private function get_base_url() {
145
+ $url = '';
146
+ switch ($this->get_plaid_environment ()) {
147
+ case 'production' :
148
+ $url = 'https://production.plaid.com/';
149
+ break;
150
+ case 'sandbox' :
151
+ $url = 'https://sandbox.plaid.com/';
152
+ break;
153
+ case 'development' :
154
+ $url = 'https://development.plaid.com/';
155
+ break;
156
+ }
157
+ return $url;
158
+ }
159
+
160
+ private function get_plaid_url($uri) {
161
+ return sprintf ( '%s%s', $this->get_base_url (), $uri );
162
+ }
163
+
164
+ public function get_plaid_environment() {
165
+ return wc_stripe_mode () == 'test' ? 'sandbox' : 'production';
166
+ }
167
+
168
+ private function get_metadata() {
169
+ return isset ( $_POST[ $this->metadata_key ] ) ? json_decode ( stripslashes ( $_POST[ $this->metadata_key ] ), true ) : null;
170
+ }
171
+
172
+ private function get_public_token() {
173
+ return $this->get_new_source_token ();
174
+ }
175
+ }
includes/gateways/class-wc-payment-gateway-stripe-klarna.php CHANGED
@@ -139,10 +139,7 @@ class WC_Payment_Gateway_Stripe_Klarna extends WC_Payment_Gateway_Stripe_Local_P
139
  ]
140
  ] );
141
  $args[ 'source_order' ] = [];
142
- /**
143
- * Stripe's Klarna integration appears to have a bug where the shipping_first_name, and shipping_last_name always
144
- * have to be populated.
145
- */
146
  if ($order->get_shipping_address_1 ()) {
147
  $args[ 'klarna' ][ 'shipping_first_name' ] = $order->get_shipping_first_name ();
148
  $args[ 'klarna' ][ 'shipping_last_name' ] = $order->get_shipping_last_name ();
@@ -154,9 +151,6 @@ class WC_Payment_Gateway_Stripe_Klarna extends WC_Payment_Gateway_Stripe_Local_P
154
  'postal_code' => $order->get_shipping_postcode (),
155
  'state' => $order->get_shipping_state ()
156
  ];
157
- } else {
158
- $args[ 'klarna' ][ 'shipping_first_name' ] = $order->get_billing_first_name ();
159
- $args[ 'klarna' ][ 'shipping_last_name' ] = $order->get_billing_last_name ();
160
  }
161
  $types = [ 'line_item', 'tax', 'shipping',
162
  'fee', 'coupon'
@@ -175,7 +169,7 @@ class WC_Payment_Gateway_Stripe_Klarna extends WC_Payment_Gateway_Stripe_Local_P
175
  if ($item instanceof WC_Order_Item_Product) {
176
  $source_item[ 'type' ] = 'sku';
177
  // $source_item[ 'parent' ] = $item->get_id ();
178
- $source_item[ 'amount' ] = wc_stripe_add_number_precision ( $order->get_item_subtotal ( $item, false ) );
179
  } elseif ($item instanceof WC_Order_Item_Shipping) {
180
  $source_item[ 'type' ] = 'shipping';
181
  $source_item[ 'amount' ] = wc_stripe_add_number_precision ( $item->get_total () );
139
  ]
140
  ] );
141
  $args[ 'source_order' ] = [];
142
+
 
 
 
143
  if ($order->get_shipping_address_1 ()) {
144
  $args[ 'klarna' ][ 'shipping_first_name' ] = $order->get_shipping_first_name ();
145
  $args[ 'klarna' ][ 'shipping_last_name' ] = $order->get_shipping_last_name ();
151
  'postal_code' => $order->get_shipping_postcode (),
152
  'state' => $order->get_shipping_state ()
153
  ];
 
 
 
154
  }
155
  $types = [ 'line_item', 'tax', 'shipping',
156
  'fee', 'coupon'
169
  if ($item instanceof WC_Order_Item_Product) {
170
  $source_item[ 'type' ] = 'sku';
171
  // $source_item[ 'parent' ] = $item->get_id ();
172
+ $source_item[ 'amount' ] = wc_stripe_add_number_precision ( $item->get_subtotal () );
173
  } elseif ($item instanceof WC_Order_Item_Shipping) {
174
  $source_item[ 'type' ] = 'shipping';
175
  $source_item[ 'amount' ] = wc_stripe_add_number_precision ( $item->get_total () );
includes/gateways/settings/ach-settings.php ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ return array(
3
+ 'desc' => array( 'type' => 'description',
4
+ 'description' => sprintf ( '<div>%s</div>', __ ( 'For US customers only.', 'woo-stripe-payment' ) ) . sprintf ( '<p>%s</p>', sprintf ( __ ( 'Read through our %sdocumentation%s to configure ACH payments', 'woo-stripe-payment' ), '<a target="_blank" href="https://docs.paymentplugins.com/wc-stripe/config/#/stripe_ach">', '</a>' ) )
5
+ ),
6
+ 'enabled' => array(
7
+ 'title' => __ ( 'Enabled', 'woo-stripe-payment' ),
8
+ 'type' => 'checkbox', 'default' => 'no',
9
+ 'value' => 'yes', 'desc_tip' => true,
10
+ 'description' => __ ( 'If enabled, your site can accept ACH payments through Stripe.', 'woo-stripe-payment' )
11
+ ),
12
+ 'plaid_keys' => array( 'type' => 'title',
13
+ 'title' => __ ( 'Plaid Keys', 'wo-stripe-paymento' )
14
+ ),
15
+ 'client_id' => array( 'type' => 'text',
16
+ 'title' => __ ( 'Client ID' ),
17
+ 'default' => '',
18
+ 'description' => __ ( 'ID that identifies your Plaid account.', 'woo-stripe-payment' ),
19
+ 'desc_tip' => true
20
+ ),
21
+ 'public_key' => array( 'type' => 'text',
22
+ 'title' => __ ( 'Public Key' ),
23
+ 'default' => '',
24
+ 'description' => __ ( 'Used to identify ACH payments initiated from your site.', 'woo-stripe-payment' ),
25
+ 'desc_tip' => true
26
+ ),
27
+ 'plaid_secrets' => array( 'type' => 'title',
28
+ 'title' => __ ( 'Plaid Secrets', 'wo-stripe-paymento' )
29
+ ),
30
+ 'sandbox_secret' => array(
31
+ 'title' => __ ( 'Sandbox Secret', 'woo-stripe-payment' ),
32
+ 'type' => 'password', 'default' => '',
33
+ 'description' => __ ( 'Key that acts as a password when connecting to Plaid\'s sandbox environment.', 'woo-stripe-payment' ),
34
+ 'desc_tip' => true
35
+ ),
36
+ /* 'development_secret' => array(
37
+ 'title' => __ ( 'Development Secret', 'woo-stripe-payment' ),
38
+ 'type' => 'password', 'default' => '',
39
+ 'description' => __ ( '', 'woo-stripe-payment' ),
40
+ 'desc_tip' => true
41
+ ), */
42
+ 'production_secret' => array(
43
+ 'title' => __ ( 'Production Secret', 'woo-stripe-payment' ),
44
+ 'type' => 'password', 'default' => '',
45
+ 'description' => __ ( 'Key that acts as a password when connecting to Plaid\'s production environment.', 'woo-stripe-payment' ),
46
+ 'desc_tip' => true
47
+ ),
48
+ 'general_settings' => array( 'type' => 'title',
49
+ 'title' => __ ( 'General Settings', 'woo-stripe-payment' )
50
+ ),
51
+ 'title_text' => array( 'type' => 'text',
52
+ 'title' => __ ( 'Title', 'woo-stripe-payment' ),
53
+ 'default' => __ ( 'ACH Payment', 'woo-stripe-payment' ),
54
+ 'desc_tip' => true,
55
+ 'description' => __ ( 'Title of the ACH gateway' )
56
+ ),
57
+ 'description' => array(
58
+ 'title' => __ ( 'Description', 'woo-stripe-payment' ),
59
+ 'type' => 'text', 'default' => '',
60
+ 'description' => __ ( 'Leave blank if you don\'t want a description to show for the gateway.', 'woo-stripe-payment' ),
61
+ 'desc_tip' => true
62
+ ),
63
+ 'client_name' => array( 'type' => 'text',
64
+ 'title' => __ ( 'Client Name', 'woo-stripe-payment' ),
65
+ 'default' => get_bloginfo ( 'name' ),
66
+ 'description' => __ ( 'The name that appears on the ACH payment screen.', 'woo-stripe-payment' ),
67
+ 'desc_tip' => true
68
+ ),
69
+ 'method_format' => array(
70
+ 'title' => __ ( 'ACH Display', 'woo-stripe-payment' ),
71
+ 'type' => 'select',
72
+ 'class' => 'wc-enhanced-select',
73
+ 'options' => wp_list_pluck ( $this->get_method_formats (), 'example' ),
74
+ 'value' => '', 'default' => 'type_ending_in',
75
+ 'desc_tip' => true,
76
+ 'description' => __ ( 'This option allows you to customize how the credit card will display for your customers on orders, subscriptions, etc.' )
77
+ )
78
+ );
includes/gateways/settings/applepay-settings.php CHANGED
@@ -16,7 +16,7 @@ return array(
16
  'title' => __ ( 'Title', 'woo-stripe-payment' ),
17
  'default' => __ ( 'Apple Pay', 'woo-stripe-payment' ),
18
  'desc_tip' => true,
19
- 'description' => __ ( 'Title of the credit card gateway' )
20
  ),
21
  'description' => array(
22
  'title' => __ ( 'Description', 'woo-stripe-payment' ),
16
  'title' => __ ( 'Title', 'woo-stripe-payment' ),
17
  'default' => __ ( 'Apple Pay', 'woo-stripe-payment' ),
18
  'desc_tip' => true,
19
+ 'description' => __ ( 'Title of the Apple Pay gateway' )
20
  ),
21
  'description' => array(
22
  'title' => __ ( 'Description', 'woo-stripe-payment' ),
includes/tokens/class-wc-payment-token-stripe-ach.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @since 3.0.5
4
+ * @package Stripe/Tokens
5
+ * @author Payment Plugins
6
+ *
7
+ */
8
+ class WC_Payment_Token_Stripe_ACH extends WC_Payment_Token_Stripe {
9
+
10
+ protected $type = 'Stripe_ACH';
11
+
12
+ protected $stripe_data = array( 'bank_name' => '',
13
+ 'routing' => '', 'last4' => ''
14
+ );
15
+
16
+ /**
17
+ *
18
+ * {@inheritDoc}
19
+ *
20
+ * @see WC_Payment_Token_Stripe::details_to_props()
21
+ */
22
+ public function details_to_props($details) {
23
+ if (isset ( $details[ 'ach_debit' ] )) {
24
+ $bank = $details[ 'ach_debit' ];
25
+ $this->set_bank_name ( $bank[ 'bank_name' ] );
26
+ $this->set_last4 ( $bank[ 'last4' ] );
27
+ $this->set_routing_number ( $bank[ 'routing_number' ] );
28
+ }
29
+ }
30
+
31
+ public function get_bank_name($context = 'view') {
32
+ return $this->get_prop ( 'bank_name', $context );
33
+ }
34
+
35
+ public function get_routing_number($context = 'view') {
36
+ return $this->get_prop ( 'routing_number', $context );
37
+ }
38
+
39
+ public function get_last4($context = 'view') {
40
+ return $this->get_prop ( 'last4', $context );
41
+ }
42
+
43
+ public function set_bank_name($value) {
44
+ $this->set_prop ( 'bank_name', $value );
45
+ }
46
+
47
+ public function set_routing_number($value) {
48
+ $this->set_prop ( 'routing', $value );
49
+ }
50
+
51
+ public function set_last4($value) {
52
+ $this->set_prop ( 'last4', $value );
53
+ }
54
+
55
+ public function get_formats() {
56
+ return array(
57
+ 'type_ending_in' => array(
58
+ 'label' => __ ( 'Type Ending In', 'woo-stripe-payment' ),
59
+ 'example' => 'Chase ending in 3434',
60
+ 'format' => __ ( '{bank_name} ending in {last4}', 'woo-stripe-payment' )
61
+ ),
62
+ 'name_masked_last4' => array(
63
+ 'label' => __ ( 'Type Ending In', 'woo-stripe-payment' ),
64
+ 'example' => 'Chase **** 3434',
65
+ 'format' => __ ( '{bank_name} **** {last4}', 'woo-stripe-payment' )
66
+ )
67
+ );
68
+ }
69
+ }
includes/wc-stripe-functions.php CHANGED
@@ -519,7 +519,7 @@ function wc_stripe_get_local_payment_params() {
519
  $data = [];
520
  $gateways = WC ()->payment_gateways ()->payment_gateways ();
521
  foreach ( $gateways as $gateway ) {
522
- if ($gateway instanceof WC_Payment_Gateway_Stripe_Local_Payment) {
523
  $data[ 'gateways' ][ $gateway->id ] = $gateway->get_localized_params ();
524
  }
525
  }
@@ -645,8 +645,8 @@ function wc_stripe_get_custom_forms() {
645
  'fontSize' => '16px',
646
  'fontSmoothing' => 'antialiased',
647
  '::placeholder' => [
648
- 'color' => '#fff' ,
649
- 'fontSize' => '0px'
650
  ],
651
  ':-webkit-autofill' => [
652
  'color' => '#e39f48'
@@ -700,6 +700,40 @@ function wc_stripe_get_custom_forms() {
700
  ]
701
  ]
702
  ],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
703
  'inline' => [
704
  'template' => 'cc-forms/inline.php',
705
  'label' => __ ( 'Inline Form', 'woo-stripe-payment' ),
@@ -819,4 +853,27 @@ function wc_stripe_display_prices_including_tax() {
819
  */
820
  function wc_stripe_pre_orders_active() {
821
  return class_exists ( 'WC_Pre_Orders' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
822
  }
519
  $data = [];
520
  $gateways = WC ()->payment_gateways ()->payment_gateways ();
521
  foreach ( $gateways as $gateway ) {
522
+ if ($gateway instanceof WC_Payment_Gateway_Stripe_Local_Payment && $gateway->is_available ()) {
523
  $data[ 'gateways' ][ $gateway->id ] = $gateway->get_localized_params ();
524
  }
525
  }
645
  'fontSize' => '16px',
646
  'fontSmoothing' => 'antialiased',
647
  '::placeholder' => [
648
+ 'color' => '#fff',
649
+ 'fontSize' => '0px'
650
  ],
651
  ':-webkit-autofill' => [
652
  'color' => '#e39f48'
700
  ]
701
  ]
702
  ],
703
+ 'minimalist' => [
704
+ 'template' => 'cc-forms/minimalist.php',
705
+ 'label' => __ ( 'Minimalist form', 'woo-stripe-payment' ),
706
+ 'cardBrand' => wc_stripe ()->assets_url ( 'img/card_brand2.svg' ),
707
+ 'elementStyles' => [
708
+ 'base' => [
709
+ 'color' => '#495057',
710
+ 'fontWeight' => 300,
711
+ 'fontFamily' => 'Roboto, sans-serif, Source Code Pro, Consolas, Menlo, monospace',
712
+ 'fontSize' => '30px',
713
+ 'fontSmoothing' => 'antialiased',
714
+ '::placeholder' => [
715
+ 'color' => '#fff',
716
+ 'fontSize' => '0px'
717
+ ],
718
+ ':-webkit-autofill' => [
719
+ 'color' => '#e39f48'
720
+ ]
721
+ ],
722
+ 'invalid' => [
723
+ 'color' => '#495057',
724
+ '::placeholder' => [
725
+ 'color' => '#495057'
726
+ ]
727
+ ]
728
+ ],
729
+ 'elementOptions' => [
730
+ 'fonts' => [
731
+ [
732
+ 'cssSrc' => 'https://fonts.googleapis.com/css?family=Source+Code+Pro'
733
+ ]
734
+ ]
735
+ ]
736
+ ],
737
  'inline' => [
738
  'template' => 'cc-forms/inline.php',
739
  'label' => __ ( 'Inline Form', 'woo-stripe-payment' ),
853
  */
854
  function wc_stripe_pre_orders_active() {
855
  return class_exists ( 'WC_Pre_Orders' );
856
+ }
857
+
858
+ /**
859
+ *
860
+ * @since 3.0.5
861
+ * @param string $source_id
862
+ */
863
+ function wc_stripe_get_order_from_source_id($source_id) {
864
+ global $wpdb;
865
+ $order_id = $wpdb->get_var ( $wpdb->prepare ( "SELECT ID FROM {$wpdb->posts} AS posts LEFT JOIN {$wpdb->postmeta} AS meta ON posts.ID = meta.post_id WHERE meta.meta_key = %s AND meta.meta_value = %s LIMIT 1", '_stripe_source_id', $source_id ) );
866
+ return wc_get_order ( $order_id );
867
+ }
868
+
869
+ /**
870
+ *
871
+ * @since 3.0.5
872
+ * @param string $transaction_id
873
+ * @return WC_Order|WC_Refund|boolean|WC_Order_Refund
874
+ */
875
+ function wc_stripe_get_order_from_transaction($transaction_id) {
876
+ global $wpdb;
877
+ $order_id = $wpdb->get_var ( $wpdb->prepare ( "SELECT ID FROM {$wpdb->posts} AS posts LEFT JOIN {$wpdb->postmeta} AS meta ON posts.ID = meta.post_id WHERE meta.meta_key = %s AND meta.meta_value = %s LIMIT 1", '_transaction_id', $transaction_id ) );
878
+ return wc_get_order ( $order_id );
879
  }
includes/wc-stripe-hooks.php CHANGED
@@ -9,6 +9,7 @@ add_action ( 'woocommerce_order_status_completed', 'wc_stripe_order_status_compl
9
  * * Webhook Actions ***
10
  */
11
  add_action ( 'wc_stripe_webhook_source_chargeable', 'wc_stripe_process_source_chargeable', 10, 2 );
 
12
 
13
  /**
14
  * Filters
9
  * * Webhook Actions ***
10
  */
11
  add_action ( 'wc_stripe_webhook_source_chargeable', 'wc_stripe_process_source_chargeable', 10, 2 );
12
+ add_action ( 'wc_stripe_webhook_charge_succeeded', 'wc_stripe_process_charge_succeeded', 10, 2 );
13
 
14
  /**
15
  * Filters
includes/wc-stripe-webhook-functions.php CHANGED
@@ -12,19 +12,12 @@ function wc_stripe_process_source_chargeable($source, $request) {
12
  // first retrieve the order_id using the source ID.
13
  global $wpdb;
14
 
15
- $order_id = $wpdb->get_var ( $wpdb->prepare ( "SELECT ID FROM {$wpdb->posts} AS posts LEFT JOIN {$wpdb->postmeta} AS meta ON posts.ID = meta.post_id WHERE meta.meta_key = %s AND meta.meta_value = %s LIMIT 1", '_stripe_source_id', $source->id ) );
16
- if (! $order_id) {
17
  wc_stripe_log_error ( sprintf ( 'Could not create a charge for source %s. No order ID was found in your Wordpress database.', $source->id ) );
18
  return;
19
  }
20
- // get the gateway
21
- $order = wc_get_order ( $order_id );
22
 
23
- // if the order has a transaction ID, then a charge has already been created.
24
- if (( $transaction_id = $order->get_transaction_id () )) {
25
- wc_stripe_log_info ( sprintf ( 'source.chargeable event received. Charge has already been created for order %s. Event exited.', $order_id ) );
26
- return;
27
- }
28
  $payment_method = $order->get_payment_method ();
29
 
30
  /**
@@ -33,17 +26,41 @@ function wc_stripe_process_source_chargeable($source, $request) {
33
  */
34
  $gateway = WC ()->payment_gateways ()->payment_gateways ()[ $payment_method ];
35
 
36
- $gateway->set_payment_method_token ( $source->id );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
 
38
- // only process webhook charges for local payment methods.
39
- if ($gateway instanceof WC_Payment_Gateway_Stripe_Local_Payment) {
40
- $gateway->processing_payment = true;
41
-
42
- $gateway->set_order_lock ( $order );
43
-
44
- // if the payment fails, then should rety be performed?
45
- $gateway->process_payment ( $order_id );
46
-
47
- $gateway->release_order_lock ( $order );
48
  }
49
  }
12
  // first retrieve the order_id using the source ID.
13
  global $wpdb;
14
 
15
+ $order = wc_stripe_get_order_from_source_id ( $source->id );
16
+ if (! $order) {
17
  wc_stripe_log_error ( sprintf ( 'Could not create a charge for source %s. No order ID was found in your Wordpress database.', $source->id ) );
18
  return;
19
  }
 
 
20
 
 
 
 
 
 
21
  $payment_method = $order->get_payment_method ();
22
 
23
  /**
26
  */
27
  $gateway = WC ()->payment_gateways ()->payment_gateways ()[ $payment_method ];
28
 
29
+ // if the order has a transaction ID, then a charge has already been created.
30
+ if ($gateway->has_order_lock ( $order ) || ( $transaction_id = $order->get_transaction_id () )) {
31
+ wc_stripe_log_info ( sprintf ( 'source.chargeable event received. Charge has already been created for order %s. Event exited.', $order_id ) );
32
+ return;
33
+ }
34
+ $gateway->set_new_source_token ( $source->id );
35
+ $gateway->processing_payment = true;
36
+ $gateway->set_order_lock ( $order );
37
+ wc_stripe_log_info ( 'processing from webhook.' );
38
+ $gateway->process_payment ( $order->get_id () );
39
+ }
40
+
41
+ /**
42
+ * When the charge has succeeded, the order should be completed.
43
+ *
44
+ * @version 3.0.5
45
+ * @package Stripe/Functions
46
+ *
47
+ * @param \Stripe\Charge $source
48
+ * @param WP_REST_Request $request
49
+ */
50
+ function wc_stripe_process_charge_succeeded($charge, $request) {
51
+ $order = wc_stripe_get_order_from_transaction ( $charge->id );
52
+ if (! $order) {
53
+ wc_stripe_log_error ( sprintf ( 'Could not complete payment for charge %s. No order ID was found in your Wordpress database.', $charge->id ) );
54
+ return;
55
+ }
56
+ $payment_method = WC ()->payment_gateways ()->payment_gateways ()[ $order->get_payment_method () ];
57
 
58
+ // only process payment_complete for asynchronous methods.
59
+ if (! $payment_method->synchronous) {
60
+ // want to prevent plugin from processing capture_charge since charge has already been captured.
61
+ remove_action ( 'woocommerce_order_status_completed', 'wc_stripe_order_status_completed' );
62
+ // call payment complete so shipping, emails, etc are triggered.
63
+ $order->payment_complete ();
64
+ $order->add_order_note ( __ ( 'Charge.succeeded webhook recieved. Payment has been completed.', 'woo-stripe-payment' ) );
 
 
 
65
  }
66
  }
readme.txt CHANGED
@@ -1,16 +1,16 @@
1
  === Stripe For WooCommerce ===
2
  Contributors: mr.clayton
3
- Tags: stripe, klarna, credit card, apple pay, google pay, ideal, sepa, sofort
4
  Requires at least: 3.0.1
5
- Tested up to: 5.3.0
6
  Requires PHP: 5.4
7
- Stable tag: 3.0.4
8
  Copyright: Payment Plugins
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
12
  == Description ==
13
- Accept Credit Cards, Google Pay, ApplePay, P24, Klarna, iDEAL and more all in one plugin for free!
14
 
15
  = Boost conversion by offering product and cart page checkout =
16
  Stripe for WooCommerce is made to supercharge your conversion rate by decreasing payment friction for your customer.
@@ -25,7 +25,9 @@ To see Apple Pay, visit the site using an iOS device. Google Pay will display fo
25
  - Credit Cards
26
  - Google Pay
27
  - Apple Pay
 
28
  - 3DS 2.0
 
29
  - WooCommerce Subscriptions
30
 
31
  == Frequently Asked Questions ==
@@ -51,6 +53,12 @@ If you're site is not loading over https, then Stripe won't render the Payment R
51
  7. Payment options at top of checkout page for easy one click checkout
52
 
53
  == Changelog ==
 
 
 
 
 
 
54
  = 3.0.4 =
55
  * Added - Bootstrap form added
56
  * Updated - WC 3.8.1
1
  === Stripe For WooCommerce ===
2
  Contributors: mr.clayton
3
+ Tags: stripe, ach, klarna, credit card, apple pay, google pay, ideal, sepa, sofort
4
  Requires at least: 3.0.1
5
+ Tested up to: 5.3
6
  Requires PHP: 5.4
7
+ Stable tag: 3.0.5
8
  Copyright: Payment Plugins
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
12
  == Description ==
13
+ Accept Credit Cards, Google Pay, ApplePay, ACH, P24, Klarna, iDEAL and more all in one plugin for free!
14
 
15
  = Boost conversion by offering product and cart page checkout =
16
  Stripe for WooCommerce is made to supercharge your conversion rate by decreasing payment friction for your customer.
25
  - Credit Cards
26
  - Google Pay
27
  - Apple Pay
28
+ - ACH Payments
29
  - 3DS 2.0
30
+ - Local Payment Methods
31
  - WooCommerce Subscriptions
32
 
33
  == Frequently Asked Questions ==
53
  7. Payment options at top of checkout page for easy one click checkout
54
 
55
  == Changelog ==
56
+ = 3.0.5 =
57
+ * Added - ACH payment support
58
+ * Added - New credit card form
59
+ * Fixed - Klarna error if item totals don't equal order total.
60
+ * Updated - API version to 2019-12-03
61
+ * Updated - Local payment logic.
62
  = 3.0.4 =
63
  * Added - Bootstrap form added
64
  * Updated - WC 3.8.1
stripe-payments.php CHANGED
@@ -3,12 +3,12 @@
3
  /**
4
  * Plugin Name: Stripe For WooCommerce
5
  * Plugin URI: https://docs.paymentplugins.com/wc-stripe/config/
6
- * Description: Accept credit cards, Google Pay, & Apple Pay, Klarna and more using Stripe.
7
- * Version: 3.0.4
8
  * Author: Payment Plugins, support@paymentplugins.com
9
  * Text Domain: woo-stripe-payment
10
  * Domain Path: /i18n/languages/
11
- * Tested up to: 5.3.0
12
  * WC requires at least: 3.0.0
13
  * WC tested up to: 3.8.1
14
  */
3
  /**
4
  * Plugin Name: Stripe For WooCommerce
5
  * Plugin URI: https://docs.paymentplugins.com/wc-stripe/config/
6
+ * Description: Accept credit cards, Google Pay, & Apple Pay, ACH, Klarna and more using Stripe.
7
+ * Version: 3.0.5
8
  * Author: Payment Plugins, support@paymentplugins.com
9
  * Text Domain: woo-stripe-payment
10
  * Domain Path: /i18n/languages/
11
+ * Tested up to: 5.3
12
  * WC requires at least: 3.0.0
13
  * WC tested up to: 3.8.1
14
  */
templates/cc-forms/bootstrap.php CHANGED
@@ -13,15 +13,15 @@
13
  <div class="row">
14
  <div class="col-md-4 mb-3">
15
  <div id="stripe-exp" class="md-form md-outline stripe-input"></div>
16
- <label for="stripe-cvv"><?php _e('Exp', 'woo-stripe-payment')?></label>
17
  </div>
18
  <div class="col-md-4 mb-3">
19
  <div id="stripe-cvv" class="md-form md-outline stripe-input"></div>
20
- <label for="stripe-cvv"><?php _e('CVC', 'woo-stripe-payment')?></label>
21
  </div>
22
  <?php if($gateway->postal_enabled()):?>
23
  <div class="col-md-4 mb-3">
24
- <input id="stripe-postal-code" class="md-form md-outline stripe-input"/>
25
  <label for="stripe-postal-code"><?php _e('ZIP', 'woo-stripe-payment')?></label>
26
  </div>
27
  <?php endif;?>
@@ -130,9 +130,9 @@ li.payment_method_stripe_cc .payment_box{
130
  .wc-stripe-bootstrap-form .md-form.md-outline.focused+label,
131
  .wc-stripe-bootstrap-form .md-form.md-outline.invalid+label,
132
  .wc-stripe-bootstrap-form .md-form.md-outline.StripeElement--complete+label {
133
- -webkit-transform: translateY(-150%);
134
- -ms-transform: translateY(-150%);
135
- transform: translateY(-150%);
136
  background: #fff;
137
  font-weight: 500;
138
  padding-right: 5px;
@@ -163,7 +163,7 @@ li.payment_method_stripe_cc .payment_box{
163
  background-color: #fff !important;
164
  -webkit-box-sizing: border-box;
165
  box-sizing: border-box;
166
- padding: 10px 12px;
167
  height: 40px;
168
  }
169
  .wc-stripe-bootstrap-form .stripe-input.focused,
13
  <div class="row">
14
  <div class="col-md-4 mb-3">
15
  <div id="stripe-exp" class="md-form md-outline stripe-input"></div>
16
+ <label for="stripe-exp"><?php _e('Exp', 'woo-stripe-payment')?></label>
17
  </div>
18
  <div class="col-md-4 mb-3">
19
  <div id="stripe-cvv" class="md-form md-outline stripe-input"></div>
20
+ <label for="stripe-cvv"><?php _e('CVV', 'woo-stripe-payment')?></label>
21
  </div>
22
  <?php if($gateway->postal_enabled()):?>
23
  <div class="col-md-4 mb-3">
24
+ <input id="stripe-postal-code" class="md-form md-outline stripe-input empty"/>
25
  <label for="stripe-postal-code"><?php _e('ZIP', 'woo-stripe-payment')?></label>
26
  </div>
27
  <?php endif;?>
130
  .wc-stripe-bootstrap-form .md-form.md-outline.focused+label,
131
  .wc-stripe-bootstrap-form .md-form.md-outline.invalid+label,
132
  .wc-stripe-bootstrap-form .md-form.md-outline.StripeElement--complete+label {
133
+ -webkit-transform: translateY(-155%);
134
+ -ms-transform: translateY(-155%);
135
+ transform: translateY(-155%);
136
  background: #fff;
137
  font-weight: 500;
138
  padding-right: 5px;
163
  background-color: #fff !important;
164
  -webkit-box-sizing: border-box;
165
  box-sizing: border-box;
166
+ z
167
  height: 40px;
168
  }
169
  .wc-stripe-bootstrap-form .stripe-input.focused,
templates/cc-forms/inline.php CHANGED
@@ -15,7 +15,7 @@
15
  <div id="stripe-exp" class="input"></div>
16
  </div>
17
  <div class="row">
18
- <label for="stripe-cvv"><?php _e('CVC', 'woo-stripe-payment')?></label>
19
  <div id="stripe-cvv" class="input"></div>
20
  </div>
21
  <?php if($gateway->postal_enabled()):?>
@@ -56,6 +56,7 @@
56
  -ms-flex-align: center;
57
  align-items: center;
58
  margin-left: 15px;
 
59
  }
60
 
61
  .wc-stripe-inline-form .row + .row {
15
  <div id="stripe-exp" class="input"></div>
16
  </div>
17
  <div class="row">
18
+ <label for="stripe-cvv"><?php _e('CVV', 'woo-stripe-payment')?></label>
19
  <div id="stripe-cvv" class="input"></div>
20
  </div>
21
  <?php if($gateway->postal_enabled()):?>
56
  -ms-flex-align: center;
57
  align-items: center;
58
  margin-left: 15px;
59
+ margin-right: 0px;
60
  }
61
 
62
  .wc-stripe-inline-form .row + .row {
templates/cc-forms/minimalist.php ADDED
@@ -0,0 +1,271 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @version 3.0.5
4
+ */
5
+ $steps = $gateway->postal_enabled() ? 4 : 3;
6
+ wc_stripe()->scripts()->enqueue_script('cc-forms', wc_stripe()->assets_url('js/frontend/cc-forms.js'), array(wc_stripe()->scripts()->get_handle('credit-card')));
7
+ ?>
8
+ <div class="wc-stripe-minimalist-form">
9
+ <div class="Wc-stripe-steps-container">
10
+ <nav class="wc-stripe-steps" data-steps="<?php echo $steps?>">
11
+ <a href="" class="wc-stripe-back">
12
+ <svg width="19" height="32" viewBox="0 0 19 32" xmlns="http://www.w3.org/2000/svg"><title>next</title><path fill="#495057" d="M5.657 15.556L18.385 2.828 15.555 0 0 15.556l15.556 15.557 2.83-2.83" fill-rule="evenodd"></path></svg>
13
+ </a>
14
+ <span class="wc-stripe-step" data-text="%s / <?php echo $steps?>">1 / <?php echo $steps?></span>
15
+ <a href="" class="wc-stripe-next">
16
+ <svg width="19" height="32" viewBox="0 0 19 32" xmlns="http://www.w3.org/2000/svg"><title>prev</title><path fill="#495057" d="M12.727 15.556L0 2.828 2.828 0l15.557 15.556L2.828 31.113 0 28.283" fill-rule="evenodd"></path></svg>
17
+ </a>
18
+ </nav>
19
+ </div>
20
+ <div class="field-container" data-index="1">
21
+ <div id="stripe-card-number" class="stripe-input"></div>
22
+ <label for="stripe-card-number" class="stripe-input--label"><?php _e('Card Number', 'woo-stripe-payment')?></label>
23
+ </div>
24
+ <div class="field-container field-container--hidden" data-index="2">
25
+ <div id="stripe-exp" class="stripe-input"></div>
26
+ <label for="stripe-exp" class="stripe-input--label"><?php _e('Exp', 'woo-stripe-payment')?></label>
27
+ </div>
28
+ <div class="field-container field-container--hidden" data-index="3">
29
+ <div id="stripe-cvv" class="stripe-input"></div>
30
+ <label for="stripe-cvv" class="stripe-input--label"><?php _e('CVV', 'woo-stripe-payment')?></label>
31
+ </div>
32
+ <?php if($gateway->postal_enabled()):?>
33
+ <div class="field-container field-container--hidden" data-index="4">
34
+ <input id="stripe-postal-code" class="stripe-input StripeElement"/>
35
+ <label for="stripe-postal-code" class="stripe-input--label"><?php _e('Postal', 'woo-stripe-payment')?></label>
36
+ </div>
37
+ <?php endif;?>
38
+ </div>
39
+ <style>
40
+ .wc-stripe_cc-new-method-container{
41
+ padding-top: 20px;
42
+ }
43
+ .wc-stripe-minimalist-form .Wc-stripe-steps-container{
44
+ position: relative;
45
+ height: 32px;
46
+ }
47
+ .wc-stripe-minimalist-form{
48
+ position: relative;
49
+ height: 82px;
50
+ }
51
+ .wc-stripe-minimalist-form .field-container{
52
+ position: absolute;
53
+ width: 100%;
54
+ z-index: 999;
55
+ opacity: 1;
56
+ transition: all 500ms cubic-bezier(0.2, 1.3, 0.7, 1);
57
+ -webkit-backface-visibility: hidden;
58
+ -webkit-transform-style: preserve-3d;
59
+ transform-style: preserve-3d;
60
+ -webkit-transform-origin: bottom;
61
+ transform-origin: bottom;
62
+ border: 1px solid #dadada;
63
+ }
64
+ .wc-stripe-minimalist-form .field-container.field-container--hidden {
65
+ opacity: 0;
66
+ -webkit-transform: translate(0em, 0em) rotateX(180deg);
67
+ transform: translate(0em, 0em) rotateX(180deg);
68
+ z-index: -1;
69
+ }
70
+ .wc-stripe-minimalist-form .field-container.field-container--hidden label[for=stripe-postal-code]{
71
+ display: none;
72
+ }
73
+ .wc-stripe-minimalist-form .field-container.field-container--hidden label[for=stripe-postal-code]:focus{
74
+ background: white;
75
+ }
76
+ .wc-stripe-minimalist-form .field-container #stripe-postal-code{
77
+ font-size: 30px;
78
+ }
79
+ .wc-stripe-minimalist-form .field-container label[for=stripe-postal-code]{
80
+ z-index: 999;
81
+ }
82
+ .wc-stripe-minimalist-form .stripe-input{
83
+ height: 50px;
84
+ padding: 7px 12px 9px 12px;
85
+ border-radius: unset;
86
+ width: 100%;
87
+ }
88
+ .wc-stripe-minimalist-form .stripe-input.invalid{
89
+ background: rgba(244, 67, 54, 0.5);
90
+ -webkit-animation: error 0.5s cubic-bezier(0.2, 1.3, 0.7, 1);
91
+ animation: error 0.5s cubic-bezier(0.2, 1.3, 0.7, 1);
92
+ }
93
+ .wc-stripe-minimalist-form .stripe-input.StripeElement--complete{
94
+ background: rgba(76, 175, 80, 0.5);
95
+ -webkit-animation: success 0.5s cubic-bezier(0.2, 1.3, 0.7, 1);
96
+ animation: success 0.5s cubic-bezier(0.2, 1.3, 0.7, 1);
97
+ }
98
+ .wc-stripe-minimalist-form .stripe-input--label{
99
+ color: #495057;
100
+ position: absolute;
101
+ top: 11px;
102
+ left: 10px;
103
+ transition: color 0.2s, -webkit-transform 0.2s cubic-bezier(0.2, 1.3, 0.7, 1);
104
+ transition: transform 0.2s cubic-bezier(0.2, 1.3, 0.7, 1), color 0.2s;
105
+ transition: transform 0.2s cubic-bezier(0.2, 1.3, 0.7, 1), color 0.2s, -webkit-transform 0.2s cubic-bezier(0.2, 1.3, 0.7, 1);
106
+ -webkit-transform-origin: 0 0;
107
+ transform-origin: 0 0;
108
+ font-size: 30px;
109
+ line-height: 1;
110
+ margin: 0px;
111
+ font-weight: 400;
112
+ }
113
+ .wc-stripe-minimalist-form .stripe-input.focused + .stripe-input--label,
114
+ .wc-stripe-minimalist-form .stripe-input.invalid + .stripe-input--label,
115
+ .wc-stripe-minimalist-form .stripe-input.StripeElement--complete + .stripe-input--label,
116
+ .wc-stripe-minimalist-form .stripe-input:focus + .stripe-input--label{
117
+ -webkit-transform: scale(0.6) translate(0px, -60px);
118
+ transform: scale(0.6) translate(0em, -60px);
119
+ transition: color 0.2s, -webkit-transform 0.2s cubic-bezier(0.2, 1.3, 0.7, 1);
120
+ transition: transform 0.2s cubic-bezier(0.2, 1.3, 0.7, 1), color 0.2s;
121
+ transition: transform 0.2s cubic-bezier(0.2, 1.3, 0.7, 1), color 0.2s, -webkit-transform 0.2s cubic-bezier(0.2, 1.3, 0.7, 1);
122
+ }
123
+ .wc-stripe-minimalist-form .wc-stripe-steps{
124
+ position: absolute;
125
+ z-index: 999;
126
+ right: 20px;
127
+ top: -10px;
128
+ display: flex;
129
+ display: -webkit-flex;
130
+ display: -ms-flexbox;
131
+ align-items: center;
132
+ }
133
+ .wc-stripe-minimalist-form .wc-stripe-steps a{
134
+ display: inline-block;
135
+ -webkit-transform: scale(0.8);
136
+ transform: scale(0.8);
137
+ transition: -webkit-transform 0.3s cubic-bezier(0.2, 1.3, 0.7, 1);
138
+ transition: transform 0.3s cubic-bezier(0.2, 1.3, 0.7, 1);
139
+ transition: transform 0.3s cubic-bezier(0.2, 1.3, 0.7, 1), -webkit-transform 0.3s cubic-bezier(0.2, 1.3, 0.7, 1);
140
+ }
141
+ .wc-stripe-minimalist-form .wc-stripe-steps a:hover{
142
+ -webkit-transform: scale(0.9);
143
+ transform: scale(0.9);
144
+ transition: -webkit-transform 0.1s cubic-bezier(0.2, 1.3, 0.7, 1);
145
+ transition: transform 0.1s cubic-bezier(0.2, 1.3, 0.7, 1);
146
+ transition: transform 0.1s cubic-bezier(0.2, 1.3, 0.7, 1), -webkit-transform 0.1s cubic-bezier(0.2, 1.3, 0.7, 1);
147
+ }
148
+ .wc-stripe-minimalist-form .wc-stripe-steps .wc-stripe-next,
149
+ .wc-stripe-minimalist-form .wc-stripe-steps .wc-stripe-back{
150
+ text-decoration: none;
151
+ box-shadow: none;
152
+ display: flex;
153
+ display: -webkit-flex;
154
+ align-items: center;
155
+ }
156
+ .wc-stripe-minimalist-form .wc-stripe-steps .wc-stripe-step{
157
+ margin: 0 5px;
158
+ }
159
+ @-webkit-keyframes error {
160
+ 0% {
161
+ background: #282828;
162
+ -webkit-transform: scale(1);
163
+ transform: scale(1);
164
+ }
165
+ 50% {
166
+ background: #f44336;
167
+ -webkit-transform: scale(1.1);
168
+ transform: scale(1.1);
169
+ }
170
+ 100% {
171
+ background: rgba(244, 67, 54, 0.5);
172
+ -webkit-transform: scale(1);
173
+ transform: scale(1);
174
+ }
175
+ }
176
+ @keyframes error {
177
+ 0% {
178
+ background: #282828;
179
+ -webkit-transform: scale(1);
180
+ transform: scale(1);
181
+ }
182
+ 50% {
183
+ background: #f44336;
184
+ -webkit-transform: scale(1.1);
185
+ transform: scale(1.1);
186
+ }
187
+ 100% {
188
+ background: rgba(244, 67, 54, 0.5);
189
+ -webkit-transform: scale(1);
190
+ transform: scale(1);
191
+ }
192
+ }
193
+
194
+ @-webkit-keyframes success {
195
+ 0% {
196
+ background: #282828;
197
+ -webkit-transform: scale(1);
198
+ transform: scale(1);
199
+ }
200
+ 50% {
201
+ background: #3d8b40;
202
+ -webkit-transform: scale(1.1);
203
+ transform: scale(1.1);
204
+ }
205
+ 100% {
206
+ background: rgba(76, 175, 80, 0.5);
207
+ -webkit-transform: scale(1);
208
+ transform: scale(1);
209
+ }
210
+ }
211
+ @keyframes success {
212
+ 0% {
213
+ background: #282828;
214
+ -webkit-transform: scale(1);
215
+ transform: scale(1);
216
+ }
217
+ 50% {
218
+ background: #3d8b40;
219
+ -webkit-transform: scale(1.1);
220
+ transform: scale(1.1);
221
+ }
222
+ 100% {
223
+ background: rgba(76, 175, 80, 0.5);
224
+ -webkit-transform: scale(1);
225
+ transform: scale(1);
226
+ }
227
+ }
228
+
229
+ @-webkit-keyframes inputIntro {
230
+ 0% {
231
+ -webkit-transform: translate(0, 0.2em) rotateX(90deg) scale(0.9);
232
+ transform: translate(0, 0.2em) rotateX(90deg) scale(0.9);
233
+ }
234
+ 100% {
235
+ -webkit-transform: translate(0, 0) rotateX(0) scale(1);
236
+ transform: translate(0, 0) rotateX(0) scale(1);
237
+ }
238
+ }
239
+ @keyframes inputIntro {
240
+ 0% {
241
+ -webkit-transform: translate(0, 0.2em) rotateX(90deg) scale(0.9);
242
+ transform: translate(0, 0.2em) rotateX(90deg) scale(0.9);
243
+ }
244
+ 100% {
245
+ -webkit-transform: translate(0, 0) rotateX(0) scale(1);
246
+ transform: translate(0, 0) rotateX(0) scale(1);
247
+ }
248
+ }
249
+ @media(max-width: 400px){
250
+ .wc-stripe-minimalist-form .stripe-input{
251
+ padding: 15px 12px;
252
+ }
253
+ .wc-stripe-minimalist-form .stripe-input--label{
254
+ font-size: 20px;
255
+ top: 15px;
256
+ }
257
+ .wc-stripe-minimalist-form .wc-stripe-steps{
258
+ right: 0;
259
+ }
260
+ }
261
+ .wc-stripe-sm .wc-stripe-minimalist-form .stripe-input{
262
+ padding: 15px 12px;
263
+ }
264
+ .wc-stripe-sm .wc-stripe-minimalist-form .stripe-input--label{
265
+ font-size: 20px;
266
+ top: 15px;
267
+ }
268
+ .wc-stripe-sm .wc-stripe-minimalist-form .wc-stripe-steps{
269
+ right: 0;
270
+ }
271
+ </style>
templates/cc-forms/simple.php CHANGED
@@ -23,7 +23,7 @@
23
  <div class="field half-width cvc">
24
  <div id="stripe-cvv" class="input empty"></div>
25
  <label for="stripe-cvv"
26
- data-tid=""><?php _e('CVC', 'woo-stripe-payment')?></label>
27
  <div class="baseline"></div>
28
  </div>
29
  </div>
23
  <div class="field half-width cvc">
24
  <div id="stripe-cvv" class="input empty"></div>
25
  <label for="stripe-cvv"
26
+ data-tid=""><?php _e('CVV', 'woo-stripe-payment')?></label>
27
  <div class="baseline"></div>
28
  </div>
29
  </div>
templates/checkout/ach.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @version 3.0.5
4
+ * @var WC_Payment_Gateway_Stripe_ACH $gateway
5
+ */
6
+ wc_stripe_hidden_field ( $gateway->metadata_key );
7
+ ?>
8
+ <div id="wc-stripe-ach-container">
9
+ <?php if('sandbox' === $gateway->get_plaid_environment()):?>
10
+ <p><?php _e('sandbox testing credentials', 'woo-stripe-payment')?>:</p>
11
+ <p><strong><?php _e('username', 'woo-stripe-payment')?></strong>:&nbsp;user_good</p>
12
+ <p><strong><?php _e('password', 'woo-stripe-payment')?></strong>:&nbsp;pass_good</p>
13
+ <?php endif;?>
14
+ </div>