WooCommerce Stripe Payment Gateway - Version 4.0.7

Version Description

  • 2018-02-23 =
  • Fix - Potential conflict issue when adding payment method from another payment gateway.
  • Fix - Issue when using saved card before sources were introduced.
  • Add - Description field/setting for Stripe Checkout Modal/popup.

See changelog for all versions.

=

Download this release

Release Info

Developer royho
Plugin Icon 128x128 WooCommerce Stripe Payment Gateway
Version 4.0.7
Comparing to
See all releases

Code changes from version 4.0.6 to 4.0.7

assets/js/stripe-admin.js CHANGED
@@ -45,11 +45,11 @@ jQuery( function( $ ) {
45
  // Toggle Stripe Checkout settings.
46
  $( '#woocommerce_stripe_stripe_checkout' ).change( function() {
47
  if ( $( this ).is( ':checked' ) ) {
48
- $( '#woocommerce_stripe_stripe_bitcoin, #woocommerce_stripe_stripe_checkout_image' ).closest( 'tr' ).show();
49
  } else {
50
- $( '#woocommerce_stripe_stripe_bitcoin, #woocommerce_stripe_stripe_checkout_image' ).closest( 'tr' ).hide();
51
  }
52
- }).change();
53
 
54
  // Toggle Payment Request buttons settings.
55
  $( '#woocommerce_stripe_payment_request' ).change( function() {
@@ -58,9 +58,9 @@ jQuery( function( $ ) {
58
  } else {
59
  $( '#woocommerce_stripe_payment_request_button_theme, #woocommerce_stripe_payment_request_button_type, #woocommerce_stripe_payment_request_button_height' ).closest( 'tr' ).hide();
60
  }
61
- }).change();
62
  }
63
  };
64
 
65
  wc_stripe_admin.init();
66
- });
45
  // Toggle Stripe Checkout settings.
46
  $( '#woocommerce_stripe_stripe_checkout' ).change( function() {
47
  if ( $( this ).is( ':checked' ) ) {
48
+ $( '#woocommerce_stripe_stripe_bitcoin, #woocommerce_stripe_stripe_checkout_image, #woocommerce_stripe_stripe_checkout_description' ).closest( 'tr' ).show();
49
  } else {
50
+ $( '#woocommerce_stripe_stripe_bitcoin, #woocommerce_stripe_stripe_checkout_image, #woocommerce_stripe_stripe_checkout_description' ).closest( 'tr' ).hide();
51
  }
52
+ } ).change();
53
 
54
  // Toggle Payment Request buttons settings.
55
  $( '#woocommerce_stripe_payment_request' ).change( function() {
58
  } else {
59
  $( '#woocommerce_stripe_payment_request_button_theme, #woocommerce_stripe_payment_request_button_type, #woocommerce_stripe_payment_request_button_height' ).closest( 'tr' ).hide();
60
  }
61
+ } ).change();
62
  }
63
  };
64
 
65
  wc_stripe_admin.init();
66
+ } );
assets/js/stripe-admin.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(function(e){"use strict";var t={isTestMode:function(){return e("#woocommerce_stripe_testmode").is(":checked")},getSecretKey:function(){return t.isTestMode()?e("#woocommerce_stripe_test_secret_key").val():e("#woocommerce_stripe_secret_key").val()},init:function(){e(document.body).on("change","#woocommerce_stripe_testmode",function(){var t=e("#woocommerce_stripe_test_secret_key").parents("tr").eq(0),o=e("#woocommerce_stripe_test_publishable_key").parents("tr").eq(0),c=e("#woocommerce_stripe_secret_key").parents("tr").eq(0),r=e("#woocommerce_stripe_publishable_key").parents("tr").eq(0);e(this).is(":checked")?(t.show(),o.show(),c.hide(),r.hide()):(t.hide(),o.hide(),c.show(),r.show())}),e("#woocommerce_stripe_testmode").change(),e("#woocommerce_stripe_stripe_checkout").change(function(){e(this).is(":checked")?e("#woocommerce_stripe_stripe_bitcoin, #woocommerce_stripe_stripe_checkout_image").closest("tr").show():e("#woocommerce_stripe_stripe_bitcoin, #woocommerce_stripe_stripe_checkout_image").closest("tr").hide()}).change(),e("#woocommerce_stripe_payment_request").change(function(){e(this).is(":checked")?e("#woocommerce_stripe_payment_request_button_theme, #woocommerce_stripe_payment_request_button_type, #woocommerce_stripe_payment_request_button_height").closest("tr").show():e("#woocommerce_stripe_payment_request_button_theme, #woocommerce_stripe_payment_request_button_type, #woocommerce_stripe_payment_request_button_height").closest("tr").hide()}).change()}};t.init()});
1
+ jQuery(function(e){"use strict";var t={isTestMode:function(){return e("#woocommerce_stripe_testmode").is(":checked")},getSecretKey:function(){return t.isTestMode()?e("#woocommerce_stripe_test_secret_key").val():e("#woocommerce_stripe_secret_key").val()},init:function(){e(document.body).on("change","#woocommerce_stripe_testmode",function(){var t=e("#woocommerce_stripe_test_secret_key").parents("tr").eq(0),o=e("#woocommerce_stripe_test_publishable_key").parents("tr").eq(0),c=e("#woocommerce_stripe_secret_key").parents("tr").eq(0),r=e("#woocommerce_stripe_publishable_key").parents("tr").eq(0);e(this).is(":checked")?(t.show(),o.show(),c.hide(),r.hide()):(t.hide(),o.hide(),c.show(),r.show())}),e("#woocommerce_stripe_testmode").change(),e("#woocommerce_stripe_stripe_checkout").change(function(){e(this).is(":checked")?e("#woocommerce_stripe_stripe_bitcoin, #woocommerce_stripe_stripe_checkout_image, #woocommerce_stripe_stripe_checkout_description").closest("tr").show():e("#woocommerce_stripe_stripe_bitcoin, #woocommerce_stripe_stripe_checkout_image, #woocommerce_stripe_stripe_checkout_description").closest("tr").hide()}).change(),e("#woocommerce_stripe_payment_request").change(function(){e(this).is(":checked")?e("#woocommerce_stripe_payment_request_button_theme, #woocommerce_stripe_payment_request_button_type, #woocommerce_stripe_payment_request_button_height").closest("tr").show():e("#woocommerce_stripe_payment_request_button_theme, #woocommerce_stripe_payment_request_button_type, #woocommerce_stripe_payment_request_button_height").closest("tr").hide()}).change()}};t.init()});
assets/js/stripe-payment-request.js CHANGED
@@ -21,21 +21,19 @@ jQuery( function( $ ) {
21
  .replace( '%%endpoint%%', 'wc_stripe_' + endpoint );
22
  },
23
 
24
- getCartDetails: function( paymentRequest ) {
25
  var data = {
26
  security: wc_stripe_payment_request_params.nonce.payment
27
  };
28
 
29
- $.ajax({
30
  type: 'POST',
31
  data: data,
32
  url: wc_stripe_payment_request.getAjaxURL( 'get_cart_details' ),
33
  success: function( response ) {
34
- paymentRequest.update({
35
- total: response.order_data.total
36
- });
37
  }
38
- });
39
  },
40
 
41
  getAttributes: function() {
@@ -66,12 +64,12 @@ jQuery( function( $ ) {
66
  processSource: function( source, paymentRequestType ) {
67
  var data = wc_stripe_payment_request.getOrderData( source, paymentRequestType );
68
 
69
- return $.ajax({
70
  type: 'POST',
71
  data: data,
72
  dataType: 'json',
73
  url: wc_stripe_payment_request.getAjaxURL( 'create_order' )
74
- });
75
  },
76
 
77
  /**
@@ -198,13 +196,13 @@ jQuery( function( $ ) {
198
  },
199
 
200
  block: function() {
201
- $.blockUI({
202
  message: null,
203
  overlayCSS: {
204
  background: '#fff',
205
  opacity: 0.6
206
  }
207
- });
208
  },
209
 
210
  /**
@@ -225,11 +223,11 @@ jQuery( function( $ ) {
225
  payment_request_type: paymentRequestType
226
  };
227
 
228
- return $.ajax({
229
  type: 'POST',
230
  data: data,
231
  url: wc_stripe_payment_request.getAjaxURL( 'get_shipping_options' )
232
- });
233
  },
234
 
235
  /**
@@ -245,11 +243,11 @@ jQuery( function( $ ) {
245
  payment_request_type: paymentRequestType
246
  };
247
 
248
- return $.ajax({
249
  type: 'POST',
250
  data: data,
251
  url: wc_stripe_payment_request.getAjaxURL( 'update_shipping_method' )
252
- });
253
  },
254
 
255
  /**
@@ -271,11 +269,11 @@ jQuery( function( $ ) {
271
  attributes: $( '.variations_form' ).length ? wc_stripe_payment_request.getAttributes().data : []
272
  };
273
 
274
- return $.ajax({
275
  type: 'POST',
276
  data: data,
277
  url: wc_stripe_payment_request.getAjaxURL( 'add_to_cart' )
278
- });
279
  },
280
 
281
  clearCart: function() {
@@ -283,12 +281,12 @@ jQuery( function( $ ) {
283
  'security': wc_stripe_payment_request_params.nonce.clear_cart
284
  };
285
 
286
- return $.ajax({
287
  type: 'POST',
288
  data: data,
289
  url: wc_stripe_payment_request.getAjaxURL( 'clear_cart' ),
290
  success: function( response ) {}
291
- });
292
  },
293
 
294
  getRequestOptionsFromLocal: function() {
@@ -335,7 +333,7 @@ jQuery( function( $ ) {
335
 
336
  var paymentRequest = stripe.paymentRequest( options );
337
 
338
- var elements = stripe.elements({ locale: wc_stripe_payment_request_params.button.locale });
339
  var prButton = elements.create( 'paymentRequestButton', {
340
  paymentRequest: paymentRequest,
341
  style: {
@@ -345,7 +343,7 @@ jQuery( function( $ ) {
345
  height: wc_stripe_payment_request_params.button.height + 'px'
346
  },
347
  }
348
- });
349
 
350
  // Check the availability of the Payment Request API first.
351
  paymentRequest.canMakePayment().then( function( result ) {
@@ -367,33 +365,33 @@ jQuery( function( $ ) {
367
  } else {
368
  wc_stripe_payment_request.addToCart();
369
  }
370
- });
371
 
372
  $( document.body ).on( 'woocommerce_variation_has_changed', function() {
373
- $( '#wc-stripe-payment-request-button' ).block({ message: null });
374
 
375
  $.when( wc_stripe_payment_request.getSelectedProductData() ).then( function( response ) {
376
- $.when( paymentRequest.update({
377
  total: response.total,
378
  displayItems: response.displayItems
379
- }) ).then( function() {
380
  $( '#wc-stripe-payment-request-button' ).unblock();
381
- });
382
- });
383
- });
384
 
385
  $( '.quantity' ).on( 'change', '.qty', function() {
386
- $( '#wc-stripe-payment-request-button' ).block({ message: null });
387
 
388
  $.when( wc_stripe_payment_request.getSelectedProductData() ).then( function( response ) {
389
- $.when( paymentRequest.update({
390
  total: response.total,
391
  displayItems: response.displayItems
392
- }) ).then( function() {
393
  $( '#wc-stripe-payment-request-button' ).unblock();
394
- });
395
- });
396
- });
397
  }
398
 
399
  if ( $( '#wc-stripe-payment-request-button' ).length ) {
@@ -404,14 +402,14 @@ jQuery( function( $ ) {
404
  $( '#wc-stripe-payment-request-button' ).hide();
405
  $( '#wc-stripe-payment-request-button-separator' ).hide();
406
  }
407
- });
408
 
409
  // Possible statuses success, fail, invalid_payer_name, invalid_payer_email, invalid_payer_phone, invalid_shipping_address.
410
  paymentRequest.on( 'shippingaddresschange', function( evt ) {
411
  $.when( wc_stripe_payment_request.updateShippingOptions( paymentDetails, evt.shippingAddress ) ).then( function( response ) {
412
  evt.updateWith( { status: response.result, shippingOptions: response.shipping_options, total: response.total, displayItems: response.displayItems } );
413
- });
414
- });
415
 
416
  paymentRequest.on( 'shippingoptionchange', function( evt ) {
417
  $.when( wc_stripe_payment_request.updateShippingDetails( paymentDetails, evt.shippingOption ) ).then( function( response ) {
@@ -422,8 +420,8 @@ jQuery( function( $ ) {
422
  if ( 'fail' === response.result ) {
423
  evt.updateWith( { status: 'fail' } );
424
  }
425
- });
426
- });
427
 
428
  paymentRequest.on( 'source', function( evt ) {
429
  // Check if we allow prepaid cards.
@@ -436,9 +434,9 @@ jQuery( function( $ ) {
436
  } else {
437
  wc_stripe_payment_request.abortPayment( evt, response.messages );
438
  }
439
- });
440
  }
441
- });
442
  },
443
 
444
  getSelectedProductData: function() {
@@ -456,11 +454,11 @@ jQuery( function( $ ) {
456
  attributes: $( '.variations_form' ).length ? wc_stripe_payment_request.getAttributes().data : []
457
  };
458
 
459
- return $.ajax({
460
  type: 'POST',
461
  data: data,
462
  url: wc_stripe_payment_request.getAjaxURL( 'get_selected_product_data' )
463
- });
464
  },
465
 
466
  /**
@@ -470,18 +468,12 @@ jQuery( function( $ ) {
470
  * @version 4.0.0
471
  */
472
  init: function() {
473
- var data = {
474
- security: wc_stripe_payment_request_params.nonce.payment
475
- };
 
 
476
 
477
- $.ajax({
478
- type: 'POST',
479
- data: data,
480
- url: wc_stripe_payment_request.getAjaxURL( 'get_cart_details' ),
481
- success: function( response ) {
482
- wc_stripe_payment_request.startPaymentRequest( response );
483
- }
484
- });
485
  },
486
  };
487
 
@@ -490,10 +482,10 @@ jQuery( function( $ ) {
490
  // We need to refresh payment request data when total is updated.
491
  $( document.body ).on( 'updated_cart_totals', function() {
492
  wc_stripe_payment_request.init();
493
- });
494
 
495
  // We need to refresh payment request data when total is updated.
496
  $( document.body ).on( 'updated_checkout', function() {
497
  wc_stripe_payment_request.init();
498
- });
499
- });
21
  .replace( '%%endpoint%%', 'wc_stripe_' + endpoint );
22
  },
23
 
24
+ getCartDetails: function() {
25
  var data = {
26
  security: wc_stripe_payment_request_params.nonce.payment
27
  };
28
 
29
+ $.ajax( {
30
  type: 'POST',
31
  data: data,
32
  url: wc_stripe_payment_request.getAjaxURL( 'get_cart_details' ),
33
  success: function( response ) {
34
+ wc_stripe_payment_request.startPaymentRequest( response );
 
 
35
  }
36
+ } );
37
  },
38
 
39
  getAttributes: function() {
64
  processSource: function( source, paymentRequestType ) {
65
  var data = wc_stripe_payment_request.getOrderData( source, paymentRequestType );
66
 
67
+ return $.ajax( {
68
  type: 'POST',
69
  data: data,
70
  dataType: 'json',
71
  url: wc_stripe_payment_request.getAjaxURL( 'create_order' )
72
+ } );
73
  },
74
 
75
  /**
196
  },
197
 
198
  block: function() {
199
+ $.blockUI( {
200
  message: null,
201
  overlayCSS: {
202
  background: '#fff',
203
  opacity: 0.6
204
  }
205
+ } );
206
  },
207
 
208
  /**
223
  payment_request_type: paymentRequestType
224
  };
225
 
226
+ return $.ajax( {
227
  type: 'POST',
228
  data: data,
229
  url: wc_stripe_payment_request.getAjaxURL( 'get_shipping_options' )
230
+ } );
231
  },
232
 
233
  /**
243
  payment_request_type: paymentRequestType
244
  };
245
 
246
+ return $.ajax( {
247
  type: 'POST',
248
  data: data,
249
  url: wc_stripe_payment_request.getAjaxURL( 'update_shipping_method' )
250
+ } );
251
  },
252
 
253
  /**
269
  attributes: $( '.variations_form' ).length ? wc_stripe_payment_request.getAttributes().data : []
270
  };
271
 
272
+ return $.ajax( {
273
  type: 'POST',
274
  data: data,
275
  url: wc_stripe_payment_request.getAjaxURL( 'add_to_cart' )
276
+ } );
277
  },
278
 
279
  clearCart: function() {
281
  'security': wc_stripe_payment_request_params.nonce.clear_cart
282
  };
283
 
284
+ return $.ajax( {
285
  type: 'POST',
286
  data: data,
287
  url: wc_stripe_payment_request.getAjaxURL( 'clear_cart' ),
288
  success: function( response ) {}
289
+ } );
290
  },
291
 
292
  getRequestOptionsFromLocal: function() {
333
 
334
  var paymentRequest = stripe.paymentRequest( options );
335
 
336
+ var elements = stripe.elements( { locale: wc_stripe_payment_request_params.button.locale } );
337
  var prButton = elements.create( 'paymentRequestButton', {
338
  paymentRequest: paymentRequest,
339
  style: {
343
  height: wc_stripe_payment_request_params.button.height + 'px'
344
  },
345
  }
346
+ } );
347
 
348
  // Check the availability of the Payment Request API first.
349
  paymentRequest.canMakePayment().then( function( result ) {
365
  } else {
366
  wc_stripe_payment_request.addToCart();
367
  }
368
+ } );
369
 
370
  $( document.body ).on( 'woocommerce_variation_has_changed', function() {
371
+ $( '#wc-stripe-payment-request-button' ).block( { message: null } );
372
 
373
  $.when( wc_stripe_payment_request.getSelectedProductData() ).then( function( response ) {
374
+ $.when( paymentRequest.update( {
375
  total: response.total,
376
  displayItems: response.displayItems
377
+ } ) ).then( function() {
378
  $( '#wc-stripe-payment-request-button' ).unblock();
379
+ } );
380
+ } );
381
+ } );
382
 
383
  $( '.quantity' ).on( 'change', '.qty', function() {
384
+ $( '#wc-stripe-payment-request-button' ).block( { message: null } );
385
 
386
  $.when( wc_stripe_payment_request.getSelectedProductData() ).then( function( response ) {
387
+ $.when( paymentRequest.update( {
388
  total: response.total,
389
  displayItems: response.displayItems
390
+ } ) ).then( function() {
391
  $( '#wc-stripe-payment-request-button' ).unblock();
392
+ } );
393
+ } );
394
+ } );
395
  }
396
 
397
  if ( $( '#wc-stripe-payment-request-button' ).length ) {
402
  $( '#wc-stripe-payment-request-button' ).hide();
403
  $( '#wc-stripe-payment-request-button-separator' ).hide();
404
  }
405
+ } );
406
 
407
  // Possible statuses success, fail, invalid_payer_name, invalid_payer_email, invalid_payer_phone, invalid_shipping_address.
408
  paymentRequest.on( 'shippingaddresschange', function( evt ) {
409
  $.when( wc_stripe_payment_request.updateShippingOptions( paymentDetails, evt.shippingAddress ) ).then( function( response ) {
410
  evt.updateWith( { status: response.result, shippingOptions: response.shipping_options, total: response.total, displayItems: response.displayItems } );
411
+ } );
412
+ } );
413
 
414
  paymentRequest.on( 'shippingoptionchange', function( evt ) {
415
  $.when( wc_stripe_payment_request.updateShippingDetails( paymentDetails, evt.shippingOption ) ).then( function( response ) {
420
  if ( 'fail' === response.result ) {
421
  evt.updateWith( { status: 'fail' } );
422
  }
423
+ } );
424
+ } );
425
 
426
  paymentRequest.on( 'source', function( evt ) {
427
  // Check if we allow prepaid cards.
434
  } else {
435
  wc_stripe_payment_request.abortPayment( evt, response.messages );
436
  }
437
+ } );
438
  }
439
+ } );
440
  },
441
 
442
  getSelectedProductData: function() {
454
  attributes: $( '.variations_form' ).length ? wc_stripe_payment_request.getAttributes().data : []
455
  };
456
 
457
+ return $.ajax( {
458
  type: 'POST',
459
  data: data,
460
  url: wc_stripe_payment_request.getAjaxURL( 'get_selected_product_data' )
461
+ } );
462
  },
463
 
464
  /**
468
  * @version 4.0.0
469
  */
470
  init: function() {
471
+ if ( wc_stripe_payment_request_params.is_product_page ) {
472
+ wc_stripe_payment_request.startPaymentRequest( '' );
473
+ } else {
474
+ wc_stripe_payment_request.getCartDetails();
475
+ }
476
 
 
 
 
 
 
 
 
 
477
  },
478
  };
479
 
482
  // We need to refresh payment request data when total is updated.
483
  $( document.body ).on( 'updated_cart_totals', function() {
484
  wc_stripe_payment_request.init();
485
+ } );
486
 
487
  // We need to refresh payment request data when total is updated.
488
  $( document.body ).on( 'updated_checkout', function() {
489
  wc_stripe_payment_request.init();
490
+ } );
491
+ } );
assets/js/stripe-payment-request.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(function(t){"use strict";var e,a=Stripe(wc_stripe_payment_request_params.stripe.key),n={getAjaxURL:function(t){return wc_stripe_payment_request_params.ajax_url.toString().replace("%%endpoint%%","wc_stripe_"+t)},getCartDetails:function(e){var a={security:wc_stripe_payment_request_params.nonce.payment};t.ajax({type:"POST",data:a,url:n.getAjaxURL("get_cart_details"),success:function(t){e.update({total:t.order_data.total})}})},getAttributes:function(){var e={},a=0,n=0;return t(".variations_form").find(".variations select").each(function(){var r=t(this).data("attribute_name")||t(this).attr("name"),i=t(this).val()||"";i.length>0&&n++,a++,e[r]=i}),{count:a,chosenCount:n,data:e}},processSource:function(e,a){var r=n.getOrderData(e,a);return t.ajax({type:"POST",data:r,dataType:"json",url:n.getAjaxURL("create_order")})},getOrderData:function(t,e){var a=t.source,n=a.owner.email,r=a.owner.phone,i=a.owner.address,s=a.owner.name,p=t.shippingAddress,o={_wpnonce:wc_stripe_payment_request_params.nonce.checkout,billing_first_name:null!==s?s.split(" ").slice(0,1).join(" "):"",billing_last_name:null!==s?s.split(" ").slice(1).join(" "):"",billing_company:"",billing_email:null!==n?n:t.payerEmail,billing_phone:null!==r?r:t.payerPhone.replace("/[() -]/g",""),billing_country:null!==i?i.country:"",billing_address_1:null!==i?i.line1:"",billing_address_2:null!==i?i.line2:"",billing_city:null!==i?i.city:"",billing_state:null!==i?i.state:"",billing_postcode:null!==i?i.postal_code:"",shipping_first_name:"",shipping_last_name:"",shipping_company:"",shipping_country:"",shipping_address_1:"",shipping_address_2:"",shipping_city:"",shipping_state:"",shipping_postcode:"",shipping_method:[null===t.shippingOption?null:t.shippingOption.id],order_comments:"",payment_method:"stripe",ship_to_different_address:1,terms:1,stripe_source:a.id,payment_request_type:e};return p&&(o.shipping_first_name=p.recipient.split(" ").slice(0,1).join(" "),o.shipping_last_name=p.recipient.split(" ").slice(1).join(" "),o.shipping_company=p.organization,o.shipping_country=p.country,o.shipping_address_1=void 0===p.addressLine[0]?"":p.addressLine[0],o.shipping_address_2=void 0===p.addressLine[1]?"":p.addressLine[1],o.shipping_city=p.city,o.shipping_state=p.region,o.shipping_postcode=p.postalCode),o},getErrorMessageHTML:function(e){return t('<div class="woocommerce-error" />').text(e)},abortPayment:function(e,a){if(e.complete("fail"),t(".woocommerce-error").remove(),wc_stripe_payment_request_params.is_product_page){var n=t(".product");n.before(a),t("html, body").animate({scrollTop:n.prev(".woocommerce-error").offset().top},600)}else{var r=t(".shop_table.cart").closest("form");r.before(a),t("html, body").animate({scrollTop:r.prev(".woocommerce-error").offset().top},600)}},completePayment:function(t,e){n.block(),t.complete("success"),window.location=e},block:function(){t.blockUI({message:null,overlayCSS:{background:"#fff",opacity:.6}})},updateShippingOptions:function(a,r){var i={security:wc_stripe_payment_request_params.nonce.shipping,country:r.country,state:r.region,postcode:r.postalCode,city:r.city,address:void 0===r.addressLine[0]?"":r.addressLine[0],address_2:void 0===r.addressLine[1]?"":r.addressLine[1],payment_request_type:e};return t.ajax({type:"POST",data:i,url:n.getAjaxURL("get_shipping_options")})},updateShippingDetails:function(a,r){var i={security:wc_stripe_payment_request_params.nonce.update_shipping,shipping_method:[r.id],payment_request_type:e};return t.ajax({type:"POST",data:i,url:n.getAjaxURL("update_shipping_method")})},addToCart:function(){var e=t(".single_add_to_cart_button").val();t(".single_variation_wrap").length&&(e=t(".single_variation_wrap").find('input[name="product_id"]').val());var a={security:wc_stripe_payment_request_params.nonce.add_to_cart,product_id:e,qty:t(".quantity .qty").val(),attributes:t(".variations_form").length?n.getAttributes().data:[]};return t.ajax({type:"POST",data:a,url:n.getAjaxURL("add_to_cart")})},clearCart:function(){var e={security:wc_stripe_payment_request_params.nonce.clear_cart};return t.ajax({type:"POST",data:e,url:n.getAjaxURL("clear_cart"),success:function(t){}})},getRequestOptionsFromLocal:function(){return{total:wc_stripe_payment_request_params.product.total,currency:wc_stripe_payment_request_params.checkout.currency_code,country:wc_stripe_payment_request_params.checkout.country_code,requestPayerName:!0,requestPayerEmail:!0,requestPayerPhone:!0,requestShipping:wc_stripe_payment_request_params.product.requestShipping,displayItems:wc_stripe_payment_request_params.product.displayItems}},startPaymentRequest:function(r){var i,s;wc_stripe_payment_request_params.is_product_page?(s=n.getRequestOptionsFromLocal(),i=s):(s={total:r.order_data.total,currency:r.order_data.currency,country:r.order_data.country_code,requestPayerName:!0,requestPayerEmail:!0,requestPayerPhone:!0,requestShipping:!!r.shipping_required,displayItems:r.order_data.displayItems},i=r.order_data);var p=a.paymentRequest(s),o=a.elements({locale:wc_stripe_payment_request_params.button.locale}).create("paymentRequestButton",{paymentRequest:p,style:{paymentRequestButton:{type:wc_stripe_payment_request_params.button.type,theme:wc_stripe_payment_request_params.button.theme,height:wc_stripe_payment_request_params.button.height+"px"}}});p.canMakePayment().then(function(a){if(a){if(e=a.applePay?"apple_pay":"payment_request_api",wc_stripe_payment_request_params.is_product_page){var r=t(".single_add_to_cart_button");o.on("click",function(t){r.is(".disabled")?(t.preventDefault(),r.is(".wc-variation-is-unavailable")?window.alert(wc_add_to_cart_variation_params.i18n_unavailable_text):r.is(".wc-variation-selection-needed")&&window.alert(wc_add_to_cart_variation_params.i18n_make_a_selection_text)):n.addToCart()}),t(document.body).on("woocommerce_variation_has_changed",function(){t("#wc-stripe-payment-request-button").block({message:null}),t.when(n.getSelectedProductData()).then(function(e){t.when(p.update({total:e.total,displayItems:e.displayItems})).then(function(){t("#wc-stripe-payment-request-button").unblock()})})}),t(".quantity").on("change",".qty",function(){t("#wc-stripe-payment-request-button").block({message:null}),t.when(n.getSelectedProductData()).then(function(e){t.when(p.update({total:e.total,displayItems:e.displayItems})).then(function(){t("#wc-stripe-payment-request-button").unblock()})})})}t("#wc-stripe-payment-request-button").length&&(o.mount("#wc-stripe-payment-request-button"),t("#wc-stripe-payment-request-button-separator").show())}else t("#wc-stripe-payment-request-button").hide(),t("#wc-stripe-payment-request-button-separator").hide()}),p.on("shippingaddresschange",function(e){t.when(n.updateShippingOptions(i,e.shippingAddress)).then(function(t){e.updateWith({status:t.result,shippingOptions:t.shipping_options,total:t.total,displayItems:t.displayItems})})}),p.on("shippingoptionchange",function(e){t.when(n.updateShippingDetails(i,e.shippingOption)).then(function(t){"success"===t.result&&e.updateWith({status:"success",total:t.total,displayItems:t.displayItems}),"fail"===t.result&&e.updateWith({status:"fail"})})}),p.on("source",function(a){"no"===wc_stripe_payment_request_params.stripe.allow_prepaid_card&&"prepaid"===a.source.card.funding?n.abortPayment(a,n.getErrorMessageHTML(wc_stripe_payment_request_params.i18n.no_prepaid_card)):t.when(n.processSource(a,e)).then(function(t){"success"===t.result?n.completePayment(a,t.redirect):n.abortPayment(a,t.messages)})})},getSelectedProductData:function(){var e=t(".single_add_to_cart_button").val();t(".single_variation_wrap").length&&(e=t(".single_variation_wrap").find('input[name="product_id"]').val());var a={security:wc_stripe_payment_request_params.nonce.get_selected_product_data,product_id:e,qty:t(".quantity .qty").val(),attributes:t(".variations_form").length?n.getAttributes().data:[]};return t.ajax({type:"POST",data:a,url:n.getAjaxURL("get_selected_product_data")})},init:function(){var e={security:wc_stripe_payment_request_params.nonce.payment};t.ajax({type:"POST",data:e,url:n.getAjaxURL("get_cart_details"),success:function(t){n.startPaymentRequest(t)}})}};n.init(),t(document.body).on("updated_cart_totals",function(){n.init()}),t(document.body).on("updated_checkout",function(){n.init()})});
1
+ jQuery(function(t){"use strict";var e,a=Stripe(wc_stripe_payment_request_params.stripe.key),n={getAjaxURL:function(t){return wc_stripe_payment_request_params.ajax_url.toString().replace("%%endpoint%%","wc_stripe_"+t)},getCartDetails:function(){var e={security:wc_stripe_payment_request_params.nonce.payment};t.ajax({type:"POST",data:e,url:n.getAjaxURL("get_cart_details"),success:function(t){n.startPaymentRequest(t)}})},getAttributes:function(){var e={},a=0,n=0;return t(".variations_form").find(".variations select").each(function(){var r=t(this).data("attribute_name")||t(this).attr("name"),i=t(this).val()||"";i.length>0&&n++,a++,e[r]=i}),{count:a,chosenCount:n,data:e}},processSource:function(e,a){var r=n.getOrderData(e,a);return t.ajax({type:"POST",data:r,dataType:"json",url:n.getAjaxURL("create_order")})},getOrderData:function(t,e){var a=t.source,n=a.owner.email,r=a.owner.phone,i=a.owner.address,s=a.owner.name,p=t.shippingAddress,o={_wpnonce:wc_stripe_payment_request_params.nonce.checkout,billing_first_name:null!==s?s.split(" ").slice(0,1).join(" "):"",billing_last_name:null!==s?s.split(" ").slice(1).join(" "):"",billing_company:"",billing_email:null!==n?n:t.payerEmail,billing_phone:null!==r?r:t.payerPhone.replace("/[() -]/g",""),billing_country:null!==i?i.country:"",billing_address_1:null!==i?i.line1:"",billing_address_2:null!==i?i.line2:"",billing_city:null!==i?i.city:"",billing_state:null!==i?i.state:"",billing_postcode:null!==i?i.postal_code:"",shipping_first_name:"",shipping_last_name:"",shipping_company:"",shipping_country:"",shipping_address_1:"",shipping_address_2:"",shipping_city:"",shipping_state:"",shipping_postcode:"",shipping_method:[null===t.shippingOption?null:t.shippingOption.id],order_comments:"",payment_method:"stripe",ship_to_different_address:1,terms:1,stripe_source:a.id,payment_request_type:e};return p&&(o.shipping_first_name=p.recipient.split(" ").slice(0,1).join(" "),o.shipping_last_name=p.recipient.split(" ").slice(1).join(" "),o.shipping_company=p.organization,o.shipping_country=p.country,o.shipping_address_1=void 0===p.addressLine[0]?"":p.addressLine[0],o.shipping_address_2=void 0===p.addressLine[1]?"":p.addressLine[1],o.shipping_city=p.city,o.shipping_state=p.region,o.shipping_postcode=p.postalCode),o},getErrorMessageHTML:function(e){return t('<div class="woocommerce-error" />').text(e)},abortPayment:function(e,a){if(e.complete("fail"),t(".woocommerce-error").remove(),wc_stripe_payment_request_params.is_product_page){var n=t(".product");n.before(a),t("html, body").animate({scrollTop:n.prev(".woocommerce-error").offset().top},600)}else{var r=t(".shop_table.cart").closest("form");r.before(a),t("html, body").animate({scrollTop:r.prev(".woocommerce-error").offset().top},600)}},completePayment:function(t,e){n.block(),t.complete("success"),window.location=e},block:function(){t.blockUI({message:null,overlayCSS:{background:"#fff",opacity:.6}})},updateShippingOptions:function(a,r){var i={security:wc_stripe_payment_request_params.nonce.shipping,country:r.country,state:r.region,postcode:r.postalCode,city:r.city,address:void 0===r.addressLine[0]?"":r.addressLine[0],address_2:void 0===r.addressLine[1]?"":r.addressLine[1],payment_request_type:e};return t.ajax({type:"POST",data:i,url:n.getAjaxURL("get_shipping_options")})},updateShippingDetails:function(a,r){var i={security:wc_stripe_payment_request_params.nonce.update_shipping,shipping_method:[r.id],payment_request_type:e};return t.ajax({type:"POST",data:i,url:n.getAjaxURL("update_shipping_method")})},addToCart:function(){var e=t(".single_add_to_cart_button").val();t(".single_variation_wrap").length&&(e=t(".single_variation_wrap").find('input[name="product_id"]').val());var a={security:wc_stripe_payment_request_params.nonce.add_to_cart,product_id:e,qty:t(".quantity .qty").val(),attributes:t(".variations_form").length?n.getAttributes().data:[]};return t.ajax({type:"POST",data:a,url:n.getAjaxURL("add_to_cart")})},clearCart:function(){var e={security:wc_stripe_payment_request_params.nonce.clear_cart};return t.ajax({type:"POST",data:e,url:n.getAjaxURL("clear_cart"),success:function(t){}})},getRequestOptionsFromLocal:function(){return{total:wc_stripe_payment_request_params.product.total,currency:wc_stripe_payment_request_params.checkout.currency_code,country:wc_stripe_payment_request_params.checkout.country_code,requestPayerName:!0,requestPayerEmail:!0,requestPayerPhone:!0,requestShipping:wc_stripe_payment_request_params.product.requestShipping,displayItems:wc_stripe_payment_request_params.product.displayItems}},startPaymentRequest:function(r){var i,s;wc_stripe_payment_request_params.is_product_page?(s=n.getRequestOptionsFromLocal(),i=s):(s={total:r.order_data.total,currency:r.order_data.currency,country:r.order_data.country_code,requestPayerName:!0,requestPayerEmail:!0,requestPayerPhone:!0,requestShipping:!!r.shipping_required,displayItems:r.order_data.displayItems},i=r.order_data);var p=a.paymentRequest(s),o=a.elements({locale:wc_stripe_payment_request_params.button.locale}).create("paymentRequestButton",{paymentRequest:p,style:{paymentRequestButton:{type:wc_stripe_payment_request_params.button.type,theme:wc_stripe_payment_request_params.button.theme,height:wc_stripe_payment_request_params.button.height+"px"}}});p.canMakePayment().then(function(a){if(a){if(e=a.applePay?"apple_pay":"payment_request_api",wc_stripe_payment_request_params.is_product_page){var r=t(".single_add_to_cart_button");o.on("click",function(t){r.is(".disabled")?(t.preventDefault(),r.is(".wc-variation-is-unavailable")?window.alert(wc_add_to_cart_variation_params.i18n_unavailable_text):r.is(".wc-variation-selection-needed")&&window.alert(wc_add_to_cart_variation_params.i18n_make_a_selection_text)):n.addToCart()}),t(document.body).on("woocommerce_variation_has_changed",function(){t("#wc-stripe-payment-request-button").block({message:null}),t.when(n.getSelectedProductData()).then(function(e){t.when(p.update({total:e.total,displayItems:e.displayItems})).then(function(){t("#wc-stripe-payment-request-button").unblock()})})}),t(".quantity").on("change",".qty",function(){t("#wc-stripe-payment-request-button").block({message:null}),t.when(n.getSelectedProductData()).then(function(e){t.when(p.update({total:e.total,displayItems:e.displayItems})).then(function(){t("#wc-stripe-payment-request-button").unblock()})})})}t("#wc-stripe-payment-request-button").length&&(o.mount("#wc-stripe-payment-request-button"),t("#wc-stripe-payment-request-button-separator").show())}else t("#wc-stripe-payment-request-button").hide(),t("#wc-stripe-payment-request-button-separator").hide()}),p.on("shippingaddresschange",function(e){t.when(n.updateShippingOptions(i,e.shippingAddress)).then(function(t){e.updateWith({status:t.result,shippingOptions:t.shipping_options,total:t.total,displayItems:t.displayItems})})}),p.on("shippingoptionchange",function(e){t.when(n.updateShippingDetails(i,e.shippingOption)).then(function(t){"success"===t.result&&e.updateWith({status:"success",total:t.total,displayItems:t.displayItems}),"fail"===t.result&&e.updateWith({status:"fail"})})}),p.on("source",function(a){"no"===wc_stripe_payment_request_params.stripe.allow_prepaid_card&&"prepaid"===a.source.card.funding?n.abortPayment(a,n.getErrorMessageHTML(wc_stripe_payment_request_params.i18n.no_prepaid_card)):t.when(n.processSource(a,e)).then(function(t){"success"===t.result?n.completePayment(a,t.redirect):n.abortPayment(a,t.messages)})})},getSelectedProductData:function(){var e=t(".single_add_to_cart_button").val();t(".single_variation_wrap").length&&(e=t(".single_variation_wrap").find('input[name="product_id"]').val());var a={security:wc_stripe_payment_request_params.nonce.get_selected_product_data,product_id:e,qty:t(".quantity .qty").val(),attributes:t(".variations_form").length?n.getAttributes().data:[]};return t.ajax({type:"POST",data:a,url:n.getAjaxURL("get_selected_product_data")})},init:function(){wc_stripe_payment_request_params.is_product_page?n.startPaymentRequest(""):n.getCartDetails()}};n.init(),t(document.body).on("updated_cart_totals",function(){n.init()}),t(document.body).on("updated_checkout",function(){n.init()})});
assets/js/stripe.js CHANGED
@@ -575,7 +575,11 @@ jQuery( function( $ ) {
575
  },
576
 
577
  onSubmit: function( e ) {
578
- if ( wc_stripe_form.isStripeChosen() && ! wc_stripe_form.isStripeSaveCardChosen() && ! wc_stripe_form.hasSource() && ! wc_stripe_form.hasToken() ) {
 
 
 
 
579
  e.preventDefault();
580
 
581
  // Stripe Checkout.
575
  },
576
 
577
  onSubmit: function( e ) {
578
+ if ( ! wc_stripe_form.isStripeChosen() ) {
579
+ return;
580
+ }
581
+
582
+ if ( ! wc_stripe_form.isStripeSaveCardChosen() && ! wc_stripe_form.hasSource() && ! wc_stripe_form.hasToken() ) {
583
  e.preventDefault();
584
 
585
  // Stripe Checkout.
assets/js/stripe.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(function(e){"use strict";var r=Stripe(wc_stripe_params.key);if("yes"===wc_stripe_params.use_elements)var t,i,o,s=wc_stripe_params.elements_options.length?wc_stripe_params.elements_options:{},a=r.elements(s);var n={getAjaxURL:function(e){return wc_stripe_params.ajaxurl.toString().replace("%%endpoint%%","wc_stripe_"+e)},unmountElements:function(){"yes"===wc_stripe_params.inline_cc_form?t.unmount("#stripe-card-element"):(t.unmount("#stripe-card-element"),i.unmount("#stripe-exp-element"),o.unmount("#stripe-cvc-element"))},mountElements:function(){e("#stripe-card-element").length&&("yes"===wc_stripe_params.inline_cc_form?t.mount("#stripe-card-element"):(t.mount("#stripe-card-element"),i.mount("#stripe-exp-element"),o.mount("#stripe-cvc-element")))},createElements:function(){var r={base:{iconColor:"#666EE8",color:"#31325F",fontSize:"15px","::placeholder":{color:"#CFD7E0"}}},s={focus:"focused",empty:"empty",invalid:"invalid"};r=wc_stripe_params.elements_styling?wc_stripe_params.elements_styling:r,s=wc_stripe_params.elements_classes?wc_stripe_params.elements_classes:s,"yes"===wc_stripe_params.inline_cc_form?(t=a.create("card",{style:r,hidePostalCode:!0})).addEventListener("change",function(r){n.onCCFormChange(),r.error&&e(document.body).trigger("stripeError",r)}):(t=a.create("cardNumber",{style:r,classes:s}),i=a.create("cardExpiry",{style:r,classes:s}),o=a.create("cardCvc",{style:r,classes:s}),t.addEventListener("change",function(r){n.onCCFormChange(),r.error&&e(document.body).trigger("stripeError",r)}),i.addEventListener("change",function(r){n.onCCFormChange(),r.error&&e(document.body).trigger("stripeError",r)}),o.addEventListener("change",function(r){n.onCCFormChange(),r.error&&e(document.body).trigger("stripeError",r)})),"yes"===wc_stripe_params.is_checkout?e(document.body).on("updated_checkout",function(){t&&n.unmountElements(),n.mountElements()}):(e("form#add_payment_method").length||e("form#order_review").length)&&n.mountElements()},init:function(){"yes"!==wc_stripe_params.is_change_payment_page&&"yes"!==wc_stripe_params.is_pay_for_order_page||e(document.body).trigger("wc-credit-card-form-init"),this.stripe_checkout_submit=!1,e("form.woocommerce-checkout").length&&(this.form=e("form.woocommerce-checkout")),e("form.woocommerce-checkout").on("checkout_place_order_stripe checkout_place_order_stripe_bancontact checkout_place_order_stripe_sofort checkout_place_order_stripe_giropay checkout_place_order_stripe_ideal checkout_place_order_stripe_alipay checkout_place_order_stripe_sepa checkout_place_order_stripe_bitcoin",this.onSubmit),e("form#order_review").length&&(this.form=e("form#order_review")),e("form#order_review, form#add_payment_method").on("submit",this.onSubmit),e("form#add_payment_method").length&&(this.form=e("form#add_payment_method")),e("form.woocommerce-checkout").on("change",this.reset),e(document).on("stripeError",this.onError).on("checkout_error",this.reset),"yes"===wc_stripe_params.use_elements&&n.createElements()},isStripeChosen:function(){return e("#payment_method_stripe, #payment_method_stripe_bancontact, #payment_method_stripe_sofort, #payment_method_stripe_giropay, #payment_method_stripe_ideal, #payment_method_stripe_alipay, #payment_method_stripe_sepa, #payment_method_stripe_bitcoin").is(":checked")||e("#payment_method_stripe").is(":checked")&&"new"===e('input[name="wc-stripe-payment-token"]:checked').val()||e("#payment_method_stripe_sepa").is(":checked")&&"new"===e('input[name="wc-stripe-payment-token"]:checked').val()},isStripeSaveCardChosen:function(){return e("#payment_method_stripe").is(":checked")&&e('input[name="wc-stripe-payment-token"]').is(":checked")&&"new"!==e('input[name="wc-stripe-payment-token"]:checked').val()||e("#payment_method_stripe_sepa").is(":checked")&&e('input[name="wc-stripe_sepa-payment-token"]').is(":checked")&&"new"!==e('input[name="wc-stripe_sepa-payment-token"]:checked').val()},isStripeCardChosen:function(){return e("#payment_method_stripe").is(":checked")},isBancontactChosen:function(){return e("#payment_method_stripe_bancontact").is(":checked")},isGiropayChosen:function(){return e("#payment_method_stripe_giropay").is(":checked")},isIdealChosen:function(){return e("#payment_method_stripe_ideal").is(":checked")},isSofortChosen:function(){return e("#payment_method_stripe_sofort").is(":checked")},isAlipayChosen:function(){return e("#payment_method_stripe_alipay").is(":checked")},isSepaChosen:function(){return e("#payment_method_stripe_sepa").is(":checked")},isBitcoinChosen:function(){return e("#payment_method_stripe_bitcoin").is(":checked")},isP24Chosen:function(){return e("#payment_method_stripe_p24").is(":checked")},hasSource:function(){return 0<e("input.stripe-source").length},hasToken:function(){return 0<e("input.stripe_token").length},isMobile:function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},isStripeModalNeeded:function(e){var r=n.form.find("input.stripe_token");return(!n.stripe_submit||!r)&&!!n.isStripeChosen()},block:function(){n.isMobile()||n.form.block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},unblock:function(){n.form.unblock()},getSelectedPaymentElement:function(){return e('.payment_methods input[name="payment_method"]:checked')},openModal:function(){var t=n.form,i=e("#stripe-payment-data");n.reset();StripeCheckout.open({key:wc_stripe_params.key,billingAddress:"yes"===wc_stripe_params.stripe_checkout_require_billing_address,amount:i.data("amount"),name:i.data("name"),description:i.data("description"),currency:i.data("currency"),image:i.data("image"),bitcoin:i.data("bitcoin"),locale:i.data("locale"),email:e("#billing_email").val()||i.data("email"),panelLabel:i.data("panel-label"),allowRememberMe:i.data("allow-remember-me"),token:function(e){if(t.find("input.stripe_source").remove(),"token"===e.object)r.createSource({type:"card",token:e.id}).then(n.sourceResponse);else if("source"===e.object){var i={source:e};n.sourceResponse(i)}},closed:n.onClose()})},resetModal:function(){n.reset(),n.stripe_checkout_submit=!1},onClose:function(){n.unblock()},getOwnerDetails:function(){var r=e("#billing_first_name").length?e("#billing_first_name").val():wc_stripe_params.billing_first_name,t=e("#billing_last_name").length?e("#billing_last_name").val():wc_stripe_params.billing_last_name,i={owner:{name:"",address:{},email:"",phone:""}};return i.owner.name=r,r&&t&&(i.owner.name=r+" "+t),i.owner.email=e("#billing_email").val(),i.owner.phone=e("#billing_phone").val(),void 0!==i.owner.phone&&0>=i.owner.phone.length&&delete i.owner.phone,void 0!==i.owner.email&&0>=i.owner.email.length&&delete i.owner.email,void 0!==i.owner.name&&0>=i.owner.name.length&&delete i.owner.name,e("#billing_address_1").length>0?(i.owner.address.line1=e("#billing_address_1").val(),i.owner.address.line2=e("#billing_address_2").val(),i.owner.address.state=e("#billing_state").val(),i.owner.address.city=e("#billing_city").val(),i.owner.address.postal_code=e("#billing_postcode").val(),i.owner.address.country=e("#billing_country").val()):wc_stripe_params.billing_address_1&&(i.owner.address.line1=wc_stripe_params.billing_address_1,i.owner.address.line2=wc_stripe_params.billing_address_2,i.owner.address.state=wc_stripe_params.billing_state,i.owner.address.city=wc_stripe_params.billing_city,i.owner.address.postal_code=wc_stripe_params.billing_postcode,i.owner.address.country=wc_stripe_params.billing_country),i},createSource:function(){var i=n.getOwnerDetails(),o="card";if(n.isBancontactChosen()&&(o="bancontact"),n.isSepaChosen()&&(o="sepa_debit"),n.isIdealChosen()&&(o="ideal"),n.isSofortChosen()&&(o="sofort"),n.isBitcoinChosen()&&(o="bitcoin"),n.isGiropayChosen()&&(o="giropay"),n.isAlipayChosen()&&(o="alipay"),"card"===o)r.createSource(t,i).then(n.sourceResponse);else{switch(o){case"bancontact":case"giropay":case"ideal":case"sofort":case"alipay":i.amount=e("#stripe-"+o+"-payment-data").data("amount"),i.currency=e("#stripe-"+o+"-payment-data").data("currency"),i.redirect={return_url:wc_stripe_params.return_url},wc_stripe_params.statement_descriptor&&(i.statement_descriptor=wc_stripe_params.statement_descriptor)}switch(o){case"sepa_debit":var s=e("#stripe-payment-data"),a=e("#billing_email").length?e("#billing_email").val():s.data("email");i.currency=e("#stripe-"+o+"-payment-data").data("currency"),i.owner.name=e("#stripe-sepa-owner").val(),i.owner.email=a,i.sepa_debit={iban:e("#stripe-sepa-iban").val()},i.mandate={notification_method:wc_stripe_params.sepa_mandate_notification};break;case"ideal":i.ideal={bank:e("#stripe-ideal-bank").val()};break;case"bitcoin":case"alipay":i.currency=e("#stripe-"+o+"-payment-data").data("currency"),i.amount=e("#stripe-"+o+"-payment-data").data("amount");break;case"sofort":i.sofort={country:e("#billing_country").val()}}i.type=o,r.createSource(i).then(n.sourceResponse)}},sourceResponse:function(r){r.error?e(document.body).trigger("stripeError",r):"no"===wc_stripe_params.allow_prepaid_card&&"card"===r.source.type&&"prepaid"===r.source.card.funding?(r.error={message:wc_stripe_params.no_prepaid_card_msg},wc_stripe_params.is_stripe_checkout?n.submitError('<ul class="woocommerce-error"><li>'+wc_stripe_params.no_prepaid_card_msg+"</li></ul>"):e(document.body).trigger("stripeError",r)):n.processStripeResponse(r.source)},processStripeResponse:function(r){n.reset(),n.form.append("<input type='hidden' class='stripe-source' name='stripe_source' value='"+r.id+"'/>"),e("form#add_payment_method").length&&e(n.form).off("submit",n.form.onSubmit),n.form.submit()},createToken:function(){var r=e("#stripe-card-number").val(),t=e("#stripe-card-cvc").val(),i=e("#stripe-card-expiry").payment("cardExpiryVal"),o=e("#billing_first_name").length?e("#billing_first_name").val():wc_stripe_params.billing_first_name,s=e("#billing_last_name").length?e("#billing_last_name").val():wc_stripe_params.billing_last_name,a={number:r,cvc:t,exp_month:parseInt(i.month,10)||0,exp_year:parseInt(i.year,10)||0};o&&s&&(a.name=o+" "+s),e("#billing_address_1").length>0?(a.address_line1=e("#billing_address_1").val(),a.address_line2=e("#billing_address_2").val(),a.address_state=e("#billing_state").val(),a.address_city=e("#billing_city").val(),a.address_zip=e("#billing_postcode").val(),a.address_country=e("#billing_country").val()):wc_stripe_params.billing_address_1&&(a.address_line1=wc_stripe_params.billing_address_1,a.address_line2=wc_stripe_params.billing_address_2,a.address_state=wc_stripe_params.billing_state,a.address_city=wc_stripe_params.billing_city,a.address_zip=wc_stripe_params.billing_postcode,a.address_country=wc_stripe_params.billing_country),Stripe.setPublishableKey(wc_stripe_params.key),Stripe.createToken(a,n.onStripeTokenResponse)},onStripeTokenResponse:function(r,t){if(t.error)e(document).trigger("stripeError",t);else{if("no"===wc_stripe_params.allow_prepaid_card&&"prepaid"===t.card.funding)return t.error={message:wc_stripe_params.no_prepaid_card_msg},e(document).trigger("stripeError",{response:t}),!1;var i=t.id;n.form.append("<input type='hidden' class='stripe_token' name='stripe_token' value='"+i+"'/>"),e("form#add_payment_method").length&&e(n.form).off("submit",n.form.onSubmit),n.form.submit()}},onSubmit:function(r){if(n.isStripeChosen()&&!n.isStripeSaveCardChosen()&&!n.hasSource()&&!n.hasToken()){if(r.preventDefault(),"yes"===wc_stripe_params.is_stripe_checkout&&n.isStripeModalNeeded()&&n.isStripeCardChosen())return n.isMobile()||"no"===wc_stripe_params.validate_modal_checkout?n.openModal():n.validateCheckout(),!1;if(n.block(),n.isStripeCardChosen()&&"no"===wc_stripe_params.use_elements)return n.createToken(),!1;if(n.isSepaChosen()){if(""===e("#stripe-sepa-owner").val())return e(document.body).trigger("stripeError",{error:{message:wc_stripe_params.no_sepa_owner_msg}}),!1;if(""===e("#stripe-sepa-iban").val())return e(document.body).trigger("stripeError",{error:{message:wc_stripe_params.no_sepa_iban_msg}}),!1}if(n.isBancontactChosen()||n.isGiropayChosen()||n.isIdealChosen()||n.isAlipayChosen()||n.isSofortChosen()||n.isP24Chosen()){if(e("form#order_review").length&&(e("form#order_review").off("submit",this.onSubmit),n.form.submit()),e("form.woocommerce-checkout").length)return e("form.woocommerce-checkout").off("submit",this.onSubmit),!0;e("form#add_payment_method").length&&(e("form#add_payment_method").off("submit",this.onSubmit),n.form.submit())}return n.createSource(),!1}if(e("form#add_payment_method").length)return r.preventDefault(),"yes"===wc_stripe_params.is_stripe_checkout&&n.isStripeModalNeeded()&&n.isStripeCardChosen()?(n.openModal(),!1):(n.block(),n.isStripeCardChosen()&&"no"===wc_stripe_params.use_elements?(n.createToken(),!1):(n.createSource(),!1))},onCCFormChange:function(){n.reset()},reset:function(){e(".wc-stripe-error, .stripe-source, .stripe_token").remove(),"yes"===wc_stripe_params.is_stripe_checkout&&(n.stripe_submit=!1)},getRequiredFields:function(){return n.form.find(".form-row.validate-required > input:visible, .form-row.validate-required > select:visible, .form-row.validate-required > textarea:visible")},validateCheckout:function(){var r={nonce:wc_stripe_params.stripe_nonce,required_fields:n.getRequiredFields().serialize(),all_fields:n.form.serialize()};e.ajax({type:"POST",url:n.getAjaxURL("validate_checkout"),data:r,dataType:"json",success:function(e){"success"===e?n.openModal():e.messages&&(n.resetModal(),n.reset(),n.submitError(e.messages))}})},onError:function(r,t){var i=t.error.message,o=n.getSelectedPaymentElement().parents("li").eq(0).find(".stripe-source-errors");"invalid_request_error"!==t.error.type&&"api_connection_error"!==t.error.type&&"api_error"!==t.error.type&&"authentication_error"!==t.error.type&&"rate_limit_error"!==t.error.type||(i=wc_stripe_params.invalid_request_error),"card_error"===t.error.type&&wc_stripe_params.hasOwnProperty(t.error.code)&&(i=wc_stripe_params[t.error.code]),"validation_error"===t.error.type&&wc_stripe_params.hasOwnProperty(t.error.code)&&(i=wc_stripe_params[t.error.code]),n.reset(),e(".woocommerce-NoticeGroup-checkout").remove(),console.log(t.error.message),e(o).html('<ul class="woocommerce_error woocommerce-error wc-stripe-error"><li>'+i+"</li></ul>"),e(".wc-stripe-error").length&&e("html, body").animate({scrollTop:e(".wc-stripe-error").offset().top-200},200),n.unblock()},submitError:function(r){e(".woocommerce-NoticeGroup-checkout, .woocommerce-error, .woocommerce-message").remove(),n.form.prepend('<div class="woocommerce-NoticeGroup woocommerce-NoticeGroup-checkout">'+r+"</div>"),n.form.removeClass("processing").unblock(),n.form.find(".input-text, select, input:checkbox").blur();var t="";e("#add_payment_method").length&&(t=e("#add_payment_method")),e("#order_review").length&&(t=e("#order_review")),e("form.checkout").length&&(t=e("form.checkout")),t.length&&e("html, body").animate({scrollTop:t.offset().top-100},500),e(document.body).trigger("checkout_error"),n.unblock()}};n.init()});
1
+ jQuery(function(e){"use strict";var r=Stripe(wc_stripe_params.key);if("yes"===wc_stripe_params.use_elements)var t,i,o,s=wc_stripe_params.elements_options.length?wc_stripe_params.elements_options:{},a=r.elements(s);var n={getAjaxURL:function(e){return wc_stripe_params.ajaxurl.toString().replace("%%endpoint%%","wc_stripe_"+e)},unmountElements:function(){"yes"===wc_stripe_params.inline_cc_form?t.unmount("#stripe-card-element"):(t.unmount("#stripe-card-element"),i.unmount("#stripe-exp-element"),o.unmount("#stripe-cvc-element"))},mountElements:function(){e("#stripe-card-element").length&&("yes"===wc_stripe_params.inline_cc_form?t.mount("#stripe-card-element"):(t.mount("#stripe-card-element"),i.mount("#stripe-exp-element"),o.mount("#stripe-cvc-element")))},createElements:function(){var r={base:{iconColor:"#666EE8",color:"#31325F",fontSize:"15px","::placeholder":{color:"#CFD7E0"}}},s={focus:"focused",empty:"empty",invalid:"invalid"};r=wc_stripe_params.elements_styling?wc_stripe_params.elements_styling:r,s=wc_stripe_params.elements_classes?wc_stripe_params.elements_classes:s,"yes"===wc_stripe_params.inline_cc_form?(t=a.create("card",{style:r,hidePostalCode:!0})).addEventListener("change",function(r){n.onCCFormChange(),r.error&&e(document.body).trigger("stripeError",r)}):(t=a.create("cardNumber",{style:r,classes:s}),i=a.create("cardExpiry",{style:r,classes:s}),o=a.create("cardCvc",{style:r,classes:s}),t.addEventListener("change",function(r){n.onCCFormChange(),r.error&&e(document.body).trigger("stripeError",r)}),i.addEventListener("change",function(r){n.onCCFormChange(),r.error&&e(document.body).trigger("stripeError",r)}),o.addEventListener("change",function(r){n.onCCFormChange(),r.error&&e(document.body).trigger("stripeError",r)})),"yes"===wc_stripe_params.is_checkout?e(document.body).on("updated_checkout",function(){t&&n.unmountElements(),n.mountElements()}):(e("form#add_payment_method").length||e("form#order_review").length)&&n.mountElements()},init:function(){"yes"!==wc_stripe_params.is_change_payment_page&&"yes"!==wc_stripe_params.is_pay_for_order_page||e(document.body).trigger("wc-credit-card-form-init"),this.stripe_checkout_submit=!1,e("form.woocommerce-checkout").length&&(this.form=e("form.woocommerce-checkout")),e("form.woocommerce-checkout").on("checkout_place_order_stripe checkout_place_order_stripe_bancontact checkout_place_order_stripe_sofort checkout_place_order_stripe_giropay checkout_place_order_stripe_ideal checkout_place_order_stripe_alipay checkout_place_order_stripe_sepa checkout_place_order_stripe_bitcoin",this.onSubmit),e("form#order_review").length&&(this.form=e("form#order_review")),e("form#order_review, form#add_payment_method").on("submit",this.onSubmit),e("form#add_payment_method").length&&(this.form=e("form#add_payment_method")),e("form.woocommerce-checkout").on("change",this.reset),e(document).on("stripeError",this.onError).on("checkout_error",this.reset),"yes"===wc_stripe_params.use_elements&&n.createElements()},isStripeChosen:function(){return e("#payment_method_stripe, #payment_method_stripe_bancontact, #payment_method_stripe_sofort, #payment_method_stripe_giropay, #payment_method_stripe_ideal, #payment_method_stripe_alipay, #payment_method_stripe_sepa, #payment_method_stripe_bitcoin").is(":checked")||e("#payment_method_stripe").is(":checked")&&"new"===e('input[name="wc-stripe-payment-token"]:checked').val()||e("#payment_method_stripe_sepa").is(":checked")&&"new"===e('input[name="wc-stripe-payment-token"]:checked').val()},isStripeSaveCardChosen:function(){return e("#payment_method_stripe").is(":checked")&&e('input[name="wc-stripe-payment-token"]').is(":checked")&&"new"!==e('input[name="wc-stripe-payment-token"]:checked').val()||e("#payment_method_stripe_sepa").is(":checked")&&e('input[name="wc-stripe_sepa-payment-token"]').is(":checked")&&"new"!==e('input[name="wc-stripe_sepa-payment-token"]:checked').val()},isStripeCardChosen:function(){return e("#payment_method_stripe").is(":checked")},isBancontactChosen:function(){return e("#payment_method_stripe_bancontact").is(":checked")},isGiropayChosen:function(){return e("#payment_method_stripe_giropay").is(":checked")},isIdealChosen:function(){return e("#payment_method_stripe_ideal").is(":checked")},isSofortChosen:function(){return e("#payment_method_stripe_sofort").is(":checked")},isAlipayChosen:function(){return e("#payment_method_stripe_alipay").is(":checked")},isSepaChosen:function(){return e("#payment_method_stripe_sepa").is(":checked")},isBitcoinChosen:function(){return e("#payment_method_stripe_bitcoin").is(":checked")},isP24Chosen:function(){return e("#payment_method_stripe_p24").is(":checked")},hasSource:function(){return 0<e("input.stripe-source").length},hasToken:function(){return 0<e("input.stripe_token").length},isMobile:function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},isStripeModalNeeded:function(e){var r=n.form.find("input.stripe_token");return(!n.stripe_submit||!r)&&!!n.isStripeChosen()},block:function(){n.isMobile()||n.form.block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},unblock:function(){n.form.unblock()},getSelectedPaymentElement:function(){return e('.payment_methods input[name="payment_method"]:checked')},openModal:function(){var t=n.form,i=e("#stripe-payment-data");n.reset();StripeCheckout.open({key:wc_stripe_params.key,billingAddress:"yes"===wc_stripe_params.stripe_checkout_require_billing_address,amount:i.data("amount"),name:i.data("name"),description:i.data("description"),currency:i.data("currency"),image:i.data("image"),bitcoin:i.data("bitcoin"),locale:i.data("locale"),email:e("#billing_email").val()||i.data("email"),panelLabel:i.data("panel-label"),allowRememberMe:i.data("allow-remember-me"),token:function(e){if(t.find("input.stripe_source").remove(),"token"===e.object)r.createSource({type:"card",token:e.id}).then(n.sourceResponse);else if("source"===e.object){var i={source:e};n.sourceResponse(i)}},closed:n.onClose()})},resetModal:function(){n.reset(),n.stripe_checkout_submit=!1},onClose:function(){n.unblock()},getOwnerDetails:function(){var r=e("#billing_first_name").length?e("#billing_first_name").val():wc_stripe_params.billing_first_name,t=e("#billing_last_name").length?e("#billing_last_name").val():wc_stripe_params.billing_last_name,i={owner:{name:"",address:{},email:"",phone:""}};return i.owner.name=r,r&&t&&(i.owner.name=r+" "+t),i.owner.email=e("#billing_email").val(),i.owner.phone=e("#billing_phone").val(),void 0!==i.owner.phone&&0>=i.owner.phone.length&&delete i.owner.phone,void 0!==i.owner.email&&0>=i.owner.email.length&&delete i.owner.email,void 0!==i.owner.name&&0>=i.owner.name.length&&delete i.owner.name,e("#billing_address_1").length>0?(i.owner.address.line1=e("#billing_address_1").val(),i.owner.address.line2=e("#billing_address_2").val(),i.owner.address.state=e("#billing_state").val(),i.owner.address.city=e("#billing_city").val(),i.owner.address.postal_code=e("#billing_postcode").val(),i.owner.address.country=e("#billing_country").val()):wc_stripe_params.billing_address_1&&(i.owner.address.line1=wc_stripe_params.billing_address_1,i.owner.address.line2=wc_stripe_params.billing_address_2,i.owner.address.state=wc_stripe_params.billing_state,i.owner.address.city=wc_stripe_params.billing_city,i.owner.address.postal_code=wc_stripe_params.billing_postcode,i.owner.address.country=wc_stripe_params.billing_country),i},createSource:function(){var i=n.getOwnerDetails(),o="card";if(n.isBancontactChosen()&&(o="bancontact"),n.isSepaChosen()&&(o="sepa_debit"),n.isIdealChosen()&&(o="ideal"),n.isSofortChosen()&&(o="sofort"),n.isBitcoinChosen()&&(o="bitcoin"),n.isGiropayChosen()&&(o="giropay"),n.isAlipayChosen()&&(o="alipay"),"card"===o)r.createSource(t,i).then(n.sourceResponse);else{switch(o){case"bancontact":case"giropay":case"ideal":case"sofort":case"alipay":i.amount=e("#stripe-"+o+"-payment-data").data("amount"),i.currency=e("#stripe-"+o+"-payment-data").data("currency"),i.redirect={return_url:wc_stripe_params.return_url},wc_stripe_params.statement_descriptor&&(i.statement_descriptor=wc_stripe_params.statement_descriptor)}switch(o){case"sepa_debit":var s=e("#stripe-payment-data"),a=e("#billing_email").length?e("#billing_email").val():s.data("email");i.currency=e("#stripe-"+o+"-payment-data").data("currency"),i.owner.name=e("#stripe-sepa-owner").val(),i.owner.email=a,i.sepa_debit={iban:e("#stripe-sepa-iban").val()},i.mandate={notification_method:wc_stripe_params.sepa_mandate_notification};break;case"ideal":i.ideal={bank:e("#stripe-ideal-bank").val()};break;case"bitcoin":case"alipay":i.currency=e("#stripe-"+o+"-payment-data").data("currency"),i.amount=e("#stripe-"+o+"-payment-data").data("amount");break;case"sofort":i.sofort={country:e("#billing_country").val()}}i.type=o,r.createSource(i).then(n.sourceResponse)}},sourceResponse:function(r){r.error?e(document.body).trigger("stripeError",r):"no"===wc_stripe_params.allow_prepaid_card&&"card"===r.source.type&&"prepaid"===r.source.card.funding?(r.error={message:wc_stripe_params.no_prepaid_card_msg},wc_stripe_params.is_stripe_checkout?n.submitError('<ul class="woocommerce-error"><li>'+wc_stripe_params.no_prepaid_card_msg+"</li></ul>"):e(document.body).trigger("stripeError",r)):n.processStripeResponse(r.source)},processStripeResponse:function(r){n.reset(),n.form.append("<input type='hidden' class='stripe-source' name='stripe_source' value='"+r.id+"'/>"),e("form#add_payment_method").length&&e(n.form).off("submit",n.form.onSubmit),n.form.submit()},createToken:function(){var r=e("#stripe-card-number").val(),t=e("#stripe-card-cvc").val(),i=e("#stripe-card-expiry").payment("cardExpiryVal"),o=e("#billing_first_name").length?e("#billing_first_name").val():wc_stripe_params.billing_first_name,s=e("#billing_last_name").length?e("#billing_last_name").val():wc_stripe_params.billing_last_name,a={number:r,cvc:t,exp_month:parseInt(i.month,10)||0,exp_year:parseInt(i.year,10)||0};o&&s&&(a.name=o+" "+s),e("#billing_address_1").length>0?(a.address_line1=e("#billing_address_1").val(),a.address_line2=e("#billing_address_2").val(),a.address_state=e("#billing_state").val(),a.address_city=e("#billing_city").val(),a.address_zip=e("#billing_postcode").val(),a.address_country=e("#billing_country").val()):wc_stripe_params.billing_address_1&&(a.address_line1=wc_stripe_params.billing_address_1,a.address_line2=wc_stripe_params.billing_address_2,a.address_state=wc_stripe_params.billing_state,a.address_city=wc_stripe_params.billing_city,a.address_zip=wc_stripe_params.billing_postcode,a.address_country=wc_stripe_params.billing_country),Stripe.setPublishableKey(wc_stripe_params.key),Stripe.createToken(a,n.onStripeTokenResponse)},onStripeTokenResponse:function(r,t){if(t.error)e(document).trigger("stripeError",t);else{if("no"===wc_stripe_params.allow_prepaid_card&&"prepaid"===t.card.funding)return t.error={message:wc_stripe_params.no_prepaid_card_msg},e(document).trigger("stripeError",{response:t}),!1;var i=t.id;n.form.append("<input type='hidden' class='stripe_token' name='stripe_token' value='"+i+"'/>"),e("form#add_payment_method").length&&e(n.form).off("submit",n.form.onSubmit),n.form.submit()}},onSubmit:function(r){if(n.isStripeChosen()){if(!(n.isStripeSaveCardChosen()||n.hasSource()||n.hasToken())){if(r.preventDefault(),"yes"===wc_stripe_params.is_stripe_checkout&&n.isStripeModalNeeded()&&n.isStripeCardChosen())return n.isMobile()||"no"===wc_stripe_params.validate_modal_checkout?n.openModal():n.validateCheckout(),!1;if(n.block(),n.isStripeCardChosen()&&"no"===wc_stripe_params.use_elements)return n.createToken(),!1;if(n.isSepaChosen()){if(""===e("#stripe-sepa-owner").val())return e(document.body).trigger("stripeError",{error:{message:wc_stripe_params.no_sepa_owner_msg}}),!1;if(""===e("#stripe-sepa-iban").val())return e(document.body).trigger("stripeError",{error:{message:wc_stripe_params.no_sepa_iban_msg}}),!1}if(n.isBancontactChosen()||n.isGiropayChosen()||n.isIdealChosen()||n.isAlipayChosen()||n.isSofortChosen()||n.isP24Chosen()){if(e("form#order_review").length&&(e("form#order_review").off("submit",this.onSubmit),n.form.submit()),e("form.woocommerce-checkout").length)return e("form.woocommerce-checkout").off("submit",this.onSubmit),!0;e("form#add_payment_method").length&&(e("form#add_payment_method").off("submit",this.onSubmit),n.form.submit())}return n.createSource(),!1}return e("form#add_payment_method").length?(r.preventDefault(),"yes"===wc_stripe_params.is_stripe_checkout&&n.isStripeModalNeeded()&&n.isStripeCardChosen()?(n.openModal(),!1):(n.block(),n.isStripeCardChosen()&&"no"===wc_stripe_params.use_elements?(n.createToken(),!1):(n.createSource(),!1))):void 0}},onCCFormChange:function(){n.reset()},reset:function(){e(".wc-stripe-error, .stripe-source, .stripe_token").remove(),"yes"===wc_stripe_params.is_stripe_checkout&&(n.stripe_submit=!1)},getRequiredFields:function(){return n.form.find(".form-row.validate-required > input:visible, .form-row.validate-required > select:visible, .form-row.validate-required > textarea:visible")},validateCheckout:function(){var r={nonce:wc_stripe_params.stripe_nonce,required_fields:n.getRequiredFields().serialize(),all_fields:n.form.serialize()};e.ajax({type:"POST",url:n.getAjaxURL("validate_checkout"),data:r,dataType:"json",success:function(e){"success"===e?n.openModal():e.messages&&(n.resetModal(),n.reset(),n.submitError(e.messages))}})},onError:function(r,t){var i=t.error.message,o=n.getSelectedPaymentElement().parents("li").eq(0).find(".stripe-source-errors");"invalid_request_error"!==t.error.type&&"api_connection_error"!==t.error.type&&"api_error"!==t.error.type&&"authentication_error"!==t.error.type&&"rate_limit_error"!==t.error.type||(i=wc_stripe_params.invalid_request_error),"card_error"===t.error.type&&wc_stripe_params.hasOwnProperty(t.error.code)&&(i=wc_stripe_params[t.error.code]),"validation_error"===t.error.type&&wc_stripe_params.hasOwnProperty(t.error.code)&&(i=wc_stripe_params[t.error.code]),n.reset(),e(".woocommerce-NoticeGroup-checkout").remove(),console.log(t.error.message),e(o).html('<ul class="woocommerce_error woocommerce-error wc-stripe-error"><li>'+i+"</li></ul>"),e(".wc-stripe-error").length&&e("html, body").animate({scrollTop:e(".wc-stripe-error").offset().top-200},200),n.unblock()},submitError:function(r){e(".woocommerce-NoticeGroup-checkout, .woocommerce-error, .woocommerce-message").remove(),n.form.prepend('<div class="woocommerce-NoticeGroup woocommerce-NoticeGroup-checkout">'+r+"</div>"),n.form.removeClass("processing").unblock(),n.form.find(".input-text, select, input:checkbox").blur();var t="";e("#add_payment_method").length&&(t=e("#add_payment_method")),e("#order_review").length&&(t=e("#order_review")),e("form.checkout").length&&(t=e("form.checkout")),t.length&&e("html, body").animate({scrollTop:t.offset().top-100},500),e(document.body).trigger("checkout_error"),n.unblock()}};n.init()});
changelog.txt CHANGED
@@ -1,5 +1,10 @@
1
  *** Changelog ***
2
 
 
 
 
 
 
3
  = 4.0.6 - 2018-02-20 =
4
  * Fix - A WC 2.6 backwards compat issue with function from WC 3.0.
5
  * Fix - Subs renewal sometimes failed due to parameters being different.
1
  *** Changelog ***
2
 
3
+ = 4.0.7 - 2018-02-23 =
4
+ * Fix - Potential conflict issue when adding payment method from another payment gateway.
5
+ * Fix - Issue when using saved card before sources were introduced.
6
+ * Add - Description field/setting for Stripe Checkout Modal/popup.
7
+
8
  = 4.0.6 - 2018-02-20 =
9
  * Fix - A WC 2.6 backwards compat issue with function from WC 3.0.
10
  * Fix - Subs renewal sometimes failed due to parameters being different.
includes/abstracts/abstract-wc-stripe-payment-gateway.php CHANGED
@@ -496,6 +496,7 @@ abstract class WC_Stripe_Payment_Gateway extends WC_Payment_Gateway_CC {
496
  $source_id = '';
497
  $wc_token_id = false;
498
  $payment_method = isset( $_POST['payment_method'] ) ? wc_clean( $_POST['payment_method'] ) : 'stripe';
 
499
 
500
  // New CC info was entered and we have a new source to process.
501
  if ( ! empty( $_POST['stripe_source'] ) ) {
@@ -528,6 +529,7 @@ abstract class WC_Stripe_Payment_Gateway extends WC_Payment_Gateway_CC {
528
  }
529
 
530
  $source_id = $wc_token->get_token();
 
531
  } elseif ( isset( $_POST['stripe_token'] ) && 'new' !== $_POST['stripe_token'] ) {
532
  $stripe_token = wc_clean( $_POST['stripe_token'] );
533
  $maybe_saved_card = isset( $_POST[ 'wc-' . $payment_method . '-new-payment-method' ] ) && ! empty( $_POST[ 'wc-' . $payment_method . '-new-payment-method' ] );
@@ -542,6 +544,7 @@ abstract class WC_Stripe_Payment_Gateway extends WC_Payment_Gateway_CC {
542
  } else {
543
  $set_customer = false;
544
  $source_id = $stripe_token;
 
545
  }
546
  }
547
 
@@ -551,7 +554,7 @@ abstract class WC_Stripe_Payment_Gateway extends WC_Payment_Gateway_CC {
551
  $customer_id = $customer->get_id() ? $customer->get_id() : false;
552
  }
553
 
554
- if ( empty( $source_object ) ) {
555
  $source_object = self::get_source_object( $source_id );
556
  }
557
 
496
  $source_id = '';
497
  $wc_token_id = false;
498
  $payment_method = isset( $_POST['payment_method'] ) ? wc_clean( $_POST['payment_method'] ) : 'stripe';
499
+ $is_token = false;
500
 
501
  // New CC info was entered and we have a new source to process.
502
  if ( ! empty( $_POST['stripe_source'] ) ) {
529
  }
530
 
531
  $source_id = $wc_token->get_token();
532
+ $is_token = true;
533
  } elseif ( isset( $_POST['stripe_token'] ) && 'new' !== $_POST['stripe_token'] ) {
534
  $stripe_token = wc_clean( $_POST['stripe_token'] );
535
  $maybe_saved_card = isset( $_POST[ 'wc-' . $payment_method . '-new-payment-method' ] ) && ! empty( $_POST[ 'wc-' . $payment_method . '-new-payment-method' ] );
544
  } else {
545
  $set_customer = false;
546
  $source_id = $stripe_token;
547
+ $is_token = true;
548
  }
549
  }
550
 
554
  $customer_id = $customer->get_id() ? $customer->get_id() : false;
555
  }
556
 
557
+ if ( empty( $source_object ) && ! $is_token ) {
558
  $source_object = self::get_source_object( $source_id );
559
  }
560
 
includes/admin/stripe-settings.php CHANGED
@@ -123,6 +123,13 @@ return apply_filters( 'wc_stripe_settings',
123
  'default' => '',
124
  'desc_tip' => true,
125
  ),
 
 
 
 
 
 
 
126
  'payment_request' => array(
127
  'title' => __( 'Payment Request Buttons', 'woocommerce-gateway-stripe' ),
128
  /* translators: 1) br tag 2) opening anchor tag 3) closing anchor tag */
123
  'default' => '',
124
  'desc_tip' => true,
125
  ),
126
+ 'stripe_checkout_description' => array(
127
+ 'title' => __( 'Stripe Checkout Description', 'woocommerce-gateway-stripe' ),
128
+ 'type' => 'text',
129
+ 'description' => __( 'Shows a description of your store on Stripe Modal Checkout.', 'woocommerce-gateway-stripe' ),
130
+ 'default' => '',
131
+ 'desc_tip' => true,
132
+ ),
133
  'payment_request' => array(
134
  'title' => __( 'Payment Request Buttons', 'woocommerce-gateway-stripe' ),
135
  /* translators: 1) br tag 2) opening anchor tag 3) closing anchor tag */
includes/class-wc-gateway-stripe.php CHANGED
@@ -37,6 +37,13 @@ class WC_Gateway_Stripe extends WC_Stripe_Payment_Gateway {
37
  */
38
  public $stripe_checkout;
39
 
 
 
 
 
 
 
 
40
  /**
41
  * Require 3D Secure enabled
42
  *
@@ -135,21 +142,22 @@ class WC_Gateway_Stripe extends WC_Stripe_Payment_Gateway {
135
  $this->init_settings();
136
 
137
  // Get setting values.
138
- $this->title = $this->get_option( 'title' );
139
- $this->description = $this->get_option( 'description' );
140
- $this->enabled = $this->get_option( 'enabled' );
141
- $this->testmode = 'yes' === $this->get_option( 'testmode' );
142
- $this->inline_cc_form = 'yes' === $this->get_option( 'inline_cc_form' );
143
- $this->capture = 'yes' === $this->get_option( 'capture', 'yes' );
144
- $this->statement_descriptor = WC_Stripe_Helper::clean_statement_descriptor( $this->get_option( 'statement_descriptor' ) );
145
- $this->three_d_secure = 'yes' === $this->get_option( 'three_d_secure' );
146
- $this->stripe_checkout = 'yes' === $this->get_option( 'stripe_checkout' );
147
- $this->stripe_checkout_image = $this->get_option( 'stripe_checkout_image', '' );
148
- $this->saved_cards = 'yes' === $this->get_option( 'saved_cards' );
149
- $this->secret_key = $this->testmode ? $this->get_option( 'test_secret_key' ) : $this->get_option( 'secret_key' );
150
- $this->publishable_key = $this->testmode ? $this->get_option( 'test_publishable_key' ) : $this->get_option( 'publishable_key' );
151
- $this->bitcoin = 'USD' === strtoupper( get_woocommerce_currency() ) && 'yes' === $this->get_option( 'stripe_bitcoin' );
152
- $this->payment_request = 'yes' === $this->get_option( 'payment_request', 'yes' );
 
153
 
154
  if ( $this->stripe_checkout ) {
155
  $this->order_button_text = __( 'Continue to payment', 'woocommerce-gateway-stripe' );
@@ -257,7 +265,7 @@ class WC_Gateway_Stripe extends WC_Stripe_Payment_Gateway {
257
  echo '<div
258
  id="stripe-payment-data"
259
  data-panel-label="' . esc_attr( $pay_button_text ) . '"
260
- data-description=""
261
  data-email="' . esc_attr( $user_email ) . '"
262
  data-amount="' . esc_attr( WC_Stripe_Helper::get_stripe_amount( $total ) ) . '"
263
  data-name="' . esc_attr( $this->statement_descriptor ) . '"
37
  */
38
  public $stripe_checkout;
39
 
40
+ /**
41
+ * Stripe Checkout description.
42
+ *
43
+ * @var string
44
+ */
45
+ public $stripe_checkout_description;
46
+
47
  /**
48
  * Require 3D Secure enabled
49
  *
142
  $this->init_settings();
143
 
144
  // Get setting values.
145
+ $this->title = $this->get_option( 'title' );
146
+ $this->description = $this->get_option( 'description' );
147
+ $this->enabled = $this->get_option( 'enabled' );
148
+ $this->testmode = 'yes' === $this->get_option( 'testmode' );
149
+ $this->inline_cc_form = 'yes' === $this->get_option( 'inline_cc_form' );
150
+ $this->capture = 'yes' === $this->get_option( 'capture', 'yes' );
151
+ $this->statement_descriptor = WC_Stripe_Helper::clean_statement_descriptor( $this->get_option( 'statement_descriptor' ) );
152
+ $this->three_d_secure = 'yes' === $this->get_option( 'three_d_secure' );
153
+ $this->stripe_checkout = 'yes' === $this->get_option( 'stripe_checkout' );
154
+ $this->stripe_checkout_image = $this->get_option( 'stripe_checkout_image', '' );
155
+ $this->stripe_checkout_description = $this->get_option( 'stripe_checkout_description' );
156
+ $this->saved_cards = 'yes' === $this->get_option( 'saved_cards' );
157
+ $this->secret_key = $this->testmode ? $this->get_option( 'test_secret_key' ) : $this->get_option( 'secret_key' );
158
+ $this->publishable_key = $this->testmode ? $this->get_option( 'test_publishable_key' ) : $this->get_option( 'publishable_key' );
159
+ $this->bitcoin = 'USD' === strtoupper( get_woocommerce_currency() ) && 'yes' === $this->get_option( 'stripe_bitcoin' );
160
+ $this->payment_request = 'yes' === $this->get_option( 'payment_request', 'yes' );
161
 
162
  if ( $this->stripe_checkout ) {
163
  $this->order_button_text = __( 'Continue to payment', 'woocommerce-gateway-stripe' );
265
  echo '<div
266
  id="stripe-payment-data"
267
  data-panel-label="' . esc_attr( $pay_button_text ) . '"
268
+ data-description="'. esc_attr( strip_tags( $this->stripe_checkout_description ) ) . '"
269
  data-email="' . esc_attr( $user_email ) . '"
270
  data-amount="' . esc_attr( WC_Stripe_Helper::get_stripe_amount( $total ) ) . '"
271
  data-name="' . esc_attr( $this->statement_descriptor ) . '"
languages/woocommerce-gateway-stripe.pot CHANGED
@@ -2,10 +2,10 @@
2
  # This file is distributed under the same license as the WooCommerce Stripe Gateway package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WooCommerce Stripe Gateway 4.0.5\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://github.com/woocommerce/woocommerce-gateway-stripe/issues\n"
8
- "POT-Creation-Date: 2018-02-20 16:36:16+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
@@ -51,7 +51,7 @@ msgid "Stripe charge complete (Charge ID: %s)"
51
  msgstr ""
52
 
53
  #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:321
54
- #: includes/class-wc-gateway-stripe.php:502
55
  #: includes/compat/class-wc-stripe-compat.php:100
56
  #: includes/payment-methods/class-wc-gateway-stripe-bitcoin.php:374
57
  msgid "Payment processing failed. Please retry."
@@ -64,20 +64,20 @@ msgid ""
64
  "cancel to remove the pre-authorization."
65
  msgstr ""
66
 
67
- #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:527
68
  msgid "Invalid payment method. Please input a new card number."
69
  msgstr ""
70
 
71
- #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:767
72
  #. translators: 1) dollar amount 2) transaction id 3) refund message
73
  msgid "Refunded %1$s - Refund ID: %2$s - Reason: %3$s"
74
  msgstr ""
75
 
76
- #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:767
77
  msgid "Pre-Authorization Released"
78
  msgstr ""
79
 
80
- #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:785
81
  msgid "There was a problem adding the card."
82
  msgstr ""
83
 
@@ -475,107 +475,115 @@ msgid ""
475
  msgstr ""
476
 
477
  #: includes/admin/stripe-settings.php:127
478
- msgid "Payment Request Buttons"
479
  msgstr ""
480
 
481
  #: includes/admin/stripe-settings.php:129
 
 
 
 
 
 
 
 
482
  #. translators: 1) br tag 2) opening anchor tag 3) closing anchor tag
483
  msgid ""
484
  "Enable Payment Request Buttons. (Apple Pay/Chrome Payment Request API) "
485
  "%1$sBy using Apple Pay, you agree to %2$s and %3$s's terms of service."
486
  msgstr ""
487
 
488
- #: includes/admin/stripe-settings.php:131
489
  msgid ""
490
  "If enabled, users will be able to pay using Apple Pay or Chrome Payment "
491
  "Request if supported by the browser."
492
  msgstr ""
493
 
494
- #: includes/admin/stripe-settings.php:136
495
  msgid "Payment Request Button Type"
496
  msgstr ""
497
 
498
- #: includes/admin/stripe-settings.php:137
499
  msgid "Button Type"
500
  msgstr ""
501
 
502
- #: includes/admin/stripe-settings.php:139
503
  msgid "Select the button type you would like to show."
504
  msgstr ""
505
 
506
- #: includes/admin/stripe-settings.php:143
507
  msgid "Default"
508
  msgstr ""
509
 
510
- #: includes/admin/stripe-settings.php:144
511
  msgid "Buy"
512
  msgstr ""
513
 
514
- #: includes/admin/stripe-settings.php:145
515
  msgid "Donate"
516
  msgstr ""
517
 
518
- #: includes/admin/stripe-settings.php:149
519
  msgid "Payment Request Button Theme"
520
  msgstr ""
521
 
522
- #: includes/admin/stripe-settings.php:150
523
  msgid "Button Theme"
524
  msgstr ""
525
 
526
- #: includes/admin/stripe-settings.php:152
527
  msgid "Select the button theme you would like to show."
528
  msgstr ""
529
 
530
- #: includes/admin/stripe-settings.php:156
531
  msgid "Dark"
532
  msgstr ""
533
 
534
- #: includes/admin/stripe-settings.php:157
535
  msgid "Light"
536
  msgstr ""
537
 
538
- #: includes/admin/stripe-settings.php:158
539
  msgid "Light-Outline"
540
  msgstr ""
541
 
542
- #: includes/admin/stripe-settings.php:162
543
  msgid "Payment Request Button Height"
544
  msgstr ""
545
 
546
- #: includes/admin/stripe-settings.php:163
547
  msgid "Button Height"
548
  msgstr ""
549
 
550
- #: includes/admin/stripe-settings.php:165
551
  msgid ""
552
  "Enter the height you would like the button to be in pixels. Width will "
553
  "always be 100%."
554
  msgstr ""
555
 
556
- #: includes/admin/stripe-settings.php:170
557
  msgid "Saved Cards"
558
  msgstr ""
559
 
560
- #: includes/admin/stripe-settings.php:171
561
  msgid "Enable Payment via Saved Cards"
562
  msgstr ""
563
 
564
- #: includes/admin/stripe-settings.php:173
565
  msgid ""
566
  "If enabled, users will be able to pay with a saved card during checkout. "
567
  "Card details are saved on Stripe servers, not on your store."
568
  msgstr ""
569
 
570
- #: includes/admin/stripe-settings.php:178
571
  msgid "Logging"
572
  msgstr ""
573
 
574
- #: includes/admin/stripe-settings.php:179
575
  msgid "Log debug messages"
576
  msgstr ""
577
 
578
- #: includes/admin/stripe-settings.php:181
579
  msgid "Save debug messages to the WooCommerce System Status log."
580
  msgstr ""
581
 
@@ -601,11 +609,11 @@ msgstr ""
601
  msgid "You will be redirected to SOFORT."
602
  msgstr ""
603
 
604
- #: includes/class-wc-gateway-stripe.php:109
605
  msgid "Stripe"
606
  msgstr ""
607
 
608
- #: includes/class-wc-gateway-stripe.php:111
609
  #. translators: 1) link to Stripe register page 2) link to Stripe api keys page
610
  msgid ""
611
  "Stripe works by adding payment fields on the checkout and then sending the "
@@ -614,15 +622,15 @@ msgid ""
614
  "your Stripe account keys</a>."
615
  msgstr ""
616
 
617
- #: includes/class-wc-gateway-stripe.php:155
618
  msgid "Continue to payment"
619
  msgstr ""
620
 
621
- #: includes/class-wc-gateway-stripe.php:251
622
  msgid "Add Card"
623
  msgstr ""
624
 
625
- #: includes/class-wc-gateway-stripe.php:274
626
  #. translators: link to Stripe testing page
627
  msgid ""
628
  "TEST MODE ENABLED. In test mode, you can use the card number "
@@ -631,54 +639,54 @@ msgid ""
631
  "more card numbers."
632
  msgstr ""
633
 
634
- #: includes/class-wc-gateway-stripe.php:315
635
  msgid "Credit or debit card"
636
  msgstr ""
637
 
638
- #: includes/class-wc-gateway-stripe.php:323
639
  msgid "Card Number"
640
  msgstr ""
641
 
642
- #: includes/class-wc-gateway-stripe.php:331
643
  msgid "Expiry Date"
644
  msgstr ""
645
 
646
- #: includes/class-wc-gateway-stripe.php:339
647
  msgid "Card Code (CVC)"
648
  msgstr ""
649
 
650
- #: includes/class-wc-gateway-stripe.php:412
651
  msgid "Please accept the terms and conditions first"
652
  msgstr ""
653
 
654
- #: includes/class-wc-gateway-stripe.php:413
655
  msgid "Please fill in required checkout fields first"
656
  msgstr ""
657
 
658
- #: includes/class-wc-gateway-stripe.php:431
659
- #: includes/class-wc-gateway-stripe.php:497
660
  #: includes/compat/class-wc-stripe-compat.php:95
661
  msgid ""
662
  "Sorry, we're not accepting prepaid cards at this time. Your credit card has "
663
  "not been charge. Please try with alternative payment method."
664
  msgstr ""
665
 
666
- #: includes/class-wc-gateway-stripe.php:432
667
  msgid "Please enter your IBAN account name."
668
  msgstr ""
669
 
670
- #: includes/class-wc-gateway-stripe.php:433
671
  msgid "Please enter your IBAN account number."
672
  msgstr ""
673
 
674
- #: includes/class-wc-gateway-stripe.php:578
675
  #: includes/class-wc-stripe-order-handler.php:143
676
  #: includes/class-wc-stripe-webhook-handler.php:207
677
  #: includes/payment-methods/class-wc-gateway-stripe-sepa.php:377
678
  msgid "This card is no longer available and has been removed."
679
  msgstr ""
680
 
681
- #: includes/class-wc-gateway-stripe.php:598
682
  #: includes/class-wc-stripe-order-handler.php:161
683
  #: includes/class-wc-stripe-webhook-handler.php:184
684
  #: includes/payment-methods/class-wc-gateway-stripe-sepa.php:397
@@ -689,25 +697,25 @@ msgstr ""
689
  msgid "There was a problem connecting to the Stripe API endpoint."
690
  msgstr ""
691
 
692
- #: includes/class-wc-stripe-apple-pay-registration.php:122
693
  msgid "Unable to verify domain - missing secret key."
694
  msgstr ""
695
 
696
- #: includes/class-wc-stripe-apple-pay-registration.php:143
697
- #: includes/class-wc-stripe-apple-pay-registration.php:152
698
  #. translators: error message
699
  msgid "Unable to verify domain - %s"
700
  msgstr ""
701
 
702
- #: includes/class-wc-stripe-apple-pay-registration.php:175
703
  msgid "Unable to create domain association folder to domain root."
704
  msgstr ""
705
 
706
- #: includes/class-wc-stripe-apple-pay-registration.php:181
707
  msgid "Unable to copy domain association file to domain root."
708
  msgstr ""
709
 
710
- #: includes/class-wc-stripe-apple-pay-registration.php:234
711
  #. translators: 1) HTML anchor open tag 2) HTML anchor closing tag
712
  msgid ""
713
  "Apple Pay domain verification failed. Please check the %1$slog%2$s to see "
2
  # This file is distributed under the same license as the WooCommerce Stripe Gateway package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: WooCommerce Stripe Gateway 4.0.7\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://github.com/woocommerce/woocommerce-gateway-stripe/issues\n"
8
+ "POT-Creation-Date: 2018-02-23 14:39:05+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
51
  msgstr ""
52
 
53
  #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:321
54
+ #: includes/class-wc-gateway-stripe.php:510
55
  #: includes/compat/class-wc-stripe-compat.php:100
56
  #: includes/payment-methods/class-wc-gateway-stripe-bitcoin.php:374
57
  msgid "Payment processing failed. Please retry."
64
  "cancel to remove the pre-authorization."
65
  msgstr ""
66
 
67
+ #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:528
68
  msgid "Invalid payment method. Please input a new card number."
69
  msgstr ""
70
 
71
+ #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:770
72
  #. translators: 1) dollar amount 2) transaction id 3) refund message
73
  msgid "Refunded %1$s - Refund ID: %2$s - Reason: %3$s"
74
  msgstr ""
75
 
76
+ #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:770
77
  msgid "Pre-Authorization Released"
78
  msgstr ""
79
 
80
+ #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:788
81
  msgid "There was a problem adding the card."
82
  msgstr ""
83
 
475
  msgstr ""
476
 
477
  #: includes/admin/stripe-settings.php:127
478
+ msgid "Stripe Checkout Description"
479
  msgstr ""
480
 
481
  #: includes/admin/stripe-settings.php:129
482
+ msgid "Shows a description of your store on Stripe Modal Checkout."
483
+ msgstr ""
484
+
485
+ #: includes/admin/stripe-settings.php:134
486
+ msgid "Payment Request Buttons"
487
+ msgstr ""
488
+
489
+ #: includes/admin/stripe-settings.php:136
490
  #. translators: 1) br tag 2) opening anchor tag 3) closing anchor tag
491
  msgid ""
492
  "Enable Payment Request Buttons. (Apple Pay/Chrome Payment Request API) "
493
  "%1$sBy using Apple Pay, you agree to %2$s and %3$s's terms of service."
494
  msgstr ""
495
 
496
+ #: includes/admin/stripe-settings.php:138
497
  msgid ""
498
  "If enabled, users will be able to pay using Apple Pay or Chrome Payment "
499
  "Request if supported by the browser."
500
  msgstr ""
501
 
502
+ #: includes/admin/stripe-settings.php:143
503
  msgid "Payment Request Button Type"
504
  msgstr ""
505
 
506
+ #: includes/admin/stripe-settings.php:144
507
  msgid "Button Type"
508
  msgstr ""
509
 
510
+ #: includes/admin/stripe-settings.php:146
511
  msgid "Select the button type you would like to show."
512
  msgstr ""
513
 
514
+ #: includes/admin/stripe-settings.php:150
515
  msgid "Default"
516
  msgstr ""
517
 
518
+ #: includes/admin/stripe-settings.php:151
519
  msgid "Buy"
520
  msgstr ""
521
 
522
+ #: includes/admin/stripe-settings.php:152
523
  msgid "Donate"
524
  msgstr ""
525
 
526
+ #: includes/admin/stripe-settings.php:156
527
  msgid "Payment Request Button Theme"
528
  msgstr ""
529
 
530
+ #: includes/admin/stripe-settings.php:157
531
  msgid "Button Theme"
532
  msgstr ""
533
 
534
+ #: includes/admin/stripe-settings.php:159
535
  msgid "Select the button theme you would like to show."
536
  msgstr ""
537
 
538
+ #: includes/admin/stripe-settings.php:163
539
  msgid "Dark"
540
  msgstr ""
541
 
542
+ #: includes/admin/stripe-settings.php:164
543
  msgid "Light"
544
  msgstr ""
545
 
546
+ #: includes/admin/stripe-settings.php:165
547
  msgid "Light-Outline"
548
  msgstr ""
549
 
550
+ #: includes/admin/stripe-settings.php:169
551
  msgid "Payment Request Button Height"
552
  msgstr ""
553
 
554
+ #: includes/admin/stripe-settings.php:170
555
  msgid "Button Height"
556
  msgstr ""
557
 
558
+ #: includes/admin/stripe-settings.php:172
559
  msgid ""
560
  "Enter the height you would like the button to be in pixels. Width will "
561
  "always be 100%."
562
  msgstr ""
563
 
564
+ #: includes/admin/stripe-settings.php:177
565
  msgid "Saved Cards"
566
  msgstr ""
567
 
568
+ #: includes/admin/stripe-settings.php:178
569
  msgid "Enable Payment via Saved Cards"
570
  msgstr ""
571
 
572
+ #: includes/admin/stripe-settings.php:180
573
  msgid ""
574
  "If enabled, users will be able to pay with a saved card during checkout. "
575
  "Card details are saved on Stripe servers, not on your store."
576
  msgstr ""
577
 
578
+ #: includes/admin/stripe-settings.php:185
579
  msgid "Logging"
580
  msgstr ""
581
 
582
+ #: includes/admin/stripe-settings.php:186
583
  msgid "Log debug messages"
584
  msgstr ""
585
 
586
+ #: includes/admin/stripe-settings.php:188
587
  msgid "Save debug messages to the WooCommerce System Status log."
588
  msgstr ""
589
 
609
  msgid "You will be redirected to SOFORT."
610
  msgstr ""
611
 
612
+ #: includes/class-wc-gateway-stripe.php:116
613
  msgid "Stripe"
614
  msgstr ""
615
 
616
+ #: includes/class-wc-gateway-stripe.php:118
617
  #. translators: 1) link to Stripe register page 2) link to Stripe api keys page
618
  msgid ""
619
  "Stripe works by adding payment fields on the checkout and then sending the "
622
  "your Stripe account keys</a>."
623
  msgstr ""
624
 
625
+ #: includes/class-wc-gateway-stripe.php:163
626
  msgid "Continue to payment"
627
  msgstr ""
628
 
629
+ #: includes/class-wc-gateway-stripe.php:259
630
  msgid "Add Card"
631
  msgstr ""
632
 
633
+ #: includes/class-wc-gateway-stripe.php:282
634
  #. translators: link to Stripe testing page
635
  msgid ""
636
  "TEST MODE ENABLED. In test mode, you can use the card number "
639
  "more card numbers."
640
  msgstr ""
641
 
642
+ #: includes/class-wc-gateway-stripe.php:323
643
  msgid "Credit or debit card"
644
  msgstr ""
645
 
646
+ #: includes/class-wc-gateway-stripe.php:331
647
  msgid "Card Number"
648
  msgstr ""
649
 
650
+ #: includes/class-wc-gateway-stripe.php:339
651
  msgid "Expiry Date"
652
  msgstr ""
653
 
654
+ #: includes/class-wc-gateway-stripe.php:347
655
  msgid "Card Code (CVC)"
656
  msgstr ""
657
 
658
+ #: includes/class-wc-gateway-stripe.php:420
659
  msgid "Please accept the terms and conditions first"
660
  msgstr ""
661
 
662
+ #: includes/class-wc-gateway-stripe.php:421
663
  msgid "Please fill in required checkout fields first"
664
  msgstr ""
665
 
666
+ #: includes/class-wc-gateway-stripe.php:439
667
+ #: includes/class-wc-gateway-stripe.php:505
668
  #: includes/compat/class-wc-stripe-compat.php:95
669
  msgid ""
670
  "Sorry, we're not accepting prepaid cards at this time. Your credit card has "
671
  "not been charge. Please try with alternative payment method."
672
  msgstr ""
673
 
674
+ #: includes/class-wc-gateway-stripe.php:440
675
  msgid "Please enter your IBAN account name."
676
  msgstr ""
677
 
678
+ #: includes/class-wc-gateway-stripe.php:441
679
  msgid "Please enter your IBAN account number."
680
  msgstr ""
681
 
682
+ #: includes/class-wc-gateway-stripe.php:586
683
  #: includes/class-wc-stripe-order-handler.php:143
684
  #: includes/class-wc-stripe-webhook-handler.php:207
685
  #: includes/payment-methods/class-wc-gateway-stripe-sepa.php:377
686
  msgid "This card is no longer available and has been removed."
687
  msgstr ""
688
 
689
+ #: includes/class-wc-gateway-stripe.php:606
690
  #: includes/class-wc-stripe-order-handler.php:161
691
  #: includes/class-wc-stripe-webhook-handler.php:184
692
  #: includes/payment-methods/class-wc-gateway-stripe-sepa.php:397
697
  msgid "There was a problem connecting to the Stripe API endpoint."
698
  msgstr ""
699
 
700
+ #: includes/class-wc-stripe-apple-pay-registration.php:127
701
  msgid "Unable to verify domain - missing secret key."
702
  msgstr ""
703
 
704
+ #: includes/class-wc-stripe-apple-pay-registration.php:148
705
+ #: includes/class-wc-stripe-apple-pay-registration.php:157
706
  #. translators: error message
707
  msgid "Unable to verify domain - %s"
708
  msgstr ""
709
 
710
+ #: includes/class-wc-stripe-apple-pay-registration.php:180
711
  msgid "Unable to create domain association folder to domain root."
712
  msgstr ""
713
 
714
+ #: includes/class-wc-stripe-apple-pay-registration.php:186
715
  msgid "Unable to copy domain association file to domain root."
716
  msgstr ""
717
 
718
+ #: includes/class-wc-stripe-apple-pay-registration.php:239
719
  #. translators: 1) HTML anchor open tag 2) HTML anchor closing tag
720
  msgid ""
721
  "Apple Pay domain verification failed. Please check the %1$slog%2$s to see "
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: credit card, stripe, apple pay, payment request, google pay, sepa, sofort,
4
  Requires at least: 4.4
5
  Tested up to: 4.9
6
  Requires PHP: 5.6
7
- Stable tag: 4.0.6
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
  Attributions: thorsten-stripe
@@ -105,21 +105,10 @@ We will completely remove the older form by version 4.1.0.
105
 
106
  == Changelog ==
107
 
108
- = 4.0.6 - 2018-02-20 =
109
- * Fix - A WC 2.6 backwards compat issue with function from WC 3.0.
110
- * Fix - Subs renewal sometimes failed due to parameters being different.
111
- * Fix - Stripe accepts only NO for Norwegian language on Stripe Checkout.
112
- * Fix - Refund fees may not accurately reflect net fees. Props @rvola.
113
- * Fix - Undefined SERVERNAME property in some cases.
114
- * Fix - Potential issue when a charge parameter changes due to initial failed request causing retries to fail.
115
- * Fix - When 3DS is not required, failed payments was not change order status to failed.
116
- * Fix - Potential duplicate order processes on WC side when webhook and redirect has a race condition.
117
- * Remove - Checkout validation and let WC handle it.
118
- * Update - Stripe API version to 2018-02-06.
119
- * Add - Webhooks for review open/closed for Radar.
120
- * Add - Hook `wc_stripe_refund_request` for refund request arguments.
121
- * Add - Hook `wc_stripe_validate_modal_checkout` to enable 3rd party checkout validation.
122
- * Add - Hook `wc_stripe_validate_modal_checkout_action` to enable 3rd party checkout validation.
123
 
124
  [See changelog for all versions](https://raw.githubusercontent.com/woothemes/woocommerce-gateway-stripe/master/changelog.txt).
125
 
4
  Requires at least: 4.4
5
  Tested up to: 4.9
6
  Requires PHP: 5.6
7
+ Stable tag: 4.0.7
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
  Attributions: thorsten-stripe
105
 
106
  == Changelog ==
107
 
108
+ = 4.0.7 - 2018-02-23 =
109
+ * Fix - Potential conflict issue when adding payment method from another payment gateway.
110
+ * Fix - Issue when using saved card before sources were introduced.
111
+ * Add - Description field/setting for Stripe Checkout Modal/popup.
 
 
 
 
 
 
 
 
 
 
 
112
 
113
  [See changelog for all versions](https://raw.githubusercontent.com/woothemes/woocommerce-gateway-stripe/master/changelog.txt).
114
 
woocommerce-gateway-stripe.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: Take credit card payments on your store using Stripe.
6
  * Author: WooCommerce
7
  * Author URI: https://woocommerce.com/
8
- * Version: 4.0.6
9
  * Requires at least: 4.4
10
  * Tested up to: 4.9
11
  * WC requires at least: 2.6
@@ -23,7 +23,7 @@ if ( ! class_exists( 'WC_Stripe' ) ) :
23
  /**
24
  * Required minimums and constants
25
  */
26
- define( 'WC_STRIPE_VERSION', '4.0.6' );
27
  define( 'WC_STRIPE_MIN_PHP_VER', '5.6.0' );
28
  define( 'WC_STRIPE_MIN_WC_VER', '2.6.0' );
29
  define( 'WC_STRIPE_MAIN_FILE', __FILE__ );
5
  * Description: Take credit card payments on your store using Stripe.
6
  * Author: WooCommerce
7
  * Author URI: https://woocommerce.com/
8
+ * Version: 4.0.7
9
  * Requires at least: 4.4
10
  * Tested up to: 4.9
11
  * WC requires at least: 2.6
23
  /**
24
  * Required minimums and constants
25
  */
26
+ define( 'WC_STRIPE_VERSION', '4.0.7' );
27
  define( 'WC_STRIPE_MIN_PHP_VER', '5.6.0' );
28
  define( 'WC_STRIPE_MIN_WC_VER', '2.6.0' );
29
  define( 'WC_STRIPE_MAIN_FILE', __FILE__ );