Payment Plugins for Stripe WooCommerce - Version 3.0.1

Version Description

  • Updated - Google Pay paymentDataCallbacks in JavaScript
  • Updated - Text domain to match plugin slug
  • Added - Dynamic price option for Google Pay
  • Added - Pre-orders support
Download this release

Release Info

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

Code changes from version 3.0.0 to 3.0.1

Files changed (57) hide show
  1. assets/js/frontend/wc-stripe.js +68 -21
  2. assets/js/frontend/wc-stripe.min.js +1 -1
  3. i18n/languages/{woo-stripe.pot → woo-stripe-payment.pot} +117 -83
  4. includes/abstract/abstract-wc-payment-gateway-stripe-charge.php +46 -12
  5. includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php +5 -5
  6. includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php +59 -12
  7. includes/abstract/abstract-wc-payment-gateway-stripe.php +51 -14
  8. includes/abstract/abstract-wc-stripe-rest-controller.php +1 -1
  9. includes/admin/class-wc-stripe-admin-menus.php +5 -5
  10. includes/admin/class-wc-stripe-admin-settings.php +1 -1
  11. includes/admin/meta-boxes/views/html-charge-data-subview.php +21 -21
  12. includes/admin/meta-boxes/views/html-order-actions.php +8 -8
  13. includes/admin/meta-boxes/views/html-order-charge-data.php +1 -1
  14. includes/admin/meta-boxes/views/html-order-pay.php +8 -8
  15. includes/admin/settings/class-wc-stripe-api-settings.php +20 -20
  16. includes/admin/views/html-settings-nav.php +1 -1
  17. includes/admin/views/html-user-profile.php +20 -20
  18. includes/class-stripe.php +8 -1
  19. includes/class-wc-stripe-customer-manager.php +2 -2
  20. includes/class-wc-stripe-frontend-notices.php +1 -1
  21. includes/class-wc-stripe-gateway.php +3 -3
  22. includes/class-wc-stripe-install.php +2 -2
  23. includes/class-wc-stripe-redirect-handler.php +3 -3
  24. includes/class-wc-stripe-rest-api.php +1 -1
  25. includes/controllers/class-wc-stripe-controller-cart.php +3 -3
  26. includes/controllers/class-wc-stripe-controller-checkout.php +38 -2
  27. includes/controllers/class-wc-stripe-controller-gateway-settings.php +2 -2
  28. includes/controllers/class-wc-stripe-controller-googlepay.php +2 -2
  29. includes/controllers/class-wc-stripe-controller-order-actions.php +5 -5
  30. includes/controllers/class-wc-stripe-controller-payment-intent.php +1 -1
  31. includes/controllers/class-wc-stripe-controller-webhook.php +2 -2
  32. includes/gateways/class-wc-payment-gateway-stripe-applepay.php +4 -4
  33. includes/gateways/class-wc-payment-gateway-stripe-cc.php +3 -3
  34. includes/gateways/class-wc-payment-gateway-stripe-eps.php +11 -11
  35. includes/gateways/class-wc-payment-gateway-stripe-giropay.php +11 -11
  36. includes/gateways/class-wc-payment-gateway-stripe-googlepay.php +12 -11
  37. includes/gateways/class-wc-payment-gateway-stripe-ideal.php +11 -11
  38. includes/gateways/class-wc-payment-gateway-stripe-klarna.php +11 -11
  39. includes/gateways/class-wc-payment-gateway-stripe-multibanco.php +11 -11
  40. includes/gateways/class-wc-payment-gateway-stripe-p24.php +11 -11
  41. includes/gateways/class-wc-payment-gateway-stripe-payment-request.php +5 -5
  42. includes/gateways/class-wc-payment-gateway-stripe-sepa.php +11 -11
  43. includes/gateways/class-wc-payment-gateway-stripe-sofort.php +11 -11
  44. includes/gateways/class-wc-payment-gateway-stripe-wechat.php +12 -12
  45. includes/gateways/settings/applepay-settings.php +43 -43
  46. includes/gateways/settings/cc-settings.php +30 -30
  47. includes/gateways/settings/googlepay-settings.php +54 -48
  48. includes/gateways/settings/payment-request-settings.php +38 -38
  49. includes/tokens/class-wc-payment-token-stripe-cc.php +8 -8
  50. includes/tokens/class-wc-payment-token-stripe-local-payment.php +1 -1
  51. includes/wc-stripe-functions.php +17 -8
  52. readme.txt +8 -2
  53. stripe-payments.php +4 -4
  54. templates/cart/payment-methods.php +1 -1
  55. templates/cc-forms/inline.php +4 -4
  56. templates/cc-forms/simple.php +4 -4
  57. templates/checkout/credit-card.php +1 -1
assets/js/frontend/wc-stripe.js CHANGED
@@ -22,6 +22,10 @@
22
  this.initialize();
23
  }
24
 
 
 
 
 
25
  /**
26
  * [get_element_options description]
27
  * @return {[type]} [description]
@@ -545,7 +549,7 @@
545
  url: this.params.routes.checkout,
546
  method: 'POST',
547
  dataType: 'json',
548
- data: this.serialize_form(this.get_form()),
549
  beforeSend: function(xhr) {
550
  xhr.setRequestHeader('X-WP-Nonce', this.params.rest_nonce);
551
  }.bind(this)
@@ -694,6 +698,22 @@
694
  $(this.banner_container).css('max-width', $('.woocommerce-billing-fields').outerWidth(true));
695
  }
696
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
697
  }
698
 
699
  /**
@@ -1149,6 +1169,12 @@
1149
  }
1150
  }
1151
 
 
 
 
 
 
 
1152
  /**
1153
  * Populate the WC checkout fields.
1154
  * @param {[type]}
@@ -1273,10 +1299,22 @@
1273
  * @return {[type]}
1274
  */
1275
  wc_stripe.GooglePay.prototype.get_merchant_info = function() {
1276
- return {
1277
  merchantId: this.params.merchant_id,
1278
  merchantName: this.params.merchant_name
1279
  }
 
 
 
 
 
 
 
 
 
 
 
 
1280
  }
1281
 
1282
  /**
@@ -1287,16 +1325,23 @@
1287
  environment: this.params.environment,
1288
  merchantInfo: this.get_merchant_info()
1289
  }
1290
- if (this.needs_shipping() && (this.get_total_price_cents() > 0)) {
1291
- options.paymentDataCallbacks = {
1292
- onPaymentDataChanged: this.on_payment_data_changed.bind(this)
1293
- }
1294
- } else {
1295
- options.paymentDataCallbacks = {
1296
- onPaymentAuthorized: function(data) {
1297
- return new Promise(function(resolve, reject) {
1298
- resolve({ transactionState: "SUCCESS" })
1299
- }.bind(this))
 
 
 
 
 
 
 
1300
  }
1301
  }
1302
  }
@@ -1322,7 +1367,6 @@
1322
  }
1323
  }, baseCardPaymentMethod)],
1324
  shippingAddressRequired: this.needs_shipping() && this.get_total_price_cents() > 0,
1325
- shippingOptionRequired: this.needs_shipping() && this.get_total_price_cents() > 0,
1326
  transactionInfo: {
1327
  currencyCode: this.get_currency(),
1328
  totalPriceStatus: "ESTIMATED",
@@ -1336,14 +1380,17 @@
1336
  format: "FULL",
1337
  phoneNumberRequired: $('#billing_phone').length > 0
1338
  }
1339
- if (this.needs_shipping() && (this.get_total_price_cents() > 0)) {
1340
- request['shippingAddressParameters'] = {};
1341
- request['shippingOptionParameters'] = {
1342
- shippingOptions: this.get_shipping_options(),
1343
- };
1344
- request['callbackIntents'] = ["SHIPPING_ADDRESS", "SHIPPING_OPTION"];
1345
- } else {
1346
- request['callbackIntents'] = ["PAYMENT_AUTHORIZATION"];
 
 
 
1347
  }
1348
  return request;
1349
  }
22
  this.initialize();
23
  }
24
 
25
+ wc_stripe.BaseGateway.prototype.set_nonce = function(value) {
26
+ $(this.token_selector).val(value);
27
+ }
28
+
29
  /**
30
  * [get_element_options description]
31
  * @return {[type]} [description]
549
  url: this.params.routes.checkout,
550
  method: 'POST',
551
  dataType: 'json',
552
+ data: $.extend({}, this.serialize_form(this.get_form()), { payment_method: this.gateway_id }),
553
  beforeSend: function(xhr) {
554
  xhr.setRequestHeader('X-WP-Nonce', this.params.rest_nonce);
555
  }.bind(this)
698
  $(this.banner_container).css('max-width', $('.woocommerce-billing-fields').outerWidth(true));
699
  }
700
  }
701
+
702
+ this.order_review();
703
+ }
704
+
705
+ wc_stripe.CheckoutGateway.prototype.order_review = function() {
706
+ var url = window.location.href;
707
+ var matches = url.match(/order_review.+payment_method=([\w]+).+payment_nonce=(.+)/);
708
+ if (matches && matches.length > 1) {
709
+ var payment_method = matches[1],
710
+ nonce = matches[2];
711
+ if (this.gateway_id === payment_method) {
712
+ this.payment_token_received = true;
713
+ this.set_nonce(nonce);
714
+ this.set_use_new_option(true);
715
+ }
716
+ }
717
  }
718
 
719
  /**
1169
  }
1170
  }
1171
 
1172
+ wc_stripe.GooglePay.prototype.serialize_form = function($form) {
1173
+ return $.extend({}, wc_stripe.BaseGateway.prototype.serialize_form.apply(this, arguments), {
1174
+ order_review: !this.dynamic_price_enabled()
1175
+ });
1176
+ }
1177
+
1178
  /**
1179
  * Populate the WC checkout fields.
1180
  * @param {[type]}
1299
  * @return {[type]}
1300
  */
1301
  wc_stripe.GooglePay.prototype.get_merchant_info = function() {
1302
+ var options = {
1303
  merchantId: this.params.merchant_id,
1304
  merchantName: this.params.merchant_name
1305
  }
1306
+ if (this.params.environment === 'TEST') {
1307
+ delete options.merchantId;
1308
+ }
1309
+ return options;
1310
+ }
1311
+
1312
+ /**
1313
+ * Return true if dynamic pricing is enabled.
1314
+ * @return {[type]} [description]
1315
+ */
1316
+ wc_stripe.GooglePay.prototype.dynamic_price_enabled = function() {
1317
+ return this.params.dynamic_price === "1";
1318
  }
1319
 
1320
  /**
1325
  environment: this.params.environment,
1326
  merchantInfo: this.get_merchant_info()
1327
  }
1328
+ if (this.dynamic_price_enabled()) {
1329
+ if (this.needs_shipping() && (this.get_total_price_cents() > 0)) {
1330
+ options.paymentDataCallbacks = {
1331
+ onPaymentDataChanged: this.on_payment_data_changed.bind(this),
1332
+ onPaymentAuthorized: function(data) {
1333
+ return new Promise(function(resolve, reject) {
1334
+ resolve({ transactionState: "SUCCESS" })
1335
+ }.bind(this))
1336
+ }.bind(this)
1337
+ }
1338
+ } else {
1339
+ options.paymentDataCallbacks = {
1340
+ onPaymentAuthorized: function(data) {
1341
+ return new Promise(function(resolve, reject) {
1342
+ resolve({ transactionState: "SUCCESS" })
1343
+ }.bind(this))
1344
+ }
1345
  }
1346
  }
1347
  }
1367
  }
1368
  }, baseCardPaymentMethod)],
1369
  shippingAddressRequired: this.needs_shipping() && this.get_total_price_cents() > 0,
 
1370
  transactionInfo: {
1371
  currencyCode: this.get_currency(),
1372
  totalPriceStatus: "ESTIMATED",
1380
  format: "FULL",
1381
  phoneNumberRequired: $('#billing_phone').length > 0
1382
  }
1383
+ if (this.dynamic_price_enabled()) {
1384
+ if (this.needs_shipping() && (this.get_total_price_cents() > 0)) {
1385
+ request['shippingAddressParameters'] = {};
1386
+ request['shippingOptionRequired'] = true;
1387
+ request['shippingOptionParameters'] = {
1388
+ shippingOptions: this.get_shipping_options(),
1389
+ };
1390
+ request['callbackIntents'] = ["SHIPPING_ADDRESS", "SHIPPING_OPTION", "PAYMENT_AUTHORIZATION"];
1391
+ } else {
1392
+ request['callbackIntents'] = ["PAYMENT_AUTHORIZATION"];
1393
+ }
1394
  }
1395
  return request;
1396
  }
assets/js/frontend/wc-stripe.min.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){t.wc_stripe={};var i=Stripe(wc_stripe_params.api_key);wc_stripe.BaseGateway=function(t){this.params=t,this.gateway_id=this.params.gateway_id,this.token_selector=this.params.token_selector,this.saved_method_selector=this.params.saved_method_selector,this.payment_intent_selector=this.params.payment_intent_selector,this.payment_token_received=!1,this.stripe=i,this.elements=i.elements(e.extend({},{locale:"auto"},this.get_element_options())),this.initialize()},wc_stripe.BaseGateway.prototype.get_element_options=function(){return{}},wc_stripe.BaseGateway.prototype.initialize=function(){},wc_stripe.BaseGateway.prototype.create_button=function(){},wc_stripe.BaseGateway.prototype.is_gateway_selected=function(){return e('[name="payment_method"]:checked').val()===this.gateway_id},wc_stripe.BaseGateway.prototype.is_saved_method_selected=function(){return this.is_gateway_selected()&&"saved"===e('[name="'+this.gateway_id+'_payment_type_key"]:checked').val()},wc_stripe.BaseGateway.prototype.has_checkout_error=function(){return e("#wc_stripe_checkout_error").length>0&&this.is_gateway_selected()},wc_stripe.BaseGateway.prototype.submit_error=function(t){-1==t.indexOf("</ul>")&&(t='<div class="woocommerce-error">'+t+"</div>"),this.submit_message(t)},wc_stripe.BaseGateway.prototype.submit_error_code=function(t){},wc_stripe.BaseGateway.prototype.submit_message=function(t){e(".woocommerce-error, .woocommerce-message, .woocommerce-info").remove();var i=e(this.message_container);i.closest("form").length&&(i=i.closest("form")),i.prepend(t),i.removeClass("processing").unblock(),i.find(".input-text, select, input:checkbox").blur(),e("html, body").animate({scrollTop:i.offset().top-100},1e3)},wc_stripe.BaseGateway.prototype.should_save_method=function(){return e("#"+this.gateway_id+"_save_source_key").is(":checked")},wc_stripe.BaseGateway.prototype.is_add_payment_method_page=function(){return e(document.body).hasClass("woocommerce-add-payment-method")},wc_stripe.BaseGateway.prototype.get_selected_payment_method=function(){return e(this.saved_method_selector).val()},wc_stripe.BaseGateway.prototype.needs_shipping=function(){return"1"===this.params.needs_shipping},wc_stripe.BaseGateway.prototype.get_currency=function(){return e("#wc_stripe_currency").val()},wc_stripe.BaseGateway.prototype.get_country=function(){return e("#wc_stripe_country").val()},wc_stripe.BaseGateway.prototype.get_customer_name=function(t){return e(t+"_first_name").val()+" "+e(t+"_last_name").val()},wc_stripe.BaseGateway.prototype.get_customer_email=function(){return e("#billing_email").val()},wc_stripe.BaseGateway.prototype.get_address_field_hash=function(t){for(var i=["_first_name","_last_name","_address_1","_address_2","_postcode","_city","_state","_country"],a="",n=0;n<i.length;n++)a+=e(t+i[n]).val()+"_";return a},wc_stripe.BaseGateway.prototype.block=function(){e.blockUI({message:null,overlayCSS:{background:"#fff",opacity:.6}})},wc_stripe.BaseGateway.prototype.unblock=function(){e.unblockUI()},wc_stripe.BaseGateway.prototype.get_form=function(){return e(this.token_selector).closest("form")},wc_stripe.BaseGateway.prototype.get_total_price=function(){return e("#wc_stripe_order_total").data("amount")},wc_stripe.BaseGateway.prototype.get_total_price_cents=function(){return e("#wc_stripe_order_total_cents").data("amount")},wc_stripe.BaseGateway.prototype.set_total_price=function(t){e("#wc_stripe_order_total").data("amount",t)},wc_stripe.BaseGateway.prototype.set_total_price_cents=function(t){e("#wc_stripe_order_total_cents").data("amount",t)},wc_stripe.BaseGateway.prototype.set_payment_method=function(t){e('[name="payment_method"][value="'+t+'"]').prop("checked",!0).trigger("click")},wc_stripe.BaseGateway.prototype.set_selected_shipping_methods=function(t){if(t&&e('[name^="shipping_method"]').length)for(var i in t){var a=t[i];e('[name="shipping_method['+i+']"][value="'+a+'"]').prop("checked",!0).trigger("change")}},wc_stripe.BaseGateway.prototype.on_token_received=function(t){this.payment_token_received=!0,e(this.token_selector).val(t.id),this.process_checkout()},wc_stripe.BaseGateway.prototype.createPaymentRequest=function(){this.paymentRequest=i.paymentRequest(this.get_payment_request_options()),this.needs_shipping()&&(this.paymentRequest.on("shippingaddresschange",this.update_shipping_address.bind(this)),this.paymentRequest.on("shippingoptionchange",this.update_shipping_method.bind(this))),this.paymentRequest.on("paymentmethod",this.on_payment_method_received.bind(this))},wc_stripe.BaseGateway.prototype.get_payment_request_options=function(){var t={country:this.params.country_code,currency:this.get_currency().toLowerCase(),total:{amount:this.get_total_price_cents(),label:this.params.total_label,pending:!0},requestPayerName:!0,requestPayerEmail:!0,requestPayerPhone:!0,requestShipping:this.needs_shipping()},e=this.get_display_items(),i=this.get_shipping_options();return e&&(t.displayItems=e),this.needs_shipping()&&i&&(t.shippingOptions=i),t},wc_stripe.BaseGateway.prototype.get_payment_request_update=function(t){var i={currency:this.get_currency().toLowerCase(),total:{amount:parseInt(this.get_total_price_cents()),label:this.params.total_label,pending:!0}},a=this.get_display_items(),n=this.get_shipping_options();return a&&(i.displayItems=a),this.needs_shipping()&&n&&(i.shippingOptions=n),t&&(i=e.extend(!0,{},i,t)),i},wc_stripe.BaseGateway.prototype.get_display_items=function(){return e("#wc_stripe_display_items").data("items")},wc_stripe.BaseGateway.prototype.set_display_items=function(t){e("#wc_stripe_display_items").data("items",t)},wc_stripe.BaseGateway.prototype.get_shipping_options=function(){return e("#wc_stripe_shipping_options").data("items")},wc_stripe.BaseGateway.prototype.set_shipping_options=function(t){e("#wc_stripe_shipping_options").data("items",t)},wc_stripe.BaseGateway.prototype.map_address=function(t){return{city:t.city,postcode:t.postalCode,state:t.region,country:t.country}},wc_stripe.BaseGateway.prototype.on_payment_method_received=function(e){try{this.payment_response=e,this.populate_checkout_fields(e),e.complete("success"),this.on_token_received(e.paymentMethod)}catch(e){t.alert(e)}},wc_stripe.BaseGateway.prototype.populate_checkout_fields=function(t){e(this.token_selector).val(t.paymentMethod.id),this.populate_address_fields(t)},wc_stripe.BaseGateway.prototype.populate_address_fields=function(t){var i=this.address_mappings();if(t.payerName&&i.payerName.set(t.payerName),t.payerEmail&&i.payerEmail.set(t.payerEmail),t.payerPhone&&i.payerPhone.set(t.payerPhone),t.shippingAddress){var a=t.shippingAddress;for(var n in a)i[n]&&i[n].set.call(this,a[n],"#shipping")}if(t.paymentMethod.billing_details.address){a=t.paymentMethod.billing_details.address;for(var n in a)i[n]&&i[n].set.call(this,a[n],"#billing")}this.maybe_set_ship_to_different(),e('[name="billing_country"]').trigger("change")},wc_stripe.BaseGateway.prototype.address_mappings=function(){return{payerName:{set:function(t,i){var a=t.split(" ");a.length>0&&e("#billing_first_name").val(a[0]),a.length>1&&e("#billing_last_name").val(a[1])},get:function(t){return e("#billing_first_name").val()+" "+e("#billing_last_name").val()}},payerEmail:{set:function(t){e("#billing_email").val(t)},get:function(){return e("#billing_email").val()}},payerPhone:{set:function(t){e("#billing_phone").val(t)},get:function(){return e("#billing_phone").val()}},recipient:{set:function(t,i){var a=t.split(" ");a.length>0&&e(i+"_first_name").val(a[0]),a.length>1&&e(i+"_last_name").val(a[1])},get:function(t){return e(t+"_first_name").val()+" "+e(t+"_last_name").val()}},country:{set:function(t,i){e(i+"_country").val(t)},get:function(t){return e(t+"_country").val()}},addressLine:{set:function(t,i){t.length>0&&e(i+"_address_1").val(t[0]),t.length>1&&e(i+"_address_2").val(t[1])},get:function(t){return[e(t+"_address_1").val(),e(t+"_address_2").val()]}},line1:{set:function(t,i){e(i+"_address_1").val(t)},get:function(t){return e(t+"_address_1").val()}},line2:{set:function(t,i){e(i+"_address_2").val(t)},get:function(t){return e(t+"_address_2").val()}},region:{set:function(t,i){e(i+"_state").val(t)},get:function(t){e(t+"_state").val()}},state:{set:function(t,i){e(i+"_state").val(t)},get:function(t){e(t+"_state").val()}},city:{set:function(t,i){e(i+"_city").val(t)},get:function(t){e(t+"_city").val()}},postalCode:{set:function(t,i){e(i+"_postcode").val(t)},get:function(t){e(t+"_postcode").val()}},postal_code:{set:function(t,i){e(i+"_postcode").val(t)},get:function(t){e(t+"_postcode").val()}}}},wc_stripe.BaseGateway.prototype.process_checkout=function(){return new Promise(function(i,a){this.block(),e.ajax({url:this.params.routes.checkout,method:"POST",dataType:"json",data:this.serialize_form(this.get_form()),beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",this.params.rest_nonce)}.bind(this)}).done(function(e){e.reload?t.location.reload():"success"===e.result?t.location=e.redirect:(e.messages&&this.submit_error(e.messages),this.unblock())}.bind(this)).fail(function(t,e,i){this.unblock(),this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.BaseGateway.prototype.serialize_form=function(t){var i=t.find("input").filter(function(t,i){return!e(i).is('[name^="add-to-cart"]')}.bind(this)).serializeArray(),a={};for(var n in i){var s=i[n];a[s.name]=s.value}return a.payment_method=this.gateway_id,a},wc_stripe.BaseGateway.prototype.map_shipping_methods=function(t){var e={};if("default"!==t){var i=t.match(/^(\d):(.+)$/);i.length>1&&(e[i[1]]=i[2])}return e},wc_stripe.BaseGateway.prototype.maybe_set_ship_to_different=function(){e('[name="ship_to_different_address"]').length&&e('[name="ship_to_different_address"]').prop("checked",this.get_address_field_hash("#billing")!==this.get_address_field_hash("#shipping")).trigger("change")},wc_stripe.BaseGateway.prototype.update_shipping_address=function(t){return new Promise(function(i,a){e.ajax({url:this.params.routes.shipping_address,method:"POST",dataType:"json",data:{address:this.map_address(t.shippingAddress),payment_method:this.gateway_id},beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",this.params.rest_nonce)}.bind(this)}).done(function(e){e.code?(t.updateWith(e.data.newData),a(e.data)):(t.updateWith(e.data.newData),i(e.data))}.bind(this)).fail(function(t,e,i){}.bind(this))}.bind(this))},wc_stripe.BaseGateway.prototype.update_shipping_method=function(t){return new Promise(function(i,a){e.ajax({url:this.params.routes.shipping_method,method:"POST",dataType:"json",data:{shipping_methods:this.map_shipping_methods(t.shippingOption.id),payment_method:this.gateway_id},beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",this.params.rest_nonce)}.bind(this)}).done(function(e){e.code?(t.updateWith(e.data.newData),a(e.data)):(this.set_selected_shipping_methods(e.data.shipping_methods),t.updateWith(e.data.newData),i(e.data))}.bind(this)).fail(function(t,e,i){this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.CheckoutGateway=function(){this.container=this.message_container="li.payment_method_"+this.gateway_id,this.banner_container="li.banner_payment_method_"+this.gateway_id,e(document.body).on("updated_checkout",this.updated_checkout.bind(this)),e(document.body).on("checkout_error",this.checkout_error.bind(this)),e(this.token_selector).closest("form").on("checkout_place_order_"+this.gateway_id,this.checkout_place_order.bind(this)),e(document.body).on("wc_stripe_new_method_"+this.gateway_id,this.on_show_new_methods.bind(this)),e(document.body).on("wc_stripe_saved_method_"+this.gateway_id,this.on_show_saved_methods.bind(this)),e(document.body).on("wc_stripe_payment_method_selected",this.on_payment_method_selected.bind(this)),this.banner_enabled()&&e(".woocommerce-billing-fields").length&&e(this.banner_container).css("max-width",e(".woocommerce-billing-fields").outerWidth(!0))},wc_stripe.CheckoutGateway.prototype.updated_checkout=function(){},wc_stripe.CheckoutGateway.prototype.checkout_error=function(){this.has_checkout_error()&&(this.payment_token_received=!1,this.payment_response=null,this.show_payment_button(),this.hide_place_order())},wc_stripe.CheckoutGateway.prototype.is_valid_checkout=function(){return!(e('[name="terms"]').length&&!e('[name="terms"]').is(":checked"))},wc_stripe.CheckoutGateway.prototype.get_payment_method=function(){return e('[name="payment_method"]:checked').val()},wc_stripe.CheckoutGateway.prototype.set_use_new_option=function(t){e("#"+this.gateway_id+"_use_new").prop("checked",t).trigger("change")},wc_stripe.CheckoutGateway.prototype.checkout_place_order=function(){return this.is_valid_checkout()?!!this.is_saved_method_selected()||this.payment_token_received:(this.submit_error(this.params.messages.terms),!1)},wc_stripe.CheckoutGateway.prototype.on_token_received=function(t){this.payment_token_received=!0,e(this.token_selector).val(t.id),this.hide_payment_button(),this.show_place_order()},wc_stripe.CheckoutGateway.prototype.block=function(){e("form.checkout").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},wc_stripe.CheckoutGateway.prototype.unblock=function(){e("form.checkout").unblock()},wc_stripe.CheckoutGateway.prototype.hide_place_order=function(){e("#place_order").addClass("wc-stripe-hide")},wc_stripe.CheckoutGateway.prototype.show_place_order=function(){e("#place_order").removeClass("wc-stripe-hide")},wc_stripe.CheckoutGateway.prototype.on_show_new_methods=function(){this.payment_token_received?(this.show_place_order(),this.hide_payment_button()):(this.hide_place_order(),this.show_payment_button())},wc_stripe.CheckoutGateway.prototype.on_show_saved_methods=function(){this.hide_payment_button(),this.show_place_order()},wc_stripe.CheckoutGateway.prototype.show_payment_button=function(){this.$button&&this.$button.show()},wc_stripe.CheckoutGateway.prototype.hide_payment_button=function(){this.$button&&this.$button.hide()},wc_stripe.CheckoutGateway.prototype.trigger_payment_method_selected=function(){this.on_payment_method_selected(null,e('[name="payment_method"]:checked').val())},wc_stripe.CheckoutGateway.prototype.on_payment_method_selected=function(t,e){e===this.gateway_id?this.payment_token_received||this.is_saved_method_selected()?(this.hide_payment_button(),this.show_place_order()):(this.show_payment_button(),this.hide_place_order()):(this.hide_payment_button(),e.indexOf("stripe_")<0&&this.show_place_order())},wc_stripe.CheckoutGateway.prototype.banner_enabled=function(){return"1"===this.params.banner_enabled},wc_stripe.ProductGateway=function(){this.container="li.payment_method_"+this.gateway_id,this.message_container="div.product",e(document.body).on("wc_stripe_updated_rest_nonce",this.set_rest_nonce.bind(this)),e("form.cart").on("found_variation",this.found_variation.bind(this)),e("form.cart").on("reset_data",this.reset_variation_data.bind(this)),this.buttonWidth=e("div.quantity").outerWidth(!0)+e(".single_add_to_cart_button").outerWidth(),e(this.container).css("max-width",this.buttonWidth+"px")},wc_stripe.ProductGateway.prototype.get_quantity=function(){return parseInt(e('[name="quantity"]').val())},wc_stripe.ProductGateway.prototype.set_rest_nonce=function(t,e){this.params.rest_nonce=e},wc_stripe.ProductGateway.prototype.found_variation=function(t,e){var i=this.get_product_data();i.price=e.display_price,i.needs_shipping=!e.is_virtual,this.set_product_data(i),this.enable_payment_button()},wc_stripe.ProductGateway.prototype.reset_variation_data=function(){this.disable_payment_button()},wc_stripe.ProductGateway.prototype.disable_payment_button=function(){this.$button&&this.get_button().prop("disabled",!0).addClass("disabled")},wc_stripe.ProductGateway.prototype.enable_payment_button=function(){this.$button&&this.get_button().prop("disabled",!1).removeClass("disabled")},wc_stripe.ProductGateway.prototype.get_button=function(){return this.$button},wc_stripe.ProductGateway.prototype.is_variable_product=function(){return e('[name="variation_id"]').length>0},wc_stripe.ProductGateway.prototype.needs_shipping=function(){return this.get_product_data().needs_shipping},wc_stripe.ProductGateway.prototype.get_product_data=function(){return e("#wc_stripe_product_data").data("product")},wc_stripe.ProductGateway.prototype.set_product_data=function(t){e("#wc_stripe_product_data").data("product",t)},wc_stripe.ProductGateway.prototype.add_to_cart=function(){return new Promise(function(t,i){this.block(),e.ajax({url:this.params.routes.add_to_cart,method:"POST",dataType:"json",data:{product_id:e("#product_id").val(),variation_id:this.is_variable_product()?e('[name="variation_id"]').val():0,qty:e('[name="quantity"]').val(),payment_method:this.gateway_id},beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",this.params.rest_nonce)}.bind(this)}).done(function(a,n,s){this.unblock(),e(document.body).triggerHandler("wc_stripe_updated_rest_nonce",s.getResponseHeader("X-WP-Nonce")),a.code?(this.submit_error(a.message),i(a)):(this.set_total_price(a.data.total),this.set_total_price_cents(a.data.totalCents),this.set_display_items(a.data.displayItems),t(a.data))}.bind(this)).fail(function(t,e,i){this.unblock(),this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.CartGateway=function(){this.container="li.payment_method_"+this.gateway_id,this.message_container="div.woocommerce",e(document.body).on("updated_wc_div",this.updated_html.bind(this)),e(document.body).on("updated_cart_totals",this.updated_html.bind(this))},wc_stripe.CartGateway.prototype.needs_shipping=function(){return 1===e("#wc_stripe_needs_shipping").data("value")},wc_stripe.CartGateway.prototype.submit_error=function(t){this.submit_message(t)},wc_stripe.CartGateway.prototype.updated_html=function(t){},wc_stripe.GooglePay=function(){};const a={apiVersion:2,apiVersionMinor:0},n={type:"CARD",parameters:{allowedAuthMethods:["PAN_ONLY"],allowedCardNetworks:["AMEX","DISCOVER","INTERAC","JCB","MASTERCARD","VISA"]}};wc_stripe.GooglePay.prototype.address_mappings=function(t){return{name:{set:function(t,i){var a=t.split(" ");e(i+"_first_name").val(a[0]),e(i+"_last_name").val(a[1])},get:function(t){return e(t+"_first_name").val()+e(t+"_last_name").val()}},postalCode:{set:function(t,i){e(i+"_postcode").val(t)},get:function(t){return e(t+"_postcode").val()}},countryCode:{set:function(t,i){e(i+"_country").val(t)},get:function(t){return e(t+"_country").val()}},phoneNumber:{set:function(t,i){e("#billing_phone").val(t)},get:function(){return"#billing_phone".val()}},address1:{set:function(t,i){e(i+"_address_1").val(t)},get:function(t){return e(t+"_address_1").val()}},address2:{set:function(t,i){e(i+"_address_2").val(t)},get:function(t){return e(t+"_address_2").val()}},locality:{set:function(t,i){e(i+"_city").val(t)},get:function(t){return e(t+"_city").val()}},administrativeArea:{set:function(t,i){e(i+"_state").val(t)},get:function(t){return e(t+"_state").val()}}}},wc_stripe.GooglePay.prototype.populate_address_fields=function(t){var i=t.paymentMethodData.info.billingAddress,a=this.address_mappings();for(var n in i)a[n]&&a[n].set.call(this,i[n],"#billing");if(t.shippingAddress)for(var n in t.shippingAddress)a[n]&&a[n].set.call(this,t.shippingAddress[n],"#shipping");t.email&&e("#billing_email").val(t.email),this.maybe_set_ship_to_different(),e('[name="billing_country"]').trigger("change")},wc_stripe.GooglePay.prototype.map_address=function(t){return{city:t.locality,postcode:t.postalCode,state:t.administrativeArea,country:t.countryCode}},wc_stripe.GooglePay.prototype.update_payment_data=function(t){return new Promise(function(i,a){e.when(e.ajax({url:this.params.routes.payment_data,dataType:"json",method:"POST",data:{shipping_address:this.map_address(t.shippingAddress),shipping_methods:this.map_shipping_methods(t.shippingOptionData.id),shipping_method_id:t.shippingOptionData.id},beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",this.params.rest_nonce)}.bind(this)})).done(function(t){t.code?a(t.data.data):i(t.data)}.bind(this)).fail(function(){a()}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.on_payment_data_changed=function(t){return new Promise(function(e,i){this.update_payment_data(t).then(function(i){e(i.paymentRequestUpdate),this.set_selected_shipping_methods(i.shipping_methods),this.payment_data_updated(i,t)}.bind(this)).catch(function(t){e(t)}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.payment_data_updated=function(t){},wc_stripe.GooglePay.prototype.get_googlepay_display_items=function(){return e("#googlepay_display_items").data("items")},wc_stripe.GooglePay.prototype.set_googlepay_display_items=function(t){e("#googlepay_display_items").data("items",t)},wc_stripe.GooglePay.prototype.get_shipping_options=function(){return e("#googlepay_shipping_options").data("items")},wc_stripe.GooglePay.prototype.get_merchant_info=function(){return{merchantId:this.params.merchant_id,merchantName:this.params.merchant_name}},wc_stripe.GooglePay.prototype.get_payment_options=function(){var t={environment:this.params.environment,merchantInfo:this.get_merchant_info()};return this.needs_shipping()&&this.get_total_price_cents()>0?t.paymentDataCallbacks={onPaymentDataChanged:this.on_payment_data_changed.bind(this)}:t.paymentDataCallbacks={onPaymentAuthorized:function(t){return new Promise(function(t,e){t({transactionState:"SUCCESS"})}.bind(this))}},t},wc_stripe.GooglePay.prototype.build_payment_request=function(){var t=e.extend({},a,{emailRequired:!0,merchantInfo:this.get_merchant_info(),allowedPaymentMethods:[e.extend({type:"CARD",tokenizationSpecification:{type:"PAYMENT_GATEWAY",parameters:{gateway:"stripe","stripe:version":"2018-10-31","stripe:publishableKey":this.params.api_key}}},n)],shippingAddressRequired:this.needs_shipping()&&this.get_total_price_cents()>0,shippingOptionRequired:this.needs_shipping()&&this.get_total_price_cents()>0,transactionInfo:{currencyCode:this.get_currency(),totalPriceStatus:"ESTIMATED",totalPrice:this.get_total_price().toString(),displayItems:this.get_googlepay_display_items(),totalPriceLabel:this.params.total_price_label}});return t.allowedPaymentMethods[0].parameters.billingAddressRequired=!0,t.allowedPaymentMethods[0].parameters.billingAddressParameters={format:"FULL",phoneNumberRequired:e("#billing_phone").length>0},this.needs_shipping()&&this.get_total_price_cents()>0?(t.shippingAddressParameters={},t.shippingOptionParameters={shippingOptions:this.get_shipping_options()},t.callbackIntents=["SHIPPING_ADDRESS","SHIPPING_OPTION"]):t.callbackIntents=["PAYMENT_AUTHORIZATION"],t},wc_stripe.GooglePay.prototype.createPaymentsClient=function(){this.paymentsClient=new google.payments.api.PaymentsClient(this.get_payment_options())},wc_stripe.GooglePay.prototype.isReadyToPay=function(){return new Promise(function(t){var i=e.extend({},a);i.allowedPaymentMethods=[n],this.paymentsClient.isReadyToPay(i).then(function(){this.can_pay=!0,this.create_button(),t()}.bind(this)).catch(function(t){this.submit_error(t)}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.create_button=function(){this.$button&&this.$button.remove(),this.$button=e(this.paymentsClient.createButton({onClick:this.start.bind(this),buttonColor:this.params.button_color,buttonType:this.params.button_style})),this.$button.addClass("gpay-button-container")},wc_stripe.GooglePay.prototype.start=function(){this.createPaymentsClient(),this.paymentsClient.loadPaymentData(this.build_payment_request()).then(function(t){var e=JSON.parse(t.paymentMethodData.tokenizationData.token);this.populate_address_fields(t),this.on_token_received(e)}.bind(this)).catch(function(t){"CANCELED"!==t.statusCode&&(t.statusMessage&&t.statusMessage.indexOf("paymentDataRequest.callbackIntent")>-1?this.submit_error_code("DEVELOPER_ERROR_WHITELIST"):this.submit_error(t.statusMessage))}.bind(this))},wc_stripe.ApplePay=function(){},wc_stripe.ApplePay.prototype.initialize=function(){e(document.body).on("click",".apple-pay-button",this.start.bind(this)),this.createPaymentRequest(),this.canMakePayment()},wc_stripe.ApplePay.prototype.create_button=function(){this.$button&&this.$button.remove(),this.$button=e(this.params.button),this.append_button()},wc_stripe.ApplePay.prototype.canMakePayment=function(){return new Promise(function(t,i){this.paymentRequest.canMakePayment().then(function(i){i&&i.applePay&&(this.can_pay=!0,this.create_button(),e(this.container).show(),t(i))}.bind(this))}.bind(this))},wc_stripe.ApplePay.prototype.start=function(t){t.preventDefault(),this.paymentRequest.update(this.get_payment_request_update({total:{pending:!1}})),this.paymentRequest.show()},wc_stripe.PaymentRequest=function(){},wc_stripe.PaymentRequest.prototype.initialize=function(){this.createPaymentRequest(),this.canMakePayment(),this.paymentRequestButton=this.createPaymentRequestButton(),this.paymentRequestButton.on("click",this.button_click.bind(this))},wc_stripe.PaymentRequest.prototype.button_click=function(t){},wc_stripe.PaymentRequest.prototype.createPaymentRequestButton=function(){return this.elements.create("paymentRequestButton",{paymentRequest:this.paymentRequest,style:{paymentRequestButton:{type:this.params.button.type,theme:this.params.button.theme,height:this.params.button.height}}})},wc_stripe.PaymentRequest.prototype.canMakePayment=function(){return new Promise(function(t,i){this.paymentRequest.canMakePayment().then(function(i){i&&!i.applePay&&(this.can_pay=!0,this.create_button(),e(this.container).show(),t(i))}.bind(this))}.bind(this))},wc_stripe.PaymentRequest.prototype.create_button=function(){this.paymentRequestButton.mount("#wc-stripe-payment-request-container")}}(window,jQuery);
1
+ !function(t,e){t.wc_stripe={};var i=Stripe(wc_stripe_params.api_key);wc_stripe.BaseGateway=function(t){this.params=t,this.gateway_id=this.params.gateway_id,this.token_selector=this.params.token_selector,this.saved_method_selector=this.params.saved_method_selector,this.payment_intent_selector=this.params.payment_intent_selector,this.payment_token_received=!1,this.stripe=i,this.elements=i.elements(e.extend({},{locale:"auto"},this.get_element_options())),this.initialize()},wc_stripe.BaseGateway.prototype.set_nonce=function(t){e(this.token_selector).val(t)},wc_stripe.BaseGateway.prototype.get_element_options=function(){return{}},wc_stripe.BaseGateway.prototype.initialize=function(){},wc_stripe.BaseGateway.prototype.create_button=function(){},wc_stripe.BaseGateway.prototype.is_gateway_selected=function(){return e('[name="payment_method"]:checked').val()===this.gateway_id},wc_stripe.BaseGateway.prototype.is_saved_method_selected=function(){return this.is_gateway_selected()&&"saved"===e('[name="'+this.gateway_id+'_payment_type_key"]:checked').val()},wc_stripe.BaseGateway.prototype.has_checkout_error=function(){return e("#wc_stripe_checkout_error").length>0&&this.is_gateway_selected()},wc_stripe.BaseGateway.prototype.submit_error=function(t){-1==t.indexOf("</ul>")&&(t='<div class="woocommerce-error">'+t+"</div>"),this.submit_message(t)},wc_stripe.BaseGateway.prototype.submit_error_code=function(t){},wc_stripe.BaseGateway.prototype.submit_message=function(t){e(".woocommerce-error, .woocommerce-message, .woocommerce-info").remove();var i=e(this.message_container);i.closest("form").length&&(i=i.closest("form")),i.prepend(t),i.removeClass("processing").unblock(),i.find(".input-text, select, input:checkbox").blur(),e("html, body").animate({scrollTop:i.offset().top-100},1e3)},wc_stripe.BaseGateway.prototype.should_save_method=function(){return e("#"+this.gateway_id+"_save_source_key").is(":checked")},wc_stripe.BaseGateway.prototype.is_add_payment_method_page=function(){return e(document.body).hasClass("woocommerce-add-payment-method")},wc_stripe.BaseGateway.prototype.get_selected_payment_method=function(){return e(this.saved_method_selector).val()},wc_stripe.BaseGateway.prototype.needs_shipping=function(){return"1"===this.params.needs_shipping},wc_stripe.BaseGateway.prototype.get_currency=function(){return e("#wc_stripe_currency").val()},wc_stripe.BaseGateway.prototype.get_country=function(){return e("#wc_stripe_country").val()},wc_stripe.BaseGateway.prototype.get_customer_name=function(t){return e(t+"_first_name").val()+" "+e(t+"_last_name").val()},wc_stripe.BaseGateway.prototype.get_customer_email=function(){return e("#billing_email").val()},wc_stripe.BaseGateway.prototype.get_address_field_hash=function(t){for(var i=["_first_name","_last_name","_address_1","_address_2","_postcode","_city","_state","_country"],a="",n=0;n<i.length;n++)a+=e(t+i[n]).val()+"_";return a},wc_stripe.BaseGateway.prototype.block=function(){e.blockUI({message:null,overlayCSS:{background:"#fff",opacity:.6}})},wc_stripe.BaseGateway.prototype.unblock=function(){e.unblockUI()},wc_stripe.BaseGateway.prototype.get_form=function(){return e(this.token_selector).closest("form")},wc_stripe.BaseGateway.prototype.get_total_price=function(){return e("#wc_stripe_order_total").data("amount")},wc_stripe.BaseGateway.prototype.get_total_price_cents=function(){return e("#wc_stripe_order_total_cents").data("amount")},wc_stripe.BaseGateway.prototype.set_total_price=function(t){e("#wc_stripe_order_total").data("amount",t)},wc_stripe.BaseGateway.prototype.set_total_price_cents=function(t){e("#wc_stripe_order_total_cents").data("amount",t)},wc_stripe.BaseGateway.prototype.set_payment_method=function(t){e('[name="payment_method"][value="'+t+'"]').prop("checked",!0).trigger("click")},wc_stripe.BaseGateway.prototype.set_selected_shipping_methods=function(t){if(t&&e('[name^="shipping_method"]').length)for(var i in t){var a=t[i];e('[name="shipping_method['+i+']"][value="'+a+'"]').prop("checked",!0).trigger("change")}},wc_stripe.BaseGateway.prototype.on_token_received=function(t){this.payment_token_received=!0,e(this.token_selector).val(t.id),this.process_checkout()},wc_stripe.BaseGateway.prototype.createPaymentRequest=function(){this.paymentRequest=i.paymentRequest(this.get_payment_request_options()),this.needs_shipping()&&(this.paymentRequest.on("shippingaddresschange",this.update_shipping_address.bind(this)),this.paymentRequest.on("shippingoptionchange",this.update_shipping_method.bind(this))),this.paymentRequest.on("paymentmethod",this.on_payment_method_received.bind(this))},wc_stripe.BaseGateway.prototype.get_payment_request_options=function(){var t={country:this.params.country_code,currency:this.get_currency().toLowerCase(),total:{amount:this.get_total_price_cents(),label:this.params.total_label,pending:!0},requestPayerName:!0,requestPayerEmail:!0,requestPayerPhone:!0,requestShipping:this.needs_shipping()},e=this.get_display_items(),i=this.get_shipping_options();return e&&(t.displayItems=e),this.needs_shipping()&&i&&(t.shippingOptions=i),t},wc_stripe.BaseGateway.prototype.get_payment_request_update=function(t){var i={currency:this.get_currency().toLowerCase(),total:{amount:parseInt(this.get_total_price_cents()),label:this.params.total_label,pending:!0}},a=this.get_display_items(),n=this.get_shipping_options();return a&&(i.displayItems=a),this.needs_shipping()&&n&&(i.shippingOptions=n),t&&(i=e.extend(!0,{},i,t)),i},wc_stripe.BaseGateway.prototype.get_display_items=function(){return e("#wc_stripe_display_items").data("items")},wc_stripe.BaseGateway.prototype.set_display_items=function(t){e("#wc_stripe_display_items").data("items",t)},wc_stripe.BaseGateway.prototype.get_shipping_options=function(){return e("#wc_stripe_shipping_options").data("items")},wc_stripe.BaseGateway.prototype.set_shipping_options=function(t){e("#wc_stripe_shipping_options").data("items",t)},wc_stripe.BaseGateway.prototype.map_address=function(t){return{city:t.city,postcode:t.postalCode,state:t.region,country:t.country}},wc_stripe.BaseGateway.prototype.on_payment_method_received=function(e){try{this.payment_response=e,this.populate_checkout_fields(e),e.complete("success"),this.on_token_received(e.paymentMethod)}catch(e){t.alert(e)}},wc_stripe.BaseGateway.prototype.populate_checkout_fields=function(t){e(this.token_selector).val(t.paymentMethod.id),this.populate_address_fields(t)},wc_stripe.BaseGateway.prototype.populate_address_fields=function(t){var i=this.address_mappings();if(t.payerName&&i.payerName.set(t.payerName),t.payerEmail&&i.payerEmail.set(t.payerEmail),t.payerPhone&&i.payerPhone.set(t.payerPhone),t.shippingAddress){var a=t.shippingAddress;for(var n in a)i[n]&&i[n].set.call(this,a[n],"#shipping")}if(t.paymentMethod.billing_details.address){a=t.paymentMethod.billing_details.address;for(var n in a)i[n]&&i[n].set.call(this,a[n],"#billing")}this.maybe_set_ship_to_different(),e('[name="billing_country"]').trigger("change")},wc_stripe.BaseGateway.prototype.address_mappings=function(){return{payerName:{set:function(t,i){var a=t.split(" ");a.length>0&&e("#billing_first_name").val(a[0]),a.length>1&&e("#billing_last_name").val(a[1])},get:function(t){return e("#billing_first_name").val()+" "+e("#billing_last_name").val()}},payerEmail:{set:function(t){e("#billing_email").val(t)},get:function(){return e("#billing_email").val()}},payerPhone:{set:function(t){e("#billing_phone").val(t)},get:function(){return e("#billing_phone").val()}},recipient:{set:function(t,i){var a=t.split(" ");a.length>0&&e(i+"_first_name").val(a[0]),a.length>1&&e(i+"_last_name").val(a[1])},get:function(t){return e(t+"_first_name").val()+" "+e(t+"_last_name").val()}},country:{set:function(t,i){e(i+"_country").val(t)},get:function(t){return e(t+"_country").val()}},addressLine:{set:function(t,i){t.length>0&&e(i+"_address_1").val(t[0]),t.length>1&&e(i+"_address_2").val(t[1])},get:function(t){return[e(t+"_address_1").val(),e(t+"_address_2").val()]}},line1:{set:function(t,i){e(i+"_address_1").val(t)},get:function(t){return e(t+"_address_1").val()}},line2:{set:function(t,i){e(i+"_address_2").val(t)},get:function(t){return e(t+"_address_2").val()}},region:{set:function(t,i){e(i+"_state").val(t)},get:function(t){e(t+"_state").val()}},state:{set:function(t,i){e(i+"_state").val(t)},get:function(t){e(t+"_state").val()}},city:{set:function(t,i){e(i+"_city").val(t)},get:function(t){e(t+"_city").val()}},postalCode:{set:function(t,i){e(i+"_postcode").val(t)},get:function(t){e(t+"_postcode").val()}},postal_code:{set:function(t,i){e(i+"_postcode").val(t)},get:function(t){e(t+"_postcode").val()}}}},wc_stripe.BaseGateway.prototype.process_checkout=function(){return new Promise(function(i,a){this.block(),e.ajax({url:this.params.routes.checkout,method:"POST",dataType:"json",data:e.extend({},this.serialize_form(this.get_form()),{payment_method:this.gateway_id}),beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",this.params.rest_nonce)}.bind(this)}).done(function(e){e.reload?t.location.reload():"success"===e.result?t.location=e.redirect:(e.messages&&this.submit_error(e.messages),this.unblock())}.bind(this)).fail(function(t,e,i){this.unblock(),this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.BaseGateway.prototype.serialize_form=function(t){var i=t.find("input").filter(function(t,i){return!e(i).is('[name^="add-to-cart"]')}.bind(this)).serializeArray(),a={};for(var n in i){var s=i[n];a[s.name]=s.value}return a.payment_method=this.gateway_id,a},wc_stripe.BaseGateway.prototype.map_shipping_methods=function(t){var e={};if("default"!==t){var i=t.match(/^(\d):(.+)$/);i.length>1&&(e[i[1]]=i[2])}return e},wc_stripe.BaseGateway.prototype.maybe_set_ship_to_different=function(){e('[name="ship_to_different_address"]').length&&e('[name="ship_to_different_address"]').prop("checked",this.get_address_field_hash("#billing")!==this.get_address_field_hash("#shipping")).trigger("change")},wc_stripe.BaseGateway.prototype.update_shipping_address=function(t){return new Promise(function(i,a){e.ajax({url:this.params.routes.shipping_address,method:"POST",dataType:"json",data:{address:this.map_address(t.shippingAddress),payment_method:this.gateway_id},beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",this.params.rest_nonce)}.bind(this)}).done(function(e){e.code?(t.updateWith(e.data.newData),a(e.data)):(t.updateWith(e.data.newData),i(e.data))}.bind(this)).fail(function(t,e,i){}.bind(this))}.bind(this))},wc_stripe.BaseGateway.prototype.update_shipping_method=function(t){return new Promise(function(i,a){e.ajax({url:this.params.routes.shipping_method,method:"POST",dataType:"json",data:{shipping_methods:this.map_shipping_methods(t.shippingOption.id),payment_method:this.gateway_id},beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",this.params.rest_nonce)}.bind(this)}).done(function(e){e.code?(t.updateWith(e.data.newData),a(e.data)):(this.set_selected_shipping_methods(e.data.shipping_methods),t.updateWith(e.data.newData),i(e.data))}.bind(this)).fail(function(t,e,i){this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.CheckoutGateway=function(){this.container=this.message_container="li.payment_method_"+this.gateway_id,this.banner_container="li.banner_payment_method_"+this.gateway_id,e(document.body).on("updated_checkout",this.updated_checkout.bind(this)),e(document.body).on("checkout_error",this.checkout_error.bind(this)),e(this.token_selector).closest("form").on("checkout_place_order_"+this.gateway_id,this.checkout_place_order.bind(this)),e(document.body).on("wc_stripe_new_method_"+this.gateway_id,this.on_show_new_methods.bind(this)),e(document.body).on("wc_stripe_saved_method_"+this.gateway_id,this.on_show_saved_methods.bind(this)),e(document.body).on("wc_stripe_payment_method_selected",this.on_payment_method_selected.bind(this)),this.banner_enabled()&&e(".woocommerce-billing-fields").length&&e(this.banner_container).css("max-width",e(".woocommerce-billing-fields").outerWidth(!0)),this.order_review()},wc_stripe.CheckoutGateway.prototype.order_review=function(){var e=t.location.href.match(/order_review.+payment_method=([\w]+).+payment_nonce=(.+)/);if(e&&e.length>1){var i=e[1],a=e[2];this.gateway_id===i&&(this.payment_token_received=!0,this.set_nonce(a),this.set_use_new_option(!0))}},wc_stripe.CheckoutGateway.prototype.updated_checkout=function(){},wc_stripe.CheckoutGateway.prototype.checkout_error=function(){this.has_checkout_error()&&(this.payment_token_received=!1,this.payment_response=null,this.show_payment_button(),this.hide_place_order())},wc_stripe.CheckoutGateway.prototype.is_valid_checkout=function(){return!(e('[name="terms"]').length&&!e('[name="terms"]').is(":checked"))},wc_stripe.CheckoutGateway.prototype.get_payment_method=function(){return e('[name="payment_method"]:checked').val()},wc_stripe.CheckoutGateway.prototype.set_use_new_option=function(t){e("#"+this.gateway_id+"_use_new").prop("checked",t).trigger("change")},wc_stripe.CheckoutGateway.prototype.checkout_place_order=function(){return this.is_valid_checkout()?!!this.is_saved_method_selected()||this.payment_token_received:(this.submit_error(this.params.messages.terms),!1)},wc_stripe.CheckoutGateway.prototype.on_token_received=function(t){this.payment_token_received=!0,e(this.token_selector).val(t.id),this.hide_payment_button(),this.show_place_order()},wc_stripe.CheckoutGateway.prototype.block=function(){e("form.checkout").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},wc_stripe.CheckoutGateway.prototype.unblock=function(){e("form.checkout").unblock()},wc_stripe.CheckoutGateway.prototype.hide_place_order=function(){e("#place_order").addClass("wc-stripe-hide")},wc_stripe.CheckoutGateway.prototype.show_place_order=function(){e("#place_order").removeClass("wc-stripe-hide")},wc_stripe.CheckoutGateway.prototype.on_show_new_methods=function(){this.payment_token_received?(this.show_place_order(),this.hide_payment_button()):(this.hide_place_order(),this.show_payment_button())},wc_stripe.CheckoutGateway.prototype.on_show_saved_methods=function(){this.hide_payment_button(),this.show_place_order()},wc_stripe.CheckoutGateway.prototype.show_payment_button=function(){this.$button&&this.$button.show()},wc_stripe.CheckoutGateway.prototype.hide_payment_button=function(){this.$button&&this.$button.hide()},wc_stripe.CheckoutGateway.prototype.trigger_payment_method_selected=function(){this.on_payment_method_selected(null,e('[name="payment_method"]:checked').val())},wc_stripe.CheckoutGateway.prototype.on_payment_method_selected=function(t,e){e===this.gateway_id?this.payment_token_received||this.is_saved_method_selected()?(this.hide_payment_button(),this.show_place_order()):(this.show_payment_button(),this.hide_place_order()):(this.hide_payment_button(),e.indexOf("stripe_")<0&&this.show_place_order())},wc_stripe.CheckoutGateway.prototype.banner_enabled=function(){return"1"===this.params.banner_enabled},wc_stripe.ProductGateway=function(){this.container="li.payment_method_"+this.gateway_id,this.message_container="div.product",e(document.body).on("wc_stripe_updated_rest_nonce",this.set_rest_nonce.bind(this)),e("form.cart").on("found_variation",this.found_variation.bind(this)),e("form.cart").on("reset_data",this.reset_variation_data.bind(this)),this.buttonWidth=e("div.quantity").outerWidth(!0)+e(".single_add_to_cart_button").outerWidth(),e(this.container).css("max-width",this.buttonWidth+"px")},wc_stripe.ProductGateway.prototype.get_quantity=function(){return parseInt(e('[name="quantity"]').val())},wc_stripe.ProductGateway.prototype.set_rest_nonce=function(t,e){this.params.rest_nonce=e},wc_stripe.ProductGateway.prototype.found_variation=function(t,e){var i=this.get_product_data();i.price=e.display_price,i.needs_shipping=!e.is_virtual,this.set_product_data(i),this.enable_payment_button()},wc_stripe.ProductGateway.prototype.reset_variation_data=function(){this.disable_payment_button()},wc_stripe.ProductGateway.prototype.disable_payment_button=function(){this.$button&&this.get_button().prop("disabled",!0).addClass("disabled")},wc_stripe.ProductGateway.prototype.enable_payment_button=function(){this.$button&&this.get_button().prop("disabled",!1).removeClass("disabled")},wc_stripe.ProductGateway.prototype.get_button=function(){return this.$button},wc_stripe.ProductGateway.prototype.is_variable_product=function(){return e('[name="variation_id"]').length>0},wc_stripe.ProductGateway.prototype.needs_shipping=function(){return this.get_product_data().needs_shipping},wc_stripe.ProductGateway.prototype.get_product_data=function(){return e("#wc_stripe_product_data").data("product")},wc_stripe.ProductGateway.prototype.set_product_data=function(t){e("#wc_stripe_product_data").data("product",t)},wc_stripe.ProductGateway.prototype.add_to_cart=function(){return new Promise(function(t,i){this.block(),e.ajax({url:this.params.routes.add_to_cart,method:"POST",dataType:"json",data:{product_id:e("#product_id").val(),variation_id:this.is_variable_product()?e('[name="variation_id"]').val():0,qty:e('[name="quantity"]').val(),payment_method:this.gateway_id},beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",this.params.rest_nonce)}.bind(this)}).done(function(a,n,s){this.unblock(),e(document.body).triggerHandler("wc_stripe_updated_rest_nonce",s.getResponseHeader("X-WP-Nonce")),a.code?(this.submit_error(a.message),i(a)):(this.set_total_price(a.data.total),this.set_total_price_cents(a.data.totalCents),this.set_display_items(a.data.displayItems),t(a.data))}.bind(this)).fail(function(t,e,i){this.unblock(),this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.CartGateway=function(){this.container="li.payment_method_"+this.gateway_id,this.message_container="div.woocommerce",e(document.body).on("updated_wc_div",this.updated_html.bind(this)),e(document.body).on("updated_cart_totals",this.updated_html.bind(this))},wc_stripe.CartGateway.prototype.needs_shipping=function(){return 1===e("#wc_stripe_needs_shipping").data("value")},wc_stripe.CartGateway.prototype.submit_error=function(t){this.submit_message(t)},wc_stripe.CartGateway.prototype.updated_html=function(t){},wc_stripe.GooglePay=function(){};const a={apiVersion:2,apiVersionMinor:0},n={type:"CARD",parameters:{allowedAuthMethods:["PAN_ONLY"],allowedCardNetworks:["AMEX","DISCOVER","INTERAC","JCB","MASTERCARD","VISA"]}};wc_stripe.GooglePay.prototype.address_mappings=function(t){return{name:{set:function(t,i){var a=t.split(" ");e(i+"_first_name").val(a[0]),e(i+"_last_name").val(a[1])},get:function(t){return e(t+"_first_name").val()+e(t+"_last_name").val()}},postalCode:{set:function(t,i){e(i+"_postcode").val(t)},get:function(t){return e(t+"_postcode").val()}},countryCode:{set:function(t,i){e(i+"_country").val(t)},get:function(t){return e(t+"_country").val()}},phoneNumber:{set:function(t,i){e("#billing_phone").val(t)},get:function(){return"#billing_phone".val()}},address1:{set:function(t,i){e(i+"_address_1").val(t)},get:function(t){return e(t+"_address_1").val()}},address2:{set:function(t,i){e(i+"_address_2").val(t)},get:function(t){return e(t+"_address_2").val()}},locality:{set:function(t,i){e(i+"_city").val(t)},get:function(t){return e(t+"_city").val()}},administrativeArea:{set:function(t,i){e(i+"_state").val(t)},get:function(t){return e(t+"_state").val()}}}},wc_stripe.GooglePay.prototype.serialize_form=function(t){return e.extend({},wc_stripe.BaseGateway.prototype.serialize_form.apply(this,arguments),{order_review:!this.dynamic_price_enabled()})},wc_stripe.GooglePay.prototype.populate_address_fields=function(t){var i=t.paymentMethodData.info.billingAddress,a=this.address_mappings();for(var n in i)a[n]&&a[n].set.call(this,i[n],"#billing");if(t.shippingAddress)for(var n in t.shippingAddress)a[n]&&a[n].set.call(this,t.shippingAddress[n],"#shipping");t.email&&e("#billing_email").val(t.email),this.maybe_set_ship_to_different(),e('[name="billing_country"]').trigger("change")},wc_stripe.GooglePay.prototype.map_address=function(t){return{city:t.locality,postcode:t.postalCode,state:t.administrativeArea,country:t.countryCode}},wc_stripe.GooglePay.prototype.update_payment_data=function(t){return new Promise(function(i,a){e.when(e.ajax({url:this.params.routes.payment_data,dataType:"json",method:"POST",data:{shipping_address:this.map_address(t.shippingAddress),shipping_methods:this.map_shipping_methods(t.shippingOptionData.id),shipping_method_id:t.shippingOptionData.id},beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",this.params.rest_nonce)}.bind(this)})).done(function(t){t.code?a(t.data.data):i(t.data)}.bind(this)).fail(function(){a()}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.on_payment_data_changed=function(t){return new Promise(function(e,i){this.update_payment_data(t).then(function(i){e(i.paymentRequestUpdate),this.set_selected_shipping_methods(i.shipping_methods),this.payment_data_updated(i,t)}.bind(this)).catch(function(t){e(t)}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.payment_data_updated=function(t){},wc_stripe.GooglePay.prototype.get_googlepay_display_items=function(){return e("#googlepay_display_items").data("items")},wc_stripe.GooglePay.prototype.set_googlepay_display_items=function(t){e("#googlepay_display_items").data("items",t)},wc_stripe.GooglePay.prototype.get_shipping_options=function(){return e("#googlepay_shipping_options").data("items")},wc_stripe.GooglePay.prototype.get_merchant_info=function(){var t={merchantId:this.params.merchant_id,merchantName:this.params.merchant_name};return"TEST"===this.params.environment&&delete t.merchantId,t},wc_stripe.GooglePay.prototype.dynamic_price_enabled=function(){return"1"===this.params.dynamic_price},wc_stripe.GooglePay.prototype.get_payment_options=function(){var t={environment:this.params.environment,merchantInfo:this.get_merchant_info()};return this.dynamic_price_enabled()&&(this.needs_shipping()&&this.get_total_price_cents()>0?t.paymentDataCallbacks={onPaymentDataChanged:this.on_payment_data_changed.bind(this),onPaymentAuthorized:function(t){return new Promise(function(t,e){t({transactionState:"SUCCESS"})}.bind(this))}.bind(this)}:t.paymentDataCallbacks={onPaymentAuthorized:function(t){return new Promise(function(t,e){t({transactionState:"SUCCESS"})}.bind(this))}}),t},wc_stripe.GooglePay.prototype.build_payment_request=function(){var t=e.extend({},a,{emailRequired:!0,merchantInfo:this.get_merchant_info(),allowedPaymentMethods:[e.extend({type:"CARD",tokenizationSpecification:{type:"PAYMENT_GATEWAY",parameters:{gateway:"stripe","stripe:version":"2018-10-31","stripe:publishableKey":this.params.api_key}}},n)],shippingAddressRequired:this.needs_shipping()&&this.get_total_price_cents()>0,transactionInfo:{currencyCode:this.get_currency(),totalPriceStatus:"ESTIMATED",totalPrice:this.get_total_price().toString(),displayItems:this.get_googlepay_display_items(),totalPriceLabel:this.params.total_price_label}});return t.allowedPaymentMethods[0].parameters.billingAddressRequired=!0,t.allowedPaymentMethods[0].parameters.billingAddressParameters={format:"FULL",phoneNumberRequired:e("#billing_phone").length>0},this.dynamic_price_enabled()&&(this.needs_shipping()&&this.get_total_price_cents()>0?(t.shippingAddressParameters={},t.shippingOptionRequired=!0,t.shippingOptionParameters={shippingOptions:this.get_shipping_options()},t.callbackIntents=["SHIPPING_ADDRESS","SHIPPING_OPTION","PAYMENT_AUTHORIZATION"]):t.callbackIntents=["PAYMENT_AUTHORIZATION"]),t},wc_stripe.GooglePay.prototype.createPaymentsClient=function(){this.paymentsClient=new google.payments.api.PaymentsClient(this.get_payment_options())},wc_stripe.GooglePay.prototype.isReadyToPay=function(){return new Promise(function(t){var i=e.extend({},a);i.allowedPaymentMethods=[n],this.paymentsClient.isReadyToPay(i).then(function(){this.can_pay=!0,this.create_button(),t()}.bind(this)).catch(function(t){this.submit_error(t)}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.create_button=function(){this.$button&&this.$button.remove(),this.$button=e(this.paymentsClient.createButton({onClick:this.start.bind(this),buttonColor:this.params.button_color,buttonType:this.params.button_style})),this.$button.addClass("gpay-button-container")},wc_stripe.GooglePay.prototype.start=function(){this.createPaymentsClient(),this.paymentsClient.loadPaymentData(this.build_payment_request()).then(function(t){var e=JSON.parse(t.paymentMethodData.tokenizationData.token);this.populate_address_fields(t),this.on_token_received(e)}.bind(this)).catch(function(t){"CANCELED"!==t.statusCode&&(t.statusMessage&&t.statusMessage.indexOf("paymentDataRequest.callbackIntent")>-1?this.submit_error_code("DEVELOPER_ERROR_WHITELIST"):this.submit_error(t.statusMessage))}.bind(this))},wc_stripe.ApplePay=function(){},wc_stripe.ApplePay.prototype.initialize=function(){e(document.body).on("click",".apple-pay-button",this.start.bind(this)),this.createPaymentRequest(),this.canMakePayment()},wc_stripe.ApplePay.prototype.create_button=function(){this.$button&&this.$button.remove(),this.$button=e(this.params.button),this.append_button()},wc_stripe.ApplePay.prototype.canMakePayment=function(){return new Promise(function(t,i){this.paymentRequest.canMakePayment().then(function(i){i&&i.applePay&&(this.can_pay=!0,this.create_button(),e(this.container).show(),t(i))}.bind(this))}.bind(this))},wc_stripe.ApplePay.prototype.start=function(t){t.preventDefault(),this.paymentRequest.update(this.get_payment_request_update({total:{pending:!1}})),this.paymentRequest.show()},wc_stripe.PaymentRequest=function(){},wc_stripe.PaymentRequest.prototype.initialize=function(){this.createPaymentRequest(),this.canMakePayment(),this.paymentRequestButton=this.createPaymentRequestButton(),this.paymentRequestButton.on("click",this.button_click.bind(this))},wc_stripe.PaymentRequest.prototype.button_click=function(t){},wc_stripe.PaymentRequest.prototype.createPaymentRequestButton=function(){return this.elements.create("paymentRequestButton",{paymentRequest:this.paymentRequest,style:{paymentRequestButton:{type:this.params.button.type,theme:this.params.button.theme,height:this.params.button.height}}})},wc_stripe.PaymentRequest.prototype.canMakePayment=function(){return new Promise(function(t,i){this.paymentRequest.canMakePayment().then(function(i){i&&!i.applePay&&(this.can_pay=!0,this.create_button(),e(this.container).show(),t(i))}.bind(this))}.bind(this))},wc_stripe.PaymentRequest.prototype.create_button=function(){this.paymentRequestButton.mount("#wc-stripe-payment-request-container")}}(window,jQuery);
i18n/languages/{woo-stripe.pot → woo-stripe-payment.pot} RENAMED
@@ -1,8 +1,8 @@
1
  #, fuzzy
2
  msgid ""
3
  msgstr ""
4
- "Project-Id-Version: woo-stripe\n"
5
- "POT-Creation-Date: 2019-08-23 12:35-0700\n"
6
  "PO-Revision-Date: 2019-08-16 14:27-0700\n"
7
  "Last-Translator: \n"
8
  "Language-Team: \n"
@@ -18,68 +18,82 @@ 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:60
22
  #, php-format
23
  msgid "Error processing payment. Reason: %s"
24
  msgstr ""
25
 
26
- #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:61
27
  #, php-format
28
  msgid "Error processing payment. Reason: %s. Code: %s"
29
  msgstr ""
30
 
31
- #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:72
32
  #, php-format
33
  msgid "Order charge successful in Stripe. Charge: %s. Payment Method: %s"
34
  msgstr ""
35
 
36
- #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:116
37
- #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:188
38
  #, php-format
39
  msgid "Order amount captured in Stripe. Amount: %s"
40
  msgstr ""
41
 
42
- #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:120
43
- #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:192
44
  #, php-format
45
  msgid "Error capturing charge in Stripe. Reason: %s"
46
  msgstr ""
47
 
48
- #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:132
49
- #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:202
50
  #, php-format
51
  msgid "Error voiding charge. Reason: %s"
52
  msgstr ""
53
 
54
- #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:134
55
- #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:204
56
  msgid "Charge voided in Stripe."
57
  msgstr ""
58
 
59
- #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:159
60
  #, php-format
61
  msgid ""
62
  "Recurring payment for subscription failed. Reason: %s. Payment method: %s"
63
  msgstr ""
64
 
65
- #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:163
66
- #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:235
67
  #, php-format
68
  msgid "Recurring payment captured in Stripe. Payment method: %s"
69
  msgstr ""
70
 
71
- #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:165
72
- #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:237
 
 
73
  #, php-format
74
  msgid "Recurring payment authorized in Stripe. Payment method: %s"
75
  msgstr ""
76
 
77
- #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:177
78
- #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:269
79
  #, php-format
80
  msgid "Error deleting Stripe card. Token Id: %s"
81
  msgstr ""
82
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:76
84
  #, php-format
85
  msgid "Error creating payment source. Reason: %s"
@@ -100,39 +114,45 @@ msgstr ""
100
  msgid "& billing country is <strong>%s</strong>"
101
  msgstr ""
102
 
103
- #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:82
104
  #, php-format
105
  msgid "Order %s successful in Stripe. Charge: %s. Payment Method: %s"
106
  msgstr ""
107
 
108
- #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:82
109
  msgid "charge"
110
  msgstr ""
111
 
112
- #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:82
113
  msgid "authorization"
114
  msgstr ""
115
 
116
- #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:110
117
  msgid "A new payment method is required."
118
  msgstr ""
119
 
120
- #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:224
121
  #, php-format
122
  msgid "Recurring payment for order failed. Reason: %s"
123
  msgstr ""
124
 
125
- #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:241
 
126
  #, php-format
127
  msgid "Customer must manually complete payment for payment method %s"
128
  msgstr ""
129
 
130
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:289
 
 
 
 
 
131
  msgid ""
132
  "Please read and accept the terms and conditions to proceed with your order."
133
  msgstr ""
134
 
135
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:302
136
  #: includes/controllers/class-wc-stripe-controller-cart.php:99
137
  #: includes/controllers/class-wc-stripe-controller-cart.php:139
138
  #: includes/controllers/class-wc-stripe-controller-googlepay.php:116
@@ -140,61 +160,61 @@ msgstr ""
140
  msgid "Total"
141
  msgstr ""
142
 
143
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:360
144
  #, php-format
145
  msgid "Error saving your payment method. Reason: %s"
146
  msgstr ""
147
 
148
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:371
149
  #, php-format
150
  msgid "Error saving payment method. Reason: %s"
151
  msgstr ""
152
 
153
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:383
154
  msgid "Transaction Id cannot be empty."
155
  msgstr ""
156
 
157
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:390
158
  #, php-format
159
  msgid "Order refunded in Stripe. Amount: %s"
160
  msgstr ""
161
 
162
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:575
163
  #: includes/admin/meta-boxes/views/html-order-pay.php:42
164
  msgid "New Card"
165
  msgstr ""
166
 
167
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:579
168
  #: includes/admin/meta-boxes/views/html-order-pay.php:30
169
  msgid "Saved Cards"
170
  msgstr ""
171
 
172
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:777
173
  #, php-format
174
  msgid "Attemp to save payment method failed. Reason: %s"
175
  msgstr ""
176
 
177
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:797
178
  msgid ""
179
  "We were not able to save your payment method. To prevent billing issues with "
180
  "your subscription, please add a payment method to the subscription."
181
  msgstr ""
182
 
183
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:799
184
  #, php-format
185
  msgid "We were not able to save your payment method. Reason: %s"
186
  msgstr ""
187
 
188
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:831
189
  msgid "Payment Method Token"
190
  msgstr ""
191
 
192
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:857
193
  #, php-format
194
  msgid "Error saving payment method for subscription. Reason: %s"
195
  msgstr ""
196
 
197
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:906
198
  #, php-format
199
  msgid "Order %s from %s"
200
  msgstr ""
@@ -239,7 +259,7 @@ msgstr ""
239
  #: includes/admin/meta-boxes/views/html-order-pay.php:23
240
  #: includes/gateways/settings/applepay-settings.php:41
241
  #: includes/gateways/settings/cc-settings.php:41
242
- #: includes/gateways/settings/googlepay-settings.php:49
243
  #: includes/gateways/settings/payment-request-settings.php:42
244
  msgid "Capture"
245
  msgstr ""
@@ -297,7 +317,7 @@ msgstr ""
297
  #: includes/gateways/class-wc-payment-gateway-stripe-wechat.php:46
298
  #: includes/gateways/settings/applepay-settings.php:16
299
  #: includes/gateways/settings/cc-settings.php:16
300
- #: includes/gateways/settings/googlepay-settings.php:24
301
  #: includes/gateways/settings/payment-request-settings.php:17
302
  msgid "Title"
303
  msgstr ""
@@ -367,7 +387,7 @@ msgstr ""
367
  #: includes/admin/meta-boxes/views/html-order-pay.php:21
368
  #: includes/gateways/settings/applepay-settings.php:37
369
  #: includes/gateways/settings/cc-settings.php:37
370
- #: includes/gateways/settings/googlepay-settings.php:45
371
  #: includes/gateways/settings/payment-request-settings.php:38
372
  msgid "Charge Type"
373
  msgstr ""
@@ -375,7 +395,7 @@ msgstr ""
375
  #: includes/admin/meta-boxes/views/html-order-pay.php:24
376
  #: includes/gateways/settings/applepay-settings.php:42
377
  #: includes/gateways/settings/cc-settings.php:42
378
- #: includes/gateways/settings/googlepay-settings.php:50
379
  #: includes/gateways/settings/payment-request-settings.php:43
380
  msgid "Authorize"
381
  msgstr ""
@@ -564,13 +584,17 @@ msgstr ""
564
  msgid "Quantity must be greater than zero."
565
  msgstr ""
566
 
567
- #: includes/controllers/class-wc-stripe-controller-checkout.php:118
568
  #, php-format
569
  msgid ""
570
  "Some required fields were missing. Please click %shere%s to complete your "
571
  "payment."
572
  msgstr ""
573
 
 
 
 
 
574
  #: includes/controllers/class-wc-stripe-controller-gateway-settings.php:54
575
  msgid ""
576
  "You cannot register your domain until you have configured your Live API keys."
@@ -713,7 +737,7 @@ msgstr ""
713
  #: includes/gateways/class-wc-payment-gateway-stripe-wechat.php:52
714
  #: includes/gateways/settings/applepay-settings.php:22
715
  #: includes/gateways/settings/cc-settings.php:22
716
- #: includes/gateways/settings/googlepay-settings.php:30
717
  #: includes/gateways/settings/payment-request-settings.php:23
718
  msgid "Description"
719
  msgstr ""
@@ -729,7 +753,7 @@ msgstr ""
729
  #: includes/gateways/class-wc-payment-gateway-stripe-wechat.php:54
730
  #: includes/gateways/settings/applepay-settings.php:24
731
  #: includes/gateways/settings/cc-settings.php:24
732
- #: includes/gateways/settings/googlepay-settings.php:32
733
  #: includes/gateways/settings/payment-request-settings.php:25
734
  msgid "Leave blank if you don't want a description to show for the gateway."
735
  msgstr ""
@@ -754,7 +778,7 @@ msgid "Title of the Giropay gateway"
754
  msgstr ""
755
 
756
  #: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:16
757
- #: includes/gateways/settings/googlepay-settings.php:25
758
  msgid "Google Pay"
759
  msgstr ""
760
 
@@ -770,27 +794,27 @@ msgstr ""
770
  msgid "Please update you product quantity before using Google Pay."
771
  msgstr ""
772
 
773
- #: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:86
774
  #: includes/wc-stripe-functions.php:358
775
  msgid "Subscription"
776
  msgstr ""
777
 
778
- #: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:106
779
  #: includes/wc-stripe-functions.php:344
780
  msgid "Shipping"
781
  msgstr ""
782
 
783
- #: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:113
784
  #: includes/wc-stripe-functions.php:351
785
  msgid "Tax"
786
  msgstr ""
787
 
788
- #: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:144
789
  #: includes/wc-stripe-functions.php:409
790
  msgid "Waiting..."
791
  msgstr ""
792
 
793
- #: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:145
794
  #: includes/wc-stripe-functions.php:410
795
  msgid "loading shipping methods..."
796
  msgstr ""
@@ -967,21 +991,21 @@ msgstr ""
967
 
968
  #: includes/gateways/settings/applepay-settings.php:19
969
  #: includes/gateways/settings/cc-settings.php:19
970
- #: includes/gateways/settings/googlepay-settings.php:27
971
  #: includes/gateways/settings/payment-request-settings.php:20
972
  msgid "Title of the credit card gateway"
973
  msgstr ""
974
 
975
  #: includes/gateways/settings/applepay-settings.php:28
976
  #: includes/gateways/settings/cc-settings.php:28
977
- #: includes/gateways/settings/googlepay-settings.php:36
978
  #: includes/gateways/settings/payment-request-settings.php:29
979
  msgid "Credit Card Display"
980
  msgstr ""
981
 
982
  #: includes/gateways/settings/applepay-settings.php:34
983
  #: includes/gateways/settings/cc-settings.php:34
984
- #: includes/gateways/settings/googlepay-settings.php:42
985
  #: includes/gateways/settings/payment-request-settings.php:35
986
  msgid ""
987
  "This option allows you to customize how the credit card will display for "
@@ -997,25 +1021,25 @@ msgid ""
997
  msgstr ""
998
 
999
  #: includes/gateways/settings/applepay-settings.php:48
1000
- #: includes/gateways/settings/googlepay-settings.php:56
1001
  #: includes/gateways/settings/payment-request-settings.php:49
1002
  msgid "Payment Sections"
1003
  msgstr ""
1004
 
1005
  #: includes/gateways/settings/applepay-settings.php:51
1006
- #: includes/gateways/settings/googlepay-settings.php:59
1007
  #: includes/gateways/settings/payment-request-settings.php:52
1008
  msgid "Product Page"
1009
  msgstr ""
1010
 
1011
  #: includes/gateways/settings/applepay-settings.php:52
1012
- #: includes/gateways/settings/googlepay-settings.php:60
1013
  #: includes/gateways/settings/payment-request-settings.php:53
1014
  msgid "Cart Page"
1015
  msgstr ""
1016
 
1017
  #: includes/gateways/settings/applepay-settings.php:53
1018
- #: includes/gateways/settings/googlepay-settings.php:61
1019
  #: includes/gateways/settings/payment-request-settings.php:54
1020
  msgid "Top of Checkout"
1021
  msgstr ""
@@ -1029,21 +1053,21 @@ msgstr ""
1029
 
1030
  #: includes/gateways/settings/applepay-settings.php:59
1031
  #: includes/gateways/settings/cc-settings.php:47
1032
- #: includes/gateways/settings/googlepay-settings.php:67
1033
  #: includes/gateways/settings/payment-request-settings.php:74
1034
  msgid "Order Status"
1035
  msgstr ""
1036
 
1037
  #: includes/gateways/settings/applepay-settings.php:63
1038
  #: includes/gateways/settings/cc-settings.php:51
1039
- #: includes/gateways/settings/googlepay-settings.php:71
1040
  #: includes/gateways/settings/payment-request-settings.php:78
1041
  msgid "Default"
1042
  msgstr ""
1043
 
1044
  #: includes/gateways/settings/applepay-settings.php:66
1045
  #: includes/gateways/settings/cc-settings.php:54
1046
- #: includes/gateways/settings/googlepay-settings.php:74
1047
  #: includes/gateways/settings/payment-request-settings.php:81
1048
  msgid ""
1049
  "This is the status of the order once payment is complete. If <b>Default</b> "
@@ -1060,7 +1084,7 @@ msgid "Button Settings"
1060
  msgstr ""
1061
 
1062
  #: includes/gateways/settings/applepay-settings.php:86
1063
- #: includes/gateways/settings/googlepay-settings.php:140
1064
  msgid "Button Design"
1065
  msgstr ""
1066
 
@@ -1238,91 +1262,101 @@ msgid "If enabled, your site can accept Google Pay payments through Stripe."
1238
  msgstr ""
1239
 
1240
  #: includes/gateways/settings/googlepay-settings.php:19
 
 
 
 
 
 
 
 
 
 
1241
  msgid "Merchant ID"
1242
  msgstr ""
1243
 
1244
- #: includes/gateways/settings/googlepay-settings.php:21
1245
  msgid ""
1246
  "Your Google Merchant ID is given to you by the Google API team once you "
1247
  "register for Google Pay. While testing in TEST mode you can leave this value "
1248
  "blank and Google Pay will work."
1249
  msgstr ""
1250
 
1251
- #: includes/gateways/settings/googlepay-settings.php:52
1252
  msgid ""
1253
  "This option determines whether the customer's funds are capture immediately "
1254
  "or authorized and can be captured at a later date."
1255
  msgstr ""
1256
 
1257
- #: includes/gateways/settings/googlepay-settings.php:64
1258
  msgid ""
1259
  "Increase your conversion rate by offering Google Pay on your Product and "
1260
  "Cart pages, or at the top of the checkout page."
1261
  msgstr ""
1262
 
1263
- #: includes/gateways/settings/googlepay-settings.php:77
1264
  msgid "Merchant Name"
1265
  msgstr ""
1266
 
1267
- #: includes/gateways/settings/googlepay-settings.php:79
1268
  msgid ""
1269
  "The name of your business as it appears on the Google Pay payment sheet."
1270
  msgstr ""
1271
 
1272
- #: includes/gateways/settings/googlepay-settings.php:83
1273
  msgid "Icon"
1274
  msgstr ""
1275
 
1276
- #: includes/gateways/settings/googlepay-settings.php:86
1277
  msgid "With Outline"
1278
  msgstr ""
1279
 
1280
- #: includes/gateways/settings/googlepay-settings.php:87
1281
  msgid "Standard"
1282
  msgstr ""
1283
 
1284
- #: includes/gateways/settings/googlepay-settings.php:90
1285
  msgid ""
1286
  "This is the icon style that appears next to the gateway on the checkout page."
1287
  msgstr ""
1288
 
1289
- #: includes/gateways/settings/googlepay-settings.php:117
1290
  msgid "Button Options"
1291
  msgstr ""
1292
 
1293
- #: includes/gateways/settings/googlepay-settings.php:120
1294
  msgid "Button Color"
1295
  msgstr ""
1296
 
1297
- #: includes/gateways/settings/googlepay-settings.php:124
1298
  msgid "Black"
1299
  msgstr ""
1300
 
1301
- #: includes/gateways/settings/googlepay-settings.php:125
1302
  msgid "White"
1303
  msgstr ""
1304
 
1305
- #: includes/gateways/settings/googlepay-settings.php:127
1306
  msgid "The button color of the GPay button."
1307
  msgstr ""
1308
 
1309
- #: includes/gateways/settings/googlepay-settings.php:130
1310
  msgid "Button Style"
1311
  msgstr ""
1312
 
1313
- #: includes/gateways/settings/googlepay-settings.php:134
1314
  msgid "Long"
1315
  msgstr ""
1316
 
1317
- #: includes/gateways/settings/googlepay-settings.php:135
1318
  msgid "Short"
1319
  msgstr ""
1320
 
1321
- #: includes/gateways/settings/googlepay-settings.php:137
1322
  msgid "The button style of the GPay button."
1323
  msgstr ""
1324
 
1325
- #: includes/gateways/settings/googlepay-settings.php:142
1326
  msgid ""
1327
  "If you can't see the Google Pay button, try switching to a Chrome browser."
1328
  msgstr ""
1
  #, fuzzy
2
  msgid ""
3
  msgstr ""
4
+ "Project-Id-Version: woo-stripe-payment\n"
5
+ "POT-Creation-Date: 2019-10-15 15:32-0500\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:64
22
  #, php-format
23
  msgid "Error processing payment. Reason: %s"
24
  msgstr ""
25
 
26
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:65
27
  #, php-format
28
  msgid "Error processing payment. Reason: %s. Code: %s"
29
  msgstr ""
30
 
31
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:76
32
  #, php-format
33
  msgid "Order charge successful in Stripe. Charge: %s. Payment Method: %s"
34
  msgstr ""
35
 
36
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:120
37
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:192
38
  #, php-format
39
  msgid "Order amount captured in Stripe. Amount: %s"
40
  msgstr ""
41
 
42
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:124
43
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:196
44
  #, php-format
45
  msgid "Error capturing charge in Stripe. Reason: %s"
46
  msgstr ""
47
 
48
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:136
49
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:206
50
  #, php-format
51
  msgid "Error voiding charge. Reason: %s"
52
  msgstr ""
53
 
54
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:138
55
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:208
56
  msgid "Charge voided in Stripe."
57
  msgstr ""
58
 
59
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:165
60
  #, php-format
61
  msgid ""
62
  "Recurring payment for subscription failed. Reason: %s. Payment method: %s"
63
  msgstr ""
64
 
65
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:169
66
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:243
67
  #, php-format
68
  msgid "Recurring payment captured in Stripe. Payment method: %s"
69
  msgstr ""
70
 
71
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:171
72
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:209
73
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:245
74
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:311
75
  #, php-format
76
  msgid "Recurring payment authorized in Stripe. Payment method: %s"
77
  msgstr ""
78
 
79
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:183
80
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:277
81
  #, php-format
82
  msgid "Error deleting Stripe card. Token Id: %s"
83
  msgstr ""
84
 
85
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:203
86
+ #, php-format
87
+ msgid ""
88
+ "Pre-order payment for subscription failed. Reason: %s. Payment method: %s"
89
+ msgstr ""
90
+
91
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-charge.php:207
92
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:309
93
+ #, php-format
94
+ msgid "Pre-order payment captured in Stripe. Payment method: %s"
95
+ msgstr ""
96
+
97
  #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:76
98
  #, php-format
99
  msgid "Error creating payment source. Reason: %s"
114
  msgid "& billing country is <strong>%s</strong>"
115
  msgstr ""
116
 
117
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:86
118
  #, php-format
119
  msgid "Order %s successful in Stripe. Charge: %s. Payment Method: %s"
120
  msgstr ""
121
 
122
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:86
123
  msgid "charge"
124
  msgstr ""
125
 
126
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:86
127
  msgid "authorization"
128
  msgstr ""
129
 
130
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:114
131
  msgid "A new payment method is required."
132
  msgstr ""
133
 
134
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:232
135
  #, php-format
136
  msgid "Recurring payment for order failed. Reason: %s"
137
  msgstr ""
138
 
139
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:249
140
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:315
141
  #, php-format
142
  msgid "Customer must manually complete payment for payment method %s"
143
  msgstr ""
144
 
145
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php:298
146
+ #, php-format
147
+ msgid "Pre-order payment for order failed. Reason: %s"
148
+ msgstr ""
149
+
150
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:292
151
  msgid ""
152
  "Please read and accept the terms and conditions to proceed with your order."
153
  msgstr ""
154
 
155
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:305
156
  #: includes/controllers/class-wc-stripe-controller-cart.php:99
157
  #: includes/controllers/class-wc-stripe-controller-cart.php:139
158
  #: includes/controllers/class-wc-stripe-controller-googlepay.php:116
160
  msgid "Total"
161
  msgstr ""
162
 
163
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:363
164
  #, php-format
165
  msgid "Error saving your payment method. Reason: %s"
166
  msgstr ""
167
 
168
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:374
169
  #, php-format
170
  msgid "Error saving payment method. Reason: %s"
171
  msgstr ""
172
 
173
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:386
174
  msgid "Transaction Id cannot be empty."
175
  msgstr ""
176
 
177
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:393
178
  #, php-format
179
  msgid "Order refunded in Stripe. Amount: %s"
180
  msgstr ""
181
 
182
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:578
183
  #: includes/admin/meta-boxes/views/html-order-pay.php:42
184
  msgid "New Card"
185
  msgstr ""
186
 
187
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:582
188
  #: includes/admin/meta-boxes/views/html-order-pay.php:30
189
  msgid "Saved Cards"
190
  msgstr ""
191
 
192
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:779
193
  #, php-format
194
  msgid "Attemp to save payment method failed. Reason: %s"
195
  msgstr ""
196
 
197
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:799
198
  msgid ""
199
  "We were not able to save your payment method. To prevent billing issues with "
200
  "your subscription, please add a payment method to the subscription."
201
  msgstr ""
202
 
203
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:801
204
  #, php-format
205
  msgid "We were not able to save your payment method. Reason: %s"
206
  msgstr ""
207
 
208
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:833
209
  msgid "Payment Method Token"
210
  msgstr ""
211
 
212
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:859
213
  #, php-format
214
  msgid "Error saving payment method for subscription. Reason: %s"
215
  msgstr ""
216
 
217
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:908
218
  #, php-format
219
  msgid "Order %s from %s"
220
  msgstr ""
259
  #: includes/admin/meta-boxes/views/html-order-pay.php:23
260
  #: includes/gateways/settings/applepay-settings.php:41
261
  #: includes/gateways/settings/cc-settings.php:41
262
+ #: includes/gateways/settings/googlepay-settings.php:55
263
  #: includes/gateways/settings/payment-request-settings.php:42
264
  msgid "Capture"
265
  msgstr ""
317
  #: includes/gateways/class-wc-payment-gateway-stripe-wechat.php:46
318
  #: includes/gateways/settings/applepay-settings.php:16
319
  #: includes/gateways/settings/cc-settings.php:16
320
+ #: includes/gateways/settings/googlepay-settings.php:30
321
  #: includes/gateways/settings/payment-request-settings.php:17
322
  msgid "Title"
323
  msgstr ""
387
  #: includes/admin/meta-boxes/views/html-order-pay.php:21
388
  #: includes/gateways/settings/applepay-settings.php:37
389
  #: includes/gateways/settings/cc-settings.php:37
390
+ #: includes/gateways/settings/googlepay-settings.php:51
391
  #: includes/gateways/settings/payment-request-settings.php:38
392
  msgid "Charge Type"
393
  msgstr ""
395
  #: includes/admin/meta-boxes/views/html-order-pay.php:24
396
  #: includes/gateways/settings/applepay-settings.php:42
397
  #: includes/gateways/settings/cc-settings.php:42
398
+ #: includes/gateways/settings/googlepay-settings.php:56
399
  #: includes/gateways/settings/payment-request-settings.php:43
400
  msgid "Authorize"
401
  msgstr ""
584
  msgid "Quantity must be greater than zero."
585
  msgstr ""
586
 
587
+ #: includes/controllers/class-wc-stripe-controller-checkout.php:131
588
  #, php-format
589
  msgid ""
590
  "Some required fields were missing. Please click %shere%s to complete your "
591
  "payment."
592
  msgstr ""
593
 
594
+ #: includes/controllers/class-wc-stripe-controller-checkout.php:164
595
+ msgid "Please review your order details then click Place Order."
596
+ msgstr ""
597
+
598
  #: includes/controllers/class-wc-stripe-controller-gateway-settings.php:54
599
  msgid ""
600
  "You cannot register your domain until you have configured your Live API keys."
737
  #: includes/gateways/class-wc-payment-gateway-stripe-wechat.php:52
738
  #: includes/gateways/settings/applepay-settings.php:22
739
  #: includes/gateways/settings/cc-settings.php:22
740
+ #: includes/gateways/settings/googlepay-settings.php:36
741
  #: includes/gateways/settings/payment-request-settings.php:23
742
  msgid "Description"
743
  msgstr ""
753
  #: includes/gateways/class-wc-payment-gateway-stripe-wechat.php:54
754
  #: includes/gateways/settings/applepay-settings.php:24
755
  #: includes/gateways/settings/cc-settings.php:24
756
+ #: includes/gateways/settings/googlepay-settings.php:38
757
  #: includes/gateways/settings/payment-request-settings.php:25
758
  msgid "Leave blank if you don't want a description to show for the gateway."
759
  msgstr ""
778
  msgstr ""
779
 
780
  #: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:16
781
+ #: includes/gateways/settings/googlepay-settings.php:31
782
  msgid "Google Pay"
783
  msgstr ""
784
 
794
  msgid "Please update you product quantity before using Google Pay."
795
  msgstr ""
796
 
797
+ #: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:87
798
  #: includes/wc-stripe-functions.php:358
799
  msgid "Subscription"
800
  msgstr ""
801
 
802
+ #: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:107
803
  #: includes/wc-stripe-functions.php:344
804
  msgid "Shipping"
805
  msgstr ""
806
 
807
+ #: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:114
808
  #: includes/wc-stripe-functions.php:351
809
  msgid "Tax"
810
  msgstr ""
811
 
812
+ #: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:145
813
  #: includes/wc-stripe-functions.php:409
814
  msgid "Waiting..."
815
  msgstr ""
816
 
817
+ #: includes/gateways/class-wc-payment-gateway-stripe-googlepay.php:146
818
  #: includes/wc-stripe-functions.php:410
819
  msgid "loading shipping methods..."
820
  msgstr ""
991
 
992
  #: includes/gateways/settings/applepay-settings.php:19
993
  #: includes/gateways/settings/cc-settings.php:19
994
+ #: includes/gateways/settings/googlepay-settings.php:33
995
  #: includes/gateways/settings/payment-request-settings.php:20
996
  msgid "Title of the credit card gateway"
997
  msgstr ""
998
 
999
  #: includes/gateways/settings/applepay-settings.php:28
1000
  #: includes/gateways/settings/cc-settings.php:28
1001
+ #: includes/gateways/settings/googlepay-settings.php:42
1002
  #: includes/gateways/settings/payment-request-settings.php:29
1003
  msgid "Credit Card Display"
1004
  msgstr ""
1005
 
1006
  #: includes/gateways/settings/applepay-settings.php:34
1007
  #: includes/gateways/settings/cc-settings.php:34
1008
+ #: includes/gateways/settings/googlepay-settings.php:48
1009
  #: includes/gateways/settings/payment-request-settings.php:35
1010
  msgid ""
1011
  "This option allows you to customize how the credit card will display for "
1021
  msgstr ""
1022
 
1023
  #: includes/gateways/settings/applepay-settings.php:48
1024
+ #: includes/gateways/settings/googlepay-settings.php:62
1025
  #: includes/gateways/settings/payment-request-settings.php:49
1026
  msgid "Payment Sections"
1027
  msgstr ""
1028
 
1029
  #: includes/gateways/settings/applepay-settings.php:51
1030
+ #: includes/gateways/settings/googlepay-settings.php:65
1031
  #: includes/gateways/settings/payment-request-settings.php:52
1032
  msgid "Product Page"
1033
  msgstr ""
1034
 
1035
  #: includes/gateways/settings/applepay-settings.php:52
1036
+ #: includes/gateways/settings/googlepay-settings.php:66
1037
  #: includes/gateways/settings/payment-request-settings.php:53
1038
  msgid "Cart Page"
1039
  msgstr ""
1040
 
1041
  #: includes/gateways/settings/applepay-settings.php:53
1042
+ #: includes/gateways/settings/googlepay-settings.php:67
1043
  #: includes/gateways/settings/payment-request-settings.php:54
1044
  msgid "Top of Checkout"
1045
  msgstr ""
1053
 
1054
  #: includes/gateways/settings/applepay-settings.php:59
1055
  #: includes/gateways/settings/cc-settings.php:47
1056
+ #: includes/gateways/settings/googlepay-settings.php:73
1057
  #: includes/gateways/settings/payment-request-settings.php:74
1058
  msgid "Order Status"
1059
  msgstr ""
1060
 
1061
  #: includes/gateways/settings/applepay-settings.php:63
1062
  #: includes/gateways/settings/cc-settings.php:51
1063
+ #: includes/gateways/settings/googlepay-settings.php:77
1064
  #: includes/gateways/settings/payment-request-settings.php:78
1065
  msgid "Default"
1066
  msgstr ""
1067
 
1068
  #: includes/gateways/settings/applepay-settings.php:66
1069
  #: includes/gateways/settings/cc-settings.php:54
1070
+ #: includes/gateways/settings/googlepay-settings.php:80
1071
  #: includes/gateways/settings/payment-request-settings.php:81
1072
  msgid ""
1073
  "This is the status of the order once payment is complete. If <b>Default</b> "
1084
  msgstr ""
1085
 
1086
  #: includes/gateways/settings/applepay-settings.php:86
1087
+ #: includes/gateways/settings/googlepay-settings.php:146
1088
  msgid "Button Design"
1089
  msgstr ""
1090
 
1262
  msgstr ""
1263
 
1264
  #: includes/gateways/settings/googlepay-settings.php:19
1265
+ msgid "Dynamic Price"
1266
+ msgstr ""
1267
+
1268
+ #: includes/gateways/settings/googlepay-settings.php:22
1269
+ msgid ""
1270
+ "If enabled, the Google Payment sheet will show the order line items. You "
1271
+ "must have Google whitelist you for callback intents."
1272
+ msgstr ""
1273
+
1274
+ #: includes/gateways/settings/googlepay-settings.php:25
1275
  msgid "Merchant ID"
1276
  msgstr ""
1277
 
1278
+ #: includes/gateways/settings/googlepay-settings.php:27
1279
  msgid ""
1280
  "Your Google Merchant ID is given to you by the Google API team once you "
1281
  "register for Google Pay. While testing in TEST mode you can leave this value "
1282
  "blank and Google Pay will work."
1283
  msgstr ""
1284
 
1285
+ #: includes/gateways/settings/googlepay-settings.php:58
1286
  msgid ""
1287
  "This option determines whether the customer's funds are capture immediately "
1288
  "or authorized and can be captured at a later date."
1289
  msgstr ""
1290
 
1291
+ #: includes/gateways/settings/googlepay-settings.php:70
1292
  msgid ""
1293
  "Increase your conversion rate by offering Google Pay on your Product and "
1294
  "Cart pages, or at the top of the checkout page."
1295
  msgstr ""
1296
 
1297
+ #: includes/gateways/settings/googlepay-settings.php:83
1298
  msgid "Merchant Name"
1299
  msgstr ""
1300
 
1301
+ #: includes/gateways/settings/googlepay-settings.php:85
1302
  msgid ""
1303
  "The name of your business as it appears on the Google Pay payment sheet."
1304
  msgstr ""
1305
 
1306
+ #: includes/gateways/settings/googlepay-settings.php:89
1307
  msgid "Icon"
1308
  msgstr ""
1309
 
1310
+ #: includes/gateways/settings/googlepay-settings.php:92
1311
  msgid "With Outline"
1312
  msgstr ""
1313
 
1314
+ #: includes/gateways/settings/googlepay-settings.php:93
1315
  msgid "Standard"
1316
  msgstr ""
1317
 
1318
+ #: includes/gateways/settings/googlepay-settings.php:96
1319
  msgid ""
1320
  "This is the icon style that appears next to the gateway on the checkout page."
1321
  msgstr ""
1322
 
1323
+ #: includes/gateways/settings/googlepay-settings.php:123
1324
  msgid "Button Options"
1325
  msgstr ""
1326
 
1327
+ #: includes/gateways/settings/googlepay-settings.php:126
1328
  msgid "Button Color"
1329
  msgstr ""
1330
 
1331
+ #: includes/gateways/settings/googlepay-settings.php:130
1332
  msgid "Black"
1333
  msgstr ""
1334
 
1335
+ #: includes/gateways/settings/googlepay-settings.php:131
1336
  msgid "White"
1337
  msgstr ""
1338
 
1339
+ #: includes/gateways/settings/googlepay-settings.php:133
1340
  msgid "The button color of the GPay button."
1341
  msgstr ""
1342
 
1343
+ #: includes/gateways/settings/googlepay-settings.php:136
1344
  msgid "Button Style"
1345
  msgstr ""
1346
 
1347
+ #: includes/gateways/settings/googlepay-settings.php:140
1348
  msgid "Long"
1349
  msgstr ""
1350
 
1351
+ #: includes/gateways/settings/googlepay-settings.php:141
1352
  msgid "Short"
1353
  msgstr ""
1354
 
1355
+ #: includes/gateways/settings/googlepay-settings.php:143
1356
  msgid "The button style of the GPay button."
1357
  msgstr ""
1358
 
1359
+ #: includes/gateways/settings/googlepay-settings.php:148
1360
  msgid ""
1361
  "If you can't see the Google Pay button, try switching to a Chrome browser."
1362
  msgstr ""
includes/abstract/abstract-wc-payment-gateway-stripe-charge.php CHANGED
@@ -28,6 +28,10 @@ abstract class WC_Payment_Gateway_Stripe_Charge extends WC_Payment_Gateway_Strip
28
  }
29
  $this->processing_payment = true;
30
 
 
 
 
 
31
  // if order total is zero, then save meta but don't process payment.
32
  if ($order->get_total () == 0) {
33
  return $this->process_zero_total_order ( $order );
@@ -57,8 +61,8 @@ abstract class WC_Payment_Gateway_Stripe_Charge extends WC_Payment_Gateway_Strip
57
 
58
  wc_stripe_log_info ( 'Stripe charge: ' . print_r ( $charge, true ) );
59
  if (is_wp_error ( $charge )) {
60
- wc_add_notice ( sprintf ( __ ( 'Error processing payment. Reason: %s', 'woo-stripe' ), $charge->get_error_message () ), 'error' );
61
- $order->add_order_note ( sprintf ( __ ( 'Error processing payment. Reason: %s. Code: %s', 'woo-stripe' ), $charge->get_error_message (), $charge->get_error_code () ) );
62
  return $this->order_error ();
63
  }
64
  if ($charge->captured) {
@@ -69,7 +73,7 @@ abstract class WC_Payment_Gateway_Stripe_Charge extends WC_Payment_Gateway_Strip
69
  }
70
  $this->save_order_meta ( $order, $charge );
71
 
72
- $order->add_order_note ( sprintf ( __ ( 'Order charge successful in Stripe. Charge: %s. Payment Method: %s', 'woo-stripe' ), $order->get_transaction_id (), $order->get_payment_method_title () ) );
73
  WC ()->cart->empty_cart ();
74
 
75
  return array( 'result' => 'success',
@@ -113,11 +117,11 @@ abstract class WC_Payment_Gateway_Stripe_Charge extends WC_Payment_Gateway_Strip
113
  if (! is_wp_error ( $result )) {
114
  $order->payment_complete ();
115
  $this->save_order_meta ( $order, $result );
116
- $order->add_order_note ( sprintf ( __ ( 'Order amount captured in Stripe. Amount: %s', 'woo-stripe' ), wc_price ( $amount, array(
117
  'currency' => $order->get_currency ()
118
  ) ) ) );
119
  } else {
120
- $order->add_order_note ( sprintf ( __ ( 'Error capturing charge in Stripe. Reason: %s', 'woo-stripe' ), wc_price ( $amount, array(
121
  'currency' => $order->get_currency ()
122
  ) ) ) );
123
  }
@@ -129,9 +133,9 @@ abstract class WC_Payment_Gateway_Stripe_Charge extends WC_Payment_Gateway_Strip
129
  'charge' => $order->get_transaction_id ()
130
  ), wc_stripe_order_mode ( $order ) );
131
  if (is_wp_error ( $result )) {
132
- $order->add_order_note ( sprintf ( __ ( 'Error voiding charge. Reason: %s', 'woo-stripe' ), $result->get_error_message () ) );
133
  } else {
134
- $order->add_order_note ( __ ( 'Charge voided in Stripe.', 'woo-stripe' ) );
135
  }
136
  return $result;
137
  }
@@ -152,17 +156,19 @@ abstract class WC_Payment_Gateway_Stripe_Charge extends WC_Payment_Gateway_Strip
152
  'source' => $order->get_meta ( '_payment_method_token', true ),
153
  'amount' => wc_stripe_add_number_precision ( $amount )
154
  ] );
155
-
 
 
156
  $charge = $this->gateway->charge ( $args, wc_stripe_order_mode ( $order ) );
157
 
158
  if (is_wp_error ( $charge )) {
159
- $order->update_status ( 'failed', sprintf ( __ ( 'Recurring payment for subscription failed. Reason: %s. Payment method: %s', 'woo-stripe' ), $charge->get_error_message (), $order->get_payment_method_title () ) );
160
  } else {
161
  if ($charge->captured) {
162
  $order->payment_complete ( $charge->id );
163
- $order->add_order_note ( sprintf ( __ ( 'Recurring payment captured in Stripe. Payment method: %s', 'woo-stripe' ), $order->get_payment_method_title () ) );
164
  } else {
165
- $order->update_status ( apply_filters ( 'wc_stripe_authorized_renewal_order_status', 'processing', $order, $this ), sprintf ( __ ( 'Recurring payment authorized in Stripe. Payment method: %s', 'woo-stripe' ), $order->get_payment_method_title () ) );
166
  }
167
  $this->save_order_meta ( $order, $charge );
168
  }
@@ -174,7 +180,35 @@ abstract class WC_Payment_Gateway_Stripe_Charge extends WC_Payment_Gateway_Strip
174
  $customer_id = wc_stripe_get_customer_id ( $token->get_user_id (), $mode );
175
  $this->gateway->delete_card ( $token->get_token (), $customer_id, $mode );
176
  } catch ( \Stripe\Error\Base $e ) {
177
- wc_stripe_log_error ( sprintf ( __ ( 'Error deleting Stripe card. Token Id: %s', 'woo-stripe' ), $token->get_token () ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
178
  }
179
  }
180
  }
28
  }
29
  $this->processing_payment = true;
30
 
31
+ if ($this->order_contains_pre_order ( $order ) && $this->pre_order_requires_tokenization ( $order )) {
32
+ return $this->process_pre_order ( $order );
33
+ }
34
+
35
  // if order total is zero, then save meta but don't process payment.
36
  if ($order->get_total () == 0) {
37
  return $this->process_zero_total_order ( $order );
61
 
62
  wc_stripe_log_info ( 'Stripe charge: ' . print_r ( $charge, true ) );
63
  if (is_wp_error ( $charge )) {
64
+ wc_add_notice ( sprintf ( __ ( 'Error processing payment. Reason: %s', 'woo-stripe-payment' ), $charge->get_error_message () ), 'error' );
65
+ $order->add_order_note ( sprintf ( __ ( 'Error processing payment. Reason: %s. Code: %s', 'woo-stripe-payment' ), $charge->get_error_message (), $charge->get_error_code () ) );
66
  return $this->order_error ();
67
  }
68
  if ($charge->captured) {
73
  }
74
  $this->save_order_meta ( $order, $charge );
75
 
76
+ $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 () ) );
77
  WC ()->cart->empty_cart ();
78
 
79
  return array( 'result' => 'success',
117
  if (! is_wp_error ( $result )) {
118
  $order->payment_complete ();
119
  $this->save_order_meta ( $order, $result );
120
+ $order->add_order_note ( sprintf ( __ ( 'Order amount captured in Stripe. Amount: %s', 'woo-stripe-payment' ), wc_price ( $amount, array(
121
  'currency' => $order->get_currency ()
122
  ) ) ) );
123
  } else {
124
+ $order->add_order_note ( sprintf ( __ ( 'Error capturing charge in Stripe. Reason: %s', 'woo-stripe-payment' ), wc_price ( $amount, array(
125
  'currency' => $order->get_currency ()
126
  ) ) ) );
127
  }
133
  'charge' => $order->get_transaction_id ()
134
  ), wc_stripe_order_mode ( $order ) );
135
  if (is_wp_error ( $result )) {
136
+ $order->add_order_note ( sprintf ( __ ( 'Error voiding charge. Reason: %s', 'woo-stripe-payment' ), $result->get_error_message () ) );
137
  } else {
138
+ $order->add_order_note ( __ ( 'Charge voided in Stripe.', 'woo-stripe-payment' ) );
139
  }
140
  return $result;
141
  }
156
  'source' => $order->get_meta ( '_payment_method_token', true ),
157
  'amount' => wc_stripe_add_number_precision ( $amount )
158
  ] );
159
+ if (empty ( $args[ 'customer' ] )) {
160
+ unset ( $args[ 'customer' ] );
161
+ }
162
  $charge = $this->gateway->charge ( $args, wc_stripe_order_mode ( $order ) );
163
 
164
  if (is_wp_error ( $charge )) {
165
+ $order->update_status ( 'failed', sprintf ( __ ( 'Recurring payment for subscription failed. Reason: %s. Payment method: %s', 'woo-stripe-payment' ), $charge->get_error_message (), $order->get_payment_method_title () ) );
166
  } else {
167
  if ($charge->captured) {
168
  $order->payment_complete ( $charge->id );
169
+ $order->add_order_note ( sprintf ( __ ( 'Recurring payment captured in Stripe. Payment method: %s', 'woo-stripe-payment' ), $order->get_payment_method_title () ) );
170
  } else {
171
+ $order->update_status ( apply_filters ( 'wc_stripe_authorized_renewal_order_status', 'processing', $order, $this ), sprintf ( __ ( 'Recurring payment authorized in Stripe. Payment method: %s', 'woo-stripe-payment' ), $order->get_payment_method_title () ) );
172
  }
173
  $this->save_order_meta ( $order, $charge );
174
  }
180
  $customer_id = wc_stripe_get_customer_id ( $token->get_user_id (), $mode );
181
  $this->gateway->delete_card ( $token->get_token (), $customer_id, $mode );
182
  } catch ( \Stripe\Error\Base $e ) {
183
+ wc_stripe_log_error ( sprintf ( __ ( 'Error deleting Stripe card. Token Id: %s', 'woo-stripe-payment' ), $token->get_token () ) );
184
+ }
185
+ }
186
+
187
+ /**
188
+ *
189
+ * @param WC_Order $order
190
+ */
191
+ public function process_pre_order_payment($order) {
192
+ $args = $this->get_order_charge_args ( $order, [
193
+ 'customer' => wc_stripe_get_customer_id ( $order->get_customer_id (), wc_stripe_order_mode ( $order ) ),
194
+ 'source' => $order->get_meta ( '_payment_method_token', true ),
195
+ 'amount' => wc_stripe_add_number_precision ( $order->get_total () )
196
+ ] );
197
+ if (empty ( $args[ 'customer' ] )) {
198
+ unset ( $args[ 'customer' ] );
199
+ }
200
+ $charge = $this->gateway->charge ( $args, wc_stripe_order_mode ( $order ) );
201
+
202
+ if (is_wp_error ( $charge )) {
203
+ $order->update_status ( 'failed', sprintf ( __ ( 'Pre-order payment for subscription failed. Reason: %s. Payment method: %s', 'woo-stripe-payment' ), $charge->get_error_message (), $order->get_payment_method_title () ) );
204
+ } else {
205
+ if ($charge->captured) {
206
+ $order->payment_complete ( $charge->id );
207
+ $order->add_order_note ( sprintf ( __ ( 'Pre-order payment captured in Stripe. Payment method: %s', 'woo-stripe-payment' ), $order->get_payment_method_title () ) );
208
+ } else {
209
+ $order->update_status ( apply_filters ( 'wc_stripe_authorized_renewal_order_status', 'processing', $order, $this ), sprintf ( __ ( 'Recurring payment authorized in Stripe. Payment method: %s', 'woo-stripe-payment' ), $order->get_payment_method_title () ) );
210
+ }
211
+ $this->save_order_meta ( $order, $charge );
212
  }
213
  }
214
  }
includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php CHANGED
@@ -6,7 +6,7 @@ if (! class_exists ( 'WC_Payment_Gateway_Stripe_Charge' )) {
6
  * Local payment method classes should extend this abstract class
7
  *
8
  * @package Stripe/Abstract
9
- * @author User
10
  *
11
  */
12
  abstract class WC_Payment_Gateway_Stripe_Local_Payment extends WC_Payment_Gateway_Stripe_Charge {
@@ -73,7 +73,7 @@ abstract class WC_Payment_Gateway_Stripe_Local_Payment extends WC_Payment_Gatewa
73
  }
74
 
75
  if (is_wp_error ( $source )) {
76
- wc_add_notice ( sprintf ( __ ( 'Error creating payment source. Reason: %s', 'woo-stripe' ), $source->get_error_message () ), 'error' );
77
  return $this->order_error ();
78
  }
79
 
@@ -171,7 +171,7 @@ abstract class WC_Payment_Gateway_Stripe_Local_Payment extends WC_Payment_Gatewa
171
  return [ 'type' => $this->local_payment_type,
172
  'amount' => wc_stripe_add_number_precision ( $order->get_total () ),
173
  'currency' => $order->get_currency (),
174
- 'statement_descriptor' => sprintf ( __ ( 'Order %s', 'woo-stripe' ), $order->get_order_number () ),
175
  'owner' => [
176
  'name' => $this->get_name_from_order ( $order, 'billing' ),
177
  'email' => $order->get_billing_email ()
@@ -208,10 +208,10 @@ abstract class WC_Payment_Gateway_Stripe_Local_Payment extends WC_Payment_Gatewa
208
  protected function get_payment_description() {
209
  $desc = '';
210
  if ($this->currencies) {
211
- $desc .= sprintf ( __ ( 'Gateway will appear when store currency is <strong>%s</strong>.', 'woo-stripe' ), implode ( ', ', $this->currencies ) );
212
  }
213
  if ($this->countries) {
214
- $desc .= '<p>' . sprintf ( __ ( '& billing country is <strong>%s</strong>', 'woo-stripe' ), implode ( ', ', $this->countries ) ) . '</p>';
215
  }
216
  return $desc;
217
  }
6
  * Local payment method classes should extend this abstract class
7
  *
8
  * @package Stripe/Abstract
9
+ * @author Payment Plugins
10
  *
11
  */
12
  abstract class WC_Payment_Gateway_Stripe_Local_Payment extends WC_Payment_Gateway_Stripe_Charge {
73
  }
74
 
75
  if (is_wp_error ( $source )) {
76
+ wc_add_notice ( sprintf ( __ ( 'Error creating payment source. Reason: %s', 'woo-stripe-payment' ), $source->get_error_message () ), 'error' );
77
  return $this->order_error ();
78
  }
79
 
171
  return [ 'type' => $this->local_payment_type,
172
  'amount' => wc_stripe_add_number_precision ( $order->get_total () ),
173
  'currency' => $order->get_currency (),
174
+ 'statement_descriptor' => sprintf ( __ ( 'Order %s', 'woo-stripe-payment' ), $order->get_order_number () ),
175
  'owner' => [
176
  'name' => $this->get_name_from_order ( $order, 'billing' ),
177
  'email' => $order->get_billing_email ()
208
  protected function get_payment_description() {
209
  $desc = '';
210
  if ($this->currencies) {
211
+ $desc .= sprintf ( __ ( 'Gateway will appear when store currency is <strong>%s</strong>.', 'woo-stripe-payment' ), implode ( ', ', $this->currencies ) );
212
  }
213
  if ($this->countries) {
214
+ $desc .= '<p>' . sprintf ( __ ( '& billing country is <strong>%s</strong>', 'woo-stripe-payment' ), implode ( ', ', $this->countries ) ) . '</p>';
215
  }
216
  return $desc;
217
  }
includes/abstract/abstract-wc-payment-gateway-stripe-payment-intent.php CHANGED
@@ -28,6 +28,10 @@ abstract class WC_Payment_Gateway_Stripe_Payment_Intent extends WC_Payment_Gatew
28
  }
29
  $this->processing_payment = true;
30
 
 
 
 
 
31
  // if order total is zero, then save meta but don't process payment.
32
  if ($order->get_total () == 0) {
33
  return $this->process_zero_total_order ( $order );
@@ -79,7 +83,7 @@ abstract class WC_Payment_Gateway_Stripe_Payment_Intent extends WC_Payment_Gatew
79
  $order->update_status ( apply_filters ( 'wc_stripe_authorized_order_status', 'default' === $order_status ? 'processing' : $order_status, $order, $this ) );
80
  }
81
  $this->save_order_meta ( $order, $charge );
82
- $order->add_order_note ( sprintf ( __ ( 'Order %s successful in Stripe. Charge: %s. Payment Method: %s', 'woo-stripe' ), $charge->captured ? __ ( 'charge', 'woo-stripe' ) : __ ( 'authorization', 'woo-stripe' ), $order->get_transaction_id (), $order->get_payment_method_title () ) );
83
  }
84
  WC ()->cart->empty_cart ();
85
 
@@ -107,7 +111,7 @@ abstract class WC_Payment_Gateway_Stripe_Payment_Intent extends WC_Payment_Gatew
107
  );
108
  }
109
  if ($intent->status === 'requires_source' || $intent->status === 'requires_payment_method') {
110
- wc_add_notice ( __ ( 'A new payment method is required.', 'woo-stripe' ), 'error' );
111
  return $this->order_error ();
112
  }
113
  }
@@ -144,7 +148,7 @@ abstract class WC_Payment_Gateway_Stripe_Payment_Intent extends WC_Payment_Gatew
144
  if ($order->get_meta ( '_payment_method_token', true ) !== $this->get_payment_method_from_request ()) {
145
  $args[ 'payment_method' ] = $this->get_payment_method_from_request ();
146
  }
147
- if (( $customer_id = wc_stripe_get_customer_id ( get_current_user_id () ) )) {
148
  $args[ 'customer' ] = $customer_id;
149
  }
150
  if ($this->should_save_payment_method ( $order )) {
@@ -185,11 +189,11 @@ abstract class WC_Payment_Gateway_Stripe_Payment_Intent extends WC_Payment_Gatew
185
  ), wc_stripe_order_mode ( $order ) );
186
  if (! is_wp_error ( $result )) {
187
  $order->payment_complete ();
188
- $order->add_order_note ( sprintf ( __ ( 'Order amount captured in Stripe. Amount: %s', 'woo-stripe' ), wc_price ( $amount, array(
189
  'currency' => $order->get_currency ()
190
  ) ) ) );
191
  } else {
192
- $order->add_order_note ( sprintf ( __ ( 'Error capturing charge in Stripe. Reason: %s', 'woo-stripe' ), wc_price ( $amount, array(
193
  'currency' => $order->get_currency ()
194
  ) ) ) );
195
  }
@@ -199,9 +203,9 @@ abstract class WC_Payment_Gateway_Stripe_Payment_Intent extends WC_Payment_Gatew
199
  public function void_charge($order) {
200
  $result = $this->gateway->cancel_payment_intent ( $order->get_meta ( '_payment_intent_id', true ), wc_stripe_order_mode ( $order ) );
201
  if (is_wp_error ( $result )) {
202
- $order->add_order_note ( sprintf ( __ ( 'Error voiding charge. Reason: %s', 'woo-stripe' ), $result->get_error_message () ) );
203
  } else {
204
- $order->add_order_note ( __ ( 'Charge voided in Stripe.', 'woo-stripe' ) );
205
  }
206
  }
207
 
@@ -215,13 +219,17 @@ abstract class WC_Payment_Gateway_Stripe_Payment_Intent extends WC_Payment_Gatew
215
  $args = array_merge ( $this->get_payment_intent_args ( $order ), [
216
  'amount' => wc_stripe_add_number_precision ( $amount ),
217
  'payment_method' => $order->get_meta ( '_payment_method_token', true ),
 
218
  'confirm' => true, 'off_session' => true
219
  ] );
 
 
 
220
  $intent = $this->gateway->create_payment_intent ( $args, wc_stripe_order_mode ( $order ) );
221
 
222
  if (is_wp_error ( $intent )) {
223
  // payment intent failed
224
- $order->update_status ( 'failed', sprintf ( __ ( 'Recurring payment for order failed. Reason: %s', 'woo-stripe' ), $intent->get_error_message () ) );
225
  } else {
226
  if ($intent->status === 'succeeded' || $intent->status === 'requires_capture') {
227
  $charges = $intent->charges->data;
@@ -232,13 +240,13 @@ abstract class WC_Payment_Gateway_Stripe_Payment_Intent extends WC_Payment_Gatew
232
 
233
  if ($charge->captured) {
234
  $order->payment_complete ( $charge->id );
235
- $order->add_order_note ( sprintf ( __ ( 'Recurring payment captured in Stripe. Payment method: %s', 'woo-stripe' ), $order->get_payment_method_title () ) );
236
  } else {
237
- $order->update_status ( apply_filters ( 'wc_stripe_authorized_renewal_order_status', 'processing', $order, $this ), sprintf ( __ ( 'Recurring payment authorized in Stripe. Payment method: %s', 'woo-stripe' ), $order->get_payment_method_title () ) );
238
  }
239
  }
240
  } else {
241
- $order->update_status ( 'pending', sprintf ( __ ( 'Customer must manually complete payment for payment method %s', 'woo-stripe' ), $order->get_payment_method_title () ) );
242
  }
243
  }
244
  }
@@ -266,7 +274,46 @@ abstract class WC_Payment_Gateway_Stripe_Payment_Intent extends WC_Payment_Gatew
266
  $payment_method = $this->gateway->fetch_payment_method ( $token->get_token () );
267
  $this->gateway->delete_payment_method ( $payment_method );
268
  } catch ( \Stripe\Error\Base $e ) {
269
- wc_stripe_log_error ( sprintf ( __ ( 'Error deleting Stripe card. Token Id: %s', 'woo-stripe' ), $token->get_token () ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
270
  }
271
  }
272
  }
28
  }
29
  $this->processing_payment = true;
30
 
31
+ if ($this->order_contains_pre_order ( $order ) && $this->pre_order_requires_tokenization ( $order )) {
32
+ return $this->process_pre_order ( $order );
33
+ }
34
+
35
  // if order total is zero, then save meta but don't process payment.
36
  if ($order->get_total () == 0) {
37
  return $this->process_zero_total_order ( $order );
83
  $order->update_status ( apply_filters ( 'wc_stripe_authorized_order_status', 'default' === $order_status ? 'processing' : $order_status, $order, $this ) );
84
  }
85
  $this->save_order_meta ( $order, $charge );
86
+ $order->add_order_note ( sprintf ( __ ( 'Order %s successful in Stripe. Charge: %s. Payment Method: %s', 'woo-stripe-payment' ), $charge->captured ? __ ( 'charge', 'woo-stripe-payment' ) : __ ( 'authorization', 'woo-stripe-payment' ), $order->get_transaction_id (), $order->get_payment_method_title () ) );
87
  }
88
  WC ()->cart->empty_cart ();
89
 
111
  );
112
  }
113
  if ($intent->status === 'requires_source' || $intent->status === 'requires_payment_method') {
114
+ wc_add_notice ( __ ( 'A new payment method is required.', 'woo-stripe-payment' ), 'error' );
115
  return $this->order_error ();
116
  }
117
  }
148
  if ($order->get_meta ( '_payment_method_token', true ) !== $this->get_payment_method_from_request ()) {
149
  $args[ 'payment_method' ] = $this->get_payment_method_from_request ();
150
  }
151
+ if (( $customer_id = wc_stripe_get_customer_id ( $order->get_customer_id () ) )) {
152
  $args[ 'customer' ] = $customer_id;
153
  }
154
  if ($this->should_save_payment_method ( $order )) {
189
  ), wc_stripe_order_mode ( $order ) );
190
  if (! is_wp_error ( $result )) {
191
  $order->payment_complete ();
192
+ $order->add_order_note ( sprintf ( __ ( 'Order amount captured in Stripe. Amount: %s', 'woo-stripe-payment' ), wc_price ( $amount, array(
193
  'currency' => $order->get_currency ()
194
  ) ) ) );
195
  } else {
196
+ $order->add_order_note ( sprintf ( __ ( 'Error capturing charge in Stripe. Reason: %s', 'woo-stripe-payment' ), wc_price ( $amount, array(
197
  'currency' => $order->get_currency ()
198
  ) ) ) );
199
  }
203
  public function void_charge($order) {
204
  $result = $this->gateway->cancel_payment_intent ( $order->get_meta ( '_payment_intent_id', true ), wc_stripe_order_mode ( $order ) );
205
  if (is_wp_error ( $result )) {
206
+ $order->add_order_note ( sprintf ( __ ( 'Error voiding charge. Reason: %s', 'woo-stripe-payment' ), $result->get_error_message () ) );
207
  } else {
208
+ $order->add_order_note ( __ ( 'Charge voided in Stripe.', 'woo-stripe-payment' ) );
209
  }
210
  }
211
 
219
  $args = array_merge ( $this->get_payment_intent_args ( $order ), [
220
  'amount' => wc_stripe_add_number_precision ( $amount ),
221
  'payment_method' => $order->get_meta ( '_payment_method_token', true ),
222
+ 'customer' => $order->get_meta ( '_wc_stripe_customer', true ),
223
  'confirm' => true, 'off_session' => true
224
  ] );
225
+ if (empty ( $args[ 'customer' ] )) {
226
+ unset ( $args[ 'customer' ] );
227
+ }
228
  $intent = $this->gateway->create_payment_intent ( $args, wc_stripe_order_mode ( $order ) );
229
 
230
  if (is_wp_error ( $intent )) {
231
  // payment intent failed
232
+ $order->update_status ( 'failed', sprintf ( __ ( 'Recurring payment for order failed. Reason: %s', 'woo-stripe-payment' ), $intent->get_error_message () ) );
233
  } else {
234
  if ($intent->status === 'succeeded' || $intent->status === 'requires_capture') {
235
  $charges = $intent->charges->data;
240
 
241
  if ($charge->captured) {
242
  $order->payment_complete ( $charge->id );
243
+ $order->add_order_note ( sprintf ( __ ( 'Recurring payment captured in Stripe. Payment method: %s', 'woo-stripe-payment' ), $order->get_payment_method_title () ) );
244
  } else {
245
+ $order->update_status ( apply_filters ( 'wc_stripe_authorized_renewal_order_status', 'processing', $order, $this ), sprintf ( __ ( 'Recurring payment authorized in Stripe. Payment method: %s', 'woo-stripe-payment' ), $order->get_payment_method_title () ) );
246
  }
247
  }
248
  } else {
249
+ $order->update_status ( 'pending', sprintf ( __ ( 'Customer must manually complete payment for payment method %s', 'woo-stripe-payment' ), $order->get_payment_method_title () ) );
250
  }
251
  }
252
  }
274
  $payment_method = $this->gateway->fetch_payment_method ( $token->get_token () );
275
  $this->gateway->delete_payment_method ( $payment_method );
276
  } catch ( \Stripe\Error\Base $e ) {
277
+ wc_stripe_log_error ( sprintf ( __ ( 'Error deleting Stripe card. Token Id: %s', 'woo-stripe-payment' ), $token->get_token () ) );
278
+ }
279
+ }
280
+
281
+ /**
282
+ *
283
+ * @param WC_Order $order
284
+ */
285
+ public function process_pre_order_payment($order) {
286
+ $args = array_merge ( $this->get_payment_intent_args ( $order ), [
287
+ 'amount' => wc_stripe_add_number_precision ( $order->get_total () ),
288
+ 'payment_method' => $order->get_meta ( '_payment_method_token', true ),
289
+ 'confirm' => true, 'off_session' => true
290
+ ] );
291
+ if (empty ( $args[ 'customer' ] )) {
292
+ unset ( $args[ 'customer' ] );
293
+ }
294
+ $intent = $this->gateway->create_payment_intent ( $args, wc_stripe_order_mode ( $order ) );
295
+
296
+ if (is_wp_error ( $intent )) {
297
+ // payment intent failed
298
+ $order->update_status ( 'failed', sprintf ( __ ( 'Pre-order payment for order failed. Reason: %s', 'woo-stripe-payment' ), $intent->get_error_message () ) );
299
+ } else {
300
+ if ($intent->status === 'succeeded' || $intent->status === 'requires_capture') {
301
+ $charges = $intent->charges->data;
302
+ if (isset ( $charges[ 0 ] )) {
303
+ $charge = $charges[ 0 ];
304
+
305
+ $this->save_order_meta ( $order, $charge );
306
+
307
+ if ($charge->captured) {
308
+ $order->payment_complete ( $charge->id );
309
+ $order->add_order_note ( sprintf ( __ ( 'Pre-order payment captured in Stripe. Payment method: %s', 'woo-stripe-payment' ), $order->get_payment_method_title () ) );
310
+ } else {
311
+ $order->update_status ( apply_filters ( 'wc_stripe_authorized_renewal_order_status', 'processing', $order, $this ), sprintf ( __ ( 'Recurring payment authorized in Stripe. Payment method: %s', 'woo-stripe-payment' ), $order->get_payment_method_title () ) );
312
+ }
313
+ }
314
+ } else {
315
+ $order->update_status ( 'pending', sprintf ( __ ( 'Customer must manually complete payment for payment method %s', 'woo-stripe-payment' ), $order->get_payment_method_title () ) );
316
+ }
317
  }
318
  }
319
  }
includes/abstract/abstract-wc-payment-gateway-stripe.php CHANGED
@@ -118,6 +118,9 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
118
  'subscription_payment_method_updated'
119
  ] );
120
  }
 
 
 
121
  }
122
 
123
  public function init_supports() {
@@ -299,7 +302,7 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
299
  'needs_shipping' => $this->get_needs_shipping (),
300
  'banner_enabled' => $this->banner_checkout_enabled (),
301
  'currency' => get_woocommerce_currency (),
302
- 'total_label' => __ ( 'Total', 'woo-stripe' ),
303
  'country_code' => wc_get_base_location ()[ 'country' ]
304
  );
305
  }
@@ -357,7 +360,7 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
357
  try {
358
  $result = $this->create_payment_method ( $this->get_new_source_id (), $customer_id );
359
  if (is_wp_error ( $result )) {
360
- wc_add_notice ( sprintf ( __ ( 'Error saving your payment method. Reason: %s', 'woo-stripe' ), $result->get_error_message () ), 'error' );
361
  return array( 'result' => 'error'
362
  );
363
  }
@@ -368,7 +371,7 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
368
  'redirect' => wc_get_account_endpoint_url ( 'payment-methods' )
369
  );
370
  } catch ( \Stripe\Error\Base $e ) {
371
- wc_add_notice ( sprintf ( __ ( 'Error saving payment method. Reason: %s', 'woo-stripe' ), $e->getMessage () ), 'error' );
372
  return array( 'result' => 'error'
373
  );
374
  }
@@ -380,14 +383,14 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
380
  $charge = $order->get_transaction_id ();
381
  try {
382
  if (empty ( $charge )) {
383
- throw new Exception ( __ ( 'Transaction Id cannot be empty.', 'woo-stripe' ) );
384
  }
385
  $result = $this->gateway->refund ( array(
386
  'charge' => $charge,
387
  'amount' => $amount_in_cents
388
  ), wc_stripe_order_mode ( $order ) );
389
  if (! is_wp_error ( $result )) {
390
- $order->add_order_note ( sprintf ( __ ( 'Order refunded in Stripe. Amount: %s', 'woo-stripe' ), wc_price ( $amount, array(
391
  'currency' => $order->get_currency ()
392
  ) ) ) );
393
  return true;
@@ -572,11 +575,11 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
572
  }
573
 
574
  public function get_new_method_label() {
575
- return __ ( 'New Card', 'woo-stripe' );
576
  }
577
 
578
  public function get_saved_methods_label() {
579
- return __ ( 'Saved Cards', 'woo-stripe' );
580
  }
581
 
582
  /**
@@ -755,8 +758,7 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
755
  *
756
  * @var WC_Order_Item_Product $item
757
  */
758
- $product = $item->get_product ();
759
- $meta_data[ 'product_' . $product->get_id () ] = sprintf ( '%s x %s', $product->get_name (), $item->get_quantity () );
760
  }
761
  return apply_filters ( 'wc_stripe_order_meta_data', $meta_data, $order );
762
  }
@@ -774,7 +776,7 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
774
  $token = $this->create_payment_method ( $id, wc_stripe_get_customer_id ( $order->get_user_id () ) );
775
  if (is_wp_error ( $token )) {
776
  $this->wp_error = $token;
777
- $order->add_order_note ( sprintf ( __ ( 'Attemp to save payment method failed. Reason: %s', 'woo-stripe' ), $token->get_error_message () ) );
778
  return $token;
779
  }
780
  $token->set_user_id ( $order->get_user_id () );
@@ -794,9 +796,9 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
794
  */
795
  protected function set_payment_save_error($order, $error) {
796
  if (wcs_stripe_active () && wcs_order_contains_subscription ( $order )) {
797
- $message = __ ( 'We were not able to save your payment method. To prevent billing issues with your subscription, please add a payment method to the subscription.', 'woo-stripe' );
798
  } else {
799
- $message = sprintf ( __ ( 'We were not able to save your payment method. Reason: %s', 'woo-stripe' ), $error->get_error_message () );
800
  }
801
  $order->update_meta_data ( '_wc_stripe_order_error', $message );
802
  $order->save ();
@@ -854,7 +856,7 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
854
  if (! $this->use_saved_source ()) {
855
  $result = $this->save_payment_method ( $this->get_new_source_id (), $subscription );
856
  if (is_wp_error ( $result )) {
857
- wc_add_notice ( sprintf ( __ ( 'Error saving payment method for subscription. Reason: %s', 'woo-stripe' ), $result->get_error_message () ), 'error' );
858
  // redirect to change payment method page.
859
  wp_safe_redirect ( $subscription->get_view_order_url () );
860
  }
@@ -903,7 +905,7 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
903
  * @param WC_Order $order
904
  */
905
  public function get_order_description($order) {
906
- return sprintf ( __ ( 'Order %s from %s', 'woo-stripe' ), $order->get_order_number (), get_bloginfo ( 'name' ) );
907
  }
908
 
909
  public function get_custom_attribute_html($attribs) {
@@ -945,6 +947,23 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
945
  );
946
  }
947
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
948
  /**
949
  *
950
  * @param WC_Order $order
@@ -970,4 +989,22 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
970
  }
971
  }
972
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
973
  }
118
  'subscription_payment_method_updated'
119
  ] );
120
  }
121
+ add_action ( 'wc_pre_orders_process_pre_order_completion_payment_' . $this->id, array(
122
+ $this, 'process_pre_order_payment'
123
+ ) );
124
  }
125
 
126
  public function init_supports() {
302
  'needs_shipping' => $this->get_needs_shipping (),
303
  'banner_enabled' => $this->banner_checkout_enabled (),
304
  'currency' => get_woocommerce_currency (),
305
+ 'total_label' => __ ( 'Total', 'woo-stripe-payment' ),
306
  'country_code' => wc_get_base_location ()[ 'country' ]
307
  );
308
  }
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'
365
  );
366
  }
371
  'redirect' => wc_get_account_endpoint_url ( 'payment-methods' )
372
  );
373
  } catch ( \Stripe\Error\Base $e ) {
374
+ wc_add_notice ( sprintf ( __ ( 'Error saving payment method. Reason: %s', 'woo-stripe-payment' ), $e->getMessage () ), 'error' );
375
  return array( 'result' => 'error'
376
  );
377
  }
383
  $charge = $order->get_transaction_id ();
384
  try {
385
  if (empty ( $charge )) {
386
+ throw new Exception ( __ ( 'Transaction Id cannot be empty.', 'woo-stripe-payment' ) );
387
  }
388
  $result = $this->gateway->refund ( array(
389
  'charge' => $charge,
390
  'amount' => $amount_in_cents
391
  ), wc_stripe_order_mode ( $order ) );
392
  if (! is_wp_error ( $result )) {
393
+ $order->add_order_note ( sprintf ( __ ( 'Order refunded in Stripe. Amount: %s', 'woo-stripe-payment' ), wc_price ( $amount, array(
394
  'currency' => $order->get_currency ()
395
  ) ) ) );
396
  return true;
575
  }
576
 
577
  public function get_new_method_label() {
578
+ return __ ( 'New Card', 'woo-stripe-payment' );
579
  }
580
 
581
  public function get_saved_methods_label() {
582
+ return __ ( 'Saved Cards', 'woo-stripe-payment' );
583
  }
584
 
585
  /**
758
  *
759
  * @var WC_Order_Item_Product $item
760
  */
761
+ $meta_data[ 'product_' . $item->get_product_id () ] = sprintf ( '%s x %s', $item->get_name (), $item->get_quantity () );
 
762
  }
763
  return apply_filters ( 'wc_stripe_order_meta_data', $meta_data, $order );
764
  }
776
  $token = $this->create_payment_method ( $id, wc_stripe_get_customer_id ( $order->get_user_id () ) );
777
  if (is_wp_error ( $token )) {
778
  $this->wp_error = $token;
779
+ $order->add_order_note ( sprintf ( __ ( 'Attemp to save payment method failed. Reason: %s', 'woo-stripe-payment' ), $token->get_error_message () ) );
780
  return $token;
781
  }
782
  $token->set_user_id ( $order->get_user_id () );
796
  */
797
  protected function set_payment_save_error($order, $error) {
798
  if (wcs_stripe_active () && wcs_order_contains_subscription ( $order )) {
799
+ $message = __ ( 'We were not able to save your payment method. To prevent billing issues with your subscription, please add a payment method to the subscription.', 'woo-stripe-payment' );
800
  } else {
801
+ $message = sprintf ( __ ( 'We were not able to save your payment method. Reason: %s', 'woo-stripe-payment' ), $error->get_error_message () );
802
  }
803
  $order->update_meta_data ( '_wc_stripe_order_error', $message );
804
  $order->save ();
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.
861
  wp_safe_redirect ( $subscription->get_view_order_url () );
862
  }
905
  * @param WC_Order $order
906
  */
907
  public function get_order_description($order) {
908
+ return sprintf ( __ ( 'Order %s from %s', 'woo-stripe-payment' ), $order->get_order_number (), get_bloginfo ( 'name' ) );
909
  }
910
 
911
  public function get_custom_attribute_html($attribs) {
947
  );
948
  }
949
 
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
+ }
957
+ } else {
958
+ $this->payment_method_token = $this->get_saved_source_id ();
959
+ }
960
+ WC_Pre_Orders_Order::mark_order_as_pre_ordered ( $order );
961
+ $this->save_zero_total_meta ( $order );
962
+ return array( 'result' => 'success',
963
+ 'redirect' => $order->get_checkout_order_received_url ()
964
+ );
965
+ }
966
+
967
  /**
968
  *
969
  * @param WC_Order $order
989
  }
990
  }
991
  }
992
+
993
+ /**
994
+ * Pre orders can't be mixed with regular products.
995
+ *
996
+ * @param WC_Order $order
997
+ */
998
+ protected function order_contains_pre_order($order) {
999
+ return wc_stripe_pre_orders_active () && WC_Pre_Orders_Order::order_contains_pre_order ( $order );
1000
+ }
1001
+
1002
+ /**
1003
+ *
1004
+ * @param WC_Order $order
1005
+ * @return boolean
1006
+ */
1007
+ protected function pre_order_requires_tokenization($order) {
1008
+ return WC_Pre_Orders_Order::order_requires_payment_tokenization ( $order );
1009
+ }
1010
  }
includes/abstract/abstract-wc-stripe-rest-controller.php CHANGED
@@ -53,7 +53,7 @@ abstract class WC_Stripe_Rest_Controller {
53
  */
54
  public function admin_permission_check($request) {
55
  if (! current_user_can ( 'administrator' )) {
56
- return new WP_Error ( 'permission-error', __ ( 'You do not have permissions to access this resource.', 'woo-stripe' ), array(
57
  'status' => 403
58
  ) );
59
  }
53
  */
54
  public function admin_permission_check($request) {
55
  if (! current_user_can ( 'administrator' )) {
56
+ return new WP_Error ( 'permission-error', __ ( 'You do not have permissions to access this resource.', 'woo-stripe-payment' ), array(
57
  'status' => 403
58
  ) );
59
  }
includes/admin/class-wc-stripe-admin-menus.php CHANGED
@@ -20,18 +20,18 @@ class WC_Stripe_Admin_Menus {
20
  }
21
 
22
  public static function admin_menu() {
23
- add_menu_page ( __ ( 'Stripe Gateway', 'woo-stripe' ), __ ( 'Stripe Gateway', 'woo-stripe' ), 'administrator', 'wc_stripe', null, null, '7.458' );
24
  }
25
 
26
  public static function sub_menu() {
27
- add_submenu_page ( 'wc_stripe', __ ( 'Settings', 'woo-stripe' ), __ ( 'Settings', 'woo-stripe' ), 'administrator', admin_url ( 'admin.php?page=wc-settings&tab=checkout&section=stripe_api' ) );
28
- add_submenu_page ( 'wc_stripe', __ ( 'Logs', 'woo-stripe' ), __ ( 'Logs', 'woo-stripe' ), 'administrator', admin_url ( 'admin.php?page=wc-status&tab=logs' ) );
29
  /*
30
- * add_submenu_page ( 'wc_stripe', __ ( 'Data Migration', 'woo-stripe' ), __ ( 'Data Migration', 'woo-stripe' ), 'administrator', 'wc-stripe-data-migration', array(
31
  * __CLASS__, 'data_migration_page'
32
  * ) );
33
  */
34
- add_submenu_page ( 'wc_stripe', __ ( 'Documentation', 'woo-stripe' ), __ ( 'Documentation', 'woo-stripe' ), 'administrator', 'https://docs.paymentplugins.com/wc-stripe/config' );
35
  }
36
 
37
  public static function remove_submenu() {
20
  }
21
 
22
  public static function admin_menu() {
23
+ add_menu_page ( __ ( 'Stripe Gateway', 'woo-stripe-payment' ), __ ( 'Stripe Gateway', 'woo-stripe-payment' ), 'administrator', 'wc_stripe', null, null, '7.458' );
24
  }
25
 
26
  public static function sub_menu() {
27
+ add_submenu_page ( 'wc_stripe', __ ( 'Settings', 'woo-stripe-payment' ), __ ( 'Settings', 'woo-stripe-payment' ), 'administrator', admin_url ( 'admin.php?page=wc-settings&tab=checkout&section=stripe_api' ) );
28
+ add_submenu_page ( 'wc_stripe', __ ( 'Logs', 'woo-stripe-payment' ), __ ( 'Logs', 'woo-stripe-payment' ), 'administrator', admin_url ( 'admin.php?page=wc-status&tab=logs' ) );
29
  /*
30
+ * add_submenu_page ( 'wc_stripe', __ ( 'Data Migration', 'woo-stripe-payment' ), __ ( 'Data Migration', 'woo-stripe-payment' ), 'administrator', 'wc-stripe-data-migration', array(
31
  * __CLASS__, 'data_migration_page'
32
  * ) );
33
  */
34
+ add_submenu_page ( 'wc_stripe', __ ( 'Documentation', 'woo-stripe-payment' ), __ ( 'Documentation', 'woo-stripe-payment' ), 'administrator', 'https://docs.paymentplugins.com/wc-stripe/config' );
35
  }
36
 
37
  public static function remove_submenu() {
includes/admin/class-wc-stripe-admin-settings.php CHANGED
@@ -70,7 +70,7 @@ class WC_Stripe_Admin_Settings {
70
  }
71
 
72
  public static function admin_settings_tabs($tabs) {
73
- $tabs[ 'stripe_local_gateways' ] = __ ( 'Local Gateways', 'woo-stripe' );
74
  return $tabs;
75
  }
76
 
70
  }
71
 
72
  public static function admin_settings_tabs($tabs) {
73
+ $tabs[ 'stripe_local_gateways' ] = __ ( 'Local Gateways', 'woo-stripe-payment' );
74
  return $tabs;
75
  }
76
 
includes/admin/meta-boxes/views/html-charge-data-subview.php CHANGED
@@ -6,82 +6,82 @@
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')?></h2>
10
  <div>
11
  <input type="text" class="wc_input_price" name="capture_amount"
12
  value="<?php echo $order->get_total()?>"
13
- placeholder="<?php _e('capture amount', 'woo-stripe')?>" />
14
- <button class="button button-secondary do-api-capture"><?php _e('Capture', 'woo-stripe')?></button>
15
- <button class="button button-secondary do-api-cancel"><?php _e('Void', 'woo-stripe')?></button>
16
  </div>
17
  </div>
18
  <?php endif;?>
19
  <?php endif;?>
20
  <div class="data-container">
21
  <div class="charge-data column-6">
22
- <h3><?php _e('Charge Data', 'woo-stripe')?></h3>
23
  <div class="metadata">
24
- <label><?php _e('Mode', 'woo-stripe')?></label>:&nbsp;
25
- <?php $charge->livemode ? _e('Live', 'woo-stripe') : _e('Test', 'wo0o-stripe')?>
26
  </div>
27
  <div class="metadata">
28
- <label><?php _e('Status', 'woo-stripe')?></label>:&nbsp;
29
  <?php echo $charge->status;?>
30
  </div>
31
  <?php if(($payment_intent_id = $order->get_meta('_payment_intent_id', true))):?>
32
  <div class="metadata">
33
- <label><?php _e('Payment Intent', 'woo-stripe')?></label>:&nbsp;
34
  <?php echo $payment_intent_id?>
35
  </div>
36
  <?php endif;?>
37
  <?php if(isset($charge->customer)):?>
38
  <div class="metadata">
39
- <label><?php _e('Customer', 'woo-stripe')?></label>:&nbsp;
40
  <?php echo $charge->customer?>
41
  </div>
42
  <?php endif;?>
43
  </div>
44
  <div class="payment-data column-6">
45
- <h3><?php _e('Payment Method', 'woo-stripe')?></h3>
46
  <div class="metadata">
47
- <label><?php _e('Title', 'woo-stripe')?></label>:&nbsp;
48
  <?php echo $order->get_payment_method_title()?>
49
  </div>
50
  <div class="metadata">
51
- <label><?php _e('Type', 'woo-stripe')?></label>:&nbsp;
52
  <?php echo $charge->payment_method_details->type;?>
53
  </div>
54
  <?php if(isset($charge->payment_method_details->card)):?>
55
  <div class="metadata">
56
- <label><?php _e('Exp', 'woo-stripe')?>:&nbsp;</label>
57
  <?php printf('%02d / %s', $charge->payment_method_details->card->exp_month, $charge->payment_method_details->card->exp_year)?>
58
  </div>
59
  <div class="metadata">
60
- <label><?php _e('Fingerprint', 'woo-stripe')?>:&nbsp;</label>
61
  <?php echo $charge->payment_method_details->card->fingerprint;?>
62
  </div>
63
  <div class="metadata">
64
- <label><?php _e('CVC check', 'woo-stripe')?>:&nbsp;</label>
65
  <?php echo $charge->payment_method_details->card->checks->cvc_check;?>
66
  </div>
67
  <div class="metadata">
68
- <label><?php _e('Postal check', 'woo-stripe')?>:&nbsp;</label>
69
  <?php echo $charge->payment_method_details->card->checks->address_postal_code_check;?>
70
  </div>
71
  <div class="metadata">
72
- <label><?php _e('Street check', 'woo-stripe')?>:&nbsp;</label>
73
  <?php echo $charge->payment_method_details->card->checks->address_line1_check;?>
74
  </div>
75
  <?php endif;?>
76
  </div>
77
  <div class="payment-data column-6">
78
- <h3><?php _e('Riska Data', 'woo-stripe')?></h3>
79
  <div class="metadata">
80
- <label><?php _e('Score', 'woo-stripe')?></label>
81
  <?php echo $charge->outcome->risk_score;?>
82
  </div>
83
  <div class="metadata">
84
- <label><?php _e('Level', 'woo-stripe')?></label>
85
  <?php echo $charge->outcome->risk_level;?>
86
  </div>
87
  </div>
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>
11
  <input type="text" class="wc_input_price" name="capture_amount"
12
  value="<?php echo $order->get_total()?>"
13
+ placeholder="<?php _e('capture amount', 'woo-stripe-payment')?>" />
14
+ <button class="button button-secondary do-api-capture"><?php _e('Capture', 'woo-stripe-payment')?></button>
15
+ <button class="button button-secondary do-api-cancel"><?php _e('Void', 'woo-stripe-payment')?></button>
16
  </div>
17
  </div>
18
  <?php endif;?>
19
  <?php endif;?>
20
  <div class="data-container">
21
  <div class="charge-data column-6">
22
+ <h3><?php _e('Charge Data', 'woo-stripe-payment')?></h3>
23
  <div class="metadata">
24
+ <label><?php _e('Mode', 'woo-stripe-payment')?></label>:&nbsp;
25
+ <?php $charge->livemode ? _e('Live', 'woo-stripe-payment') : _e('Test', 'wo0o-stripe')?>
26
  </div>
27
  <div class="metadata">
28
+ <label><?php _e('Status', 'woo-stripe-payment')?></label>:&nbsp;
29
  <?php echo $charge->status;?>
30
  </div>
31
  <?php if(($payment_intent_id = $order->get_meta('_payment_intent_id', true))):?>
32
  <div class="metadata">
33
+ <label><?php _e('Payment Intent', 'woo-stripe-payment')?></label>:&nbsp;
34
  <?php echo $payment_intent_id?>
35
  </div>
36
  <?php endif;?>
37
  <?php if(isset($charge->customer)):?>
38
  <div class="metadata">
39
+ <label><?php _e('Customer', 'woo-stripe-payment')?></label>:&nbsp;
40
  <?php echo $charge->customer?>
41
  </div>
42
  <?php endif;?>
43
  </div>
44
  <div class="payment-data column-6">
45
+ <h3><?php _e('Payment Method', 'woo-stripe-payment')?></h3>
46
  <div class="metadata">
47
+ <label><?php _e('Title', 'woo-stripe-payment')?></label>:&nbsp;
48
  <?php echo $order->get_payment_method_title()?>
49
  </div>
50
  <div class="metadata">
51
+ <label><?php _e('Type', 'woo-stripe-payment')?></label>:&nbsp;
52
  <?php echo $charge->payment_method_details->type;?>
53
  </div>
54
  <?php if(isset($charge->payment_method_details->card)):?>
55
  <div class="metadata">
56
+ <label><?php _e('Exp', 'woo-stripe-payment')?>:&nbsp;</label>
57
  <?php printf('%02d / %s', $charge->payment_method_details->card->exp_month, $charge->payment_method_details->card->exp_year)?>
58
  </div>
59
  <div class="metadata">
60
+ <label><?php _e('Fingerprint', 'woo-stripe-payment')?>:&nbsp;</label>
61
  <?php echo $charge->payment_method_details->card->fingerprint;?>
62
  </div>
63
  <div class="metadata">
64
+ <label><?php _e('CVC check', 'woo-stripe-payment')?>:&nbsp;</label>
65
  <?php echo $charge->payment_method_details->card->checks->cvc_check;?>
66
  </div>
67
  <div class="metadata">
68
+ <label><?php _e('Postal check', 'woo-stripe-payment')?>:&nbsp;</label>
69
  <?php echo $charge->payment_method_details->card->checks->address_postal_code_check;?>
70
  </div>
71
  <div class="metadata">
72
+ <label><?php _e('Street check', 'woo-stripe-payment')?>:&nbsp;</label>
73
  <?php echo $charge->payment_method_details->card->checks->address_line1_check;?>
74
  </div>
75
  <?php endif;?>
76
  </div>
77
  <div class="payment-data column-6">
78
+ <h3><?php _e('Riska Data', 'woo-stripe-payment')?></h3>
79
  <div class="metadata">
80
+ <label><?php _e('Score', 'woo-stripe-payment')?></label>
81
  <?php echo $charge->outcome->risk_score;?>
82
  </div>
83
  <div class="metadata">
84
+ <label><?php _e('Level', 'woo-stripe-payment')?></label>
85
  <?php echo $charge->outcome->risk_level;?>
86
  </div>
87
  </div>
includes/admin/meta-boxes/views/html-order-actions.php CHANGED
@@ -1,15 +1,15 @@
1
- <p><b><?php _e('Charge Status', 'woo-stripe')?>:</b>&nbsp;<?php echo ucfirst(str_replace('_', ' ', $status))?></p>
2
  <?php if($status === 'pending' && $order->get_meta('_authorization_exp_at')):
3
  $date = new DateTime('@' . $order->get_meta('_authorization_exp_at'));
4
  ?>
5
- <p><b><?php _e('Authorization Expires', 'woo-stripe')?>:</b>&nbsp;<?php echo date_format($date, 'M d Y, h:i A e')?>
6
  <?php endif;?>
7
  <?php
8
  switch ($status) {
9
  case 'succeeded' :
10
  case 'faied' :
11
  ?>
12
- <p><?php _e ( 'There are no actions available at this time.', 'woo-stripe' )?></p>
13
  <?php
14
  return;
15
  }
@@ -18,7 +18,7 @@ $can_settle = $status === 'pending';
18
  <div id="wc-stripe-actions">
19
  <div class="wc-stripe-buttons-container">
20
  <?php if($can_settle):?>
21
- <button type="button" class="button capture-charge"><?php esc_html_e('Capture Charge', 'woo-stripe')?></button>
22
  <?php endif;?>
23
  </div>
24
  <div class="wc-order-data-row wc-order-capture-charge"
@@ -26,11 +26,11 @@ $can_settle = $status === 'pending';
26
  <div class="wc-order-capture-charge-container">
27
  <table class="wc-order-capture-charge">
28
  <tr>
29
- <td class="label"><?php esc_html_e('Total available to capture', 'woo-stripe')?>:</td>
30
  <td class="total"><?php echo wc_price($order->get_total())?></td>
31
  </tr>
32
  <tr>
33
- <td class="label"><?php esc_html_e('Amount To Capture', 'woo-stripe')?>:</td>
34
  <td class="total"><input type="text" id="worldpay_capture_amount"
35
  name="capture_amount" class="wc_input_price" />
36
  <div class="clear"></div></td>
@@ -39,8 +39,8 @@ $can_settle = $status === 'pending';
39
  </div>
40
  <div class="clear"></div>
41
  <div class="capture-actions">
42
- <button type="button" class="button button-primary do-api-capture"><?php esc_html_e( 'Capture', 'woo-stripe' ); ?></button>
43
- <button type="button" class="button cancel-action"><?php esc_html_e( 'Cancel', 'woo-stripe' ); ?></button>
44
  </div>
45
  <div class="clear"></div>
46
  </div>
1
+ <p><b><?php _e('Charge Status', 'woo-stripe-payment')?>:</b>&nbsp;<?php echo ucfirst(str_replace('_', ' ', $status))?></p>
2
  <?php if($status === 'pending' && $order->get_meta('_authorization_exp_at')):
3
  $date = new DateTime('@' . $order->get_meta('_authorization_exp_at'));
4
  ?>
5
+ <p><b><?php _e('Authorization Expires', 'woo-stripe-payment')?>:</b>&nbsp;<?php echo date_format($date, 'M d Y, h:i A e')?>
6
  <?php endif;?>
7
  <?php
8
  switch ($status) {
9
  case 'succeeded' :
10
  case 'faied' :
11
  ?>
12
+ <p><?php _e ( 'There are no actions available at this time.', 'woo-stripe-payment' )?></p>
13
  <?php
14
  return;
15
  }
18
  <div id="wc-stripe-actions">
19
  <div class="wc-stripe-buttons-container">
20
  <?php if($can_settle):?>
21
+ <button type="button" class="button capture-charge"><?php esc_html_e('Capture Charge', 'woo-stripe-payment')?></button>
22
  <?php endif;?>
23
  </div>
24
  <div class="wc-order-data-row wc-order-capture-charge"
26
  <div class="wc-order-capture-charge-container">
27
  <table class="wc-order-capture-charge">
28
  <tr>
29
+ <td class="label"><?php esc_html_e('Total available to capture', 'woo-stripe-payment')?>:</td>
30
  <td class="total"><?php echo wc_price($order->get_total())?></td>
31
  </tr>
32
  <tr>
33
+ <td class="label"><?php esc_html_e('Amount To Capture', 'woo-stripe-payment')?>:</td>
34
  <td class="total"><input type="text" id="worldpay_capture_amount"
35
  name="capture_amount" class="wc_input_price" />
36
  <div class="clear"></div></td>
39
  </div>
40
  <div class="clear"></div>
41
  <div class="capture-actions">
42
+ <button type="button" class="button button-primary do-api-capture"><?php esc_html_e( 'Capture', 'woo-stripe-payment' ); ?></button>
43
+ <button type="button" class="button cancel-action"><?php esc_html_e( 'Cancel', 'woo-stripe-payment' ); ?></button>
44
  </div>
45
  <div class="clear"></div>
46
  </div>
includes/admin/meta-boxes/views/html-order-charge-data.php CHANGED
@@ -1,5 +1,5 @@
1
  <div class="transaction-data">
2
- <h3><?php _e('Transaction Data / Actions', 'woo-stripe')?></h3>
3
  <a href="#" class="do-transaction-view"
4
  data-order="<?php echo $order->get_id()?>"></a>
5
  </div>
1
  <div class="transaction-data">
2
+ <h3><?php _e('Transaction Data / Actions', 'woo-stripe-payment')?></h3>
3
  <a href="#" class="do-transaction-view"
4
  data-order="<?php echo $order->get_id()?>"></a>
5
  </div>
includes/admin/meta-boxes/views/html-order-pay.php CHANGED
@@ -1,6 +1,6 @@
1
  <p class="form-field form-field-wide">
2
- <button class="button button-secondary wc-stripe-pay-order"><?php _e('Pay for Order', 'woo-stripe')?></button>
3
- <?php echo wc_help_tip(__('Admins can process customer orders over the phone using this functionality.', 'woo-stripe'))?>
4
  </p>
5
  <script type="text/template" id="tmpl-wc-stripe-modal-pay-order">
6
  <div class="wc-backbone-modal">
@@ -18,16 +18,16 @@
18
  <input type="hidden" name="wc_stripe_payment_method" value="stripe_cc"/>
19
  <input type="hidden" name="order_id" value="{{{data.order_id}}}"/>
20
  <div class="modal-wide option">
21
- <label><?php _e('Charge Type', 'woo-stripe')?></label>
22
  <select name="wc_stripe_charge_type" class="wc-select2">
23
- <option value="capture"><?php _e('Capture', 'woo-stripe')?></value>
24
- <option value="authorize"><?php _e('Authorize', 'woo-stripe')?></value>
25
  </select>
26
  </div>
27
  <#if(data.payment_methods.length){#>
28
  <div class="modal-wide">
29
  <input type="radio" value="token" name="payment_type" checked/>
30
- <label class=""><?php _e('Saved Cards', 'woo-stripe')?></label>
31
  <div class="token-container show_if_token hide_if_nonce">
32
  <select name="payment_token_id" class="wc-select2">
33
  <#_.each(data.payment_methods, function(method){#>
@@ -39,7 +39,7 @@
39
  <#}#>
40
  <div class="modal-wide">
41
  <input type="radio" value="nonce" name="payment_type" class="" <#if(!data.payment_methods.length){#>checked<#}#>/>
42
- <label class=""><?php _e('New Card', 'woo-stripe')?></label>
43
  <input type="hidden" name="payment_nonce"/>
44
  <div id="wc-stripe-card-container" class="wc-stripe-card-container show_if_nonce hide_if_token">
45
  <div id="card-element"></div>
@@ -49,7 +49,7 @@
49
  </article>
50
  <footer>
51
  <div class="inner">
52
- <button id="pay-order" class="button button-primary button-large"><?php esc_html_e( 'Pay', 'woo-stripe' ); ?></button>
53
  </div>
54
  </footer>
55
  </section>
1
  <p class="form-field form-field-wide">
2
+ <button class="button button-secondary wc-stripe-pay-order"><?php _e('Pay for Order', 'woo-stripe-payment')?></button>
3
+ <?php echo wc_help_tip(__('Admins can process customer orders over the phone using this functionality.', 'woo-stripe-payment'))?>
4
  </p>
5
  <script type="text/template" id="tmpl-wc-stripe-modal-pay-order">
6
  <div class="wc-backbone-modal">
18
  <input type="hidden" name="wc_stripe_payment_method" value="stripe_cc"/>
19
  <input type="hidden" name="order_id" value="{{{data.order_id}}}"/>
20
  <div class="modal-wide option">
21
+ <label><?php _e('Charge Type', 'woo-stripe-payment')?></label>
22
  <select name="wc_stripe_charge_type" class="wc-select2">
23
+ <option value="capture"><?php _e('Capture', 'woo-stripe-payment')?></value>
24
+ <option value="authorize"><?php _e('Authorize', 'woo-stripe-payment')?></value>
25
  </select>
26
  </div>
27
  <#if(data.payment_methods.length){#>
28
  <div class="modal-wide">
29
  <input type="radio" value="token" name="payment_type" checked/>
30
+ <label class=""><?php _e('Saved Cards', 'woo-stripe-payment')?></label>
31
  <div class="token-container show_if_token hide_if_nonce">
32
  <select name="payment_token_id" class="wc-select2">
33
  <#_.each(data.payment_methods, function(method){#>
39
  <#}#>
40
  <div class="modal-wide">
41
  <input type="radio" value="nonce" name="payment_type" class="" <#if(!data.payment_methods.length){#>checked<#}#>/>
42
+ <label class=""><?php _e('New Card', 'woo-stripe-payment')?></label>
43
  <input type="hidden" name="payment_nonce"/>
44
  <div id="wc-stripe-card-container" class="wc-stripe-card-container show_if_nonce hide_if_token">
45
  <div id="card-element"></div>
49
  </article>
50
  <footer>
51
  <div class="inner">
52
+ <button id="pay-order" class="button button-primary button-large"><?php esc_html_e( 'Pay', 'woo-stripe-payment' ); ?></button>
53
  </div>
54
  </footer>
55
  </section>
includes/admin/settings/class-wc-stripe-api-settings.php CHANGED
@@ -3,7 +3,7 @@ class WC_Stripe_API_Settings extends WC_Stripe_Settings_API {
3
 
4
  public function __construct() {
5
  $this->id = 'stripe_api';
6
- $this->tab_title = __ ( 'API Settings', 'woo-stripe' );
7
  parent::__construct ();
8
  }
9
 
@@ -23,23 +23,23 @@ class WC_Stripe_API_Settings extends WC_Stripe_Settings_API {
23
  public function init_form_fields() {
24
  $this->form_fields = array(
25
  'title' => array( 'type' => 'title',
26
- 'title' => __ ( 'API Settings', 'woo-stripe' )
27
  ),
28
  'mode' => array( 'type' => 'select',
29
- 'title' => __ ( 'Mode', 'woo-stripe' ),
30
  'class' => 'wc-enhanced-select',
31
  'options' => array(
32
- 'test' => __ ( 'Test', 'woo-stripe' ),
33
- 'live' => __ ( 'Live', 'woo-stripe' )
34
  ), 'default' => 'test',
35
  'desc_tip' => true,
36
- 'description' => __ ( 'The mode determines if you are processing test transaction or live transactions on your site. Test mode allows you to simulate payments so you can test your integration.', 'woo-stripe' )
37
  ),
38
  'publishable_key_test' => array(
39
- 'title' => __ ( 'Test Publishable Key', 'woo-stripe' ),
40
  'type' => 'text', 'default' => '',
41
  'desc_tip' => true,
42
- 'description' => __ ( 'Your publishable key is used to initialize Stripe assets.', 'woo-stripe' ),
43
  'custom_attributes' => array(
44
  'data-show-if' => array(
45
  'mode' => 'test'
@@ -47,10 +47,10 @@ class WC_Stripe_API_Settings extends WC_Stripe_Settings_API {
47
  )
48
  ),
49
  'secret_key_test' => array(
50
- 'title' => __ ( 'Test Secret Key', 'woo-stripe' ),
51
  'type' => 'password',
52
  'default' => '', 'desc_tip' => true,
53
- 'description' => __ ( 'Your secret key is used to authenticate requests to Stripe.', 'woo-stripe' ),
54
  'custom_attributes' => array(
55
  'data-show-if' => array(
56
  'mode' => 'test'
@@ -58,10 +58,10 @@ class WC_Stripe_API_Settings extends WC_Stripe_Settings_API {
58
  )
59
  ),
60
  'publishable_key_live' => array(
61
- 'title' => __ ( 'Live Publishable Key', 'woo-stripe' ),
62
  'type' => 'text', 'default' => '',
63
  'desc_tip' => true,
64
- 'description' => __ ( 'Your publishable key is used to initialize Stripe assets.', 'woo-stripe' ),
65
  'custom_attributes' => array(
66
  'data-show-if' => array(
67
  'mode' => 'live'
@@ -69,10 +69,10 @@ class WC_Stripe_API_Settings extends WC_Stripe_Settings_API {
69
  )
70
  ),
71
  'secret_key_live' => array(
72
- 'title' => __ ( 'Live Secret Key', 'woo-stripe' ),
73
  'type' => 'password',
74
  'default' => '', 'desc_tip' => true,
75
- 'description' => __ ( 'Your secret key is used to authenticate requests to Stripe.', 'woo-stripe' ),
76
  'custom_attributes' => array(
77
  'data-show-if' => array(
78
  'mode' => 'live'
@@ -81,22 +81,22 @@ class WC_Stripe_API_Settings extends WC_Stripe_Settings_API {
81
  ),
82
  'webhook_url' => array(
83
  'type' => 'paragraph',
84
- 'title' => __ ( 'Webhook url', 'woo-stripe' ),
85
  'class' => 'wc-stripe-webhook',
86
  'text' => wc_stripe ()->rest_api->webhook->rest_url ( 'webhook' ),
87
- 'description' => sprintf ( __ ( '<strong>Important:</strong> the webhook url is called by Stripe when events occur in your account, like a source becomes chargeable. You must add this webhook to your Stripe Dashboard if you are using any of the local gateways. %sWebhook guide%s', 'woo-stripe' ), '<a target="_blank" href="https://docs.paymentplugins.com/wc-stripe/config/#/webhooks?id=confgure-webooks">', '</a>' )
88
  ),
89
  'webhook_secret' => array(
90
  'type' => 'password',
91
- 'title' => __ ( 'Webhook Secret', 'woo-stripe' ),
92
- 'description' => __ ( 'The webhook secret is used to authenticate webhooks sent from Stripe. It ensures no 3rd party can send you events, pretending to be Stripe.', 'woo-stripe' )
93
  ),
94
  'debug_log' => array(
95
- 'title' => __ ( 'Debug Log', 'woo-stripe' ),
96
  'type' => 'checkbox',
97
  'desc_tip' => true,
98
  'default' => 'yes',
99
- 'description' => __ ( 'When enabled, the plugin logs important errors and info that can help you troubleshoot potential issues.', 'woo-stripe' )
100
  )
101
  );
102
  }
3
 
4
  public function __construct() {
5
  $this->id = 'stripe_api';
6
+ $this->tab_title = __ ( 'API Settings', 'woo-stripe-payment' );
7
  parent::__construct ();
8
  }
9
 
23
  public function init_form_fields() {
24
  $this->form_fields = array(
25
  'title' => array( 'type' => 'title',
26
+ 'title' => __ ( 'API Settings', 'woo-stripe-payment' )
27
  ),
28
  'mode' => array( 'type' => 'select',
29
+ 'title' => __ ( 'Mode', 'woo-stripe-payment' ),
30
  'class' => 'wc-enhanced-select',
31
  'options' => array(
32
+ 'test' => __ ( 'Test', 'woo-stripe-payment' ),
33
+ 'live' => __ ( 'Live', 'woo-stripe-payment' )
34
  ), 'default' => 'test',
35
  'desc_tip' => true,
36
+ 'description' => __ ( 'The mode determines if you are processing test transaction or live transactions on your site. Test mode allows you to simulate payments so you can test your integration.', 'woo-stripe-payment' )
37
  ),
38
  'publishable_key_test' => array(
39
+ 'title' => __ ( 'Test Publishable Key', 'woo-stripe-payment' ),
40
  'type' => 'text', 'default' => '',
41
  'desc_tip' => true,
42
+ 'description' => __ ( 'Your publishable key is used to initialize Stripe assets.', 'woo-stripe-payment' ),
43
  'custom_attributes' => array(
44
  'data-show-if' => array(
45
  'mode' => 'test'
47
  )
48
  ),
49
  'secret_key_test' => array(
50
+ 'title' => __ ( 'Test Secret Key', 'woo-stripe-payment' ),
51
  'type' => 'password',
52
  'default' => '', 'desc_tip' => true,
53
+ 'description' => __ ( 'Your secret key is used to authenticate requests to Stripe.', 'woo-stripe-payment' ),
54
  'custom_attributes' => array(
55
  'data-show-if' => array(
56
  'mode' => 'test'
58
  )
59
  ),
60
  'publishable_key_live' => array(
61
+ 'title' => __ ( 'Live Publishable Key', 'woo-stripe-payment' ),
62
  'type' => 'text', 'default' => '',
63
  'desc_tip' => true,
64
+ 'description' => __ ( 'Your publishable key is used to initialize Stripe assets.', 'woo-stripe-payment' ),
65
  'custom_attributes' => array(
66
  'data-show-if' => array(
67
  'mode' => 'live'
69
  )
70
  ),
71
  'secret_key_live' => array(
72
+ 'title' => __ ( 'Live Secret Key', 'woo-stripe-payment' ),
73
  'type' => 'password',
74
  'default' => '', 'desc_tip' => true,
75
+ 'description' => __ ( 'Your secret key is used to authenticate requests to Stripe.', 'woo-stripe-payment' ),
76
  'custom_attributes' => array(
77
  'data-show-if' => array(
78
  'mode' => 'live'
81
  ),
82
  'webhook_url' => array(
83
  'type' => 'paragraph',
84
+ 'title' => __ ( 'Webhook url', 'woo-stripe-payment' ),
85
  'class' => 'wc-stripe-webhook',
86
  'text' => wc_stripe ()->rest_api->webhook->rest_url ( 'webhook' ),
87
+ 'description' => sprintf ( __ ( '<strong>Important:</strong> the webhook url is called by Stripe when events occur in your account, like a source becomes chargeable. You must add this webhook to your Stripe Dashboard if you are using any of the local gateways. %sWebhook guide%s', 'woo-stripe-payment' ), '<a target="_blank" href="https://docs.paymentplugins.com/wc-stripe/config/#/webhooks?id=confgure-webooks">', '</a>' )
88
  ),
89
  'webhook_secret' => array(
90
  'type' => 'password',
91
+ 'title' => __ ( 'Webhook Secret', 'woo-stripe-payment' ),
92
+ 'description' => __ ( 'The webhook secret is used to authenticate webhooks sent from Stripe. It ensures no 3rd party can send you events, pretending to be Stripe.', 'woo-stripe-payment' )
93
  ),
94
  'debug_log' => array(
95
+ 'title' => __ ( 'Debug Log', 'woo-stripe-payment' ),
96
  'type' => 'checkbox',
97
  'desc_tip' => true,
98
  'default' => 'yes',
99
+ 'description' => __ ( 'When enabled, the plugin logs important errors and info that can help you troubleshoot potential issues.', 'woo-stripe-payment' )
100
  )
101
  );
102
  }
includes/admin/views/html-settings-nav.php CHANGED
@@ -14,5 +14,5 @@ $tabs = apply_filters('wc_stripe_settings_nav_tabs', array());
14
  </div>
15
  <div class="clear"></div>
16
  <div class="wc-stripe-docs">
17
- <a target="_blank" class="button button-secondary" href="https://docs.paymentplugins.com/wc-stripe/config/#/<?php echo $current_section?>"><?php _e('Documentation', 'woo-stripe')?></a>
18
  </div>
14
  </div>
15
  <div class="clear"></div>
16
  <div class="wc-stripe-docs">
17
+ <a target="_blank" class="button button-secondary" href="https://docs.paymentplugins.com/wc-stripe/config/#/<?php echo $current_section?>"><?php _e('Documentation', 'woo-stripe-payment')?></a>
18
  </div>
includes/admin/views/html-user-profile.php CHANGED
@@ -4,34 +4,34 @@
4
  */
5
  ?>
6
  <div class="wc-stripe-user-info">
7
- <h2><?php _e('Stripe Customer ID\'s', 'woo-stripe')?></h2>
8
  <p><?php _e('If you change a customer ID, the customer\'s payment methods will be imported from your Stripe account.')?></p>
9
  <p><?php _e('If you remove a customer ID, the customer\'s payment methods will be removed from the WC payment methods table.')?></p>
10
  <table class="form-table">
11
  <tbody>
12
  <tr>
13
- <th><?php _e('Live ID', 'woo-stripe')?></th>
14
  <td>
15
  <input type="text" id="wc_stripe_live_id" name="wc_stripe_live_id" value="<?php echo wc_stripe_get_customer_id($user->ID, 'live')?>"
16
  </td>
17
  </tr>
18
  <tr>
19
- <th><?php _e('Test ID', 'woo-stripe')?></th>
20
  <td>
21
  <input type="text" id="wc_stripe_test_id" name="wc_stripe_test_id" value="<?php echo wc_stripe_get_customer_id($user->ID, 'test')?>"
22
  </td>
23
  </tr>
24
  </tbody>
25
  </table>
26
- <h2><?php _e('Stripe Live Payment Methods', 'woo-stripe')?></h2>
27
  <?php if($payment_methods['live']):?>
28
  <table class="wc-stripe-payment-methods">
29
  <thead>
30
  <tr>
31
- <th><?php _e('Payment Gateway', 'woo-stripe')?></th>
32
- <th><?php _e('Payment Method', 'woo-stripe')?></th>
33
- <th><?php _e('Token', 'woo-stripe')?></th>
34
- <th><?php _e('Actions', 'woo-stripe')?></th>
35
  </tr>
36
  </thead>
37
  <tbody>
@@ -47,25 +47,25 @@
47
  <th><?php _e('Action', 'delete')?></th>
48
  <td>
49
  <select name="live_payment_method_actions">
50
- <option value="none" selected><?php _e('No Action', 'woo-stripe')?></option>
51
- <option value="delete"><?php _e('Delete', 'woo-stripe')?></option>
52
  </select>
53
  </td>
54
  </tr>
55
  </tbody>
56
  </table>
57
  <?php else:?>
58
- <?php _e('No live payment methods saved', 'woo-stripe')?>
59
  <?php endif;?>
60
- <h2><?php _e('Stripe Test Payment Methods', 'woo-stripe')?></h2>
61
  <?php if($payment_methods['test']):?>
62
  <table class="wc-stripe-payment-methods">
63
  <thead>
64
  <tr>
65
- <th><?php _e('Payment Gateway', 'woo-stripe')?></th>
66
- <th><?php _e('Payment Method', 'woo-stripe')?></th>
67
- <th><?php _e('Token', 'woo-stripe')?></th>
68
- <th><?php _e('Actions', 'woo-stripe')?></th>
69
  </tr>
70
  </thead>
71
  <tbody>
@@ -81,15 +81,15 @@
81
  <th><?php _e('Action', 'delete')?></th>
82
  <td>
83
  <select name="test_payment_method_actions">
84
- <option value="none" selected><?php _e('No Action', 'woo-stripe')?></option>
85
- <option value="delete"><?php _e('Delete', 'woo-stripe')?></option>
86
  </select>
87
  </td>
88
  </tr>
89
  </tbody>
90
  </table>
91
  <?php else:?>
92
- <?php _e('No test payment methods saved', 'woo-stripe')?>
93
  <?php endif;?>
94
- <?php printf(__('%snote:%s payment methods will be deleted in Stripe if you use the delete action.', 'woo-stripe'), '<strong>', '</strong>')?>
95
  </div>
4
  */
5
  ?>
6
  <div class="wc-stripe-user-info">
7
+ <h2><?php _e('Stripe Customer ID\'s', 'woo-stripe-payment')?></h2>
8
  <p><?php _e('If you change a customer ID, the customer\'s payment methods will be imported from your Stripe account.')?></p>
9
  <p><?php _e('If you remove a customer ID, the customer\'s payment methods will be removed from the WC payment methods table.')?></p>
10
  <table class="form-table">
11
  <tbody>
12
  <tr>
13
+ <th><?php _e('Live ID', 'woo-stripe-payment')?></th>
14
  <td>
15
  <input type="text" id="wc_stripe_live_id" name="wc_stripe_live_id" value="<?php echo wc_stripe_get_customer_id($user->ID, 'live')?>"
16
  </td>
17
  </tr>
18
  <tr>
19
+ <th><?php _e('Test ID', 'woo-stripe-payment')?></th>
20
  <td>
21
  <input type="text" id="wc_stripe_test_id" name="wc_stripe_test_id" value="<?php echo wc_stripe_get_customer_id($user->ID, 'test')?>"
22
  </td>
23
  </tr>
24
  </tbody>
25
  </table>
26
+ <h2><?php _e('Stripe Live Payment Methods', 'woo-stripe-payment')?></h2>
27
  <?php if($payment_methods['live']):?>
28
  <table class="wc-stripe-payment-methods">
29
  <thead>
30
  <tr>
31
+ <th><?php _e('Payment Gateway', 'woo-stripe-payment')?></th>
32
+ <th><?php _e('Payment Method', 'woo-stripe-payment')?></th>
33
+ <th><?php _e('Token', 'woo-stripe-payment')?></th>
34
+ <th><?php _e('Actions', 'woo-stripe-payment')?></th>
35
  </tr>
36
  </thead>
37
  <tbody>
47
  <th><?php _e('Action', 'delete')?></th>
48
  <td>
49
  <select name="live_payment_method_actions">
50
+ <option value="none" selected><?php _e('No Action', 'woo-stripe-payment')?></option>
51
+ <option value="delete"><?php _e('Delete', 'woo-stripe-payment')?></option>
52
  </select>
53
  </td>
54
  </tr>
55
  </tbody>
56
  </table>
57
  <?php else:?>
58
+ <?php _e('No live payment methods saved', 'woo-stripe-payment')?>
59
  <?php endif;?>
60
+ <h2><?php _e('Stripe Test Payment Methods', 'woo-stripe-payment')?></h2>
61
  <?php if($payment_methods['test']):?>
62
  <table class="wc-stripe-payment-methods">
63
  <thead>
64
  <tr>
65
+ <th><?php _e('Payment Gateway', 'woo-stripe-payment')?></th>
66
+ <th><?php _e('Payment Method', 'woo-stripe-payment')?></th>
67
+ <th><?php _e('Token', 'woo-stripe-payment')?></th>
68
+ <th><?php _e('Actions', 'woo-stripe-payment')?></th>
69
  </tr>
70
  </thead>
71
  <tbody>
81
  <th><?php _e('Action', 'delete')?></th>
82
  <td>
83
  <select name="test_payment_method_actions">
84
+ <option value="none" selected><?php _e('No Action', 'woo-stripe-payment')?></option>
85
+ <option value="delete"><?php _e('Delete', 'woo-stripe-payment')?></option>
86
  </select>
87
  </td>
88
  </tr>
89
  </tbody>
90
  </table>
91
  <?php else:?>
92
+ <?php _e('No test payment methods saved', 'woo-stripe-payment')?>
93
  <?php endif;?>
94
+ <?php printf(__('%snote:%s payment methods will be deleted in Stripe if you use the delete action.', 'woo-stripe-payment'), '<strong>', '</strong>')?>
95
  </div>
includes/class-stripe.php CHANGED
@@ -21,7 +21,7 @@ class WC_Stripe_Manager {
21
  *
22
  * @var string
23
  */
24
- public $version = '3.0.0';
25
 
26
  /**
27
  *
@@ -48,6 +48,9 @@ class WC_Stripe_Manager {
48
  private $payment_gateways;
49
 
50
  public function __construct() {
 
 
 
51
  add_action ( 'init', array( $this, 'init'
52
  ) );
53
  add_action ( 'admin_init', array( $this,
@@ -90,6 +93,10 @@ class WC_Stripe_Manager {
90
  return WC_STRIPE_PLUGIN_PATH;
91
  }
92
 
 
 
 
 
93
  /**
94
  * Function that is hooked in to the Wordpress init action.
95
  */
21
  *
22
  * @var string
23
  */
24
+ public $version = '3.0.1';
25
 
26
  /**
27
  *
48
  private $payment_gateways;
49
 
50
  public function __construct() {
51
+ add_action ( 'plugins_loaded', array( $this,
52
+ 'plugins_loaded'
53
+ ), 10 );
54
  add_action ( 'init', array( $this, 'init'
55
  ) );
56
  add_action ( 'admin_init', array( $this,
93
  return WC_STRIPE_PLUGIN_PATH;
94
  }
95
 
96
+ public function plugins_loaded() {
97
+ load_plugin_textdomain ( 'woo-stripe-payment', false, dirname ( WC_STRIPE_PLUGIN_NAME ) . '/i18n/languages' );
98
+ }
99
+
100
  /**
101
  * Function that is hooked in to the Wordpress init action.
102
  */
includes/class-wc-stripe-customer-manager.php CHANGED
@@ -27,7 +27,7 @@ class WC_Stripe_Customer_Manager {
27
  if ($this->should_update_customer ( $customer )) {
28
  $result = $this->update_customer ( $customer );
29
  if (is_wp_error ( $result )) {
30
- wc_add_notice ( __ ( 'Error saving customer. Reason: %s', 'woo-stripe' ), $customer_id->get_error_message () );
31
  }
32
  }
33
  } else {
@@ -37,7 +37,7 @@ class WC_Stripe_Customer_Manager {
37
  if (! is_wp_error ( $customer_id )) {
38
  wc_stripe_save_customer ( $customer_id, $customer->get_id () );
39
  } else {
40
- wc_add_notice ( __ ( 'Error saving customer. Reason: %s', 'woo-stripe' ), $customer_id->get_error_message () );
41
  }
42
  }
43
  }
27
  if ($this->should_update_customer ( $customer )) {
28
  $result = $this->update_customer ( $customer );
29
  if (is_wp_error ( $result )) {
30
+ wc_add_notice ( __ ( 'Error saving customer. Reason: %s', 'woo-stripe-payment' ), $customer_id->get_error_message () );
31
  }
32
  }
33
  } else {
37
  if (! is_wp_error ( $customer_id )) {
38
  wc_stripe_save_customer ( $customer_id, $customer->get_id () );
39
  } else {
40
+ wc_add_notice ( __ ( 'Error saving customer. Reason: %s', 'woo-stripe-payment' ), $customer_id->get_error_message () );
41
  }
42
  }
43
  }
includes/class-wc-stripe-frontend-notices.php CHANGED
@@ -32,7 +32,7 @@ class WC_Stripe_Frontend_Notices {
32
  if ($gateway instanceof WC_Payment_Gateway_Stripe_Local_Payment) {
33
  $notices[] = wc_get_template_html ( "notices/notice.php", [
34
  'messages' => [
35
- __ ( 'Your payment is being processed and your order status will be updated once the funds are received.', 'woo-stripe' )
36
  ]
37
  ] );
38
  }
32
  if ($gateway instanceof WC_Payment_Gateway_Stripe_Local_Payment) {
33
  $notices[] = wc_get_template_html ( "notices/notice.php", [
34
  'messages' => [
35
+ __ ( 'Your payment is being processed and your order status will be updated once the funds are received.', 'woo-stripe-payment' )
36
  ]
37
  ] );
38
  }
includes/class-wc-stripe-gateway.php CHANGED
@@ -31,7 +31,7 @@ class WC_Stripe_Gateway {
31
  $customer = \Stripe\Customer::create ( apply_filters ( 'wc_stripe_create_customer_args', $args ), $this->get_api_options () );
32
  return $customer->id;
33
  } catch ( \Stripe\Error\Base $e ) {
34
- $err = $e->getJsonBody ();
35
  return new WP_Error ( 'customer-error', $err[ 'message' ] );
36
  }
37
  }
@@ -40,7 +40,7 @@ class WC_Stripe_Gateway {
40
  try {
41
  return \Stripe\Customer::update ( $id, $args, $this->get_api_options ( $mode ) );
42
  } catch ( \Stripe\Error\Base $e ) {
43
- $err = $e->getJsonBody ();
44
  return new WP_Error ( 'customer-error', $err[ 'message' ] );
45
  }
46
  }
@@ -170,7 +170,7 @@ class WC_Stripe_Gateway {
170
  try {
171
  return $charge->capture ( $args, $this->get_api_options ( $mode ) );
172
  } catch ( \Stripe\Error\Base $e ) {
173
- return new WP_Error ( 'capture-error', sprintf ( __ ( 'Error capturing charge. Reason: %s', 'woo-stripe' ), $e->getMessage () ) );
174
  }
175
  } else {
176
  return $charge;
31
  $customer = \Stripe\Customer::create ( apply_filters ( 'wc_stripe_create_customer_args', $args ), $this->get_api_options () );
32
  return $customer->id;
33
  } catch ( \Stripe\Error\Base $e ) {
34
+ $err = $e->getJsonBody ()[ 'error' ];
35
  return new WP_Error ( 'customer-error', $err[ 'message' ] );
36
  }
37
  }
40
  try {
41
  return \Stripe\Customer::update ( $id, $args, $this->get_api_options ( $mode ) );
42
  } catch ( \Stripe\Error\Base $e ) {
43
+ $err = $e->getJsonBody ()[ 'error' ];
44
  return new WP_Error ( 'customer-error', $err[ 'message' ] );
45
  }
46
  }
170
  try {
171
  return $charge->capture ( $args, $this->get_api_options ( $mode ) );
172
  } catch ( \Stripe\Error\Base $e ) {
173
+ return new WP_Error ( 'capture-error', sprintf ( __ ( 'Error capturing charge. Reason: %s', 'woo-stripe-payment' ), $e->getMessage () ) );
174
  }
175
  } else {
176
  return $charge;
includes/class-wc-stripe-install.php CHANGED
@@ -17,8 +17,8 @@ class WC_Stripe_Install {
17
  */
18
  public static function plugin_action_links($links) {
19
  $action_links = array(
20
- 'settings' => sprintf ( '<a href="%1$s">%2$s</a>', admin_url ( 'admin.php?page=wc-settings&tab=checkout&section=stripe_api' ), esc_html__ ( 'Settings', 'woo-stripe' ) ),
21
- 'docs' => sprintf ( '<a target="_blank" href="https://docs.paymentplugins.com/wc-stripe/config">%s</a>', __ ( 'Documentation', 'woo-stripe' ) )
22
  );
23
  return array_merge ( $action_links, $links );
24
  }
17
  */
18
  public static function plugin_action_links($links) {
19
  $action_links = array(
20
+ 'settings' => sprintf ( '<a href="%1$s">%2$s</a>', admin_url ( 'admin.php?page=wc-settings&tab=checkout&section=stripe_api' ), esc_html__ ( 'Settings', 'woo-stripe-payment' ) ),
21
+ 'docs' => sprintf ( '<a target="_blank" href="https://docs.paymentplugins.com/wc-stripe/config">%s</a>', __ ( 'Documentation', 'woo-stripe-payment' ) )
22
  );
23
  return array_merge ( $action_links, $links );
24
  }
includes/class-wc-stripe-redirect-handler.php CHANGED
@@ -37,18 +37,18 @@ class WC_Stripe_Redirect_Handler {
37
 
38
  $source = $stripe_gateway->fetch_payment_source ( wc_clean ( $_GET[ 'source' ] ) );
39
  if (is_wp_error ( $source )) {
40
- wc_add_notice ( sprintf ( __ ( 'Error retrieving payment source. Reason: %s', 'woo-stripe' ), $source->get_error_message () ), 'error' );
41
  return;
42
  } else {
43
  if ('failed' === $source->status) {
44
- wc_add_notice ( __ ( 'Payment authorization failed. Please select another payment method.', 'woo-stripe' ), 'error' );
45
  return;
46
  }
47
  }
48
  $transaction_id = $order->get_transaction_id ();
49
  // if there is no transaction ID then the order hasn't been processed via webhooks yet.
50
  if (! $$transaction_id) {
51
- $order->update_status ( 'on-hold', __ ( 'Status updated to on hold. Charge will be created when source.chargeable webhook received.', 'woo-stripe' ) );
52
  }
53
  wp_safe_redirect ( $order->get_checkout_order_received_url () );
54
  exit ();
37
 
38
  $source = $stripe_gateway->fetch_payment_source ( wc_clean ( $_GET[ 'source' ] ) );
39
  if (is_wp_error ( $source )) {
40
+ wc_add_notice ( sprintf ( __ ( 'Error retrieving payment source. Reason: %s', 'woo-stripe-payment' ), $source->get_error_message () ), 'error' );
41
  return;
42
  } else {
43
  if ('failed' === $source->status) {
44
+ wc_add_notice ( __ ( 'Payment authorization failed. Please select another payment method.', 'woo-stripe-payment' ), 'error' );
45
  return;
46
  }
47
  }
48
  $transaction_id = $order->get_transaction_id ();
49
  // if there is no transaction ID then the order hasn't been processed via webhooks yet.
50
  if (! $$transaction_id) {
51
+ $order->update_status ( 'on-hold', __ ( 'Status updated to on hold. Charge will be created when source.chargeable webhook received.', 'woo-stripe-payment' ) );
52
  }
53
  wp_safe_redirect ( $order->get_checkout_order_received_url () );
54
  exit ();
includes/class-wc-stripe-rest-api.php CHANGED
@@ -39,7 +39,7 @@ class WC_Stripe_Rest_API {
39
  public function __get($key) {
40
  $controller = isset ( $this->controllers[ $key ] ) ? $this->controllers[ $key ] : '';
41
  if (empty ( $controller )) {
42
- wc_doing_it_wrong ( __FUNCTION__, sprintf ( __ ( '%1$s is an invalid controller name.', 'woo-stripe' ), $key ), wc_stripe ()->version );
43
  }
44
  return $controller;
45
  }
39
  public function __get($key) {
40
  $controller = isset ( $this->controllers[ $key ] ) ? $this->controllers[ $key ] : '';
41
  if (empty ( $controller )) {
42
+ wc_doing_it_wrong ( __FUNCTION__, sprintf ( __ ( '%1$s is an invalid controller name.', 'woo-stripe-payment' ), $key ), wc_stripe ()->version );
43
  }
44
  return $controller;
45
  }
includes/controllers/class-wc-stripe-controller-cart.php CHANGED
@@ -66,7 +66,7 @@ class WC_Stripe_Controller_Cart extends WC_Stripe_Rest_Controller {
66
  */
67
  public function validate_quantity($qty, $request) {
68
  if ($qty == 0) {
69
- return $this->add_validation_error ( new WP_Error ( 'cart-error', __ ( 'Quantity must be greater than zero.', 'woo-stripe' ) ) );
70
  }
71
  return true;
72
  }
@@ -96,7 +96,7 @@ class WC_Stripe_Controller_Cart extends WC_Stripe_Rest_Controller {
96
  'status' => 'success',
97
  'total' => [
98
  'amount' => wc_stripe_add_number_precision ( WC ()->cart->total ),
99
- 'label' => __ ( 'Total', 'woo-stripe' ),
100
  'pending' => false
101
  ],
102
  'displayItems' => wc_stripe_get_display_items (),
@@ -136,7 +136,7 @@ class WC_Stripe_Controller_Cart extends WC_Stripe_Rest_Controller {
136
  'status' => 'success',
137
  'total' => [
138
  'amount' => wc_stripe_add_number_precision ( WC ()->cart->total ),
139
- 'label' => __ ( 'Total', 'woo-stripe' ),
140
  'pending' => false
141
  ],
142
  'displayItems' => wc_stripe_get_display_items (),
66
  */
67
  public function validate_quantity($qty, $request) {
68
  if ($qty == 0) {
69
+ return $this->add_validation_error ( new WP_Error ( 'cart-error', __ ( 'Quantity must be greater than zero.', 'woo-stripe-payment' ) ) );
70
  }
71
  return true;
72
  }
96
  'status' => 'success',
97
  'total' => [
98
  'amount' => wc_stripe_add_number_precision ( WC ()->cart->total ),
99
+ 'label' => __ ( 'Total', 'woo-stripe-payment' ),
100
  'pending' => false
101
  ],
102
  'displayItems' => wc_stripe_get_display_items (),
136
  'status' => 'success',
137
  'total' => [
138
  'amount' => wc_stripe_add_number_precision ( WC ()->cart->total ),
139
+ 'label' => __ ( 'Total', 'woo-stripe-payment' ),
140
  'pending' => false
141
  ],
142
  'displayItems' => wc_stripe_get_display_items (),
includes/controllers/class-wc-stripe-controller-checkout.php CHANGED
@@ -13,6 +13,14 @@ class WC_Stripe_Controller_Checkout extends WC_Stripe_Rest_Controller {
13
 
14
  protected $namespace = '';
15
 
 
 
 
 
 
 
 
 
16
  public function register_routes() {
17
  register_rest_route ( $this->rest_uri (), 'checkout', [
18
  'methods' => WP_REST_Server::CREATABLE,
@@ -36,10 +44,12 @@ class WC_Stripe_Controller_Checkout extends WC_Stripe_Rest_Controller {
36
  *
37
  * @var WC_Payment_Gateway_Stripe $gateway
38
  */
39
- $gateway = WC ()->payment_gateways ()->payment_gateways ()[ $payment_method ];
40
 
41
  $this->required_post_data ();
42
 
 
 
43
  try {
44
  do_action ( 'wc_stripe_rest_process_checkout', $request, $gateway );
45
  if (! is_user_logged_in ()) {
@@ -106,6 +116,9 @@ class WC_Stripe_Controller_Checkout extends WC_Stripe_Rest_Controller {
106
  add_action ( 'woocommerce_after_checkout_validation', array(
107
  $this, 'after_checkout_validation'
108
  ), 10, 2 );
 
 
 
109
  }
110
 
111
  /**
@@ -115,7 +128,7 @@ class WC_Stripe_Controller_Checkout extends WC_Stripe_Rest_Controller {
115
  */
116
  public function after_checkout_validation($data, $errors) {
117
  if ($errors->get_error_message ( 'required-field' )) {
118
- wc_add_notice ( apply_filters ( 'wc_stripe_after_checkout_validation_notice', sprintf ( __ ( 'Some required fields were missing. Please click %shere%s to complete your payment.', 'woo-stripe-payments' ), '<a href="' . wc_get_checkout_url () . '">', '</a>' ), $data, $errors ), 'notice' );
119
  wp_send_json ( array( 'result' => 'failure',
120
  'messages' => $this->get_messages ( 'notice' ),
121
  'reload' => false
@@ -131,4 +144,27 @@ class WC_Stripe_Controller_Checkout extends WC_Stripe_Rest_Controller {
131
  $_POST[ 'terms' ] = 1;
132
  }
133
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
134
  }
13
 
14
  protected $namespace = '';
15
 
16
+ private $order_review = false;
17
+
18
+ /**
19
+ *
20
+ * @var WC_Payment_Gateway_Stripe
21
+ */
22
+ private $gateway = null;
23
+
24
  public function register_routes() {
25
  register_rest_route ( $this->rest_uri (), 'checkout', [
26
  'methods' => WP_REST_Server::CREATABLE,
44
  *
45
  * @var WC_Payment_Gateway_Stripe $gateway
46
  */
47
+ $this->gateway = $gateway = WC ()->payment_gateways ()->payment_gateways ()[ $payment_method ];
48
 
49
  $this->required_post_data ();
50
 
51
+ $this->order_review = ! is_null ( $request->get_param ( 'order_review' ) ) && 'true' === $request->get_param ( 'order_review' );
52
+
53
  try {
54
  do_action ( 'wc_stripe_rest_process_checkout', $request, $gateway );
55
  if (! is_user_logged_in ()) {
116
  add_action ( 'woocommerce_after_checkout_validation', array(
117
  $this, 'after_checkout_validation'
118
  ), 10, 2 );
119
+ add_action ( 'woocommerce_checkout_order_processed', array(
120
+ $this, 'checkout_order_processed'
121
+ ), 10, 3 );
122
  }
123
 
124
  /**
128
  */
129
  public function after_checkout_validation($data, $errors) {
130
  if ($errors->get_error_message ( 'required-field' )) {
131
+ wc_add_notice ( apply_filters ( 'wc_stripe_after_checkout_validation_notice', sprintf ( __ ( 'Some required fields were missing. Please click %shere%s to complete your payment.', 'woo-stripe-payment' ), '<a href="' . $this->get_order_review_url () . '">', '</a>' ), $data, $errors ), 'notice' );
132
  wp_send_json ( array( 'result' => 'failure',
133
  'messages' => $this->get_messages ( 'notice' ),
134
  'reload' => false
144
  $_POST[ 'terms' ] = 1;
145
  }
146
  }
147
+
148
+ private function get_order_review_url() {
149
+ return add_query_arg ( array(
150
+ 'order_review' => 'true',
151
+ 'payment_method' => $this->gateway->id,
152
+ 'payment_nonce' => $this->gateway->get_payment_source ()
153
+ ), wc_get_checkout_url () );
154
+ }
155
+
156
+ /**
157
+ *
158
+ * @param int $order_id
159
+ * @param array $posted_data
160
+ * @param WC_Order $order
161
+ */
162
+ public function checkout_order_processed($order_id, $posted_data, $order) {
163
+ if ($this->order_review) {
164
+ wc_add_notice ( __ ( 'Please review your order details then click Place Order.', 'woo-stripe-payment' ), 'notice' );
165
+ wp_send_json ( array( 'result' => 'success',
166
+ 'redirect' => $this->get_order_review_url ()
167
+ ), 200 );
168
+ }
169
+ }
170
  }
includes/controllers/class-wc-stripe-controller-gateway-settings.php CHANGED
@@ -51,14 +51,14 @@ class WC_Stripe_Controller_Gateway_Settings extends WC_Stripe_Rest_Controller {
51
  try {
52
  $api_key = wc_stripe_get_secret_key ( 'live' );
53
  if (empty ( $api_key )) {
54
- throw new Exception ( __ ( 'You cannot register your domain until you have configured your Live API keys.', 'woo-stripe' ) );
55
  }
56
  $result = $gateway->register_domain ( $server_name, 'live' );
57
  if (is_wp_error ( $result )) {
58
  throw new Exception ( $result->get_error_message () );
59
  }
60
  return rest_ensure_response ( [
61
- 'message' => sprintf ( __ ( 'Domain %s registered successfully. You can confirm in your Stripe Dashboard at https://dashboard.stripe.com/account/apple_pay.', 'woo-stripe' ), $server_name )
62
  ] );
63
  } catch ( Exception $e ) {
64
  return new WP_Error ( 'domain-error', $e->getMessage (), [
51
  try {
52
  $api_key = wc_stripe_get_secret_key ( 'live' );
53
  if (empty ( $api_key )) {
54
+ throw new Exception ( __ ( 'You cannot register your domain until you have configured your Live API keys.', 'woo-stripe-payment' ) );
55
  }
56
  $result = $gateway->register_domain ( $server_name, 'live' );
57
  if (is_wp_error ( $result )) {
58
  throw new Exception ( $result->get_error_message () );
59
  }
60
  return rest_ensure_response ( [
61
+ 'message' => sprintf ( __ ( 'Domain %s registered successfully. You can confirm in your Stripe Dashboard at https://dashboard.stripe.com/account/apple_pay.', 'woo-stripe-payment' ), $server_name )
62
  ] );
63
  } catch ( Exception $e ) {
64
  return new WP_Error ( 'domain-error', $e->getMessage (), [
includes/controllers/class-wc-stripe-controller-googlepay.php CHANGED
@@ -80,7 +80,7 @@ class WC_Stripe_Controller_GooglePay extends WC_Stripe_Rest_Controller {
80
  // if shipping address is not serviceable, throw an error.
81
  if (! wc_stripe_shipping_address_serviceable ()) {
82
  $this->reason_code = 'SHIPPING_ADDRESS_UNSERVICEABLE';
83
- throw new Exception ( __ ( 'Your shipping address is not serviceable.', 'woo-stripe' ) );
84
  }
85
 
86
  return rest_ensure_response ( apply_filters ( 'wc_stripe_googlepay_paymentdata_response', [
@@ -113,7 +113,7 @@ class WC_Stripe_Controller_GooglePay extends WC_Stripe_Rest_Controller {
113
  'totalPriceStatus' => 'FINAL',
114
  'totalPrice' => strval ( WC ()->cart->total ),
115
  'displayItems' => $this->gateway->get_display_items (),
116
- 'totalPriceLabel' => __ ( 'Total', 'woo-stripe' )
117
  ],
118
  'newShippingOptionParameters' => [
119
  'shippingOptions' => $this->gateway->get_shipping_methods (),
80
  // if shipping address is not serviceable, throw an error.
81
  if (! wc_stripe_shipping_address_serviceable ()) {
82
  $this->reason_code = 'SHIPPING_ADDRESS_UNSERVICEABLE';
83
+ throw new Exception ( __ ( 'Your shipping address is not serviceable.', 'woo-stripe-payment' ) );
84
  }
85
 
86
  return rest_ensure_response ( apply_filters ( 'wc_stripe_googlepay_paymentdata_response', [
113
  'totalPriceStatus' => 'FINAL',
114
  'totalPrice' => strval ( WC ()->cart->total ),
115
  'displayItems' => $this->gateway->get_display_items (),
116
+ 'totalPriceLabel' => __ ( 'Total', 'woo-stripe-payment' )
117
  ],
118
  'newShippingOptionParameters' => [
119
  'shippingOptions' => $this->gateway->get_shipping_methods (),
includes/controllers/class-wc-stripe-controller-order-actions.php CHANGED
@@ -112,7 +112,7 @@ class WC_Stripe_Controller_Order_Actions extends WC_Stripe_Rest_Controller {
112
  $order = wc_get_order ( $order_id );
113
  $amount = $request->get_param ( 'amount' );
114
  if (! is_numeric ( $amount )) {
115
- return new WP_Error ( 'invalid_data', __ ( 'Invalid amount entered.', 'woo-stripe' ), array(
116
  'success' => false, 'status' => 200
117
  ) );
118
  }
@@ -163,15 +163,15 @@ class WC_Stripe_Controller_Order_Actions extends WC_Stripe_Rest_Controller {
163
  // perform some validations
164
  if ($order->get_total () == 0) {
165
  if (! wcs_stripe_active ()) {
166
- throw new Exception ( __ ( 'Order total must be greater than zero.', 'woo-stripe' ) );
167
  } else {
168
  if (! wcs_order_contains_subscription ( $order )) {
169
- throw new Exception ( __ ( 'Order total must be greater than zero.', 'woo-stripe' ) );
170
  }
171
  }
172
  }
173
  if ($order->get_transaction_id ()) {
174
- throw new Exception ( sprintf ( __ ( 'This order has already been processed. Transaction ID: %s. Payment method: %s', 'woo-stripe' ), $order->get_transaction_id (), $order->get_payment_method_title () ) );
175
  }
176
  if (! $use_token) {
177
  // only credit card payments are allowed for one off payments as an admin.
@@ -180,7 +180,7 @@ class WC_Stripe_Controller_Order_Actions extends WC_Stripe_Rest_Controller {
180
  $token_id = intval ( $request->get_param ( 'payment_token_id' ) );
181
  $token = WC_Payment_Tokens::get ( $token_id );
182
  if ($token->get_user_id () !== $order->get_customer_id ()) {
183
- throw new Exception ( __ ( 'Order customer Id and payment method customer Id do not match.', 'woo-stripe' ) );
184
  }
185
  $payment_method = $token->get_gateway_id ();
186
  }
112
  $order = wc_get_order ( $order_id );
113
  $amount = $request->get_param ( 'amount' );
114
  if (! is_numeric ( $amount )) {
115
+ return new WP_Error ( 'invalid_data', __ ( 'Invalid amount entered.', 'woo-stripe-payment' ), array(
116
  'success' => false, 'status' => 200
117
  ) );
118
  }
163
  // perform some validations
164
  if ($order->get_total () == 0) {
165
  if (! wcs_stripe_active ()) {
166
+ throw new Exception ( __ ( 'Order total must be greater than zero.', 'woo-stripe-payment' ) );
167
  } else {
168
  if (! wcs_order_contains_subscription ( $order )) {
169
+ throw new Exception ( __ ( 'Order total must be greater than zero.', 'woo-stripe-payment' ) );
170
  }
171
  }
172
  }
173
  if ($order->get_transaction_id ()) {
174
+ throw new Exception ( sprintf ( __ ( 'This order has already been processed. Transaction ID: %s. Payment method: %s', 'woo-stripe-payment' ), $order->get_transaction_id (), $order->get_payment_method_title () ) );
175
  }
176
  if (! $use_token) {
177
  // only credit card payments are allowed for one off payments as an admin.
180
  $token_id = intval ( $request->get_param ( 'payment_token_id' ) );
181
  $token = WC_Payment_Tokens::get ( $token_id );
182
  if ($token->get_user_id () !== $order->get_customer_id ()) {
183
+ throw new Exception ( __ ( 'Order customer Id and payment method customer Id do not match.', 'woo-stripe-payment' ) );
184
  }
185
  $payment_method = $token->get_gateway_id ();
186
  }
includes/controllers/class-wc-stripe-controller-payment-intent.php CHANGED
@@ -37,7 +37,7 @@ class WC_Stripe_Controller_Payment_Intent extends WC_Stripe_Rest_Controller {
37
  )
38
  ) );
39
  } catch ( Exception $e ) {
40
- return new WP_Error ( 'payment-intent-error', sprintf ( __ ( 'Error creating payment intent. Reason: %s', 'woo-stripe' ), $e->getMessage () ), array(
41
  'status' => 200
42
  ) );
43
  }
37
  )
38
  ) );
39
  } catch ( Exception $e ) {
40
+ return new WP_Error ( 'payment-intent-error', sprintf ( __ ( 'Error creating payment intent. Reason: %s', 'woo-stripe-payment' ), $e->getMessage () ), array(
41
  'status' => 200
42
  ) );
43
  }
includes/controllers/class-wc-stripe-controller-webhook.php CHANGED
@@ -38,8 +38,8 @@ class WC_Stripe_Controller_Webhook extends WC_Stripe_Rest_Controller {
38
 
39
  return rest_ensure_response ( apply_filters ( 'wc_stripe_webhook_response', [], $event, $request ) );
40
  } catch ( \Stripe\Error\SignatureVerification $e ) {
41
- wc_stripe_log_info ( __ ( 'Invalid signaute received. Verify that your webhook secret is correct.', 'woo-stripe' ) );
42
- return $this->send_error_response ( __ ( 'Invalid signaute received. Verify that your webhook secret is correct.', 'woo-stripe' ) );
43
  } catch ( Exception $e ) {
44
  return $this->send_error_response ( $e->getMessage () );
45
  }
38
 
39
  return rest_ensure_response ( apply_filters ( 'wc_stripe_webhook_response', [], $event, $request ) );
40
  } catch ( \Stripe\Error\SignatureVerification $e ) {
41
+ wc_stripe_log_info ( __ ( 'Invalid signaute received. Verify that your webhook secret is correct.', 'woo-stripe-payment' ) );
42
+ return $this->send_error_response ( __ ( 'Invalid signaute received. Verify that your webhook secret is correct.', 'woo-stripe-payment' ) );
43
  } catch ( Exception $e ) {
44
  return $this->send_error_response ( $e->getMessage () );
45
  }
includes/gateways/class-wc-payment-gateway-stripe-applepay.php CHANGED
@@ -11,11 +11,11 @@ class WC_Payment_Gateway_Stripe_ApplePay extends WC_Payment_Gateway_Stripe_Payme
11
 
12
  public function __construct() {
13
  $this->id = 'stripe_applepay';
14
- $this->tab_title = __ ( 'Apple Pay', 'woo-stripe' );
15
  $this->template_name = 'applepay.php';
16
  $this->token_type = 'Stripe_ApplePay';
17
- $this->method_title = __ ( 'Stripe Apple Pay', 'woo-stripe' );
18
- $this->method_description = __ ( 'Apple Pay gateway that integrates with your Stripe account.', 'woo-stripe' );
19
  parent::__construct ();
20
  $this->icon = wc_stripe ()->assets_url ( 'img/applepay.svg' );
21
  }
@@ -54,7 +54,7 @@ class WC_Payment_Gateway_Stripe_ApplePay extends WC_Payment_Gateway_Stripe_Payme
54
  public function get_localized_params() {
55
  return array_merge_recursive ( parent::get_localized_params (), [
56
  'messages' => [
57
- 'invalid_amount' => __ ( 'Please update you product quantity before using Apple Pay.', 'woo-stripe' )
58
  ],
59
  'button' => wc_stripe_get_template_html ( 'applepay-button.php', [
60
  'style' => $this->get_option ( 'button_style' ),
11
 
12
  public function __construct() {
13
  $this->id = 'stripe_applepay';
14
+ $this->tab_title = __ ( 'Apple Pay', 'woo-stripe-payment' );
15
  $this->template_name = 'applepay.php';
16
  $this->token_type = 'Stripe_ApplePay';
17
+ $this->method_title = __ ( 'Stripe Apple Pay', 'woo-stripe-payment' );
18
+ $this->method_description = __ ( 'Apple Pay gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
19
  parent::__construct ();
20
  $this->icon = wc_stripe ()->assets_url ( 'img/applepay.svg' );
21
  }
54
  public function get_localized_params() {
55
  return array_merge_recursive ( parent::get_localized_params (), [
56
  'messages' => [
57
+ 'invalid_amount' => __ ( 'Please update you product quantity before using Apple Pay.', 'woo-stripe-payment' )
58
  ],
59
  'button' => wc_stripe_get_template_html ( 'applepay-button.php', [
60
  'style' => $this->get_option ( 'button_style' ),
includes/gateways/class-wc-payment-gateway-stripe-cc.php CHANGED
@@ -9,11 +9,11 @@ class WC_Payment_Gateway_Stripe_CC extends WC_Payment_Gateway_Stripe_Payment_Int
9
 
10
  public function __construct() {
11
  $this->id = 'stripe_cc';
12
- $this->tab_title = __ ( 'Credit Cards', 'woo-stripe' );
13
  $this->template_name = 'credit-card.php';
14
  $this->token_type = 'Stripe_CC';
15
- $this->method_title = __ ( 'Stripe Credit Cards', 'woo-stripe' );
16
- $this->method_description = __ ( 'Credit card gateway that integrates with your Stripe account.', 'woo-stripe' );
17
  parent::__construct ();
18
  }
19
 
9
 
10
  public function __construct() {
11
  $this->id = 'stripe_cc';
12
+ $this->tab_title = __ ( 'Credit Cards', 'woo-stripe-payment' );
13
  $this->template_name = 'credit-card.php';
14
  $this->token_type = 'Stripe_CC';
15
+ $this->method_title = __ ( 'Stripe Credit Cards', 'woo-stripe-payment' );
16
+ $this->method_description = __ ( 'Credit card gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
17
  parent::__construct ();
18
  }
19
 
includes/gateways/class-wc-payment-gateway-stripe-eps.php CHANGED
@@ -14,13 +14,13 @@ class WC_Payment_Gateway_Stripe_EPS extends WC_Payment_Gateway_Stripe_Local_Paym
14
  $this->currencies = [ 'EUR'
15
  ];
16
  $this->id = 'stripe_eps';
17
- $this->tab_title = __ ( 'EPS', 'woo-stripe' );
18
  $this->template_name = 'local-payment.php';
19
  $this->token_type = 'Stripe_Local';
20
- $this->method_title = __ ( 'EPS', 'woo-stripe' );
21
- $this->method_description = __ ( 'EPS gateway that integrates with your Stripe account.', 'woo-stripe' );
22
  $this->icon = wc_stripe ()->assets_url ( 'img/eps.svg' );
23
- $this->order_button_text = __ ( 'EPS', 'woo-stripe' );
24
  parent::__construct ();
25
  }
26
 
@@ -30,26 +30,26 @@ class WC_Payment_Gateway_Stripe_EPS extends WC_Payment_Gateway_Stripe_Local_Paym
30
  'description' => $this->get_payment_description()
31
  ),
32
  'enabled' => array(
33
- 'title' => __ ( 'Enabled', 'woo-stripe' ),
34
  'type' => 'checkbox',
35
  'default' => 'no', 'value' => 'yes',
36
  'desc_tip' => true,
37
- 'description' => __ ( 'If enabled, your site can accept P24 payments through Stripe.', 'woo-stripe' )
38
  ),
39
  'general_settings' => array(
40
  'type' => 'title',
41
- 'title' => __ ( 'General Settings', 'woo-stripe' )
42
  ),
43
  'title_text' => array( 'type' => 'text',
44
- 'title' => __ ( 'Title', 'woo-stripe' ),
45
- 'default' => __ ( 'EPS', 'woo-stripe' ),
46
  'desc_tip' => true,
47
  'description' => __ ( 'Title of the p24 gateway' )
48
  ),
49
  'description' => array(
50
- 'title' => __ ( 'Description', 'woo-stripe' ),
51
  'type' => 'text', 'default' => '',
52
- 'description' => __ ( 'Leave blank if you don\'t want a description to show for the gateway.', 'woo-stripe' ),
53
  'desc_tip' => true
54
  )
55
  ];
14
  $this->currencies = [ 'EUR'
15
  ];
16
  $this->id = 'stripe_eps';
17
+ $this->tab_title = __ ( 'EPS', 'woo-stripe-payment' );
18
  $this->template_name = 'local-payment.php';
19
  $this->token_type = 'Stripe_Local';
20
+ $this->method_title = __ ( 'EPS', 'woo-stripe-payment' );
21
+ $this->method_description = __ ( 'EPS gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
22
  $this->icon = wc_stripe ()->assets_url ( 'img/eps.svg' );
23
+ $this->order_button_text = __ ( 'EPS', 'woo-stripe-payment' );
24
  parent::__construct ();
25
  }
26
 
30
  'description' => $this->get_payment_description()
31
  ),
32
  'enabled' => array(
33
+ 'title' => __ ( 'Enabled', 'woo-stripe-payment' ),
34
  'type' => 'checkbox',
35
  'default' => 'no', 'value' => 'yes',
36
  'desc_tip' => true,
37
+ 'description' => __ ( 'If enabled, your site can accept P24 payments through Stripe.', 'woo-stripe-payment' )
38
  ),
39
  'general_settings' => array(
40
  'type' => 'title',
41
+ 'title' => __ ( 'General Settings', 'woo-stripe-payment' )
42
  ),
43
  'title_text' => array( 'type' => 'text',
44
+ 'title' => __ ( 'Title', 'woo-stripe-payment' ),
45
+ 'default' => __ ( 'EPS', 'woo-stripe-payment' ),
46
  'desc_tip' => true,
47
  'description' => __ ( 'Title of the p24 gateway' )
48
  ),
49
  'description' => array(
50
+ 'title' => __ ( 'Description', 'woo-stripe-payment' ),
51
  'type' => 'text', 'default' => '',
52
+ 'description' => __ ( 'Leave blank if you don\'t want a description to show for the gateway.', 'woo-stripe-payment' ),
53
  'desc_tip' => true
54
  )
55
  ];
includes/gateways/class-wc-payment-gateway-stripe-giropay.php CHANGED
@@ -16,13 +16,13 @@ class WC_Payment_Gateway_Stripe_Giropay extends WC_Payment_Gateway_Stripe_Local_
16
  $this->countries = [ 'DE'
17
  ];
18
  $this->id = 'stripe_giropay';
19
- $this->tab_title = __ ( 'Giropay', 'woo-stripe' );
20
  $this->template_name = 'local-payment.php';
21
  $this->token_type = 'Stripe_Local';
22
- $this->method_title = __ ( 'Giropay', 'woo-stripe' );
23
- $this->method_description = __ ( 'Giropay gateway that integrates with your Stripe account.', 'woo-stripe' );
24
  $this->icon = wc_stripe ()->assets_url ( 'img/giropay.svg' );
25
- $this->order_button_text = __ ( 'Giropay', 'woo-stripe' );
26
  parent::__construct ();
27
  }
28
 
@@ -32,26 +32,26 @@ class WC_Payment_Gateway_Stripe_Giropay extends WC_Payment_Gateway_Stripe_Local_
32
  'description' => $this->get_payment_description()
33
  ),
34
  'enabled' => array(
35
- 'title' => __ ( 'Enabled', 'woo-stripe' ),
36
  'type' => 'checkbox',
37
  'default' => 'no', 'value' => 'yes',
38
  'desc_tip' => true,
39
- 'description' => __ ( 'If enabled, your site can Giropay card payments through Stripe.', 'woo-stripe' )
40
  ),
41
  'general_settings' => array(
42
  'type' => 'title',
43
- 'title' => __ ( 'General Settings', 'woo-stripe' )
44
  ),
45
  'title_text' => array( 'type' => 'text',
46
- 'title' => __ ( 'Title', 'woo-stripe' ),
47
- 'default' => __ ( 'Giropay', 'woo-stripe' ),
48
  'desc_tip' => true,
49
  'description' => __ ( 'Title of the Giropay gateway' )
50
  ),
51
  'description' => array(
52
- 'title' => __ ( 'Description', 'woo-stripe' ),
53
  'type' => 'text', 'default' => '',
54
- 'description' => __ ( 'Leave blank if you don\'t want a description to show for the gateway.', 'woo-stripe' ),
55
  'desc_tip' => true
56
  )
57
  ];
16
  $this->countries = [ 'DE'
17
  ];
18
  $this->id = 'stripe_giropay';
19
+ $this->tab_title = __ ( 'Giropay', 'woo-stripe-payment' );
20
  $this->template_name = 'local-payment.php';
21
  $this->token_type = 'Stripe_Local';
22
+ $this->method_title = __ ( 'Giropay', 'woo-stripe-payment' );
23
+ $this->method_description = __ ( 'Giropay gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
24
  $this->icon = wc_stripe ()->assets_url ( 'img/giropay.svg' );
25
+ $this->order_button_text = __ ( 'Giropay', 'woo-stripe-payment' );
26
  parent::__construct ();
27
  }
28
 
32
  'description' => $this->get_payment_description()
33
  ),
34
  'enabled' => array(
35
+ 'title' => __ ( 'Enabled', 'woo-stripe-payment' ),
36
  'type' => 'checkbox',
37
  'default' => 'no', 'value' => 'yes',
38
  'desc_tip' => true,
39
+ 'description' => __ ( 'If enabled, your site can Giropay card payments through Stripe.', 'woo-stripe-payment' )
40
  ),
41
  'general_settings' => array(
42
  'type' => 'title',
43
+ 'title' => __ ( 'General Settings', 'woo-stripe-payment' )
44
  ),
45
  'title_text' => array( 'type' => 'text',
46
+ 'title' => __ ( 'Title', 'woo-stripe-payment' ),
47
+ 'default' => __ ( 'Giropay', 'woo-stripe-payment' ),
48
  'desc_tip' => true,
49
  'description' => __ ( 'Title of the Giropay gateway' )
50
  ),
51
  'description' => array(
52
+ 'title' => __ ( 'Description', 'woo-stripe-payment' ),
53
  'type' => 'text', 'default' => '',
54
+ 'description' => __ ( 'Leave blank if you don\'t want a description to show for the gateway.', 'woo-stripe-payment' ),
55
  'desc_tip' => true
56
  )
57
  ];
includes/gateways/class-wc-payment-gateway-stripe-googlepay.php CHANGED
@@ -13,11 +13,11 @@ class WC_Payment_Gateway_Stripe_GooglePay extends WC_Payment_Gateway_Stripe_Char
13
 
14
  public function __construct() {
15
  $this->id = 'stripe_googlepay';
16
- $this->tab_title = __ ( 'Google Pay', 'woo-stripe' );
17
  $this->template_name = 'googlepay.php';
18
  $this->token_type = 'Stripe_GooglePay';
19
- $this->method_title = __ ( 'Stripe Google Pay', 'woo-stripe' );
20
- $this->method_description = __ ( 'Google Pay gateway that integrates with your Stripe account.', 'woo-stripe' );
21
  parent::__construct ();
22
  $this->icon = wc_stripe ()->assets_url ( 'img/' . $this->get_option ( 'icon' ) . '.svg' );
23
  }
@@ -67,13 +67,14 @@ class WC_Payment_Gateway_Stripe_GooglePay extends WC_Payment_Gateway_Stripe_Char
67
  'merchant_name' => $this->get_option ( 'merchant_name' ),
68
  'button_color' => $this->get_option ( 'button_color' ),
69
  'button_style' => $this->get_option ( 'button_style' ),
70
- 'total_price_label' => __ ( 'Total', 'woo-stripe' ),
71
  'routes' => [
72
  'payment_data' => wc_stripe ()->rest_api->googlepay->rest_url ( 'shipping-data' )
73
  ],
74
  'messages' => [
75
- 'invalid_amount' => __ ( 'Please update you product quantity before using Google Pay.', 'woo-stripe' )
76
- ]
 
77
  ] );
78
  return $data;
79
  }
@@ -83,7 +84,7 @@ class WC_Payment_Gateway_Stripe_GooglePay extends WC_Payment_Gateway_Stripe_Char
83
  if (wcs_stripe_active () && WC_Subscriptions_Change_Payment_Gateway::$is_request_to_change_payment) {
84
  $subscription = wcs_get_subscription ( absint ( $_GET[ 'change_payment_method' ] ) );
85
  $items[] = [
86
- 'label' => __ ( 'Subscription', 'woo-stripe' ),
87
  'type' => 'SUBTOTAL',
88
  'price' => strval ( $subscription->get_total () )
89
  ];
@@ -103,14 +104,14 @@ class WC_Payment_Gateway_Stripe_GooglePay extends WC_Payment_Gateway_Stripe_Char
103
  }
104
  if (WC ()->cart->needs_shipping ()) {
105
  $items[] = [
106
- 'label' => __ ( 'Shipping', 'woo-stripe' ),
107
  'type' => 'LINE_ITEM',
108
  'price' => strval ( WC ()->cart->shipping_total )
109
  ];
110
  }
111
  if (wc_tax_enabled ()) {
112
  $items[] = [
113
- 'label' => __ ( 'Tax', 'woo-stripe' ),
114
  'type' => 'LINE_ITEM',
115
  'price' => strval ( WC ()->cart->get_taxes_total () )
116
  ];
@@ -141,8 +142,8 @@ class WC_Payment_Gateway_Stripe_GooglePay extends WC_Payment_Gateway_Stripe_Char
141
  if (empty ( $methods )) {
142
  // GPay does not like empty shipping methods. Make a temporary one;
143
  $methods[] = [ 'id' => 'default',
144
- 'label' => __ ( 'Waiting...', 'woo-stripe' ),
145
- 'description' => __ ( 'loading shipping methods...', 'woo-stripe' )
146
  ];
147
  }
148
  }
13
 
14
  public function __construct() {
15
  $this->id = 'stripe_googlepay';
16
+ $this->tab_title = __ ( 'Google Pay', 'woo-stripe-payment' );
17
  $this->template_name = 'googlepay.php';
18
  $this->token_type = 'Stripe_GooglePay';
19
+ $this->method_title = __ ( 'Stripe Google Pay', 'woo-stripe-payment' );
20
+ $this->method_description = __ ( 'Google Pay gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
21
  parent::__construct ();
22
  $this->icon = wc_stripe ()->assets_url ( 'img/' . $this->get_option ( 'icon' ) . '.svg' );
23
  }
67
  'merchant_name' => $this->get_option ( 'merchant_name' ),
68
  'button_color' => $this->get_option ( 'button_color' ),
69
  'button_style' => $this->get_option ( 'button_style' ),
70
+ 'total_price_label' => __ ( 'Total', 'woo-stripe-payment' ),
71
  'routes' => [
72
  'payment_data' => wc_stripe ()->rest_api->googlepay->rest_url ( 'shipping-data' )
73
  ],
74
  'messages' => [
75
+ 'invalid_amount' => __ ( 'Please update you product quantity before using Google Pay.', 'woo-stripe-payment' )
76
+ ],
77
+ 'dynamic_price' => $this->is_active ( 'dynamic_price' )
78
  ] );
79
  return $data;
80
  }
84
  if (wcs_stripe_active () && WC_Subscriptions_Change_Payment_Gateway::$is_request_to_change_payment) {
85
  $subscription = wcs_get_subscription ( absint ( $_GET[ 'change_payment_method' ] ) );
86
  $items[] = [
87
+ 'label' => __ ( 'Subscription', 'woo-stripe-payment' ),
88
  'type' => 'SUBTOTAL',
89
  'price' => strval ( $subscription->get_total () )
90
  ];
104
  }
105
  if (WC ()->cart->needs_shipping ()) {
106
  $items[] = [
107
+ 'label' => __ ( 'Shipping', 'woo-stripe-payment' ),
108
  'type' => 'LINE_ITEM',
109
  'price' => strval ( WC ()->cart->shipping_total )
110
  ];
111
  }
112
  if (wc_tax_enabled ()) {
113
  $items[] = [
114
+ 'label' => __ ( 'Tax', 'woo-stripe-payment' ),
115
  'type' => 'LINE_ITEM',
116
  'price' => strval ( WC ()->cart->get_taxes_total () )
117
  ];
142
  if (empty ( $methods )) {
143
  // GPay does not like empty shipping methods. Make a temporary one;
144
  $methods[] = [ 'id' => 'default',
145
+ 'label' => __ ( 'Waiting...', 'woo-stripe-payment' ),
146
+ 'description' => __ ( 'loading shipping methods...', 'woo-stripe-payment' )
147
  ];
148
  }
149
  }
includes/gateways/class-wc-payment-gateway-stripe-ideal.php CHANGED
@@ -14,11 +14,11 @@ class WC_Payment_Gateway_Stripe_Ideal extends WC_Payment_Gateway_Stripe_Local_Pa
14
  $this->currencies = [ 'EUR'
15
  ];
16
  $this->id = 'stripe_ideal';
17
- $this->tab_title = __ ( 'iDEAL', 'woo-stripe' );
18
- $this->method_title = __ ( 'iDEAL', 'woo-stripe' );
19
- $this->method_description = __ ( 'Ideal gateway that integrates with your Stripe account.', 'woo-stripe' );
20
  $this->icon = wc_stripe ()->assets_url ( 'img/ideal.svg' );
21
- $this->order_button_text = __ ( 'iDEAL', 'woo-stripe' );
22
  parent::__construct ();
23
  }
24
 
@@ -28,26 +28,26 @@ class WC_Payment_Gateway_Stripe_Ideal extends WC_Payment_Gateway_Stripe_Local_Pa
28
  'description' => $this->get_payment_description()
29
  ),
30
  'enabled' => array(
31
- 'title' => __ ( 'Enabled', 'woo-stripe' ),
32
  'type' => 'checkbox',
33
  'default' => 'no', 'value' => 'yes',
34
  'desc_tip' => true,
35
- 'description' => __ ( 'If enabled, your site can accept credit card payments through Stripe.', 'woo-stripe' )
36
  ),
37
  'general_settings' => array(
38
  'type' => 'title',
39
- 'title' => __ ( 'General Settings', 'woo-stripe' )
40
  ),
41
  'title_text' => array( 'type' => 'text',
42
- 'title' => __ ( 'Title', 'woo-stripe' ),
43
- 'default' => __ ( 'iDEAL', 'woo-stripe' ),
44
  'desc_tip' => true,
45
  'description' => __ ( 'Title of the iDEAL gateway' )
46
  ),
47
  'description' => array(
48
- 'title' => __ ( 'Description', 'woo-stripe' ),
49
  'type' => 'text', 'default' => '',
50
- 'description' => __ ( 'Leave blank if you don\'t want a description to show for the gateway.', 'woo-stripe' ),
51
  'desc_tip' => true
52
  )
53
  ];
14
  $this->currencies = [ 'EUR'
15
  ];
16
  $this->id = 'stripe_ideal';
17
+ $this->tab_title = __ ( 'iDEAL', 'woo-stripe-payment' );
18
+ $this->method_title = __ ( 'iDEAL', 'woo-stripe-payment' );
19
+ $this->method_description = __ ( 'Ideal gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
20
  $this->icon = wc_stripe ()->assets_url ( 'img/ideal.svg' );
21
+ $this->order_button_text = __ ( 'iDEAL', 'woo-stripe-payment' );
22
  parent::__construct ();
23
  }
24
 
28
  'description' => $this->get_payment_description()
29
  ),
30
  'enabled' => array(
31
+ 'title' => __ ( 'Enabled', 'woo-stripe-payment' ),
32
  'type' => 'checkbox',
33
  'default' => 'no', 'value' => 'yes',
34
  'desc_tip' => true,
35
+ 'description' => __ ( 'If enabled, your site can accept credit card payments through Stripe.', 'woo-stripe-payment' )
36
  ),
37
  'general_settings' => array(
38
  'type' => 'title',
39
+ 'title' => __ ( 'General Settings', 'woo-stripe-payment' )
40
  ),
41
  'title_text' => array( 'type' => 'text',
42
+ 'title' => __ ( 'Title', 'woo-stripe-payment' ),
43
+ 'default' => __ ( 'iDEAL', 'woo-stripe-payment' ),
44
  'desc_tip' => true,
45
  'description' => __ ( 'Title of the iDEAL gateway' )
46
  ),
47
  'description' => array(
48
+ 'title' => __ ( 'Description', 'woo-stripe-payment' ),
49
  'type' => 'text', 'default' => '',
50
+ 'description' => __ ( 'Leave blank if you don\'t want a description to show for the gateway.', 'woo-stripe-payment' ),
51
  'desc_tip' => true
52
  )
53
  ];
includes/gateways/class-wc-payment-gateway-stripe-klarna.php CHANGED
@@ -15,13 +15,13 @@ class WC_Payment_Gateway_Stripe_Klarna extends WC_Payment_Gateway_Stripe_Local_P
15
  'DKK', 'GBP', 'USD'
16
  ];
17
  $this->id = 'stripe_klarna';
18
- $this->tab_title = __ ( 'Klarna', 'woo-stripe' );
19
  $this->template_name = 'local-payment.php';
20
  $this->token_type = 'Stripe_Local';
21
- $this->method_title = __ ( 'Klarna', 'woo-stripe' );
22
- $this->method_description = __ ( 'Klarna gateway that integrates with your Stripe account.', 'woo-stripe' );
23
  $this->icon = wc_stripe ()->assets_url ( 'img/klarna.svg' );
24
- $this->order_button_text = __ ( 'Klarna', 'woo-stripe' );
25
  parent::__construct ();
26
  }
27
 
@@ -31,26 +31,26 @@ class WC_Payment_Gateway_Stripe_Klarna extends WC_Payment_Gateway_Stripe_Local_P
31
  'description' => $this->get_payment_description()
32
  ),
33
  'enabled' => array(
34
- 'title' => __ ( 'Enabled', 'woo-stripe' ),
35
  'type' => 'checkbox',
36
  'default' => 'no', 'value' => 'yes',
37
  'desc_tip' => true,
38
- 'description' => __ ( 'If enabled, your site can accept Klarna payments through Stripe.', 'woo-stripe' )
39
  ),
40
  'general_settings' => array(
41
  'type' => 'title',
42
- 'title' => __ ( 'General Settings', 'woo-stripe' )
43
  ),
44
  'title_text' => array( 'type' => 'text',
45
- 'title' => __ ( 'Title', 'woo-stripe' ),
46
- 'default' => __ ( 'Klarna', 'woo-stripe' ),
47
  'desc_tip' => true,
48
  'description' => __ ( 'Title of the Klarna gateway' )
49
  ),
50
  'description' => array(
51
- 'title' => __ ( 'Description', 'woo-stripe' ),
52
  'type' => 'text', 'default' => '',
53
- 'description' => __ ( 'Leave blank if you don\'t want a description to show for the gateway.', 'woo-stripe' ),
54
  'desc_tip' => true
55
  )
56
  ];
15
  'DKK', 'GBP', 'USD'
16
  ];
17
  $this->id = 'stripe_klarna';
18
+ $this->tab_title = __ ( 'Klarna', 'woo-stripe-payment' );
19
  $this->template_name = 'local-payment.php';
20
  $this->token_type = 'Stripe_Local';
21
+ $this->method_title = __ ( 'Klarna', 'woo-stripe-payment' );
22
+ $this->method_description = __ ( 'Klarna gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
23
  $this->icon = wc_stripe ()->assets_url ( 'img/klarna.svg' );
24
+ $this->order_button_text = __ ( 'Klarna', 'woo-stripe-payment' );
25
  parent::__construct ();
26
  }
27
 
31
  'description' => $this->get_payment_description()
32
  ),
33
  'enabled' => array(
34
+ 'title' => __ ( 'Enabled', 'woo-stripe-payment' ),
35
  'type' => 'checkbox',
36
  'default' => 'no', 'value' => 'yes',
37
  'desc_tip' => true,
38
+ 'description' => __ ( 'If enabled, your site can accept Klarna payments through Stripe.', 'woo-stripe-payment' )
39
  ),
40
  'general_settings' => array(
41
  'type' => 'title',
42
+ 'title' => __ ( 'General Settings', 'woo-stripe-payment' )
43
  ),
44
  'title_text' => array( 'type' => 'text',
45
+ 'title' => __ ( 'Title', 'woo-stripe-payment' ),
46
+ 'default' => __ ( 'Klarna', 'woo-stripe-payment' ),
47
  'desc_tip' => true,
48
  'description' => __ ( 'Title of the Klarna gateway' )
49
  ),
50
  'description' => array(
51
+ 'title' => __ ( 'Description', 'woo-stripe-payment' ),
52
  'type' => 'text', 'default' => '',
53
+ 'description' => __ ( 'Leave blank if you don\'t want a description to show for the gateway.', 'woo-stripe-payment' ),
54
  'desc_tip' => true
55
  )
56
  ];
includes/gateways/class-wc-payment-gateway-stripe-multibanco.php CHANGED
@@ -15,13 +15,13 @@ class WC_Payment_Gateway_Stripe_Multibanco extends WC_Payment_Gateway_Stripe_Loc
15
  $this->currencies = [ 'EUR'
16
  ];
17
  $this->id = 'stripe_multibanco';
18
- $this->tab_title = __ ( 'Multibanco', 'woo-stripe' );
19
  $this->template_name = 'local-payment.php';
20
  $this->token_type = 'Stripe_Local';
21
- $this->method_title = __ ( 'EPS', 'woo-stripe' );
22
- $this->method_description = __ ( 'Multibanco gateway that integrates with your Stripe account.', 'woo-stripe' );
23
  $this->icon = wc_stripe ()->assets_url ( 'img/multibanco.svg' );
24
- $this->order_button_text = __ ( 'Multibanco', 'woo-stripe' );
25
  parent::__construct ();
26
  }
27
 
@@ -31,26 +31,26 @@ class WC_Payment_Gateway_Stripe_Multibanco extends WC_Payment_Gateway_Stripe_Loc
31
  'description' => $this->get_payment_description()
32
  ),
33
  'enabled' => array(
34
- 'title' => __ ( 'Enabled', 'woo-stripe' ),
35
  'type' => 'checkbox',
36
  'default' => 'no', 'value' => 'yes',
37
  'desc_tip' => true,
38
- 'description' => __ ( 'If enabled, your site can accept Multibanco payments through Stripe.', 'woo-stripe' )
39
  ),
40
  'general_settings' => array(
41
  'type' => 'title',
42
- 'title' => __ ( 'General Settings', 'woo-stripe' )
43
  ),
44
  'title_text' => array( 'type' => 'text',
45
- 'title' => __ ( 'Title', 'woo-stripe' ),
46
- 'default' => __ ( 'Multibanco', 'woo-stripe' ),
47
  'desc_tip' => true,
48
  'description' => __ ( 'Title of the Multibanco gateway' )
49
  ),
50
  'description' => array(
51
- 'title' => __ ( 'Description', 'woo-stripe' ),
52
  'type' => 'text', 'default' => '',
53
- 'description' => __ ( 'Leave blank if you don\'t want a description to show for the gateway.', 'woo-stripe' ),
54
  'desc_tip' => true
55
  )
56
  ];
15
  $this->currencies = [ 'EUR'
16
  ];
17
  $this->id = 'stripe_multibanco';
18
+ $this->tab_title = __ ( 'Multibanco', 'woo-stripe-payment' );
19
  $this->template_name = 'local-payment.php';
20
  $this->token_type = 'Stripe_Local';
21
+ $this->method_title = __ ( 'EPS', 'woo-stripe-payment' );
22
+ $this->method_description = __ ( 'Multibanco gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
23
  $this->icon = wc_stripe ()->assets_url ( 'img/multibanco.svg' );
24
+ $this->order_button_text = __ ( 'Multibanco', 'woo-stripe-payment' );
25
  parent::__construct ();
26
  }
27
 
31
  'description' => $this->get_payment_description()
32
  ),
33
  'enabled' => array(
34
+ 'title' => __ ( 'Enabled', 'woo-stripe-payment' ),
35
  'type' => 'checkbox',
36
  'default' => 'no', 'value' => 'yes',
37
  'desc_tip' => true,
38
+ 'description' => __ ( 'If enabled, your site can accept Multibanco payments through Stripe.', 'woo-stripe-payment' )
39
  ),
40
  'general_settings' => array(
41
  'type' => 'title',
42
+ 'title' => __ ( 'General Settings', 'woo-stripe-payment' )
43
  ),
44
  'title_text' => array( 'type' => 'text',
45
+ 'title' => __ ( 'Title', 'woo-stripe-payment' ),
46
+ 'default' => __ ( 'Multibanco', 'woo-stripe-payment' ),
47
  'desc_tip' => true,
48
  'description' => __ ( 'Title of the Multibanco gateway' )
49
  ),
50
  'description' => array(
51
+ 'title' => __ ( 'Description', 'woo-stripe-payment' ),
52
  'type' => 'text', 'default' => '',
53
+ 'description' => __ ( 'Leave blank if you don\'t want a description to show for the gateway.', 'woo-stripe-payment' ),
54
  'desc_tip' => true
55
  )
56
  ];
includes/gateways/class-wc-payment-gateway-stripe-p24.php CHANGED
@@ -14,13 +14,13 @@ class WC_Payment_Gateway_Stripe_P24 extends WC_Payment_Gateway_Stripe_Local_Paym
14
  $this->currencies = [ 'EUR', 'PLN'
15
  ];
16
  $this->id = 'stripe_p24';
17
- $this->tab_title = __ ( 'Przelewy24', 'woo-stripe' );
18
  $this->template_name = 'local-payment.php';
19
  $this->token_type = 'Stripe_Local';
20
- $this->method_title = __ ( 'Przelewy24', 'woo-stripe' );
21
- $this->method_description = __ ( 'P24 gateway that integrates with your Stripe account.', 'woo-stripe' );
22
  $this->icon = wc_stripe ()->assets_url ( 'img/p24.svg' );
23
- $this->order_button_text = __ ( 'P24', 'woo-stripe' );
24
  parent::__construct ();
25
  }
26
 
@@ -30,26 +30,26 @@ class WC_Payment_Gateway_Stripe_P24 extends WC_Payment_Gateway_Stripe_Local_Paym
30
  'description' => $this->get_payment_description()
31
  ),
32
  'enabled' => array(
33
- 'title' => __ ( 'Enabled', 'woo-stripe' ),
34
  'type' => 'checkbox',
35
  'default' => 'no', 'value' => 'yes',
36
  'desc_tip' => true,
37
- 'description' => __ ( 'If enabled, your site can accept P24 payments through Stripe.', 'woo-stripe' )
38
  ),
39
  'general_settings' => array(
40
  'type' => 'title',
41
- 'title' => __ ( 'General Settings', 'woo-stripe' )
42
  ),
43
  'title_text' => array( 'type' => 'text',
44
- 'title' => __ ( 'Title', 'woo-stripe' ),
45
- 'default' => __ ( 'P24', 'woo-stripe' ),
46
  'desc_tip' => true,
47
  'description' => __ ( 'Title of the p24 gateway' )
48
  ),
49
  'description' => array(
50
- 'title' => __ ( 'Description', 'woo-stripe' ),
51
  'type' => 'text', 'default' => '',
52
- 'description' => __ ( 'Leave blank if you don\'t want a description to show for the gateway.', 'woo-stripe' ),
53
  'desc_tip' => true
54
  )
55
  ];
14
  $this->currencies = [ 'EUR', 'PLN'
15
  ];
16
  $this->id = 'stripe_p24';
17
+ $this->tab_title = __ ( 'Przelewy24', 'woo-stripe-payment' );
18
  $this->template_name = 'local-payment.php';
19
  $this->token_type = 'Stripe_Local';
20
+ $this->method_title = __ ( 'Przelewy24', 'woo-stripe-payment' );
21
+ $this->method_description = __ ( 'P24 gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
22
  $this->icon = wc_stripe ()->assets_url ( 'img/p24.svg' );
23
+ $this->order_button_text = __ ( 'P24', 'woo-stripe-payment' );
24
  parent::__construct ();
25
  }
26
 
30
  'description' => $this->get_payment_description()
31
  ),
32
  'enabled' => array(
33
+ 'title' => __ ( 'Enabled', 'woo-stripe-payment' ),
34
  'type' => 'checkbox',
35
  'default' => 'no', 'value' => 'yes',
36
  'desc_tip' => true,
37
+ 'description' => __ ( 'If enabled, your site can accept P24 payments through Stripe.', 'woo-stripe-payment' )
38
  ),
39
  'general_settings' => array(
40
  'type' => 'title',
41
+ 'title' => __ ( 'General Settings', 'woo-stripe-payment' )
42
  ),
43
  'title_text' => array( 'type' => 'text',
44
+ 'title' => __ ( 'Title', 'woo-stripe-payment' ),
45
+ 'default' => __ ( 'P24', 'woo-stripe-payment' ),
46
  'desc_tip' => true,
47
  'description' => __ ( 'Title of the p24 gateway' )
48
  ),
49
  'description' => array(
50
+ 'title' => __ ( 'Description', 'woo-stripe-payment' ),
51
  'type' => 'text', 'default' => '',
52
+ 'description' => __ ( 'Leave blank if you don\'t want a description to show for the gateway.', 'woo-stripe-payment' ),
53
  'desc_tip' => true
54
  )
55
  ];
includes/gateways/class-wc-payment-gateway-stripe-payment-request.php CHANGED
@@ -13,11 +13,11 @@ class WC_Payment_Gateway_Stripe_Payment_Request extends WC_Payment_Gateway_Strip
13
 
14
  public function __construct() {
15
  $this->id = 'stripe_payment_request';
16
- $this->tab_title = __ ( 'PaymentRequest Gateway', 'woo-stripe' );
17
  $this->template_name = 'payment-request.php';
18
  $this->token_type = 'Stripe_CC';
19
- $this->method_title = __ ( 'Stripe Payment Request', 'woo-stripe' );
20
- $this->method_description = __ ( 'Gateway that renders based on the user\'s browser. Chrome payment methods, Microsoft pay, etc.', 'woo-stripe' );
21
  parent::__construct ();
22
  }
23
 
@@ -60,8 +60,8 @@ class WC_Payment_Gateway_Stripe_Payment_Request extends WC_Payment_Gateway_Strip
60
  'chrome' => wc_stripe ()->assets_url ( 'img/chrome.svg' )
61
  ],
62
  'messages' => [
63
- 'add_to_cart' => __ ( 'Adding to cart...', 'woo-stripe' ),
64
- 'choose_product' => __ ( 'Please select a product option before updating quantity.', 'woo-stripe' )
65
  ]
66
  ] );
67
  }
13
 
14
  public function __construct() {
15
  $this->id = 'stripe_payment_request';
16
+ $this->tab_title = __ ( 'PaymentRequest Gateway', 'woo-stripe-payment' );
17
  $this->template_name = 'payment-request.php';
18
  $this->token_type = 'Stripe_CC';
19
+ $this->method_title = __ ( 'Stripe Payment Request', 'woo-stripe-payment' );
20
+ $this->method_description = __ ( 'Gateway that renders based on the user\'s browser. Chrome payment methods, Microsoft pay, etc.', 'woo-stripe-payment' );
21
  parent::__construct ();
22
  }
23
 
60
  'chrome' => wc_stripe ()->assets_url ( 'img/chrome.svg' )
61
  ],
62
  'messages' => [
63
+ 'add_to_cart' => __ ( 'Adding to cart...', 'woo-stripe-payment' ),
64
+ 'choose_product' => __ ( 'Please select a product option before updating quantity.', 'woo-stripe-payment' )
65
  ]
66
  ] );
67
  }
includes/gateways/class-wc-payment-gateway-stripe-sepa.php CHANGED
@@ -16,13 +16,13 @@ class WC_Payment_Gateway_Stripe_Sepa extends WC_Payment_Gateway_Stripe_Local_Pay
16
  $this->currencies = [ 'EUR'
17
  ];
18
  $this->id = 'stripe_sepa';
19
- $this->tab_title = __ ( 'SEPA', 'woo-stripe' );
20
  $this->template_name = 'local-payment.php';
21
  $this->token_type = 'Stripe_Local';
22
- $this->method_title = __ ( 'Sepa', 'woo-stripe' );
23
- $this->method_description = __ ( 'Sepa gateway that integrates with your Stripe account.', 'woo-stripe' );
24
  $this->icon = wc_stripe ()->assets_url ( 'img/sepa.svg' );
25
- $this->order_button_text = __ ( 'SEPA', 'woo-stripe' );
26
  parent::__construct ();
27
  }
28
 
@@ -32,26 +32,26 @@ class WC_Payment_Gateway_Stripe_Sepa extends WC_Payment_Gateway_Stripe_Local_Pay
32
  'description' => $this->get_payment_description()
33
  ),
34
  'enabled' => array(
35
- 'title' => __ ( 'Enabled', 'woo-stripe' ),
36
  'type' => 'checkbox',
37
  'default' => 'no', 'value' => 'yes',
38
  'desc_tip' => true,
39
- 'description' => __ ( 'If enabled, your site can accept P24 payments through Stripe.', 'woo-stripe' )
40
  ),
41
  'general_settings' => array(
42
  'type' => 'title',
43
- 'title' => __ ( 'General Settings', 'woo-stripe' )
44
  ),
45
  'title_text' => array( 'type' => 'text',
46
- 'title' => __ ( 'Title', 'woo-stripe' ),
47
- 'default' => __ ( 'SEPA Direct Debit', 'woo-stripe' ),
48
  'desc_tip' => true,
49
  'description' => __ ( 'Title of the Sepa gateway' )
50
  ),
51
  'description' => array(
52
- 'title' => __ ( 'Description', 'woo-stripe' ),
53
  'type' => 'text', 'default' => '',
54
- 'description' => __ ( 'Leave blank if you don\'t want a description to show for the gateway.', 'woo-stripe' ),
55
  'desc_tip' => true
56
  )
57
  ];
16
  $this->currencies = [ 'EUR'
17
  ];
18
  $this->id = 'stripe_sepa';
19
+ $this->tab_title = __ ( 'SEPA', 'woo-stripe-payment' );
20
  $this->template_name = 'local-payment.php';
21
  $this->token_type = 'Stripe_Local';
22
+ $this->method_title = __ ( 'Sepa', 'woo-stripe-payment' );
23
+ $this->method_description = __ ( 'Sepa gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
24
  $this->icon = wc_stripe ()->assets_url ( 'img/sepa.svg' );
25
+ $this->order_button_text = __ ( 'SEPA', 'woo-stripe-payment' );
26
  parent::__construct ();
27
  }
28
 
32
  'description' => $this->get_payment_description()
33
  ),
34
  'enabled' => array(
35
+ 'title' => __ ( 'Enabled', 'woo-stripe-payment' ),
36
  'type' => 'checkbox',
37
  'default' => 'no', 'value' => 'yes',
38
  'desc_tip' => true,
39
+ 'description' => __ ( 'If enabled, your site can accept P24 payments through Stripe.', 'woo-stripe-payment' )
40
  ),
41
  'general_settings' => array(
42
  'type' => 'title',
43
+ 'title' => __ ( 'General Settings', 'woo-stripe-payment' )
44
  ),
45
  'title_text' => array( 'type' => 'text',
46
+ 'title' => __ ( 'Title', 'woo-stripe-payment' ),
47
+ 'default' => __ ( 'SEPA Direct Debit', 'woo-stripe-payment' ),
48
  'desc_tip' => true,
49
  'description' => __ ( 'Title of the Sepa gateway' )
50
  ),
51
  'description' => array(
52
+ 'title' => __ ( 'Description', 'woo-stripe-payment' ),
53
  'type' => 'text', 'default' => '',
54
+ 'description' => __ ( 'Leave blank if you don\'t want a description to show for the gateway.', 'woo-stripe-payment' ),
55
  'desc_tip' => true
56
  )
57
  ];
includes/gateways/class-wc-payment-gateway-stripe-sofort.php CHANGED
@@ -19,13 +19,13 @@ class WC_Payment_Gateway_Stripe_Sofort extends WC_Payment_Gateway_Stripe_Local_P
19
  'IT', 'NL'
20
  ];
21
  $this->id = 'stripe_sofort';
22
- $this->tab_title = __ ( 'Sofort', 'woo-stripe' );
23
  $this->template_name = 'local-payment.php';
24
  $this->token_type = 'Stripe_Local';
25
- $this->method_title = __ ( 'Sofort', 'woo-stripe' );
26
- $this->method_description = __ ( 'Sofort gateway that integrates with your Stripe account.', 'woo-stripe' );
27
  $this->icon = wc_stripe ()->assets_url ( 'img/sofort.svg' );
28
- $this->order_button_text = __ ( 'SOFORT', 'woo-stripe' );
29
  parent::__construct ();
30
  }
31
 
@@ -35,26 +35,26 @@ class WC_Payment_Gateway_Stripe_Sofort extends WC_Payment_Gateway_Stripe_Local_P
35
  'description' => $this->get_payment_description()
36
  ),
37
  'enabled' => array(
38
- 'title' => __ ( 'Enabled', 'woo-stripe' ),
39
  'type' => 'checkbox',
40
  'default' => 'no', 'value' => 'yes',
41
  'desc_tip' => true,
42
- 'description' => __ ( 'If enabled, your site can accept Sofort payments through Stripe.', 'woo-stripe' )
43
  ),
44
  'general_settings' => array(
45
  'type' => 'title',
46
- 'title' => __ ( 'General Settings', 'woo-stripe' )
47
  ),
48
  'title_text' => array( 'type' => 'text',
49
- 'title' => __ ( 'Title', 'woo-stripe' ),
50
- 'default' => __ ( 'SOFORT', 'woo-stripe' ),
51
  'desc_tip' => true,
52
  'description' => __ ( 'Title of the Sofort gateway' )
53
  ),
54
  'description' => array(
55
- 'title' => __ ( 'Description', 'woo-stripe' ),
56
  'type' => 'text', 'default' => '',
57
- 'description' => __ ( 'Leave blank if you don\'t want a description to show for the gateway.', 'woo-stripe' ),
58
  'desc_tip' => true
59
  )
60
  ];
19
  'IT', 'NL'
20
  ];
21
  $this->id = 'stripe_sofort';
22
+ $this->tab_title = __ ( 'Sofort', 'woo-stripe-payment' );
23
  $this->template_name = 'local-payment.php';
24
  $this->token_type = 'Stripe_Local';
25
+ $this->method_title = __ ( 'Sofort', 'woo-stripe-payment' );
26
+ $this->method_description = __ ( 'Sofort gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
27
  $this->icon = wc_stripe ()->assets_url ( 'img/sofort.svg' );
28
+ $this->order_button_text = __ ( 'SOFORT', 'woo-stripe-payment' );
29
  parent::__construct ();
30
  }
31
 
35
  'description' => $this->get_payment_description()
36
  ),
37
  'enabled' => array(
38
+ 'title' => __ ( 'Enabled', 'woo-stripe-payment' ),
39
  'type' => 'checkbox',
40
  'default' => 'no', 'value' => 'yes',
41
  'desc_tip' => true,
42
+ 'description' => __ ( 'If enabled, your site can accept Sofort payments through Stripe.', 'woo-stripe-payment' )
43
  ),
44
  'general_settings' => array(
45
  'type' => 'title',
46
+ 'title' => __ ( 'General Settings', 'woo-stripe-payment' )
47
  ),
48
  'title_text' => array( 'type' => 'text',
49
+ 'title' => __ ( 'Title', 'woo-stripe-payment' ),
50
+ 'default' => __ ( 'SOFORT', 'woo-stripe-payment' ),
51
  'desc_tip' => true,
52
  'description' => __ ( 'Title of the Sofort gateway' )
53
  ),
54
  'description' => array(
55
+ 'title' => __ ( 'Description', 'woo-stripe-payment' ),
56
  'type' => 'text', 'default' => '',
57
+ 'description' => __ ( 'Leave blank if you don\'t want a description to show for the gateway.', 'woo-stripe-payment' ),
58
  'desc_tip' => true
59
  )
60
  ];
includes/gateways/class-wc-payment-gateway-stripe-wechat.php CHANGED
@@ -16,13 +16,13 @@ class WC_Payment_Gateway_Stripe_WeChat extends WC_Payment_Gateway_Stripe_Local_P
16
  'GBP', 'HKD', 'JPY', 'SGD', 'USD'
17
  ];
18
  $this->id = 'stripe_wechat';
19
- $this->tab_title = __ ( 'WeChat', 'woo-stripe' );
20
  $this->template_name = 'local-payment.php';
21
  $this->token_type = 'Stripe_Local';
22
- $this->method_title = __ ( 'WeChat', 'woo-stripe' );
23
- $this->method_description = __ ( 'WeChat gateway that integrates with your Stripe account.', 'woo-stripe' );
24
  $this->icon = wc_stripe ()->assets_url ( 'img/wechat.svg' );
25
- $this->order_button_text = __ ( 'WeChat', 'woo-stripe' );
26
  parent::__construct ();
27
  }
28
 
@@ -32,26 +32,26 @@ class WC_Payment_Gateway_Stripe_WeChat extends WC_Payment_Gateway_Stripe_Local_P
32
  'description' => $this->get_payment_description()
33
  ),
34
  'enabled' => array(
35
- 'title' => __ ( 'Enabled', 'woo-stripe' ),
36
  'type' => 'checkbox',
37
  'default' => 'no', 'value' => 'yes',
38
  'desc_tip' => true,
39
- 'description' => __ ( 'If enabled, your site can accept P24 payments through Stripe.', 'woo-stripe' )
40
  ),
41
  'general_settings' => array(
42
  'type' => 'title',
43
- 'title' => __ ( 'General Settings', 'woo-stripe' )
44
  ),
45
  'title_text' => array( 'type' => 'text',
46
- 'title' => __ ( 'Title', 'woo-stripe' ),
47
- 'default' => __ ( 'WeChat', 'woo-stripe' ),
48
  'desc_tip' => true,
49
- 'description' => __ ( 'Title of the WeChat gateway', 'woo-stripe' )
50
  ),
51
  'description' => array(
52
- 'title' => __ ( 'Description', 'woo-stripe' ),
53
  'type' => 'text', 'default' => '',
54
- 'description' => __ ( 'Leave blank if you don\'t want a description to show for the gateway.', 'woo-stripe' ),
55
  'desc_tip' => true
56
  )
57
  ];
16
  'GBP', 'HKD', 'JPY', 'SGD', 'USD'
17
  ];
18
  $this->id = 'stripe_wechat';
19
+ $this->tab_title = __ ( 'WeChat', 'woo-stripe-payment' );
20
  $this->template_name = 'local-payment.php';
21
  $this->token_type = 'Stripe_Local';
22
+ $this->method_title = __ ( 'WeChat', 'woo-stripe-payment' );
23
+ $this->method_description = __ ( 'WeChat gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
24
  $this->icon = wc_stripe ()->assets_url ( 'img/wechat.svg' );
25
+ $this->order_button_text = __ ( 'WeChat', 'woo-stripe-payment' );
26
  parent::__construct ();
27
  }
28
 
32
  'description' => $this->get_payment_description()
33
  ),
34
  'enabled' => array(
35
+ 'title' => __ ( 'Enabled', 'woo-stripe-payment' ),
36
  'type' => 'checkbox',
37
  'default' => 'no', 'value' => 'yes',
38
  'desc_tip' => true,
39
+ 'description' => __ ( 'If enabled, your site can accept P24 payments through Stripe.', 'woo-stripe-payment' )
40
  ),
41
  'general_settings' => array(
42
  'type' => 'title',
43
+ 'title' => __ ( 'General Settings', 'woo-stripe-payment' )
44
  ),
45
  'title_text' => array( 'type' => 'text',
46
+ 'title' => __ ( 'Title', 'woo-stripe-payment' ),
47
+ 'default' => __ ( 'WeChat', 'woo-stripe-payment' ),
48
  'desc_tip' => true,
49
+ 'description' => __ ( 'Title of the WeChat gateway', 'woo-stripe-payment' )
50
  ),
51
  'description' => array(
52
+ 'title' => __ ( 'Description', 'woo-stripe-payment' ),
53
  'type' => 'text', 'default' => '',
54
+ 'description' => __ ( 'Leave blank if you don\'t want a description to show for the gateway.', 'woo-stripe-payment' ),
55
  'desc_tip' => true
56
  )
57
  ];
includes/gateways/settings/applepay-settings.php CHANGED
@@ -1,31 +1,31 @@
1
  <?php
2
  return array(
3
  'desc' => array( 'type' => 'description',
4
- 'description' => sprintf ( '<div class="wc-stripe-register-domain"><button class="button button-secondary api-register-domain">%s</button></div><p>%s</p>', __ ( 'Register Domain', 'woo-stripe' ), sprintf ( __ ( 'This plugin attemps to add the domain association file to your server automatically when you click the Register Domain button. If that fails due to file permssions, you must add the <strong>%s.well-known/apple-developer-merchantid-domain-association%s</strong> file to your domain and register your domain within the Stripe Dashboard.', 'woo-stripe' ), '<a href="https://stripe.com/files/apple-pay/apple-developer-merchantid-domain-association">', '</a>' ) )
5
  ),
6
  'enabled' => array(
7
- 'title' => __ ( 'Enabled', 'woo-stripe' ),
8
  'type' => 'checkbox', 'default' => 'no',
9
  'value' => 'yes', 'desc_tip' => true,
10
- 'description' => __ ( 'If enabled, your site can accept Apple Pay payments through Stripe.', 'woo-stripe' )
11
  ),
12
  'general_settings' => array( 'type' => 'title',
13
- 'title' => __ ( 'General Settings', 'woo-stripe' )
14
  ),
15
  'title_text' => array( 'type' => 'text',
16
- 'title' => __ ( 'Title', 'woo-stripe' ),
17
- 'default' => __ ( 'Apple Pay', 'woo-stripe' ),
18
  'desc_tip' => true,
19
  'description' => __ ( 'Title of the credit card gateway' )
20
  ),
21
  'description' => array(
22
- 'title' => __ ( 'Description', 'woo-stripe' ),
23
  'type' => 'text', 'default' => '',
24
- 'description' => __ ( 'Leave blank if you don\'t want a description to show for the gateway.', 'woo-stripe' ),
25
  'desc_tip' => true
26
  ),
27
  'method_format' => array(
28
- 'title' => __ ( 'Credit Card Display', 'woo-stripe' ),
29
  'type' => 'select',
30
  'class' => 'wc-enhanced-select',
31
  'options' => wp_list_pluck ( $this->get_method_formats (), 'example' ),
@@ -34,93 +34,93 @@ return array(
34
  'description' => __ ( 'This option allows you to customize how the credit card will display for your customers on orders, subscriptions, etc.' )
35
  ),
36
  'charge_type' => array( 'type' => 'select',
37
- 'title' => __ ( 'Charge Type', 'woo-stripe' ),
38
  'default' => 'capture',
39
  'class' => 'wc-enhanced-select',
40
  'options' => array(
41
- 'capture' => __ ( 'Capture', 'woo-stripe' ),
42
- 'authorize' => __ ( 'Authorize', 'woo-stripe' )
43
  ), 'desc_tip' => true,
44
- 'description' => __ ( 'This option determines whether the customer\'s funds are captured immediately or authorized and can be captured at a later date.', 'woo-stripe' )
45
  ),
46
  'payment_sections' => array(
47
  'type' => 'multiselect',
48
- 'title' => __ ( 'Payment Sections', 'woo-stripe' ),
49
  'class' => 'wc-enhanced-select',
50
  'options' => [
51
- 'product' => __ ( 'Product Page', 'woo-stripe' ),
52
- 'cart' => __ ( 'Cart Page', 'woo-stripe' ),
53
- 'checkout_banner' => __ ( 'Top of Checkout', 'woo-stripe' )
54
  ], 'default' => [ 'product', 'cart'
55
  ],
56
- 'description' => __ ( 'Increase your conversion rate by offering Apple Pay on your Product and Cart pages, or at the top of the checkout page.', 'woo-stripe' )
57
  ),
58
  'order_status' => array( 'type' => 'select',
59
- 'title' => __ ( 'Order Status', 'woo-stripe' ),
60
  'default' => 'default',
61
  'class' => 'wc-enhanced-select',
62
  'options' => array_merge ( array(
63
- 'default' => __ ( 'Default', 'woo-stripe' )
64
  ), wc_get_order_statuses () ),
65
  'tool_tip' => true,
66
- 'description' => __ ( 'This is the status of the order once payment is complete. If <b>Default</b> is selected, then WooCommerce will set the order status automatically based on internal logic which states if a product is virtual and downloadable then status is set to complete. Products that require shipping are set to Processing. Default is the recommended setting as it allows standard WooCommerce code to process the order status.', 'woo-stripe' )
67
  ),
68
  /* 'order_prefix' => array( 'type' => 'text',
69
- 'title' => __ ( 'Order Prefix', 'woo-stripe' ),
70
  'value' => '', 'default' => '',
71
  'class' => '', 'desc_tip' => true,
72
  'description' => __ ( 'The order prefix is prepended to the WooCommerce order id and will appear within Braintree as the Order ID. This setting can be helpful if you want to distinguish
73
- orders that came from this particular site, plugin, or gateway.', 'woo-stripe' )
74
  ),
75
  'order_suffix' => array( 'type' => 'text',
76
- 'title' => __ ( 'Order Suffix', 'woo-stripe' ),
77
  'value' => '', 'default' => '',
78
  'class' => '', 'desc_tip' => true,
79
  'description' => __ ( 'The order suffix is appended to the WooCommerce order id and will appear within Braintree as the Order ID. This setting can be helpful if you want to distinguish
80
- orders that came from this particular site, plugin, or gateway.', 'woo-stripe' )
81
  ), */
82
  'button_section' => [ 'type' => 'title',
83
- 'title' => __ ( 'Button Settings', 'woo-stripe' )
84
  ],
85
  'button_style' => [ 'type' => 'select',
86
- 'title' => __ ( 'Button Design', 'woo-stripe' ),
87
  'class' => 'wc-enhanced-select',
88
  'default' => 'apple-pay-button-black',
89
  'options' => array(
90
- 'apple-pay-button-black' => __ ( 'Black Button', 'woo-stripe' ),
91
- 'apple-pay-button-white-with-line' => __ ( 'White With Black Line', 'woo-stripe' ),
92
- 'apple-pay-button-white' => __ ( 'White Button', 'woo-stripe' )
93
  ),
94
- 'description' => __ ( 'This is the style for all Apple Pay buttons presented on your store.', 'woo-stripe' )
95
  ],
96
  'button_type_checkout' => array(
97
- 'title' => __ ( 'Checkout button type', 'woo-stripe' ),
98
  'type' => 'select',
99
  'options' => array(
100
- 'plain' => __ ( 'Standard Button', 'woo-stripe' ),
101
- 'buy' => __ ( 'Buy with Apple Pay', 'woo-stripe' )
102
  ),
103
- // 'check-out' => __ ( 'Checkout with Apple Pay', 'woo-stripe' )
104
  'default' => 'plain'
105
  ),
106
  'button_type_cart' => array(
107
- 'title' => __ ( 'Cart button type', 'woo-stripe' ),
108
  'type' => 'select',
109
  'options' => array(
110
- 'plain' => __ ( 'Standard Button', 'woo-stripe' ),
111
- 'buy' => __ ( 'Buy with Apple Pay', 'woo-stripe' )
112
  ),
113
- // 'check-out' => __ ( 'Checkout with Apple Pay', 'woo-stripe' )
114
  'default' => 'plain'
115
  ),
116
  'button_type_product' => array(
117
- 'title' => __ ( 'Product button type', 'woo-stripe' ),
118
  'type' => 'select',
119
  'options' => array(
120
- 'plain' => __ ( 'Standard Button', 'woo-stripe' ),
121
- 'buy' => __ ( 'Buy with Apple Pay', 'woo-stripe' )
122
  ),
123
- // 'check-out' => __ ( 'Checkout with Apple Pay', 'woo-stripe' )
124
  'default' => 'buy'
125
  )
126
  );
1
  <?php
2
  return array(
3
  'desc' => array( 'type' => 'description',
4
+ 'description' => sprintf ( '<div class="wc-stripe-register-domain"><button class="button button-secondary api-register-domain">%s</button></div><p>%s</p>', __ ( 'Register Domain', 'woo-stripe-payment' ), sprintf ( __ ( 'This plugin attemps to add the domain association file to your server automatically when you click the Register Domain button. If that fails due to file permssions, you must add the <strong>%s.well-known/apple-developer-merchantid-domain-association%s</strong> file to your domain and register your domain within the Stripe Dashboard.', 'woo-stripe-payment' ), '<a href="https://stripe.com/files/apple-pay/apple-developer-merchantid-domain-association">', '</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 Apple Pay payments through Stripe.', 'woo-stripe-payment' )
11
  ),
12
  'general_settings' => array( 'type' => 'title',
13
+ 'title' => __ ( 'General Settings', 'woo-stripe-payment' )
14
  ),
15
  'title_text' => array( 'type' => 'text',
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' ),
23
  'type' => 'text', 'default' => '',
24
+ 'description' => __ ( 'Leave blank if you don\'t want a description to show for the gateway.', 'woo-stripe-payment' ),
25
  'desc_tip' => true
26
  ),
27
  'method_format' => array(
28
+ 'title' => __ ( 'Credit Card Display', 'woo-stripe-payment' ),
29
  'type' => 'select',
30
  'class' => 'wc-enhanced-select',
31
  'options' => wp_list_pluck ( $this->get_method_formats (), 'example' ),
34
  'description' => __ ( 'This option allows you to customize how the credit card will display for your customers on orders, subscriptions, etc.' )
35
  ),
36
  'charge_type' => array( 'type' => 'select',
37
+ 'title' => __ ( 'Charge Type', 'woo-stripe-payment' ),
38
  'default' => 'capture',
39
  'class' => 'wc-enhanced-select',
40
  'options' => array(
41
+ 'capture' => __ ( 'Capture', 'woo-stripe-payment' ),
42
+ 'authorize' => __ ( 'Authorize', 'woo-stripe-payment' )
43
  ), 'desc_tip' => true,
44
+ 'description' => __ ( 'This option determines whether the customer\'s funds are captured immediately or authorized and can be captured at a later date.', 'woo-stripe-payment' )
45
  ),
46
  'payment_sections' => array(
47
  'type' => 'multiselect',
48
+ 'title' => __ ( 'Payment Sections', 'woo-stripe-payment' ),
49
  'class' => 'wc-enhanced-select',
50
  'options' => [
51
+ 'product' => __ ( 'Product Page', 'woo-stripe-payment' ),
52
+ 'cart' => __ ( 'Cart Page', 'woo-stripe-payment' ),
53
+ 'checkout_banner' => __ ( 'Top of Checkout', 'woo-stripe-payment' )
54
  ], 'default' => [ 'product', 'cart'
55
  ],
56
+ 'description' => __ ( 'Increase your conversion rate by offering Apple Pay on your Product and Cart pages, or at the top of the checkout page.', 'woo-stripe-payment' )
57
  ),
58
  'order_status' => array( 'type' => 'select',
59
+ 'title' => __ ( 'Order Status', 'woo-stripe-payment' ),
60
  'default' => 'default',
61
  'class' => 'wc-enhanced-select',
62
  'options' => array_merge ( array(
63
+ 'default' => __ ( 'Default', 'woo-stripe-payment' )
64
  ), wc_get_order_statuses () ),
65
  'tool_tip' => true,
66
+ 'description' => __ ( 'This is the status of the order once payment is complete. If <b>Default</b> is selected, then WooCommerce will set the order status automatically based on internal logic which states if a product is virtual and downloadable then status is set to complete. Products that require shipping are set to Processing. Default is the recommended setting as it allows standard WooCommerce code to process the order status.', 'woo-stripe-payment' )
67
  ),
68
  /* 'order_prefix' => array( 'type' => 'text',
69
+ 'title' => __ ( 'Order Prefix', 'woo-stripe-payment' ),
70
  'value' => '', 'default' => '',
71
  'class' => '', 'desc_tip' => true,
72
  'description' => __ ( 'The order prefix is prepended to the WooCommerce order id and will appear within Braintree as the Order ID. This setting can be helpful if you want to distinguish
73
+ orders that came from this particular site, plugin, or gateway.', 'woo-stripe-payment' )
74
  ),
75
  'order_suffix' => array( 'type' => 'text',
76
+ 'title' => __ ( 'Order Suffix', 'woo-stripe-payment' ),
77
  'value' => '', 'default' => '',
78
  'class' => '', 'desc_tip' => true,
79
  'description' => __ ( 'The order suffix is appended to the WooCommerce order id and will appear within Braintree as the Order ID. This setting can be helpful if you want to distinguish
80
+ orders that came from this particular site, plugin, or gateway.', 'woo-stripe-payment' )
81
  ), */
82
  'button_section' => [ 'type' => 'title',
83
+ 'title' => __ ( 'Button Settings', 'woo-stripe-payment' )
84
  ],
85
  'button_style' => [ 'type' => 'select',
86
+ 'title' => __ ( 'Button Design', 'woo-stripe-payment' ),
87
  'class' => 'wc-enhanced-select',
88
  'default' => 'apple-pay-button-black',
89
  'options' => array(
90
+ 'apple-pay-button-black' => __ ( 'Black Button', 'woo-stripe-payment' ),
91
+ 'apple-pay-button-white-with-line' => __ ( 'White With Black Line', 'woo-stripe-payment' ),
92
+ 'apple-pay-button-white' => __ ( 'White Button', 'woo-stripe-payment' )
93
  ),
94
+ 'description' => __ ( 'This is the style for all Apple Pay buttons presented on your store.', 'woo-stripe-payment' )
95
  ],
96
  'button_type_checkout' => array(
97
+ 'title' => __ ( 'Checkout button type', 'woo-stripe-payment' ),
98
  'type' => 'select',
99
  'options' => array(
100
+ 'plain' => __ ( 'Standard Button', 'woo-stripe-payment' ),
101
+ 'buy' => __ ( 'Buy with Apple Pay', 'woo-stripe-payment' )
102
  ),
103
+ // 'check-out' => __ ( 'Checkout with Apple Pay', 'woo-stripe-payment' )
104
  'default' => 'plain'
105
  ),
106
  'button_type_cart' => array(
107
+ 'title' => __ ( 'Cart button type', 'woo-stripe-payment' ),
108
  'type' => 'select',
109
  'options' => array(
110
+ 'plain' => __ ( 'Standard Button', 'woo-stripe-payment' ),
111
+ 'buy' => __ ( 'Buy with Apple Pay', 'woo-stripe-payment' )
112
  ),
113
+ // 'check-out' => __ ( 'Checkout with Apple Pay', 'woo-stripe-payment' )
114
  'default' => 'plain'
115
  ),
116
  'button_type_product' => array(
117
+ 'title' => __ ( 'Product button type', 'woo-stripe-payment' ),
118
  'type' => 'select',
119
  'options' => array(
120
+ 'plain' => __ ( 'Standard Button', 'woo-stripe-payment' ),
121
+ 'buy' => __ ( 'Buy with Apple Pay', 'woo-stripe-payment' )
122
  ),
123
+ // 'check-out' => __ ( 'Checkout with Apple Pay', 'woo-stripe-payment' )
124
  'default' => 'buy'
125
  )
126
  );
includes/gateways/settings/cc-settings.php CHANGED
@@ -1,31 +1,31 @@
1
  <?php
2
  return array(
3
  'enabled' => array(
4
- 'title' => __ ( 'Enabled', 'woo-stripe' ),
5
  'type' => 'checkbox', 'default' => 'yes',
6
  'value' => 'yes', 'desc_tip' => true,
7
- 'description' => __ ( 'If enabled, your site can accept credit card payments through Stripe.', 'woo-stripe' )
8
  ),
9
  'desc1' => array( 'type' => 'description',
10
- 'description' => sprintf ( __ ( '%sTest cards%s', 'woo-stripe' ), '<a target="_blank" href="https://stripe.com/docs/testing#cards">', '</a>' )
11
  ),
12
  'general_settings' => array( 'type' => 'title',
13
- 'title' => __ ( 'General Settings', 'woo-stripe' )
14
  ),
15
  'title_text' => array( 'type' => 'text',
16
- 'title' => __ ( 'Title', 'woo-stripe' ),
17
- 'default' => __ ( 'Credit Cards', 'woo-stripe' ),
18
  'desc_tip' => true,
19
  'description' => __ ( 'Title of the credit card gateway' )
20
  ),
21
  'description' => array(
22
- 'title' => __ ( 'Description', 'woo-stripe' ),
23
  'type' => 'text', 'default' => '',
24
- 'description' => __ ( 'Leave blank if you don\'t want a description to show for the gateway.', 'woo-stripe' ),
25
  'desc_tip' => true
26
  ),
27
  'method_format' => array(
28
- 'title' => __ ( 'Credit Card Display', 'woo-stripe' ),
29
  'type' => 'select',
30
  'class' => 'wc-enhanced-select',
31
  'options' => wp_list_pluck ( $this->get_method_formats (), 'example' ),
@@ -34,30 +34,30 @@ return array(
34
  'description' => __ ( 'This option allows you to customize how the credit card will display for your customers on orders, subscriptions, etc.' )
35
  ),
36
  'charge_type' => array( 'type' => 'select',
37
- 'title' => __ ( 'Charge Type', 'woo-stripe' ),
38
  'default' => 'capture',
39
  'class' => 'wc-enhanced-select',
40
  'options' => array(
41
- 'capture' => __ ( 'Capture', 'woo-stripe' ),
42
- 'authorize' => __ ( 'Authorize', 'woo-stripe' )
43
  ), 'desc_tip' => true,
44
- 'description' => __ ( 'This option determines whether the customer\'s funds are captured immediately or authorized and can be captured at a later date.', 'woo-stripe' )
45
  ),
46
  'order_status' => array( 'type' => 'select',
47
- 'title' => __ ( 'Order Status', 'woo-stripe' ),
48
  'default' => 'default',
49
  'class' => 'wc-enhanced-select',
50
  'options' => array_merge ( array(
51
- 'default' => __ ( 'Default', 'woo-stripe' )
52
  ), wc_get_order_statuses () ),
53
  'tool_tip' => true,
54
- 'description' => __ ( 'This is the status of the order once payment is complete. If <b>Default</b> is selected, then WooCommerce will set the order status automatically based on internal logic which states if a product is virtual and downloadable then status is set to complete. Products that require shipping are set to Processing. Default is the recommended setting as it allows standard WooCommerce code to process the order status.', 'woo-stripe' )
55
  ),
56
  'save_card_enabled' => array( 'type' => 'checkbox',
57
  'value' => 'yes', 'default' => 'yes',
58
- 'title' => __ ( 'Allow Credit Card Save', 'woo-stripe' ),
59
  'desc_tip' => false,
60
- 'description' => __ ( 'If enabled, a checkbox will be available on the checkout page allowing your customer\'s to save their credit card. The payment methods are stored securely in Stripe\'s vault and never touch your server. Note: if the cart contains a subscription, there will be no checkbox because the payment method will be saved automatically. There will also be no checkbox for guest checkout as a user must be logged in to save a payment method.', 'woo-stripe' )
61
  ),
62
  'cards' => array( 'type' => 'multiselect',
63
  'title' => __ ( 'Accepted Payment Methods', 'wwoo-stripe' ),
@@ -78,23 +78,23 @@ return array(
78
  'description' => __ ( 'The selected icons will show customers which credit card brands you accept.', 'wwoo-stripe' )
79
  ),
80
  'form_title' => array( 'type' => 'title',
81
- 'title' => __ ( 'Credit Card Form', 'woo-stripe' )
82
  ),
83
  'form_type' => array(
84
- 'title' => __ ( 'Card Form', 'woo-stripe' ),
85
  'type' => 'select',
86
  'options' => array(
87
- 'inline' => __ ( 'Stripe form', 'woo-stripe' ),
88
- 'custom' => __ ( 'Custom form', 'woo-stripe' )
89
  ), 'default' => 'inline',
90
- 'description' => __ ( 'The Stripe form option displays a CC form rendered by Stripe. It works well with most themes. The custom card forms are offered if you want more options on the CC form design.', 'woo-stripe' )
91
  ),
92
  'custom_form' => array(
93
- 'title' => __ ( 'Custom Form', 'woo-stripe' ),
94
  'type' => 'select',
95
  'options' => wp_list_pluck ( wc_stripe_get_custom_forms (), 'label' ),
96
- 'default' => 'bootstrap',
97
- 'description' => __ ( 'The design of the credit card form.', 'woo-stripe' ),
98
  'desc_tip' => true,
99
  'custom_attributes' => array(
100
  'data-show-if' => array(
@@ -103,9 +103,9 @@ return array(
103
  )
104
  ),
105
  'postal_enabled' => array(
106
- 'title' => __ ( 'Postal Code', 'woo-stripe' ),
107
  'type' => 'checkbox', 'default' => 'yes',
108
- 'description' => __ ( 'If enabled, the CC form will show the postal code on the checkout page. If disabled, the billing field\'s postal code will be used. The postal code will show on the Add Payment Method page for security reasons.', 'woo-stripe' ),
109
  'desc_tip' => true,
110
  'custom_attributes' => array(
111
  'data-show-if' => array(
@@ -114,9 +114,9 @@ return array(
114
  )
115
  ),
116
  /* 'cvv_enabled' => array(
117
- 'title' => __ ( 'CVV Code', 'woo-stripe' ),
118
  'type' => 'checkbox', 'default' => 'yes',
119
- 'description' => __ ( 'If enabled, the CC form will show the cvv field.', 'woo-stripe' ),
120
  'desc_tip' => true,
121
  'custom_attributes' => array(
122
  'data-show-if' => array(
1
  <?php
2
  return array(
3
  'enabled' => array(
4
+ 'title' => __ ( 'Enabled', 'woo-stripe-payment' ),
5
  'type' => 'checkbox', 'default' => 'yes',
6
  'value' => 'yes', 'desc_tip' => true,
7
+ 'description' => __ ( 'If enabled, your site can accept credit card payments through Stripe.', 'woo-stripe-payment' )
8
  ),
9
  'desc1' => array( 'type' => 'description',
10
+ 'description' => sprintf ( __ ( '%sTest cards%s', 'woo-stripe-payment' ), '<a target="_blank" href="https://stripe.com/docs/testing#cards">', '</a>' )
11
  ),
12
  'general_settings' => array( 'type' => 'title',
13
+ 'title' => __ ( 'General Settings', 'woo-stripe-payment' )
14
  ),
15
  'title_text' => array( 'type' => 'text',
16
+ 'title' => __ ( 'Title', 'woo-stripe-payment' ),
17
+ 'default' => __ ( 'Credit Cards', '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' ),
23
  'type' => 'text', 'default' => '',
24
+ 'description' => __ ( 'Leave blank if you don\'t want a description to show for the gateway.', 'woo-stripe-payment' ),
25
  'desc_tip' => true
26
  ),
27
  'method_format' => array(
28
+ 'title' => __ ( 'Credit Card Display', 'woo-stripe-payment' ),
29
  'type' => 'select',
30
  'class' => 'wc-enhanced-select',
31
  'options' => wp_list_pluck ( $this->get_method_formats (), 'example' ),
34
  'description' => __ ( 'This option allows you to customize how the credit card will display for your customers on orders, subscriptions, etc.' )
35
  ),
36
  'charge_type' => array( 'type' => 'select',
37
+ 'title' => __ ( 'Charge Type', 'woo-stripe-payment' ),
38
  'default' => 'capture',
39
  'class' => 'wc-enhanced-select',
40
  'options' => array(
41
+ 'capture' => __ ( 'Capture', 'woo-stripe-payment' ),
42
+ 'authorize' => __ ( 'Authorize', 'woo-stripe-payment' )
43
  ), 'desc_tip' => true,
44
+ 'description' => __ ( 'This option determines whether the customer\'s funds are captured immediately or authorized and can be captured at a later date.', 'woo-stripe-payment' )
45
  ),
46
  'order_status' => array( 'type' => 'select',
47
+ 'title' => __ ( 'Order Status', 'woo-stripe-payment' ),
48
  'default' => 'default',
49
  'class' => 'wc-enhanced-select',
50
  'options' => array_merge ( array(
51
+ 'default' => __ ( 'Default', 'woo-stripe-payment' )
52
  ), wc_get_order_statuses () ),
53
  'tool_tip' => true,
54
+ 'description' => __ ( 'This is the status of the order once payment is complete. If <b>Default</b> is selected, then WooCommerce will set the order status automatically based on internal logic which states if a product is virtual and downloadable then status is set to complete. Products that require shipping are set to Processing. Default is the recommended setting as it allows standard WooCommerce code to process the order status.', 'woo-stripe-payment' )
55
  ),
56
  'save_card_enabled' => array( 'type' => 'checkbox',
57
  'value' => 'yes', 'default' => 'yes',
58
+ 'title' => __ ( 'Allow Credit Card Save', 'woo-stripe-payment' ),
59
  'desc_tip' => false,
60
+ 'description' => __ ( 'If enabled, a checkbox will be available on the checkout page allowing your customer\'s to save their credit card. The payment methods are stored securely in Stripe\'s vault and never touch your server. Note: if the cart contains a subscription, there will be no checkbox because the payment method will be saved automatically. There will also be no checkbox for guest checkout as a user must be logged in to save a payment method.', 'woo-stripe-payment' )
61
  ),
62
  'cards' => array( 'type' => 'multiselect',
63
  'title' => __ ( 'Accepted Payment Methods', 'wwoo-stripe' ),
78
  'description' => __ ( 'The selected icons will show customers which credit card brands you accept.', 'wwoo-stripe' )
79
  ),
80
  'form_title' => array( 'type' => 'title',
81
+ 'title' => __ ( 'Credit Card Form', 'woo-stripe-payment' )
82
  ),
83
  'form_type' => array(
84
+ 'title' => __ ( 'Card Form', 'woo-stripe-payment' ),
85
  'type' => 'select',
86
  'options' => array(
87
+ 'inline' => __ ( 'Stripe form', 'woo-stripe-payment' ),
88
+ 'custom' => __ ( 'Custom form', 'woo-stripe-payment' )
89
  ), 'default' => 'inline',
90
+ 'description' => __ ( 'The Stripe form option displays a CC form rendered by Stripe. It works well with most themes. The custom card forms are offered if you want more options on the CC form design.', 'woo-stripe-payment' )
91
  ),
92
  'custom_form' => array(
93
+ 'title' => __ ( 'Custom Form', 'woo-stripe-payment' ),
94
  'type' => 'select',
95
  'options' => wp_list_pluck ( wc_stripe_get_custom_forms (), 'label' ),
96
+ 'default' => 'simple',
97
+ 'description' => __ ( 'The design of the credit card form.', 'woo-stripe-payment' ),
98
  'desc_tip' => true,
99
  'custom_attributes' => array(
100
  'data-show-if' => array(
103
  )
104
  ),
105
  'postal_enabled' => array(
106
+ 'title' => __ ( 'Postal Code', 'woo-stripe-payment' ),
107
  'type' => 'checkbox', 'default' => 'yes',
108
+ 'description' => __ ( 'If enabled, the CC form will show the postal code on the checkout page. If disabled, the billing field\'s postal code will be used. The postal code will show on the Add Payment Method page for security reasons.', 'woo-stripe-payment' ),
109
  'desc_tip' => true,
110
  'custom_attributes' => array(
111
  'data-show-if' => array(
114
  )
115
  ),
116
  /* 'cvv_enabled' => array(
117
+ 'title' => __ ( 'CVV Code', 'woo-stripe-payment' ),
118
  'type' => 'checkbox', 'default' => 'yes',
119
+ 'description' => __ ( 'If enabled, the CC form will show the cvv field.', 'woo-stripe-payment' ),
120
  'desc_tip' => true,
121
  'custom_attributes' => array(
122
  'data-show-if' => array(
includes/gateways/settings/googlepay-settings.php CHANGED
@@ -1,39 +1,45 @@
1
  <?php
2
  return array(
3
  'desc1' => array( 'type' => 'description',
4
- 'description' => '<p><a target="_blank" href="https://services.google.com/fb/forms/googlepayAPIenable/">' . __ ( 'Google Pay Request', 'woo-stripe' ) . '</a>. ' . __ ( 'When you submit your request for Google Pay, request to be whitelisted for callbackintents. This ensures that the order items are displayed on the Google Payment sheet.', 'woo-stripe' ) . '</p>' . __ ( 'To have the Google API team approve your integration you can enable test mode and Google Pay. When test mode is enabled, Google Pay will work, allowing you to capture the necessary screenshots the Google API team needs to approve your Merchant ID request.', 'woo-stripe' )
5
  ),
6
  'desc2' => array( 'type' => 'description',
7
- 'description' => sprintf ( '<p>%s</p>', sprintf ( __ ( 'If you don\'t want to request a Google Merchant ID, you can use the %sPayment Request Gateway%s which has a Google Pay integration through Stripe via the Chrome browser.', 'woo-stripe' ), '<a target="_blank" href="' . admin_url ( 'admin.php?page=wc-settings&tab=checkout&section=stripe_payment_request' ) . '">', '</a>' ) )
8
  ),
9
  'enabled' => array(
10
- 'title' => __ ( 'Enabled', 'woo-stripe' ),
11
  'type' => 'checkbox', 'default' => 'no',
12
  'value' => 'yes', 'desc_tip' => true,
13
- 'description' => __ ( 'If enabled, your site can accept Google Pay payments through Stripe.', 'woo-stripe' )
14
  ),
15
  'general_settings' => array( 'type' => 'title',
16
- 'title' => __ ( 'General Settings', 'woo-stripe' )
 
 
 
 
 
 
17
  ),
18
  'merchant_id' => array( 'type' => 'text',
19
- 'title' => __ ( 'Merchant ID', 'woo-stripe' ),
20
  'default' => '',
21
- 'description' => __ ( 'Your Google Merchant ID is given to you by the Google API team once you register for Google Pay. While testing in TEST mode you can leave this value blank and Google Pay will work.', 'woo-stripe' )
22
  ),
23
  'title_text' => array( 'type' => 'text',
24
- 'title' => __ ( 'Title', 'woo-stripe' ),
25
- 'default' => __ ( 'Google Pay', 'woo-stripe' ),
26
  'desc_tip' => true,
27
  'description' => __ ( 'Title of the credit card gateway' )
28
  ),
29
  'description' => array(
30
- 'title' => __ ( 'Description', 'woo-stripe' ),
31
  'type' => 'text', 'default' => '',
32
- 'description' => __ ( 'Leave blank if you don\'t want a description to show for the gateway.', 'woo-stripe' ),
33
  'desc_tip' => true
34
  ),
35
  'method_format' => array(
36
- 'title' => __ ( 'Credit Card Display', 'woo-stripe' ),
37
  'type' => 'select',
38
  'class' => 'wc-enhanced-select',
39
  'options' => wp_list_pluck ( $this->get_method_formats (), 'example' ),
@@ -42,103 +48,103 @@ return array(
42
  'description' => __ ( 'This option allows you to customize how the credit card will display for your customers on orders, subscriptions, etc.' )
43
  ),
44
  'charge_type' => array( 'type' => 'select',
45
- 'title' => __ ( 'Charge Type', 'woo-stripe' ),
46
  'default' => 'capture',
47
  'class' => 'wc-enhanced-select',
48
  'options' => array(
49
- 'capture' => __ ( 'Capture', 'woo-stripe' ),
50
- 'authorize' => __ ( 'Authorize', 'woo-stripe' )
51
  ), 'desc_tip' => true,
52
- 'description' => __ ( 'This option determines whether the customer\'s funds are capture immediately or authorized and can be captured at a later date.', 'woo-stripe' )
53
  ),
54
  'payment_sections' => array(
55
  'type' => 'multiselect',
56
- 'title' => __ ( 'Payment Sections', 'woo-stripe' ),
57
  'class' => 'wc-enhanced-select',
58
  'options' => [
59
- 'product' => __ ( 'Product Page', 'woo-stripe' ),
60
- 'cart' => __ ( 'Cart Page', 'woo-stripe' ),
61
- 'checkout_banner' => __ ( 'Top of Checkout', 'woo-stripe' )
62
  ], 'default' => [ 'product', 'cart'
63
  ],
64
- 'description' => __ ( 'Increase your conversion rate by offering Google Pay on your Product and Cart pages, or at the top of the checkout page.', 'woo-stripe' )
65
  ),
66
  'order_status' => array( 'type' => 'select',
67
- 'title' => __ ( 'Order Status', 'woo-stripe' ),
68
  'default' => 'default',
69
  'class' => 'wc-enhanced-select',
70
  'options' => array_merge ( array(
71
- 'default' => __ ( 'Default', 'woo-stripe' )
72
  ), wc_get_order_statuses () ),
73
  'tool_tip' => true,
74
- 'description' => __ ( 'This is the status of the order once payment is complete. If <b>Default</b> is selected, then WooCommerce will set the order status automatically based on internal logic which states if a product is virtual and downloadable then status is set to complete. Products that require shipping are set to Processing. Default is the recommended setting as it allows standard WooCommerce code to process the order status.', 'woo-stripe' )
75
  ),
76
  'merchant_name' => [ 'type' => 'text',
77
- 'title' => __ ( 'Merchant Name', 'woo-stripe' ),
78
  'default' => get_bloginfo ( 'name' ),
79
- 'description' => __ ( 'The name of your business as it appears on the Google Pay payment sheet.', 'woo-stripe' ),
80
  'desc_tip' => true
81
  ],
82
  'icon' => array(
83
- 'title' => __ ( 'Icon', 'woo-stripe' ),
84
  'type' => 'select',
85
  'options' => array(
86
- 'googlepay_outline' => __ ( 'With Outline', 'woo-stripe' ),
87
- 'googlepay_standard' => __ ( 'Standard', 'woo-stripe' )
88
  ), 'default' => 'googlepay_standard',
89
  'desc_tip' => true,
90
- 'description' => __ ( 'This is the icon style that appears next to the gateway on the checkout page.', 'woo-stripe' )
91
  ),
92
  /* 'order_prefix' => array( 'type' => 'text',
93
- 'title' => __ ( 'Order Prefix', 'woo-stripe' ),
94
  'value' => '', 'default' => '',
95
  'class' => '', 'desc_tip' => true,
96
  'description' => __ ( 'The order prefix is prepended to the WooCommerce order id and will appear within Braintree as the Order ID. This setting can be helpful if you want to distinguish
97
- orders that came from this particular site, plugin, or gateway.', 'woo-stripe' )
98
  ),
99
  'order_suffix' => array( 'type' => 'text',
100
- 'title' => __ ( 'Order Suffix', 'woo-stripe' ),
101
  'value' => '', 'default' => '',
102
  'class' => '', 'desc_tip' => true,
103
  'description' => __ ( 'The order suffix is appended to the WooCommerce order id and will appear within Braintree as the Order ID. This setting can be helpful if you want to distinguish
104
- orders that came from this particular site, plugin, or gateway.', 'woo-stripe' )
105
  ), */
106
  /* 'order_status' => array( 'type' => 'select',
107
- 'title' => __ ( 'Order Status', 'woo-stripe' ),
108
  'default' => 'default',
109
  'class' => 'wc-enhanced-select',
110
  'options' => array_merge ( array(
111
- 'default' => __ ( 'Default', 'woo-stripe' )
112
  ), wc_get_order_statuses () ),
113
  'tool_tip' => true,
114
- 'description' => __ ( 'This is the status of the order once payment is complete. If <b>Default</b> is selected, then WooCommerce will set the order status automatically based on internal logic which states if a product is virtual and downloadable then status is set to complete. Products that require shipping are set to Processing. Default is the recommended setting as it allows standard WooCommerce code to process the order status.', 'woo-stripe' )
115
  ), */
116
  'button_section' => array( 'type' => 'title',
117
- 'title' => __ ( 'Button Options', 'woo-stripe' )
118
  ),
119
  'button_color' => array(
120
- 'title' => __ ( 'Button Color', 'woo-stripe' ),
121
  'type' => 'select',
122
  'class' => 'gpay-button-option button-color',
123
  'options' => array(
124
- 'black' => __ ( 'Black', 'woo-stripe' ),
125
- 'white' => __ ( 'White', 'woo-stripe' )
126
  ), 'default' => 'black',
127
- 'description' => __ ( 'The button color of the GPay button.', 'woo-stripe' )
128
  ),
129
  'button_style' => array(
130
- 'title' => __ ( 'Button Style', 'woo-stripe' ),
131
  'type' => 'select',
132
  'class' => 'gpay-button-option button-style',
133
  'options' => array(
134
- 'long' => __ ( 'Long', 'woo-stripe' ),
135
- 'short' => __ ( 'Short', 'woo-stripe' )
136
  ), 'default' => 'long',
137
- 'description' => __ ( 'The button style of the GPay button.', 'woo-stripe' )
138
  ),
139
  'button_render' => [ 'type' => 'button_demo',
140
- 'title' => __ ( 'Button Design', 'woo-stripe' ),
141
  'id' => 'gpay-button',
142
- 'description' => __ ( 'If you can\'t see the Google Pay button, try switching to a Chrome browser.', 'woo-stripe' )
143
  ]
144
  );
1
  <?php
2
  return array(
3
  'desc1' => array( 'type' => 'description',
4
+ 'description' => '<p><a target="_blank" href="https://services.google.com/fb/forms/googlepayAPIenable/">' . __ ( 'Google Pay Request', 'woo-stripe-payment' ) . '</a>. ' . __ ( 'When you submit your request for Google Pay, request to be whitelisted for callbackintents. This ensures that the order items are displayed on the Google Payment sheet.', 'woo-stripe-payment' ) . '</p>' . __ ( 'To have the Google API team approve your integration you can enable test mode and Google Pay. When test mode is enabled, Google Pay will work, allowing you to capture the necessary screenshots the Google API team needs to approve your Merchant ID request.', 'woo-stripe-payment' )
5
  ),
6
  'desc2' => array( 'type' => 'description',
7
+ 'description' => sprintf ( '<p>%s</p>', sprintf ( __ ( 'If you don\'t want to request a Google Merchant ID, you can use the %sPayment Request Gateway%s which has a Google Pay integration through Stripe via the Chrome browser.', 'woo-stripe-payment' ), '<a target="_blank" href="' . admin_url ( 'admin.php?page=wc-settings&tab=checkout&section=stripe_payment_request' ) . '">', '</a>' ) )
8
  ),
9
  'enabled' => array(
10
+ 'title' => __ ( 'Enabled', 'woo-stripe-payment' ),
11
  'type' => 'checkbox', 'default' => 'no',
12
  'value' => 'yes', 'desc_tip' => true,
13
+ 'description' => __ ( 'If enabled, your site can accept Google Pay payments through Stripe.', 'woo-stripe-payment' )
14
  ),
15
  'general_settings' => array( 'type' => 'title',
16
+ 'title' => __ ( 'General Settings', 'woo-stripe-payment' )
17
+ ),
18
+ 'dynamic_price' => array(
19
+ 'title' => __ ( 'Dynamic Price', 'woo-stripe-payment' ),
20
+ 'type' => 'checkbox', 'default' => 'yes',
21
+ 'desc_tip' => true,
22
+ 'description' => __ ( 'If enabled, the Google Payment sheet will show the order line items. You must have Google whitelist you for callback intents.', 'woo-stripe-payment' )
23
  ),
24
  'merchant_id' => array( 'type' => 'text',
25
+ 'title' => __ ( 'Merchant ID', 'woo-stripe-payment' ),
26
  'default' => '',
27
+ 'description' => __ ( 'Your Google Merchant ID is given to you by the Google API team once you register for Google Pay. While testing in TEST mode you can leave this value blank and Google Pay will work.', 'woo-stripe-payment' )
28
  ),
29
  'title_text' => array( 'type' => 'text',
30
+ 'title' => __ ( 'Title', 'woo-stripe-payment' ),
31
+ 'default' => __ ( 'Google Pay', 'woo-stripe-payment' ),
32
  'desc_tip' => true,
33
  'description' => __ ( 'Title of the credit card gateway' )
34
  ),
35
  'description' => array(
36
+ 'title' => __ ( 'Description', 'woo-stripe-payment' ),
37
  'type' => 'text', 'default' => '',
38
+ 'description' => __ ( 'Leave blank if you don\'t want a description to show for the gateway.', 'woo-stripe-payment' ),
39
  'desc_tip' => true
40
  ),
41
  'method_format' => array(
42
+ 'title' => __ ( 'Credit Card Display', 'woo-stripe-payment' ),
43
  'type' => 'select',
44
  'class' => 'wc-enhanced-select',
45
  'options' => wp_list_pluck ( $this->get_method_formats (), 'example' ),
48
  'description' => __ ( 'This option allows you to customize how the credit card will display for your customers on orders, subscriptions, etc.' )
49
  ),
50
  'charge_type' => array( 'type' => 'select',
51
+ 'title' => __ ( 'Charge Type', 'woo-stripe-payment' ),
52
  'default' => 'capture',
53
  'class' => 'wc-enhanced-select',
54
  'options' => array(
55
+ 'capture' => __ ( 'Capture', 'woo-stripe-payment' ),
56
+ 'authorize' => __ ( 'Authorize', 'woo-stripe-payment' )
57
  ), 'desc_tip' => true,
58
+ 'description' => __ ( 'This option determines whether the customer\'s funds are capture immediately or authorized and can be captured at a later date.', 'woo-stripe-payment' )
59
  ),
60
  'payment_sections' => array(
61
  'type' => 'multiselect',
62
+ 'title' => __ ( 'Payment Sections', 'woo-stripe-payment' ),
63
  'class' => 'wc-enhanced-select',
64
  'options' => [
65
+ 'product' => __ ( 'Product Page', 'woo-stripe-payment' ),
66
+ 'cart' => __ ( 'Cart Page', 'woo-stripe-payment' ),
67
+ 'checkout_banner' => __ ( 'Top of Checkout', 'woo-stripe-payment' )
68
  ], 'default' => [ 'product', 'cart'
69
  ],
70
+ 'description' => __ ( 'Increase your conversion rate by offering Google Pay on your Product and Cart pages, or at the top of the checkout page.', 'woo-stripe-payment' )
71
  ),
72
  'order_status' => array( 'type' => 'select',
73
+ 'title' => __ ( 'Order Status', 'woo-stripe-payment' ),
74
  'default' => 'default',
75
  'class' => 'wc-enhanced-select',
76
  'options' => array_merge ( array(
77
+ 'default' => __ ( 'Default', 'woo-stripe-payment' )
78
  ), wc_get_order_statuses () ),
79
  'tool_tip' => true,
80
+ 'description' => __ ( 'This is the status of the order once payment is complete. If <b>Default</b> is selected, then WooCommerce will set the order status automatically based on internal logic which states if a product is virtual and downloadable then status is set to complete. Products that require shipping are set to Processing. Default is the recommended setting as it allows standard WooCommerce code to process the order status.', 'woo-stripe-payment' )
81
  ),
82
  'merchant_name' => [ 'type' => 'text',
83
+ 'title' => __ ( 'Merchant Name', 'woo-stripe-payment' ),
84
  'default' => get_bloginfo ( 'name' ),
85
+ 'description' => __ ( 'The name of your business as it appears on the Google Pay payment sheet.', 'woo-stripe-payment' ),
86
  'desc_tip' => true
87
  ],
88
  'icon' => array(
89
+ 'title' => __ ( 'Icon', 'woo-stripe-payment' ),
90
  'type' => 'select',
91
  'options' => array(
92
+ 'googlepay_outline' => __ ( 'With Outline', 'woo-stripe-payment' ),
93
+ 'googlepay_standard' => __ ( 'Standard', 'woo-stripe-payment' )
94
  ), 'default' => 'googlepay_standard',
95
  'desc_tip' => true,
96
+ 'description' => __ ( 'This is the icon style that appears next to the gateway on the checkout page.', 'woo-stripe-payment' )
97
  ),
98
  /* 'order_prefix' => array( 'type' => 'text',
99
+ 'title' => __ ( 'Order Prefix', 'woo-stripe-payment' ),
100
  'value' => '', 'default' => '',
101
  'class' => '', 'desc_tip' => true,
102
  'description' => __ ( 'The order prefix is prepended to the WooCommerce order id and will appear within Braintree as the Order ID. This setting can be helpful if you want to distinguish
103
+ orders that came from this particular site, plugin, or gateway.', 'woo-stripe-payment' )
104
  ),
105
  'order_suffix' => array( 'type' => 'text',
106
+ 'title' => __ ( 'Order Suffix', 'woo-stripe-payment' ),
107
  'value' => '', 'default' => '',
108
  'class' => '', 'desc_tip' => true,
109
  'description' => __ ( 'The order suffix is appended to the WooCommerce order id and will appear within Braintree as the Order ID. This setting can be helpful if you want to distinguish
110
+ orders that came from this particular site, plugin, or gateway.', 'woo-stripe-payment' )
111
  ), */
112
  /* 'order_status' => array( 'type' => 'select',
113
+ 'title' => __ ( 'Order Status', 'woo-stripe-payment' ),
114
  'default' => 'default',
115
  'class' => 'wc-enhanced-select',
116
  'options' => array_merge ( array(
117
+ 'default' => __ ( 'Default', 'woo-stripe-payment' )
118
  ), wc_get_order_statuses () ),
119
  'tool_tip' => true,
120
+ 'description' => __ ( 'This is the status of the order once payment is complete. If <b>Default</b> is selected, then WooCommerce will set the order status automatically based on internal logic which states if a product is virtual and downloadable then status is set to complete. Products that require shipping are set to Processing. Default is the recommended setting as it allows standard WooCommerce code to process the order status.', 'woo-stripe-payment' )
121
  ), */
122
  'button_section' => array( 'type' => 'title',
123
+ 'title' => __ ( 'Button Options', 'woo-stripe-payment' )
124
  ),
125
  'button_color' => array(
126
+ 'title' => __ ( 'Button Color', 'woo-stripe-payment' ),
127
  'type' => 'select',
128
  'class' => 'gpay-button-option button-color',
129
  'options' => array(
130
+ 'black' => __ ( 'Black', 'woo-stripe-payment' ),
131
+ 'white' => __ ( 'White', 'woo-stripe-payment' )
132
  ), 'default' => 'black',
133
+ 'description' => __ ( 'The button color of the GPay button.', 'woo-stripe-payment' )
134
  ),
135
  'button_style' => array(
136
+ 'title' => __ ( 'Button Style', 'woo-stripe-payment' ),
137
  'type' => 'select',
138
  'class' => 'gpay-button-option button-style',
139
  'options' => array(
140
+ 'long' => __ ( 'Long', 'woo-stripe-payment' ),
141
+ 'short' => __ ( 'Short', 'woo-stripe-payment' )
142
  ), 'default' => 'long',
143
+ 'description' => __ ( 'The button style of the GPay button.', 'woo-stripe-payment' )
144
  ),
145
  'button_render' => [ 'type' => 'button_demo',
146
+ 'title' => __ ( 'Button Design', 'woo-stripe-payment' ),
147
  'id' => 'gpay-button',
148
+ 'description' => __ ( 'If you can\'t see the Google Pay button, try switching to a Chrome browser.', 'woo-stripe-payment' )
149
  ]
150
  );
includes/gateways/settings/payment-request-settings.php CHANGED
@@ -2,31 +2,31 @@
2
  return array(
3
  'desc' => array( 'type' => 'description',
4
  'description' => __ ( 'The PaymentRequest gateway uses your customer\'s browser to render payment options like Google Pay and Microsoft Pay. You can either use the Google Pay gateway for example, or this gateway.
5
- The difference is this gateway uses Stripe\'s PaymentRequest Button rather than render a Google Pay specific button.', 'woo-stripe' )
6
  ),
7
  'enabled' => array(
8
- 'title' => __ ( 'Enabled', 'woo-stripe' ),
9
  'type' => 'checkbox', 'default' => 'no',
10
  'value' => 'yes', 'desc_tip' => true,
11
- 'description' => __ ( 'If enabled, your site can accept Apple Pay payments through Stripe.', 'woo-stripe' )
12
  ),
13
  'general_settings' => array( 'type' => 'title',
14
- 'title' => __ ( 'General Settings', 'woo-stripe' )
15
  ),
16
  'title_text' => array( 'type' => 'text',
17
- 'title' => __ ( 'Title', 'woo-stripe' ),
18
- 'default' => __ ( 'Browser Payments', 'woo-stripe' ),
19
  'desc_tip' => true,
20
  'description' => __ ( 'Title of the credit card gateway' )
21
  ),
22
  'description' => array(
23
- 'title' => __ ( 'Description', 'woo-stripe' ),
24
  'type' => 'text', 'default' => '',
25
- 'description' => __ ( 'Leave blank if you don\'t want a description to show for the gateway.', 'woo-stripe' ),
26
  'desc_tip' => true
27
  ),
28
  'method_format' => array(
29
- 'title' => __ ( 'Credit Card Display', 'woo-stripe' ),
30
  'type' => 'select',
31
  'class' => 'wc-enhanced-select',
32
  'options' => wp_list_pluck ( $this->get_method_formats (), 'example' ),
@@ -35,75 +35,75 @@ return array(
35
  'description' => __ ( 'This option allows you to customize how the credit card will display for your customers on orders, subscriptions, etc.' )
36
  ),
37
  'charge_type' => array( 'type' => 'select',
38
- 'title' => __ ( 'Charge Type', 'woo-stripe' ),
39
  'default' => 'capture',
40
  'class' => 'wc-enhanced-select',
41
  'options' => array(
42
- 'capture' => __ ( 'Capture', 'woo-stripe' ),
43
- 'authorize' => __ ( 'Authorize', 'woo-stripe' )
44
  ), 'desc_tip' => true,
45
- 'description' => __ ( 'This option determines whether the customer\'s funds are captured immediately or authorized and can be captured at a later date.', 'woo-stripe' )
46
  ),
47
  'payment_sections' => array(
48
  'type' => 'multiselect',
49
- 'title' => __ ( 'Payment Sections', 'woo-stripe' ),
50
  'class' => 'wc-enhanced-select',
51
  'options' => [
52
- 'product' => __ ( 'Product Page', 'woo-stripe' ),
53
- 'cart' => __ ( 'Cart Page', 'woo-stripe' ),
54
- 'checkout_banner' => __ ( 'Top of Checkout', 'woo-stripe' )
55
  ], 'default' => [ 'product', 'cart'
56
  ],
57
- 'description' => __ ( 'Increase your conversion rate by offering Apple Pay on your Product and Cart pages, or at the top of the checkout page.', 'woo-stripe' )
58
  ),
59
  /* 'order_prefix' => array( 'type' => 'text',
60
- 'title' => __ ( 'Order Prefix', 'woo-stripe' ),
61
  'value' => '', 'default' => '',
62
  'class' => '', 'desc_tip' => true,
63
  'description' => __ ( 'The order prefix is prepended to the WooCommerce order id and will appear within Braintree as the Order ID. This setting can be helpful if you want to distinguish
64
- orders that came from this particular site, plugin, or gateway.', 'woo-stripe' )
65
  ),
66
  'order_suffix' => array( 'type' => 'text',
67
- 'title' => __ ( 'Order Suffix', 'woo-stripe' ),
68
  'value' => '', 'default' => '',
69
  'class' => '', 'desc_tip' => true,
70
  'description' => __ ( 'The order suffix is appended to the WooCommerce order id and will appear within Braintree as the Order ID. This setting can be helpful if you want to distinguish
71
- orders that came from this particular site, plugin, or gateway.', 'woo-stripe' )
72
  ), */
73
  'order_status' => array( 'type' => 'select',
74
- 'title' => __ ( 'Order Status', 'woo-stripe' ),
75
  'default' => 'default',
76
  'class' => 'wc-enhanced-select',
77
  'options' => array_merge ( array(
78
- 'default' => __ ( 'Default', 'woo-stripe' )
79
  ), wc_get_order_statuses () ),
80
  'tool_tip' => true,
81
- 'description' => __ ( 'This is the status of the order once payment is complete. If <b>Default</b> is selected, then WooCommerce will set the order status automatically based on internal logic which states if a product is virtual and downloadable then status is set to complete. Products that require shipping are set to Processing. Default is the recommended setting as it allows standard WooCommerce code to process the order status.', 'woo-stripe' )
82
  ),
83
  'button_section' => [ 'type' => 'title',
84
- 'title' => __ ( 'Button Settings', 'woo-stripe' )
85
  ],
86
  'button_type' => [ 'type' => 'select',
87
- 'title' => __ ( 'Type', 'woo-stripe' ),
88
  'options' => [
89
- 'default' => __ ( 'default', 'woo-stripe' ),
90
- // 'donate' => __ ( 'donate', 'woo-stripe' ),
91
- 'buy' => __ ( 'buy', 'woo-stripe' )
92
  ], 'default' => 'buy', 'desc_tip' => true,
93
- 'description' => __ ( 'This defines the type of button that will display.', 'woo-stripe' )
94
  ],
95
  'button_theme' => [ 'type' => 'select',
96
- 'title' => __ ( 'Theme', 'woo-stripe' ),
97
  'options' => [
98
- 'dark' => __ ( 'dark', 'woo-stripe' ),
99
- 'light' => __ ( 'light', 'woo-stripe' ),
100
- 'light-outline' => __ ( 'light-outline', 'woo-stripe' )
101
  ], 'default' => 'dark', 'desc_tip' => true,
102
- 'description' => __ ( 'This defines the color scheme for the button.', 'woo-stripe' )
103
  ],
104
  'button_height' => [ 'type' => 'text',
105
- 'title' => __ ( 'Height', 'woo-stripe' ),
106
  'default' => '40', 'desc_tip' => true,
107
- 'description' => __ ( 'The height of the button. Max height is 64', 'woo-stripe' )
108
  ]
109
  );
2
  return array(
3
  'desc' => array( 'type' => 'description',
4
  'description' => __ ( 'The PaymentRequest gateway uses your customer\'s browser to render payment options like Google Pay and Microsoft Pay. You can either use the Google Pay gateway for example, or this gateway.
5
+ The difference is this gateway uses Stripe\'s PaymentRequest Button rather than render a Google Pay specific button.', 'woo-stripe-payment' )
6
  ),
7
  'enabled' => array(
8
+ 'title' => __ ( 'Enabled', 'woo-stripe-payment' ),
9
  'type' => 'checkbox', 'default' => 'no',
10
  'value' => 'yes', 'desc_tip' => true,
11
+ 'description' => __ ( 'If enabled, your site can accept Apple Pay payments through Stripe.', 'woo-stripe-payment' )
12
  ),
13
  'general_settings' => array( 'type' => 'title',
14
+ 'title' => __ ( 'General Settings', 'woo-stripe-payment' )
15
  ),
16
  'title_text' => array( 'type' => 'text',
17
+ 'title' => __ ( 'Title', 'woo-stripe-payment' ),
18
+ 'default' => __ ( 'Browser Payments', 'woo-stripe-payment' ),
19
  'desc_tip' => true,
20
  'description' => __ ( 'Title of the credit card gateway' )
21
  ),
22
  'description' => array(
23
+ 'title' => __ ( 'Description', 'woo-stripe-payment' ),
24
  'type' => 'text', 'default' => '',
25
+ 'description' => __ ( 'Leave blank if you don\'t want a description to show for the gateway.', 'woo-stripe-payment' ),
26
  'desc_tip' => true
27
  ),
28
  'method_format' => array(
29
+ 'title' => __ ( 'Credit Card Display', 'woo-stripe-payment' ),
30
  'type' => 'select',
31
  'class' => 'wc-enhanced-select',
32
  'options' => wp_list_pluck ( $this->get_method_formats (), 'example' ),
35
  'description' => __ ( 'This option allows you to customize how the credit card will display for your customers on orders, subscriptions, etc.' )
36
  ),
37
  'charge_type' => array( 'type' => 'select',
38
+ 'title' => __ ( 'Charge Type', 'woo-stripe-payment' ),
39
  'default' => 'capture',
40
  'class' => 'wc-enhanced-select',
41
  'options' => array(
42
+ 'capture' => __ ( 'Capture', 'woo-stripe-payment' ),
43
+ 'authorize' => __ ( 'Authorize', 'woo-stripe-payment' )
44
  ), 'desc_tip' => true,
45
+ 'description' => __ ( 'This option determines whether the customer\'s funds are captured immediately or authorized and can be captured at a later date.', 'woo-stripe-payment' )
46
  ),
47
  'payment_sections' => array(
48
  'type' => 'multiselect',
49
+ 'title' => __ ( 'Payment Sections', 'woo-stripe-payment' ),
50
  'class' => 'wc-enhanced-select',
51
  'options' => [
52
+ 'product' => __ ( 'Product Page', 'woo-stripe-payment' ),
53
+ 'cart' => __ ( 'Cart Page', 'woo-stripe-payment' ),
54
+ 'checkout_banner' => __ ( 'Top of Checkout', 'woo-stripe-payment' )
55
  ], 'default' => [ 'product', 'cart'
56
  ],
57
+ 'description' => __ ( 'Increase your conversion rate by offering Apple Pay on your Product and Cart pages, or at the top of the checkout page.', 'woo-stripe-payment' )
58
  ),
59
  /* 'order_prefix' => array( 'type' => 'text',
60
+ 'title' => __ ( 'Order Prefix', 'woo-stripe-payment' ),
61
  'value' => '', 'default' => '',
62
  'class' => '', 'desc_tip' => true,
63
  'description' => __ ( 'The order prefix is prepended to the WooCommerce order id and will appear within Braintree as the Order ID. This setting can be helpful if you want to distinguish
64
+ orders that came from this particular site, plugin, or gateway.', 'woo-stripe-payment' )
65
  ),
66
  'order_suffix' => array( 'type' => 'text',
67
+ 'title' => __ ( 'Order Suffix', 'woo-stripe-payment' ),
68
  'value' => '', 'default' => '',
69
  'class' => '', 'desc_tip' => true,
70
  'description' => __ ( 'The order suffix is appended to the WooCommerce order id and will appear within Braintree as the Order ID. This setting can be helpful if you want to distinguish
71
+ orders that came from this particular site, plugin, or gateway.', 'woo-stripe-payment' )
72
  ), */
73
  'order_status' => array( 'type' => 'select',
74
+ 'title' => __ ( 'Order Status', 'woo-stripe-payment' ),
75
  'default' => 'default',
76
  'class' => 'wc-enhanced-select',
77
  'options' => array_merge ( array(
78
+ 'default' => __ ( 'Default', 'woo-stripe-payment' )
79
  ), wc_get_order_statuses () ),
80
  'tool_tip' => true,
81
+ 'description' => __ ( 'This is the status of the order once payment is complete. If <b>Default</b> is selected, then WooCommerce will set the order status automatically based on internal logic which states if a product is virtual and downloadable then status is set to complete. Products that require shipping are set to Processing. Default is the recommended setting as it allows standard WooCommerce code to process the order status.', 'woo-stripe-payment' )
82
  ),
83
  'button_section' => [ 'type' => 'title',
84
+ 'title' => __ ( 'Button Settings', 'woo-stripe-payment' )
85
  ],
86
  'button_type' => [ 'type' => 'select',
87
+ 'title' => __ ( 'Type', 'woo-stripe-payment' ),
88
  'options' => [
89
+ 'default' => __ ( 'default', 'woo-stripe-payment' ),
90
+ // 'donate' => __ ( 'donate', 'woo-stripe-payment' ),
91
+ 'buy' => __ ( 'buy', 'woo-stripe-payment' )
92
  ], 'default' => 'buy', 'desc_tip' => true,
93
+ 'description' => __ ( 'This defines the type of button that will display.', 'woo-stripe-payment' )
94
  ],
95
  'button_theme' => [ 'type' => 'select',
96
+ 'title' => __ ( 'Theme', 'woo-stripe-payment' ),
97
  'options' => [
98
+ 'dark' => __ ( 'dark', 'woo-stripe-payment' ),
99
+ 'light' => __ ( 'light', 'woo-stripe-payment' ),
100
+ 'light-outline' => __ ( 'light-outline', 'woo-stripe-payment' )
101
  ], 'default' => 'dark', 'desc_tip' => true,
102
+ 'description' => __ ( 'This defines the color scheme for the button.', 'woo-stripe-payment' )
103
  ],
104
  'button_height' => [ 'type' => 'text',
105
+ 'title' => __ ( 'Height', 'woo-stripe-payment' ),
106
  'default' => '40', 'desc_tip' => true,
107
+ 'description' => __ ( 'The height of the button. Max height is 64', 'woo-stripe-payment' )
108
  ]
109
  );
includes/tokens/class-wc-payment-token-stripe-cc.php CHANGED
@@ -87,37 +87,37 @@ class WC_Payment_Token_Stripe_CC extends WC_Payment_Token_Stripe {
87
  public function get_formats() {
88
  return array(
89
  'type_ending_in' => array(
90
- 'label' => __ ( 'Type Ending In', 'woo-stripe' ),
91
  'example' => 'Visa ending in 1111',
92
- 'format' => __ ( '{brand} ending in {last4}', 'woo-stripe' )
93
  ),
94
  'type_masked_number' => array(
95
- 'label' => __ ( 'Type Masked Number', 'woo-stripe' ),
96
  'example' => 'Visa ********1111',
97
  'format' => '{brand} {masked_number}'
98
  ),
99
  'type_dash_masked_number' => array(
100
- 'label' => __ ( 'Type Dash Masked Number', 'woo-stripe' ),
101
  'example' => 'Visa - ********1111',
102
  'format' => '{brand} - {masked_number}'
103
  ),
104
  'type_last4' => array(
105
- 'label' => __ ( 'Type Last 4', 'woo-stripe' ),
106
  'example' => 'Visa 1111',
107
  'format' => '{brand} {last4}'
108
  ),
109
  'type_dash_last4' => array(
110
- 'label' => __ ( 'Type Dash & Last 4', 'woo-stripe' ),
111
  'example' => 'Visa - 1111',
112
  'format' => '{brand} - {last4}'
113
  ),
114
  'last4' => array(
115
- 'label' => __ ( 'Last Four', 'woo-stripe' ),
116
  'example' => '1111',
117
  'format' => '{last4}'
118
  ),
119
  'card_type' => array(
120
- 'label' => __ ( 'Card Type', 'woo-stripe' ),
121
  'example' => 'Visa',
122
  'format' => '{brand}'
123
  )
87
  public function get_formats() {
88
  return array(
89
  'type_ending_in' => array(
90
+ 'label' => __ ( 'Type Ending In', 'woo-stripe-payment' ),
91
  'example' => 'Visa ending in 1111',
92
+ 'format' => __ ( '{brand} ending in {last4}', 'woo-stripe-payment' )
93
  ),
94
  'type_masked_number' => array(
95
+ 'label' => __ ( 'Type Masked Number', 'woo-stripe-payment' ),
96
  'example' => 'Visa ********1111',
97
  'format' => '{brand} {masked_number}'
98
  ),
99
  'type_dash_masked_number' => array(
100
+ 'label' => __ ( 'Type Dash Masked Number', 'woo-stripe-payment' ),
101
  'example' => 'Visa - ********1111',
102
  'format' => '{brand} - {masked_number}'
103
  ),
104
  'type_last4' => array(
105
+ 'label' => __ ( 'Type Last 4', 'woo-stripe-payment' ),
106
  'example' => 'Visa 1111',
107
  'format' => '{brand} {last4}'
108
  ),
109
  'type_dash_last4' => array(
110
+ 'label' => __ ( 'Type Dash & Last 4', 'woo-stripe-payment' ),
111
  'example' => 'Visa - 1111',
112
  'format' => '{brand} - {last4}'
113
  ),
114
  'last4' => array(
115
+ 'label' => __ ( 'Last Four', 'woo-stripe-payment' ),
116
  'example' => '1111',
117
  'format' => '{last4}'
118
  ),
119
  'card_type' => array(
120
+ 'label' => __ ( 'Card Type', 'woo-stripe-payment' ),
121
  'example' => 'Visa',
122
  'format' => '{brand}'
123
  )
includes/tokens/class-wc-payment-token-stripe-local-payment.php CHANGED
@@ -25,7 +25,7 @@ class WC_Payment_Token_Stripe_Local extends WC_Payment_Token_Stripe {
25
  public function get_formats() {
26
  return [
27
  'gateway_title' => [
28
- 'label' => __ ( 'Gateway Title', 'woo-stripe' ),
29
  'example' => 'P24',
30
  'format' => '{gateway_title}'
31
  ]
25
  public function get_formats() {
26
  return [
27
  'gateway_title' => [
28
+ 'label' => __ ( 'Gateway Title', 'woo-stripe-payment' ),
29
  'example' => 'P24',
30
  'format' => '{gateway_title}'
31
  ]
includes/wc-stripe-functions.php CHANGED
@@ -341,21 +341,21 @@ function wc_stripe_get_display_items($encode = false, $order = null) {
341
  }
342
  if (WC ()->cart->needs_shipping ()) {
343
  $items[] = [
344
- 'label' => __ ( 'Shipping', 'woo-stripe' ),
345
  'pending' => false,
346
  'amount' => wc_stripe_add_number_precision ( WC ()->cart->shipping_total )
347
  ];
348
  }
349
  if (wc_tax_enabled ()) {
350
  $items[] = [
351
- 'label' => __ ( 'Tax', 'woo-stripe' ),
352
  'pending' => false,
353
  'amount' => wc_stripe_add_number_precision ( WC ()->cart->get_taxes_total () )
354
  ];
355
  }
356
  } else {
357
  $items[] = [
358
- 'label' => __ ( 'Subscription', 'woo-stripe' ),
359
  'pending' => false,
360
  'amount' => wc_stripe_add_number_precision ( $order->get_total () )
361
  ];
@@ -406,8 +406,8 @@ function wc_stripe_get_shipping_options($encode = false, $order = null) {
406
  if (empty ( $methods )) {
407
  // GPay does not like empty shipping methods. Make a temporary one;
408
  $methods[] = [ 'id' => 'default',
409
- 'label' => __ ( 'Waiting...', 'woo-stripe' ),
410
- 'detail' => __ ( 'loading shipping methods...', 'woo-stripe' ),
411
  'amount' => 0
412
  ];
413
  }
@@ -628,7 +628,7 @@ function wc_stripe_get_custom_forms() {
628
  return apply_filters ( 'wc_stripe_get_custom_forms', [
629
  'simple' => [
630
  'template' => 'cc-forms/simple.php',
631
- 'label' => __ ( 'Simple form', 'woo-stripe' ),
632
  'cardBrand' => wc_stripe ()->assets_url ( 'img/card_brand2.svg' ),
633
  'elementStyles' => [
634
  'base' => [
@@ -661,7 +661,7 @@ function wc_stripe_get_custom_forms() {
661
  ],
662
  'inline' => [
663
  'template' => 'cc-forms/inline.php',
664
- 'label' => __ ( 'Inline Form', 'woo-stripe' ),
665
  'cardBrand' => wc_stripe ()->assets_url ( 'img/card_brand.svg' ),
666
  'elementStyles' => [
667
  'base' => [
@@ -697,7 +697,7 @@ function wc_stripe_get_custom_forms() {
697
  ],
698
  'rounded' => [
699
  'template' => 'cc-forms/round.php',
700
- 'label' => __ ( 'Rounded Form', 'woo-stripe' ),
701
  'cardBrand' => wc_stripe ()->assets_url ( 'img/card_brand.svg' ),
702
  'elementStyles' => [
703
  'base' => [
@@ -768,4 +768,13 @@ function wc_stripe_display_prices_including_tax() {
768
  $customer_exempt = $customer && $customer->get_is_vat_exempt ();
769
  'incl' === $cart->tax_display_cart && ! $customer_exempt;
770
  }
 
 
 
 
 
 
 
 
 
771
  }
341
  }
342
  if (WC ()->cart->needs_shipping ()) {
343
  $items[] = [
344
+ 'label' => __ ( 'Shipping', 'woo-stripe-payment' ),
345
  'pending' => false,
346
  'amount' => wc_stripe_add_number_precision ( WC ()->cart->shipping_total )
347
  ];
348
  }
349
  if (wc_tax_enabled ()) {
350
  $items[] = [
351
+ 'label' => __ ( 'Tax', 'woo-stripe-payment' ),
352
  'pending' => false,
353
  'amount' => wc_stripe_add_number_precision ( WC ()->cart->get_taxes_total () )
354
  ];
355
  }
356
  } else {
357
  $items[] = [
358
+ 'label' => __ ( 'Subscription', 'woo-stripe-payment' ),
359
  'pending' => false,
360
  'amount' => wc_stripe_add_number_precision ( $order->get_total () )
361
  ];
406
  if (empty ( $methods )) {
407
  // GPay does not like empty shipping methods. Make a temporary one;
408
  $methods[] = [ 'id' => 'default',
409
+ 'label' => __ ( 'Waiting...', 'woo-stripe-payment' ),
410
+ 'detail' => __ ( 'loading shipping methods...', 'woo-stripe-payment' ),
411
  'amount' => 0
412
  ];
413
  }
628
  return apply_filters ( 'wc_stripe_get_custom_forms', [
629
  'simple' => [
630
  'template' => 'cc-forms/simple.php',
631
+ 'label' => __ ( 'Simple form', 'woo-stripe-payment' ),
632
  'cardBrand' => wc_stripe ()->assets_url ( 'img/card_brand2.svg' ),
633
  'elementStyles' => [
634
  'base' => [
661
  ],
662
  'inline' => [
663
  'template' => 'cc-forms/inline.php',
664
+ 'label' => __ ( 'Inline Form', 'woo-stripe-payment' ),
665
  'cardBrand' => wc_stripe ()->assets_url ( 'img/card_brand.svg' ),
666
  'elementStyles' => [
667
  'base' => [
697
  ],
698
  'rounded' => [
699
  'template' => 'cc-forms/round.php',
700
+ 'label' => __ ( 'Rounded Form', 'woo-stripe-payment' ),
701
  'cardBrand' => wc_stripe ()->assets_url ( 'img/card_brand.svg' ),
702
  'elementStyles' => [
703
  'base' => [
768
  $customer_exempt = $customer && $customer->get_is_vat_exempt ();
769
  'incl' === $cart->tax_display_cart && ! $customer_exempt;
770
  }
771
+ }
772
+
773
+ /**
774
+ * Return true if the WC pre-orders plugin is active
775
+ * @since 3.0.1
776
+ * @package Stripe/Functions
777
+ */
778
+ function wc_stripe_pre_orders_active(){
779
+ return class_exists('WC_Pre_Orders');
780
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: stripe, credit cards, apple pay, google pay, ideal, sepa, sofort
4
  Requires at least: 3.0.1
5
  Tested up to: 5.2.2
6
  Requires PHP: 5.4
7
- Stable tag: 3.0.0
8
  Copyright: Payment Plugins
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -49,7 +49,13 @@ If you're site is not loading over https, then Stripe won't render the Payment R
49
  5. Configuration pages
50
 
51
  == Changelog ==
52
- 3.0.0 - First commit
 
 
 
 
 
 
53
 
54
  == Upgrade Notice ==
55
  = 3.0.0 =
4
  Requires at least: 3.0.1
5
  Tested up to: 5.2.2
6
  Requires PHP: 5.4
7
+ Stable tag: 3.0.1
8
  Copyright: Payment Plugins
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
49
  5. Configuration pages
50
 
51
  == Changelog ==
52
+ = 3.0.1 =
53
+ * Updated - Google Pay paymentDataCallbacks in JavaScript
54
+ * Updated - Text domain to match plugin slug
55
+ * Added - Dynamic price option for Google Pay
56
+ * Added - Pre-orders support
57
+ = 3.0.0 =
58
+ * First commit
59
 
60
  == Upgrade Notice ==
61
  = 3.0.0 =
stripe-payments.php CHANGED
@@ -4,16 +4,16 @@
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 using Stripe.
7
- * Version: 3.0.0
8
  * Author: Payment Plugins, support@paymentplugins.com
9
- * Text Domain: woo-stripe
10
  * Domain Path: /i18n/languages/
11
  * Tested up to: 5.2
12
  * WC requires at least: 3.0.0
13
- * WC tested up to: 3.7.0
14
  */
15
  function wc_stripe_php_version_notice() {
16
- $message = sprintf ( __ ( 'Your PHP version is %s but Stripe requires version 5.4+.', 'woo-stripe' ), PHP_VERSION );
17
  echo '<div class="notice notice-error"><p style="font-size: 16px">' . $message . '</p></div>';
18
  }
19
 
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 using Stripe.
7
+ * Version: 3.0.1
8
  * Author: Payment Plugins, support@paymentplugins.com
9
+ * Text Domain: woo-stripe-payment
10
  * Domain Path: /i18n/languages/
11
  * Tested up to: 5.2
12
  * WC requires at least: 3.0.0
13
+ * WC tested up to: 3.7.1
14
  */
15
  function wc_stripe_php_version_notice() {
16
+ $message = sprintf ( __ ( 'Your PHP version is %s but Stripe requires version 5.4+.', 'woo-stripe-payment' ), PHP_VERSION );
17
  echo '<div class="notice notice-error"><p style="font-size: 16px">' . $message . '</p></div>';
18
  }
19
 
templates/cart/payment-methods.php CHANGED
@@ -17,7 +17,7 @@
17
  <?php endforeach;?>
18
  <li class="wc-stripe-payment-method or">
19
  <p class="wc-stripe-cart-or">
20
- &mdash;&nbsp;<?php _e('or', 'woo-stripe')?>&mdash;&nbsp;
21
  </p>
22
  </li>
23
  </ul>
17
  <?php endforeach;?>
18
  <li class="wc-stripe-payment-method or">
19
  <p class="wc-stripe-cart-or">
20
+ &mdash;&nbsp;<?php _e('or', 'woo-stripe-payment')?>&mdash;&nbsp;
21
  </p>
22
  </li>
23
  </ul>
templates/cc-forms/inline.php CHANGED
@@ -7,20 +7,20 @@
7
  <div class="wc-stripe-inline-form">
8
  <fieldset>
9
  <div class="row">
10
- <label for="stripe-card-number"><?php _e('Card Number', 'woo-stripe')?></label>
11
  <div id="stripe-card-number" class="input"></div>
12
  </div>
13
  <div class="row">
14
- <label for="stripe-exp"><?php _e('Exp Date', 'woo-stripe')?></label>
15
  <div id="stripe-exp" class="input"></div>
16
  </div>
17
  <div class="row">
18
- <label for="stripe-cvv"><?php _e('CVC', 'woo-stripe')?></label>
19
  <div id="stripe-cvv" class="input"></div>
20
  </div>
21
  <?php if($gateway->postal_enabled()):?>
22
  <div class="row">
23
- <label for="stripe-postal-code"><?php _e('ZIP', 'woo-stripe')?></label>
24
  <input type="text" id="stripe-postal-code" class="input empty" placeholder="78703" value="<?php echo WC ()->checkout ()->get_value('billing_postcode')?>"/>
25
  </div>
26
  <?php endif;?>
7
  <div class="wc-stripe-inline-form">
8
  <fieldset>
9
  <div class="row">
10
+ <label for="stripe-card-number"><?php _e('Card Number', 'woo-stripe-payment')?></label>
11
  <div id="stripe-card-number" class="input"></div>
12
  </div>
13
  <div class="row">
14
+ <label for="stripe-exp"><?php _e('Exp Date', 'woo-stripe-payment')?></label>
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()):?>
22
  <div class="row">
23
+ <label for="stripe-postal-code"><?php _e('ZIP', 'woo-stripe-payment')?></label>
24
  <input type="text" id="stripe-postal-code" class="input empty" placeholder="78703" value="<?php echo WC ()->checkout ()->get_value('billing_postcode')?>"/>
25
  </div>
26
  <?php endif;?>
templates/cc-forms/simple.php CHANGED
@@ -9,7 +9,7 @@
9
  <div class="field">
10
  <div id="stripe-card-number" class="input empty"></div>
11
  <label for="stripe-card-number"
12
- data-tid=""><?php _e('Card Number', 'woo-stripe')?></label>
13
  <div class="baseline"></div>
14
  </div>
15
  </div>
@@ -17,13 +17,13 @@
17
  <div class="field half-width">
18
  <div id="stripe-exp" class="input empty"></div>
19
  <label for="stripe-exp"
20
- data-tid=""><?php _e('Expiration', 'woo-stripe')?></label>
21
  <div class="baseline"></div>
22
  </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('CVC', 'woo-stripe')?></label>
27
  <div class="baseline"></div>
28
  </div>
29
  </div>
@@ -31,7 +31,7 @@
31
  <div class="row">
32
  <div class="field postalCode" tabindex="-1">
33
  <input type="text" id="stripe-postal-code" class="input empty" value="<?php echo WC ()->checkout ()->get_value('billing_postcode')?>"/>
34
- <label><?php _e('ZIP', 'woo-stripe')?></label>
35
  <div class="baseline"></div>
36
  </div>
37
  </div>
9
  <div class="field">
10
  <div id="stripe-card-number" class="input empty"></div>
11
  <label for="stripe-card-number"
12
+ data-tid=""><?php _e('Card Number', 'woo-stripe-payment')?></label>
13
  <div class="baseline"></div>
14
  </div>
15
  </div>
17
  <div class="field half-width">
18
  <div id="stripe-exp" class="input empty"></div>
19
  <label for="stripe-exp"
20
+ data-tid=""><?php _e('Expiration', 'woo-stripe-payment')?></label>
21
  <div class="baseline"></div>
22
  </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('CVC', 'woo-stripe-payment')?></label>
27
  <div class="baseline"></div>
28
  </div>
29
  </div>
31
  <div class="row">
32
  <div class="field postalCode" tabindex="-1">
33
  <input type="text" id="stripe-postal-code" class="input empty" value="<?php echo WC ()->checkout ()->get_value('billing_postcode')?>"/>
34
+ <label><?php _e('ZIP', 'woo-stripe-payment')?></label>
35
  <div class="baseline"></div>
36
  </div>
37
  </div>
templates/checkout/credit-card.php CHANGED
@@ -14,7 +14,7 @@
14
  <?php endif;?>
15
  <?php if($gateway->show_save_source()):?>
16
  <div class="wc-stripe-save-source">
17
- <label class="save-source-label"><?php _e('Save Card', 'woo-stripe')?></label>
18
  <label class="checkbox"> <input type="checkbox"
19
  id="<?php echo $gateway->save_source_key?>"
20
  name="<?php echo $gateway->save_source_key?>" value="yes" /> <span
14
  <?php endif;?>
15
  <?php if($gateway->show_save_source()):?>
16
  <div class="wc-stripe-save-source">
17
+ <label class="save-source-label"><?php _e('Save Card', 'woo-stripe-payment')?></label>
18
  <label class="checkbox"> <input type="checkbox"
19
  id="<?php echo $gateway->save_source_key?>"
20
  name="<?php echo $gateway->save_source_key?>" value="yes" /> <span