Payment Plugins for Stripe WooCommerce - Version 3.2.8

Version Description

  • Updated - Changed function wc_stripe to stripe_wc because WooCommerce Stripe Payment Gateway introduced a function with same name in version 4.5.4 which caused a fatal error.
  • Updated - Apple Pay and GPay - if billing address already populated, don't request it in wallet.
  • Updated - Convert long version of state/province for GPay to abbreviation. California
Download this release

Release Info

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

Code changes from version 3.2.7 to 3.2.8

Files changed (114) hide show
  1. assets/css/stripe-rtl.css +52 -4
  2. assets/css/stripe.css +52 -4
  3. assets/css/stripe.min-rtl.css +1 -1
  4. assets/css/stripe.min.css +1 -1
  5. assets/js/frontend/applepay-checkout.js +7 -0
  6. assets/js/frontend/local-payment.js +225 -30
  7. assets/js/frontend/local-payment.min.js +1 -0
  8. assets/js/frontend/payment-request.js +7 -0
  9. assets/js/frontend/wc-stripe.js +13 -2
  10. assets/js/frontend/wc-stripe.min.js +1 -1
  11. i18n/languages/woo-stripe-payment.pot +85 -87
  12. includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php +5 -4
  13. includes/abstract/abstract-wc-payment-gateway-stripe.php +24 -23
  14. includes/abstract/abstract-wc-stripe-rest-controller.php +104 -104
  15. includes/admin/class-wc-stripe-admin-assets.php +13 -13
  16. includes/admin/class-wc-stripe-admin-notices.php +3 -3
  17. includes/admin/class-wc-stripe-admin-user-edit.php +109 -109
  18. includes/admin/meta-boxes/class-wc-stripe-admin-order-metaboxes.php +10 -10
  19. includes/admin/settings/class-wc-stripe-api-settings.php +191 -191
  20. includes/admin/views/html-settings-nav.php +1 -1
  21. includes/class-stripe.php +32 -4
  22. includes/class-wc-stripe-frontend-notices.php +58 -58
  23. includes/class-wc-stripe-frontend-scripts.php +5 -5
  24. includes/class-wc-stripe-gateway.php +444 -444
  25. includes/class-wc-stripe-install.php +40 -40
  26. includes/class-wc-stripe-payment-charge-local.php +4 -1
  27. includes/class-wc-stripe-redirect-handler.php +7 -5
  28. includes/class-wc-stripe-rest-api.php +9 -6
  29. includes/class-wc-stripe-update.php +69 -68
  30. includes/controllers/class-wc-stripe-controller-checkout.php +0 -28
  31. includes/controllers/class-wc-stripe-controller-gateway-settings.php +3 -3
  32. includes/controllers/class-wc-stripe-controller-order-actions.php +1 -1
  33. includes/controllers/class-wc-stripe-controller-source.php +88 -0
  34. includes/controllers/class-wc-stripe-controller-webhook.php +61 -61
  35. includes/gateways/class-wc-payment-gateway-stripe-ach.php +3 -3
  36. includes/gateways/class-wc-payment-gateway-stripe-alipay.php +63 -63
  37. includes/gateways/class-wc-payment-gateway-stripe-applepay.php +4 -4
  38. includes/gateways/class-wc-payment-gateway-stripe-bancontact.php +33 -33
  39. includes/gateways/class-wc-payment-gateway-stripe-becs.php +40 -40
  40. includes/gateways/class-wc-payment-gateway-stripe-cc.php +10 -9
  41. includes/gateways/class-wc-payment-gateway-stripe-eps.php +32 -32
  42. includes/gateways/class-wc-payment-gateway-stripe-fpx.php +39 -39
  43. includes/gateways/class-wc-payment-gateway-stripe-giropay.php +32 -32
  44. includes/gateways/class-wc-payment-gateway-stripe-googlepay.php +8 -8
  45. includes/gateways/class-wc-payment-gateway-stripe-grabpay.php +32 -32
  46. includes/gateways/class-wc-payment-gateway-stripe-ideal.php +32 -32
  47. includes/gateways/class-wc-payment-gateway-stripe-klarna.php +75 -88
  48. includes/gateways/class-wc-payment-gateway-stripe-multibanco.php +32 -32
  49. includes/gateways/class-wc-payment-gateway-stripe-p24.php +32 -32
  50. includes/gateways/class-wc-payment-gateway-stripe-payment-request.php +2 -2
  51. includes/gateways/class-wc-payment-gateway-stripe-sepa.php +1 -1
  52. includes/gateways/class-wc-payment-gateway-stripe-sofort.php +37 -37
  53. includes/gateways/class-wc-payment-gateway-stripe-wechat.php +73 -73
  54. includes/gateways/settings/ach-settings-v2.php +0 -115
  55. includes/gateways/settings/applepay-settings.php +126 -126
  56. includes/traits/wc-stripe-settings-trait.php +5 -5
  57. includes/updates/update-3.0.7.php +38 -38
  58. includes/updates/update-3.1.0.php +55 -55
  59. includes/updates/update-3.1.6.php +1 -1
  60. includes/updates/update-3.1.7.php +2 -2
  61. includes/updates/update-3.2.8.php +34 -0
  62. includes/wc-stripe-functions.php +13 -13
  63. readme.txt +6 -1
  64. stripe-payments.php +1 -1
  65. templates/card-icons.php +5 -5
  66. templates/cc-forms/minimalist.php +1 -1
  67. templates/payment-request-icons.php +3 -3
  68. vendor/composer/installed.json +7 -7
  69. vendor/stripe/stripe-php/CHANGELOG.md +33 -0
  70. vendor/stripe/stripe-php/VERSION +1 -1
  71. vendor/stripe/stripe-php/init.php +2 -0
  72. vendor/stripe/stripe-php/lib/Account.php +1 -1
  73. vendor/stripe/stripe-php/lib/ApiRequestor.php +39 -1
  74. vendor/stripe/stripe-php/lib/ApplicationFeeRefund.php +1 -1
  75. vendor/stripe/stripe-php/lib/Balance.php +1 -0
  76. vendor/stripe/stripe-php/lib/BalanceTransaction.php +2 -1
  77. vendor/stripe/stripe-php/lib/BitcoinReceiver.php +1 -1
  78. vendor/stripe/stripe-php/lib/Card.php +3 -3
  79. vendor/stripe/stripe-php/lib/Charge.php +2 -1
  80. vendor/stripe/stripe-php/lib/Checkout/Session.php +1 -1
  81. vendor/stripe/stripe-php/lib/Coupon.php +1 -1
  82. vendor/stripe/stripe-php/lib/CreditNote.php +5 -5
  83. vendor/stripe/stripe-php/lib/CreditNoteLineItem.php +2 -2
  84. vendor/stripe/stripe-php/lib/Customer.php +1 -1
  85. vendor/stripe/stripe-php/lib/ErrorObject.php +3 -0
  86. vendor/stripe/stripe-php/lib/Event.php +19 -0
  87. vendor/stripe/stripe-php/lib/Invoice.php +3 -2
  88. vendor/stripe/stripe-php/lib/InvoiceItem.php +2 -2
  89. vendor/stripe/stripe-php/lib/Order.php +1 -1
  90. vendor/stripe/stripe-php/lib/PaymentIntent.php +1 -1
  91. vendor/stripe/stripe-php/lib/PaymentMethod.php +2 -1
  92. vendor/stripe/stripe-php/lib/Payout.php +25 -6
  93. vendor/stripe/stripe-php/lib/Plan.php +1 -1
  94. vendor/stripe/stripe-php/lib/PromotionCode.php +1 -1
  95. vendor/stripe/stripe-php/lib/Refund.php +1 -1
  96. vendor/stripe/stripe-php/lib/Service/CoreServiceFactory.php +2 -0
  97. vendor/stripe/stripe-php/lib/Service/CustomerService.php +6 -6
  98. vendor/stripe/stripe-php/lib/Service/InvoiceService.php +6 -3
  99. vendor/stripe/stripe-php/lib/Service/PayoutService.php +23 -0
  100. vendor/stripe/stripe-php/lib/Service/SetupAttemptService.php +23 -0
  101. vendor/stripe/stripe-php/lib/Service/SubscriptionScheduleService.php +1 -1
  102. vendor/stripe/stripe-php/lib/Service/SubscriptionService.php +1 -1
  103. vendor/stripe/stripe-php/lib/SetupAttempt.php +32 -0
  104. vendor/stripe/stripe-php/lib/SetupIntent.php +2 -1
  105. vendor/stripe/stripe-php/lib/Source.php +1 -1
  106. vendor/stripe/stripe-php/lib/Stripe.php +1 -1
  107. vendor/stripe/stripe-php/lib/StripeClient.php +1 -0
  108. vendor/stripe/stripe-php/lib/StripeObject.php +4 -6
  109. vendor/stripe/stripe-php/lib/Subscription.php +3 -3
  110. vendor/stripe/stripe-php/lib/TaxId.php +3 -1
  111. vendor/stripe/stripe-php/lib/TaxRate.php +2 -2
  112. vendor/stripe/stripe-php/lib/TransferReversal.php +1 -1
  113. vendor/stripe/stripe-php/lib/Util/ObjectTypes.php +1 -0
  114. vendor/stripe/stripe-php/lib/Util/Util.php +1 -1
assets/css/stripe-rtl.css CHANGED
@@ -312,7 +312,9 @@ li.payment_method_stripe_payment_request {
312
  }
313
 
314
  .wc_stripe_product_payment_methods .gpay-button,
315
- .wc_stripe_cart_payment_methods .gpay-button {
 
 
316
  width: 100% !important;
317
  margin: 0;
318
  }
@@ -405,10 +407,12 @@ li.payment_method_stripe_ach label:first-of-type img {
405
 
406
  .apple-pay-button-black {
407
  -apple-pay-button-style: black;
 
408
  }
409
 
410
  .apple-pay-button-white {
411
  -apple-pay-button-style: white;
 
412
  }
413
 
414
  .apple-pay-button-white-with-line {
@@ -482,11 +486,13 @@ li.payment_method_stripe_ach label:first-of-type img {
482
  display: none;
483
  }
484
 
485
- .wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways li.wc-stripe-checkout-banner-gateway .gpay-button {
 
486
  margin: 0;
487
  }
488
 
489
- .wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways .gpay-button {
 
490
  width: 100%;
491
  }
492
 
@@ -783,6 +789,7 @@ li.payment_method_stripe_wechat {
783
  border: none;
784
  }
785
  a.wc-stripe-gpay-mini-cart .gpay-button,
 
786
  a.wc-stripe-applepay-mini-cart .apple-pay-button{
787
  width: 100%;
788
  margin: 0;
@@ -808,4 +815,45 @@ a.wc-stripe-applepay-mini-cart .apple-pay-button{
808
  .widget_shopping_cart_content .wc-stripe-overlay.active{
809
  display: block !important;
810
  z-index: 9999;
811
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
312
  }
313
 
314
  .wc_stripe_product_payment_methods .gpay-button,
315
+ .wc_stripe_cart_payment_methods .gpay-button,
316
+ .wc_stripe_product_payment_methods .gpay-card-info-container,
317
+ .wc_stripe_cart_payment_methods .gpay-card-info-container{
318
  width: 100% !important;
319
  margin: 0;
320
  }
407
 
408
  .apple-pay-button-black {
409
  -apple-pay-button-style: black;
410
+ background-color: black !important;
411
  }
412
 
413
  .apple-pay-button-white {
414
  -apple-pay-button-style: white;
415
+ background-color: white !important;
416
  }
417
 
418
  .apple-pay-button-white-with-line {
486
  display: none;
487
  }
488
 
489
+ .wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways li.wc-stripe-checkout-banner-gateway .gpay-button,
490
+ .wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways li.wc-stripe-checkout-banner-gateway .gpay-card-info-container{
491
  margin: 0;
492
  }
493
 
494
+ .wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways .gpay-button,
495
+ .wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways .gpay-card-info-container{
496
  width: 100%;
497
  }
498
 
789
  border: none;
790
  }
791
  a.wc-stripe-gpay-mini-cart .gpay-button,
792
+ a.wc-stripe-gpay-mini-cart .gpay-card-info-container
793
  a.wc-stripe-applepay-mini-cart .apple-pay-button{
794
  width: 100%;
795
  margin: 0;
815
  .widget_shopping_cart_content .wc-stripe-overlay.active{
816
  display: block !important;
817
  z-index: 9999;
818
+ }
819
+
820
+ .wc-stripe-klarna-loader {
821
+ display: flex;
822
+ justify-content: center;
823
+ position: relative;
824
+ width: 100%;
825
+ height: 30px;
826
+ box-sizing: border-box;
827
+ transform: scale(.65);
828
+ }
829
+ .wc-stripe-klarna-loader div {
830
+ box-sizing: border-box;
831
+ display: block;
832
+ position: absolute;
833
+ box-sizing: border-box;
834
+ width: 30px;
835
+ height: 30px;
836
+ border: 3px solid #000;
837
+ border-radius: 50%;
838
+ animation: klarna-payments-loader 1.3s cubic-bezier(0.5, 0, 0.5, 1) infinite;
839
+ border-color: #000 transparent transparent transparent;
840
+ }
841
+ .wc-stripe-klarna-loader div:nth-child(1) {
842
+ animation-delay: -0.45s;
843
+ }
844
+ .wc-stripe-klarna-loader div:nth-child(2) {
845
+ animation-delay: -0.3s;
846
+ }
847
+ .wc-stripe-klarna-loader div:nth-child(3) {
848
+ animation-delay: -0.15s;
849
+ }
850
+ @keyframes klarna-payments-loader {
851
+ 0% {
852
+ transform: rotate(0deg);
853
+ }
854
+ 100% {
855
+ transform: rotate(-360deg);
856
+ }
857
+ }
858
+
859
+
assets/css/stripe.css CHANGED
@@ -312,7 +312,9 @@ li.payment_method_stripe_payment_request {
312
  }
313
 
314
  .wc_stripe_product_payment_methods .gpay-button,
315
- .wc_stripe_cart_payment_methods .gpay-button {
 
 
316
  width: 100% !important;
317
  margin: 0;
318
  }
@@ -405,10 +407,12 @@ li.payment_method_stripe_ach label:first-of-type img {
405
 
406
  .apple-pay-button-black {
407
  -apple-pay-button-style: black;
 
408
  }
409
 
410
  .apple-pay-button-white {
411
  -apple-pay-button-style: white;
 
412
  }
413
 
414
  .apple-pay-button-white-with-line {
@@ -482,11 +486,13 @@ li.payment_method_stripe_ach label:first-of-type img {
482
  display: none;
483
  }
484
 
485
- .wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways li.wc-stripe-checkout-banner-gateway .gpay-button {
 
486
  margin: 0;
487
  }
488
 
489
- .wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways .gpay-button {
 
490
  width: 100%;
491
  }
492
 
@@ -783,6 +789,7 @@ li.payment_method_stripe_wechat {
783
  border: none;
784
  }
785
  a.wc-stripe-gpay-mini-cart .gpay-button,
 
786
  a.wc-stripe-applepay-mini-cart .apple-pay-button{
787
  width: 100%;
788
  margin: 0;
@@ -808,4 +815,45 @@ a.wc-stripe-applepay-mini-cart .apple-pay-button{
808
  .widget_shopping_cart_content .wc-stripe-overlay.active{
809
  display: block !important;
810
  z-index: 9999;
811
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
312
  }
313
 
314
  .wc_stripe_product_payment_methods .gpay-button,
315
+ .wc_stripe_cart_payment_methods .gpay-button,
316
+ .wc_stripe_product_payment_methods .gpay-card-info-container,
317
+ .wc_stripe_cart_payment_methods .gpay-card-info-container{
318
  width: 100% !important;
319
  margin: 0;
320
  }
407
 
408
  .apple-pay-button-black {
409
  -apple-pay-button-style: black;
410
+ background-color: black !important;
411
  }
412
 
413
  .apple-pay-button-white {
414
  -apple-pay-button-style: white;
415
+ background-color: white !important;
416
  }
417
 
418
  .apple-pay-button-white-with-line {
486
  display: none;
487
  }
488
 
489
+ .wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways li.wc-stripe-checkout-banner-gateway .gpay-button,
490
+ .wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways li.wc-stripe-checkout-banner-gateway .gpay-card-info-container{
491
  margin: 0;
492
  }
493
 
494
+ .wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways .gpay-button,
495
+ .wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways .gpay-card-info-container{
496
  width: 100%;
497
  }
498
 
789
  border: none;
790
  }
791
  a.wc-stripe-gpay-mini-cart .gpay-button,
792
+ a.wc-stripe-gpay-mini-cart .gpay-card-info-container
793
  a.wc-stripe-applepay-mini-cart .apple-pay-button{
794
  width: 100%;
795
  margin: 0;
815
  .widget_shopping_cart_content .wc-stripe-overlay.active{
816
  display: block !important;
817
  z-index: 9999;
818
+ }
819
+
820
+ .wc-stripe-klarna-loader {
821
+ display: flex;
822
+ justify-content: center;
823
+ position: relative;
824
+ width: 100%;
825
+ height: 30px;
826
+ box-sizing: border-box;
827
+ transform: scale(.65);
828
+ }
829
+ .wc-stripe-klarna-loader div {
830
+ box-sizing: border-box;
831
+ display: block;
832
+ position: absolute;
833
+ box-sizing: border-box;
834
+ width: 30px;
835
+ height: 30px;
836
+ border: 3px solid #000;
837
+ border-radius: 50%;
838
+ animation: klarna-payments-loader 1.3s cubic-bezier(0.5, 0, 0.5, 1) infinite;
839
+ border-color: #000 transparent transparent transparent;
840
+ }
841
+ .wc-stripe-klarna-loader div:nth-child(1) {
842
+ animation-delay: -0.45s;
843
+ }
844
+ .wc-stripe-klarna-loader div:nth-child(2) {
845
+ animation-delay: -0.3s;
846
+ }
847
+ .wc-stripe-klarna-loader div:nth-child(3) {
848
+ animation-delay: -0.15s;
849
+ }
850
+ @keyframes klarna-payments-loader {
851
+ 0% {
852
+ transform: rotate(0deg);
853
+ }
854
+ 100% {
855
+ transform: rotate(360deg);
856
+ }
857
+ }
858
+
859
+
assets/css/stripe.min-rtl.css CHANGED
@@ -1 +1 @@
1
- .wc-stripe-card-icons-container,.wc-stripe-paymentRequest-icons-container{float:left;display:inline-block}ul.payment_methods li[class*=payment_method]{margin:0;padding:0}li[class*=payment_method] input[type=radio]{margin:0 5px 0 10px}li[class*=payment_method] input[type=radio]+label:not(.wc-stripe-label-payment-type){margin:0}.woocommerce-checkout #payment ul.payment_methods li[class*=payment_method_stripe_]:nth-child(n+2),ul.payment_methods li[class*=payment_method_stripe_]:nth-child(n+2){margin:0}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon,li.payment_method_stripe_payment_request .wc-stripe-paymentRequest-icons-container img{max-width:44px;max-height:27px;width:44px;height:27px;float:none;display:inline}li.payment_method_stripe_payment_request .wc-stripe-paymentRequest-icons-container img{width:25px;height:25px;max-width:25px;max-height:25px}ul.payment_methods label[for*=payment_method_stripe]:after{clear:left;content:"";display:block}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon:nth-child(2n+2){margin:0 2px}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon.open.visa{padding-top:2px}ul.payment_methods li[class*=payment_method_stripe_] label>img:first-of-type{float:left!important}.wc-stripe_cc-new-method-container{margin-bottom:1em}.wc-stripe_cc-container .StripeElement{box-sizing:border-box;height:40px;padding:10px 12px;border-radius:4px;background-color:#fff;-webkit-transition:box-shadow 150ms ease;transition:box-shadow 150ms ease}input.wc-stripe-klarna-category,input.wc-stripe-payment-type{display:none!important}body .wfacp_main_form.woocommerce .wc-stripe-save-source label.checkbox{padding:0!important}input[type=radio]+label.wc-stripe-label-payment-type,label.wc-stripe-label-klarna-category,label.wc-stripe-label-payment-type{margin-bottom:1em;display:block;padding:0!important;color:#000}.theme-flatsome div.wc-stripe-saved-methods-container{margin:0 0 1em 0}label.wc-stripe-label-klarna-category:before,label.wc-stripe-label-payment-type:before{content:"";display:inline-block;width:11px;height:11px;border:2px solid #fff;box-shadow:0 0 0 2px #000;background:#fff;margin-right:4px;margin-left:.5em;border-radius:100%;-webkit-transform:translateY(2px);-ms-transform:translateY(2px);transform:translateY(2px)}input.wc-stripe-klarna-category:checked+label.wc-stripe-label-klarna-category:before,input.wc-stripe-payment-type:checked+label.wc-stripe-label-payment-type:before{background:#000}label.wc-stripe-label-payment-type:after{content:none!important;display:none!important}.select2-results__options li.wc-stripe-select2-container,.wc-stripe-saved-methods-container .select2-container .select2-selection--single .wc-stripe-select2-container{display:flex;align-items:center;height:42px;line-height:42px!important}.select2-container .select2-selection--single .wc-stripe-select2-container:before,.select2-results__options li.wc-stripe-select2-container:before{content:'';background-repeat:no-repeat;background-size:40px 24px;width:40px;height:42px;display:inline-block;margin-left:8px;background-position:center}.select2-container .select2-selection--single .wc-stripe-select2-container.visa:before,.select2-results__options li.wc-stripe-select2-container.visa:before{background-image:url(../img/cards/visa.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.mastercard:before,.select2-results__options li.wc-stripe-select2-container.mastercard:before{background-image:url(../img/cards/mastercard.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.americanexpress:before,.select2-results__options li.wc-stripe-select2-container.americanexpress:before{background-image:url(../img/cards/amex.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.amex:before,.select2-results__options li.wc-stripe-select2-container.amex:before{background-image:url(../img/cards/amex.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.discover:before,.select2-results__options li.wc-stripe-select2-container.discover:before{background-image:url(../img/cards/discover.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.mastercard:before,.select2-results__options li.wc-stripe-select2-container.mastercard:before{background-image:url(../img/cards/mastercard.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.dinersclub:before,.select2-results__options li.wc-stripe-select2-container.dinersclub:before{background-image:url(../img/cards/diners.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.diners:before,.select2-results__options li.wc-stripe-select2-container.diners:before{background-image:url(../img/cards/diners.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.jcb:before,.select2-results__options li.wc-stripe-select2-container.jcb:before{background-image:url(../img/cards/jcb.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.stripe_sepa:before,.select2-results__options li.wc-stripe-select2-container.stripe_sepa:before{background-image:url(../img/sepa.svg)}.select2-results__options li.wc-stripe-select2-container.wc-stripe-ach:before{display:none}#wc-stripe-card-element{margin-bottom:1em}.wc-stripe_cc-container .wc-stripe-save-source .save-source-label{display:block;margin-top:10px}.wc-stripe_cc-container .wc-stripe-save-source input[type=checkbox]{opacity:0;position:absolute;width:20px;height:20px}.wc-stripe_cc-container .wc-stripe-save-source label.checkbox{position:relative}.wc-stripe_cc-container .save-source-checkbox{height:20px;width:20px;position:relative;background-color:#fff;display:block;border-radius:3px;border:1px solid #bababa}.wc-stripe_cc-container .save-source-checkbox:after{content:"";position:absolute;top:0;right:0}.wc-stripe_cc-container .wc-stripe-save-source input[type=checkbox]:checked+.save-source-checkbox:after{right:6px;top:2px;width:7px;height:12px;border:solid #2196f3;border-width:0 0 3px 3px;-webkit-transform:rotate(-45deg);-ms-transform:rotate(-45deg);transform:rotate(-45deg);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}li.payment_method_stripe_applepay,li.payment_method_stripe_googlepay,li.payment_method_stripe_payment_request{display:none}#payment #place_order.wc-stripe-hide,#place_order.wc-stripe-hide,.woocommerce-checkout-review-order #payment #place_order.wc-stripe-hide{position:absolute!important;z-index:-1000!important;height:0!important;padding:0!important;opacity:0!important}.wc-stripe-product-checkout-container{display:none;width:100%}.wc-stripe-product-checkout-container.bottom{margin-top:1em}.wc-stripe-product-checkout-container.top{margin-bottom:1em}.wc-stripe-product-checkout-container.active{display:block}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods,.wc-stripe-product-checkout-container ul.wc_stripe_product_payment_methods{list-style:none;margin:0;padding:0}.wc-stripe-cart-checkout-container{margin:0;padding:0;clear:both}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods{margin-bottom:1.5em}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods li[class*=payment_method_stripe_],.wc-stripe-product-checkout-container ul.wc_stripe_product_payment_methods li[class*=payment_method_stripe_]{margin:0 0 1em 0}.wc_stripe_cart_payment_methods .gpay-button,.wc_stripe_product_payment_methods .gpay-button{width:100%!important;margin:0}.wc_stripe_product_payment_methods .disabled{opacity:.45}.stripe_cart_gateway_active .checkout-button,.woocommerce-cart .stripe_cart_gateway_active .wc-proceed-to-checkout .checkout-button{margin-bottom:0}.wc-stripe-cart-or{margin:1em 0;text-align:center}li.wc-stripe-payment-method.or{display:none}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods.active li.wc-stripe-payment-method.or{display:block;margin:15px 0}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods.active li.wc-stripe-payment-method.or p{margin:0}li[class*=payment_method_stripe_].active~li.wc-stripe-payment-method.or{display:block;margin:0}li.payment_method_stripe_applepay label:first-of-type img{width:49px;max-height:32px}li.payment_method_stripe_googlepay label:first-of-type img{width:48px;max-height:35px}li.payment_method_stripe_googlepay label:first-of-type img[src*=googlepay_standard]{width:60px;max-height:35px}li.payment_method_stripe_ach label:first-of-type img{width:32px;height:32px;min-width:32px;min-height:32px}.gpay-button:hover{background-origin:content-box;background-position:center center;background-repeat:no-repeat;background-size:contain}.gpay-button:active{background-origin:content-box;background-position:center center;background-repeat:no-repeat;background-size:contain}.gpay-button:focus{background-origin:content-box;background-position:center center;background-repeat:no-repeat;background-size:contain}@supports (-webkit-appearance:-apple-pay-button){.apple-pay-button{display:block;-webkit-appearance:-apple-pay-button;width:100%;max-width:100%;min-width:200px;height:40px;max-height:40px}.apple-pay-button-black{-apple-pay-button-style:#000}.apple-pay-button-white{-apple-pay-button-style:#fff}.apple-pay-button-white-with-line{-apple-pay-button-style:white-outline}.applepay-top-container .apple-pay-button{max-width:240px}.woocommerce-checkout-payment .apple-pay-button{max-width:240px}body.single-product div.product form.cart .wc_stripe_product_payment_methods .apple-pay-button{max-width:100%}}.wc-stripe-banner-checkout{display:none;padding:20px 15px 0 15px;border:1px solid #d1d1d1;border-width:0 0 1px;position:relative;margin:1em 0}.wc-stripe-banner-checkout.active{display:block}.wc-stripe-banner-checkout span.banner-title{position:absolute;display:flex;align-items:center;top:-13px;left:0;right:0;background:0 0;white-space:nowrap;font-size:16px}.wc-stripe-banner-checkout span.banner-title:after,.wc-stripe-banner-checkout span.banner-title:before{content:' ';height:1px;background:#d1d1d1;display:block;width:50%}.wc-stripe-banner-checkout span.banner-title:before{margin-left:8px}.wc-stripe-banner-checkout span.banner-title:after{margin-right:8px}.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways{list-style:none;margin:0;padding:0}.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways li.wc-stripe-checkout-banner-gateway{margin:0 0 20px 0;display:none}.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways li.wc-stripe-checkout-banner-gateway .gpay-button{margin:0}.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways .gpay-button{width:100%}.wc_stripe_cart_payment_methods .payment_method_stripe_payment_request .StripeElement,.wc_stripe_product_payment_methods .payment_method_stripe_payment_request .StripeElement{padding:0;width:100%}.woocommerce-checkout #wc-stripe-payment-request-container.StripeElement{width:240px;padding:0}.wc-stripe-checkout-banner-gateway #wc-stripe-payment-request-banner.StripeElement{width:100%}ul.payment_methods li.payment_method_stripe_p24 img{max-width:90px;width:90px;max-height:45px}ul.payment_methods li.payment_method_stripe_ideal img{max-width:38px;width:38px;max-height:35px}ul.payment_methods li.payment_method_stripe_fpx img{max-width:75px;width:75px;max-height:25px}ul.payment_methods li.payment_method_stripe_klarna img{max-width:72px;width:72px;max-height:20px}ul.payment_methods li.payment_method_stripe_giropay img{max-width:65px;width:65px;max-height:28px}ul.payment_methods li.payment_method_stripe_eps img{max-width:70px;width:70px;max-height:46px}ul.payment_methods li.payment_method_stripe_multibanco img{max-width:48px;width:48px;max-height:48px}ul.payment_methods li.payment_method_stripe_sepa img{max-width:67px;width:67px;max-height:18px}ul.payment_methods li.payment_method_stripe_sofort img{max-width:70px;width:70px;max-height:21px}label[for=payment_method_stripe_bancontact] img,ul.payment_methods li.payment_method_stripe_bancontact img{width:60px;height:42px;max-width:60px;max-height:42px}ul.payment_methods li.payment_method_stripe_wechat label img{max-width:82px;width:82px;max-height:23px}ul.payment_methods li.payment_method_stripe_alipay img{max-width:72px;width:72px;height:36px;max-height:36px}ul.payment_methods li.payment_method_stripe_grabpay img{max-width:95px;width:95px;max-height:28px}#wc-stripe-card-element{width:100%}li.banner_payment_method_stripe_payment_request .StripeElement{padding:0}.single-product .blockMsg{border:none!important;background-color:transparent!important}#wc-stripe-card{position:absolute!important;top:50%;left:8px;transform:translatey(-50%);width:23px;height:15px;padding:0;border:none}#wc-stripe-card.active{width:32px;height:20px}input[id=stripe-postal-code]:focus{outline:0;background:0 0;border:none;box-shadow:none}div.postalCode:focus{outline:0;border:none}li[class*=payment_method_stripe] .select2-container .select2-selection--single{height:42px;padding:0 5px}li[class*=payment_method_stripe] .select2-container--default .select2-selection--single .select2-selection__arrow{height:42px;top:1px;left:1px}.blockUI.blockMsg{font-size:20px;white-space:nowrap}#wc-stripe-payment-request-container.disabled{opactity:.45}.wc-stripe-paymentRequest-icons-container img{float:none}.select2-container .select2-selection--single .wc-stripe-select2-container.wc-stripe-ach:before{display:none}ul.wc_stripe_cart_payment_methods li.wc-stripe-payment-method button,ul.wc_stripe_checkout_banner_gateways li button,ul.wc_stripe_product_payment_methods li[class*=payment_method_stripe_] button{margin:0}ul.payment_methods li[class*=payment_method]{margin:0;padding:10px 0}ul.payment_methods li[class*=payment_method] input[name=payment_method]{margin:0 5px 0 10px;float:none}ul.payment_methods li[class*=payment_method]>input[name=payment_method]+label{padding-top:0;padding-left:0;padding-bottom:0}ul.payment_methods{list-style:none}ul.payment_methods li[class*=payment_method_stripe_] .wc-stripe_cc-new-method-container label:before{display:none}.wc-stripe_cc-container .wc-stripe-save-source label.checkbox{padding:0!important;margin:0}.wc-stripe_cc-container .wc-stripe-save-source .save-source-label{padding:0;margin-bottom:5px}div[id*=wc_stripe_local_payment_stripe_].StripeElement{border:1px solid #eee;border-radius:4px}.qrcode-message{margin:10px 0 0 0}#wc_stripe_local_payment_stripe_becs,#wc_stripe_local_payment_stripe_sepa{padding:10px 12px;box-shadow:0 1px 3px 0 #e6ebf1}.wc-stripe-local-desc.stripe_becs,.wc-stripe-local-desc.stripe_sepa{margin:10px 0}.wc-stripe-clear{clear:both;height:0;visibility:hidden}.wc-stripe-gateway-desc p{margin:0}#wc_stripe_local_payment_stripe_klarna,div.payment_method_stripe_cc,div.payment_method_stripe_fpx,div.payment_method_stripe_ideal,div.payment_method_stripe_sepa,li[class*=payment_method_stripe_] div.wc-stripe_applepay-container.has_tokens,li[class*=payment_method_stripe_] div.wc-stripe_googlepay-container.has_tokens,li[class*=payment_method_stripe_] div.wc-stripe_payment_request-container.has_tokens{margin-top:10px}.wc-stripe-gateway-desc{margin-top:10px}#wc-stripe-card-element.StripeElement--webkit-autofill{background-color:transparent!important}#wc_stripe_local_payment_stripe_klarna .stripe-klarna-categories{list-style:none;margin:0;padding:10px}li.payment_method_stripe_alipay,li.payment_method_stripe_bancontact,li.payment_method_stripe_becs,li.payment_method_stripe_eps,li.payment_method_stripe_fpx,li.payment_method_stripe_giropay,li.payment_method_stripe_ideal,li.payment_method_stripe_klarna,li.payment_method_stripe_multibanco,li.payment_method_stripe_p24,li.payment_method_stripe_sepa,li.payment_method_stripe_sofort,li.payment_method_stripe_wechat{display:none}.widget_shopping_cart_content .wc-stripe-mini-cart-payment-methods{list-style:none;margin:0;padding:0}.widget_shopping_cart_content .wc-stripe-mini-cart-payment-methods li{margin:0}.widget_shopping_cart_content a.wc-stripe-applepay-mini-cart,.widget_shopping_cart_content a.wc-stripe-gpay-mini-cart,.widget_shopping_cart_content a.wc-stripe-payment-request-mini-cart{background:0 0;padding:0;border:none}a.wc-stripe-applepay-mini-cart .apple-pay-button,a.wc-stripe-gpay-mini-cart .gpay-button{width:100%;margin:0}.wc-stripe-payment-request-mini-cart.StripeElement{padding:0;background:0 0;border:none;width:100%}.wc-stripe-payment-request-mini-cart.StripeElement .__PrivateStripeElement{width:100%}.widget_shopping_cart_content .wc-stripe-overlay{display:none!important;position:absolute;background:rgba(255,255,255,.75);height:100%;width:100%;z-index:-1}.widget_shopping_cart_content .wc-stripe-overlay.active{display:block!important;z-index:9999}
1
+ .wc-stripe-card-icons-container,.wc-stripe-paymentRequest-icons-container{float:left;display:inline-block}ul.payment_methods li[class*=payment_method]{margin:0;padding:0}li[class*=payment_method] input[type=radio]{margin:0 5px 0 10px}li[class*=payment_method] input[type=radio]+label:not(.wc-stripe-label-payment-type){margin:0}.woocommerce-checkout #payment ul.payment_methods li[class*=payment_method_stripe_]:nth-child(n+2),ul.payment_methods li[class*=payment_method_stripe_]:nth-child(n+2){margin:0}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon,li.payment_method_stripe_payment_request .wc-stripe-paymentRequest-icons-container img{max-width:44px;max-height:27px;width:44px;height:27px;float:none;display:inline}li.payment_method_stripe_payment_request .wc-stripe-paymentRequest-icons-container img{width:25px;height:25px;max-width:25px;max-height:25px}ul.payment_methods label[for*=payment_method_stripe]:after{clear:left;content:"";display:block}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon:nth-child(2n+2){margin:0 2px}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon.open.visa{padding-top:2px}ul.payment_methods li[class*=payment_method_stripe_] label>img:first-of-type{float:left!important}.wc-stripe_cc-new-method-container{margin-bottom:1em}.wc-stripe_cc-container .StripeElement{box-sizing:border-box;height:40px;padding:10px 12px;border-radius:4px;background-color:#fff;-webkit-transition:box-shadow 150ms ease;transition:box-shadow 150ms ease}input.wc-stripe-klarna-category,input.wc-stripe-payment-type{display:none!important}body .wfacp_main_form.woocommerce .wc-stripe-save-source label.checkbox{padding:0!important}input[type=radio]+label.wc-stripe-label-payment-type,label.wc-stripe-label-klarna-category,label.wc-stripe-label-payment-type{margin-bottom:1em;display:block;padding:0!important;color:#000}.theme-flatsome div.wc-stripe-saved-methods-container{margin:0 0 1em 0}label.wc-stripe-label-klarna-category:before,label.wc-stripe-label-payment-type:before{content:"";display:inline-block;width:11px;height:11px;border:2px solid #fff;box-shadow:0 0 0 2px #000;background:#fff;margin-right:4px;margin-left:.5em;border-radius:100%;-webkit-transform:translateY(2px);-ms-transform:translateY(2px);transform:translateY(2px)}input.wc-stripe-klarna-category:checked+label.wc-stripe-label-klarna-category:before,input.wc-stripe-payment-type:checked+label.wc-stripe-label-payment-type:before{background:#000}label.wc-stripe-label-payment-type:after{content:none!important;display:none!important}.select2-results__options li.wc-stripe-select2-container,.wc-stripe-saved-methods-container .select2-container .select2-selection--single .wc-stripe-select2-container{display:flex;align-items:center;height:42px;line-height:42px!important}.select2-container .select2-selection--single .wc-stripe-select2-container:before,.select2-results__options li.wc-stripe-select2-container:before{content:'';background-repeat:no-repeat;background-size:40px 24px;width:40px;height:42px;display:inline-block;margin-left:8px;background-position:center}.select2-container .select2-selection--single .wc-stripe-select2-container.visa:before,.select2-results__options li.wc-stripe-select2-container.visa:before{background-image:url(../img/cards/visa.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.mastercard:before,.select2-results__options li.wc-stripe-select2-container.mastercard:before{background-image:url(../img/cards/mastercard.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.americanexpress:before,.select2-results__options li.wc-stripe-select2-container.americanexpress:before{background-image:url(../img/cards/amex.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.amex:before,.select2-results__options li.wc-stripe-select2-container.amex:before{background-image:url(../img/cards/amex.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.discover:before,.select2-results__options li.wc-stripe-select2-container.discover:before{background-image:url(../img/cards/discover.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.mastercard:before,.select2-results__options li.wc-stripe-select2-container.mastercard:before{background-image:url(../img/cards/mastercard.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.dinersclub:before,.select2-results__options li.wc-stripe-select2-container.dinersclub:before{background-image:url(../img/cards/diners.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.diners:before,.select2-results__options li.wc-stripe-select2-container.diners:before{background-image:url(../img/cards/diners.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.jcb:before,.select2-results__options li.wc-stripe-select2-container.jcb:before{background-image:url(../img/cards/jcb.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.stripe_sepa:before,.select2-results__options li.wc-stripe-select2-container.stripe_sepa:before{background-image:url(../img/sepa.svg)}.select2-results__options li.wc-stripe-select2-container.wc-stripe-ach:before{display:none}#wc-stripe-card-element{margin-bottom:1em}.wc-stripe_cc-container .wc-stripe-save-source .save-source-label{display:block;margin-top:10px}.wc-stripe_cc-container .wc-stripe-save-source input[type=checkbox]{opacity:0;position:absolute;width:20px;height:20px}.wc-stripe_cc-container .wc-stripe-save-source label.checkbox{position:relative}.wc-stripe_cc-container .save-source-checkbox{height:20px;width:20px;position:relative;background-color:#fff;display:block;border-radius:3px;border:1px solid #bababa}.wc-stripe_cc-container .save-source-checkbox:after{content:"";position:absolute;top:0;right:0}.wc-stripe_cc-container .wc-stripe-save-source input[type=checkbox]:checked+.save-source-checkbox:after{right:6px;top:2px;width:7px;height:12px;border:solid #2196f3;border-width:0 0 3px 3px;-webkit-transform:rotate(-45deg);-ms-transform:rotate(-45deg);transform:rotate(-45deg);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}li.payment_method_stripe_applepay,li.payment_method_stripe_googlepay,li.payment_method_stripe_payment_request{display:none}#payment #place_order.wc-stripe-hide,#place_order.wc-stripe-hide,.woocommerce-checkout-review-order #payment #place_order.wc-stripe-hide{position:absolute!important;z-index:-1000!important;height:0!important;padding:0!important;opacity:0!important}.wc-stripe-product-checkout-container{display:none;width:100%}.wc-stripe-product-checkout-container.bottom{margin-top:1em}.wc-stripe-product-checkout-container.top{margin-bottom:1em}.wc-stripe-product-checkout-container.active{display:block}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods,.wc-stripe-product-checkout-container ul.wc_stripe_product_payment_methods{list-style:none;margin:0;padding:0}.wc-stripe-cart-checkout-container{margin:0;padding:0;clear:both}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods{margin-bottom:1.5em}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods li[class*=payment_method_stripe_],.wc-stripe-product-checkout-container ul.wc_stripe_product_payment_methods li[class*=payment_method_stripe_]{margin:0 0 1em 0}.wc_stripe_cart_payment_methods .gpay-button,.wc_stripe_cart_payment_methods .gpay-card-info-container,.wc_stripe_product_payment_methods .gpay-button,.wc_stripe_product_payment_methods .gpay-card-info-container{width:100%!important;margin:0}.wc_stripe_product_payment_methods .disabled{opacity:.45}.stripe_cart_gateway_active .checkout-button,.woocommerce-cart .stripe_cart_gateway_active .wc-proceed-to-checkout .checkout-button{margin-bottom:0}.wc-stripe-cart-or{margin:1em 0;text-align:center}li.wc-stripe-payment-method.or{display:none}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods.active li.wc-stripe-payment-method.or{display:block;margin:15px 0}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods.active li.wc-stripe-payment-method.or p{margin:0}li[class*=payment_method_stripe_].active~li.wc-stripe-payment-method.or{display:block;margin:0}li.payment_method_stripe_applepay label:first-of-type img{width:49px;max-height:32px}li.payment_method_stripe_googlepay label:first-of-type img{width:48px;max-height:35px}li.payment_method_stripe_googlepay label:first-of-type img[src*=googlepay_standard]{width:60px;max-height:35px}li.payment_method_stripe_ach label:first-of-type img{width:32px;height:32px;min-width:32px;min-height:32px}.gpay-button:hover{background-origin:content-box;background-position:center center;background-repeat:no-repeat;background-size:contain}.gpay-button:active{background-origin:content-box;background-position:center center;background-repeat:no-repeat;background-size:contain}.gpay-button:focus{background-origin:content-box;background-position:center center;background-repeat:no-repeat;background-size:contain}@supports (-webkit-appearance:-apple-pay-button){.apple-pay-button{display:block;-webkit-appearance:-apple-pay-button;width:100%;max-width:100%;min-width:200px;height:40px;max-height:40px}.apple-pay-button-black{-apple-pay-button-style:#000;background-color:#000!important}.apple-pay-button-white{-apple-pay-button-style:#fff;background-color:#fff!important}.apple-pay-button-white-with-line{-apple-pay-button-style:white-outline}.applepay-top-container .apple-pay-button{max-width:240px}.woocommerce-checkout-payment .apple-pay-button{max-width:240px}body.single-product div.product form.cart .wc_stripe_product_payment_methods .apple-pay-button{max-width:100%}}.wc-stripe-banner-checkout{display:none;padding:20px 15px 0 15px;border:1px solid #d1d1d1;border-width:0 0 1px;position:relative;margin:1em 0}.wc-stripe-banner-checkout.active{display:block}.wc-stripe-banner-checkout span.banner-title{position:absolute;display:flex;align-items:center;top:-13px;left:0;right:0;background:0 0;white-space:nowrap;font-size:16px}.wc-stripe-banner-checkout span.banner-title:after,.wc-stripe-banner-checkout span.banner-title:before{content:' ';height:1px;background:#d1d1d1;display:block;width:50%}.wc-stripe-banner-checkout span.banner-title:before{margin-left:8px}.wc-stripe-banner-checkout span.banner-title:after{margin-right:8px}.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways{list-style:none;margin:0;padding:0}.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways li.wc-stripe-checkout-banner-gateway{margin:0 0 20px 0;display:none}.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways li.wc-stripe-checkout-banner-gateway .gpay-button,.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways li.wc-stripe-checkout-banner-gateway .gpay-card-info-container{margin:0}.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways .gpay-button,.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways .gpay-card-info-container{width:100%}.wc_stripe_cart_payment_methods .payment_method_stripe_payment_request .StripeElement,.wc_stripe_product_payment_methods .payment_method_stripe_payment_request .StripeElement{padding:0;width:100%}.woocommerce-checkout #wc-stripe-payment-request-container.StripeElement{width:240px;padding:0}.wc-stripe-checkout-banner-gateway #wc-stripe-payment-request-banner.StripeElement{width:100%}ul.payment_methods li.payment_method_stripe_p24 img{max-width:90px;width:90px;max-height:45px}ul.payment_methods li.payment_method_stripe_ideal img{max-width:38px;width:38px;max-height:35px}ul.payment_methods li.payment_method_stripe_fpx img{max-width:75px;width:75px;max-height:25px}ul.payment_methods li.payment_method_stripe_klarna img{max-width:72px;width:72px;max-height:20px}ul.payment_methods li.payment_method_stripe_giropay img{max-width:65px;width:65px;max-height:28px}ul.payment_methods li.payment_method_stripe_eps img{max-width:70px;width:70px;max-height:46px}ul.payment_methods li.payment_method_stripe_multibanco img{max-width:48px;width:48px;max-height:48px}ul.payment_methods li.payment_method_stripe_sepa img{max-width:67px;width:67px;max-height:18px}ul.payment_methods li.payment_method_stripe_sofort img{max-width:70px;width:70px;max-height:21px}label[for=payment_method_stripe_bancontact] img,ul.payment_methods li.payment_method_stripe_bancontact img{width:60px;height:42px;max-width:60px;max-height:42px}ul.payment_methods li.payment_method_stripe_wechat label img{max-width:82px;width:82px;max-height:23px}ul.payment_methods li.payment_method_stripe_alipay img{max-width:72px;width:72px;height:36px;max-height:36px}ul.payment_methods li.payment_method_stripe_grabpay img{max-width:95px;width:95px;max-height:28px}#wc-stripe-card-element{width:100%}li.banner_payment_method_stripe_payment_request .StripeElement{padding:0}.single-product .blockMsg{border:none!important;background-color:transparent!important}#wc-stripe-card{position:absolute!important;top:50%;left:8px;transform:translatey(-50%);width:23px;height:15px;padding:0;border:none}#wc-stripe-card.active{width:32px;height:20px}input[id=stripe-postal-code]:focus{outline:0;background:0 0;border:none;box-shadow:none}div.postalCode:focus{outline:0;border:none}li[class*=payment_method_stripe] .select2-container .select2-selection--single{height:42px;padding:0 5px}li[class*=payment_method_stripe] .select2-container--default .select2-selection--single .select2-selection__arrow{height:42px;top:1px;left:1px}.blockUI.blockMsg{font-size:20px;white-space:nowrap}#wc-stripe-payment-request-container.disabled{opactity:.45}.wc-stripe-paymentRequest-icons-container img{float:none}.select2-container .select2-selection--single .wc-stripe-select2-container.wc-stripe-ach:before{display:none}ul.wc_stripe_cart_payment_methods li.wc-stripe-payment-method button,ul.wc_stripe_checkout_banner_gateways li button,ul.wc_stripe_product_payment_methods li[class*=payment_method_stripe_] button{margin:0}ul.payment_methods li[class*=payment_method]{margin:0;padding:10px 0}ul.payment_methods li[class*=payment_method] input[name=payment_method]{margin:0 5px 0 10px;float:none}ul.payment_methods li[class*=payment_method]>input[name=payment_method]+label{padding-top:0;padding-left:0;padding-bottom:0}ul.payment_methods{list-style:none}ul.payment_methods li[class*=payment_method_stripe_] .wc-stripe_cc-new-method-container label:before{display:none}.wc-stripe_cc-container .wc-stripe-save-source label.checkbox{padding:0!important;margin:0}.wc-stripe_cc-container .wc-stripe-save-source .save-source-label{padding:0;margin-bottom:5px}div[id*=wc_stripe_local_payment_stripe_].StripeElement{border:1px solid #eee;border-radius:4px}.qrcode-message{margin:10px 0 0 0}#wc_stripe_local_payment_stripe_becs,#wc_stripe_local_payment_stripe_sepa{padding:10px 12px;box-shadow:0 1px 3px 0 #e6ebf1}.wc-stripe-local-desc.stripe_becs,.wc-stripe-local-desc.stripe_sepa{margin:10px 0}.wc-stripe-clear{clear:both;height:0;visibility:hidden}.wc-stripe-gateway-desc p{margin:0}#wc_stripe_local_payment_stripe_klarna,div.payment_method_stripe_cc,div.payment_method_stripe_fpx,div.payment_method_stripe_ideal,div.payment_method_stripe_sepa,li[class*=payment_method_stripe_] div.wc-stripe_applepay-container.has_tokens,li[class*=payment_method_stripe_] div.wc-stripe_googlepay-container.has_tokens,li[class*=payment_method_stripe_] div.wc-stripe_payment_request-container.has_tokens{margin-top:10px}.wc-stripe-gateway-desc{margin-top:10px}#wc-stripe-card-element.StripeElement--webkit-autofill{background-color:transparent!important}#wc_stripe_local_payment_stripe_klarna .stripe-klarna-categories{list-style:none;margin:0;padding:10px}li.payment_method_stripe_alipay,li.payment_method_stripe_bancontact,li.payment_method_stripe_becs,li.payment_method_stripe_eps,li.payment_method_stripe_fpx,li.payment_method_stripe_giropay,li.payment_method_stripe_ideal,li.payment_method_stripe_klarna,li.payment_method_stripe_multibanco,li.payment_method_stripe_p24,li.payment_method_stripe_sepa,li.payment_method_stripe_sofort,li.payment_method_stripe_wechat{display:none}.widget_shopping_cart_content .wc-stripe-mini-cart-payment-methods{list-style:none;margin:0;padding:0}.widget_shopping_cart_content .wc-stripe-mini-cart-payment-methods li{margin:0}.widget_shopping_cart_content a.wc-stripe-applepay-mini-cart,.widget_shopping_cart_content a.wc-stripe-gpay-mini-cart,.widget_shopping_cart_content a.wc-stripe-payment-request-mini-cart{background:0 0;padding:0;border:none}a.wc-stripe-gpay-mini-cart .gpay-button,a.wc-stripe-gpay-mini-cart .gpay-card-info-container a.wc-stripe-applepay-mini-cart .apple-pay-button{width:100%;margin:0}.wc-stripe-payment-request-mini-cart.StripeElement{padding:0;background:0 0;border:none;width:100%}.wc-stripe-payment-request-mini-cart.StripeElement .__PrivateStripeElement{width:100%}.widget_shopping_cart_content .wc-stripe-overlay{display:none!important;position:absolute;background:rgba(255,255,255,.75);height:100%;width:100%;z-index:-1}.widget_shopping_cart_content .wc-stripe-overlay.active{display:block!important;z-index:9999}.wc-stripe-klarna-loader{display:flex;justify-content:center;position:relative;width:100%;height:30px;box-sizing:border-box;transform:scale(.65)}.wc-stripe-klarna-loader div{box-sizing:border-box;display:block;position:absolute;box-sizing:border-box;width:30px;height:30px;border:3px solid #000;border-radius:50%;animation:klarna-payments-loader 1.3s cubic-bezier(.5,0,.5,1) infinite;border-color:#000 transparent transparent transparent}.wc-stripe-klarna-loader div:nth-child(1){animation-delay:-.45s}.wc-stripe-klarna-loader div:nth-child(2){animation-delay:-.3s}.wc-stripe-klarna-loader div:nth-child(3){animation-delay:-.15s}@keyframes klarna-payments-loader{0%{transform:rotate(0)}100%{transform:rotate(-360deg)}}
assets/css/stripe.min.css CHANGED
@@ -1 +1 @@
1
- .wc-stripe-card-icons-container,.wc-stripe-paymentRequest-icons-container{float:right;display:inline-block}ul.payment_methods li[class*=payment_method]{margin:0;padding:0}li[class*=payment_method] input[type=radio]{margin:0 10px 0 5px}li[class*=payment_method] input[type=radio]+label:not(.wc-stripe-label-payment-type){margin:0}.woocommerce-checkout #payment ul.payment_methods li[class*=payment_method_stripe_]:nth-child(n+2),ul.payment_methods li[class*=payment_method_stripe_]:nth-child(n+2){margin:0}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon,li.payment_method_stripe_payment_request .wc-stripe-paymentRequest-icons-container img{max-width:44px;max-height:27px;width:44px;height:27px;float:none;display:inline}li.payment_method_stripe_payment_request .wc-stripe-paymentRequest-icons-container img{width:25px;height:25px;max-width:25px;max-height:25px}ul.payment_methods label[for*=payment_method_stripe]:after{clear:right;content:"";display:block}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon:nth-child(2n+2){margin:0 2px}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon.open.visa{padding-top:2px}ul.payment_methods li[class*=payment_method_stripe_] label>img:first-of-type{float:right!important}.wc-stripe_cc-new-method-container{margin-bottom:1em}.wc-stripe_cc-container .StripeElement{box-sizing:border-box;height:40px;padding:10px 12px;border-radius:4px;background-color:#fff;-webkit-transition:box-shadow 150ms ease;transition:box-shadow 150ms ease}input.wc-stripe-klarna-category,input.wc-stripe-payment-type{display:none!important}body .wfacp_main_form.woocommerce .wc-stripe-save-source label.checkbox{padding:0!important}input[type=radio]+label.wc-stripe-label-payment-type,label.wc-stripe-label-klarna-category,label.wc-stripe-label-payment-type{margin-bottom:1em;display:block;padding:0!important;color:#000}.theme-flatsome div.wc-stripe-saved-methods-container{margin:0 0 1em 0}label.wc-stripe-label-klarna-category:before,label.wc-stripe-label-payment-type:before{content:"";display:inline-block;width:11px;height:11px;border:2px solid #fff;box-shadow:0 0 0 2px #000;background:#fff;margin-left:4px;margin-right:.5em;border-radius:100%;-webkit-transform:translateY(2px);-ms-transform:translateY(2px);transform:translateY(2px)}input.wc-stripe-klarna-category:checked+label.wc-stripe-label-klarna-category:before,input.wc-stripe-payment-type:checked+label.wc-stripe-label-payment-type:before{background:#000}label.wc-stripe-label-payment-type:after{content:none!important;display:none!important}.select2-results__options li.wc-stripe-select2-container,.wc-stripe-saved-methods-container .select2-container .select2-selection--single .wc-stripe-select2-container{display:flex;align-items:center;height:42px;line-height:42px!important}.select2-container .select2-selection--single .wc-stripe-select2-container:before,.select2-results__options li.wc-stripe-select2-container:before{content:'';background-repeat:no-repeat;background-size:40px 24px;width:40px;height:42px;display:inline-block;margin-right:8px;background-position:center}.select2-container .select2-selection--single .wc-stripe-select2-container.visa:before,.select2-results__options li.wc-stripe-select2-container.visa:before{background-image:url(../img/cards/visa.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.mastercard:before,.select2-results__options li.wc-stripe-select2-container.mastercard:before{background-image:url(../img/cards/mastercard.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.americanexpress:before,.select2-results__options li.wc-stripe-select2-container.americanexpress:before{background-image:url(../img/cards/amex.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.amex:before,.select2-results__options li.wc-stripe-select2-container.amex:before{background-image:url(../img/cards/amex.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.discover:before,.select2-results__options li.wc-stripe-select2-container.discover:before{background-image:url(../img/cards/discover.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.mastercard:before,.select2-results__options li.wc-stripe-select2-container.mastercard:before{background-image:url(../img/cards/mastercard.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.dinersclub:before,.select2-results__options li.wc-stripe-select2-container.dinersclub:before{background-image:url(../img/cards/diners.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.diners:before,.select2-results__options li.wc-stripe-select2-container.diners:before{background-image:url(../img/cards/diners.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.jcb:before,.select2-results__options li.wc-stripe-select2-container.jcb:before{background-image:url(../img/cards/jcb.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.stripe_sepa:before,.select2-results__options li.wc-stripe-select2-container.stripe_sepa:before{background-image:url(../img/sepa.svg)}.select2-results__options li.wc-stripe-select2-container.wc-stripe-ach:before{display:none}#wc-stripe-card-element{margin-bottom:1em}.wc-stripe_cc-container .wc-stripe-save-source .save-source-label{display:block;margin-top:10px}.wc-stripe_cc-container .wc-stripe-save-source input[type=checkbox]{opacity:0;position:absolute;width:20px;height:20px}.wc-stripe_cc-container .wc-stripe-save-source label.checkbox{position:relative}.wc-stripe_cc-container .save-source-checkbox{height:20px;width:20px;position:relative;background-color:#fff;display:block;border-radius:3px;border:1px solid #bababa}.wc-stripe_cc-container .save-source-checkbox:after{content:"";position:absolute;top:0;left:0}.wc-stripe_cc-container .wc-stripe-save-source input[type=checkbox]:checked+.save-source-checkbox:after{left:6px;top:2px;width:7px;height:12px;border:solid #2196f3;border-width:0 3px 3px 0;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}li.payment_method_stripe_applepay,li.payment_method_stripe_googlepay,li.payment_method_stripe_payment_request{display:none}#payment #place_order.wc-stripe-hide,#place_order.wc-stripe-hide,.woocommerce-checkout-review-order #payment #place_order.wc-stripe-hide{position:absolute!important;z-index:-1000!important;height:0!important;padding:0!important;opacity:0!important}.wc-stripe-product-checkout-container{display:none;width:100%}.wc-stripe-product-checkout-container.bottom{margin-top:1em}.wc-stripe-product-checkout-container.top{margin-bottom:1em}.wc-stripe-product-checkout-container.active{display:block}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods,.wc-stripe-product-checkout-container ul.wc_stripe_product_payment_methods{list-style:none;margin:0;padding:0}.wc-stripe-cart-checkout-container{margin:0;padding:0;clear:both}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods{margin-bottom:1.5em}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods li[class*=payment_method_stripe_],.wc-stripe-product-checkout-container ul.wc_stripe_product_payment_methods li[class*=payment_method_stripe_]{margin:0 0 1em 0}.wc_stripe_cart_payment_methods .gpay-button,.wc_stripe_product_payment_methods .gpay-button{width:100%!important;margin:0}.wc_stripe_product_payment_methods .disabled{opacity:.45}.stripe_cart_gateway_active .checkout-button,.woocommerce-cart .stripe_cart_gateway_active .wc-proceed-to-checkout .checkout-button{margin-bottom:0}.wc-stripe-cart-or{margin:1em 0;text-align:center}li.wc-stripe-payment-method.or{display:none}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods.active li.wc-stripe-payment-method.or{display:block;margin:15px 0}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods.active li.wc-stripe-payment-method.or p{margin:0}li[class*=payment_method_stripe_].active~li.wc-stripe-payment-method.or{display:block;margin:0}li.payment_method_stripe_applepay label:first-of-type img{width:49px;max-height:32px}li.payment_method_stripe_googlepay label:first-of-type img{width:48px;max-height:35px}li.payment_method_stripe_googlepay label:first-of-type img[src*=googlepay_standard]{width:60px;max-height:35px}li.payment_method_stripe_ach label:first-of-type img{width:32px;height:32px;min-width:32px;min-height:32px}.gpay-button:hover{background-origin:content-box;background-position:center center;background-repeat:no-repeat;background-size:contain}.gpay-button:active{background-origin:content-box;background-position:center center;background-repeat:no-repeat;background-size:contain}.gpay-button:focus{background-origin:content-box;background-position:center center;background-repeat:no-repeat;background-size:contain}@supports (-webkit-appearance:-apple-pay-button){.apple-pay-button{display:block;-webkit-appearance:-apple-pay-button;width:100%;max-width:100%;min-width:200px;height:40px;max-height:40px}.apple-pay-button-black{-apple-pay-button-style:#000}.apple-pay-button-white{-apple-pay-button-style:#fff}.apple-pay-button-white-with-line{-apple-pay-button-style:white-outline}.applepay-top-container .apple-pay-button{max-width:240px}.woocommerce-checkout-payment .apple-pay-button{max-width:240px}body.single-product div.product form.cart .wc_stripe_product_payment_methods .apple-pay-button{max-width:100%}}.wc-stripe-banner-checkout{display:none;padding:20px 15px 0 15px;border:1px solid #d1d1d1;border-width:0 0 1px;position:relative;margin:1em 0}.wc-stripe-banner-checkout.active{display:block}.wc-stripe-banner-checkout span.banner-title{position:absolute;display:flex;align-items:center;top:-13px;right:0;left:0;background:0 0;white-space:nowrap;font-size:16px}.wc-stripe-banner-checkout span.banner-title:after,.wc-stripe-banner-checkout span.banner-title:before{content:' ';height:1px;background:#d1d1d1;display:block;width:50%}.wc-stripe-banner-checkout span.banner-title:before{margin-right:8px}.wc-stripe-banner-checkout span.banner-title:after{margin-left:8px}.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways{list-style:none;margin:0;padding:0}.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways li.wc-stripe-checkout-banner-gateway{margin:0 0 20px 0;display:none}.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways li.wc-stripe-checkout-banner-gateway .gpay-button{margin:0}.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways .gpay-button{width:100%}.wc_stripe_cart_payment_methods .payment_method_stripe_payment_request .StripeElement,.wc_stripe_product_payment_methods .payment_method_stripe_payment_request .StripeElement{padding:0;width:100%}.woocommerce-checkout #wc-stripe-payment-request-container.StripeElement{width:240px;padding:0}.wc-stripe-checkout-banner-gateway #wc-stripe-payment-request-banner.StripeElement{width:100%}ul.payment_methods li.payment_method_stripe_p24 img{max-width:90px;width:90px;max-height:45px}ul.payment_methods li.payment_method_stripe_ideal img{max-width:38px;width:38px;max-height:35px}ul.payment_methods li.payment_method_stripe_fpx img{max-width:75px;width:75px;max-height:25px}ul.payment_methods li.payment_method_stripe_klarna img{max-width:72px;width:72px;max-height:20px}ul.payment_methods li.payment_method_stripe_giropay img{max-width:65px;width:65px;max-height:28px}ul.payment_methods li.payment_method_stripe_eps img{max-width:70px;width:70px;max-height:46px}ul.payment_methods li.payment_method_stripe_multibanco img{max-width:48px;width:48px;max-height:48px}ul.payment_methods li.payment_method_stripe_sepa img{max-width:67px;width:67px;max-height:18px}ul.payment_methods li.payment_method_stripe_sofort img{max-width:70px;width:70px;max-height:21px}label[for=payment_method_stripe_bancontact] img,ul.payment_methods li.payment_method_stripe_bancontact img{width:60px;height:42px;max-width:60px;max-height:42px}ul.payment_methods li.payment_method_stripe_wechat label img{max-width:82px;width:82px;max-height:23px}ul.payment_methods li.payment_method_stripe_alipay img{max-width:72px;width:72px;height:36px;max-height:36px}ul.payment_methods li.payment_method_stripe_grabpay img{max-width:95px;width:95px;max-height:28px}#wc-stripe-card-element{width:100%}li.banner_payment_method_stripe_payment_request .StripeElement{padding:0}.single-product .blockMsg{border:none!important;background-color:transparent!important}#wc-stripe-card{position:absolute!important;top:50%;right:8px;transform:translatey(-50%);width:23px;height:15px;padding:0;border:none}#wc-stripe-card.active{width:32px;height:20px}input[id=stripe-postal-code]:focus{outline:0;background:0 0;border:none;box-shadow:none}div.postalCode:focus{outline:0;border:none}li[class*=payment_method_stripe] .select2-container .select2-selection--single{height:42px;padding:0 5px}li[class*=payment_method_stripe] .select2-container--default .select2-selection--single .select2-selection__arrow{height:42px;top:1px;right:1px}.blockUI.blockMsg{font-size:20px;white-space:nowrap}#wc-stripe-payment-request-container.disabled{opactity:.45}.wc-stripe-paymentRequest-icons-container img{float:none}.select2-container .select2-selection--single .wc-stripe-select2-container.wc-stripe-ach:before{display:none}ul.wc_stripe_cart_payment_methods li.wc-stripe-payment-method button,ul.wc_stripe_checkout_banner_gateways li button,ul.wc_stripe_product_payment_methods li[class*=payment_method_stripe_] button{margin:0}ul.payment_methods li[class*=payment_method]{margin:0;padding:10px 0}ul.payment_methods li[class*=payment_method] input[name=payment_method]{margin:0 10px 0 5px;float:none}ul.payment_methods li[class*=payment_method]>input[name=payment_method]+label{padding-top:0;padding-right:0;padding-bottom:0}ul.payment_methods{list-style:none}ul.payment_methods li[class*=payment_method_stripe_] .wc-stripe_cc-new-method-container label:before{display:none}.wc-stripe_cc-container .wc-stripe-save-source label.checkbox{padding:0!important;margin:0}.wc-stripe_cc-container .wc-stripe-save-source .save-source-label{padding:0;margin-bottom:5px}div[id*=wc_stripe_local_payment_stripe_].StripeElement{border:1px solid #eee;border-radius:4px}.qrcode-message{margin:10px 0 0 0}#wc_stripe_local_payment_stripe_becs,#wc_stripe_local_payment_stripe_sepa{padding:10px 12px;box-shadow:0 1px 3px 0 #e6ebf1}.wc-stripe-local-desc.stripe_becs,.wc-stripe-local-desc.stripe_sepa{margin:10px 0}.wc-stripe-clear{clear:both;height:0;visibility:hidden}.wc-stripe-gateway-desc p{margin:0}#wc_stripe_local_payment_stripe_klarna,div.payment_method_stripe_cc,div.payment_method_stripe_fpx,div.payment_method_stripe_ideal,div.payment_method_stripe_sepa,li[class*=payment_method_stripe_] div.wc-stripe_applepay-container.has_tokens,li[class*=payment_method_stripe_] div.wc-stripe_googlepay-container.has_tokens,li[class*=payment_method_stripe_] div.wc-stripe_payment_request-container.has_tokens{margin-top:10px}.wc-stripe-gateway-desc{margin-top:10px}#wc-stripe-card-element.StripeElement--webkit-autofill{background-color:transparent!important}#wc_stripe_local_payment_stripe_klarna .stripe-klarna-categories{list-style:none;margin:0;padding:10px}li.payment_method_stripe_alipay,li.payment_method_stripe_bancontact,li.payment_method_stripe_becs,li.payment_method_stripe_eps,li.payment_method_stripe_fpx,li.payment_method_stripe_giropay,li.payment_method_stripe_ideal,li.payment_method_stripe_klarna,li.payment_method_stripe_multibanco,li.payment_method_stripe_p24,li.payment_method_stripe_sepa,li.payment_method_stripe_sofort,li.payment_method_stripe_wechat{display:none}.widget_shopping_cart_content .wc-stripe-mini-cart-payment-methods{list-style:none;margin:0;padding:0}.widget_shopping_cart_content .wc-stripe-mini-cart-payment-methods li{margin:0}.widget_shopping_cart_content a.wc-stripe-applepay-mini-cart,.widget_shopping_cart_content a.wc-stripe-gpay-mini-cart,.widget_shopping_cart_content a.wc-stripe-payment-request-mini-cart{background:0 0;padding:0;border:none}a.wc-stripe-applepay-mini-cart .apple-pay-button,a.wc-stripe-gpay-mini-cart .gpay-button{width:100%;margin:0}.wc-stripe-payment-request-mini-cart.StripeElement{padding:0;background:0 0;border:none;width:100%}.wc-stripe-payment-request-mini-cart.StripeElement .__PrivateStripeElement{width:100%}.widget_shopping_cart_content .wc-stripe-overlay{display:none!important;position:absolute;background:rgba(255,255,255,.75);height:100%;width:100%;z-index:-1}.widget_shopping_cart_content .wc-stripe-overlay.active{display:block!important;z-index:9999}
1
+ .wc-stripe-card-icons-container,.wc-stripe-paymentRequest-icons-container{float:right;display:inline-block}ul.payment_methods li[class*=payment_method]{margin:0;padding:0}li[class*=payment_method] input[type=radio]{margin:0 10px 0 5px}li[class*=payment_method] input[type=radio]+label:not(.wc-stripe-label-payment-type){margin:0}.woocommerce-checkout #payment ul.payment_methods li[class*=payment_method_stripe_]:nth-child(n+2),ul.payment_methods li[class*=payment_method_stripe_]:nth-child(n+2){margin:0}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon,li.payment_method_stripe_payment_request .wc-stripe-paymentRequest-icons-container img{max-width:44px;max-height:27px;width:44px;height:27px;float:none;display:inline}li.payment_method_stripe_payment_request .wc-stripe-paymentRequest-icons-container img{width:25px;height:25px;max-width:25px;max-height:25px}ul.payment_methods label[for*=payment_method_stripe]:after{clear:right;content:"";display:block}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon:nth-child(2n+2){margin:0 2px}li.payment_method_stripe_cc .wc-stripe-card-icons-container img.wc-stripe-card-icon.open.visa{padding-top:2px}ul.payment_methods li[class*=payment_method_stripe_] label>img:first-of-type{float:right!important}.wc-stripe_cc-new-method-container{margin-bottom:1em}.wc-stripe_cc-container .StripeElement{box-sizing:border-box;height:40px;padding:10px 12px;border-radius:4px;background-color:#fff;-webkit-transition:box-shadow 150ms ease;transition:box-shadow 150ms ease}input.wc-stripe-klarna-category,input.wc-stripe-payment-type{display:none!important}body .wfacp_main_form.woocommerce .wc-stripe-save-source label.checkbox{padding:0!important}input[type=radio]+label.wc-stripe-label-payment-type,label.wc-stripe-label-klarna-category,label.wc-stripe-label-payment-type{margin-bottom:1em;display:block;padding:0!important;color:#000}.theme-flatsome div.wc-stripe-saved-methods-container{margin:0 0 1em 0}label.wc-stripe-label-klarna-category:before,label.wc-stripe-label-payment-type:before{content:"";display:inline-block;width:11px;height:11px;border:2px solid #fff;box-shadow:0 0 0 2px #000;background:#fff;margin-left:4px;margin-right:.5em;border-radius:100%;-webkit-transform:translateY(2px);-ms-transform:translateY(2px);transform:translateY(2px)}input.wc-stripe-klarna-category:checked+label.wc-stripe-label-klarna-category:before,input.wc-stripe-payment-type:checked+label.wc-stripe-label-payment-type:before{background:#000}label.wc-stripe-label-payment-type:after{content:none!important;display:none!important}.select2-results__options li.wc-stripe-select2-container,.wc-stripe-saved-methods-container .select2-container .select2-selection--single .wc-stripe-select2-container{display:flex;align-items:center;height:42px;line-height:42px!important}.select2-container .select2-selection--single .wc-stripe-select2-container:before,.select2-results__options li.wc-stripe-select2-container:before{content:'';background-repeat:no-repeat;background-size:40px 24px;width:40px;height:42px;display:inline-block;margin-right:8px;background-position:center}.select2-container .select2-selection--single .wc-stripe-select2-container.visa:before,.select2-results__options li.wc-stripe-select2-container.visa:before{background-image:url(../img/cards/visa.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.mastercard:before,.select2-results__options li.wc-stripe-select2-container.mastercard:before{background-image:url(../img/cards/mastercard.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.americanexpress:before,.select2-results__options li.wc-stripe-select2-container.americanexpress:before{background-image:url(../img/cards/amex.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.amex:before,.select2-results__options li.wc-stripe-select2-container.amex:before{background-image:url(../img/cards/amex.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.discover:before,.select2-results__options li.wc-stripe-select2-container.discover:before{background-image:url(../img/cards/discover.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.mastercard:before,.select2-results__options li.wc-stripe-select2-container.mastercard:before{background-image:url(../img/cards/mastercard.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.dinersclub:before,.select2-results__options li.wc-stripe-select2-container.dinersclub:before{background-image:url(../img/cards/diners.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.diners:before,.select2-results__options li.wc-stripe-select2-container.diners:before{background-image:url(../img/cards/diners.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.jcb:before,.select2-results__options li.wc-stripe-select2-container.jcb:before{background-image:url(../img/cards/jcb.svg)}.select2-container .select2-selection--single .wc-stripe-select2-container.stripe_sepa:before,.select2-results__options li.wc-stripe-select2-container.stripe_sepa:before{background-image:url(../img/sepa.svg)}.select2-results__options li.wc-stripe-select2-container.wc-stripe-ach:before{display:none}#wc-stripe-card-element{margin-bottom:1em}.wc-stripe_cc-container .wc-stripe-save-source .save-source-label{display:block;margin-top:10px}.wc-stripe_cc-container .wc-stripe-save-source input[type=checkbox]{opacity:0;position:absolute;width:20px;height:20px}.wc-stripe_cc-container .wc-stripe-save-source label.checkbox{position:relative}.wc-stripe_cc-container .save-source-checkbox{height:20px;width:20px;position:relative;background-color:#fff;display:block;border-radius:3px;border:1px solid #bababa}.wc-stripe_cc-container .save-source-checkbox:after{content:"";position:absolute;top:0;left:0}.wc-stripe_cc-container .wc-stripe-save-source input[type=checkbox]:checked+.save-source-checkbox:after{left:6px;top:2px;width:7px;height:12px;border:solid #2196f3;border-width:0 3px 3px 0;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}li.payment_method_stripe_applepay,li.payment_method_stripe_googlepay,li.payment_method_stripe_payment_request{display:none}#payment #place_order.wc-stripe-hide,#place_order.wc-stripe-hide,.woocommerce-checkout-review-order #payment #place_order.wc-stripe-hide{position:absolute!important;z-index:-1000!important;height:0!important;padding:0!important;opacity:0!important}.wc-stripe-product-checkout-container{display:none;width:100%}.wc-stripe-product-checkout-container.bottom{margin-top:1em}.wc-stripe-product-checkout-container.top{margin-bottom:1em}.wc-stripe-product-checkout-container.active{display:block}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods,.wc-stripe-product-checkout-container ul.wc_stripe_product_payment_methods{list-style:none;margin:0;padding:0}.wc-stripe-cart-checkout-container{margin:0;padding:0;clear:both}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods{margin-bottom:1.5em}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods li[class*=payment_method_stripe_],.wc-stripe-product-checkout-container ul.wc_stripe_product_payment_methods li[class*=payment_method_stripe_]{margin:0 0 1em 0}.wc_stripe_cart_payment_methods .gpay-button,.wc_stripe_cart_payment_methods .gpay-card-info-container,.wc_stripe_product_payment_methods .gpay-button,.wc_stripe_product_payment_methods .gpay-card-info-container{width:100%!important;margin:0}.wc_stripe_product_payment_methods .disabled{opacity:.45}.stripe_cart_gateway_active .checkout-button,.woocommerce-cart .stripe_cart_gateway_active .wc-proceed-to-checkout .checkout-button{margin-bottom:0}.wc-stripe-cart-or{margin:1em 0;text-align:center}li.wc-stripe-payment-method.or{display:none}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods.active li.wc-stripe-payment-method.or{display:block;margin:15px 0}.wc-stripe-cart-checkout-container ul.wc_stripe_cart_payment_methods.active li.wc-stripe-payment-method.or p{margin:0}li[class*=payment_method_stripe_].active~li.wc-stripe-payment-method.or{display:block;margin:0}li.payment_method_stripe_applepay label:first-of-type img{width:49px;max-height:32px}li.payment_method_stripe_googlepay label:first-of-type img{width:48px;max-height:35px}li.payment_method_stripe_googlepay label:first-of-type img[src*=googlepay_standard]{width:60px;max-height:35px}li.payment_method_stripe_ach label:first-of-type img{width:32px;height:32px;min-width:32px;min-height:32px}.gpay-button:hover{background-origin:content-box;background-position:center center;background-repeat:no-repeat;background-size:contain}.gpay-button:active{background-origin:content-box;background-position:center center;background-repeat:no-repeat;background-size:contain}.gpay-button:focus{background-origin:content-box;background-position:center center;background-repeat:no-repeat;background-size:contain}@supports (-webkit-appearance:-apple-pay-button){.apple-pay-button{display:block;-webkit-appearance:-apple-pay-button;width:100%;max-width:100%;min-width:200px;height:40px;max-height:40px}.apple-pay-button-black{-apple-pay-button-style:#000;background-color:#000!important}.apple-pay-button-white{-apple-pay-button-style:#fff;background-color:#fff!important}.apple-pay-button-white-with-line{-apple-pay-button-style:white-outline}.applepay-top-container .apple-pay-button{max-width:240px}.woocommerce-checkout-payment .apple-pay-button{max-width:240px}body.single-product div.product form.cart .wc_stripe_product_payment_methods .apple-pay-button{max-width:100%}}.wc-stripe-banner-checkout{display:none;padding:20px 15px 0 15px;border:1px solid #d1d1d1;border-width:0 0 1px;position:relative;margin:1em 0}.wc-stripe-banner-checkout.active{display:block}.wc-stripe-banner-checkout span.banner-title{position:absolute;display:flex;align-items:center;top:-13px;right:0;left:0;background:0 0;white-space:nowrap;font-size:16px}.wc-stripe-banner-checkout span.banner-title:after,.wc-stripe-banner-checkout span.banner-title:before{content:' ';height:1px;background:#d1d1d1;display:block;width:50%}.wc-stripe-banner-checkout span.banner-title:before{margin-right:8px}.wc-stripe-banner-checkout span.banner-title:after{margin-left:8px}.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways{list-style:none;margin:0;padding:0}.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways li.wc-stripe-checkout-banner-gateway{margin:0 0 20px 0;display:none}.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways li.wc-stripe-checkout-banner-gateway .gpay-button,.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways li.wc-stripe-checkout-banner-gateway .gpay-card-info-container{margin:0}.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways .gpay-button,.wc-stripe-banner-checkout ul.wc_stripe_checkout_banner_gateways .gpay-card-info-container{width:100%}.wc_stripe_cart_payment_methods .payment_method_stripe_payment_request .StripeElement,.wc_stripe_product_payment_methods .payment_method_stripe_payment_request .StripeElement{padding:0;width:100%}.woocommerce-checkout #wc-stripe-payment-request-container.StripeElement{width:240px;padding:0}.wc-stripe-checkout-banner-gateway #wc-stripe-payment-request-banner.StripeElement{width:100%}ul.payment_methods li.payment_method_stripe_p24 img{max-width:90px;width:90px;max-height:45px}ul.payment_methods li.payment_method_stripe_ideal img{max-width:38px;width:38px;max-height:35px}ul.payment_methods li.payment_method_stripe_fpx img{max-width:75px;width:75px;max-height:25px}ul.payment_methods li.payment_method_stripe_klarna img{max-width:72px;width:72px;max-height:20px}ul.payment_methods li.payment_method_stripe_giropay img{max-width:65px;width:65px;max-height:28px}ul.payment_methods li.payment_method_stripe_eps img{max-width:70px;width:70px;max-height:46px}ul.payment_methods li.payment_method_stripe_multibanco img{max-width:48px;width:48px;max-height:48px}ul.payment_methods li.payment_method_stripe_sepa img{max-width:67px;width:67px;max-height:18px}ul.payment_methods li.payment_method_stripe_sofort img{max-width:70px;width:70px;max-height:21px}label[for=payment_method_stripe_bancontact] img,ul.payment_methods li.payment_method_stripe_bancontact img{width:60px;height:42px;max-width:60px;max-height:42px}ul.payment_methods li.payment_method_stripe_wechat label img{max-width:82px;width:82px;max-height:23px}ul.payment_methods li.payment_method_stripe_alipay img{max-width:72px;width:72px;height:36px;max-height:36px}ul.payment_methods li.payment_method_stripe_grabpay img{max-width:95px;width:95px;max-height:28px}#wc-stripe-card-element{width:100%}li.banner_payment_method_stripe_payment_request .StripeElement{padding:0}.single-product .blockMsg{border:none!important;background-color:transparent!important}#wc-stripe-card{position:absolute!important;top:50%;right:8px;transform:translatey(-50%);width:23px;height:15px;padding:0;border:none}#wc-stripe-card.active{width:32px;height:20px}input[id=stripe-postal-code]:focus{outline:0;background:0 0;border:none;box-shadow:none}div.postalCode:focus{outline:0;border:none}li[class*=payment_method_stripe] .select2-container .select2-selection--single{height:42px;padding:0 5px}li[class*=payment_method_stripe] .select2-container--default .select2-selection--single .select2-selection__arrow{height:42px;top:1px;right:1px}.blockUI.blockMsg{font-size:20px;white-space:nowrap}#wc-stripe-payment-request-container.disabled{opactity:.45}.wc-stripe-paymentRequest-icons-container img{float:none}.select2-container .select2-selection--single .wc-stripe-select2-container.wc-stripe-ach:before{display:none}ul.wc_stripe_cart_payment_methods li.wc-stripe-payment-method button,ul.wc_stripe_checkout_banner_gateways li button,ul.wc_stripe_product_payment_methods li[class*=payment_method_stripe_] button{margin:0}ul.payment_methods li[class*=payment_method]{margin:0;padding:10px 0}ul.payment_methods li[class*=payment_method] input[name=payment_method]{margin:0 10px 0 5px;float:none}ul.payment_methods li[class*=payment_method]>input[name=payment_method]+label{padding-top:0;padding-right:0;padding-bottom:0}ul.payment_methods{list-style:none}ul.payment_methods li[class*=payment_method_stripe_] .wc-stripe_cc-new-method-container label:before{display:none}.wc-stripe_cc-container .wc-stripe-save-source label.checkbox{padding:0!important;margin:0}.wc-stripe_cc-container .wc-stripe-save-source .save-source-label{padding:0;margin-bottom:5px}div[id*=wc_stripe_local_payment_stripe_].StripeElement{border:1px solid #eee;border-radius:4px}.qrcode-message{margin:10px 0 0 0}#wc_stripe_local_payment_stripe_becs,#wc_stripe_local_payment_stripe_sepa{padding:10px 12px;box-shadow:0 1px 3px 0 #e6ebf1}.wc-stripe-local-desc.stripe_becs,.wc-stripe-local-desc.stripe_sepa{margin:10px 0}.wc-stripe-clear{clear:both;height:0;visibility:hidden}.wc-stripe-gateway-desc p{margin:0}#wc_stripe_local_payment_stripe_klarna,div.payment_method_stripe_cc,div.payment_method_stripe_fpx,div.payment_method_stripe_ideal,div.payment_method_stripe_sepa,li[class*=payment_method_stripe_] div.wc-stripe_applepay-container.has_tokens,li[class*=payment_method_stripe_] div.wc-stripe_googlepay-container.has_tokens,li[class*=payment_method_stripe_] div.wc-stripe_payment_request-container.has_tokens{margin-top:10px}.wc-stripe-gateway-desc{margin-top:10px}#wc-stripe-card-element.StripeElement--webkit-autofill{background-color:transparent!important}#wc_stripe_local_payment_stripe_klarna .stripe-klarna-categories{list-style:none;margin:0;padding:10px}li.payment_method_stripe_alipay,li.payment_method_stripe_bancontact,li.payment_method_stripe_becs,li.payment_method_stripe_eps,li.payment_method_stripe_fpx,li.payment_method_stripe_giropay,li.payment_method_stripe_ideal,li.payment_method_stripe_klarna,li.payment_method_stripe_multibanco,li.payment_method_stripe_p24,li.payment_method_stripe_sepa,li.payment_method_stripe_sofort,li.payment_method_stripe_wechat{display:none}.widget_shopping_cart_content .wc-stripe-mini-cart-payment-methods{list-style:none;margin:0;padding:0}.widget_shopping_cart_content .wc-stripe-mini-cart-payment-methods li{margin:0}.widget_shopping_cart_content a.wc-stripe-applepay-mini-cart,.widget_shopping_cart_content a.wc-stripe-gpay-mini-cart,.widget_shopping_cart_content a.wc-stripe-payment-request-mini-cart{background:0 0;padding:0;border:none}a.wc-stripe-gpay-mini-cart .gpay-button,a.wc-stripe-gpay-mini-cart .gpay-card-info-container a.wc-stripe-applepay-mini-cart .apple-pay-button{width:100%;margin:0}.wc-stripe-payment-request-mini-cart.StripeElement{padding:0;background:0 0;border:none;width:100%}.wc-stripe-payment-request-mini-cart.StripeElement .__PrivateStripeElement{width:100%}.widget_shopping_cart_content .wc-stripe-overlay{display:none!important;position:absolute;background:rgba(255,255,255,.75);height:100%;width:100%;z-index:-1}.widget_shopping_cart_content .wc-stripe-overlay.active{display:block!important;z-index:9999}.wc-stripe-klarna-loader{display:flex;justify-content:center;position:relative;width:100%;height:30px;box-sizing:border-box;transform:scale(.65)}.wc-stripe-klarna-loader div{box-sizing:border-box;display:block;position:absolute;box-sizing:border-box;width:30px;height:30px;border:3px solid #000;border-radius:50%;animation:klarna-payments-loader 1.3s cubic-bezier(.5,0,.5,1) infinite;border-color:#000 transparent transparent transparent}.wc-stripe-klarna-loader div:nth-child(1){animation-delay:-.45s}.wc-stripe-klarna-loader div:nth-child(2){animation-delay:-.3s}.wc-stripe-klarna-loader div:nth-child(3){animation-delay:-.15s}@keyframes klarna-payments-loader{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}
assets/js/frontend/applepay-checkout.js CHANGED
@@ -15,6 +15,7 @@
15
 
16
  ApplePay.prototype.initialize = function () {
17
  wc_stripe.CheckoutGateway.call(this);
 
18
  if ($(this.container).length) {
19
  wc_stripe.ApplePay.prototype.initialize.call(this);
20
  }
@@ -69,6 +70,12 @@
69
  }
70
  }
71
 
 
 
 
 
 
 
72
  new ApplePay();
73
 
74
  }(jQuery, window.wc_stripe))
15
 
16
  ApplePay.prototype.initialize = function () {
17
  wc_stripe.CheckoutGateway.call(this);
18
+ $('form.checkout').on('change', '.form-row:not(.address-field) .input-text', this.update_payment_request.bind(this));
19
  if ($(this.container).length) {
20
  wc_stripe.ApplePay.prototype.initialize.call(this);
21
  }
70
  }
71
  }
72
 
73
+ ApplePay.prototype.update_payment_request = function () {
74
+ if ($(this.container).length) {
75
+ wc_stripe.ApplePay.prototype.initialize.call(this);
76
+ }
77
+ }
78
+
79
  new ApplePay();
80
 
81
  }(jQuery, window.wc_stripe))
assets/js/frontend/local-payment.js CHANGED
@@ -33,8 +33,12 @@
33
 
34
  LocalPayment.prototype.elementType = null;
35
 
 
 
 
 
36
  LocalPayment.prototype.maybe_hide_gateway = function () {
37
- if (!$('#wc_stripe_local_payment_' + this.gateway_id).data('active')) {
38
  $(this.container).hide();
39
  } else {
40
  $(this.container).show();
@@ -147,7 +151,7 @@
147
  }
148
 
149
  LocalPayment.prototype.updated_checkout = function () {
150
- this.mount_button()
151
  this.maybe_hide_gateway();
152
  }
153
 
@@ -183,6 +187,7 @@
183
  if (this.is_gateway_selected()) {
184
  var match = e.newURL.match(/response=(.*)/);
185
  if (match) {
 
186
  var obj = JSON.parse(window.atob(match[1]));
187
  this.processConfirmation(obj);
188
  }
@@ -223,7 +228,7 @@
223
  LocalPayment.prototype.delete_order_source = function () {
224
  return new Promise(function (resolve, reject) {
225
  $.ajax({
226
- url: this.params.routes.delete_source,
227
  method: 'DELETE',
228
  dataType: 'json',
229
  beforeSend: this.ajax_before_send.bind(this)
@@ -235,6 +240,27 @@
235
  }.bind(this))
236
  }
237
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
238
  /*********** iDEAL ***********/
239
  function IDEAL(params) {
240
  this.elementType = 'idealBank';
@@ -253,7 +279,8 @@
253
  function Klarna(params) {
254
  LocalPayment.call(this, params);
255
  $(document.body).on('change', '.wc-stripe-klarna-category', this.category_change.bind(this));
256
- window.addEventListener('hashchange', this.hashChange.bind(this));
 
257
  }
258
 
259
  function FPX(params) {
@@ -282,19 +309,21 @@
282
  }
283
 
284
  Klarna.prototype.category_change = function (e) {
285
- var $el = $(e.currentTarget);
286
- if ($el.is(':checked')) {
287
  $('[id^="klarna-instance-"]').slideUp();
288
  var category = $('[name="klarna_category"]:checked').val();
289
  $('#klarna-instance-' + category).slideDown();
 
 
 
 
 
 
 
290
  }
291
  }
292
 
293
  Klarna.prototype.processConfirmation = function (source) {
294
- var $form = $(this.token_selector).closest('form');
295
- $form.unblock().removeClass('processing');
296
- // get the source
297
- this.source = source;
298
  window.Klarna.Payments.init({
299
  client_token: source.klarna.client_token
300
  }, function (response) {
@@ -302,7 +331,13 @@
302
  }.bind(this));
303
  this.payment_categories = source.klarna.payment_method_categories.split(",");
304
  this.render_ui(true);
305
- this.show_place_order();
 
 
 
 
 
 
306
  }
307
 
308
  Klarna.prototype.render_ui = function (trigger_change) {
@@ -311,20 +346,21 @@
311
  $('#wc_stripe_local_payment_stripe_klarna').show();
312
  for (var i = 0; i < this.payment_categories.length; i++) {
313
  var container = '#klarna-instance-' + this.payment_categories[i];
 
314
  if ($('#klarna-category-' + this.payment_categories[i]).length) {
 
 
 
 
315
  $('#klarna-category-' + this.payment_categories[i]).show();
316
  try {
317
  window.Klarna.Payments.load({
318
  container: container,
319
- payment_method_category: this.payment_categories[i], //source.klarna.payment_method_categories
320
  instance_id: 'klarna-instance-' + this.payment_categories[i]
321
  }, function (response) {
322
  if (!response.show_form) {
323
- this.show_form_false++;
324
- if (this.show_form_false == this.payment_categories.length) {
325
- this.delete_order_source();
326
- this.payment_categories = null;
327
- }
328
  }
329
  }.bind(this));
330
  } catch (e) {
@@ -341,46 +377,204 @@
341
  Klarna.prototype.place_order = function (e) {
342
  if (this.is_gateway_selected()) {
343
  e.preventDefault();
344
- this.payment_token_received = true;
345
- if (this.payment_categories) {
346
  window.Klarna.Payments.authorize({
347
  instance_id: 'klarna-instance-' + $('[name="klarna_category"]:checked').val()
348
  }, function (res) {
349
  if (res.approved) {
350
- this.block();
351
  this.payment_token_received = true;
352
- window.location = this.source.redirect;
353
  } else {
354
  if (res.error) {
355
  this.submit_error(res.error);
356
  } else {
357
- this.payment_categories = null;
358
  this.submit_error(this.params.messages.klarna_error);
359
  }
360
  }
361
  }.bind(this));
 
 
 
 
 
 
 
 
 
 
362
  } else {
363
- // let checkout process so we can get back a source object
364
- this.get_form().submit();
365
  }
366
  }
367
  }
368
 
369
  Klarna.prototype.initialize = function () {
370
-
 
 
 
 
 
371
  }
372
 
373
  Klarna.prototype.createSource = function () {
374
- this.block();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
375
  }
376
 
377
  Klarna.prototype.updated_checkout = function () {
378
- if (this.payment_categories) {
379
- this.render_ui(false);
 
 
 
 
 
 
380
  }
381
  LocalPayment.prototype.updated_checkout.apply(this, arguments);
382
  }
383
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
384
  WeChat.prototype.updated_checkout = function () {
385
  if (!this.script_loaded && $(this.container).length) {
386
  this.load_external_script(this.params.qr_script);
@@ -392,9 +586,10 @@
392
  if (this.is_gateway_selected()) {
393
  var match = e.newURL.match(/qrcode=(.*)/);
394
  if (match) {
 
395
  this.qrcode = JSON.parse(window.atob(match[1]));
396
  this.get_form().unblock().removeClass('processing').addClass('wechat');
397
- const qrCode = new QRCode('wc_stripe_local_payment_stripe_wechat', {
398
  text: this.qrcode.code,
399
  width: 128,
400
  height: 128,
@@ -448,7 +643,7 @@
448
  * Local payment types that require JS integration
449
  * @type {Object}
450
  */
451
- const types = {
452
  'ideal': IDEAL,
453
  'sepa_debit': Sepa,
454
  'klarna': Klarna,
33
 
34
  LocalPayment.prototype.elementType = null;
35
 
36
+ LocalPayment.prototype.is_active = function () {
37
+ return $('#wc_stripe_local_payment_' + this.gateway_id).data('active');
38
+ }
39
+
40
  LocalPayment.prototype.maybe_hide_gateway = function () {
41
+ if (!this.is_active()) {
42
  $(this.container).hide();
43
  } else {
44
  $(this.container).show();
151
  }
152
 
153
  LocalPayment.prototype.updated_checkout = function () {
154
+ this.mount_button();
155
  this.maybe_hide_gateway();
156
  }
157
 
187
  if (this.is_gateway_selected()) {
188
  var match = e.newURL.match(/response=(.*)/);
189
  if (match) {
190
+ history.pushState({}, '', window.location.pathname);
191
  var obj = JSON.parse(window.atob(match[1]));
192
  this.processConfirmation(obj);
193
  }
228
  LocalPayment.prototype.delete_order_source = function () {
229
  return new Promise(function (resolve, reject) {
230
  $.ajax({
231
+ url: this.params.routes.delete_order_source,
232
  method: 'DELETE',
233
  dataType: 'json',
234
  beforeSend: this.ajax_before_send.bind(this)
240
  }.bind(this))
241
  }
242
 
243
+ LocalPayment.prototype.update_source = function (args) {
244
+ return new Promise(function (resolve, reject) {
245
+ $.ajax({
246
+ url: this.params.routes.update_source,
247
+ method: 'POST',
248
+ dataType: 'json',
249
+ data: {
250
+ _wpnonce: this.params.rest_nonce,
251
+ updates: args,
252
+ source_id: this.source.id,
253
+ client_secret: this.source.client_secret,
254
+ payment_method: this.gateway_id
255
+ }
256
+ }).done(function (response) {
257
+ resolve(response.source);
258
+ }.bind(this)).fail(function () {
259
+ reject();
260
+ });
261
+ }.bind(this));
262
+ }
263
+
264
  /*********** iDEAL ***********/
265
  function IDEAL(params) {
266
  this.elementType = 'idealBank';
279
  function Klarna(params) {
280
  LocalPayment.call(this, params);
281
  $(document.body).on('change', '.wc-stripe-klarna-category', this.category_change.bind(this));
282
+ window.addEventListener('hashchange', this.hashchange.bind(this));
283
+ $('form.checkout').on('change', '.form-row:not(.address-field) .input-text, .form-row:not(.address-field) select', this.input_change.bind(this));
284
  }
285
 
286
  function FPX(params) {
309
  }
310
 
311
  Klarna.prototype.category_change = function (e) {
312
+ var change_category = function () {
 
313
  $('[id^="klarna-instance-"]').slideUp();
314
  var category = $('[name="klarna_category"]:checked').val();
315
  $('#klarna-instance-' + category).slideDown();
316
+ }.bind(this);
317
+ // if this is triggered via code, set delay to prevent rapid change
318
+ if (!e.originalEvent) {
319
+ clearTimeout(this.categoryChangeTimer);
320
+ this.categoryChangeTimer = setTimeout(change_category, 500);
321
+ } else {
322
+ change_category();
323
  }
324
  }
325
 
326
  Klarna.prototype.processConfirmation = function (source) {
 
 
 
 
327
  window.Klarna.Payments.init({
328
  client_token: source.klarna.client_token
329
  }, function (response) {
331
  }.bind(this));
332
  this.payment_categories = source.klarna.payment_method_categories.split(",");
333
  this.render_ui(true);
334
+ }
335
+
336
+ Klarna.prototype.hashchange = function () {
337
+ if (this.is_gateway_selected()) {
338
+ history.pushState({}, '', window.location.pathname);
339
+ this.get_form().submit();
340
+ }
341
  }
342
 
343
  Klarna.prototype.render_ui = function (trigger_change) {
346
  $('#wc_stripe_local_payment_stripe_klarna').show();
347
  for (var i = 0; i < this.payment_categories.length; i++) {
348
  var container = '#klarna-instance-' + this.payment_categories[i];
349
+ $(container).empty();
350
  if ($('#klarna-category-' + this.payment_categories[i]).length) {
351
+ if (this.params.translate) {
352
+ var text = this.source.klarna[this.payment_categories[i] + '_name'];
353
+ $('label[for="klarna_' + this.payment_categories[i] + '"').text(text);
354
+ }
355
  $('#klarna-category-' + this.payment_categories[i]).show();
356
  try {
357
  window.Klarna.Payments.load({
358
  container: container,
359
+ payment_method_category: this.payment_categories[i],
360
  instance_id: 'klarna-instance-' + this.payment_categories[i]
361
  }, function (response) {
362
  if (!response.show_form) {
363
+ this.source = null;
 
 
 
 
364
  }
365
  }.bind(this));
366
  } catch (e) {
377
  Klarna.prototype.place_order = function (e) {
378
  if (this.is_gateway_selected()) {
379
  e.preventDefault();
380
+ if (this.checkout_fields_valid()) {
 
381
  window.Klarna.Payments.authorize({
382
  instance_id: 'klarna-instance-' + $('[name="klarna_category"]:checked').val()
383
  }, function (res) {
384
  if (res.approved) {
385
+ this.set_nonce(this.source.id);
386
  this.payment_token_received = true;
387
+ this.get_form().submit();
388
  } else {
389
  if (res.error) {
390
  this.submit_error(res.error);
391
  } else {
 
392
  this.submit_error(this.params.messages.klarna_error);
393
  }
394
  }
395
  }.bind(this));
396
+ }
397
+ }
398
+ }
399
+
400
+ Klarna.prototype.klarna_fields_valid = function () {
401
+ if (this.fields.validateFields('billing')) {
402
+ if (this.needs_shipping()) {
403
+ if ('billing' === this.get_shipping_prefix() || ('shipping' === this.get_shipping_prefix() && this.fields.validateFields('shipping'))) {
404
+ return true;
405
+ }
406
  } else {
407
+ return true;
 
408
  }
409
  }
410
  }
411
 
412
  Klarna.prototype.initialize = function () {
413
+ if (this.is_gateway_selected() && this.is_active() && !this.source) {
414
+ // if fields valid create source
415
+ if (this.klarna_fields_valid()) {
416
+ this.createSource();
417
+ }
418
+ }
419
  }
420
 
421
  Klarna.prototype.createSource = function () {
422
+ // prevents multiple calls to the createSource function
423
+ // from intering with eachother
424
+ clearTimeout(this.createSourceTimer);
425
+ this.createSourceTimer = setTimeout(function () {
426
+ this.show_loader();
427
+ this.stripe.createSource(this.getSourceArgs()).then(function (response) {
428
+ // create payment sections
429
+ this.hide_loader();
430
+ if (response.error) {
431
+ return this.submit_error(response.error.message);
432
+ }
433
+ this.source = response.source;
434
+ this.set_nonce(this.source.id);
435
+ this.filter_payment_method_categories();
436
+ this.processConfirmation(this.source);
437
+ }.bind(this)).catch(function (err) {
438
+ this.hide_loader();
439
+ this.submit_error(err.message);
440
+ }.bind(this));
441
+ }.bind(this), 100);
442
+ }
443
+
444
+ Klarna.prototype.getSourceArgs = function () {
445
+ return $.extend(true, {}, this.get_gateway_data().source_args, (function () {
446
+ var args = {
447
+ owner: {
448
+ name: this.fields.get('billing_first_name') + ' ' + this.fields.get('billing_last_name'),
449
+ email: this.fields.get('billing_email'),
450
+ address: {
451
+ city: this.fields.get('billing_city'),
452
+ country: this.fields.get('billing_country'),
453
+ line1: this.fields.get('billing_address_1'),
454
+ line2: this.fields.get('billing_address_2'),
455
+ postal_code: this.fields.get('billing_postcode'),
456
+ state: this.fields.get('billing_state')
457
+ }
458
+ },
459
+ klarna: {
460
+ purchase_country: this.fields.get('billing_country'),
461
+ first_name: this.fields.get('billing_first_name'),
462
+ last_name: this.fields.get('billing_last_name')
463
+ }
464
+ }
465
+ if (this.needs_shipping()) {
466
+ var prefix = this.get_shipping_prefix();
467
+ args.klarna.shipping_first_name = this.fields.get('first_name', prefix);
468
+ args.klarna.shipping_last_name = this.fields.get('last_name', prefix);
469
+ args.source_order = {
470
+ shipping: {
471
+ address: {
472
+ city: this.fields.get('city', prefix),
473
+ country: this.fields.get('country', prefix),
474
+ line1: this.fields.get('address_1', prefix),
475
+ line2: this.fields.get('address_2', prefix),
476
+ postal_code: this.fields.get('postcode', prefix),
477
+ state: this.fields.get('state', prefix)
478
+ }
479
+ }
480
+ }
481
+ }
482
+ return args;
483
+ }.bind(this)()));
484
  }
485
 
486
  Klarna.prototype.updated_checkout = function () {
487
+ if (this.source) {
488
+ // update the source
489
+ this.update_source();
490
+
491
+ } else {
492
+ if (this.is_gateway_selected() && this.is_active() && this.klarna_fields_valid()) {
493
+ this.createSource();
494
+ }
495
  }
496
  LocalPayment.prototype.updated_checkout.apply(this, arguments);
497
  }
498
 
499
+ Klarna.prototype.update_source = function () {
500
+ var args = this.get_source_update_args(this.getSourceArgs());
501
+ this.show_loader();
502
+ LocalPayment.prototype.update_source.call(this, args).then(function (source) {
503
+ this.source = source;
504
+ this.filter_payment_method_categories();
505
+ this.hide_loader();
506
+ this.render_ui();
507
+ }.bind(this));
508
+ }
509
+
510
+ Klarna.prototype.checkout_error = function () {
511
+ LocalPayment.prototype.checkout_error.apply(this, arguments);
512
+ if (this.is_gateway_selected()) {
513
+ this.createSource();
514
+ }
515
+ }
516
+
517
+ Klarna.prototype.show_loader = function () {
518
+ $(this.container).find('.wc-stripe-klarna-loader').remove();
519
+ $(this.container).find('label[for="payment_method_' + this.gateway_id + '" ]').after(this.params.klarna_loader);
520
+ }
521
+
522
+ Klarna.prototype.hide_loader = function () {
523
+ $(this.container).find('.wc-stripe-klarna-loader').remove();
524
+ }
525
+
526
+ Klarna.prototype.filter_payment_method_categories = function () {
527
+ var categories = this.source.klarna.payment_method_categories.split(',');
528
+ this.source.klarna.payment_method_categories = categories.filter(function (value) {
529
+ return this.get_gateway_data().payment_sections.indexOf(value) > -1;
530
+ }.bind(this)).join(',');
531
+ }
532
+
533
+ Klarna.prototype.get_source_update_args = function (args) {
534
+ function reduce(obj, k) {
535
+ if (k.indexOf('.') > -1) {
536
+ var keys = k.split('.');
537
+ var obj2 = keys.slice(0, keys.length - 1).reduce(function (obj, k) {
538
+ return obj[k];
539
+ }, obj);
540
+ k = keys[keys.length - 1];
541
+ delete obj2[k];
542
+ return obj;
543
+ }
544
+ delete obj[k];
545
+ return obj;
546
+ }
547
+
548
+ return ['type', 'currency', 'statement_descriptor', 'redirect', 'klarna.product', 'klarna.locale', 'klarna.custom_payment_methods'].reduce(reduce, args);
549
+ }
550
+
551
+ Klarna.prototype.on_payment_method_selected = function (e, payment_method) {
552
+ if (payment_method === this.gateway_id) {
553
+ // only need an email address to create a Klarna source
554
+ if (!this.source) {
555
+ if (this.klarna_fields_valid()) {
556
+ this.createSource();
557
+ } else {
558
+ this.submit_error(this.params.messages.required_field);
559
+ }
560
+ }
561
+ wc_stripe.CheckoutGateway.prototype.on_payment_method_selected.apply(this, arguments);
562
+ }
563
+ }
564
+
565
+ Klarna.prototype.input_change = function () {
566
+ // if the fields are valid, then create the source if it doesn't exist
567
+ if (this.is_gateway_selected()) {
568
+ if (!this.source) {
569
+ if (this.klarna_fields_valid()) {
570
+ this.createSource();
571
+ }
572
+ } else {
573
+ this.update_source();
574
+ }
575
+ }
576
+ }
577
+
578
  WeChat.prototype.updated_checkout = function () {
579
  if (!this.script_loaded && $(this.container).length) {
580
  this.load_external_script(this.params.qr_script);
586
  if (this.is_gateway_selected()) {
587
  var match = e.newURL.match(/qrcode=(.*)/);
588
  if (match) {
589
+ history.pushState({}, '', window.location.pathname);
590
  this.qrcode = JSON.parse(window.atob(match[1]));
591
  this.get_form().unblock().removeClass('processing').addClass('wechat');
592
+ var qrCode = new QRCode('wc_stripe_local_payment_stripe_wechat', {
593
  text: this.qrcode.code,
594
  width: 128,
595
  height: 128,
643
  * Local payment types that require JS integration
644
  * @type {Object}
645
  */
646
+ var types = {
647
  'ideal': IDEAL,
648
  'sepa_debit': Sepa,
649
  'klarna': Klarna,
assets/js/frontend/local-payment.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(r,i){var e=r("#place_order").css("width");function s(e){i.BaseGateway.call(this,e),i.CheckoutGateway.call(this),r(document.body).on("click","#place_order",this.place_order.bind(this)),"order_pay"===this.get_page()&&r("#order_review").on("submit",this.process_order_pay.bind(this)),this.maybe_hide_gateway()}function t(e){this.elementType="idealBank",this.confirmation_method="confirmIdealPayment",s.call(this,e),window.addEventListener("hashchange",this.hashChange.bind(this))}function n(e){this.elementType="iban",s.call(this,e)}function o(e){s.call(this,e),r(document.body).on("change",".wc-stripe-klarna-category",this.category_change.bind(this)),window.addEventListener("hashchange",this.hashchange.bind(this)),r("form.checkout").on("change",".form-row:not(.address-field) .input-text, .form-row:not(.address-field) select",this.input_change.bind(this))}function a(e){this.elementType="fpxBank",this.confirmation_method="confirmFpxPayment",s.call(this,e),window.addEventListener("hashchange",this.hashChange.bind(this))}function h(e){s.call(this,e),window.addEventListener("hashchange",this.hashChange.bind(this))}function c(e){this.elementType="auBankAccount",this.confirmation_method="confirmAuBecsDebitPayment",s.call(this,e),window.addEventListener("hashchange",this.hashChange.bind(this))}r(document.body).on("updated_checkout",function(){r("#place_order").css("min-width",e)}),(s.prototype=r.extend({},i.BaseGateway.prototype,i.CheckoutGateway.prototype)).initialize=function(){this.mount_button()},s.prototype.elementType=null,s.prototype.is_active=function(){return r("#wc_stripe_local_payment_"+this.gateway_id).data("active")},s.prototype.maybe_hide_gateway=function(){this.is_active()?r(this.container).show():r(this.container).hide()},s.prototype.createSource=function(){return new Promise(function(t,e){var i=function(e){e.error?this.submit_error(e.error.message):(this.payment_token_received=!0,r(this.token_selector).val(e.source.id),this.get_form().submit()),t()}.bind(this);if(null!=this.elementType)if(this.confirmation_method){if(!this.isValidElement())return this.submit_error({code:"empty_element_"+this.params.local_payment_type,message:wc_stripe_messages.empty_element});this.payment_token_received=!0,this.get_form().submit()}else this.stripe.createSource(this.element,this.getSourceArgs()).then(i)["catch"](function(e){this.submit_error(e.message)}.bind(this));else this.payment_token_received=!0,this.get_form().submit()}.bind(this))},s.prototype.place_order=function(e){this.is_gateway_selected()&&(this.payment_token_received||(e.preventDefault(),this.createSource()))},s.prototype.process_order_pay=function(e){this.is_gateway_selected()&&(e.preventDefault(),(e=this.get_form().serializeArray()).push({name:"_wpnonce",value:this.params.rest_nonce}),e.push({name:"order_id",value:this.params.order_id}),r.ajax({url:this.params.routes.order_pay+window.location.search,method:"POST",dataType:"json",data:r.param(e)}).done(function(e){e.success?window.location.href=e.redirect:this.submit_error(e.message)}.bind(this)).fail(function(e,t,i){this.submit_error(i)}.bind(this)))},s.prototype.show_payment_button=function(){this.show_place_order()},s.prototype.hide_place_order=function(){},s.prototype.show_place_order=function(){i.CheckoutGateway.prototype.show_place_order.apply(this,arguments),this.payment_token_received&&r("#place_order").text(r("#place_order").data("value"))},s.prototype.getSourceArgs=function(){return{type:this.params.local_payment_type,amount:this.get_total_price_cents(),currency:this.get_currency(),owner:{name:this.get_customer_name("billing"),email:this.fields.get("billing_email",null)},redirect:{return_url:this.params.return_url}}},s.prototype.updated_checkout=function(){this.mount_button(),this.maybe_hide_gateway()},s.prototype.mount_button=function(){var e="#wc_stripe_local_payment_"+this.gateway_id;r(e).length&&null!=this.elementType&&(r(e).empty(),this.element||(this.element=this.elements.create(this.elementType,this.params.element_params),this.element.on("change",this.handleElementChange.bind(this))),this.elementEmpty=!0,this.element.mount(e))},s.prototype.handleElementChange=function(e){this.elementEmpty=e.empty},s.prototype.load_external_script=function(e){var t=document.createElement("script");t.type="text/javascript",t.src=e,t.onload=function(){this.script_loaded=!0}.bind(this),document.body.appendChild(t)},s.prototype.hashChange=function(e){!this.is_gateway_selected()||(e=e.newURL.match(/response=(.*)/))&&(history.pushState({},"",window.location.pathname),e=JSON.parse(window.atob(e[1])),this.processConfirmation(e))},s.prototype.processConfirmation=function(e){this.stripe[this.confirmation_method](e.client_secret,this.get_confirmation_args(e)).then(function(e){if(e.error)return this.submit_error(e.error.message);this.get_form().submit()}.bind(this))},s.prototype.get_confirmation_args=function(e){e={payment_method:{billing_details:{name:this.get_first_name("billing")+" "+this.get_last_name("billing")}},return_url:e.return_url};return this.elementType&&(e.payment_method[this.params.local_payment_type]=this.element),e},s.prototype.isValidElement=function(){return!this.element||!this.elementEmpty},s.prototype.delete_order_source=function(){return new Promise(function(t,e){r.ajax({url:this.params.routes.delete_order_source,method:"DELETE",dataType:"json",beforeSend:this.ajax_before_send.bind(this)}).done(function(e){t(e)}.bind(this)).fail(function(){e(response)}.bind(this))}.bind(this))},s.prototype.update_source=function(i){return new Promise(function(t,e){r.ajax({url:this.params.routes.update_source,method:"POST",dataType:"json",data:{_wpnonce:this.params.rest_nonce,updates:i,source_id:this.source.id,client_secret:this.source.client_secret,payment_method:this.gateway_id}}).done(function(e){t(e.source)}.bind(this)).fail(function(){e()})}.bind(this))},o.prototype.category_change=function(e){var t=function(){r('[id^="klarna-instance-"]').slideUp();var e=r('[name="klarna_category"]:checked').val();r("#klarna-instance-"+e).slideDown()}.bind(this);e.originalEvent?t():(clearTimeout(this.categoryChangeTimer),this.categoryChangeTimer=setTimeout(t,500))},o.prototype.processConfirmation=function(e){window.Klarna.Payments.init({client_token:e.klarna.client_token},function(e){}.bind(this)),this.payment_categories=e.klarna.payment_method_categories.split(","),this.render_ui(!0)},o.prototype.hashchange=function(){this.is_gateway_selected()&&(history.pushState({},"",window.location.pathname),this.get_form().submit())},o.prototype.render_ui=function(e){if((this.show_form_false=0)<this.payment_categories.length){r("#wc_stripe_local_payment_stripe_klarna").show();for(var t=0;t<this.payment_categories.length;t++){var i,s="#klarna-instance-"+this.payment_categories[t];if(r(s).empty(),r("#klarna-category-"+this.payment_categories[t]).length){this.params.translate&&(i=this.source.klarna[this.payment_categories[t]+"_name"],r('label[for="klarna_'+this.payment_categories[t]+'"').text(i)),r("#klarna-category-"+this.payment_categories[t]).show();try{window.Klarna.Payments.load({container:s,payment_method_category:this.payment_categories[t],instance_id:"klarna-instance-"+this.payment_categories[t]},function(e){e.show_form||(this.source=null)}.bind(this))}catch(n){window.alert(n)}}}e&&r('[id^="klarna-category-"]:visible [name="klarna_category"]').first().prop("checked",!0).trigger("change")}},o.prototype.place_order=function(e){this.is_gateway_selected()&&(e.preventDefault(),this.checkout_fields_valid()&&window.Klarna.Payments.authorize({instance_id:"klarna-instance-"+r('[name="klarna_category"]:checked').val()},function(e){e.approved?(this.set_nonce(this.source.id),this.payment_token_received=!0,this.get_form().submit()):e.error?this.submit_error(e.error):this.submit_error(this.params.messages.klarna_error)}.bind(this)))},o.prototype.klarna_fields_valid=function(){if(this.fields.validateFields("billing"))return!this.needs_shipping()||(!!("billing"===this.get_shipping_prefix()||"shipping"===this.get_shipping_prefix()&&this.fields.validateFields("shipping"))||void 0)},o.prototype.initialize=function(){this.is_gateway_selected()&&this.is_active()&&!this.source&&this.klarna_fields_valid()&&this.createSource()},o.prototype.createSource=function(){clearTimeout(this.createSourceTimer),this.createSourceTimer=setTimeout(function(){this.show_loader(),this.stripe.createSource(this.getSourceArgs()).then(function(e){if(this.hide_loader(),e.error)return this.submit_error(e.error.message);this.source=e.source,this.set_nonce(this.source.id),this.filter_payment_method_categories(),this.processConfirmation(this.source)}.bind(this))["catch"](function(e){this.hide_loader(),this.submit_error(e.message)}.bind(this))}.bind(this),100)},o.prototype.getSourceArgs=function(){return r.extend(!0,{},this.get_gateway_data().source_args,function(){var e,t={owner:{name:this.fields.get("billing_first_name")+" "+this.fields.get("billing_last_name"),email:this.fields.get("billing_email"),address:{city:this.fields.get("billing_city"),country:this.fields.get("billing_country"),line1:this.fields.get("billing_address_1"),line2:this.fields.get("billing_address_2"),postal_code:this.fields.get("billing_postcode"),state:this.fields.get("billing_state")}},klarna:{purchase_country:this.fields.get("billing_country"),first_name:this.fields.get("billing_first_name"),last_name:this.fields.get("billing_last_name")}};return this.needs_shipping()&&(e=this.get_shipping_prefix(),t.klarna.shipping_first_name=this.fields.get("first_name",e),t.klarna.shipping_last_name=this.fields.get("last_name",e),t.source_order={shipping:{address:{city:this.fields.get("city",e),country:this.fields.get("country",e),line1:this.fields.get("address_1",e),line2:this.fields.get("address_2",e),postal_code:this.fields.get("postcode",e),state:this.fields.get("state",e)}}}),t}.bind(this)())},o.prototype.updated_checkout=function(){this.source?this.update_source():this.is_gateway_selected()&&this.is_active()&&this.klarna_fields_valid()&&this.createSource(),s.prototype.updated_checkout.apply(this,arguments)},o.prototype.update_source=function(){var e=this.get_source_update_args(this.getSourceArgs());this.show_loader(),s.prototype.update_source.call(this,e).then(function(e){this.source=e,this.filter_payment_method_categories(),this.hide_loader(),this.render_ui()}.bind(this))},o.prototype.checkout_error=function(){s.prototype.checkout_error.apply(this,arguments),this.is_gateway_selected()&&this.createSource()},o.prototype.show_loader=function(){r(this.container).find(".wc-stripe-klarna-loader").remove(),r(this.container).find('label[for="payment_method_'+this.gateway_id+'" ]').after(this.params.klarna_loader)},o.prototype.hide_loader=function(){r(this.container).find(".wc-stripe-klarna-loader").remove()},o.prototype.filter_payment_method_categories=function(){var e=this.source.klarna.payment_method_categories.split(",");this.source.klarna.payment_method_categories=e.filter(function(e){return-1<this.get_gateway_data().payment_sections.indexOf(e)}.bind(this)).join(",")},o.prototype.get_source_update_args=function(e){return["type","currency","statement_descriptor","redirect","klarna.product","klarna.locale","klarna.custom_payment_methods"].reduce(function(e,t){if(-1<t.indexOf(".")){var i=t.split(".");return delete i.slice(0,i.length-1).reduce(function(e,t){return e[t]},e)[t=i[i.length-1]],e}return delete e[t],e},e)},o.prototype.on_payment_method_selected=function(e,t){t===this.gateway_id&&(this.source||(this.klarna_fields_valid()?this.createSource():this.submit_error(this.params.messages.required_field)),i.CheckoutGateway.prototype.on_payment_method_selected.apply(this,arguments))},o.prototype.input_change=function(){this.is_gateway_selected()&&(this.source?this.update_source():this.klarna_fields_valid()&&this.createSource())},h.prototype.updated_checkout=function(){!this.script_loaded&&r(this.container).length&&this.load_external_script(this.params.qr_script),s.prototype.updated_checkout.apply(this,arguments)},h.prototype.hashChange=function(e){!this.is_gateway_selected()||(e=e.newURL.match(/qrcode=(.*)/))&&(history.pushState({},"",window.location.pathname),this.qrcode=JSON.parse(window.atob(e[1])),this.get_form().unblock().removeClass("processing").addClass("wechat"),new QRCode("wc_stripe_local_payment_stripe_wechat",{text:this.qrcode.code,width:128,height:128,colorDark:"#424770",colorLight:"#f8fbfd",correctLevel:QRCode.CorrectLevel.H}),r("#wc_stripe_local_payment_stripe_wechat").append('<p class="qrcode-message">'+this.params.qr_message+"</p>"),this.payment_token_received=!0,this.show_place_order())},h.prototype.place_order=function(){this.get_form().is(".wechat")?window.location=this.qrcode.redirect:s.prototype.place_order.apply(this,arguments)},c.prototype.get_confirmation_args=function(e){var t=s.prototype.get_confirmation_args.apply(this,arguments);return t.payment_method.billing_details.email=this.fields.get("billing_email"),t},n.prototype.getSourceArgs=function(){return r.extend({},s.prototype.getSourceArgs.apply(this,arguments),{mandate:{notification_method:"email",interval:this.cart_contains_subscription()?"scheduled":"one_time"}})},t.prototype=r.extend({},s.prototype,t.prototype),n.prototype=r.extend({},s.prototype,n.prototype),o.prototype=r.extend({},s.prototype,o.prototype),a.prototype=r.extend({},s.prototype,a.prototype),h.prototype=r.extend({},s.prototype,h.prototype),c.prototype=r.extend({},s.prototype,c.prototype);var p,l={ideal:t,sepa_debit:n,klarna:o,fpx:a,wechat:h,au_becs_debit:c};for(p in wc_stripe_local_payment_params.gateways){var _=wc_stripe_local_payment_params.gateways[p];new(l[_.local_payment_type]||s)(_)}}(jQuery,window.wc_stripe);
assets/js/frontend/payment-request.js CHANGED
@@ -176,6 +176,7 @@
176
 
177
  PaymentRequest.prototype.initialize = function () {
178
  wc_stripe.CheckoutGateway.call(this);
 
179
  if ($(this.container).length) {
180
  wc_stripe.PaymentRequest.prototype.initialize.call(this);
181
  }
@@ -251,6 +252,12 @@
251
  this.get_form().submit();
252
  }
253
  }
 
 
 
 
 
 
254
  }
255
 
256
  new PaymentRequest();
176
 
177
  PaymentRequest.prototype.initialize = function () {
178
  wc_stripe.CheckoutGateway.call(this);
179
+ $('form.checkout').on('change', '.form-row:not(.address-field) .input-text', this.update_payment_request.bind(this));
180
  if ($(this.container).length) {
181
  wc_stripe.PaymentRequest.prototype.initialize.call(this);
182
  }
252
  this.get_form().submit();
253
  }
254
  }
255
+
256
+ PaymentRequest.prototype.update_payment_request = function () {
257
+ if ($(this.container).length) {
258
+ wc_stripe.PaymentRequest.prototype.initialize.call(this);
259
+ }
260
+ }
261
  }
262
 
263
  new PaymentRequest();
assets/js/frontend/wc-stripe.js CHANGED
@@ -356,7 +356,13 @@
356
  label: this.params.total_label,
357
  pending: true
358
  },
359
- requestPayerName: true,
 
 
 
 
 
 
360
  requestPayerEmail: this.fields.requestFieldInWallet('billing_email'),
361
  requestPayerPhone: this.fields.requestFieldInWallet('billing_phone'),
362
  requestShipping: (function () {
@@ -1391,7 +1397,12 @@
1391
  totalPriceLabel: this.params.total_price_label
1392
  }
1393
  });
1394
- request.allowedPaymentMethods[0].parameters['billingAddressRequired'] = true;
 
 
 
 
 
1395
  request.allowedPaymentMethods[0].parameters['billingAddressParameters'] = {
1396
  format: "FULL",
1397
  phoneNumberRequired: this.fields.requestFieldInWallet('billing_phone')
356
  label: this.params.total_label,
357
  pending: true
358
  },
359
+ requestPayerName: (function () {
360
+ if (this.is_current_page('checkout')) {
361
+ // if billing address is already filled out, then don't request it in wallet
362
+ return !this.is_valid_address(this.get_address_object('billing'), 'billing', ['email', 'phone']);
363
+ }
364
+ return true;
365
+ }.bind(this)()),
366
  requestPayerEmail: this.fields.requestFieldInWallet('billing_email'),
367
  requestPayerPhone: this.fields.requestFieldInWallet('billing_phone'),
368
  requestShipping: (function () {
1397
  totalPriceLabel: this.params.total_price_label
1398
  }
1399
  });
1400
+ request.allowedPaymentMethods[0].parameters['billingAddressRequired'] = (function () {
1401
+ if (this.is_current_page('checkout')) {
1402
+ return !this.is_valid_address(this.get_address_object('billing'), 'billing', ['email', 'phone']);
1403
+ }
1404
+ return true;
1405
+ }.bind(this)());
1406
  request.allowedPaymentMethods[0].parameters['billingAddressParameters'] = {
1407
  format: "FULL",
1408
  phoneNumberRequired: this.fields.requestFieldInWallet('billing_phone')
assets/js/frontend/wc-stripe.min.js CHANGED
@@ -1 +1 @@
1
- !function(i,o){i.wc_stripe={};var s=null;"undefined"==typeof wc_stripe_checkout_fields&&(i.wc_stripe_checkout_fields=[]),wc_stripe.BaseGateway=function(t,e){this.params=t,this.gateway_id=this.params.gateway_id,this.container=void 0===e?"li.payment_method_".concat(this.gateway_id):e,o(this.container).length||(this.container=".payment_method_".concat(this.gateway_id)),this.token_selector=this.params.token_selector,this.saved_method_selector=this.params.saved_method_selector,this.payment_token_received=!1,this.stripe=s,this.elements=s.elements(o.extend({},{locale:"auto"},this.get_element_options())),this.fields=r,this.initialize()},wc_stripe.BaseGateway.prototype.get_page=function(){var t=wc_stripe_params_v3.page;return"cart"===t&&o(document.body).is(".woocommerce-checkout")&&(t="checkout"),t},wc_stripe.BaseGateway.prototype.set_nonce=function(t){this.fields.set(this.gateway_id+"_token_key",t),o(this.token_selector).val(t)},wc_stripe.BaseGateway.prototype.get_element_options=function(){return{}},wc_stripe.BaseGateway.prototype.initialize=function(){},wc_stripe.BaseGateway.prototype.create_button=function(){},wc_stripe.BaseGateway.prototype.is_gateway_selected=function(){return o('[name="payment_method"]:checked').val()===this.gateway_id},wc_stripe.BaseGateway.prototype.is_saved_method_selected=function(){return this.is_gateway_selected()&&"saved"===o('[name="'+this.gateway_id+'_payment_type_key"]:checked').val()},wc_stripe.BaseGateway.prototype.has_checkout_error=function(){return 0<o("#wc_stripe_checkout_error").length&&this.is_gateway_selected()},wc_stripe.BaseGateway.prototype.submit_error=function(t){-1==(t=this.get_error_message(t)).indexOf("</ul>")&&(t='<div class="woocommerce-error">'+t+"</div>"),this.submit_message(t)},wc_stripe.BaseGateway.prototype.submit_error_code=function(t){console.log(t)},wc_stripe.BaseGateway.prototype.get_error_message=function(t){return"object"==typeof t&&t.code&&(t=wc_stripe_messages[t.code]||t.message),t},wc_stripe.BaseGateway.prototype.submit_message=function(t){o(".woocommerce-error, .woocommerce-message, .woocommerce-info").remove();var e=o(this.message_container);e.closest("form").length&&(e=e.closest("form")),e.prepend(t),e.removeClass("processing").unblock(),e.find(".input-text, select, input:checkbox").blur(),o.scroll_to_notices?o.scroll_to_notices(e):o("html, body").animate({scrollTop:e.offset().top-100},1e3)},wc_stripe.BaseGateway.prototype.get_first_name=function(t){return o("#"+t+"_first_name").val()},wc_stripe.BaseGateway.prototype.get_last_name=function(t){return o("#"+t+"_last_name").val()},wc_stripe.BaseGateway.prototype.get_shipping_prefix=function(){return this.needs_shipping()&&0<o('[name="ship_to_different_address"]').length&&o('[name="ship_to_different_address"]').is(":checked")?"shipping":"billing"},wc_stripe.BaseGateway.prototype.should_save_method=function(){return o("#"+this.gateway_id+"_save_source_key").is(":checked")},wc_stripe.BaseGateway.prototype.is_add_payment_method_page=function(){return"add_payment_method"===this.get_page()||o(document.body).hasClass("woocommerce-add-payment-method")},wc_stripe.BaseGateway.prototype.is_change_payment_method=function(){return"change_payment_method"===this.get_page()},wc_stripe.BaseGateway.prototype.get_selected_payment_method=function(){return o(this.saved_method_selector).val()},wc_stripe.BaseGateway.prototype.needs_shipping=function(){return this.get_gateway_data().needs_shipping},wc_stripe.BaseGateway.prototype.get_currency=function(){return this.get_gateway_data().currency},wc_stripe.BaseGateway.prototype.get_gateway_data=function(){var t=o(this.container).find(".woocommerce_".concat(this.gateway_id,"_gateway_data")).data("gateway");return void 0===t&&this.is_current_page("checkout")&&(t=o("form.checkout").find(".woocommerce_".concat(this.gateway_id,"_gateway_data")).data("gateway")),t},wc_stripe.BaseGateway.prototype.set_gateway_data=function(t){o(this.container).find(".woocommerce_".concat(this.gateway_id,"_gateway_data")).data("gateway",t)},wc_stripe.BaseGateway.prototype.get_customer_name=function(t){return this.fields.get(t+"_first_name")+" "+this.fields.get(t+"_last_name")},wc_stripe.BaseGateway.prototype.get_customer_email=function(){return this.fields.get("billing_email")},wc_stripe.BaseGateway.prototype.get_address_field_hash=function(t){for(var e=["_first_name","_last_name","_address_1","_address_2","_postcode","_city","_state","_country"],i="",s=0;s<e.length;s++)i+=this.fields.get(t+e[s])+"_";return i},wc_stripe.BaseGateway.prototype.block=function(){o().block&&o.blockUI({message:null,overlayCSS:{background:"#fff",opacity:.6}})},wc_stripe.BaseGateway.prototype.unblock=function(){o().block&&o.unblockUI()},wc_stripe.BaseGateway.prototype.get_form=function(){return o(this.token_selector).closest("form")},wc_stripe.BaseGateway.prototype.get_total_price=function(){return this.get_gateway_data().total},wc_stripe.BaseGateway.prototype.get_total_price_cents=function(){return this.get_gateway_data().total_cents},wc_stripe.BaseGateway.prototype.set_total_price=function(t){var e=this.get_gateway_data();e.total=t,this.set_gateway_data(e)},wc_stripe.BaseGateway.prototype.set_total_price_cents=function(t){var e=this.get_gateway_data();e.total_cents=t,this.set_gateway_data(e)},wc_stripe.BaseGateway.prototype.set_payment_method=function(t){o('[name="payment_method"][value="'+t+'"]').prop("checked",!0).trigger("click")},wc_stripe.BaseGateway.prototype.set_selected_shipping_methods=function(t){if(this.fields.set("shipping_method",t),t&&o('[name^="shipping_method"]').length)for(var e in t){var i=t[e];o('[name="shipping_method['+e+']"][value="'+i+'"]').prop("checked",!0).trigger("change")}},wc_stripe.BaseGateway.prototype.on_token_received=function(t){this.payment_token_received=!0,this.set_nonce(t.id),this.process_checkout()},wc_stripe.BaseGateway.prototype.createPaymentRequest=function(){try{this.payment_request_options=this.get_payment_request_options(),this.paymentRequest=s.paymentRequest(this.payment_request_options),this.payment_request_options.requestShipping&&(this.paymentRequest.on("shippingaddresschange",this.update_shipping_address.bind(this)),this.paymentRequest.on("shippingoptionchange",this.update_shipping_method.bind(this))),this.paymentRequest.on("paymentmethod",this.on_payment_method_received.bind(this))}catch(t){return void this.submit_error(t.message)}},wc_stripe.BaseGateway.prototype.get_payment_request_options=function(){var t={country:this.params.country_code,currency:this.get_currency().toLowerCase(),total:{amount:this.get_total_price_cents(),label:this.params.total_label,pending:!0},requestPayerName:!0,requestPayerEmail:this.fields.requestFieldInWallet("billing_email"),requestPayerPhone:this.fields.requestFieldInWallet("billing_phone"),requestShipping:function(){if(this.needs_shipping()){var t=this.get_shipping_prefix();if(this.is_current_page("checkout")&&!this.is_valid_address(this.get_address_object(t),t,["email","phone"])||!this.is_current_page("checkout"))return!0}return!1}.bind(this)()},e=this.get_display_items(),i=this.get_shipping_options();return e&&(t.displayItems=e),t.requestShipping&&i&&(t.shippingOptions=i),t},wc_stripe.BaseGateway.prototype.get_payment_request_update=function(t){var e={currency:this.get_currency().toLowerCase(),total:{amount:parseInt(this.get_total_price_cents()),label:this.params.total_label,pending:!0}},i=this.get_display_items(),s=this.get_shipping_options();return i&&(e.displayItems=i),this.payment_request_options.requestShipping&&s&&(e.shippingOptions=s),t&&(e=o.extend(!0,{},e,t)),e},wc_stripe.BaseGateway.prototype.get_display_items=function(){return this.get_gateway_data().items},wc_stripe.BaseGateway.prototype.set_display_items=function(t){var e=this.get_gateway_data();e.items=t,this.set_gateway_data(e)},wc_stripe.BaseGateway.prototype.get_shipping_options=function(){return this.get_gateway_data().shipping_options},wc_stripe.BaseGateway.prototype.set_shipping_options=function(t){var e=this.get_gateway_data();e.shipping_options=t,this.set_gateway_data(e)},wc_stripe.BaseGateway.prototype.map_address=function(t){return{city:t.city,postcode:t.postalCode,state:t.region,country:t.country}},wc_stripe.BaseGateway.prototype.on_payment_method_received=function(t){try{this.payment_response=t,this.populate_checkout_fields(t),t.complete("success"),this.on_token_received(t.paymentMethod)}catch(e){i.alert(e)}},wc_stripe.BaseGateway.prototype.populate_checkout_fields=function(t){this.set_nonce(t.paymentMethod.id),this.update_addresses(t)},wc_stripe.BaseGateway.prototype.update_addresses=function(t){t.payerName&&this.fields.set("name",t.payerName,"billing"),t.payerEmail&&this.fields.set("email",t.payerEmail,"billing"),t.payerPhone&&this.fields.set("phone",t.payerPhone,"billing"),t.shippingAddress&&this.populate_shipping_fields(t.shippingAddress),t.paymentMethod.billing_details.address&&this.populate_billing_fields(t.paymentMethod.billing_details.address)},wc_stripe.BaseGateway.prototype.populate_address_fields=function(t,e){for(var i in t)null!==t[i]&&this.fields.set(i,t[i],e)},wc_stripe.BaseGateway.prototype.populate_billing_fields=function(t){this.populate_address_fields(t,"billing")},wc_stripe.BaseGateway.prototype.populate_shipping_fields=function(t){this.populate_address_fields(t,"shipping")},wc_stripe.BaseGateway.prototype.get_address_fields=function(){return["first_name","last_name","country","address_1","address_2","city","state","postcode","phone","email"]},wc_stripe.BaseGateway.prototype.get_address_object=function(e){var i={};return this.get_address_fields().forEach(function(t){i[t]=this.fields.get(t,e)}.bind(this)),i},wc_stripe.BaseGateway.prototype.is_current_page=function(t){return this.get_page()===t},wc_stripe.BaseGateway.prototype.is_valid_address=function(t,e,i){if(o.isEmptyObject(t))return!1;var s=this.get_address_fields();void 0!==i&&i.forEach(function(t){-1<s.indexOf(t)&&s.splice(s.indexOf(t),1)});for(var a=0;a<s.length;a++){var n=s[a];if(this.fields.required(e+"_"+n)&&(!t[n]||"undefined"==typeof t[n]||!this.fields.isValid(n,t[n],t)))return!1}return!0},wc_stripe.BaseGateway.prototype.ajax_before_send=function(t){0<this.params.user_id&&t.setRequestHeader("X-WP-Nonce",this.params.rest_nonce)},wc_stripe.BaseGateway.prototype.process_checkout=function(){return new Promise(function(){this.block(),o.ajax({url:this.params.routes.checkout,method:"POST",dataType:"json",data:o.extend({},this.serialize_fields(),{payment_method:this.gateway_id,page_id:this.get_page(),currency:this.get_currency()}),beforeSend:this.ajax_before_send.bind(this)}).done(function(t){t.reload?i.location.reload():"success"===t.result?i.location=t.redirect:(t.messages&&this.submit_error(t.messages),this.unblock())}.bind(this)).fail(function(t,e,i){this.unblock(),this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.BaseGateway.prototype.serialize_form=function(t){var e,i=t.find("input").filter(function(t,e){return!o(e).is('[name^="add-to-cart"]')}.bind(this)).serializeArray(),s={};for(e in i){var a=i[e];s[a.name]=a.value}return s.payment_method=this.gateway_id,s},wc_stripe.BaseGateway.prototype.serialize_fields=function(){return o.extend({},this.fields.toJson(),o(document.body).triggerHandler("wc_stripe_process_checkout_data",[this,this.fields]))},wc_stripe.BaseGateway.prototype.map_shipping_methods=function(t){var e={};return"default"===t||1<(t=t.match(/^([\w+]):(.+)$/)).length&&(e[t[1]]=t[2]),e},wc_stripe.BaseGateway.prototype.maybe_set_ship_to_different=function(){o('[name="ship_to_different_address"]').length&&o('[name="ship_to_different_address"]').prop("checked",this.get_address_field_hash("billing")!==this.get_address_field_hash("shipping")).trigger("change")},wc_stripe.BaseGateway.prototype.update_shipping_address=function(s){return new Promise(function(e,i){o.ajax({url:this.params.routes.shipping_address,method:"POST",dataType:"json",data:{address:this.map_address(s.shippingAddress),payment_method:this.gateway_id,page_id:this.get_page(),currency:this.get_currency()},beforeSend:this.ajax_before_send.bind(this)}).done(function(t){t.code?(s.updateWith(t.data.newData),i(t.data)):(s.updateWith(t.data.newData),this.fields.set("shipping_method",t.data.shipping_method),e(t.data))}.bind(this)).fail(function(){}.bind(this))}.bind(this))},wc_stripe.BaseGateway.prototype.update_shipping_method=function(s){return new Promise(function(e,i){o.ajax({url:this.params.routes.shipping_method,method:"POST",dataType:"json",data:{shipping_method:s.shippingOption.id,payment_method:this.gateway_id,currency:this.get_currency(),page_id:this.get_page()},beforeSend:this.ajax_before_send.bind(this)}).done(function(t){t.code?(s.updateWith(t.data.newData),i(t.data)):(this.set_selected_shipping_methods(t.data.shipping_methods),s.updateWith(t.data.newData),e(t.data))}.bind(this)).fail(function(t,e,i){this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.CheckoutGateway=function(){this.message_container="li.payment_method_"+this.gateway_id,this.banner_container="li.banner_payment_method_"+this.gateway_id,o(document.body).on("update_checkout",this.update_checkout.bind(this)),o(document.body).on("updated_checkout",this.updated_checkout.bind(this)),o(document.body).on("cfw_updated_checkout",this.updated_checkout.bind(this)),o(document.body).on("checkout_error",this.checkout_error.bind(this)),o(this.token_selector).closest("form").on("checkout_place_order_"+this.gateway_id,this.checkout_place_order.bind(this)),o(document.body).on("wc_stripe_new_method_"+this.gateway_id,this.on_show_new_methods.bind(this)),o(document.body).on("wc_stripe_saved_method_"+this.gateway_id,this.on_show_saved_methods.bind(this)),o(document.body).on("wc_stripe_payment_method_selected",this.on_payment_method_selected.bind(this)),this.banner_enabled()&&o(".woocommerce-billing-fields").length&&o(".wc-stripe-banner-checkout").css("max-width",o(".woocommerce-billing-fields").outerWidth(!0)),this.order_review()},wc_stripe.CheckoutGateway.prototype.order_review=function(){var t,e=i.location.href.match(/order_review.+payment_method=([\w]+).+payment_nonce=(.+)/);e&&1<e.length&&(t=e[1],e=e[2],this.gateway_id===t&&(this.payment_token_received=!0,this.set_nonce(e),this.set_use_new_option(!0)))},wc_stripe.CheckoutGateway.prototype.update_shipping_address=function(){return wc_stripe.BaseGateway.prototype.update_shipping_address.apply(this,arguments).then(function(t){this.populate_address_fields(t.address,this.get_shipping_prefix()),this.fields.toFormFields({update_shipping_method:!1})}.bind(this))},wc_stripe.CheckoutGateway.prototype.updated_checkout=function(){},wc_stripe.CheckoutGateway.prototype.update_checkout=function(){},wc_stripe.CheckoutGateway.prototype.checkout_error=function(){this.has_checkout_error()&&(this.payment_token_received=!1,this.payment_response=null,this.show_payment_button(),this.hide_place_order())},wc_stripe.CheckoutGateway.prototype.is_valid_checkout=function(){return!(o('[name="terms"]').length&&!o('[name="terms"]').is(":checked"))},wc_stripe.CheckoutGateway.prototype.get_payment_method=function(){return o('[name="payment_method"]:checked').val()},wc_stripe.CheckoutGateway.prototype.set_use_new_option=function(t){o("#"+this.gateway_id+"_use_new").prop("checked",t).trigger("change")},wc_stripe.CheckoutGateway.prototype.checkout_place_order=function(){return this.is_valid_checkout()?!!this.is_saved_method_selected()||this.payment_token_received:(this.submit_error(this.params.messages.terms),!1)},wc_stripe.CheckoutGateway.prototype.on_token_received=function(t){this.payment_token_received=!0,this.set_nonce(t.id),this.hide_payment_button(),this.show_place_order()},wc_stripe.CheckoutGateway.prototype.block=function(){o().block&&o("form.checkout").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},wc_stripe.CheckoutGateway.prototype.unblock=function(){o().block&&o("form.checkout").unblock()},wc_stripe.CheckoutGateway.prototype.hide_place_order=function(){o("#place_order").addClass("wc-stripe-hide")},wc_stripe.CheckoutGateway.prototype.show_place_order=function(){o("#place_order").removeClass("wc-stripe-hide")},wc_stripe.CheckoutGateway.prototype.on_show_new_methods=function(){this.payment_token_received?(this.show_place_order(),this.hide_payment_button()):(this.hide_place_order(),this.show_payment_button())},wc_stripe.CheckoutGateway.prototype.on_show_saved_methods=function(){this.hide_payment_button(),this.show_place_order()},wc_stripe.CheckoutGateway.prototype.show_payment_button=function(){this.$button&&this.$button.show()},wc_stripe.CheckoutGateway.prototype.hide_payment_button=function(){this.$button&&this.$button.hide()},wc_stripe.CheckoutGateway.prototype.trigger_payment_method_selected=function(){this.on_payment_method_selected(null,o('[name="payment_method"]:checked').val())},wc_stripe.CheckoutGateway.prototype.on_payment_method_selected=function(t,e){e===this.gateway_id?this.payment_token_received||this.is_saved_method_selected()?(this.hide_payment_button(),this.show_place_order()):(this.show_payment_button(),this.hide_place_order()):(this.hide_payment_button(),e.indexOf("stripe_")<0&&this.show_place_order())},wc_stripe.CheckoutGateway.prototype.banner_enabled=function(){return"1"===this.params.banner_enabled},wc_stripe.CheckoutGateway.prototype.checkout_fields_valid=function(){if(["checkout","order_pay"].indexOf(this.get_page())<0)return!0;var t=!0;return(t=this.fields.validateFields("billing"))?this.needs_shipping()&&o("#ship-to-different-address-checkbox").is(":checked")?(t=this.fields.validateFields("shipping"))||this.submit_error(this.params.messages.required_field):(t=this.is_valid_checkout())||this.submit_error(this.params.messages.terms):this.submit_error(this.params.messages.required_field),t},wc_stripe.CheckoutGateway.prototype.cart_contains_subscription=function(){return"undefined"!=typeof wc_stripe_cart_contains_subscription&&!0===wc_stripe_cart_contains_subscription},wc_stripe.ProductGateway=function(){this.message_container="div.product",o("form.cart").on("found_variation",this.found_variation.bind(this)),o("form.cart").on("reset_data",this.reset_variation_data.bind(this)),this.buttonWidth=o("form.cart div.quantity").outerWidth(!0)+o(".single_add_to_cart_button").outerWidth();var t=o(".single_add_to_cart_button").css("marginLeft");t&&(this.buttonWidth+=parseInt(t.replace("px",""))),o(this.container).css("max-width",this.buttonWidth+"px")},wc_stripe.ProductGateway.prototype.get_quantity=function(){return parseInt(o('[name="quantity"]').val())},wc_stripe.ProductGateway.prototype.set_rest_nonce=function(t,e){this.params.rest_nonce=e},wc_stripe.ProductGateway.prototype.found_variation=function(t,e){var i=this.get_gateway_data();i.product.price=e.display_price,i.needs_shipping=!e.is_virtual,i.product.variation=e,this.set_gateway_data(i)},wc_stripe.ProductGateway.prototype.reset_variation_data=function(){var t=this.get_product_data();t.variation=!1,this.set_product_data(t),this.disable_payment_button()},wc_stripe.ProductGateway.prototype.disable_payment_button=function(){this.$button&&this.get_button().prop("disabled",!0).addClass("disabled")},wc_stripe.ProductGateway.prototype.enable_payment_button=function(){this.$button&&this.get_button().prop("disabled",!1).removeClass("disabled")},wc_stripe.ProductGateway.prototype.get_button=function(){return this.$button},wc_stripe.ProductGateway.prototype.is_variable_product=function(){return 0<o('[name="variation_id"]').length},wc_stripe.ProductGateway.prototype.variable_product_selected=function(){return!1!==this.get_product_data().variation},wc_stripe.ProductGateway.prototype.get_product_data=function(){return this.get_gateway_data().product},wc_stripe.ProductGateway.prototype.set_product_data=function(t){var e=this.get_gateway_data();e.product=t,this.set_gateway_data(e)},wc_stripe.ProductGateway.prototype.add_to_cart=function(){return new Promise(function(e,i){this.block(),o.ajax({url:this.params.routes.add_to_cart,method:"POST",dataType:"json",data:{product_id:this.get_product_data().id,variation_id:this.is_variable_product()?o('[name="variation_id"]').val():0,qty:o('[name="quantity"]').val(),payment_method:this.gateway_id,currency:this.get_currency(),page_id:this.get_page()},beforeSend:this.ajax_before_send.bind(this)}).done(function(t){this.unblock(),t.code?(this.submit_error(t.message),i(t)):(this.set_total_price(t.data.total),this.set_total_price_cents(t.data.totalCents),this.set_display_items(t.data.displayItems),e(t.data))}.bind(this)).fail(function(t,e,i){this.unblock(),this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.ProductGateway.prototype.cart_calculation=function(t){return new Promise(function(e,i){o.ajax({url:this.params.routes.cart_calculation,method:"POST",dataType:"json",data:{product_id:this.get_product_data().id,variation_id:this.is_variable_product()&&t?t:0,qty:o('[name="quantity"]').val(),currency:this.get_currency(),payment_method:this.gateway_id},beforeSend:this.ajax_before_send.bind(this)}).done(function(t){t.code?(this.cart_calculation_error=!0,i(t)):(this.set_total_price(t.data.total),this.set_total_price_cents(t.data.totalCents),this.set_display_items(t.data.displayItems),e(t.data))}.bind(this)).fail(function(){}.bind(this))}.bind(this))},wc_stripe.CartGateway=function(){this.message_container="div.woocommerce",o(document.body).on("updated_wc_div",this.updated_html.bind(this)),o(document.body).on("updated_cart_totals",this.updated_html.bind(this)),o(document.body).on("wc_cart_emptied",this.cart_emptied.bind(this))},wc_stripe.CartGateway.prototype.submit_error=function(t){this.submit_message(this.get_error_message(t))},wc_stripe.CartGateway.prototype.updated_html=function(t){},wc_stripe.CartGateway.prototype.cart_emptied=function(t){},wc_stripe.CartGateway.prototype.add_cart_totals_class=function(){o(".cart_totals").addClass("stripe_cart_gateway_active")},wc_stripe.GooglePay=function(){};var a={apiVersion:2,apiVersionMinor:0},n={type:"CARD",parameters:{allowedAuthMethods:["PAN_ONLY"],allowedCardNetworks:["AMEX","DISCOVER","INTERAC","JCB","MASTERCARD","VISA"]}};wc_stripe.GooglePay.prototype.update_addresses=function(t){this.populate_billing_fields(t.paymentMethodData.info.billingAddress),t.shippingAddress&&this.populate_shipping_fields(t.shippingAddress),t.email&&this.fields.set("email",t.email,"billing")},wc_stripe.GooglePay.prototype.map_address=function(t){return{city:t.locality,postcode:t.postalCode,state:t.administrativeArea,country:t.countryCode}},wc_stripe.GooglePay.prototype.update_payment_data=function(s){return new Promise(function(e,i){var t="default"==s.shippingOptionData.id?null:s.shippingOptionData.id;o.when(o.ajax({url:this.params.routes.payment_data,dataType:"json",method:"POST",data:{address:this.map_address(s.shippingAddress),shipping_method:t,page_id:this.get_page(),currency:this.get_currency()},beforeSend:this.ajax_before_send.bind(this)})).done(function(t){t.code?i(t.data.data):e(t.data)}.bind(this)).fail(function(){i()}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.on_payment_data_changed=function(i){return new Promise(function(e){this.update_payment_data(i).then(function(t){e(t.paymentRequestUpdate),this.set_selected_shipping_methods(t.shipping_methods),this.payment_data_updated(t,i)}.bind(this))["catch"](function(t){e(t)}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.payment_data_updated=function(t){},wc_stripe.GooglePay.prototype.get_merchant_info=function(){var t={merchantId:this.params.merchant_id,merchantName:this.params.merchant_name};return"TEST"===this.params.environment&&delete t.merchantId,t},wc_stripe.GooglePay.prototype.get_payment_options=function(){var t,e={environment:this.params.environment,merchantInfo:this.get_merchant_info(),paymentDataCallbacks:{onPaymentAuthorized:function(){return new Promise(function(t){t({transactionState:"SUCCESS"})}.bind(this))}}};return this.needs_shipping()&&(t=this.get_shipping_prefix(),(!this.is_current_page("checkout")||this.is_valid_address(this.get_address_object(t),t,["email","phone"]))&&this.is_current_page("checkout")||(e.paymentDataCallbacks.onPaymentDataChanged=this.on_payment_data_changed.bind(this))),e},wc_stripe.GooglePay.prototype.build_payment_request=function(){var t=o.extend({},a,{emailRequired:this.fields.requestFieldInWallet("billing_email"),merchantInfo:this.get_merchant_info(),allowedPaymentMethods:[o.extend({type:"CARD",tokenizationSpecification:{type:"PAYMENT_GATEWAY",parameters:{gateway:"stripe","stripe:version":"2018-10-31","stripe:publishableKey":this.params.api_key}}},n)],shippingAddressRequired:function(){if(this.needs_shipping()){var t=this.get_shipping_prefix();if(this.is_current_page("checkout")&&!this.is_valid_address(this.get_address_object(t),t,["email","phone"])||!this.is_current_page("checkout"))return!0}return!1}.bind(this)(),transactionInfo:{currencyCode:this.get_currency(),totalPriceStatus:"ESTIMATED",totalPrice:this.get_total_price().toString(),displayItems:this.get_display_items(),totalPriceLabel:this.params.total_price_label}});return t.allowedPaymentMethods[0].parameters.billingAddressRequired=!0,t.allowedPaymentMethods[0].parameters.billingAddressParameters={format:"FULL",phoneNumberRequired:this.fields.requestFieldInWallet("billing_phone")},t.shippingAddressRequired?(t.shippingAddressParameters={},t.shippingOptionRequired=!0,t.shippingOptionParameters={shippingOptions:this.get_shipping_options()},t.callbackIntents=["SHIPPING_ADDRESS","SHIPPING_OPTION","PAYMENT_AUTHORIZATION"]):t.callbackIntents=["PAYMENT_AUTHORIZATION"],this.payment_request_options=t},wc_stripe.GooglePay.prototype.createPaymentsClient=function(){this.paymentsClient=new google.payments.api.PaymentsClient(this.get_payment_options())},wc_stripe.GooglePay.prototype.isReadyToPay=function(){return new Promise(function(t){var e=o.extend({},a);e.allowedPaymentMethods=[n],this.paymentsClient.isReadyToPay(e).then(function(){this.can_pay=!0,this.create_button(),t()}.bind(this))["catch"](function(t){this.submit_error(t)}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.create_button=function(){this.$button&&this.$button.remove(),this.$button=o(this.paymentsClient.createButton({onClick:this.start.bind(this),buttonColor:this.params.button_color,buttonType:this.params.button_style})),this.$button.addClass("gpay-button-container")},wc_stripe.GooglePay.prototype.start=function(){this.createPaymentsClient(),this.paymentsClient.loadPaymentData(this.build_payment_request()).then(function(t){var e=JSON.parse(t.paymentMethodData.tokenizationData.token);this.update_addresses(t),this.on_token_received(e)}.bind(this))["catch"](function(t){"CANCELED"!==t.statusCode&&(t.statusMessage&&-1<t.statusMessage.indexOf("paymentDataRequest.callbackIntent")?this.submit_error_code("DEVELOPER_ERROR_WHITELIST"):this.submit_error(t.message))}.bind(this))},wc_stripe.ApplePay=function(){},wc_stripe.ApplePay.prototype.initialize=function(){this.createPaymentRequest(),this.canMakePayment()},wc_stripe.ApplePay.prototype.create_button=function(){this.$button&&this.$button.remove(),this.$button=o(this.params.button),this.$button.on("click",this.start.bind(this)),this.append_button()},wc_stripe.ApplePay.prototype.canMakePayment=function(){return new Promise(function(e){this.paymentRequest.canMakePayment().then(function(t){t&&t.applePay&&(this.can_pay=!0,this.create_button(),o(this.container).show(),e(t))}.bind(this))}.bind(this))},wc_stripe.ApplePay.prototype.start=function(t){t.preventDefault(),this.paymentRequest.update(this.get_payment_request_update({total:{pending:!1}})),this.paymentRequest.show()},wc_stripe.PaymentRequest=function(){},wc_stripe.PaymentRequest.prototype.initialize=function(){this.createPaymentRequest(),this.createPaymentRequestButton(),this.canMakePayment(),this.paymentRequestButton.on("click",this.button_click.bind(this))},wc_stripe.PaymentRequest.prototype.button_click=function(t){},wc_stripe.PaymentRequest.prototype.createPaymentRequestButton=function(){this.paymentRequestButton&&this.paymentRequestButton.destroy(),this.paymentRequestButton=this.elements.create("paymentRequestButton",{paymentRequest:this.paymentRequest,style:{paymentRequestButton:{type:this.params.button.type,theme:this.params.button.theme,height:this.params.button.height}}})},wc_stripe.PaymentRequest.prototype.canMakePayment=function(){return new Promise(function(e){this.paymentRequest.canMakePayment().then(function(t){t&&!t.applePay&&(this.can_pay=!0,this.create_button(),o(this.container).show(),e(t))}.bind(this))}.bind(this))},wc_stripe.PaymentRequest.prototype.create_button=function(){this.paymentRequestButton.mount("#wc-stripe-payment-request-container")},wc_stripe.CheckoutFields=function(t,e){this.params=t,this.page=e,this.fields=new Map(Object.keys(this.params).map(function(t){return null===this.params[t].value&&(this.params[t].value=""),[t,this.params[t].value]}.bind(this))),("checkout"===e||"cart"===e&&o(document.body).is(".woocommerce-checkout"))&&(o("form.checkout").on("change",".input-text, select",this.onChange.bind(this)),o("form.checkout").on("change",'[name="ship_to_different_address"]',this.on_ship_to_address_change.bind(this)),this.init_i18n(),o('[name="ship_to_different_address"]').is(":checked")?this.update_required_fields(o("#shipping_country").val(),"shipping_country"):this.update_required_fields(o("#billing_country").val(),"billing_country"))},wc_stripe.CheckoutFields.prototype.init_i18n=function(){"undefined"!=typeof wc_address_i18n_params?this.locales=o.parseJSON(wc_address_i18n_params.locale.replace(/&quot;/g,'"')):this.locales=null},wc_stripe.CheckoutFields.prototype.onChange=function(t){try{var e=t.currentTarget.name,i=t.currentTarget.value;this.fields.set(e,i),"billing_country"!==e&&"shipping_country"!==e||this.update_required_fields(i,e)}catch(s){console.log(s)}},wc_stripe.CheckoutFields.prototype.update_required_fields=function(t,e){if(this.locales){var i,s=-1<e.indexOf("billing_")?"billing_":"shipping_",t="undefined"!=typeof this.locales[t]?this.locales[t]:this.locales["default"],a=o.extend(!0,{},this.locales["default"],t);for(i in a){var n=s+i;this.params[n]&&(this.params[n]=o.extend(!0,{},this.params[n],a[i]))}}},wc_stripe.CheckoutFields.prototype.on_ship_to_address_change=function(t){o(t.currentTarget).is(":checked")&&this.update_required_fields(o("#shipping_country").val(),"shipping_country")},wc_stripe.CheckoutFields.prototype.requestFieldInWallet=function(t){return"checkout"===this.page?this.required(t)&&this.isEmpty(t):"order_pay"!==this.page&&this.required(t)},wc_stripe.CheckoutFields.prototype.set=function(t,e,i){this[t]&&"function"==typeof this[t]?this[t]().set.call(this,e,i):this.fields.set(t,e)},wc_stripe.CheckoutFields.prototype.get=function(t,e){var i;return this[t]&&"function"==typeof this[t]?i=this[t]().get.call(this,e):null!=(i=this.fields.get(t))&&""!==i||void 0!==e&&(i=e),void 0===i?"":i},wc_stripe.CheckoutFields.prototype.required=function(t){return!(!this.params[t]||"undefined"==typeof this.params[t].required)&&this.params[t].required},wc_stripe.CheckoutFields.prototype.isEmpty=function(t){if(this.fields.has(t)){t=this.fields.get(t);return null==t||"string"==typeof t&&0===t.trim().length}return!0},wc_stripe.CheckoutFields.prototype.isValid=function(t){if(this[t]&&"function"==typeof this[t])return this[t]().isValid.apply(this,Array.prototype.slice.call(arguments,1))},wc_stripe.CheckoutFields.prototype.first_name=function(){return{set:function(t,e){this.fields.set(e+"_first_name",t)},get:function(t){return this.fields.get(t+"_first_name")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.last_name=function(){return{set:function(t,e){this.fields.set(e+"_last_name",t)},get:function(t){return this.fields.get(t+"_last_name")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.address_1=function(){return{set:function(t,e){this.fields.set(e+"_address_1",t)},get:function(t){return this.fields.get(t+"_address_1")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.address_2=function(){return{set:function(t,e){this.fields.set(e+"_address_2",t)},get:function(t){return this.fields.get(t+"_address_2")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.name=function(){return{set:function(t,e){t=t.split(" ");0<t.length&&this.fields.set(e+"_first_name",t[0]),1<t.length&&this.fields.set(e+"_last_name",t[1])},get:function(t){return this.fields.get(t+"_first_name")+" "+this.fields.get(t+"_last_name")}}},wc_stripe.CheckoutFields.prototype.email=function(){return{set:function(t,e){this.fields.set(e+"_email",t)},get:function(t){return this.fields.get(t+"_email")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.phone=function(){return{set:function(t,e){this.fields.set(e+"_phone",t)},get:function(t){return this.fields.get(t+"_phone")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.country=function(){return{set:function(t,e){this.fields.set(e+"_country",t)},get:function(t){return this.fields.get(t+"_country")},isValid:function(t){return"string"==typeof t&&2===t.length}}},wc_stripe.CheckoutFields.prototype.state=function(){return{set:function(i,t){2<(i=i.toUpperCase()).length&&"checkout"===this.page&&o("#"+t+"_state option").each(function(){var t=o(this),e=t.text().toUpperCase();i===e&&(i=t.val())}),this.fields.set(t+"_state",i)},get:function(t){return this.fields.get(t+"_state")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.city=function(){return{set:function(t,e){this.fields.set(e+"_city",t)},get:function(t){return this.fields.get(t+"_city")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.postcode=function(){return{set:function(t,e){this.fields.set(e+"_postcode",t)},get:function(t){return this.fields.get(t+"_postcode")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.recipient=function(){return wc_stripe.CheckoutFields.prototype.name.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.payerName=function(){return wc_stripe.CheckoutFields.prototype.name.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.payerEmail=function(){return wc_stripe.CheckoutFields.prototype.email.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.payerPhone=function(){return wc_stripe.CheckoutFields.prototype.phone.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.phoneNumber=function(){return wc_stripe.CheckoutFields.prototype.phone.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.countryCode=function(){return wc_stripe.CheckoutFields.prototype.country.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.address1=function(){return wc_stripe.CheckoutFields.prototype.address_1.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.address2=function(){return wc_stripe.CheckoutFields.prototype.address_2.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.line1=function(){return wc_stripe.CheckoutFields.prototype.address_1.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.line2=function(){return wc_stripe.CheckoutFields.prototype.address_2.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.addressLine=function(){return{set:function(t,e){0<t.length&&this.fields.set(e+"_address_1",t[0]),1<t.length&&this.fields.set(e+"_address_2",t[1])},get:function(t){return[this.fields.get(t+"_address_1"),this.fields.get(t+"_address_2")]},isValid:function(t){return 0<t.length&&("string"==typeof t[0]&&0<t[0].length)}}},wc_stripe.CheckoutFields.prototype.region=function(){return wc_stripe.CheckoutFields.prototype.state.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.administrativeArea=function(){return wc_stripe.CheckoutFields.prototype.state.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.locality=function(){return wc_stripe.CheckoutFields.prototype.city.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.postal_code=function(){return wc_stripe.CheckoutFields.prototype.postcode.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.postalCode=function(){return wc_stripe.CheckoutFields.prototype.postcode.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.toJson=function(){var i={};return this.fields.forEach(function(t,e){i[e]=t}),i},wc_stripe.CheckoutFields.prototype.toFormFields=function(t){var i=[];this.fields.forEach(function(t,e){e='[name="'+e+'"]';o(e).length&&""!==t&&(o(e).val()!==t&&o(e).is("select")&&i.push(e),o(e).val(t))}),0<i.length&&o(i.join(",")).trigger("change"),void 0!==t&&o(document.body).trigger("update_checkout",t)},wc_stripe.CheckoutFields.prototype.validateFields=function(t){for(var e in this.params){var i=this.params[e];if(-1<e.indexOf(t)&&i.required&&o("#"+e).length&&o("#"+e).is(":visible")){i=o("#"+e).val();if(null==i||0===i.length)return!1}}return!0};try{s=Stripe(wc_stripe_params_v3.api_key,{stripeAccount:wc_stripe_params_v3.account})}catch(t){return i.alert(t),console.log(t)}var r=new wc_stripe.CheckoutFields(wc_stripe_checkout_fields,wc_stripe_params_v3.page)}(window,jQuery);
1
+ !function(i,o){i.wc_stripe={};var s=null;"undefined"==typeof wc_stripe_checkout_fields&&(i.wc_stripe_checkout_fields=[]),wc_stripe.BaseGateway=function(t,e){this.params=t,this.gateway_id=this.params.gateway_id,this.container=void 0===e?"li.payment_method_".concat(this.gateway_id):e,o(this.container).length||(this.container=".payment_method_".concat(this.gateway_id)),this.token_selector=this.params.token_selector,this.saved_method_selector=this.params.saved_method_selector,this.payment_token_received=!1,this.stripe=s,this.elements=s.elements(o.extend({},{locale:"auto"},this.get_element_options())),this.fields=r,this.initialize()},wc_stripe.BaseGateway.prototype.get_page=function(){var t=wc_stripe_params_v3.page;return"cart"===t&&o(document.body).is(".woocommerce-checkout")&&(t="checkout"),t},wc_stripe.BaseGateway.prototype.set_nonce=function(t){this.fields.set(this.gateway_id+"_token_key",t),o(this.token_selector).val(t)},wc_stripe.BaseGateway.prototype.get_element_options=function(){return{}},wc_stripe.BaseGateway.prototype.initialize=function(){},wc_stripe.BaseGateway.prototype.create_button=function(){},wc_stripe.BaseGateway.prototype.is_gateway_selected=function(){return o('[name="payment_method"]:checked').val()===this.gateway_id},wc_stripe.BaseGateway.prototype.is_saved_method_selected=function(){return this.is_gateway_selected()&&"saved"===o('[name="'+this.gateway_id+'_payment_type_key"]:checked').val()},wc_stripe.BaseGateway.prototype.has_checkout_error=function(){return 0<o("#wc_stripe_checkout_error").length&&this.is_gateway_selected()},wc_stripe.BaseGateway.prototype.submit_error=function(t){-1==(t=this.get_error_message(t)).indexOf("</ul>")&&(t='<div class="woocommerce-error">'+t+"</div>"),this.submit_message(t)},wc_stripe.BaseGateway.prototype.submit_error_code=function(t){console.log(t)},wc_stripe.BaseGateway.prototype.get_error_message=function(t){return"object"==typeof t&&t.code&&(t=wc_stripe_messages[t.code]||t.message),t},wc_stripe.BaseGateway.prototype.submit_message=function(t){o(".woocommerce-error, .woocommerce-message, .woocommerce-info").remove();var e=o(this.message_container);e.closest("form").length&&(e=e.closest("form")),e.prepend(t),e.removeClass("processing").unblock(),e.find(".input-text, select, input:checkbox").blur(),o.scroll_to_notices?o.scroll_to_notices(e):o("html, body").animate({scrollTop:e.offset().top-100},1e3)},wc_stripe.BaseGateway.prototype.get_first_name=function(t){return o("#"+t+"_first_name").val()},wc_stripe.BaseGateway.prototype.get_last_name=function(t){return o("#"+t+"_last_name").val()},wc_stripe.BaseGateway.prototype.get_shipping_prefix=function(){return this.needs_shipping()&&0<o('[name="ship_to_different_address"]').length&&o('[name="ship_to_different_address"]').is(":checked")?"shipping":"billing"},wc_stripe.BaseGateway.prototype.should_save_method=function(){return o("#"+this.gateway_id+"_save_source_key").is(":checked")},wc_stripe.BaseGateway.prototype.is_add_payment_method_page=function(){return"add_payment_method"===this.get_page()||o(document.body).hasClass("woocommerce-add-payment-method")},wc_stripe.BaseGateway.prototype.is_change_payment_method=function(){return"change_payment_method"===this.get_page()},wc_stripe.BaseGateway.prototype.get_selected_payment_method=function(){return o(this.saved_method_selector).val()},wc_stripe.BaseGateway.prototype.needs_shipping=function(){return this.get_gateway_data().needs_shipping},wc_stripe.BaseGateway.prototype.get_currency=function(){return this.get_gateway_data().currency},wc_stripe.BaseGateway.prototype.get_gateway_data=function(){var t=o(this.container).find(".woocommerce_".concat(this.gateway_id,"_gateway_data")).data("gateway");return void 0===t&&this.is_current_page("checkout")&&(t=o("form.checkout").find(".woocommerce_".concat(this.gateway_id,"_gateway_data")).data("gateway")),t},wc_stripe.BaseGateway.prototype.set_gateway_data=function(t){o(this.container).find(".woocommerce_".concat(this.gateway_id,"_gateway_data")).data("gateway",t)},wc_stripe.BaseGateway.prototype.get_customer_name=function(t){return this.fields.get(t+"_first_name")+" "+this.fields.get(t+"_last_name")},wc_stripe.BaseGateway.prototype.get_customer_email=function(){return this.fields.get("billing_email")},wc_stripe.BaseGateway.prototype.get_address_field_hash=function(t){for(var e=["_first_name","_last_name","_address_1","_address_2","_postcode","_city","_state","_country"],i="",s=0;s<e.length;s++)i+=this.fields.get(t+e[s])+"_";return i},wc_stripe.BaseGateway.prototype.block=function(){o().block&&o.blockUI({message:null,overlayCSS:{background:"#fff",opacity:.6}})},wc_stripe.BaseGateway.prototype.unblock=function(){o().block&&o.unblockUI()},wc_stripe.BaseGateway.prototype.get_form=function(){return o(this.token_selector).closest("form")},wc_stripe.BaseGateway.prototype.get_total_price=function(){return this.get_gateway_data().total},wc_stripe.BaseGateway.prototype.get_total_price_cents=function(){return this.get_gateway_data().total_cents},wc_stripe.BaseGateway.prototype.set_total_price=function(t){var e=this.get_gateway_data();e.total=t,this.set_gateway_data(e)},wc_stripe.BaseGateway.prototype.set_total_price_cents=function(t){var e=this.get_gateway_data();e.total_cents=t,this.set_gateway_data(e)},wc_stripe.BaseGateway.prototype.set_payment_method=function(t){o('[name="payment_method"][value="'+t+'"]').prop("checked",!0).trigger("click")},wc_stripe.BaseGateway.prototype.set_selected_shipping_methods=function(t){if(this.fields.set("shipping_method",t),t&&o('[name^="shipping_method"]').length)for(var e in t){var i=t[e];o('[name="shipping_method['+e+']"][value="'+i+'"]').prop("checked",!0).trigger("change")}},wc_stripe.BaseGateway.prototype.on_token_received=function(t){this.payment_token_received=!0,this.set_nonce(t.id),this.process_checkout()},wc_stripe.BaseGateway.prototype.createPaymentRequest=function(){try{this.payment_request_options=this.get_payment_request_options(),this.paymentRequest=s.paymentRequest(this.payment_request_options),this.payment_request_options.requestShipping&&(this.paymentRequest.on("shippingaddresschange",this.update_shipping_address.bind(this)),this.paymentRequest.on("shippingoptionchange",this.update_shipping_method.bind(this))),this.paymentRequest.on("paymentmethod",this.on_payment_method_received.bind(this))}catch(t){return void this.submit_error(t.message)}},wc_stripe.BaseGateway.prototype.get_payment_request_options=function(){var t={country:this.params.country_code,currency:this.get_currency().toLowerCase(),total:{amount:this.get_total_price_cents(),label:this.params.total_label,pending:!0},requestPayerName:function(){return!this.is_current_page("checkout")||!this.is_valid_address(this.get_address_object("billing"),"billing",["email","phone"])}.bind(this)(),requestPayerEmail:this.fields.requestFieldInWallet("billing_email"),requestPayerPhone:this.fields.requestFieldInWallet("billing_phone"),requestShipping:function(){if(this.needs_shipping()){var t=this.get_shipping_prefix();if(this.is_current_page("checkout")&&!this.is_valid_address(this.get_address_object(t),t,["email","phone"])||!this.is_current_page("checkout"))return!0}return!1}.bind(this)()},e=this.get_display_items(),i=this.get_shipping_options();return e&&(t.displayItems=e),t.requestShipping&&i&&(t.shippingOptions=i),t},wc_stripe.BaseGateway.prototype.get_payment_request_update=function(t){var e={currency:this.get_currency().toLowerCase(),total:{amount:parseInt(this.get_total_price_cents()),label:this.params.total_label,pending:!0}},i=this.get_display_items(),s=this.get_shipping_options();return i&&(e.displayItems=i),this.payment_request_options.requestShipping&&s&&(e.shippingOptions=s),t&&(e=o.extend(!0,{},e,t)),e},wc_stripe.BaseGateway.prototype.get_display_items=function(){return this.get_gateway_data().items},wc_stripe.BaseGateway.prototype.set_display_items=function(t){var e=this.get_gateway_data();e.items=t,this.set_gateway_data(e)},wc_stripe.BaseGateway.prototype.get_shipping_options=function(){return this.get_gateway_data().shipping_options},wc_stripe.BaseGateway.prototype.set_shipping_options=function(t){var e=this.get_gateway_data();e.shipping_options=t,this.set_gateway_data(e)},wc_stripe.BaseGateway.prototype.map_address=function(t){return{city:t.city,postcode:t.postalCode,state:t.region,country:t.country}},wc_stripe.BaseGateway.prototype.on_payment_method_received=function(t){try{this.payment_response=t,this.populate_checkout_fields(t),t.complete("success"),this.on_token_received(t.paymentMethod)}catch(e){i.alert(e)}},wc_stripe.BaseGateway.prototype.populate_checkout_fields=function(t){this.set_nonce(t.paymentMethod.id),this.update_addresses(t)},wc_stripe.BaseGateway.prototype.update_addresses=function(t){t.payerName&&this.fields.set("name",t.payerName,"billing"),t.payerEmail&&this.fields.set("email",t.payerEmail,"billing"),t.payerPhone&&this.fields.set("phone",t.payerPhone,"billing"),t.shippingAddress&&this.populate_shipping_fields(t.shippingAddress),t.paymentMethod.billing_details.address&&this.populate_billing_fields(t.paymentMethod.billing_details.address)},wc_stripe.BaseGateway.prototype.populate_address_fields=function(t,e){for(var i in t)null!==t[i]&&this.fields.set(i,t[i],e)},wc_stripe.BaseGateway.prototype.populate_billing_fields=function(t){this.populate_address_fields(t,"billing")},wc_stripe.BaseGateway.prototype.populate_shipping_fields=function(t){this.populate_address_fields(t,"shipping")},wc_stripe.BaseGateway.prototype.get_address_fields=function(){return["first_name","last_name","country","address_1","address_2","city","state","postcode","phone","email"]},wc_stripe.BaseGateway.prototype.get_address_object=function(e){var i={};return this.get_address_fields().forEach(function(t){i[t]=this.fields.get(t,e)}.bind(this)),i},wc_stripe.BaseGateway.prototype.is_current_page=function(t){return this.get_page()===t},wc_stripe.BaseGateway.prototype.is_valid_address=function(t,e,i){if(o.isEmptyObject(t))return!1;var s=this.get_address_fields();void 0!==i&&i.forEach(function(t){-1<s.indexOf(t)&&s.splice(s.indexOf(t),1)});for(var a=0;a<s.length;a++){var n=s[a];if(this.fields.required(e+"_"+n)&&(!t[n]||"undefined"==typeof t[n]||!this.fields.isValid(n,t[n],t)))return!1}return!0},wc_stripe.BaseGateway.prototype.ajax_before_send=function(t){0<this.params.user_id&&t.setRequestHeader("X-WP-Nonce",this.params.rest_nonce)},wc_stripe.BaseGateway.prototype.process_checkout=function(){return new Promise(function(){this.block(),o.ajax({url:this.params.routes.checkout,method:"POST",dataType:"json",data:o.extend({},this.serialize_fields(),{payment_method:this.gateway_id,page_id:this.get_page(),currency:this.get_currency()}),beforeSend:this.ajax_before_send.bind(this)}).done(function(t){t.reload?i.location.reload():"success"===t.result?i.location=t.redirect:(t.messages&&this.submit_error(t.messages),this.unblock())}.bind(this)).fail(function(t,e,i){this.unblock(),this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.BaseGateway.prototype.serialize_form=function(t){var e,i=t.find("input").filter(function(t,e){return!o(e).is('[name^="add-to-cart"]')}.bind(this)).serializeArray(),s={};for(e in i){var a=i[e];s[a.name]=a.value}return s.payment_method=this.gateway_id,s},wc_stripe.BaseGateway.prototype.serialize_fields=function(){return o.extend({},this.fields.toJson(),o(document.body).triggerHandler("wc_stripe_process_checkout_data",[this,this.fields]))},wc_stripe.BaseGateway.prototype.map_shipping_methods=function(t){var e={};return"default"===t||1<(t=t.match(/^([\w+]):(.+)$/)).length&&(e[t[1]]=t[2]),e},wc_stripe.BaseGateway.prototype.maybe_set_ship_to_different=function(){o('[name="ship_to_different_address"]').length&&o('[name="ship_to_different_address"]').prop("checked",this.get_address_field_hash("billing")!==this.get_address_field_hash("shipping")).trigger("change")},wc_stripe.BaseGateway.prototype.update_shipping_address=function(s){return new Promise(function(e,i){o.ajax({url:this.params.routes.shipping_address,method:"POST",dataType:"json",data:{address:this.map_address(s.shippingAddress),payment_method:this.gateway_id,page_id:this.get_page(),currency:this.get_currency()},beforeSend:this.ajax_before_send.bind(this)}).done(function(t){t.code?(s.updateWith(t.data.newData),i(t.data)):(s.updateWith(t.data.newData),this.fields.set("shipping_method",t.data.shipping_method),e(t.data))}.bind(this)).fail(function(){}.bind(this))}.bind(this))},wc_stripe.BaseGateway.prototype.update_shipping_method=function(s){return new Promise(function(e,i){o.ajax({url:this.params.routes.shipping_method,method:"POST",dataType:"json",data:{shipping_method:s.shippingOption.id,payment_method:this.gateway_id,currency:this.get_currency(),page_id:this.get_page()},beforeSend:this.ajax_before_send.bind(this)}).done(function(t){t.code?(s.updateWith(t.data.newData),i(t.data)):(this.set_selected_shipping_methods(t.data.shipping_methods),s.updateWith(t.data.newData),e(t.data))}.bind(this)).fail(function(t,e,i){this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.CheckoutGateway=function(){this.message_container="li.payment_method_"+this.gateway_id,this.banner_container="li.banner_payment_method_"+this.gateway_id,o(document.body).on("update_checkout",this.update_checkout.bind(this)),o(document.body).on("updated_checkout",this.updated_checkout.bind(this)),o(document.body).on("cfw_updated_checkout",this.updated_checkout.bind(this)),o(document.body).on("checkout_error",this.checkout_error.bind(this)),o(this.token_selector).closest("form").on("checkout_place_order_"+this.gateway_id,this.checkout_place_order.bind(this)),o(document.body).on("wc_stripe_new_method_"+this.gateway_id,this.on_show_new_methods.bind(this)),o(document.body).on("wc_stripe_saved_method_"+this.gateway_id,this.on_show_saved_methods.bind(this)),o(document.body).on("wc_stripe_payment_method_selected",this.on_payment_method_selected.bind(this)),this.banner_enabled()&&o(".woocommerce-billing-fields").length&&o(".wc-stripe-banner-checkout").css("max-width",o(".woocommerce-billing-fields").outerWidth(!0)),this.order_review()},wc_stripe.CheckoutGateway.prototype.order_review=function(){var t,e=i.location.href.match(/order_review.+payment_method=([\w]+).+payment_nonce=(.+)/);e&&1<e.length&&(t=e[1],e=e[2],this.gateway_id===t&&(this.payment_token_received=!0,this.set_nonce(e),this.set_use_new_option(!0)))},wc_stripe.CheckoutGateway.prototype.update_shipping_address=function(){return wc_stripe.BaseGateway.prototype.update_shipping_address.apply(this,arguments).then(function(t){this.populate_address_fields(t.address,this.get_shipping_prefix()),this.fields.toFormFields({update_shipping_method:!1})}.bind(this))},wc_stripe.CheckoutGateway.prototype.updated_checkout=function(){},wc_stripe.CheckoutGateway.prototype.update_checkout=function(){},wc_stripe.CheckoutGateway.prototype.checkout_error=function(){this.has_checkout_error()&&(this.payment_token_received=!1,this.payment_response=null,this.show_payment_button(),this.hide_place_order())},wc_stripe.CheckoutGateway.prototype.is_valid_checkout=function(){return!(o('[name="terms"]').length&&!o('[name="terms"]').is(":checked"))},wc_stripe.CheckoutGateway.prototype.get_payment_method=function(){return o('[name="payment_method"]:checked').val()},wc_stripe.CheckoutGateway.prototype.set_use_new_option=function(t){o("#"+this.gateway_id+"_use_new").prop("checked",t).trigger("change")},wc_stripe.CheckoutGateway.prototype.checkout_place_order=function(){return this.is_valid_checkout()?!!this.is_saved_method_selected()||this.payment_token_received:(this.submit_error(this.params.messages.terms),!1)},wc_stripe.CheckoutGateway.prototype.on_token_received=function(t){this.payment_token_received=!0,this.set_nonce(t.id),this.hide_payment_button(),this.show_place_order()},wc_stripe.CheckoutGateway.prototype.block=function(){o().block&&o("form.checkout").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},wc_stripe.CheckoutGateway.prototype.unblock=function(){o().block&&o("form.checkout").unblock()},wc_stripe.CheckoutGateway.prototype.hide_place_order=function(){o("#place_order").addClass("wc-stripe-hide")},wc_stripe.CheckoutGateway.prototype.show_place_order=function(){o("#place_order").removeClass("wc-stripe-hide")},wc_stripe.CheckoutGateway.prototype.on_show_new_methods=function(){this.payment_token_received?(this.show_place_order(),this.hide_payment_button()):(this.hide_place_order(),this.show_payment_button())},wc_stripe.CheckoutGateway.prototype.on_show_saved_methods=function(){this.hide_payment_button(),this.show_place_order()},wc_stripe.CheckoutGateway.prototype.show_payment_button=function(){this.$button&&this.$button.show()},wc_stripe.CheckoutGateway.prototype.hide_payment_button=function(){this.$button&&this.$button.hide()},wc_stripe.CheckoutGateway.prototype.trigger_payment_method_selected=function(){this.on_payment_method_selected(null,o('[name="payment_method"]:checked').val())},wc_stripe.CheckoutGateway.prototype.on_payment_method_selected=function(t,e){e===this.gateway_id?this.payment_token_received||this.is_saved_method_selected()?(this.hide_payment_button(),this.show_place_order()):(this.show_payment_button(),this.hide_place_order()):(this.hide_payment_button(),e.indexOf("stripe_")<0&&this.show_place_order())},wc_stripe.CheckoutGateway.prototype.banner_enabled=function(){return"1"===this.params.banner_enabled},wc_stripe.CheckoutGateway.prototype.checkout_fields_valid=function(){if(["checkout","order_pay"].indexOf(this.get_page())<0)return!0;var t=!0;return(t=this.fields.validateFields("billing"))?this.needs_shipping()&&o("#ship-to-different-address-checkbox").is(":checked")?(t=this.fields.validateFields("shipping"))||this.submit_error(this.params.messages.required_field):(t=this.is_valid_checkout())||this.submit_error(this.params.messages.terms):this.submit_error(this.params.messages.required_field),t},wc_stripe.CheckoutGateway.prototype.cart_contains_subscription=function(){return"undefined"!=typeof wc_stripe_cart_contains_subscription&&!0===wc_stripe_cart_contains_subscription},wc_stripe.ProductGateway=function(){this.message_container="div.product",o("form.cart").on("found_variation",this.found_variation.bind(this)),o("form.cart").on("reset_data",this.reset_variation_data.bind(this)),this.buttonWidth=o("form.cart div.quantity").outerWidth(!0)+o(".single_add_to_cart_button").outerWidth();var t=o(".single_add_to_cart_button").css("marginLeft");t&&(this.buttonWidth+=parseInt(t.replace("px",""))),o(this.container).css("max-width",this.buttonWidth+"px")},wc_stripe.ProductGateway.prototype.get_quantity=function(){return parseInt(o('[name="quantity"]').val())},wc_stripe.ProductGateway.prototype.set_rest_nonce=function(t,e){this.params.rest_nonce=e},wc_stripe.ProductGateway.prototype.found_variation=function(t,e){var i=this.get_gateway_data();i.product.price=e.display_price,i.needs_shipping=!e.is_virtual,i.product.variation=e,this.set_gateway_data(i)},wc_stripe.ProductGateway.prototype.reset_variation_data=function(){var t=this.get_product_data();t.variation=!1,this.set_product_data(t),this.disable_payment_button()},wc_stripe.ProductGateway.prototype.disable_payment_button=function(){this.$button&&this.get_button().prop("disabled",!0).addClass("disabled")},wc_stripe.ProductGateway.prototype.enable_payment_button=function(){this.$button&&this.get_button().prop("disabled",!1).removeClass("disabled")},wc_stripe.ProductGateway.prototype.get_button=function(){return this.$button},wc_stripe.ProductGateway.prototype.is_variable_product=function(){return 0<o('[name="variation_id"]').length},wc_stripe.ProductGateway.prototype.variable_product_selected=function(){return!1!==this.get_product_data().variation},wc_stripe.ProductGateway.prototype.get_product_data=function(){return this.get_gateway_data().product},wc_stripe.ProductGateway.prototype.set_product_data=function(t){var e=this.get_gateway_data();e.product=t,this.set_gateway_data(e)},wc_stripe.ProductGateway.prototype.add_to_cart=function(){return new Promise(function(e,i){this.block(),o.ajax({url:this.params.routes.add_to_cart,method:"POST",dataType:"json",data:{product_id:this.get_product_data().id,variation_id:this.is_variable_product()?o('[name="variation_id"]').val():0,qty:o('[name="quantity"]').val(),payment_method:this.gateway_id,currency:this.get_currency(),page_id:this.get_page()},beforeSend:this.ajax_before_send.bind(this)}).done(function(t){this.unblock(),t.code?(this.submit_error(t.message),i(t)):(this.set_total_price(t.data.total),this.set_total_price_cents(t.data.totalCents),this.set_display_items(t.data.displayItems),e(t.data))}.bind(this)).fail(function(t,e,i){this.unblock(),this.submit_error(i)}.bind(this))}.bind(this))},wc_stripe.ProductGateway.prototype.cart_calculation=function(t){return new Promise(function(e,i){o.ajax({url:this.params.routes.cart_calculation,method:"POST",dataType:"json",data:{product_id:this.get_product_data().id,variation_id:this.is_variable_product()&&t?t:0,qty:o('[name="quantity"]').val(),currency:this.get_currency(),payment_method:this.gateway_id},beforeSend:this.ajax_before_send.bind(this)}).done(function(t){t.code?(this.cart_calculation_error=!0,i(t)):(this.set_total_price(t.data.total),this.set_total_price_cents(t.data.totalCents),this.set_display_items(t.data.displayItems),e(t.data))}.bind(this)).fail(function(){}.bind(this))}.bind(this))},wc_stripe.CartGateway=function(){this.message_container="div.woocommerce",o(document.body).on("updated_wc_div",this.updated_html.bind(this)),o(document.body).on("updated_cart_totals",this.updated_html.bind(this)),o(document.body).on("wc_cart_emptied",this.cart_emptied.bind(this))},wc_stripe.CartGateway.prototype.submit_error=function(t){this.submit_message(this.get_error_message(t))},wc_stripe.CartGateway.prototype.updated_html=function(t){},wc_stripe.CartGateway.prototype.cart_emptied=function(t){},wc_stripe.CartGateway.prototype.add_cart_totals_class=function(){o(".cart_totals").addClass("stripe_cart_gateway_active")},wc_stripe.GooglePay=function(){};var a={apiVersion:2,apiVersionMinor:0},n={type:"CARD",parameters:{allowedAuthMethods:["PAN_ONLY"],allowedCardNetworks:["AMEX","DISCOVER","INTERAC","JCB","MASTERCARD","VISA"]}};wc_stripe.GooglePay.prototype.update_addresses=function(t){this.populate_billing_fields(t.paymentMethodData.info.billingAddress),t.shippingAddress&&this.populate_shipping_fields(t.shippingAddress),t.email&&this.fields.set("email",t.email,"billing")},wc_stripe.GooglePay.prototype.map_address=function(t){return{city:t.locality,postcode:t.postalCode,state:t.administrativeArea,country:t.countryCode}},wc_stripe.GooglePay.prototype.update_payment_data=function(s){return new Promise(function(e,i){var t="default"==s.shippingOptionData.id?null:s.shippingOptionData.id;o.when(o.ajax({url:this.params.routes.payment_data,dataType:"json",method:"POST",data:{address:this.map_address(s.shippingAddress),shipping_method:t,page_id:this.get_page(),currency:this.get_currency()},beforeSend:this.ajax_before_send.bind(this)})).done(function(t){t.code?i(t.data.data):e(t.data)}.bind(this)).fail(function(){i()}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.on_payment_data_changed=function(i){return new Promise(function(e){this.update_payment_data(i).then(function(t){e(t.paymentRequestUpdate),this.set_selected_shipping_methods(t.shipping_methods),this.payment_data_updated(t,i)}.bind(this))["catch"](function(t){e(t)}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.payment_data_updated=function(t){},wc_stripe.GooglePay.prototype.get_merchant_info=function(){var t={merchantId:this.params.merchant_id,merchantName:this.params.merchant_name};return"TEST"===this.params.environment&&delete t.merchantId,t},wc_stripe.GooglePay.prototype.get_payment_options=function(){var t,e={environment:this.params.environment,merchantInfo:this.get_merchant_info(),paymentDataCallbacks:{onPaymentAuthorized:function(){return new Promise(function(t){t({transactionState:"SUCCESS"})}.bind(this))}}};return this.needs_shipping()&&(t=this.get_shipping_prefix(),(!this.is_current_page("checkout")||this.is_valid_address(this.get_address_object(t),t,["email","phone"]))&&this.is_current_page("checkout")||(e.paymentDataCallbacks.onPaymentDataChanged=this.on_payment_data_changed.bind(this))),e},wc_stripe.GooglePay.prototype.build_payment_request=function(){var t=o.extend({},a,{emailRequired:this.fields.requestFieldInWallet("billing_email"),merchantInfo:this.get_merchant_info(),allowedPaymentMethods:[o.extend({type:"CARD",tokenizationSpecification:{type:"PAYMENT_GATEWAY",parameters:{gateway:"stripe","stripe:version":"2018-10-31","stripe:publishableKey":this.params.api_key}}},n)],shippingAddressRequired:function(){if(this.needs_shipping()){var t=this.get_shipping_prefix();if(this.is_current_page("checkout")&&!this.is_valid_address(this.get_address_object(t),t,["email","phone"])||!this.is_current_page("checkout"))return!0}return!1}.bind(this)(),transactionInfo:{currencyCode:this.get_currency(),totalPriceStatus:"ESTIMATED",totalPrice:this.get_total_price().toString(),displayItems:this.get_display_items(),totalPriceLabel:this.params.total_price_label}});return t.allowedPaymentMethods[0].parameters.billingAddressRequired=function(){return!this.is_current_page("checkout")||!this.is_valid_address(this.get_address_object("billing"),"billing",["email","phone"])}.bind(this)(),t.allowedPaymentMethods[0].parameters.billingAddressParameters={format:"FULL",phoneNumberRequired:this.fields.requestFieldInWallet("billing_phone")},t.shippingAddressRequired?(t.shippingAddressParameters={},t.shippingOptionRequired=!0,t.shippingOptionParameters={shippingOptions:this.get_shipping_options()},t.callbackIntents=["SHIPPING_ADDRESS","SHIPPING_OPTION","PAYMENT_AUTHORIZATION"]):t.callbackIntents=["PAYMENT_AUTHORIZATION"],this.payment_request_options=t},wc_stripe.GooglePay.prototype.createPaymentsClient=function(){this.paymentsClient=new google.payments.api.PaymentsClient(this.get_payment_options())},wc_stripe.GooglePay.prototype.isReadyToPay=function(){return new Promise(function(t){var e=o.extend({},a);e.allowedPaymentMethods=[n],this.paymentsClient.isReadyToPay(e).then(function(){this.can_pay=!0,this.create_button(),t()}.bind(this))["catch"](function(t){this.submit_error(t)}.bind(this))}.bind(this))},wc_stripe.GooglePay.prototype.create_button=function(){this.$button&&this.$button.remove(),this.$button=o(this.paymentsClient.createButton({onClick:this.start.bind(this),buttonColor:this.params.button_color,buttonType:this.params.button_style})),this.$button.addClass("gpay-button-container")},wc_stripe.GooglePay.prototype.start=function(){this.createPaymentsClient(),this.paymentsClient.loadPaymentData(this.build_payment_request()).then(function(t){var e=JSON.parse(t.paymentMethodData.tokenizationData.token);this.update_addresses(t),this.on_token_received(e)}.bind(this))["catch"](function(t){"CANCELED"!==t.statusCode&&(t.statusMessage&&-1<t.statusMessage.indexOf("paymentDataRequest.callbackIntent")?this.submit_error_code("DEVELOPER_ERROR_WHITELIST"):this.submit_error(t.message))}.bind(this))},wc_stripe.ApplePay=function(){},wc_stripe.ApplePay.prototype.initialize=function(){this.createPaymentRequest(),this.canMakePayment()},wc_stripe.ApplePay.prototype.create_button=function(){this.$button&&this.$button.remove(),this.$button=o(this.params.button),this.$button.on("click",this.start.bind(this)),this.append_button()},wc_stripe.ApplePay.prototype.canMakePayment=function(){return new Promise(function(e){this.paymentRequest.canMakePayment().then(function(t){t&&t.applePay&&(this.can_pay=!0,this.create_button(),o(this.container).show(),e(t))}.bind(this))}.bind(this))},wc_stripe.ApplePay.prototype.start=function(t){t.preventDefault(),this.paymentRequest.update(this.get_payment_request_update({total:{pending:!1}})),this.paymentRequest.show()},wc_stripe.PaymentRequest=function(){},wc_stripe.PaymentRequest.prototype.initialize=function(){this.createPaymentRequest(),this.createPaymentRequestButton(),this.canMakePayment(),this.paymentRequestButton.on("click",this.button_click.bind(this))},wc_stripe.PaymentRequest.prototype.button_click=function(t){},wc_stripe.PaymentRequest.prototype.createPaymentRequestButton=function(){this.paymentRequestButton&&this.paymentRequestButton.destroy(),this.paymentRequestButton=this.elements.create("paymentRequestButton",{paymentRequest:this.paymentRequest,style:{paymentRequestButton:{type:this.params.button.type,theme:this.params.button.theme,height:this.params.button.height}}})},wc_stripe.PaymentRequest.prototype.canMakePayment=function(){return new Promise(function(e){this.paymentRequest.canMakePayment().then(function(t){t&&!t.applePay&&(this.can_pay=!0,this.create_button(),o(this.container).show(),e(t))}.bind(this))}.bind(this))},wc_stripe.PaymentRequest.prototype.create_button=function(){this.paymentRequestButton.mount("#wc-stripe-payment-request-container")},wc_stripe.CheckoutFields=function(t,e){this.params=t,this.page=e,this.fields=new Map(Object.keys(this.params).map(function(t){return null===this.params[t].value&&(this.params[t].value=""),[t,this.params[t].value]}.bind(this))),("checkout"===e||"cart"===e&&o(document.body).is(".woocommerce-checkout"))&&(o("form.checkout").on("change",".input-text, select",this.onChange.bind(this)),o("form.checkout").on("change",'[name="ship_to_different_address"]',this.on_ship_to_address_change.bind(this)),this.init_i18n(),o('[name="ship_to_different_address"]').is(":checked")?this.update_required_fields(o("#shipping_country").val(),"shipping_country"):this.update_required_fields(o("#billing_country").val(),"billing_country"))},wc_stripe.CheckoutFields.prototype.init_i18n=function(){"undefined"!=typeof wc_address_i18n_params?this.locales=o.parseJSON(wc_address_i18n_params.locale.replace(/&quot;/g,'"')):this.locales=null},wc_stripe.CheckoutFields.prototype.onChange=function(t){try{var e=t.currentTarget.name,i=t.currentTarget.value;this.fields.set(e,i),"billing_country"!==e&&"shipping_country"!==e||this.update_required_fields(i,e)}catch(s){console.log(s)}},wc_stripe.CheckoutFields.prototype.update_required_fields=function(t,e){if(this.locales){var i,s=-1<e.indexOf("billing_")?"billing_":"shipping_",t="undefined"!=typeof this.locales[t]?this.locales[t]:this.locales["default"],a=o.extend(!0,{},this.locales["default"],t);for(i in a){var n=s+i;this.params[n]&&(this.params[n]=o.extend(!0,{},this.params[n],a[i]))}}},wc_stripe.CheckoutFields.prototype.on_ship_to_address_change=function(t){o(t.currentTarget).is(":checked")&&this.update_required_fields(o("#shipping_country").val(),"shipping_country")},wc_stripe.CheckoutFields.prototype.requestFieldInWallet=function(t){return"checkout"===this.page?this.required(t)&&this.isEmpty(t):"order_pay"!==this.page&&this.required(t)},wc_stripe.CheckoutFields.prototype.set=function(t,e,i){this[t]&&"function"==typeof this[t]?this[t]().set.call(this,e,i):this.fields.set(t,e)},wc_stripe.CheckoutFields.prototype.get=function(t,e){var i;return this[t]&&"function"==typeof this[t]?i=this[t]().get.call(this,e):null!=(i=this.fields.get(t))&&""!==i||void 0!==e&&(i=e),void 0===i?"":i},wc_stripe.CheckoutFields.prototype.required=function(t){return!(!this.params[t]||"undefined"==typeof this.params[t].required)&&this.params[t].required},wc_stripe.CheckoutFields.prototype.isEmpty=function(t){if(this.fields.has(t)){t=this.fields.get(t);return null==t||"string"==typeof t&&0===t.trim().length}return!0},wc_stripe.CheckoutFields.prototype.isValid=function(t){if(this[t]&&"function"==typeof this[t])return this[t]().isValid.apply(this,Array.prototype.slice.call(arguments,1))},wc_stripe.CheckoutFields.prototype.first_name=function(){return{set:function(t,e){this.fields.set(e+"_first_name",t)},get:function(t){return this.fields.get(t+"_first_name")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.last_name=function(){return{set:function(t,e){this.fields.set(e+"_last_name",t)},get:function(t){return this.fields.get(t+"_last_name")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.address_1=function(){return{set:function(t,e){this.fields.set(e+"_address_1",t)},get:function(t){return this.fields.get(t+"_address_1")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.address_2=function(){return{set:function(t,e){this.fields.set(e+"_address_2",t)},get:function(t){return this.fields.get(t+"_address_2")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.name=function(){return{set:function(t,e){t=t.split(" ");0<t.length&&this.fields.set(e+"_first_name",t[0]),1<t.length&&this.fields.set(e+"_last_name",t[1])},get:function(t){return this.fields.get(t+"_first_name")+" "+this.fields.get(t+"_last_name")}}},wc_stripe.CheckoutFields.prototype.email=function(){return{set:function(t,e){this.fields.set(e+"_email",t)},get:function(t){return this.fields.get(t+"_email")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.phone=function(){return{set:function(t,e){this.fields.set(e+"_phone",t)},get:function(t){return this.fields.get(t+"_phone")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.country=function(){return{set:function(t,e){this.fields.set(e+"_country",t)},get:function(t){return this.fields.get(t+"_country")},isValid:function(t){return"string"==typeof t&&2===t.length}}},wc_stripe.CheckoutFields.prototype.state=function(){return{set:function(i,t){2<(i=i.toUpperCase()).length&&"checkout"===this.page&&o("#"+t+"_state option").each(function(){var t=o(this),e=t.text().toUpperCase();i===e&&(i=t.val())}),this.fields.set(t+"_state",i)},get:function(t){return this.fields.get(t+"_state")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.city=function(){return{set:function(t,e){this.fields.set(e+"_city",t)},get:function(t){return this.fields.get(t+"_city")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.postcode=function(){return{set:function(t,e){this.fields.set(e+"_postcode",t)},get:function(t){return this.fields.get(t+"_postcode")},isValid:function(t){return"string"==typeof t&&0<t.length}}},wc_stripe.CheckoutFields.prototype.recipient=function(){return wc_stripe.CheckoutFields.prototype.name.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.payerName=function(){return wc_stripe.CheckoutFields.prototype.name.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.payerEmail=function(){return wc_stripe.CheckoutFields.prototype.email.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.payerPhone=function(){return wc_stripe.CheckoutFields.prototype.phone.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.phoneNumber=function(){return wc_stripe.CheckoutFields.prototype.phone.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.countryCode=function(){return wc_stripe.CheckoutFields.prototype.country.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.address1=function(){return wc_stripe.CheckoutFields.prototype.address_1.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.address2=function(){return wc_stripe.CheckoutFields.prototype.address_2.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.line1=function(){return wc_stripe.CheckoutFields.prototype.address_1.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.line2=function(){return wc_stripe.CheckoutFields.prototype.address_2.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.addressLine=function(){return{set:function(t,e){0<t.length&&this.fields.set(e+"_address_1",t[0]),1<t.length&&this.fields.set(e+"_address_2",t[1])},get:function(t){return[this.fields.get(t+"_address_1"),this.fields.get(t+"_address_2")]},isValid:function(t){return 0<t.length&&("string"==typeof t[0]&&0<t[0].length)}}},wc_stripe.CheckoutFields.prototype.region=function(){return wc_stripe.CheckoutFields.prototype.state.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.administrativeArea=function(){return wc_stripe.CheckoutFields.prototype.state.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.locality=function(){return wc_stripe.CheckoutFields.prototype.city.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.postal_code=function(){return wc_stripe.CheckoutFields.prototype.postcode.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.postalCode=function(){return wc_stripe.CheckoutFields.prototype.postcode.apply(this,arguments)},wc_stripe.CheckoutFields.prototype.toJson=function(){var i={};return this.fields.forEach(function(t,e){i[e]=t}),i},wc_stripe.CheckoutFields.prototype.toFormFields=function(t){var i=[];this.fields.forEach(function(t,e){e='[name="'+e+'"]';o(e).length&&""!==t&&(o(e).val()!==t&&o(e).is("select")&&i.push(e),o(e).val(t))}),0<i.length&&o(i.join(",")).trigger("change"),void 0!==t&&o(document.body).trigger("update_checkout",t)},wc_stripe.CheckoutFields.prototype.validateFields=function(t){for(var e in this.params){var i=this.params[e];if(-1<e.indexOf(t)&&i.required&&o("#"+e).length&&o("#"+e).is(":visible")){i=o("#"+e).val();if(null==i||0===i.length)return!1}}return!0};try{s=Stripe(wc_stripe_params_v3.api_key,{stripeAccount:wc_stripe_params_v3.account})}catch(t){return i.alert(t),console.log(t)}var r=new wc_stripe.CheckoutFields(wc_stripe_checkout_fields,wc_stripe_params_v3.page)}(window,jQuery);
i18n/languages/woo-stripe-payment.pot CHANGED
@@ -2,14 +2,14 @@
2
  # This file is distributed under the same license as the Stripe For WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Stripe For WooCommerce 3.2.7\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woo-stripe-payment\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "POT-Creation-Date: 2020-11-08T03:34:23+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.4.0\n"
15
  "X-Domain: woo-stripe-payment\n"
@@ -32,7 +32,6 @@ msgstr ""
32
 
33
  #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:102
34
  #: includes/admin/meta-boxes/views/html-product-data.php:14
35
- #: includes/gateways/settings/ach-settings-v2.php:9
36
  #: includes/gateways/settings/ach-settings.php:9
37
  #: includes/gateways/settings/applepay-settings.php:11
38
  #: includes/gateways/settings/cc-settings.php:4
@@ -46,7 +45,6 @@ msgid "If enabled, your site can accept %s payments through Stripe."
46
  msgstr ""
47
 
48
  #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:111
49
- #: includes/gateways/settings/ach-settings-v2.php:64
50
  #: includes/gateways/settings/ach-settings.php:66
51
  #: includes/gateways/settings/applepay-settings.php:20
52
  #: includes/gateways/settings/cc-settings.php:17
@@ -57,7 +55,6 @@ msgstr ""
57
 
58
  #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:115
59
  #: includes/admin/meta-boxes/views/html-charge-data-subview.php:47
60
- #: includes/gateways/settings/ach-settings-v2.php:68
61
  #: includes/gateways/settings/ach-settings.php:70
62
  #: includes/gateways/settings/applepay-settings.php:24
63
  #: includes/gateways/settings/cc-settings.php:21
@@ -67,7 +64,6 @@ msgid "Title"
67
  msgstr ""
68
 
69
  #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:121
70
- #: includes/gateways/settings/ach-settings-v2.php:74
71
  #: includes/gateways/settings/ach-settings.php:76
72
  #: includes/gateways/settings/applepay-settings.php:30
73
  #: includes/gateways/settings/cc-settings.php:27
@@ -77,7 +73,6 @@ msgid "Description"
77
  msgstr ""
78
 
79
  #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:124
80
- #: includes/gateways/settings/ach-settings-v2.php:77
81
  #: includes/gateways/settings/ach-settings.php:79
82
  #: includes/gateways/settings/applepay-settings.php:33
83
  #: includes/gateways/settings/cc-settings.php:30
@@ -86,15 +81,15 @@ msgstr ""
86
  msgid "Leave blank if you don't want a description to show for the gateway."
87
  msgstr ""
88
 
89
- #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:176
90
  msgid "Order %s"
91
  msgstr ""
92
 
93
- #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:276
94
  msgid "Gateway will appear when store currency is <strong>%s</strong>"
95
  msgstr ""
96
 
97
- #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:279
98
  msgid " & billing country is <strong>%s</strong>"
99
  msgstr ""
100
 
@@ -218,29 +213,29 @@ msgstr ""
218
  msgid "Increase your conversion rate by offering %1$s on your Product and Cart pages, or at the top of the checkout page. <br/><strong>Note:</strong> you can control which products display %s by going to the product edit page."
219
  msgstr ""
220
 
221
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1569
222
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1600
223
- #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:189
224
  #: includes/wc-stripe-functions.php:405
225
  #: includes/wc-stripe-functions.php:470
226
  msgid "Shipping"
227
  msgstr ""
228
 
229
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1577
230
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1603
231
- #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:199
232
  #: includes/wc-stripe-functions.php:422
233
  #: includes/wc-stripe-functions.php:478
234
  msgid "Discount"
235
  msgstr ""
236
 
237
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1580
238
- #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:221
239
  #: includes/wc-stripe-functions.php:430
240
  msgid "Tax"
241
  msgstr ""
242
 
243
- #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1610
244
  #: includes/wc-stripe-functions.php:489
245
  msgid "Fees"
246
  msgstr ""
@@ -691,11 +686,11 @@ msgstr ""
691
  msgid "Payment authorization failed."
692
  msgstr ""
693
 
694
- #: includes/class-wc-stripe-rest-api.php:39
695
  msgid "%1$s is an invalid controller name."
696
  msgstr ""
697
 
698
- #: includes/class-wc-stripe-update.php:47
699
  msgid "Thank you for updating Stripe for WooCommerce to version %1$s."
700
  msgstr ""
701
 
@@ -703,11 +698,11 @@ msgstr ""
703
  msgid "Quantity must be greater than zero."
704
  msgstr ""
705
 
706
- #: includes/controllers/class-wc-stripe-controller-checkout.php:263
707
  msgid "Some required fields were missing. Please click %1$shere%2$s to complete your payment."
708
  msgstr ""
709
 
710
- #: includes/controllers/class-wc-stripe-controller-checkout.php:312
711
  msgid "Please review your order details then click Place Order."
712
  msgstr ""
713
 
@@ -777,6 +772,15 @@ msgstr ""
777
  msgid "You are not authorized to update this order."
778
  msgstr ""
779
 
 
 
 
 
 
 
 
 
 
780
  #: includes/controllers/class-wc-stripe-controller-webhook.php:50
781
  #: includes/controllers/class-wc-stripe-controller-webhook.php:52
782
  msgid "Invalid signature received. Verify that your webhook secret is correct."
@@ -822,7 +826,7 @@ msgstr ""
822
 
823
  #: includes/gateways/class-wc-payment-gateway-stripe-alipay.php:59
824
  msgid ""
825
- "Gateway will appear when store currency is CNY, or currency matches merchant's \n"
826
  "\t\t\t\t\tdefault Stripe currency. For merchants located in DK, NO, SE, & CH, currency must be EUR."
827
  msgstr ""
828
 
@@ -870,10 +874,10 @@ msgstr ""
870
 
871
  #: includes/gateways/class-wc-payment-gateway-stripe-becs.php:30
872
  msgid ""
873
- "By providing your bank account details and confirming this payment, you agree to this \n"
874
- "\t\tDirect Debit Request and the %sDirect Debit Request service agreement%s, and authorise Stripe Payments Australia Pty Ltd ACN 160 180 343 Direct \n"
875
- "\t\tDebit User ID number 507156 (“Stripe”) to debit your account through the Bulk Electronic Clearing System (BECS) on behalf of Stripe Press \n"
876
- "\t\t(the \"Merchant\") for any amounts separately communicated to you by the Merchant. You certify that you are either an account holder or an \n"
877
  "\t\tauthorised signatory on the account listed above."
878
  msgstr ""
879
 
@@ -975,35 +979,43 @@ msgstr ""
975
  msgid "Klarna gateway that integrates with your Stripe account."
976
  msgstr ""
977
 
978
- #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:86
979
  msgid "Payment Categories"
980
  msgstr ""
981
 
982
- #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:92
983
  msgid "These are the payment categories that will be displayed on the checkout page if they are supported. Note, depending on the customer's billing country, not all enabled options may show."
984
  msgstr ""
985
 
986
- #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:213
987
- msgid "Fee"
 
 
 
 
 
 
 
 
988
  msgstr ""
989
 
990
- #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:253
991
  msgid "Pay Now"
992
  msgstr ""
993
 
994
- #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:254
995
  msgid "Pay Later"
996
  msgstr ""
997
 
998
- #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:255
999
  msgid "Pay Over Time"
1000
  msgstr ""
1001
 
1002
- #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:271
1003
  msgid "Click %1$shere%2$s for Klarna test payment methods."
1004
  msgstr ""
1005
 
1006
- #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:277
1007
  msgid "Your purchase is not approved."
1008
  msgstr ""
1009
 
@@ -1119,122 +1131,102 @@ msgstr ""
1119
  msgid "Scan the QR code using your WeChat app. Once scanned click the Place Order button."
1120
  msgstr ""
1121
 
1122
- #: includes/gateways/settings/ach-settings-v2.php:5
1123
  #: includes/gateways/settings/ach-settings.php:5
1124
  msgid "For US customers only."
1125
  msgstr ""
1126
 
1127
- #: includes/gateways/settings/ach-settings-v2.php:6
1128
  #: includes/gateways/settings/ach-settings.php:6
1129
  msgid "Read through our %1$sdocumentation%2$s to configure ACH payments"
1130
  msgstr ""
1131
 
1132
- #: includes/gateways/settings/ach-settings-v2.php:14
1133
  #: includes/gateways/settings/ach-settings.php:14
1134
  msgid "If enabled, your site can accept ACH payments through Stripe."
1135
  msgstr ""
1136
 
1137
- #: includes/gateways/settings/ach-settings-v2.php:18
1138
  #: includes/gateways/settings/ach-settings.php:18
1139
  msgid "Plaid Environment"
1140
  msgstr ""
1141
 
1142
- #: includes/gateways/settings/ach-settings-v2.php:20
1143
  #: includes/gateways/settings/ach-settings.php:21
1144
  msgid "Sandbox"
1145
  msgstr ""
1146
 
1147
- #: includes/gateways/settings/ach-settings-v2.php:21
1148
  #: includes/gateways/settings/ach-settings.php:22
1149
  msgid "Development"
1150
  msgstr ""
1151
 
1152
- #: includes/gateways/settings/ach-settings-v2.php:22
1153
  #: includes/gateways/settings/ach-settings.php:23
1154
  msgid "Production"
1155
  msgstr ""
1156
 
1157
- #: includes/gateways/settings/ach-settings-v2.php:24
1158
- msgid "This setting determines the Plaid environment you are connecting with. When you are ready to accept live transactions, switch this option to Production.<br><strong>Production</strong> - accept live ACH payments <br><strong>Development</strong> - use real bank login details with test transactions <br><strong>Sandbox</strong> - test integration using test credentials"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1159
  msgstr ""
1160
 
1161
- #: includes/gateways/settings/ach-settings-v2.php:69
1162
  #: includes/gateways/settings/ach-settings.php:71
1163
  msgid "ACH Payment"
1164
  msgstr ""
1165
 
1166
- #: includes/gateways/settings/ach-settings-v2.php:82
1167
  #: includes/gateways/settings/ach-settings.php:84
1168
  msgid "Client Name"
1169
  msgstr ""
1170
 
1171
- #: includes/gateways/settings/ach-settings-v2.php:84
1172
  #: includes/gateways/settings/ach-settings.php:86
1173
  msgid "The name that appears on the ACH payment screen."
1174
  msgstr ""
1175
 
1176
- #: includes/gateways/settings/ach-settings-v2.php:88
1177
  #: includes/gateways/settings/ach-settings.php:90
1178
  msgid "ACH Display"
1179
  msgstr ""
1180
 
1181
- #: includes/gateways/settings/ach-settings-v2.php:98
1182
  #: includes/gateways/settings/ach-settings.php:100
1183
  msgid "ACH Fee"
1184
  msgstr ""
1185
 
1186
- #: includes/gateways/settings/ach-settings-v2.php:108
1187
  #: includes/gateways/settings/ach-settings.php:110
1188
  msgid "None"
1189
  msgstr ""
1190
 
1191
- #: includes/gateways/settings/ach-settings-v2.php:109
1192
  #: includes/gateways/settings/ach-settings.php:111
1193
  msgid "Amount"
1194
  msgstr ""
1195
 
1196
- #: includes/gateways/settings/ach-settings-v2.php:110
1197
  #: includes/gateways/settings/ach-settings.php:112
1198
  msgid "Percentage"
1199
  msgstr ""
1200
 
1201
- #: includes/gateways/settings/ach-settings-v2.php:113
1202
  #: includes/gateways/settings/ach-settings.php:115
1203
  msgid "You can assign a fee to the order for ACH payments. Amount is a static amount and percentage is a percentage of the cart amount."
1204
  msgstr ""
1205
 
1206
- #: includes/gateways/settings/ach-settings.php:26
1207
- msgid "The active Plaid environment. You must set API mode to live to use Plaid's development environment."
1208
- msgstr ""
1209
-
1210
- #: includes/gateways/settings/ach-settings.php:36
1211
- msgid "ID that identifies your Plaid account."
1212
- msgstr ""
1213
-
1214
- #: includes/gateways/settings/ach-settings.php:44
1215
- msgid "Sandbox Secret"
1216
- msgstr ""
1217
-
1218
- #: includes/gateways/settings/ach-settings.php:47
1219
- msgid "Key that acts as a password when connecting to Plaid's sandbox environment."
1220
- msgstr ""
1221
-
1222
- #: includes/gateways/settings/ach-settings.php:51
1223
- msgid "Development Secret"
1224
- msgstr ""
1225
-
1226
- #: includes/gateways/settings/ach-settings.php:54
1227
- msgid "Development allows you to test real bank credentials with test transactions."
1228
- msgstr ""
1229
-
1230
- #: includes/gateways/settings/ach-settings.php:58
1231
- msgid "Production Secret"
1232
- msgstr ""
1233
-
1234
- #: includes/gateways/settings/ach-settings.php:61
1235
- msgid "Key that acts as a password when connecting to Plaid's production environment."
1236
- msgstr ""
1237
-
1238
  #: includes/gateways/settings/applepay-settings.php:5
1239
  msgid "Register Domain"
1240
  msgstr ""
@@ -1358,6 +1350,12 @@ msgstr ""
1358
  msgid "Buy with Apple Pay"
1359
  msgstr ""
1360
 
 
 
 
 
 
 
1361
  #: includes/gateways/settings/applepay-settings.php:107
1362
  msgid "Cart button type"
1363
  msgstr ""
2
  # This file is distributed under the same license as the Stripe For WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Stripe For WooCommerce 3.2.8\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woo-stripe-payment\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "POT-Creation-Date: 2020-11-18T21:08:25+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.4.0\n"
15
  "X-Domain: woo-stripe-payment\n"
32
 
33
  #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:102
34
  #: includes/admin/meta-boxes/views/html-product-data.php:14
 
35
  #: includes/gateways/settings/ach-settings.php:9
36
  #: includes/gateways/settings/applepay-settings.php:11
37
  #: includes/gateways/settings/cc-settings.php:4
45
  msgstr ""
46
 
47
  #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:111
 
48
  #: includes/gateways/settings/ach-settings.php:66
49
  #: includes/gateways/settings/applepay-settings.php:20
50
  #: includes/gateways/settings/cc-settings.php:17
55
 
56
  #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:115
57
  #: includes/admin/meta-boxes/views/html-charge-data-subview.php:47
 
58
  #: includes/gateways/settings/ach-settings.php:70
59
  #: includes/gateways/settings/applepay-settings.php:24
60
  #: includes/gateways/settings/cc-settings.php:21
64
  msgstr ""
65
 
66
  #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:121
 
67
  #: includes/gateways/settings/ach-settings.php:76
68
  #: includes/gateways/settings/applepay-settings.php:30
69
  #: includes/gateways/settings/cc-settings.php:27
73
  msgstr ""
74
 
75
  #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:124
 
76
  #: includes/gateways/settings/ach-settings.php:79
77
  #: includes/gateways/settings/applepay-settings.php:33
78
  #: includes/gateways/settings/cc-settings.php:30
81
  msgid "Leave blank if you don't want a description to show for the gateway."
82
  msgstr ""
83
 
84
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:177
85
  msgid "Order %s"
86
  msgstr ""
87
 
88
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:277
89
  msgid "Gateway will appear when store currency is <strong>%s</strong>"
90
  msgstr ""
91
 
92
+ #: includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php:280
93
  msgid " & billing country is <strong>%s</strong>"
94
  msgstr ""
95
 
213
  msgid "Increase your conversion rate by offering %1$s on your Product and Cart pages, or at the top of the checkout page. <br/><strong>Note:</strong> you can control which products display %s by going to the product edit page."
214
  msgstr ""
215
 
216
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1570
217
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1601
218
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:180
219
  #: includes/wc-stripe-functions.php:405
220
  #: includes/wc-stripe-functions.php:470
221
  msgid "Shipping"
222
  msgstr ""
223
 
224
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1578
225
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1604
226
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:190
227
  #: includes/wc-stripe-functions.php:422
228
  #: includes/wc-stripe-functions.php:478
229
  msgid "Discount"
230
  msgstr ""
231
 
232
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1581
233
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:208
234
  #: includes/wc-stripe-functions.php:430
235
  msgid "Tax"
236
  msgstr ""
237
 
238
+ #: includes/abstract/abstract-wc-payment-gateway-stripe.php:1611
239
  #: includes/wc-stripe-functions.php:489
240
  msgid "Fees"
241
  msgstr ""
686
  msgid "Payment authorization failed."
687
  msgstr ""
688
 
689
+ #: includes/class-wc-stripe-rest-api.php:40
690
  msgid "%1$s is an invalid controller name."
691
  msgstr ""
692
 
693
+ #: includes/class-wc-stripe-update.php:48
694
  msgid "Thank you for updating Stripe for WooCommerce to version %1$s."
695
  msgstr ""
696
 
698
  msgid "Quantity must be greater than zero."
699
  msgstr ""
700
 
701
+ #: includes/controllers/class-wc-stripe-controller-checkout.php:235
702
  msgid "Some required fields were missing. Please click %1$shere%2$s to complete your payment."
703
  msgstr ""
704
 
705
+ #: includes/controllers/class-wc-stripe-controller-checkout.php:284
706
  msgid "Please review your order details then click Place Order."
707
  msgstr ""
708
 
772
  msgid "You are not authorized to update this order."
773
  msgstr ""
774
 
775
+ #: includes/controllers/class-wc-stripe-controller-source.php:52
776
+ #: includes/controllers/class-wc-stripe-controller-source.php:60
777
+ msgid "Error updating source."
778
+ msgstr ""
779
+
780
+ #: includes/controllers/class-wc-stripe-controller-source.php:55
781
+ msgid "You do not have permission to update this source."
782
+ msgstr ""
783
+
784
  #: includes/controllers/class-wc-stripe-controller-webhook.php:50
785
  #: includes/controllers/class-wc-stripe-controller-webhook.php:52
786
  msgid "Invalid signature received. Verify that your webhook secret is correct."
826
 
827
  #: includes/gateways/class-wc-payment-gateway-stripe-alipay.php:59
828
  msgid ""
829
+ "Gateway will appear when store currency is CNY, or currency matches merchant's \r\n"
830
  "\t\t\t\t\tdefault Stripe currency. For merchants located in DK, NO, SE, & CH, currency must be EUR."
831
  msgstr ""
832
 
874
 
875
  #: includes/gateways/class-wc-payment-gateway-stripe-becs.php:30
876
  msgid ""
877
+ "By providing your bank account details and confirming this payment, you agree to this \r\n"
878
+ "\t\tDirect Debit Request and the %sDirect Debit Request service agreement%s, and authorise Stripe Payments Australia Pty Ltd ACN 160 180 343 Direct \r\n"
879
+ "\t\tDebit User ID number 507156 (“Stripe”) to debit your account through the Bulk Electronic Clearing System (BECS) on behalf of Stripe Press \r\n"
880
+ "\t\t(the \"Merchant\") for any amounts separately communicated to you by the Merchant. You certify that you are either an account holder or an \r\n"
881
  "\t\tauthorised signatory on the account listed above."
882
  msgstr ""
883
 
979
  msgid "Klarna gateway that integrates with your Stripe account."
980
  msgstr ""
981
 
982
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:76
983
  msgid "Payment Categories"
984
  msgstr ""
985
 
986
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:82
987
  msgid "These are the payment categories that will be displayed on the checkout page if they are supported. Note, depending on the customer's billing country, not all enabled options may show."
988
  msgstr ""
989
 
990
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:88
991
+ msgid "Use Stripe translation"
992
+ msgstr ""
993
+
994
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:92
995
+ msgid "If enabled, the payment option labels will use the Stripe translated text."
996
+ msgstr ""
997
+
998
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:200
999
+ msgid "Fee total"
1000
  msgstr ""
1001
 
1002
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:241
1003
  msgid "Pay Now"
1004
  msgstr ""
1005
 
1006
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:242
1007
  msgid "Pay Later"
1008
  msgstr ""
1009
 
1010
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:243
1011
  msgid "Pay Over Time"
1012
  msgstr ""
1013
 
1014
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:256
1015
  msgid "Click %1$shere%2$s for Klarna test payment methods."
1016
  msgstr ""
1017
 
1018
+ #: includes/gateways/class-wc-payment-gateway-stripe-klarna.php:262
1019
  msgid "Your purchase is not approved."
1020
  msgstr ""
1021
 
1131
  msgid "Scan the QR code using your WeChat app. Once scanned click the Place Order button."
1132
  msgstr ""
1133
 
 
1134
  #: includes/gateways/settings/ach-settings.php:5
1135
  msgid "For US customers only."
1136
  msgstr ""
1137
 
 
1138
  #: includes/gateways/settings/ach-settings.php:6
1139
  msgid "Read through our %1$sdocumentation%2$s to configure ACH payments"
1140
  msgstr ""
1141
 
 
1142
  #: includes/gateways/settings/ach-settings.php:14
1143
  msgid "If enabled, your site can accept ACH payments through Stripe."
1144
  msgstr ""
1145
 
 
1146
  #: includes/gateways/settings/ach-settings.php:18
1147
  msgid "Plaid Environment"
1148
  msgstr ""
1149
 
 
1150
  #: includes/gateways/settings/ach-settings.php:21
1151
  msgid "Sandbox"
1152
  msgstr ""
1153
 
 
1154
  #: includes/gateways/settings/ach-settings.php:22
1155
  msgid "Development"
1156
  msgstr ""
1157
 
 
1158
  #: includes/gateways/settings/ach-settings.php:23
1159
  msgid "Production"
1160
  msgstr ""
1161
 
1162
+ #: includes/gateways/settings/ach-settings.php:26
1163
+ msgid "The active Plaid environment. You must set API mode to live to use Plaid's development environment."
1164
+ msgstr ""
1165
+
1166
+ #: includes/gateways/settings/ach-settings.php:36
1167
+ msgid "ID that identifies your Plaid account."
1168
+ msgstr ""
1169
+
1170
+ #: includes/gateways/settings/ach-settings.php:44
1171
+ msgid "Sandbox Secret"
1172
+ msgstr ""
1173
+
1174
+ #: includes/gateways/settings/ach-settings.php:47
1175
+ msgid "Key that acts as a password when connecting to Plaid's sandbox environment."
1176
+ msgstr ""
1177
+
1178
+ #: includes/gateways/settings/ach-settings.php:51
1179
+ msgid "Development Secret"
1180
+ msgstr ""
1181
+
1182
+ #: includes/gateways/settings/ach-settings.php:54
1183
+ msgid "Development allows you to test real bank credentials with test transactions."
1184
+ msgstr ""
1185
+
1186
+ #: includes/gateways/settings/ach-settings.php:58
1187
+ msgid "Production Secret"
1188
+ msgstr ""
1189
+
1190
+ #: includes/gateways/settings/ach-settings.php:61
1191
+ msgid "Key that acts as a password when connecting to Plaid's production environment."
1192
  msgstr ""
1193
 
 
1194
  #: includes/gateways/settings/ach-settings.php:71
1195
  msgid "ACH Payment"
1196
  msgstr ""
1197
 
 
1198
  #: includes/gateways/settings/ach-settings.php:84
1199
  msgid "Client Name"
1200
  msgstr ""
1201
 
 
1202
  #: includes/gateways/settings/ach-settings.php:86
1203
  msgid "The name that appears on the ACH payment screen."
1204
  msgstr ""
1205
 
 
1206
  #: includes/gateways/settings/ach-settings.php:90
1207
  msgid "ACH Display"
1208
  msgstr ""
1209
 
 
1210
  #: includes/gateways/settings/ach-settings.php:100
1211
  msgid "ACH Fee"
1212
  msgstr ""
1213
 
 
1214
  #: includes/gateways/settings/ach-settings.php:110
1215
  msgid "None"
1216
  msgstr ""
1217
 
 
1218
  #: includes/gateways/settings/ach-settings.php:111
1219
  msgid "Amount"
1220
  msgstr ""
1221
 
 
1222
  #: includes/gateways/settings/ach-settings.php:112
1223
  msgid "Percentage"
1224
  msgstr ""
1225
 
 
1226
  #: includes/gateways/settings/ach-settings.php:115
1227
  msgid "You can assign a fee to the order for ACH payments. Amount is a static amount and percentage is a percentage of the cart amount."
1228
  msgstr ""
1229
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1230
  #: includes/gateways/settings/applepay-settings.php:5
1231
  msgid "Register Domain"
1232
  msgstr ""
1350
  msgid "Buy with Apple Pay"
1351
  msgstr ""
1352
 
1353
+ #: includes/gateways/settings/applepay-settings.php:102
1354
+ #: includes/gateways/settings/applepay-settings.php:112
1355
+ #: includes/gateways/settings/applepay-settings.php:122
1356
+ msgid "Checkout with Apple Pay"
1357
+ msgstr ""
1358
+
1359
  #: includes/gateways/settings/applepay-settings.php:107
1360
  msgid "Cart button type"
1361
  msgstr ""
includes/abstract/abstract-wc-payment-gateway-stripe-local-payment.php CHANGED
@@ -62,7 +62,7 @@ abstract class WC_Payment_Gateway_Stripe_Local_Payment extends WC_Payment_Gatewa
62
 
63
  public function output_settings_nav() {
64
  parent::output_settings_nav();
65
- include wc_stripe()->plugin_path() . 'includes/admin/views/html-settings-local-payments-nav.php';
66
  }
67
 
68
  public function init_form_fields() {
@@ -141,8 +141,9 @@ abstract class WC_Payment_Gateway_Stripe_Local_Payment extends WC_Payment_Gatewa
141
  ),
142
  'element_params' => $this->get_element_params(),
143
  'routes' => array(
144
- 'order_pay' => WC_Stripe_Rest_API::get_endpoint( wc_stripe()->rest_api->checkout->rest_uri( 'order-pay' ) ),
145
- 'delete_source' => WC_Stripe_Rest_API::get_endpoint( wc_stripe()->rest_api->checkout->rest_uri( 'source' ) )
 
146
  )
147
  )
148
  );
@@ -222,7 +223,7 @@ abstract class WC_Payment_Gateway_Stripe_Local_Payment extends WC_Payment_Gatewa
222
 
223
  return add_query_arg(
224
  array(
225
- '_payment_nonce' => wp_create_nonce( 'local-payment' ),
226
  'wc-stripe-local-gateway' => $this->id,
227
  ),
228
  $url
62
 
63
  public function output_settings_nav() {
64
  parent::output_settings_nav();
65
+ include stripe_wc()->plugin_path() . 'includes/admin/views/html-settings-local-payments-nav.php';
66
  }
67
 
68
  public function init_form_fields() {
141
  ),
142
  'element_params' => $this->get_element_params(),
143
  'routes' => array(
144
+ 'order_pay' => WC_Stripe_Rest_API::get_endpoint( stripe_wc()->rest_api->checkout->rest_uri( 'order-pay' ) ),
145
+ 'delete_order_source' => WC_Stripe_Rest_API::get_endpoint( stripe_wc()->rest_api->checkout->rest_uri( 'order/source' ) ),
146
+ 'update_source' => WC_Stripe_Rest_API::get_endpoint( stripe_wc()->rest_api->source->rest_uri( 'update' ) )
147
  )
148
  )
149
  );
223
 
224
  return add_query_arg(
225
  array(
226
+ 'order_key' => $order->get_order_key(),
227
  'wc-stripe-local-gateway' => $this->id,
228
  ),
229
  $url
includes/abstract/abstract-wc-payment-gateway-stripe.php CHANGED
@@ -185,7 +185,7 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
185
  }
186
 
187
  public function init_form_fields() {
188
- $this->form_fields = include wc_stripe()->plugin_path() . 'includes/gateways/settings/' . str_replace( array( 'stripe_', '_' ), array(
189
  '',
190
  '-'
191
  ), $this->id ) . '-settings.php';
@@ -260,33 +260,33 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
260
  global $wp;
261
  if ( $page ) {
262
  if ( 'product' === $page ) {
263
- $this->enqueue_product_scripts( wc_stripe()->scripts() );
264
  } elseif ( 'cart' === $page ) {
265
- $this->enqueue_cart_scripts( wc_stripe()->scripts() );
266
  } elseif ( 'checkout' === $page ) {
267
- $this->enqueue_checkout_scripts( wc_stripe()->scripts() );
268
  } elseif ( 'mini_cart' === $page ) {
269
- $this->enqueue_mini_cart_scripts( wc_stripe()->scripts() );
270
  } else {
271
  $this->enqueue_frontend_scripts();
272
  }
273
  } else {
274
  if ( is_add_payment_method_page() ) {
275
- $this->enqueue_add_payment_method_scripts( wc_stripe()->scripts() );
276
  }
277
  if ( is_checkout() ) {
278
- $this->enqueue_checkout_scripts( wc_stripe()->scripts() );
279
  }
280
  if ( is_cart() ) {
281
- $this->enqueue_cart_scripts( wc_stripe()->scripts() );
282
  }
283
  if ( is_product() ) {
284
- $this->enqueue_product_scripts( wc_stripe()->scripts() );
285
  }
286
  }
287
- if ( ! empty( wc_stripe()->scripts()->enqueued_scripts ) ) {
288
- wp_enqueue_style( wc_stripe()->scripts()->prefix . 'styles', wc_stripe()->assets_url( 'css/stripe' . wc_stripe()->scripts()->get_min() . '.css' ), array(), wc_stripe()->version() );
289
- wp_style_add_data( wc_stripe()->scripts()->prefix . 'styles', 'rtl', 'replace' );
290
  }
291
  }
292
 
@@ -407,14 +407,14 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
407
  'required_field' => __( 'Please fill out all required fields.', 'woo-stripe-payment' )
408
  ),
409
  'routes' => array(
410
- 'setup_intent' => WC_Stripe_Rest_API::get_endpoint( wc_stripe()->rest_api->payment_intent->rest_uri( 'setup-intent' ) ),
411
- 'sync_intent' => WC_Stripe_Rest_API::get_endpoint( wc_stripe()->rest_api->payment_intent->rest_uri( 'sync-payment-intent' ) ),
412
- 'add_to_cart' => WC_Stripe_Rest_API::get_endpoint( wc_stripe()->rest_api->cart->rest_uri( 'add-to-cart' ) ),
413
- 'cart_calculation' => WC_Stripe_Rest_API::get_endpoint( wc_stripe()->rest_api->cart->rest_uri( 'cart-calculation' ) ),
414
- 'shipping_method' => WC_Stripe_Rest_API::get_endpoint( wc_stripe()->rest_api->cart->rest_uri( 'shipping-method' ) ),
415
- 'shipping_address' => WC_Stripe_Rest_API::get_endpoint( wc_stripe()->rest_api->cart->rest_uri( 'shipping-address' ) ),
416
- 'checkout' => WC_Stripe_Rest_API::get_endpoint( wc_stripe()->rest_api->checkout->rest_uri( 'checkout' ) ),
417
- 'checkout_payment' => WC_Stripe_Rest_API::get_endpoint( wc_stripe()->rest_api->checkout->rest_uri( 'checkout/payment' ) )
418
  ),
419
  'rest_nonce' => wp_create_nonce( 'wp_rest' ),
420
  'banner_enabled' => $this->banner_checkout_enabled(),
@@ -1462,17 +1462,18 @@ abstract class WC_Payment_Gateway_Stripe extends WC_Payment_Gateway {
1462
  * Outputs fields required by Google Pay to render the payment wallet.
1463
  *
1464
  * @param string $page
 
1465
  */
1466
- public function output_display_items( $page = 'checkout' ) {
1467
  global $wp;
1468
  $order = null;
1469
- $data = array(
1470
  'items' => $this->has_digital_wallet ? $this->get_display_items( $page ) : array(),
1471
  'shipping_options' => $this->has_digital_wallet ? $this->get_formatted_shipping_methods() : array(),
1472
  'total' => WC()->cart->total,
1473
  'total_cents' => wc_stripe_add_number_precision( WC()->cart->total, get_woocommerce_currency() ),
1474
  'currency' => get_woocommerce_currency()
1475
- );
1476
  if ( in_array( $page, array( 'checkout', 'cart' ) ) ) {
1477
  if ( ! empty( $wp->query_vars['order-pay'] ) ) {
1478
  $order = wc_get_order( absint( $wp->query_vars['order-pay'] ) );
185
  }
186
 
187
  public function init_form_fields() {
188
+ $this->form_fields = include stripe_wc()->plugin_path() . 'includes/gateways/settings/' . str_replace( array( 'stripe_', '_' ), array(
189
  '',
190
  '-'
191
  ), $this->id ) . '-settings.php';
260
  global $wp;
261
  if ( $page ) {
262
  if ( 'product' === $page ) {
263
+ $this->enqueue_product_scripts( stripe_wc()->scripts() );
264
  } elseif ( 'cart' === $page ) {
265
+ $this->enqueue_cart_scripts( stripe_wc()->scripts() );
266
  } elseif ( 'checkout' === $page ) {
267
+ $this->enqueue_checkout_scripts( stripe_wc()->scripts() );
268
  } elseif ( 'mini_cart' === $page ) {
269
+ $this->enqueue_mini_cart_scripts( stripe_wc()->scripts() );
270
  } else {
271
  $this->enqueue_frontend_scripts();
272
  }
273
  } else {
274
  if ( is_add_payment_method_page() ) {
275
+ $this->enqueue_add_payment_method_scripts( stripe_wc()->scripts() );
276
  }
277
  if ( is_checkout() ) {
278
+ $this->enqueue_checkout_scripts( stripe_wc()->scripts() );
279
  }
280
  if ( is_cart() ) {
281
+ $this->enqueue_cart_scripts( stripe_wc()->scripts() );
282
  }
283
  if ( is_product() ) {
284
+ $this->enqueue_product_scripts( stripe_wc()->scripts() );
285
  }
286
  }
287
+ if ( ! empty( stripe_wc()->scripts()->enqueued_scripts ) ) {
288
+ wp_enqueue_style( stripe_wc()->scripts()->prefix . 'styles', stripe_wc()->assets_url( 'css/stripe' . stripe_wc()->scripts()->get_min() . '.css' ), array(), stripe_wc()->version() );
289
+ wp_style_add_data( stripe_wc()->scripts()->prefix . 'styles', 'rtl', 'replace' );
290
  }
291
  }
292
 
407
  'required_field' => __( 'Please fill out all required fields.', 'woo-stripe-payment' )
408
  ),
409
  'routes' => array(
410
+ 'setup_intent' => WC_Stripe_Rest_API::get_endpoint( stripe_wc()->rest_api->payment_intent->rest_uri( 'setup-intent' ) ),
411
+ 'sync_intent' => WC_Stripe_Rest_API::get_endpoint( stripe_wc()->rest_api->payment_intent->rest_uri( 'sync-payment-intent' ) ),
412
+ 'add_to_cart' => WC_Stripe_Rest_API::get_endpoint( stripe_wc()->rest_api->cart->rest_uri( 'add-to-cart' ) ),
413
+ 'cart_calculation' => WC_Stripe_Rest_API::get_endpoint( stripe_wc()->rest_api->cart->rest_uri( 'cart-calculation' ) ),
414
+ 'shipping_method' => WC_Stripe_Rest_API::get_endpoint( stripe_wc()->rest_api->cart->rest_uri( 'shipping-method' ) ),
415
+ 'shipping_address' => WC_Stripe_Rest_API::get_endpoint( stripe_wc()->rest_api->cart->rest_uri( 'shipping-address' ) ),
416
+ 'checkout' => WC_Stripe_Rest_API::get_endpoint( stripe_wc()->rest_api->checkout->rest_uri( 'checkout' ) ),
417
+ 'checkout_payment' => WC_Stripe_Rest_API::get_endpoint( stripe_wc()->rest_api->checkout->rest_uri( 'checkout/payment' ) )
418
  ),
419
  'rest_nonce' => wp_create_nonce( 'wp_rest' ),
420
  'banner_enabled' => $this->banner_checkout_enabled(),
1462
  * Outputs fields required by Google Pay to render the payment wallet.
1463
  *
1464
  * @param string $page
1465
+ * @param array $data
1466
  */
1467
+ public function output_display_items( $page = 'checkout', $data = array() ) {
1468
  global $wp;
1469
  $order = null;
1470
+ $data = wp_parse_args( $data, array(
1471
  'items' => $this->has_digital_wallet ? $this->get_display_items( $page ) : array(),
1472
  'shipping_options' => $this->has_digital_wallet ? $this->get_formatted_shipping_methods() : array(),
1473
  'total' => WC()->cart->total,
1474
  'total_cents' => wc_stripe_add_number_precision( WC()->cart->total, get_woocommerce_currency() ),
1475
  'currency' => get_woocommerce_currency()
1476
+ ) );
1477
  if ( in_array( $page, array( 'checkout', 'cart' ) ) ) {
1478
  if ( ! empty( $wp->query_vars['order-pay'] ) ) {
1479
  $order = wc_get_order( absint( $wp->query_vars['order-pay'] ) );
includes/abstract/abstract-wc-stripe-rest-controller.php CHANGED
@@ -1,104 +1,104 @@
1
- <?php
2
- defined( 'ABSPATH' ) || exit();
3
-
4
- /**
5
- *
6
- * @author PaymentPlugins
7
- * @package Stripe/Abstract
8
- *
9
- */
10
- abstract class WC_Stripe_Rest_Controller {
11
-
12
- protected $namespace = '';
13
-
14
- /**
15
- *
16
- * @var WP_Error
17
- */
18
- protected $error = null;
19
-
20
- /**
21
- *
22
- * @param string $route
23
- */
24
- protected function register_authenticated_route( $route ) {
25
- $routes = get_option( 'wc_stripe_authenticated_routes', array() );
26
- $route = '/' . trim( $route, '/' );
27
- $routes[ md5( $route ) ] = $route;
28
- update_option( 'wc_stripe_authenticated_routes', $routes );
29
- }
30
-
31
- /**
32
- * Register all routes that the controller uses.
33
- */
34
- abstract public function register_routes();
35
-
36
- public function rest_uri( $uri = '' ) {
37
- $rest_uri = wc_stripe()->rest_api->rest_uri() . ( ! empty( $this->namespace ) ? $this->namespace : '' );
38
- if ( $uri ) {
39
- $rest_uri = trailingslashit( $rest_uri ) . $uri;
40
- }
41
- return trim( $rest_uri, '/' );
42
- }
43
-
44
- public function rest_url( $uri = '' ) {
45
- $rest_url = wc_stripe()->rest_api->rest_url() . ( ! empty( $this->namespace ) ? trailingslashit( $this->namespace ) : '' );
46
- if ( $uri ) {
47
- $rest_url = trailingslashit( $rest_url ) . $uri;
48
- }
49
- return $rest_url;
50
- }
51
-
52
- /**
53
- *
54
- * @param WP_REST_Request $request
55
- */
56
- public function admin_permission_check( $request ) {
57
- if ( ! current_user_can( 'administrator' ) ) {
58
- return new WP_Error( 'permission-error', __( 'You do not have permissions to access this resource.', 'woo-stripe-payment' ), array( 'status' => 403 ) );
59
- }
60
-
61
- return true;
62
- }
63
-
64
- protected function get_error_messages() {
65
- return $this->get_messages( 'error' );
66
- }
67
-
68
- protected function get_messages( $types = 'all' ) {
69
- $notices = wc_get_notices();
70
- if ( $types !== 'all' ) {
71
- $types = (array) $types;
72
- foreach ( $notices as $type => $notice ) {
73
- if ( ! in_array( $type, $types ) ) {
74
- unset( $notices[ $type ] );
75
- }
76
- }
77
- }
78
- wc_set_notices( $notices );
79
- ob_start();
80
- $messages = wc_print_notices();
81
- return ob_get_clean();
82
- }
83
-
84
- /**
85
- * Allows a status code of 200 to be returned even if there is a validation error.
86
- *
87
- * @param WP_Error $error
88
- */
89
- protected function add_validation_error( $error ) {
90
- $data = $error->get_error_data();
91
- if ( ! is_array( $data ) ) {
92
- $data = array();
93
- }
94
- $error->add_data( array_merge( $data, array( 'status' => 200 ) ) );
95
- $this->error = $error;
96
- add_filter(
97
- 'rest_request_before_callbacks',
98
- function ( $response ) {
99
- return $this->error ? $this->error : response;
100
- }
101
- );
102
- return $error;
103
- }
104
- }
1
+ <?php
2
+ defined( 'ABSPATH' ) || exit();
3
+
4
+ /**
5
+ *
6
+ * @author PaymentPlugins
7
+ * @package Stripe/Abstract
8
+ *
9
+ */
10
+ abstract class WC_Stripe_Rest_Controller {
11
+
12
+ protected $namespace = '';
13
+
14
+ /**
15
+ *
16
+ * @var WP_Error
17
+ */
18
+ protected $error = null;
19
+
20
+ /**
21
+ *
22
+ * @param string $route
23
+ */
24
+ protected function register_authenticated_route( $route ) {
25
+ $routes = get_option( 'wc_stripe_authenticated_routes', array() );
26
+ $route = '/' . trim( $route, '/' );
27
+ $routes[ md5( $route ) ] = $route;
28
+ update_option( 'wc_stripe_authenticated_routes', $routes );
29
+ }
30
+
31
+ /**
32
+ * Register all routes that the controller uses.
33
+ */
34
+ abstract public function register_routes();
35
+
36
+ public function rest_uri( $uri = '' ) {
37
+ $rest_uri = stripe_wc()->rest_api->rest_uri() . ( ! empty( $this->namespace ) ? $this->namespace : '' );
38
+ if ( $uri ) {
39
+ $rest_uri = trailingslashit( $rest_uri ) . $uri;
40
+ }
41
+ return trim( $rest_uri, '/' );
42
+ }
43
+
44
+ public function rest_url( $uri = '' ) {
45
+ $rest_url = stripe_wc()->rest_api->rest_url() . ( ! empty( $this->namespace ) ? trailingslashit( $this->namespace ) : '' );
46
+ if ( $uri ) {
47
+ $rest_url = trailingslashit( $rest_url ) . $uri;
48
+ }
49
+ return $rest_url;
50
+ }
51
+
52
+ /**
53
+ *
54
+ * @param WP_REST_Request $request
55
+ */
56
+ public function admin_permission_check( $request ) {
57
+ if ( ! current_user_can( 'administrator' ) ) {
58
+ return new WP_Error( 'permission-error', __( 'You do not have permissions to access this resource.', 'woo-stripe-payment' ), array( 'status' => 403 ) );
59
+ }
60
+
61
+ return true;
62
+ }
63
+
64
+ protected function get_error_messages() {
65
+ return $this->get_messages( 'error' );
66
+ }
67
+
68
+ protected function get_messages( $types = 'all' ) {
69
+ $notices = wc_get_notices();
70
+ if ( $types !== 'all' ) {
71
+ $types = (array) $types;
72
+ foreach ( $notices as $type => $notice ) {
73
+ if ( ! in_array( $type, $types ) ) {
74
+ unset( $notices[ $type ] );
75
+ }
76
+ }
77
+ }
78
+ wc_set_notices( $notices );
79
+ ob_start();
80
+ $messages = wc_print_notices();
81
+ return ob_get_clean();
82
+ }
83
+
84
+ /**
85
+ * Allows a status code of 200 to be returned even if there is a validation error.
86
+ *
87
+ * @param WP_Error $error
88
+ */
89
+ protected function add_validation_error( $error ) {
90
+ $data = $error->get_error_data();
91
+ if ( ! is_array( $data ) ) {
92
+ $data = array();
93
+ }
94
+ $error->add_data( array_merge( $data, array( 'status' => 200 ) ) );
95
+ $this->error = $error;
96
+ add_filter(
97
+ 'rest_request_before_callbacks',
98
+ function ( $response ) {
99
+ return $this->error ? $this->error : response;
100
+ }
101
+ );
102
+ return $error;
103
+ }
104
+ }
includes/admin/class-wc-stripe-admin-assets.php CHANGED
@@ -20,21 +20,21 @@ class WC_Stripe_Admin_Assets {
20
  global $current_section, $wc_stripe_subsection;
21
  $screen = get_current_screen();
22
  $screen_id = $screen ? $screen->id : '';
23
- $js_path = wc_stripe()->assets_url() . 'js/';
24
- $css_path = wc_stripe()->assets_url() . 'css/';
25
 
26
  wp_register_script( 'wc-stripe-admin-settings', $js_path . 'admin/admin-settings.js', array(
27
  'jquery',
28
  'jquery-blockui'
29
- ), wc_stripe()->version, true );
30
  wp_register_script( 'wc-stripe-meta-boxes-order', $js_path . 'admin/meta-boxes-order.js', array(
31
  'jquery',
32
  'jquery-blockui'
33
- ), wc_stripe()->version, true );
34
  wp_register_script( 'wc-stripe-meta-boxes-subscription', $js_path . 'admin/meta-boxes-subscription.js', array(
35
  'jquery',
36
  'jquery-blockui'
37
- ), wc_stripe()->version, true );
38
  wp_register_script(
39
  'wc-stripe-product-data',
40
  $js_path . 'admin/meta-boxes-product-data.js',
@@ -46,25 +46,25 @@ class WC_Stripe_Admin_Assets {
46
  'jquery-ui-core',
47
  'jquery-tiptip',
48
  ),
49
- wc_stripe()->version(),
50
  true
51
  );
52
- wp_register_style( 'wc-stripe-admin-style', $css_path . 'admin/admin.css', array(), wc_stripe()->version );
53
 
54
  if ( strpos( $screen_id, 'wc-settings' ) !== false ) {
55
  if ( isset( $_REQUEST['section'] ) && preg_match( '/stripe_[\w]*/', $_REQUEST['section'] ) ) {
56
  wp_enqueue_script( 'wc-stripe-admin-settings' );
57
  wp_enqueue_style( 'wc-stripe-admin-style' );
58
  wp_style_add_data( 'wc-stripe-admin-style', 'rtl', 'replace' );
59
- wp_enqueue_script( 'stripe-help-widget', $js_path . 'admin/help-widget.js', array(), wc_stripe()->version(), true );
60
  wp_localize_script(
61
  'wc-stripe-admin-settings',
62
  'wc_stripe_setting_params',
63
  array(
64
  'routes' => array(
65
- 'apple_domain' => wc_stripe()->rest_api->settings->rest_url( 'apple-domain' ),
66
- 'create_webhook' => wc_stripe()->rest_api->settings->rest_url( 'create-webook' ),
67
- 'connection_test' => wc_stripe()->rest_api->settings->rest_url( 'connection-test' ),
68
  ),
69
  'rest_nonce' => wp_create_nonce( 'wp_rest' ),
70
  )
@@ -83,8 +83,8 @@ class WC_Stripe_Admin_Assets {
83
  array(
84
  '_wpnonce' => wp_create_nonce( 'wp_rest' ),
85
  'routes' => array(
86
- 'enable_gateway' => wc_stripe()->rest_api->product_data->rest_url( 'gateway' ),
87
- 'save' => wc_stripe()->rest_api->product_data->rest_url( 'save' ),
88
  ),
89
  )
90
  );
20
  global $current_section, $wc_stripe_subsection;
21
  $screen = get_current_screen();
22
  $screen_id = $screen ? $screen->id : '';
23
+ $js_path = stripe_wc()->assets_url() . 'js/';
24
+ $css_path = stripe_wc()->assets_url() . 'css/';
25
 
26
  wp_register_script( 'wc-stripe-admin-settings', $js_path . 'admin/admin-settings.js', array(
27
  'jquery',
28
  'jquery-blockui'
29
+ ), stripe_wc()->version, true );
30
  wp_register_script( 'wc-stripe-meta-boxes-order', $js_path . 'admin/meta-boxes-order.js', array(
31
  'jquery',
32
  'jquery-blockui'
33
+ ), stripe_wc()->version, true );
34
  wp_register_script( 'wc-stripe-meta-boxes-subscription', $js_path . 'admin/meta-boxes-subscription.js', array(
35
  'jquery',
36
  'jquery-blockui'
37
+ ), stripe_wc()->version, true );
38
  wp_register_script(
39
  'wc-stripe-product-data',
40
  $js_path . 'admin/meta-boxes-product-data.js',
46
  'jquery-ui-core',
47
  'jquery-tiptip',
48
  ),
49
+ stripe_wc()->version(),
50
  true
51
  );
52
+ wp_register_style( 'wc-stripe-admin-style', $css_path . 'admin/admin.css', array(), stripe_wc()->version );
53
 
54
  if ( strpos( $screen_id, 'wc-settings' ) !== false ) {
55
  if ( isset( $_REQUEST['section'] ) && preg_match( '/stripe_[\w]*/', $_REQUEST['section'] ) ) {
56
  wp_enqueue_script( 'wc-stripe-admin-settings' );
57
  wp_enqueue_style( 'wc-stripe-admin-style' );
58
  wp_style_add_data( 'wc-stripe-admin-style', 'rtl', 'replace' );
59
+ wp_enqueue_script( 'stripe-help-widget', $js_path . 'admin/help-widget.js', array(), stripe_wc()->version(), true );
60
  wp_localize_script(
61
  'wc-stripe-admin-settings',
62
  'wc_stripe_setting_params',
63
  array(
64
  'routes' => array(
65
+ 'apple_domain' => WC_Stripe_Rest_API::get_endpoint( stripe_wc()->rest_api->settings->rest_uri( 'apple-domain' ) ),
66
+ 'create_webhook' => WC_Stripe_Rest_API::get_endpoint( stripe_wc()->rest_api->settings->rest_uri( 'create-webhook' ) ),
67
+ 'connection_test' => WC_Stripe_Rest_API::get_endpoint( stripe_wc()->rest_api->settings->rest_uri( 'connection-test' ) ),
68
  ),
69
  'rest_nonce' => wp_create_nonce( 'wp_rest' ),
70
  )
83
  array(
84
  '_wpnonce' => wp_create_nonce( 'wp_rest' ),
85
  'routes' => array(
86
+ 'enable_gateway' => stripe_wc()->rest_api->product_data->rest_url( 'gateway' ),
87
+ 'save' => stripe_wc()->rest_api->product_data->rest_url( 'save' ),
88
  ),
89
  )
90
  );
includes/admin/class-wc-stripe-admin-notices.php CHANGED
@@ -43,10 +43,10 @@ class WC_Stripe_Admin_Notices {
43
  'connect_notice' => array(
44
  'callback' => function () {
45
  return ( ! isset( $_GET['_stripe_connect_nonce'] ) &&
46
- ( ! wc_stripe()->api_settings->get_option( 'account_id' ) && get_option( 'wc_stripe_connect_notice', 'no' ) == 'yes' ) );
47
  },
48
  'message' => function () {
49
- wp_enqueue_style( 'wc-stripe-styles', wc_stripe()->assets_url( 'css/admin/admin.css' ), array(), wc_stripe()->version() );
50
 
51
  return sprintf(
52
  __(
@@ -55,7 +55,7 @@ class WC_Stripe_Admin_Notices {
55
  Stripe is requesting that all merchants switch. %1$sUpdate Integration%2$s',
56
  'woo-stripe-payment'
57
  ),
58
- ' <a href = "' . wc_stripe()->api_settings->get_connect_url() . '" class = "stripe-connect light-blue do-stripe-connect"><span>', '</span></a>'
59
  );
60
  },
61
  ),
43
  'connect_notice' => array(
44
  'callback' => function () {
45
  return ( ! isset( $_GET['_stripe_connect_nonce'] ) &&
46
+ ( ! stripe_wc()->api_settings->get_option( 'account_id' ) && get_option( 'wc_stripe_connect_notice', 'no' ) == 'yes' ) );
47
  },
48
  'message' => function () {
49
+ wp_enqueue_style( 'wc-stripe-styles', stripe_wc()->assets_url( 'css/admin/admin.css' ), array(), stripe_wc()->version() );
50
 
51
  return sprintf(
52
  __(
55
  Stripe is requesting that all merchants switch. %1$sUpdate Integration%2$s',
56
  'woo-stripe-payment'
57
  ),
58
+ ' <a href = "' . stripe_wc()->api_settings->get_connect_url() . '" class = "stripe-connect light-blue do-stripe-connect"><span>', '</span></a>'
59
  );
60
  },
61
  ),
includes/admin/class-wc-stripe-admin-user-edit.php CHANGED
@@ -1,109 +1,109 @@
1
- <?php
2
- defined( 'ABSPATH' ) || exit();
3
-
4
- /**
5
- *
6
- * @since 3.0.0
7
- * @package Stripe/Admin
8
- * @author PaymentPlugins
9
- *
10
- */
11
- class WC_Stripe_Admin_User_Edit {
12
-
13
- public static function init() {
14
- add_action( 'edit_user_profile', array( __CLASS__, 'output' ) );
15
- add_action( 'show_user_profile', array( __CLASS__, 'output' ) );
16
- add_action( 'edit_user_profile_update', array( __CLASS__, 'save' ) );
17
- add_action( 'personal_options_update', array( __CLASS__, 'save' ) );
18
- }
19
-
20
- /**
21
- *
22
- * @param WP_User $user
23
- */
24
- public static function output( $user ) {
25
- // enquue scripts
26
- wp_enqueue_style( 'wc-stripe-admin-style' );
27
-
28
- remove_filter( 'woocommerce_get_customer_payment_tokens', 'wc_stripe_get_customer_payment_tokens' );
29
- // get payment methods for all environments.
30
- $tokens = WC_Payment_Tokens::get_customer_tokens( $user->ID );
31
- $payment_methods = array(
32
- 'live' => array(),
33
- 'test' => array(),
34
- );
35
- foreach ( $tokens as $token ) {
36
- if ( $token instanceof WC_Payment_Token_Stripe ) {
37
- if ( 'live' === $token->get_environment() ) {
38
- $payment_methods['live'][] = $token;
39
- } else {
40
- $payment_methods['test'][] = $token;
41
- }
42
- }
43
- }
44
- include wc_stripe()->plugin_path() . 'includes/admin/views/html-user-profile.php';
45
- }
46
-
47
- /**
48
- *
49
- * @param int $user_id
50
- */
51
- public static function save( $user_id ) {
52
- $modes = array( 'test', 'live' );
53
- if ( isset( $_POST['wc_stripe_live_id'] ) ) {
54
- $old_live_id = wc_stripe_get_customer_id( $user_id, 'live' );
55
- wc_stripe_save_customer( wc_clean( $_POST['wc_stripe_live_id'] ), $user_id, 'live' );
56
- }
57
- if ( isset( $_POST['wc_stripe_test_id'] ) ) {
58
- $old_test_id = wc_stripe_get_customer_id( $user_id, 'test' );
59
- wc_stripe_save_customer( wc_clean( $_POST['wc_stripe_test_id'] ), $user_id, 'test' );
60
- }
61
-
62
- // check if admin want's to delete any payment methods
63
- foreach ( $modes as $mode ) {
64
- if ( isset( $_POST[ $mode . '_payment_method_actions' ] ) ) {
65
- switch ( wc_clean( $_POST[ $mode . '_payment_method_actions' ] ) ) {
66
- case 'delete':
67
- if ( isset( $_POST['payment_methods'], $_POST['payment_methods'][ $mode ] ) ) {
68
- $tokens = $_POST['payment_methods'][ $mode ];
69
- foreach ( $tokens as $token_id ) {
70
- WC_Payment_Tokens::delete( absint( $token_id ) );
71
- }
72
- }
73
- break;
74
- }
75
- }
76
- }
77
-
78
- $changes = array(
79
- 'live' => $old_live_id !== wc_stripe_get_customer_id( $user_id, 'live' ),
80
- 'test' => $old_test_id !== wc_stripe_get_customer_id( $user_id, 'test' ),
81
- );
82
- $gateway = WC_Stripe_Gateway::load();
83
-
84
- // this will prevent the payment method from being deleted in Stripe. We only want to remove the tokens
85
- // from the WC tables.
86
- remove_action( 'woocommerce_payment_token_deleted', 'wc_stripe_woocommerce_payment_token_deleted', 10 );
87
-
88
- // want results to return tokens for all modes
89
- remove_action( 'woocommerce_get_customer_payment_tokens', 'wc_stripe_get_customer_payment_tokens' );
90
-
91
- // if the value has changed, then remove old payment methods and import new ones.
92
- foreach ( $changes as $mode => $change ) {
93
- if ( $change ) {
94
- // Delete all current payment methods in WC then save new ones.
95
- $tokens = WC_Payment_Tokens::get_customer_tokens( $user_id );
96
- foreach ( $tokens as $token ) {
97
- if ( $token instanceof WC_Payment_Token_Stripe ) {
98
- if ( $mode === $token->get_environment() ) {
99
- WC_Payment_Tokens::delete( $token->get_id() );
100
- }
101
- }
102
- }
103
- // import payment methods from Stripe.
104
- WC_Stripe_Customer_Manager::sync_payment_methods( wc_stripe_get_customer_id( $user_id, $mode ), $user_id, $mode );
105
- }
106
- }
107
- }
108
- }
109
- WC_Stripe_Admin_User_Edit::init();
1
+ <?php
2
+ defined( 'ABSPATH' ) || exit();
3
+
4
+ /**
5
+ *
6
+ * @since 3.0.0
7
+ * @package Stripe/Admin
8
+ * @author PaymentPlugins
9
+ *
10
+ */
11
+ class WC_Stripe_Admin_User_Edit {
12
+
13
+ public static function init() {
14
+ add_action( 'edit_user_profile', array( __CLASS__, 'output' ) );
15
+ add_action( 'show_user_profile', array( __CLASS__, 'output' ) );
16
+ add_action( 'edit_user_profile_update', array( __CLASS__, 'save' ) );
17
+ add_action( 'personal_options_update', array( __CLASS__, 'save' ) );
18
+ }
19
+
20
+ /**
21
+ *
22
+ * @param WP_User $user
23
+ */
24
+ public static function output( $user ) {
25
+ // enquue scripts
26
+ wp_enqueue_style( 'wc-stripe-admin-style' );
27
+
28
+ remove_filter( 'woocommerce_get_customer_payment_tokens', 'wc_stripe_get_customer_payment_tokens' );
29
+ // get payment methods for all environments.
30
+ $tokens = WC_Payment_Tokens::get_customer_tokens( $user->ID );
31
+ $payment_methods = array(
32
+ 'live' => array(),
33
+ 'test' => array(),
34
+ );
35
+ foreach ( $tokens as $token ) {
36
+ if ( $token instanceof WC_Payment_Token_Stripe ) {
37
+ if ( 'live' === $token->get_environment() ) {
38
+ $payment_methods['live'][] = $token;
39
+ } else {
40
+ $payment_methods['test'][] = $token;
41
+ }
42
+ }
43
+ }
44
+ include stripe_wc()->plugin_path() . 'includes/admin/views/html-user-profile.php';
45
+ }
46
+
47
+ /**
48
+ *
49
+ * @param int $user_id
50
+ */
51
+ public static function save( $user_id ) {
52
+ $modes = array( 'test', 'live' );
53
+ if ( isset( $_POST['wc_stripe_live_id'] ) ) {
54
+ $old_live_id = wc_stripe_get_customer_id( $user_id, 'live' );
55
+ wc_stripe_save_customer( wc_clean( $_POST['wc_stripe_live_id'] ), $user_id, 'live' );
56
+ }
57
+ if ( isset( $_POST['wc_stripe_test_id'] ) ) {
58
+ $old_test_id = wc_stripe_get_customer_id( $user_id, 'test' );
59
+ wc_stripe_save_customer( wc_clean( $_POST['wc_stripe_test_id'] ), $user_id, 'test' );
60
+ }
61
+
62
+ // check if admin want's to delete any payment methods
63
+ foreach ( $modes as $mode ) {
64
+ if ( isset( $_POST[ $mode . '_payment_method_actions' ] ) ) {
65
+ switch ( wc_clean( $_POST[ $mode . '_payment_method_actions' ] ) ) {
66
+ case 'delete':
67
+ if ( isset( $_POST['payment_methods'], $_POST['payment_methods'][ $mode ] ) ) {
68
+ $tokens = $_POST['payment_methods'][ $mode ];
69
+ foreach ( $tokens as $token_id ) {
70
+ WC_Payment_Tokens::delete( absint( $token_id ) );
71
+ }
72
+ }
73
+ break;
74
+ }
75
+ }
76
+ }
77
+
78
+ $changes = array(
79
+ 'live' => $old_live_id !== wc_stripe_get_customer_id( $user_id, 'live' ),
80
+ 'test' => $old_test_id !== wc_stripe_get_customer_id( $user_id, 'test' ),
81
+ );
82
+ $gateway = WC_Stripe_Gateway::load();
83
+
84
+ // this will prevent the payment method from being deleted in Stripe. We only want to remove the tokens
85
+ // from the WC tables.
86
+ remove_action( 'woocommerce_payment_token_deleted', 'wc_stripe_woocommerce_payment_token_deleted', 10 );
87
+
88
+ // want results to return tokens for all modes
89
+ remove_action( 'woocommerce_get_customer_payment_tokens', 'wc_stripe_get_customer_payment_tokens' );
90
+
91
+ // if the value has changed, then remove old payment methods and import new ones.
92
+ foreach ( $changes as $mode => $change ) {
93
+ if ( $change ) {
94
+ // Delete all current payment methods in WC then save new ones.
95
+ $tokens = WC_Payment_Tokens::get_customer_tokens( $user_id );
96
+ foreach ( $tokens as $token ) {
97
+ if ( $token instanceof WC_Payment_Token_Stripe ) {
98
+ if ( $mode === $token->get_environment() ) {
99
+ WC_Payment_Tokens::delete( $token->get_id() );
100
+ }
101
+ }
102
+ }
103
+ // import payment methods from Stripe.
104
+ WC_Stripe_Customer_Manager::sync_payment_methods( wc_stripe_get_customer_id( $user_id, $mode ), $user_id, $mode );
105
+ }
106
+ }
107
+ }
108
+ }
109
+ WC_Stripe_Admin_User_Edit::init();
includes/admin/meta-boxes/class-wc-stripe-admin-order-metaboxes.php CHANGED
@@ -63,7 +63,7 @@ class WC_Stripe_Admin_Order_Metaboxes {
63
  $payment_methods = array_merge( $payment_methods, WC_Payment_Tokens::get_customer_tokens( $order->get_user_id(), $gateway->id ) );
64
  }
65
  }
66
- wp_enqueue_script( 'wc-stripe-elements', 'https://js.stripe.com/v3/', array(), wc_stripe()->version, true );
67
  wp_localize_script(
68
  'wc-stripe-elements',
69
  'wc_stripe_order_pay_params',
@@ -78,18 +78,18 @@ class WC_Stripe_Admin_Order_Metaboxes {
78
  'order_status' => $order->get_status(),
79
  )
80
  );
81
- wp_enqueue_script( 'wc-stripe-admin-modals', wc_stripe()->assets_url( 'js/admin/modals.js' ), array(
82
  'wc-backbone-modal',
83
  'jquery-blockui'
84
- ), wc_stripe()->version, true );
85
  }
86
  }
87
 
88
  public static function enqueue_scripts() {
89
- wp_enqueue_script( 'wc-stripe-order-metabox', wc_stripe()->assets_url( 'js/admin/meta-boxes-order.js' ), array(
90
  'jquery',
91
  'jquery-blockui'
92
- ), wc_stripe()->version(), true );
93
 
94
  wp_localize_script(
95
  'wc-stripe-order-metabox',
@@ -97,11 +97,11 @@ class WC_Stripe_Admin_Order_Metaboxes {
97
  array(
98
  '_wpnonce' => wp_create_nonce( 'wp_rest' ),
99
  'routes' => array(
100
- 'charge_view' => WC_Stripe_Rest_API::get_endpoint( wc_stripe()->rest_api->order_actions->rest_uri( 'charge-view' ) ),
101
- 'capture' => WC_Stripe_Rest_API::get_endpoint( wc_stripe()->rest_api->order_actions->rest_uri( 'capture' ) ),
102
- 'void' => WC_Stripe_Rest_API::get_endpoint( wc_stripe()->rest_api->order_actions->rest_uri( 'void' ) ),
103
- 'pay' => WC_Stripe_Rest_API::get_endpoint( wc_stripe()->rest_api->order_actions->rest_uri( 'pay' ) ),
104
- 'payment_methods' => WC_Stripe_Rest_API::get_endpoint( wc_stripe()->rest_api->order_actions->rest_uri( 'customer-payment-methods' ) ),
105
  ),
106
  )
107
  );
63
  $payment_methods = array_merge( $payment_methods, WC_Payment_Tokens::get_customer_tokens( $order->get_user_id(), $gateway->id ) );
64
  }
65
  }
66
+ wp_enqueue_script( 'wc-stripe-elements', 'https://js.stripe.com/v3/', array(), stripe_wc()->version, true );
67
  wp_localize_script(
68
  'wc-stripe-elements',
69
  'wc_stripe_order_pay_params',
78
  'order_status' => $order->get_status(),
79
  )
80
  );
81
+ wp_enqueue_script( 'wc-stripe-admin-modals', stripe_wc()->assets_url( 'js/admin/modals.js' ), array(
82
  'wc-backbone-modal',
83
  'jquery-blockui'
84
+ ), stripe_wc()->version, true );
85
  }
86
  }
87
 
88
  public static function enqueue_scripts() {
89
+ wp_enqueue_script( 'wc-stripe-order-metabox', stripe_wc()->assets_url( 'js/admin/meta-boxes-order.js' ), array(
90
  'jquery',
91
  'jquery-blockui'
92
+ ), stripe_wc()->version(), true );
93
 
94
  wp_localize_script(
95
  'wc-stripe-order-metabox',
97
  array(
98
  '_wpnonce' => wp_create_nonce( 'wp_rest' ),
99
  'routes' => array(
100
+ 'charge_view' => WC_Stripe_Rest_API::get_endpoint( stripe_wc()->rest_api->order_actions->rest_uri( 'charge-view' ) ),
101
+ 'capture' => WC_Stripe_Rest_API::get_endpoint( stripe_wc()->rest_api->order_actions->rest_uri( 'capture' ) ),
102
+ 'void' => WC_Stripe_Rest_API::get_endpoint( stripe_wc()->rest_api->order_actions->rest_uri( 'void' ) ),
103
+ 'pay' => WC_Stripe_Rest_API::get_endpoint( stripe_wc()->rest_api->order_actions->rest_uri( 'pay' ) ),
104
+ 'payment_methods' => WC_Stripe_Rest_API::get_endpoint( stripe_wc()->rest_api->order_actions->rest_uri( 'customer-payment-methods' ) ),
105
  ),
106
  )
107
  );
includes/admin/settings/class-wc-stripe-api-settings.php CHANGED
@@ -1,191 +1,191 @@
1
- <?php
2
- defined( 'ABSPATH' ) || exit();
3
-
4
- /**
5
- *
6
- * @author Payment Plugins
7
- * @since 3.0.0
8
- * @package Stripe/Classes
9
- *
10
- */
11
- class WC_Stripe_API_Settings extends WC_Stripe_Settings_API {
12
-
13
- public function __construct() {
14
- $this->id = 'stripe_api';
15
- $this->tab_title = __( 'API Settings', 'woo-stripe-payment' );
16
- parent::__construct();
17
- }
18
-
19
- public function hooks() {
20
- parent::hooks();
21
- add_action( 'woocommerce_update_options_checkout_' . $this->id, array( $this, 'process_admin_options' ) );
22
- add_filter( 'wc_stripe_settings_nav_tabs', array( $this, 'admin_nav_tab' ) );
23
- add_action( 'woocommerce_stripe_settings_checkout_' . $this->id, array( $this, 'admin_options' ) );
24
- }
25
-
26
- public function init_form_fields() {
27
- $this->form_fields = array(
28
- 'title' => array(
29
- 'type' => 'title',
30
- 'title' => __( 'API Settings', 'woo-stripe-payment' ),
31
- ),
32
- 'mode' => array(
33
- 'type' => 'select',
34
- 'title' => __( 'Mode', 'woo-stripe-payment' ),
35
- 'class' => 'wc-enhanced-select',
36
- 'options' => array(
37
- 'test' => __( 'Test', 'woo-stripe-payment' ),
38
- 'live' => __( 'Live', 'woo-stripe-payment' ),
39
- ),
40
- 'default' => 'test',
41
- 'desc_tip' => true,
42
- 'description' => __( 'The mode determines if you are processing test transactions or live transactions on your site. Test mode allows you to simulate payments so you can test your integration.', 'woo-stripe-payment' ),
43
- ),
44
- 'account_id' => array(
45
- 'type' => 'paragraph',
46
- 'title' => __( 'Account ID', 'woo-stripe-payment' ),
47
- 'text' => '',
48
- 'class' => '',
49
- 'default' => '',
50
- 'desc_tip' => true,
51
- 'description' => __( 'This is your Stripe Connect ID and serves as a unique identifier.', 'woo-stripe-payment' ),
52
- ),
53
- 'stripe_connect' => array(
54
- 'type' => 'stripe_connect',
55
- 'title' => __( 'Connect Stripe Account', 'woo-stripe-payment' ),
56
- 'label' => __( 'Click to Connect', 'woo-stripe-payment' ),
57
- 'class' => 'do-stripe-connect',
58
- 'description' => __( 'We make it easy to connect Stripe to your site. Click the Connect button to go through our connect flow.', 'woo-stripe-payment' ),
59
- ),
60
- 'connection_test' => array(
61
- 'type' => 'stripe_button',
62
- 'title' => __( 'Connection Test', 'woo-stripe-payment' ),
63
- 'label' => __( 'Connection Test', 'woo-stripe-payment' ),
64
- 'class' => 'wc-stripe-connection-test button-secondary',
65
- 'description' => __( 'Click this button to perform a connection test. If successful, your site is connected to Stripe.', 'woo-stripe-payment' ),
66
- ),
67
- 'webhook_url' => array(
68
- 'type' => 'paragraph',
69
- 'title' => __( 'Webhook url', 'woo-stripe-payment' ),
70
- 'class' => 'wc-stripe-webhook',
71
- 'text' => wc_stripe()->rest_api->webhook->rest_url( 'webhook' ),
72
- 'description' => sprintf( __( '<strong>Important:</strong> the webhook url is called by Stripe when events occur in your account, like a source becomes chargeable. You must add this webhook to your Stripe Dashboard if you are using any of the local gateways. %1$sWebhook guide%2$s', 'woo-stripe-payment' ), '<a target="_blank" href="https://docs.paymentplugins.com/wc-stripe/config/#/webhooks?id=configure-webhooks">', '</a>' ),
73
- ),
74
- 'webhook_secret_live' => array(
75
- 'type' => 'password',
76
- 'title' => __( 'Live Webhook Secret', 'woo-stripe-payment' ),
77
- 'description' => sprintf( __( 'The webhook secret is used to authenticate webhooks sent from Stripe. It ensures no 3rd party can send you events, pretending to be Stripe. %1$sWebhook guide%2$s', 'woo-stripe-payment' ), '<a target="_blank" href="https://docs.paymentplugins.com/wc-stripe/config/#/webhooks?id=configure-webhooks">', '</a>' ),
78
- 'custom_attributes' => array( 'data-show-if' => array( 'mode' => 'live' ) ),
79
- ),
80
- 'webhook_secret_test' => array(
81
- 'type' => 'password',
82
- 'title' => __( 'Test Webhook Secret', 'woo-stripe-payment' ),
83
- 'description' => sprintf( __( 'The webhook secret is used to authenticate webhooks sent from Stripe. It ensures no 3rd party can send you events, pretending to be Stripe. %1$sWebhook guide%2$s', 'woo-stripe-payment' ), '<a target="_blank" href="https://docs.paymentplugins.com/wc-stripe/config/#/webhooks?id=configure-webhooks">', '</a>' ),
84
- 'custom_attributes' => array( 'data-show-if' => array( 'mode' => 'test' ) ),
85
- ),
86
- 'debug_log' => array(
87
- 'title' => __( 'Debug Log', 'woo-stripe-payment' ),
88
- 'type' => 'checkbox',
89
- 'desc_tip' => true,
90
- 'default' => 'yes',
91
- 'description' => __( 'When enabled, the plugin logs important errors and info that can help you troubleshoot potential issues.', 'woo-stripe-payment' ),
92
- ),
93
- );
94
- if ( $this->get_option( 'account_id' ) ) {
95
- $this->form_fields['account_id']['text'] = $this->get_option( 'account_id' );
96
- $this->form_fields['stripe_connect']['description'] = sprintf( __( '%s Your Stripe account has been connected. You can now accept Live and Test payments. You can Re-Connect if you want to recycle your API keys for security.', 'woo-stripe-payment' ), '<span class="dashicons dashicons-yes stipe-connect-active"></span>' );
97
- $this->form_fields['stripe_connect']['active'] = true;
98
- } else {
99
- unset( $this->form_fields['account_id'], $this->form_fields['connection_test'], $this->form_fields['mode'], $this->form_fields['webhook_url'] );
100
- }
101
- }
102
-
103
- public function generate_stripe_connect_html( $key, $data ) {
104
- $field_key = $this->get_field_key( $key );
105
- $data = wp_parse_args(
106
- $data,
107
- array(
108
- 'class' => '',
109
- 'style' => '',
110
- 'description' => '',
111
- 'desc_tip' => false,
112
- 'css' => '',
113
- 'active' => false,
114
- )
115
- );
116
- $data['connect_url'] = $this->get_connect_url();
117
- if ( $data['active'] ) {
118
- $data['label'] = __( 'Click To Re-Connect', 'woo-stripe-payment' );
119
- }
120
- ob_start();
121
- include wc_stripe()->plugin_path() . 'includes/admin/views/html-stripe-connect.php';
122
-
123
- return ob_get_clean();
124
- }
125
-
126
- public function admin_options() {
127
- // Check if user is being returned from Stripe Connect
128
- if ( isset( $_GET['_stripe_connect_nonce'] ) && wp_verify_nonce( $_GET['_stripe_connect_nonce'], 'stripe-connect' ) ) {
129
- if ( isset( $_GET['error'] ) ) {
130
- $error = json_decode( base64_decode( wc_clean( $_GET['error'] ) ) );
131
- if ( property_exists( $error, 'message' ) ) {
132
- $message = $error->message;
133
- } elseif ( property_exists( $error, 'raw' ) ) {
134
- $message = $error->raw->message;
135
- } else {
136
- $message = __( 'Please try again.', 'woo-stripe-payment' );
137
- }
138
- wc_stripe_log_error( sprintf( 'Error connecting to Stripe account. Reason: %s', $message ) );
139
- $this->add_error( sprintf( __( 'We were not able to connect your Stripe account. Reason: %s', 'woo-stripe-payment' ), $message ) );
140
- } elseif ( isset( $_GET['response'] ) ) {
141
- $response = json_decode( base64_decode( $_GET['response'] ) );
142
-
143
- // save the token to the api settings
144
- $this->settings['account_id'] = $response->live->stripe_user_id;
145
- $this->settings['refresh_token'] = $response->live->refresh_token;
146
-
147
- $this->settings['secret_key_live'] = $response->live->access_token;
148
- $this->settings['publishable_key_live'] = $response->live->stripe_publishable_key;
149
-
150
- $this->settings['secret_key_test'] = $response->test->access_token;
151
- $this->settings['publishable_key_test'] = $response->test->stripe_publishable_key;
152
-
153
- update_option( $this->get_option_key(), $this->settings );
154
-
155
- delete_option( 'wc_stripe_connect_notice' );
156
-
157
- /**
158
- * @param array $response
159
- * @param WC_Stripe_API_Settings $this
160
- *
161
- * @since 3.1.6
162
- */
163
- do_action( 'wc_stripe_connect_settings', $response, $this );
164
-
165
- $this->init_form_fields();
166
-
167
- echo '<div class="updated inline notice-success is-dismissible "><p>' .
168
- __( 'Your Stripe account has been connected to your WooCommerce store. You may now accept payments in Live and Test mode.', 'woo-stripe-payment' ) .
169
- '</p></div>';
170
- }
171
- }
172
- parent::admin_options();
173
- }
174
-
175
- public function get_connect_url() {
176
- return \Stripe\OAuth::authorizeUrl( array(
177
- 'response_type' => 'code',
178
- 'client_id' => wc_stripe()->client_id,
179
- 'stripe_landing' => 'login',
180
- 'always_prompt' => 'true',
181
- 'scope' => 'read_write',
182
- 'state' => base64_encode(
183
- wp_json_encode(
184
- array(
185
- 'redirect' => add_query_arg( '_stripe_connect_nonce', wp_create_nonce( 'stripe-connect' ), admin_url( 'admin.php?page=wc-settings&tab=checkout&section=stripe_api' ) )
186
- )
187
- )
188
- )
189
- ) );
190
- }
191
- }
1
+ <?php
2
+ defined( 'ABSPATH' ) || exit();
3
+
4
+ /**
5
+ *
6
+ * @author Payment Plugins
7
+ * @since 3.0.0
8
+ * @package Stripe/Classes
9
+ *
10
+ */
11
+ class WC_Stripe_API_Settings extends WC_Stripe_Settings_API {
12
+
13
+ public function __construct() {
14
+ $this->id = 'stripe_api';
15
+ $this->tab_title = __( 'API Settings', 'woo-stripe-payment' );
16
+ parent::__construct();
17
+ }
18
+
19
+ public function hooks() {
20
+ parent::hooks();
21
+ add_action( 'woocommerce_update_options_checkout_' . $this->id, array( $this, 'process_admin_options' ) );
22
+ add_filter( 'wc_stripe_settings_nav_tabs', array( $this, 'admin_nav_tab' ) );
23
+ add_action( 'woocommerce_stripe_settings_checkout_' . $this->id, array( $this, 'admin_options' ) );
24
+ }
25
+
26
+ public function init_form_fields() {
27
+ $this->form_fields = array(
28
+ 'title' => array(
29
+ 'type' => 'title',
30
+ 'title' => __( 'API Settings', 'woo-stripe-payment' ),
31
+ ),
32
+ 'mode' => array(
33
+ 'type' => 'select',
34
+ 'title' => __( 'Mode', 'woo-stripe-payment' ),
35
+ 'class' => 'wc-enhanced-select',
36
+ 'options' => array(
37
+ 'test' => __( 'Test', 'woo-stripe-payment' ),
38
+ 'live' => __( 'Live', 'woo-stripe-payment' ),
39
+ ),
40
+ 'default' => 'test',
41
+ 'desc_tip' => true,
42
+ 'description' => __( 'The mode determines if you are processing test transactions or live transactions on your site. Test mode allows you to simulate payments so you can test your integration.', 'woo-stripe-payment' ),
43
+ ),
44
+ 'account_id' => array(
45
+ 'type' => 'paragraph',
46
+ 'title' => __( 'Account ID', 'woo-stripe-payment' ),
47
+ 'text' => '',
48
+ 'class' => '',
49
+ 'default' => '',
50
+ 'desc_tip' => true,
51
+ 'description' => __( 'This is your Stripe Connect ID and serves as a unique identifier.', 'woo-stripe-payment' ),
52
+ ),
53
+ 'stripe_connect' => array(
54
+ 'type' => 'stripe_connect',
55
+ 'title' => __( 'Connect Stripe Account', 'woo-stripe-payment' ),
56
+ 'label' => __( 'Click to Connect', 'woo-stripe-payment' ),
57
+ 'class' => 'do-stripe-connect',
58
+ 'description' => __( 'We make it easy to connect Stripe to your site. Click the Connect button to go through our connect flow.', 'woo-stripe-payment' ),
59
+ ),
60
+ 'connection_test' => array(
61
+ 'type' => 'stripe_button',
62
+ 'title' => __( 'Connection Test', 'woo-stripe-payment' ),
63
+ 'label' => __( 'Connection Test', 'woo-stripe-payment' ),
64
+ 'class' => 'wc-stripe-connection-test button-secondary',
65
+ 'description' => __( 'Click this button to perform a connection test. If successful, your site is connected to Stripe.', 'woo-stripe-payment' ),
66
+ ),
67
+ 'webhook_url' => array(
68
+ 'type' => 'paragraph',
69
+ 'title' => __( 'Webhook url', 'woo-stripe-payment' ),
70
+ 'class' => 'wc-stripe-webhook',
71
+ 'text' => stripe_wc()->rest_api->webhook->rest_url( 'webhook' ),
72
+ 'description' => sprintf( __( '<strong>Important:</strong> the webhook url is called by Stripe when events occur in your account, like a source becomes chargeable. You must add this webhook to your Stripe Dashboard if you are using any of the local gateways. %1$sWebhook guide%2$s', 'woo-stripe-payment' ), '<a target="_blank" href="https://docs.paymentplugins.com/wc-stripe/config/#/webhooks?id=configure-webhooks">', '</a>' ),
73
+ ),
74
+ 'webhook_secret_live' => array(
75
+ 'type' => 'password',
76
+ 'title' => __( 'Live Webhook Secret', 'woo-stripe-payment' ),
77
+ 'description' => sprintf( __( 'The webhook secret is used to authenticate webhooks sent from Stripe. It ensures no 3rd party can send you events, pretending to be Stripe. %1$sWebhook guide%2$s', 'woo-stripe-payment' ), '<a target="_blank" href="https://docs.paymentplugins.com/wc-stripe/config/#/webhooks?id=configure-webhooks">', '</a>' ),
78
+ 'custom_attributes' => array( 'data-show-if' => array( 'mode' => 'live' ) ),
79
+ ),
80
+ 'webhook_secret_test' => array(
81
+ 'type' => 'password',
82
+ 'title' => __( 'Test Webhook Secret', 'woo-stripe-payment' ),
83
+ 'description' => sprintf( __( 'The webhook secret is used to authenticate webhooks sent from Stripe. It ensures no 3rd party can send you events, pretending to be Stripe. %1$sWebhook guide%2$s', 'woo-stripe-payment' ), '<a target="_blank" href="https://docs.paymentplugins.com/wc-stripe/config/#/webhooks?id=configure-webhooks">', '</a>' ),
84
+ 'custom_attributes' => array( 'data-show-if' => array( 'mode' => 'test' ) ),
85
+ ),
86
+ 'debug_log' => array(
87
+ 'title' => __( 'Debug Log', 'woo-stripe-payment' ),
88
+ 'type' => 'checkbox',
89
+ 'desc_tip' => true,
90
+ 'default' => 'yes',
91
+ 'description' => __( 'When enabled, the plugin logs important errors and info that can help you troubleshoot potential issues.', 'woo-stripe-payment' ),
92
+ ),
93
+ );
94
+ if ( $this->get_option( 'account_id' ) ) {
95
+ $this->form_fields['account_id']['text'] = $this->get_option( 'account_id' );
96
+ $this->form_fields['stripe_connect']['description'] = sprintf( __( '%s Your Stripe account has been connected. You can now accept Live and Test payments. You can Re-Connect if you want to recycle your API keys for security.', 'woo-stripe-payment' ), '<span class="dashicons dashicons-yes stipe-connect-active"></span>' );
97
+ $this->form_fields['stripe_connect']['active'] = true;
98
+ } else {
99
+ unset( $this->form_fields['account_id'], $this->form_fields['connection_test'], $this->form_fields['mode'], $this->form_fields['webhook_url'] );
100
+ }
101
+ }
102
+
103
+ public function generate_stripe_connect_html( $key, $data ) {
104
+ $field_key = $this->get_field_key( $key );
105
+ $data = wp_parse_args(
106
+ $data,
107
+ array(
108
+ 'class' => '',
109
+ 'style' => '',
110
+ 'description' => '',
111
+ 'desc_tip' => false,
112
+ 'css' => '',
113
+ 'active' => false,
114
+ )
115
+ );
116
+ $data['connect_url'] = $this->get_connect_url();
117
+ if ( $data['active'] ) {
118
+ $data['label'] = __( 'Click To Re-Connect', 'woo-stripe-payment' );
119
+ }
120
+ ob_start();
121
+ include stripe_wc()->plugin_path() . 'includes/admin/views/html-stripe-connect.php';
122
+
123
+ return ob_get_clean();
124
+ }
125
+
126
+ public function admin_options() {
127
+ // Check if user is being returned from Stripe Connect
128
+ if ( isset( $_GET['_stripe_connect_nonce'] ) && wp_verify_nonce( $_GET['_stripe_connect_nonce'], 'stripe-connect' ) ) {
129
+ if ( isset( $_GET['error'] ) ) {
130
+ $error = json_decode( base64_decode( wc_clean( $_GET['error'] ) ) );
131
+ if ( property_exists( $error, 'message' ) ) {
132
+ $message = $error->message;
133
+ } elseif ( property_exists( $error, 'raw' ) ) {
134
+ $message = $error->raw->message;
135
+ } else {
136
+ $message = __( 'Please try again.', 'woo-stripe-payment' );
137
+ }
138
+ wc_stripe_log_error( sprintf( 'Error connecting to Stripe account. Reason: %s', $message ) );
139
+ $this->add_error( sprintf( __( 'We were not able to connect your Stripe account. Reason: %s', 'woo-stripe-payment' ), $message ) );
140
+ } elseif ( isset( $_GET['response'] ) ) {
141
+ $response = json_decode( base64_decode( $_GET['response'] ) );
142
+
143
+ // save the token to the api settings
144
+ $this->settings['account_id'] = $response->live->stripe_user_id;
145
+ $this->settings['refresh_token'] = $response->live->refresh_token;
146
+
147
+ $this->settings['secret_key_live'] = $response->live->access_token;
148
+ $this->settings['publishable_key_live'] = $response->live->stripe_publishable_key;
149
+
150
+ $this->settings['secret_key_test'] = $response->test->access_token;
151
+ $this->settings['publishable_key_test'] = $response->test->stripe_publishable_key;
152
+
153
+ update_option( $this->get_option_key(), $this->settings );
154
+
155
+ delete_option( 'wc_stripe_connect_notice' );
156
+
157
+ /**
158
+ * @param array $response
159
+ * @param WC_Stripe_API_Settings $this
160
+ *
161
+ * @since 3.1.6
162
+ */
163
+ do_action( 'wc_stripe_connect_settings', $response, $this );
164
+
165
+ $this->init_form_fields();
166
+
167
+ echo '<div class="updated inline notice-success is-dismissible "><p>' .
168
+ __( 'Your Stripe account has been connected to your WooCommerce store. You may now accept payments in Live and Test mode.', 'woo-stripe-payment' ) .
169
+ '</p></div>';
170
+ }
171
+ }
172
+ parent::admin_options();
173
+ }
174
+
175
+ public function get_connect_url() {
176
+ return \Stripe\OAuth::authorizeUrl( array(
177
+ 'response_type' => 'code',
178
+ 'client_id' => stripe_wc()->client_id,
179
+ 'stripe_landing' => 'login',
180
+ 'always_prompt' => 'true',
181
+ 'scope' => 'read_write',
182
+ 'state' => base64_encode(
183
+ wp_json_encode(
184
+ array(
185
+ 'redirect' => add_query_arg( '_stripe_connect_nonce', wp_create_nonce( 'stripe-connect' ), admin_url( 'admin.php?page=wc-settings&tab=checkout&section=stripe_api' ) )
186
+ )
187
+ )
188
+ )
189
+ ) );
190
+ }
191
+ }
includes/admin/views/html-settings-nav.php CHANGED
@@ -7,7 +7,7 @@ $tab_active = false;
7
  ?>
8
  <div class="wc-stripe-settings-logo">
9
  <img
10
- src="<?php echo wc_stripe()->assets_url() . 'img/stripe_logo.svg'; ?>"/>
11
  </div>
12
  <div class="stripe-settings-nav">
13
  <?php foreach ( $tabs as $id => $tab ) : $idx ++ ?>
7
  ?>
8
  <div class="wc-stripe-settings-logo">
9
  <img
10
+ src="<?php echo stripe_wc()->assets_url() . 'img/stripe_logo.svg'; ?>"/>
11
  </div>
12
  <div class="stripe-settings-nav">
13
  <?php foreach ( $tabs as $id => $tab ) : $idx ++ ?>
includes/class-stripe.php CHANGED
@@ -25,7 +25,7 @@ class WC_Stripe_Manager {
25
  *
26
  * @var string
27
  */
28
- public $version = '3.2.7';
29
 
30
  /**
31
  *
@@ -112,6 +112,31 @@ class WC_Stripe_Manager {
112
 
113
  public function plugins_loaded() {
114
  load_plugin_textdomain( 'woo-stripe-payment', false, dirname( WC_STRIPE_PLUGIN_NAME ) . '/i18n/languages' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  }
116
 
117
  /**
@@ -331,14 +356,17 @@ class WC_Stripe_Manager {
331
  }
332
 
333
  /**
334
- * Returns the global instance of the WC_Stripe_Manager.
 
335
  *
336
  * @return WC_Stripe_Manager
337
  * @package Stripe/Functions
 
338
  */
339
- function wc_stripe() {
340
  return WC_Stripe_Manager::instance();
341
  }
342
 
 
343
  // load singleton
344
- wc_stripe();
25
  *
26
  * @var string
27
  */
28
+ public $version = '3.2.8';
29
 
30
  /**
31
  *
112
 
113
  public function plugins_loaded() {
114
  load_plugin_textdomain( 'woo-stripe-payment', false, dirname( WC_STRIPE_PLUGIN_NAME ) . '/i18n/languages' );
115
+
116
+ /**
117
+ * Version 4.5.4 of the WooCommerce Stripe Gateway plugin also includes a function named wc_stripe so don't include if that plugin
118
+ * is installed to prevent conflicts.
119
+ */
120
+ if ( ! function_exists( 'wc_stripe' ) ) {
121
+ if ( ( defined( 'WC_STRIPE_VERSION' ) && version_compare( WC_STRIPE_VERSION, '4.5.4', '<' ) ) || ! in_array( 'woocommerce-gateway-stripe/woocommerce-gateway-stripe.php', (array) get_option( 'active_plugins', array() ), true ) && ! ( is_admin() && ! isset( $_GET['activate'], $_GET['plugin'] ) ) ) {
122
+
123
+ /**
124
+ * Returns the global instance of the WC_Stripe_Manager.
125
+ *
126
+ * @return WC_Stripe_Manager
127
+ * @package Stripe/Functions
128
+ * @deprecated 3.2.8
129
+ */
130
+ function wc_stripe() {
131
+ if ( function_exists( 'wc_deprecated_function' ) ) {
132
+ wc_deprecated_function( 'wc_stripe', '3.2.8', 'stripe_wc' );
133
+ }
134
+
135
+ return stripe_wc();
136
+ }
137
+ }
138
+ }
139
+
140
  }
141
 
142
  /**
356
  }
357
 
358
  /**
359
+ * Returns the global instance of the WC_Stripe_Manager. This function replaces
360
+ * the wc_stripe function as of version 3.2.8
361
  *
362
  * @return WC_Stripe_Manager
363
  * @package Stripe/Functions
364
+ * @since 3.2.8
365
  */
366
+ function stripe_wc() {
367
  return WC_Stripe_Manager::instance();
368
  }
369
 
370
+
371
  // load singleton
372
+ stripe_wc();
includes/class-wc-stripe-frontend-notices.php CHANGED
@@ -1,58 +1,58 @@
1
- <?php
2
- defined( 'ABSPATH' ) || exit();
3
-
4
- /**
5
- * Class that manages frontend notices for customers.
6
- *
7
- * @author PaymentPlugins
8
- * @package Stripe/Classes
9
- * @since 3.0.0
10
- *
11
- */
12
- class WC_Stripe_Frontend_Notices {
13
-
14
- public static function init() {
15
- add_action( 'wp_enqueue_scripts', array( __CLASS__, 'enqueue_scripts' ) );
16
- }
17
-
18
- public static function enqueue_scripts() {
19
- if ( isset( $wp->query_vars['order-received'] ) ) {
20
- $scripts = wc_stripe()->scripts();
21
- $order_id = absint( $wp->query_vars['order-received'] );
22
- $order = wc_get_order( $order_id );
23
- $notices = array();
24
- if ( ( $message = $order->get_meta( '_wc_stripe_order_error', true ) ) ) {
25
- $notices[] = wc_get_template_html( 'notices/notice.php', array( 'messages' => array( $message ) ) );
26
- }
27
- if ( $order->has_status( 'on-hold' ) ) {
28
- $payment_method = $order->get_payment_method();
29
- $gateway = WC()->payment_gateways()->payment_gateways()[ $payment_method ];
30
- if ( $gateway instanceof WC_Payment_Gateway_Stripe_Local_Payment ) {
31
- $notices[] = wc_get_template_html(
32
- 'notices/notice.php',
33
- array(
34
- 'messages' => array(
35
- __( 'Your payment is being processed and your order status will be updated once the funds are received.', 'woo-stripe-payment' ),
36
- ),
37
- )
38
- );
39
- }
40
- if ( $notices ) {
41
- self::enqueue_notices( $notices );
42
- }
43
- }
44
- }
45
- }
46
-
47
- public static function enqueue_notices( $notices ) {
48
- $scripts->enqueue_script( 'notices', $scripts->assets_url( 'js/frontend/notices.js' ), array( 'jquery' ), wc_stripe()->version(), true );
49
- $scripts->localize_script(
50
- 'notices',
51
- array(
52
- 'container' => '.woocommerce-order',
53
- 'notices' => $notices,
54
- )
55
- );
56
- }
57
- }
58
- WC_Stripe_Frontend_Notices::init();
1
+ <?php
2
+ defined( 'ABSPATH' ) || exit();
3
+
4
+ /**
5
+ * Class that manages frontend notices for customers.
6
+ *
7
+ * @author PaymentPlugins
8
+ * @package Stripe/Classes
9
+ * @since 3.0.0
10
+ *
11
+ */
12
+ class WC_Stripe_Frontend_Notices {
13
+
14
+ public static function init() {
15
+ add_action( 'wp_enqueue_scripts', array( __CLASS__, 'enqueue_scripts' ) );
16
+ }
17
+
18
+ public static function enqueue_scripts() {
19
+ if ( isset( $wp->query_vars['order-received'] ) ) {
20
+ $scripts = stripe_wc()->scripts();
21
+ $order_id = absint( $wp->query_vars['order-received'] );
22
+ $order = wc_get_order( $order_id );
23
+ $notices = array();
24
+ if ( ( $message = $order->get_meta( '_wc_stripe_order_error', true ) ) ) {
25
+ $notices[] = wc_get_template_html( 'notices/notice.php', array( 'messages' => array( $message ) ) );
26
+ }
27
+ if ( $order->has_status( 'on-hold' ) ) {
28
+ $payment_method = $order->get_payment_method();
29
+ $gateway = WC()->payment_gateways()->payment_gateways()[ $payment_method ];
30
+ if ( $gateway instanceof WC_Payment_Gateway_Stripe_Local_Payment ) {
31
+ $notices[] = wc_get_template_html(
32
+ 'notices/notice.php',
33
+ array(
34
+ 'messages' => array(
35
+ __( 'Your payment is being processed and your order status will be updated once the funds are received.', 'woo-stripe-payment' ),
36
+ ),
37
+ )
38
+ );
39
+ }
40
+ if ( $notices ) {
41
+ self::enqueue_notices( $notices );
42
+ }
43
+ }
44
+ }
45
+ }
46
+
47
+ public static function enqueue_notices( $notices ) {
48
+ $scripts->enqueue_script( 'notices', $scripts->assets_url( 'js/frontend/notices.js' ), array( 'jquery' ), stripe_wc()->version(), true );
49
+ $scripts->localize_script(
50
+ 'notices',
51
+ array(
52
+ 'container' => '.woocommerce-order',
53
+ 'notices' => $notices,
54
+ )
55
+ );
56
+ }
57
+ }
58
+ WC_Stripe_Frontend_Notices::init();
includes/class-wc-stripe-frontend-scripts.php CHANGED
@@ -68,7 +68,7 @@ class WC_Stripe_Frontend_Scripts {
68
  'api_key' => wc_stripe_get_publishable_key(),
69
  'account' => wc_stripe_get_account_id(),
70
  'page' => $this->get_page_id(),
71
- 'version' => wc_stripe()->version()
72
  ),
73
  'wc_stripe_params_v3'
74
  );
@@ -100,7 +100,7 @@ class WC_Stripe_Frontend_Scripts {
100
  if ( ! empty( $data['gateways'] ) ) {
101
  $this->enqueue_script(
102
  'local-payment',
103
- $this->assets_url( 'js/frontend/local-payment.js' ),
104
  array(
105
  $this->get_handle( 'external' ),
106
  $this->get_handle( 'wc-stripe' ),
@@ -112,14 +112,14 @@ class WC_Stripe_Frontend_Scripts {
112
  }
113
 
114
  public function register_script( $handle, $src, $deps = array(), $version = '', $footer = true ) {
115
- $version = empty( $version ) ? wc_stripe()->version() : $version;
116
  $this->registered_scripts[] = $this->get_handle( $handle );
117
  wp_register_script( $this->get_handle( $handle ), $src, $deps, $version, $footer );
118
  }
119
 
120
  public function enqueue_script( $handle, $src = '', $deps = array(), $version = '', $footer = true ) {
121
  $handle = $this->get_handle( $handle );
122
- $version = empty( $version ) ? wc_stripe()->version() : $version;
123
  if ( ! in_array( $handle, $this->registered_scripts ) ) {
124
  $this->register_script( $handle, $src, $deps, $version, $footer );
125
  }
@@ -160,7 +160,7 @@ class WC_Stripe_Frontend_Scripts {
160
  * @param string $uri
161
  */
162
  public function assets_url( $uri = '' ) {
163
- return untrailingslashit( wc_stripe()->assets_url( $uri ) );
164
  }
165
 
166
  public function get_min() {
68
  'api_key' => wc_stripe_get_publishable_key(),
69
  'account' => wc_stripe_get_account_id(),
70
  'page' => $this->get_page_id(),
71
+ 'version' => stripe_wc()->version()
72
  ),
73
  'wc_stripe_params_v3'
74
  );
100
  if ( ! empty( $data['gateways'] ) ) {
101
  $this->enqueue_script(
102
  'local-payment',
103
+ $this->assets_url( 'js/frontend/local-payment' . $this->get_min() . '.js' ),
104
  array(
105
  $this->get_handle( 'external' ),
106
  $this->get_handle( 'wc-stripe' ),
112
  }
113
 
114
  public function register_script( $handle, $src, $deps = array(), $version = '', $footer = true ) {
115
+ $version = empty( $version ) ? stripe_wc()->version() : $version;
116
  $this->registered_scripts[] = $this->get_handle( $handle );
117
  wp_register_script( $this->get_handle( $handle ), $src, $deps, $version, $footer );
118
  }
119
 
120
  public function enqueue_script( $handle, $src = '', $deps = array(), $version = '', $footer = true ) {
121
  $handle = $this->get_handle( $handle );
122
+ $version = empty( $version ) ? stripe_wc()->version() : $version;
123
  if ( ! in_array( $handle, $this->registered_scripts ) ) {
124
  $this->register_script( $handle, $src, $deps, $version, $footer );
125
  }
160
  * @param string $uri
161
  */
162
  public function assets_url( $uri = '' ) {
163
+ return untrailingslashit( stripe_wc()->assets_url( $uri ) );
164
  }
165
 
166
  public function get_min() {
includes/class-wc-stripe-gateway.php CHANGED
@@ -1,444 +1,444 @@
1
- <?php
2
- defined( 'ABSPATH' ) || exit();
3
-
4
- require_once( WC_STRIPE_PLUGIN_FILE_PATH . 'includes/class-wc-stripe-api-operation.php' );
5
-
6
- /**
7
- * Gateway class that abstracts all API calls to Stripe.
8
- *
9
- * @author Payment Plugins
10
- * @package Stripe/Classes
11
- *
12
- * @property \Stripe\Service\AccountLinkService $accountLinks
13
- * @property \Stripe\Service\AccountService $accounts
14
- * @property \Stripe\Service\ApplePayDomainService $applePayDomains
15
- * @property \Stripe\Service\ApplicationFeeService $applicationFees
16
- * @property \Stripe\Service\BalanceService $balance
17
- * @property \Stripe\Service\BalanceTransactionService $balanceTransactions
18
- * @property \Stripe\Service\BillingPortal\BillingPortalServiceFactory $billingPortal
19
- * @property \Stripe\Service\ChargeService $charges
20
- * @property \Stripe\Service\Checkout\CheckoutServiceFactory $checkout
21
- * @property \Stripe\Service\CountrySpecService $countrySpecs
22
- * @property \Stripe\Service\CouponService $coupons
23
- * @property \Stripe\Service\CreditNoteService $creditNotes
24
- * @property \Stripe\Service\CustomerService $customers
25
- * @property \Stripe\Service\DisputeService $disputes
26
- * @property \Stripe\Service\EphemeralKeyService $ephemeralKeys
27
- * @property \Stripe\Service\EventService $events
28
- * @property \Stripe\Service\ExchangeRateService $exchangeRates
29
- * @property \Stripe\Service\FileLinkService $fileLinks
30
- * @property \Stripe\Service\FileService $files
31
- * @property \Stripe\Service\InvoiceItemService $invoiceItems
32
- * @property \Stripe\Service\InvoiceService $invoices
33
- * @property \Stripe\Service\Issuing\IssuingServiceFactory $issuing
34
- * @property \Stripe\Service\MandateService $mandates
35
- * @property \Stripe\Service\OrderReturnService $orderReturns
36
- * @property \Stripe\Service\OrderService $orders
37
- * @property \Stripe\Service\PaymentIntentService $paymentIntents
38
- * @property \Stripe\Service\PaymentMethodService $paymentMethods
39
- * @property \Stripe\Service\PayoutService $payouts
40
- * @property \Stripe\Service\PlanService $plans
41
- * @property \Stripe\Service\PriceService $prices
42
- * @property \Stripe\Service\ProductService $products
43
- * @property \Stripe\Service\Radar\RadarServiceFactory $radar
44
- * @property \Stripe\Service\RefundService $refunds
45
- * @property \Stripe\Service\Reporting\ReportingServiceFactory $reporting
46
- * @property \Stripe\Service\ReviewService $reviews
47
- * @property \Stripe\Service\SetupIntentService $setupIntents
48
- * @property \Stripe\Service\Sigma\SigmaServiceFactory $sigma
49
- * @property \Stripe\Service\SkuService $skus
50
- * @property \Stripe\Service\SourceService $sources
51
- * @property \Stripe\Service\SubscriptionItemService $subscriptionItems
52
- * @property \Stripe\Service\SubscriptionScheduleService $subscriptionSchedules
53
- * @property \Stripe\Service\SubscriptionService $subscriptions
54
- * @property \Stripe\Service\TaxRateService $taxRates
55
- * @property \Stripe\Service\Terminal\TerminalServiceFactory $terminal
56
- * @property \Stripe\Service\TokenService $tokens
57
- * @property \Stripe\Service\TopupService $topups
58
- * @property \Stripe\Service\TransferService $transfers
59
- * @property \Stripe\Service\WebhookEndpointService $webhookEndpoints
60
- */
61
- class WC_Stripe_Gateway {
62
-
63
- /**
64
- *
65
- * @since 3.0.5
66
- * @var Stripe mode (test, live)
67
- */
68
- private $mode = null;
69
-
70
- private $messages = array();
71
-
72
- /**
73
- *
74
- * @since 3.0.8
75
- * @var string
76
- */
77
- private $secret_key = null;
78
-
79
- /**
80
- *
81
- * @var \Stripe\StripeClient
82
- */
83
- private $client = null;
84
-
85
- public function __construct( $mode = null, $secret_key = null ) {
86
- if ( null != $mode ) {
87
- $this->mode = $mode;
88
- }
89
- if ( null != $secret_key ) {
90
- $this->secret_key = $secret_key;
91
- }
92
- $this->client = new \Stripe\StripeClient( array( 'stripe_version' => '2020-03-02' ) );
93
- }
94
-
95
- public static function init() {
96
- \Stripe\Stripe::setAppInfo( 'WordPress woo-stripe-payment', wc_stripe()->version(), 'https://wordpress.org/plugins/woo-stripe-payment/', 'pp_partner_FdPtriN2Q7JLOe' );
97
- }
98
-
99
- public function __get( $key ) {
100
- return new WC_Stripe_API_Operation( $this, $this->client, $key );
101
- }
102
-
103
- /**
104
- *
105
- * @param string $mode
106
- * @param string $secret_key
107
- *
108
- * @return WC_Stripe_Gateway
109
- * @since 3.1.0
110
- */
111
- public static function load( $mode = null, $secret_key = null ) {
112
- $class = apply_filters( 'wc_stripe_gateway_class', 'WC_Stripe_Gateway' );
113
-
114
- return new $class( $mode, $secret_key );
115
- }
116
-
117
- /**
118
- *
119
- * @param string $mode
120
- *
121
- * @since 3.1.0
122
- */
123
- public function set_mode( $mode ) {
124
- $this->mode = $mode;
125
- }
126
-
127
- /**
128
- * Create a customer within Stripe.
129
- *
130
- * @param array $args
131
- *
132
- * @return WP_Error|string
133
- */
134
- public function create_customer( $args, $mode = '' ) {
135
- return $this->customers->create( apply_filters( 'wc_stripe_create_customer_args', $args ), $this->get_api_options( $mode ) );
136
-
137
- }
138
-
139
- public function update_customer( $id, $args, $mode = '' ) {
140
- return $this->customers->update( $id, $args, $this->get_api_options( $mode ) );
141
- }
142
-
143
- public function charge( $args, $mode = '' ) {
144
- return $this->charges->create( $args, $this->get_api_options( $mode ) );
145
- }
146
-
147
- /**
148
- *
149
- * @param array $args
150
- * @param string $mode
151
- *
152
- * @return WP_Error|\Stripe\PaymentIntent
153
- */
154
- public function create_payment_intent( $args, $mode = '' ) {
155
- return $this->paymentIntents->create( $args, $this->get_api_options( $mode ) );
156
- }
157
-
158
- public function create_setup_intent( $args, $mode = '' ) {
159
- return $this->setupIntents->create( $args, $this->get_api_options( $mode ) );
160
- }
161
-
162
- /**
163
- *
164
- * @param \Stripe\PaymentIntent $intent
165
- * @param array $args
166
- * @param string $mode
167
- */
168
- public function update_payment_intent( $id, $args, $mode = '' ) {
169
- return $this->paymentIntents->update( $id, $args, $this->get_api_options( $mode ) );
170
- }
171
-
172
- /**
173
- *
174
- * @param \Stripe\PaymentIntent $intent
175
- * @param array $args
176
- * @param string $mode
177
- */
178
- public function confirm_payment_intent( $id, $args = array(), $mode = '' ) {
179
- return $this->paymentIntents->confirm( $id, $args, $this->get_api_options( $mode ) );
180
- }
181
-
182
- /**
183
- *
184
- * @param string $id
185
- * @param string $mode
186
- *
187
- * @return WP_Error|\Stripe\PaymentIntent
188
- */
189
- public function fetch_payment_intent( $id, $mode = '' ) {
190
- return $this->paymentIntents->retrieve( $id, array(), $this->get_api_options( $mode ) );
191
- }
192
-
193
- public function capture_payment_intent( $id, $args = array(), $mode = '' ) {
194
- return $this->paymentIntents->capture( $id, $args, $this->get_api_options( $mode ) );
195
- }
196
-
197
- /**
198
- *
199
- * @param \Stripe\PaymentIntent|string $id
200
- * @param string $mode
201
- */
202
- public function cancel_payment_intent( $id, $mode = '' ) {
203
- return $this->paymentIntents->cancel( $id, array(), $this->get_api_options( $mode ) );
204
- }
205
-
206
- /**
207
- *
208
- * @param string $id
209
- * @param string $mode
210
- *
211
- * @return WP_Error|\Stripe\SetupIntent
212
- */
213
- public function fetch_setup_intent( $id, $mode = '' ) {
214
- return $this->setupIntents->retrieve( $id, array(), $this->get_api_options( $mode ) );
215
- }
216
-
217
- public function capture( $id, $args, $mode = '' ) {
218
- return $this->charges->capture( $id, $args, $this->get_api_options( $mode ) );
219
- }
220
-
221
- /**
222
- *
223
- * @param string $charge_id
224
- * @param string $mode
225
- *
226
- * @return \Stripe\Charge|WP_Error
227
- */
228
- public function get_charge( $charge_id, $mode = '' ) {
229
- return $this->charges->retrieve( $charge_id, array(), $this->get_api_options( $mode ) );
230
- }
231
-
232
- public function refund( $args, $mode = '' ) {
233
- return $this->refunds->create( $args, $this->get_api_options( $mode ) );
234
- }
235
-
236
- public function get_payment_method( $id, $mode = '' ) {
237
- return \Stripe\PaymentMethod::retrieve( $id, $this->get_api_options( $mode ) );
238
- }
239
-
240
- /**
241
- *
242
- * @param \Stripe\PaymentMethod $payment_method
243
- * @param array $args
244
- * @param string $mode
245
- */
246
- public function attach_payment_method( $id, $args = array(), $mode = '' ) {
247
- return $this->paymentMethods->attach( $id, $args, $this->get_api_options( $mode ) );
248
- }
249
-
250
- public function fetch_payment_method( $id, $mode = '' ) {
251
- return $this->paymentMethods->retrieve( $id, null, $this->get_api_options( $mode ) );
252
- }
253
-
254
- /**
255
- *
256
- * @param \Stripe\PaymentMethod $payment_method
257
- * @param string $mode
258
- */
259
- public function delete_payment_method( $id, $mode = '' ) {
260
- return $this->paymentMethods->detach( $id, array(), $this->get_api_options( $mode ) );
261
- }
262
-
263
- /**
264
- *
265
- * @param string $id
266
- * @param string $customer
267
- * @param string $mode
268
- */
269
- public function delete_card( $id, $customer, $mode = '' ) {
270
- return $this->sources->detach( $customer, $id, null, $this->get_api_options( $mode ) );
271
- }
272
-
273
- /**
274
- *
275
- * @param array $args
276
- * @param string $mode
277
- *
278
- * @return WP_Error|\Stripe\PaymentMethod
279
- */
280
- public function create_payment_method( $args, $mode = '' ) {
281
- return $this->paymentMethods->create( $args, $this->get_api_options( $mode ) );
282
- }
283
-
284
- /**
285
- *
286
- * @param string $id
287
- * @param string $mode
288
- *
289
- * @return WP_Error|\Stripe\Source
290
- *
291
- */
292
- public function fetch_payment_source( $id, $mode = '' ) {
293
- return $this->sources->retrieve( $id, null, $this->get_api_options( $mode ) );
294
- }
295
-
296
- /**
297
- *
298
- * @param string $customer_id
299
- * @param string $id
300
- * @param string $mode
301
- *
302
- * @return WP_Error|\Stripe\Source
303
- */
304
- public function create_customer_source( $customer_id, $id, $mode = '' ) {
305
- return $this->customers->createSource( $customer_id, array( 'source' => $id ), $this->get_api_options( $mode ) );
306
- }
307
-
308
- /**
309
- *
310
- * @param array $args
311
- * @param string $mode
312
- *
313
- * @return WP_Error|\Stripe\Source
314
- */
315
- public function create_source( $args, $mode = '' ) {
316
- return $this->sources->create( $args, $this->get_api_options( $mode ) );
317
- }
318
-
319
- /**
320
- *
321
- * @param string $source_id
322
- * @param array $args
323
- * @param string $mode
324
- *
325
- * @since 3.0.2
326
- */
327
- public function update_source( $source_id, $args, $mode = '' ) {
328
- return $this->sources->update( $source_id, $args, $this->get_api_options( $mode ) );
329
- }
330
-
331
- public function fetch_customer( $customer_id, $mode = '' ) {
332
- return $this->customers->retrieve( $customer_id, null, $this->get_api_options( $mode ) );
333
- }
334
-
335
- public function fetch_customers( $mode = '' ) {
336
- return $this->customers->all( array( 'limit' => 1 ), $this->get_api_options( $mode ) );
337
- }
338
-
339
- public function fetch_payment_methods( $customer_id, $mode = '', $type = 'card' ) {
340
- return $this->paymentMethods->all(
341
- array(
342
- 'customer' => $customer_id,
343
- 'type' => $type,
344
- ),
345
- $this->get_api_options( $mode )
346
- );
347
- }
348
-
349
- public function register_domain( $domain, $mode = '' ) {
350
- return $this->applePayDomains->create( array( 'domain_name' => $domain ), $this->get_api_options( $mode ) );
351
- }
352
-
353
- /**
354
- *
355
- * @param string $mode
356
- *
357
- * @since 3.1.6
358
- */
359
- public function fetch_domains( $mode = '' ) {
360
- return $this->applePayDomains->all( array( 'limit' => 50 ), $this->get_api_options( $mode ) );
361
- }
362
-
363
- /**
364
- *
365
- * @param \Stripe\ApplePayDomain $domain
366
- * @param string $mode
367
- *
368
- * @since 3.1.6
369
- */
370
- public function delete_domain( $id, $mode = '' ) {
371
- return $this->applePayDomains->delete( $id, array(), $this->get_api_options( $mode ) );
372
- }
373
-
374
- public function webhooks( $mode = '' ) {
375
- return $this->webhookEndpoints->all( array( 'limit' => 100 ), $this->get_api_options( $mode ) );
376
- }
377
-
378
- public function create_webhook( $url, $events, $mode = '' ) {
379
- return $this->webhookEndpoints->create(
380
- array(
381
- 'url' => $url,
382
- 'enabled_events' => $events,
383
- ),
384
- $this->get_api_options( $mode )
385
- );
386
- }
387
-
388
- public function update_webhook( $id, $params, $mode = '' ) {
389
- return $this->webhookEndpoints->update( $id, $params, $this->get_api_options( $mode ) );
390
- }
391
-
392
- public function fetch_webhook( $id, $mode = '' ) {
393
- return $this->webhookEndpoints->retrieve( $id, null, $this->get_api_options( $mode ) );
394
- }
395
-
396
- public function get_api_options( $mode = '' ) {
397
- if ( empty( $mode ) && $this->mode != null ) {
398
- $mode = $this->mode;
399
- }
400
- $args = array( 'api_key' => $this->secret_key ? $this->secret_key : wc_stripe_get_secret_key( $mode ) );
401
-
402
- return apply_filters( 'wc_stripe_api_options', $args );
403
- }
404
-
405
- /**
406
- *
407
- * @param mixed $err
408
- */
409
- private function get_error_message( $err ) {
410
- if ( is_a( $err, '\Stripe\Exception\ApiErrorException' ) ) {
411
- $err = $err->getError();
412
- }
413
- if ( is_array( $err ) || $err instanceof \Stripe\ErrorObject ) {
414
- $this->messages = ! $this->messages ? wc_stripe_get_error_messages() : $this->messages;
415
- if ( isset( $err['decline_code'] ) && isset( $this->messages[ $err['decline_code'] ] ) ) {
416
- return $this->messages[ $err['decline_code'] ];
417
- }
418
- if ( isset( $err['code'] ) && isset( $this->messages[ $err['code'] ] ) ) {
419
- return $this->messages[ $err['code'] ];
420
- }
421
- if ( isset( $err['message'] ) ) {
422
- return $err['message'];
423
- }
424
- }
425
- if ( is_string( $err ) ) {
426
- return $err;
427
- }
428
- }
429
-
430
- /**
431
- *
432
- * @param \Stripe\Exception\ApiErrorException $e
433
- *
434
- * @since 3.1.1
435
- * @todo use in future version to replace manual returns of WP_Error in each method
436
- */
437
- public function get_wp_error( $e, $code = 'stripe-error' ) {
438
- $err = $e->getJsonBody()['error'];
439
-
440
- return new WP_Error( $code, $this->get_error_message( $err ), $err );
441
- }
442
- }
443
-
444
- WC_Stripe_Gateway::init();
1
+ <?php
2
+ defined( 'ABSPATH' ) || exit();
3
+
4
+ require_once( WC_STRIPE_PLUGIN_FILE_PATH . 'includes/class-wc-stripe-api-operation.php' );
5
+
6
+ /**
7
+ * Gateway class that abstracts all API calls to Stripe.
8
+ *
9
+ * @author Payment Plugins
10
+ * @package Stripe/Classes
11
+ *
12
+ * @property \Stripe\Service\AccountLinkService $accountLinks
13
+ * @property \Stripe\Service\AccountService $accounts
14
+ * @property \Stripe\Service\ApplePayDomainService $applePayDomains
15
+ * @property \Stripe\Service\ApplicationFeeService $applicationFees
16
+ * @property \Stripe\Service\BalanceService $balance
17
+ * @property \Stripe\Service\BalanceTransactionService $balanceTransactions
18
+ * @property \Stripe\Service\BillingPortal\BillingPortalServiceFactory $billingPortal
19
+ * @property \Stripe\Service\ChargeService $charges
20
+ * @property \Stripe\Service\Checkout\CheckoutServiceFactory $checkout
21
+ * @property \Stripe\Service\CountrySpecService $countrySpecs
22
+ * @property \Stripe\Service\CouponService $coupons
23
+ * @property \Stripe\Service\CreditNoteService $creditNotes
24
+ * @property \Stripe\Service\CustomerService $customers
25
+ * @property \Stripe\Service\DisputeService $disputes
26
+ * @property \Stripe\Service\EphemeralKeyService $ephemeralKeys
27
+ * @property \Stripe\Service\EventService $events
28
+ * @property \Stripe\Service\ExchangeRateService $exchangeRates
29
+ * @property \Stripe\Service\FileLinkService $fileLinks
30
+ * @property \Stripe\Service\FileService $files
31
+ * @property \Stripe\Service\InvoiceItemService $invoiceItems
32
+ * @property \Stripe\Service\InvoiceService $invoices
33
+ * @property \Stripe\Service\Issuing\IssuingServiceFactory $issuing
34
+ * @property \Stripe\Service\MandateService $mandates
35
+ * @property \Stripe\Service\OrderReturnService $orderReturns
36
+ * @property \Stripe\Service\OrderService $orders
37
+ * @property \Stripe\Service\PaymentIntentService $paymentIntents
38
+ * @property \Stripe\Service\PaymentMethodService $paymentMethods
39
+ * @property \Stripe\Service\PayoutService $payouts
40
+ * @property \Stripe\Service\PlanService $plans
41
+ * @property \Stripe\Service\PriceService $prices
42
+ * @property \Stripe\Service\ProductService $products
43
+ * @property \Stripe\Service\Radar\RadarServiceFactory $radar
44
+ * @property \Stripe\Service\RefundService $refunds
45
+ * @property \Stripe\Service\Reporting\ReportingServiceFactory $reporting
46
+ * @property \Stripe\Service\ReviewService $reviews
47
+ * @property \Stripe\Service\SetupIntentService $setupIntents
48
+ * @property \Stripe\Service\Sigma\SigmaServiceFactory $sigma
49
+ * @property \Stripe\Service\SkuService $skus
50
+ * @property \Stripe\Service\SourceService $sources
51
+ * @property \Stripe\Service\SubscriptionItemService $subscriptionItems
52
+ * @property \Stripe\Service\SubscriptionScheduleService $subscriptionSchedules
53
+ * @property \Stripe\Service\SubscriptionService $subscriptions
54
+ * @property \Stripe\Service\TaxRateService $taxRates
55
+ * @property \Stripe\Service\Terminal\TerminalServiceFactory $terminal
56
+ * @property \Stripe\Service\TokenService $tokens
57
+ * @property \Stripe\Service\TopupService $topups
58
+ * @property \Stripe\Service\TransferService $transfers
59
+ * @property \Stripe\Service\WebhookEndpointService $webhookEndpoints
60
+ */
61
+ class WC_Stripe_Gateway {
62
+
63
+ /**
64
+ *
65
+ * @since 3.0.5
66
+ * @var Stripe mode (test, live)
67
+ */
68
+ private $mode = null;
69
+
70
+ private $messages = array();
71
+
72
+ /**
73
+ *
74
+ * @since 3.0.8
75
+ * @var string
76
+ */
77
+ private $secret_key = null;
78
+
79
+ /**
80
+ *
81
+ * @var \Stripe\StripeClient
82
+ */
83
+ private $client = null;
84
+
85
+ public function __construct( $mode = null, $secret_key = null ) {
86
+ if ( null != $mode ) {
87
+ $this->mode = $mode;
88
+ }
89
+ if ( null != $secret_key ) {
90
+ $this->secret_key = $secret_key;
91
+ }
92
+ $this->client = new \Stripe\StripeClient( array( 'stripe_version' => '2020-08-27' ) );
93
+ }
94
+
95
+ public static function init() {
96
+ \Stripe\Stripe::setAppInfo( 'WordPress woo-stripe-payment', stripe_wc()->version(), 'https://wordpress.org/plugins/woo-stripe-payment/', 'pp_partner_FdPtriN2Q7JLOe' );
97
+ }
98
+
99
+ public function __get( $key ) {
100
+ return new WC_Stripe_API_Operation( $this, $this->client, $key );
101
+ }
102
+
103
+ /**
104
+ *
105
+ * @param string $mode
106
+ * @param string $secret_key
107
+ *
108
+ * @return WC_Stripe_Gateway
109
+ * @since 3.1.0
110
+ */
111
+ public static function load( $mode = null, $secret_key = null ) {
112
+ $class = apply_filters( 'wc_stripe_gateway_class', 'WC_Stripe_Gateway' );
113
+
114
+ return new $class( $mode, $secret_key );
115
+ }
116
+
117
+ /**
118
+ *
119
+ * @param string $mode
120
+ *
121
+ * @since 3.1.0
122
+ */
123
+ public function set_mode( $mode ) {
124
+ $this->mode = $mode;
125
+ }
126
+
127
+ /**
128
+ * Create a customer within Stripe.
129
+ *
130
+ * @param array $args
131
+ *
132
+ * @return WP_Error|string
133
+ */
134
+ public function create_customer( $args, $mode = '' ) {
135
+ return $this->customers->create( apply_filters( 'wc_stripe_create_customer_args', $args ), $this->get_api_options( $mode ) );
136
+
137
+ }
138
+
139
+ public function update_customer( $id, $args, $mode = '' ) {
140
+ return $this->customers->update( $id, $args, $this->get_api_options( $mode ) );
141
+ }
142
+
143
+ public function charge( $args, $mode = '' ) {
144
+ return $this->charges->create( $args, $this->get_api_options( $mode ) );
145
+ }
146
+
147
+ /**
148
+ *
149
+ * @param array $args
150
+ * @param string $mode
151
+ *
152
+ * @return WP_Error|\Stripe\PaymentIntent
153
+ */
154
+ public function create_payment_intent( $args, $mode = '' ) {
155
+ return $this->paymentIntents->create( $args, $this->get_api_options( $mode ) );
156
+ }
157
+
158
+ public function create_setup_intent( $args, $mode = '' ) {
159
+ return $this->setupIntents->create( $args, $this->get_api_options( $mode ) );
160
+ }
161
+
162
+ /**
163
+ *
164
+ * @param \Stripe\PaymentIntent $intent
165
+ * @param array $args
166
+ * @param string $mode
167
+ */
168
+ public function update_payment_intent( $id, $args, $mode = '' ) {
169
+ return $this->paymentIntents->update( $id, $args, $this->get_api_options( $mode ) );
170
+ }
171
+
172
+ /**
173
+ *
174
+ * @param \Stripe\PaymentIntent $intent
175
+ * @param array $args
176
+ * @param string $mode
177
+ */
178
+ public function confirm_payment_intent( $id, $args = array(), $mode = '' ) {
179
+ return $this->paymentIntents->confirm( $id, $args, $this->get_api_options( $mode ) );
180
+ }
181
+
182
+ /**
183
+ *
184
+ * @param string $id
185
+ * @param string $mode
186
+ *
187
+ * @return WP_Error|\Stripe\PaymentIntent
188
+ */
189
+ public function fetch_payment_intent( $id, $mode = '' ) {
190
+ return $this->paymentIntents->retrieve( $id, array(), $this->get_api_options( $mode ) );
191
+ }
192
+
193
+ public function capture_payment_intent( $id, $args = array(), $mode = '' ) {
194
+ return $this->paymentIntents->capture( $id, $args, $this->get_api_options( $mode ) );
195
+ }
196
+
197
+ /**
198
+ *
199
+ * @param \Stripe\PaymentIntent|string $id
200
+ * @param string $mode
201
+ */
202
+ public function cancel_payment_intent( $id, $mode = '' ) {
203
+ return $this->paymentIntents->cancel( $id, array(), $this->get_api_options( $mode ) );
204
+ }
205
+
206
+ /**
207
+ *
208
+ * @param string $id
209
+ * @param string $mode
210
+ *
211
+ * @return WP_Error|\Stripe\SetupIntent
212
+ */
213
+ public function fetch_setup_intent( $id, $mode = '' ) {
214
+ return $this->setupIntents->retrieve( $id, array(), $this->get_api_options( $mode ) );
215
+ }
216
+
217
+ public function capture( $id, $args, $mode = '' ) {
218
+ return $this->charges->capture( $id, $args, $this->get_api_options( $mode ) );
219
+ }
220
+
221
+ /**
222
+ *
223
+ * @param string $charge_id
224
+ * @param string $mode
225
+ *
226
+ * @return \Stripe\Charge|WP_Error
227
+ */
228
+ public function get_charge( $charge_id, $mode = '' ) {
229
+ return $this->charges->retrieve( $charge_id, array(), $this->get_api_options( $mode ) );
230
+ }
231
+
232
+ public function refund( $args, $mode = '' ) {
233
+ return $this->refunds->create( $args, $this->get_api_options( $mode ) );
234
+ }
235
+
236
+ public function get_payment_method( $id, $mode = '' ) {
237
+ return \Stripe\PaymentMethod::retrieve( $id, $this->get_api_options( $mode ) );
238
+ }
239
+
240
+ /**
241
+ *
242
+ * @param \Stripe\PaymentMethod $payment_method
243
+ * @param array $args
244
+ * @param string $mode
245
+ */
246
+ public function attach_payment_method( $id, $args = array(), $mode = '' ) {
247
+ return $this->paymentMethods->attach( $id, $args, $this->get_api_options( $mode ) );
248
+ }
249
+
250
+ public function fetch_payment_method( $id, $mode = '' ) {
251
+ return $this->paymentMethods->retrieve( $id, null, $this->get_api_options( $mode ) );
252
+ }
253
+
254
+ /**
255
+ *
256
+ * @param \Stripe\PaymentMethod $payment_method
257
+ * @param string $mode
258
+ */
259
+ public function delete_payment_method( $id, $mode = '' ) {
260
+ return $this->paymentMethods->detach( $id, array(), $this->get_api_options( $mode ) );
261
+ }
262
+
263
+ /**
264
+ *
265
+ * @param string $id
266
+ * @param string $customer
267
+ * @param string $mode
268
+ */
269
+ public function delete_card( $id, $customer, $mode = '' ) {
270
+ return $this->sources->detach( $customer, $id, null, $this->get_api_options( $mode ) );
271
+ }
272
+
273
+ /**
274
+ *
275
+ * @param array $args
276
+ * @param string $mode
277
+ *
278
+ * @return WP_Error|\Stripe\PaymentMethod
279
+ */
280
+ public function create_payment_method( $args, $mode = '' ) {
281
+ return $this->paymentMethods->create( $args, $this->get_api_options( $mode ) );
282
+ }
283
+
284
+ /**
285
+ *
286
+ * @param string $id
287
+ * @param string $mode
288
+ *
289
+ * @return WP_Error|\Stripe\Source
290
+ *
291
+ */
292
+ public function fetch_payment_source( $id, $mode = '' ) {
293
+ return $this->sources->retrieve( $id, null, $this->get_api_options( $mode ) );
294
+ }
295
+
296
+ /**
297
+ *
298
+ * @param string $customer_id
299
+ * @param string $id
300
+ * @param string $mode
301
+ *
302
+ * @return WP_Error|\Stripe\Source
303
+ */
304
+ public function create_customer_source( $customer_id, $id, $mode = '' ) {
305
+ return $this->customers->createSource( $customer_id, array( 'source' => $id ), $this->get_api_options( $mode ) );
306
+ }
307
+
308
+ /**
309
+ *
310
+ * @param array $args
311
+ * @param string $mode
312
+ *
313
+ * @return WP_Error|\Stripe\Source
314
+ */
315
+ public function create_source( $args, $mode = '' ) {
316
+ return $this->sources->create( $args, $this->get_api_options( $mode ) );
317
+ }
318
+
319
+ /**
320
+ *
321
+ * @param string $source_id
322
+ * @param array $args
323
+ * @param string $mode
324
+ *
325
+ * @since 3.0.2
326
+ */
327
+ public function update_source( $source_id, $args, $mode = '' ) {
328
+ return $this->sources->update( $source_id, $args, $this->get_api_options( $mode ) );
329
+ }
330
+
331
+ public function fetch_customer( $customer_id, $mode = '' ) {
332
+ return $this->customers->retrieve( $customer_id, null, $this->get_api_options( $mode ) );
333
+ }
334
+
335
+ public function fetch_customers( $mode = '' ) {
336
+ return $this->customers->all( array( 'limit' => 1 ), $this->get_api_options( $mode ) );
337
+ }
338
+
339
+ public function fetch_payment_methods( $customer_id, $mode = '', $type = 'card' ) {
340
+ return $this->paymentMethods->all(
341
+ array(
342
+ 'customer' => $customer_id,
343
+ 'type' => $type,
344
+ ),
345
+ $this->get_api_options( $mode )
346
+ );
347
+ }
348
+
349
+ public function register_domain( $domain, $mode = '' ) {
350
+ return $this->applePayDomains->create( array( 'domain_name' => $domain ), $this->get_api_options( $mode ) );
351
+ }
352
+
353
+ /**
354
+ *
355
+ * @param string $mode
356
+ *
357
+ * @since 3.1.6
358
+ */
359
+ public function fetch_domains( $mode = '' ) {
360
+ return $this->applePayDomains->all( array( 'limit' => 50 ), $this->get_api_options( $mode ) );
361
+ }
362
+
363
+ /**
364
+ *
365
+ * @param \Stripe\ApplePayDomain $domain
366
+ * @param string $mode
367
+ *
368
+ * @since 3.1.6
369
+ */
370
+ public function delete_domain( $id, $mode = '' ) {
371
+ return $this->applePayDomains->delete( $id, array(), $this->get_api_options( $mode ) );
372
+ }
373
+
374
+ public function webhooks( $mode = '' ) {
375
+ return $this->webhookEndpoints->all( array( 'limit' => 100 ), $this->get_api_options( $mode ) );
376
+ }
377
+
378
+ public function create_webhook( $url, $events, $mode = '' ) {
379
+ return $this->webhookEndpoints->create(
380
+ array(
381
+ 'url' => $url,
382
+ 'enabled_events' => $events,
383
+ ),
384
+ $this->get_api_options( $mode )
385
+ );
386
+ }
387
+
388
+ public function update_webhook( $id, $params, $mode = '' ) {
389
+ return $this->webhookEndpoints->update( $id, $params, $this->get_api_options( $mode ) );
390
+ }
391
+
392
+ public function fetch_webhook( $id, $mode = '' ) {
393
+ return $this->webhookEndpoints->retrieve( $id, null, $this->get_api_options( $mode ) );
394
+ }
395
+
396
+ public function get_api_options( $mode = '' ) {
397
+ if ( empty( $mode ) && $this->mode != null ) {
398
+ $mode = $this->mode;
399
+ }
400
+ $args = array( 'api_key' => $this->secret_key ? $this->secret_key : wc_stripe_get_secret_key( $mode ) );
401
+
402
+ return apply_filters( 'wc_stripe_api_options', $args );
403
+ }
404
+
405
+ /**
406
+ *
407
+ * @param mixed $err
408
+ */
409
+ private function get_error_message( $err ) {
410
+ if ( is_a( $err, '\Stripe\Exception\ApiErrorException' ) ) {
411
+ $err = $err->getError();
412
+ }
413
+ if ( is_array( $err ) || $err instanceof \Stripe\ErrorObject ) {
414
+ $this->messages = ! $this->messages ? wc_stripe_get_error_messages() : $this->messages;
415
+ if ( isset( $err['decline_code'] ) && isset( $this->messages[ $err['decline_code'] ] ) ) {
416
+ return $this->messages[ $err['decline_code'] ];
417
+ }
418
+ if ( isset( $err['code'] ) && isset( $this->messages[ $err['code'] ] ) ) {
419
+ return $this->messages[ $err['code'] ];
420
+ }
421
+ if ( isset( $err['message'] ) ) {
422
+ return $err['message'];
423
+ }
424
+ }
425
+ if ( is_string( $err ) ) {
426
+ return $err;
427
+ }
428
+ }
429
+
430
+ /**
431
+ *
432
+ * @param \Stripe\Exception\ApiErrorException $e
433
+ *
434
+ * @since 3.1.1
435
+ * @todo use in future version to replace manual returns of WP_Error in each method
436
+ */
437
+ public function get_wp_error( $e, $code = 'stripe-error' ) {
438
+ $err = $e->getJsonBody()['error'];
439
+
440
+ return new WP_Error( $code, $this->get_error_message( $err ), $err );
441
+ }
442
+ }
443
+
444
+ WC_Stripe_Gateway::init();
includes/class-wc-stripe-install.php CHANGED
@@ -1,40 +1,40 @@
1
- <?php
2
- defined( 'ABSPATH' ) || exit();
3
-
4
- /**
5
- *
6
- * @package Stripe/Classes
7
- *
8
- */
9
- class WC_Stripe_Install {
10
-
11
- public static function init() {
12
- add_filter( 'plugin_action_links_' . WC_STRIPE_PLUGIN_NAME, array( __CLASS__, 'plugin_action_links' ) );
13
- register_activation_hook( WC_STRIPE_PLUGIN_NAME, array( __CLASS__, 'install' ) );
14
- }
15
-
16
- public static function install() {
17
- update_option( 'stripe_wc_version', wc_stripe()->version() );
18
-
19
- /**
20
- * Schedule required actions. Actions are scheduled during install as they only need to be setup
21
- * once.
22
- */
23
- wc_stripe()->scheduled_actions();
24
- }
25
-
26
- /**
27
- *
28
- * @param array $links
29
- */
30
- public static function plugin_action_links( $links ) {
31
- $action_links = array(
32
- 'settings' => sprintf( '<a href="%1$s">%2$s</a>', admin_url( 'admin.php?page=wc-settings&tab=checkout&section=stripe_api' ), esc_html__( 'Settings', 'woo-stripe-payment' ) ),
33
- 'docs' => sprintf( '<a target="_blank" href="https://docs.paymentplugins.com/wc-stripe/config">%s</a>', __( 'Documentation', 'woo-stripe-payment' ) ),
34
- );
35
-
36
- return array_merge( $action_links, $links );
37
- }
38
- }
39
-
40
- WC_Stripe_Install::init();
1
+ <?php
2
+ defined( 'ABSPATH' ) || exit();
3
+
4
+ /**
5
+ *
6
+ * @package Stripe/Classes
7
+ *
8
+ */
9
+ class WC_Stripe_Install {
10
+
11
+ public static function init() {
12
+ add_filter( 'plugin_action_links_' . WC_STRIPE_PLUGIN_NAME, array( __CLASS__, 'plugin_action_links' ) );
13
+ register_activation_hook( WC_STRIPE_PLUGIN_NAME, array( __CLASS__, 'install' ) );
14
+ }
15
+
16
+ public static function install() {
17
+ update_option( 'stripe_wc_version', stripe_wc()->version() );
18
+
19
+ /**
20
+ * Schedule required actions. Actions are scheduled during install as they only need to be setup
21
+ * once.
22
+ */
23
+ stripe_wc()->scheduled_actions();
24
+ }
25
+
26
+ /**
27
+ *
28
+ * @param array $links
29
+ */
30
+ public static function plugin_action_links( $links ) {
31
+ $action_links = array(
32
+ 'settings' => sprintf( '<a href="%1$s">%2$s</a>', admin_url( 'admin.php?page=wc-settings&tab=checkout&section=stripe_api' ), esc_html__( 'Settings', 'woo-stripe-payment' ) ),
33
+ 'docs' => sprintf( '<a target="_blank" href="https://docs.paymentplugins.com/wc-stripe/config">%s</a>', __( 'Documentation', 'woo-stripe-payment' ) ),
34
+ );
35
+
36
+ return array_merge( $action_links, $links );
37
+ }
38
+ }
39
+
40
+ WC_Stripe_Install::init();
includes/class-wc-stripe-payment-charge-local.php CHANGED
@@ -30,7 +30,10 @@ class WC_Stripe_Payment_Charge_Local extends WC_Stripe_Payment_Charge {
30
  }
31
 
32
  // update the source's metadata with the order id
33
- $source = $this->gateway->sources->mode( wc_stripe_order_mode( $order ) )->update( $source_id, $this->payment_method->get_update_source_args( $order ) );
 
 
 
34
  } else {
35
  // create the source
36
  $args = $this->payment_method->get_source_args( $order );
30
  }
31
 
32
  // update the source's metadata with the order id
33
+ if ( 'chargeable' !== $source->status ) {
34
+ $source = $this->gateway->sources->mode( wc_stripe_order_mode( $order ) )->update( $source_id, $this->payment_method->get_update_source_args( $order ) );
35
+
36
+ }
37
  } else {
38
  // create the source
39
  $args = $this->payment_method->get_source_args( $order );
includes/class-wc-stripe-redirect-handler.php CHANGED
@@ -18,7 +18,7 @@ class WC_Stripe_Redirect_Handler {
18
  * Check if this request is for a local payment redirect.
19
  */
20
  public static function local_payment_redirect() {
21
- if ( isset( $_GET['wc-stripe-local-gateway'], $_GET['_payment_nonce'] ) && wp_verify_nonce( $_GET['_payment_nonce'], 'local-payment' ) ) {
22
  self::process_redirect();
23
  }
24
  }
@@ -27,14 +27,16 @@ class WC_Stripe_Redirect_Handler {
27
  */
28
  public static function process_redirect() {
29
  if ( isset( $_GET['source'] ) ) {
30
- $result = WC_Stripe_Gateway::load()->sources->retrieve( wc_clean( $_GET['source'] ) );
 
31
  } else {
32
- $result = WC_Stripe_Gateway::load()->paymentIntents->retrieve( wc_clean( $_GET['payment_intent'] ) );
 
33
  }
34
  if ( is_wp_error( $result ) ) {
35
  wc_add_notice( sprintf( __( 'Error retrieving payment source. Reason: %s', 'woo-stripe-payment' ), $result->get_error_message() ), 'error' );
36
-
37
- return;
38
  } else {
39
  define( WC_Stripe_Constants::REDIRECT_HANDLER, true );
40
  $order_id = $result->metadata['order_id'];
18
  * Check if this request is for a local payment redirect.
19
  */
20
  public static function local_payment_redirect() {
21
+ if ( isset( $_GET['wc-stripe-local-gateway'], $_GET['order_key'] ) ) {
22
  self::process_redirect();
23
  }
24
  }
27
  */
28
  public static function process_redirect() {
29
  if ( isset( $_GET['source'] ) ) {
30
+ $result = WC_Stripe_Gateway::load()->sources->retrieve( wc_clean( $_GET['source'] ) );
31
+ $client_secret = $_GET['client_secret'];
32
  } else {
33
+ $result = WC_Stripe_Gateway::load()->paymentIntents->retrieve( wc_clean( $_GET['payment_intent'] ) );
34
+ $client_secret = $_GET['payment_intent_client_secret'];
35
  }
36
  if ( is_wp_error( $result ) ) {
37
  wc_add_notice( sprintf( __( 'Error retrieving payment source. Reason: %s', 'woo-stripe-payment' ), $result->get_error_message() ), 'error' );
38
+ } elseif ( ! hash_equals( $client_secret, $result->client_secret ) ) {
39
+ wc_add_notice( __( 'This request is invalid. Please try again.', 'woo-stripe-payment' ), 'error' );
40
  } else {
41
  define( WC_Stripe_Constants::REDIRECT_HANDLER, true );
42
  $order_id = $result->metadata['order_id'];
includes/class-wc-stripe-rest-api.php CHANGED
@@ -14,6 +14,7 @@ defined( 'ABSPATH' ) || exit();
14
  * @property WC_Stripe_Rest_Controller $webhook
15
  * @property WC_Stripe_Rest_Controller $product_data
16
  * @property WC_Stripe_Rest_Controller $plaid
 
17
  */
18
  class WC_Stripe_Rest_API {
19
 
@@ -36,7 +37,7 @@ class WC_Stripe_Rest_API {
36
  public function __get( $key ) {
37
  $controller = isset( $this->controllers[ $key ] ) ? $this->controllers[ $key ] : '';
38
  if ( empty( $controller ) ) {
39
- wc_doing_it_wrong( __FUNCTION__, sprintf( __( '%1$s is an invalid controller name.', 'woo-stripe-payment' ), $key ), wc_stripe()->version );
40
  }
41
 
42
  return $controller;
@@ -58,6 +59,7 @@ class WC_Stripe_Rest_API {
58
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/controllers/class-wc-stripe-controller-webhook.php';
59
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/controllers/class-wc-stripe-controller-product-data.php';
60
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/controllers/class-wc-stripe-controller-plaid.php';
 
61
 
62
  foreach ( $this->get_controllers() as $key => $class_name ) {
63
  if ( class_exists( $class_name ) ) {
@@ -87,7 +89,8 @@ class WC_Stripe_Rest_API {
87
  'settings' => 'WC_Stripe_Controller_Gateway_Settings',
88
  'webhook' => 'WC_Stripe_Controller_Webhook',
89
  'product_data' => 'WC_Stripe_Controller_Product_Data',
90
- 'plaid' => 'WC_Stripe_Controller_Plaid'
 
91
  );
92
 
93
  /**
@@ -100,14 +103,14 @@ class WC_Stripe_Rest_API {
100
  * @return string
101
  */
102
  public function rest_url() {
103
- return wc_stripe()->rest_url();
104
  }
105
 
106
  /**
107
  * @return string
108
  */
109
  public function rest_uri() {
110
- return wc_stripe()->rest_uri();
111
  }
112
 
113
  /**
@@ -115,10 +118,10 @@ class WC_Stripe_Rest_API {
115
  */
116
  public static function is_rest_api_request() {
117
  global $wp;
118
- if ( ! empty( $wp->query_vars['rest_route'] ) && strpos( $wp->query_vars['rest_route'], wc_stripe()->rest_uri() ) !== false ) {
119
  return true;
120
  }
121
- if ( ! empty( $_SERVER['REQUEST_URI'] ) && strpos( $_SERVER['REQUEST_URI'], wc_stripe()->rest_uri() ) !== false ) {
122
  return true;
123
  }
124
 
14
  * @property WC_Stripe_Rest_Controller $webhook
15
  * @property WC_Stripe_Rest_Controller $product_data
16
  * @property WC_Stripe_Rest_Controller $plaid
17
+ * @property WC_Stripe_Rest_Controller $source
18
  */
19
  class WC_Stripe_Rest_API {
20
 
37
  public function __get( $key ) {
38
  $controller = isset( $this->controllers[ $key ] ) ? $this->controllers[ $key ] : '';
39
  if ( empty( $controller ) ) {
40
+ wc_doing_it_wrong( __FUNCTION__, sprintf( __( '%1$s is an invalid controller name.', 'woo-stripe-payment' ), $key ), stripe_wc()->version );
41
  }
42
 
43
  return $controller;
59
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/controllers/class-wc-stripe-controller-webhook.php';
60
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/controllers/class-wc-stripe-controller-product-data.php';
61
  include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/controllers/class-wc-stripe-controller-plaid.php';
62
+ include_once WC_STRIPE_PLUGIN_FILE_PATH . 'includes/controllers/class-wc-stripe-controller-source.php';
63
 
64
  foreach ( $this->get_controllers() as $key => $class_name ) {
65
  if ( class_exists( $class_name ) ) {
89
  'settings' => 'WC_Stripe_Controller_Gateway_Settings',
90
  'webhook' => 'WC_Stripe_Controller_Webhook',
91
  'product_data' => 'WC_Stripe_Controller_Product_Data',
92
+ 'plaid' => 'WC_Stripe_Controller_Plaid',
93
+ 'source' => 'WC_Stripe_Controller_Source'
94
  );
95
 
96
  /**
103
  * @return string
104
  */
105
  public function rest_url() {
106
+ return stripe_wc()->rest_url();
107
  }
108
 
109
  /**
110
  * @return string
111
  */
112
  public function rest_uri() {
113
+ return stripe_wc()->rest_uri();
114
  }
115
 
116
  /**
118
  */
119
  public static function is_rest_api_request() {
120
  global $wp;
121
+ if ( ! empty( $wp->query_vars['rest_route'] ) && strpos( $wp->query_vars['rest_route'], stripe_wc()->rest_uri() ) !== false ) {
122
  return true;
123
  }
124
+ if ( ! empty( $_SERVER['REQUEST_URI'] ) && strpos( $_SERVER['REQUEST_URI'], stripe_wc()->rest_uri() ) !== false ) {
125
  return true;
126
  }
127
 
includes/class-wc-stripe-update.php CHANGED
@@ -1,68 +1,69 @@
1
- <?php
2
- defined( 'ABSPATH' ) || exit();
3
-
4
- /**
5
- *
6
- * @author PaymentPlugins
7
- * @package Stripe/Classes
8
- *
9
- */
10
- class WC_Stripe_Update {
11
-
12
- private static $updates = array(
13
- '3.0.7' => 'update-3.0.7.php',
14
- '3.1.0' => 'update-3.1.0.php',
15
- '3.1.1' => 'update-3.1.1.php',
16
- '3.1.6' => 'update-3.1.6.php',
17
- '3.1.7' => 'update-3.1.7.php'
18
- );
19
-
20
- public static function init() {
21
- add_action( 'init', array( __CLASS__, 'update' ) );
22
- }
23
-
24
- /**
25
- * Performs an update on the plugin if required.
26
- */
27
- public static function update() {
28
- // if option is not set, make the default version 3.0.6.
29
- $current_version = get_option( 'stripe_wc_version', '3.0.6' );
30
-
31
- // if database version is less than plugin version, an update might be required.
32
- if ( version_compare( $current_version, wc_stripe()->version(), '<' ) ) {
33
- foreach ( self::$updates as $version => $path ) {
34
- /*
35
- * If the current version is less than the version in the loop, then perform upgrade.
36
- */
37
- if ( version_compare( $current_version, $version, '<' ) ) {
38
- $file = wc_stripe()->plugin_path() . 'includes/updates/' . $path;
39
- if ( file_exists( $file ) ) {
40
- include $file;
41
- }
42
- $current_version = $version;
43
- update_option( 'stripe_wc_version', $current_version );
44
- add_action(
45
- 'admin_notices',
46
- function () use ( $current_version ) {
47
- $message = sprintf( __( 'Thank you for updating Stripe for WooCommerce to version %1$s.', 'woo-stripe-payment' ), $current_version );
48
- if ( ( $text = self::get_messages( $current_version ) ) ) {
49
- $message .= ' ' . $text;
50
- }
51
- printf( '<div class="notice notice-success is-dismissible"><p>%1$s</p></div>', $message );
52
- }
53
- );
54
- }
55
- }
56
- // save latest version.
57
- update_option( 'stripe_wc_version', wc_stripe()->version() );
58
- }
59
- }
60
-
61
- public static function get_messages( $version ) {
62
- $messages = array();
63
-
64
- return isset( $messages[ $version ] ) ? $messages[ $version ] : false;
65
- }
66
- }
67
-
68
- WC_Stripe_Update::init();
 
1
+ <?php
2
+ defined( 'ABSPATH' ) || exit();
3
+
4
+ /**
5
+ *
6
+ * @author PaymentPlugins
7
+ * @package Stripe/Classes
8
+ *
9
+ */
10
+ class WC_Stripe_Update {
11
+
12
+ private static $updates = array(
13
+ '3.0.7' => 'update-3.0.7.php',
14
+ '3.1.0' => 'update-3.1.0.php',
15
+ '3.1.1' => 'update-3.1.1.php',
16
+ '3.1.6' => 'update-3.1.6.php',
17
+ '3.1.7' => 'update-3.1.7.php',
18
+ '3.2.8' => 'update-3.2.8.php'
19
+ );
20
+
21
+ public static function init() {
22
+ add_action( 'init', array( __CLASS__, 'update' ) );
23
+ }
24
+
25
+ /**
26
+ * Performs an update on the plugin if required.
27
+ */
28
+ public static function update() {
29
+ // if option is not set, make the default version 3.0.6.
30
+ $current_version = get_option( 'stripe_wc_version', '3.0.6' );
31
+
32
+ // if database version is less than plugin version, an update might be required.
33
+ if ( version_compare( $current_version, stripe_wc()->version(), '<' ) ) {
34
+ foreach ( self::$updates as $version => $path ) {
35
+ /*
36
+ * If the current version is less than the version in the loop, then perform upgrade.
37
+ */
38
+ if ( version_compare( $current_version, $version, '<' ) ) {
39
+ $file = stripe_wc()->plugin_path() . 'includes/updates/' . $path;
40
+ if ( file_exists( $file ) ) {
41
+ include $file;
42
+ }
43
+ $current_version = $version;
44
+ update_option( 'stripe_wc_version', $current_version );
45
+ add_action(
46
+ 'admin_notices',
47
+ function () use ( $current_version ) {
48
+ $message = sprintf( __( 'Thank you for updating Stripe for WooCommerce to version %1$s.', 'woo-stripe-payment' ), $current_version );
49
+ if ( ( $text = self::get_messages( $current_version ) ) ) {
50
+ $message .= ' ' . $text;
51
+ }
52
+ printf( '<div class="notice notice-success is-dismissible"><p>%1$s</p></div>', $message );
53
+ }
54
+ );
55
+ }
56
+ }
57
+ // save latest version.
58
+ update_option( 'stripe_wc_version', stripe_wc()->version() );
59
+ }
60
+ }
61
+
62
+ public static function get_messages( $version ) {
63
+ $messages = array();
64
+
65
+ return isset( $messages[ $version ] ) ? $messages[ $version ] : false;
66
+ }
67
+ }
68
+
69
+ WC_Stripe_Update::init();
includes/controllers/class-wc-stripe-controller-checkout.php CHANGED
@@ -53,15 +53,6 @@ class WC_Stripe_Controller_Checkout extends WC_Stripe_Rest_Controller {
53
  'permission_callback' => '__return_true',
54
  )
55
  );
56
- register_rest_route(
57
- $this->rest_uri(),
58
- 'source',
59
- array(
60
- 'methods' => WP_REST_Server::DELETABLE,
61
- 'callback' => array( $this, 'delete_source' ),
62
- 'permission_callback' => '__return_true',
63
- )
64
- );
65
  }
66
 
67
  /**
@@ -167,25 +158,6 @@ class WC_Stripe_Controller_Checkout extends WC_Stripe_Rest_Controller {
167
  }
168
  }
169
 
170
- /**
171
- * Deletes a source from an order if the order exists.
172
- *
173
- * @param WP_REST_Request $request
174
- *
175
- * @return WP_REST_Response
176
- * @since 3.1.7
177
- */
178
- public function delete_source( $request ) {
179
- $order_id = WC()->session->get( 'order_awaiting_payment', null );
180
- if ( $order_id ) {
181
- $order = wc_get_order( $order_id );
182
- $order->delete_meta_data( WC_Stripe_Constants::SOURCE_ID );
183
- $order->save();
184
- }
185
-
186
- return rest_ensure_response( array( 'success' => true ) );
187
- }
188
-
189
 
190
  /**
191
  *
53
  'permission_callback' => '__return_true',
54
  )
55
  );
 
 
 
 
 
 
 
 
 
56
  }
57
 
58
  /**
158
  }
159
  }
160
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
 
162
  /**
163
  *
includes/controllers/class-wc-stripe-controller-gateway-settings.php CHANGED
@@ -23,7 +23,7 @@ class WC_Stripe_Controller_Gateway_Settings extends WC_Stripe_Rest_Controller {
23
  );
24
  register_rest_route(
25
  $this->rest_uri(),
26
- 'create-webook',
27
  array(
28
  'methods' => WP_REST_Server::CREATABLE,
29
  'callback' => array( $this, 'create_webhook' ),
@@ -123,8 +123,8 @@ class WC_Stripe_Controller_Gateway_Settings extends WC_Stripe_Rest_Controller {
123
  * @param WP_REST_Request $request
124
  */
125
  public function create_webhook( $request ) {
126
- $url = wc_stripe()->rest_api->webhook->rest_url( 'webhook' );
127
- $api_settings = wc_stripe()->api_settings;
128
  $env = $request->get_param( 'environment' );
129
  $gateway = new WC_Stripe_Gateway( $env );
130
  // first fetch all webhooks
23
  );
24
  register_rest_route(
25
  $this->rest_uri(),
26
+ 'create-webhook',
27
  array(
28
  'methods' => WP_REST_Server::CREATABLE,
29
  'callback' => array( $this, 'create_webhook' ),
123
  * @param WP_REST_Request $request
124
  */
125
  public function create_webhook( $request ) {
126
+ $url = stripe_wc()->rest_api->webhook->rest_url( 'webhook' );
127
+ $api_settings = stripe_wc()->api_settings;
128
  $env = $request->get_param( 'environment' );
129
  $gateway = new WC_Stripe_Gateway( $env );
130
  // first fetch all webhooks
includes/controllers/class-wc-stripe-controller-order-actions.php CHANGED
@@ -297,7 +297,7 @@ class WC_Stripe_Controller_Order_Actions extends WC_Stripe_Rest_Controller {
297
  $order->update_meta_data( WC_Stripe_Constants::CHARGE_STATUS, $charge->status );
298
  $order->save();
299
  ob_start();
300
- include wc_stripe()->plugin_path() . 'includes/admin/meta-boxes/views/html-charge-data-subview.php';
301
  $html = ob_get_clean();
302
 
303
  return rest_ensure_response(
297
  $order->update_meta_data( WC_Stripe_Constants::CHARGE_STATUS, $charge->status );
298
  $order->save();
299
  ob_start();
300
+ include stripe_wc()->plugin_path() . 'includes/admin/meta-boxes/views/html-charge-data-subview.php';
301
  $html = ob_get_clean();
302
 
303
  return rest_ensure_response(
includes/controllers/class-wc-stripe-controller-source.php ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined( 'ABSPATH' ) || exit();
3
+
4
+ /**
5
+ * Controller class that perfors cart operations for client side requests.
6
+ *
7
+ * @author PaymentPlugins
8
+ * @package Stripe/Controllers
9
+ *
10
+ */
11
+ class WC_Stripe_Controller_Source extends WC_Stripe_Rest_Controller {
12
+
13
+ protected $namespace = 'source';
14
+
15
+ public function register_routes() {
16
+ register_rest_route( $this->rest_uri(), 'update', array(
17
+ 'methods' => WP_REST_Server::CREATABLE,
18
+ 'callback' => array( $this, 'update_source' ),
19
+ 'permission_callback' => '__return_true',
20
+ 'args' => array(
21
+ 'source_id' => array( 'required' => true ),
22
+ 'client_secret' => array( 'required' => true ),
23
+ 'updates' => array( 'required' => true ),
24
+ 'gateway_id' => array( 'required', true )
25
+ )
26
+ ) );
27
+ register_rest_route(
28
+ $this->rest_uri(), 'order/source', array(
29
+ 'methods' => WP_REST_Server::DELETABLE,
30
+ 'callback' => array( $this, 'delete_order_source' ),
31
+ 'permission_callback' => '__return_true',
32
+ )
33
+ );
34
+ }
35
+
36
+ /**
37
+ * @param WP_REST_Request $request
38
+ */
39
+ public function update_source( $request ) {
40
+
41
+ try {
42
+ /**
43
+ * @var WC_Payment_Gateway_Stripe $payment_method
44
+ */
45
+ $payment_method = WC()->payment_gateways()->payment_gateways()[ $request['payment_method'] ];
46
+
47
+ // fetch the source and check client token and status
48
+ $source = $payment_method->payment_object->get_gateway()->sources->retrieve( $request['source_id'] );
49
+
50
+ if ( $source->status !== 'chargeable' ) {
51
+ if ( is_wp_error( $source ) ) {
52
+ throw new Exception( __( 'Error updating source.', 'woo-stripe-payment' ) );
53
+ }
54
+ if ( ! hash_equals( $source->client_secret, $request['client_secret'] ) ) {
55
+ throw new Exception( __( 'You do not have permission to update this source.', 'woo-stripe-payment' ) );
56
+ }
57
+ //update the source
58
+ $source = $payment_method->payment_object->get_gateway()->sources->update( $request['source_id'], $request['updates'] );
59
+ if ( is_wp_error( $source ) ) {
60
+ throw new Exception( __( 'Error updating source.', 'woo-stripe-payment' ) );
61
+ }
62
+ }
63
+
64
+ return rest_ensure_response( array( 'source' => $source->toArray() ) );
65
+ } catch ( Exception $e ) {
66
+ return new WP_Error( 'source-error', $e->getMessage(), array( 'status' => 400 ) );
67
+ }
68
+ }
69
+
70
+ /**
71
+ * Deletes a source from an order if the order exists.
72
+ *
73
+ * @param WP_REST_Request $request
74
+ *
75
+ * @return WP_REST_Response
76
+ * @since 3.1.7
77
+ */
78
+ public function delete_order_source( $request ) {
79
+ $order_id = WC()->session->get( 'order_awaiting_payment', null );
80
+ if ( $order_id ) {
81
+ $order = wc_get_order( $order_id );
82
+ $order->delete_meta_data( WC_Stripe_Constants::SOURCE_ID );
83
+ $order->save();
84
+ }
85
+
86
+ return rest_ensure_response( array( 'success' => true ) );
87
+ }
88
+ }
includes/controllers/class-wc-stripe-controller-webhook.php CHANGED
@@ -1,61 +1,61 @@
1
- <?php
2
- defined( 'ABSPATH' ) || exit();
3
-
4
- /**
5
- *
6
- * @author PaymentPlugins
7
- * @package Stripe/Controllers
8
- *
9
- */
10
- class WC_Stripe_Controller_Webhook extends WC_Stripe_Rest_Controller {
11
-
12
- protected $namespace = '';
13
-
14
- private $secret;
15
-
16
- public function register_routes() {
17
- register_rest_route(
18
- $this->rest_uri(),
19
- 'webhook',
20
- array(
21
- 'methods' => WP_REST_Server::CREATABLE,
22
- 'callback' => array( $this, 'webhook' ),
23
- 'permission_callback' => '__return_true'
24
- )
25
- );
26
- }
27
-
28
- /**
29
- *
30
- * @param WP_REST_Request $request
31
- */
32
- public function webhook( $request ) {
33
- $payload = $request->get_body();
34
- $json_payload = json_decode( $payload, true );
35
- $mode = $json_payload['livemode'] == true ? 'live' : 'test';
36
- $this->secret = wc_stripe()->api_settings->get_option( 'webhook_secret_' . $mode );
37
- $header = isset( $_SERVER['HTTP_STRIPE_SIGNATURE'] ) ? $_SERVER['HTTP_STRIPE_SIGNATURE'] : '';
38
- try {
39
- $event = \Stripe\Webhook::constructEvent( $payload, $header, $this->secret );
40
- // $event = \Stripe\StripeObject::constructFrom(json_decode($payload, true));
41
- wc_stripe_log_info( sprintf( 'Webhook notification received: Event: %s. Payload: %s', $event->type, print_r( $payload, true ) ) );
42
- $type = $event->type;
43
- $type = str_replace( '.', '_', $type );
44
-
45
- // allow functionality to hook in to the event action
46
- do_action( 'wc_stripe_webhook_' . $type, $event->data->object, $request, $event );
47
-
48
- return rest_ensure_response( apply_filters( 'wc_stripe_webhook_response', array(), $event, $request ) );
49
- } catch ( \Stripe\Error\SignatureVerification $e ) {
50
- wc_stripe_log_info( __( 'Invalid signature received. Verify that your webhook secret is correct.', 'woo-stripe-payment' ) );
51
-
52
- return $this->send_error_response( __( 'Invalid signature received. Verify that your webhook secret is correct.', 'woo-stripe-payment' ), 401 );
53
- } catch ( Exception $e ) {
54
- return $this->send_error_response( $e->getMessage() );
55
- }
56
- }
57
-
58
- private function send_error_response( $message, $code = 400 ) {
59
- return new WP_Error( 'webhook-error', $message, array( 'status' => $code ) );
60
- }
61
- }
1
+ <?php
2
+ defined( 'ABSPATH' ) || exit();
3
+
4
+ /**
5
+ *
6
+ * @author PaymentPlugins
7
+ * @package Stripe/Controllers
8
+ *
9
+ */
10
+ class WC_Stripe_Controller_Webhook extends WC_Stripe_Rest_Controller {
11
+
12
+ protected $namespace = '';
13
+
14
+ private $secret;
15
+
16
+ public function register_routes() {
17
+ register_rest_route(
18
+ $this->rest_uri(),
19
+ 'webhook',
20
+ array(
21
+ 'methods' => WP_REST_Server::CREATABLE,
22
+ 'callback' => array( $this, 'webhook' ),
23
+ 'permission_callback' => '__return_true'
24
+ )
25
+ );
26
+ }
27
+
28
+ /**
29
+ *
30
+ * @param WP_REST_Request $request
31
+ */
32
+ public function webhook( $request ) {
33
+ $payload = $request->get_body();
34
+ $json_payload = json_decode( $payload, true );
35
+ $mode = $json_payload['livemode'] == true ? 'live' : 'test';
36
+ $this->secret = stripe_wc()->api_settings->get_option( 'webhook_secret_' . $mode );
37
+ $header = isset( $_SERVER['HTTP_STRIPE_SIGNATURE'] ) ? $_SERVER['HTTP_STRIPE_SIGNATURE'] : '';
38
+ try {
39
+ $event = \Stripe\Webhook::constructEvent( $payload, $header, $this->secret );
40
+ // $event = \Stripe\StripeObject::constructFrom(json_decode($payload, true));
41
+ wc_stripe_log_info( sprintf( 'Webhook notification received: Event: %s. Payload: %s', $event->type, print_r( $payload, true ) ) );
42
+ $type = $event->type;
43
+ $type = str_replace( '.', '_', $type );
44
+
45
+ // allow functionality to hook in to the event action
46
+ do_action( 'wc_stripe_webhook_' . $type, $event->data->object, $request, $event );
47
+
48
+ return rest_ensure_response( apply_filters( 'wc_stripe_webhook_response', array(), $event, $request ) );
49
+ } catch ( \Stripe\Error\SignatureVerification $e ) {
50
+ wc_stripe_log_info( __( 'Invalid signature received. Verify that your webhook secret is correct.', 'woo-stripe-payment' ) );
51
+
52
+ return $this->send_error_response( __( 'Invalid signature received. Verify that your webhook secret is correct.', 'woo-stripe-payment' ), 401 );
53
+ } catch ( Exception $e ) {
54
+ return $this->send_error_response( $e->getMessage() );
55
+ }
56
+ }
57
+
58
+ private function send_error_response( $message, $code = 400 ) {
59
+ return new WP_Error( 'webhook-error', $message, array( 'status' => $code ) );
60
+ }
61
+ }
includes/gateways/class-wc-payment-gateway-stripe-ach.php CHANGED
@@ -28,7 +28,7 @@ class WC_Payment_Gateway_Stripe_ACH extends WC_Payment_Gateway_Stripe {
28
  $this->token_type = 'Stripe_ACH';
29
  $this->method_title = __( 'Stripe ACH', 'woo-stripe-payment' );
30
  $this->method_description = __( 'ACH gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
31
- $this->icon = wc_stripe()->assets_url( 'img/ach.svg' );
32
  $this->order_button_text = __( 'Bank Payment', 'woo-stripe-payment' );
33
  $this->metadata_key = $this->id . '_metadata';
34
  parent::__construct();
@@ -95,7 +95,7 @@ class WC_Payment_Gateway_Stripe_ACH extends WC_Payment_Gateway_Stripe {
95
  'client_name' => $this->get_option( 'client_name' ),
96
  'fees_enabled' => $this->fees_enabled(),
97
  'routes' => array(
98
- 'link_token' => WC_Stripe_Rest_API::get_endpoint( wc_stripe()->rest_api->plaid->rest_uri( 'link-token' ) )
99
  )
100
  )
101
  );
@@ -268,7 +268,7 @@ class WC_Payment_Gateway_Stripe_ACH extends WC_Payment_Gateway_Stripe {
268
  );
269
  $data = wp_parse_args( $data, $defaults );
270
  ob_start();
271
- include wc_stripe()->plugin_path() . 'includes/admin/views/html-ach-fee.php';
272
 
273
  return ob_get_clean();
274
  }
28
  $this->token_type = 'Stripe_ACH';
29
  $this->method_title = __( 'Stripe ACH', 'woo-stripe-payment' );
30
  $this->method_description = __( 'ACH gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
31
+ $this->icon = stripe_wc()->assets_url( 'img/ach.svg' );
32
  $this->order_button_text = __( 'Bank Payment', 'woo-stripe-payment' );
33
  $this->metadata_key = $this->id . '_metadata';
34
  parent::__construct();
95
  'client_name' => $this->get_option( 'client_name' ),
96
  'fees_enabled' => $this->fees_enabled(),
97
  'routes' => array(
98
+ 'link_token' => WC_Stripe_Rest_API::get_endpoint( stripe_wc()->rest_api->plaid->rest_uri( 'link-token' ) )
99
  )
100
  )
101
  );
268
  );
269
  $data = wp_parse_args( $data, $defaults );
270
  ob_start();
271
+ include stripe_wc()->plugin_path() . 'includes/admin/views/html-ach-fee.php';
272
 
273
  return ob_get_clean();
274
  }
includes/gateways/class-wc-payment-gateway-stripe-alipay.php CHANGED
@@ -1,63 +1,63 @@
1
- <?php
2
- defined( 'ABSPATH' ) || exit();
3
-
4
- if ( ! class_exists( 'WC_Payment_Gateway_Stripe_Local_Payment' ) ) {
5
- return;
6
- }
7
-
8
- /**
9
- *
10
- * @package Stripe/Gateways
11
- * @author PaymentPlugins
12
- *
13
- */
14
- class WC_Payment_Gateway_Stripe_Alipay extends WC_Payment_Gateway_Stripe_Local_Payment {
15
-
16
- use WC_Stripe_Local_Payment_Charge_Trait;
17
-
18
- public function __construct() {
19
- $this->local_payment_type = 'alipay';
20
- $this->currencies = array( 'AUD', 'CAD', 'EUR', 'GBP', 'HKD', 'JPY', 'SGD', 'USD', 'CNY', 'NZD', 'MYR' );
21
- $this->id = 'stripe_alipay';
22
- $this->tab_title = __( 'Alipay', 'woo-stripe-payment' );
23
- $this->template_name = 'local-payment.php';
24
- $this->token_type = 'Stripe_Local';
25
- $this->method_title = __( 'Alipay', 'woo-stripe-payment' );
26
- $this->method_description = __( 'Alipay gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
27
- $this->icon = wc_stripe()->assets_url( 'img/alipay.svg' );
28
- $this->order_button_text = $this->get_order_button_text( __( 'Alipay', 'woo-stripe-payment' ) );
29
- parent::__construct();
30
- }
31
-
32
- /**
33
- * @param string $currency
34
- * @param string $billing_country
35
- *
36
- * @return bool
37
- */
38
- public function validate_local_payment_available( $currency, $billing_country ) {
39
- $country = wc_stripe()->account_settings->get_option( 'country' );
40
- $default_currency = wc_stripe()->account_settings->get_option( 'default_currency' );
41
-
42
- // https://stripe.com/docs/sources/alipay#create-source
43
- // Currency must be one of the allowed values
44
- if ( in_array( $currency, $this->currencies ) ) {
45
- // If merchant's country is DK, NO, SE, or CH, currency must be EUR.
46
- if ( in_array( $country, array( 'DK', 'NO', 'SE', 'CH' ) ) ) {
47
- return $currency === 'EUR';
48
- } else {
49
- // For all other countries, Ali pay is available if currency is CNY or
50
- // currency matches merchant's default currency
51
- return $currency === 'CNY' || $currency === $default_currency;
52
- }
53
- }
54
-
55
- return false;
56
- }
57
-
58
- protected function get_payment_description() {
59
- return __( 'Gateway will appear when store currency is CNY, or currency matches merchant\'s
60
- default Stripe currency. For merchants located in DK, NO, SE, & CH, currency must be EUR.', 'woo-stripe-payment' );
61
- }
62
- }
63
-
1
+ <?php
2
+ defined( 'ABSPATH' ) || exit();
3
+
4
+ if ( ! class_exists( 'WC_Payment_Gateway_Stripe_Local_Payment' ) ) {
5
+ return;
6
+ }
7
+
8
+ /**
9
+ *
10
+ * @package Stripe/Gateways
11
+ * @author PaymentPlugins
12
+ *
13
+ */
14
+ class WC_Payment_Gateway_Stripe_Alipay extends WC_Payment_Gateway_Stripe_Local_Payment {
15
+
16
+ use WC_Stripe_Local_Payment_Charge_Trait;
17
+
18
+ public function __construct() {
19
+ $this->local_payment_type = 'alipay';
20
+ $this->currencies = array( 'AUD', 'CAD', 'EUR', 'GBP', 'HKD', 'JPY', 'SGD', 'USD', 'CNY', 'NZD', 'MYR' );
21
+ $this->id = 'stripe_alipay';
22
+ $this->tab_title = __( 'Alipay', 'woo-stripe-payment' );
23
+ $this->template_name = 'local-payment.php';
24
+ $this->token_type = 'Stripe_Local';
25
+ $this->method_title = __( 'Alipay', 'woo-stripe-payment' );
26
+ $this->method_description = __( 'Alipay gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
27
+ $this->icon = stripe_wc()->assets_url( 'img/alipay.svg' );
28
+ $this->order_button_text = $this->get_order_button_text( __( 'Alipay', 'woo-stripe-payment' ) );
29
+ parent::__construct();
30
+ }
31
+
32
+ /**
33
+ * @param string $currency
34
+ * @param string $billing_country
35
+ *
36
+ * @return bool
37
+ */
38
+ public function validate_local_payment_available( $currency, $billing_country ) {
39
+ $country = stripe_wc()->account_settings->get_option( 'country' );
40
+ $default_currency = stripe_wc()->account_settings->get_option( 'default_currency' );
41
+
42
+ // https://stripe.com/docs/sources/alipay#create-source
43
+ // Currency must be one of the allowed values
44
+ if ( in_array( $currency, $this->currencies ) ) {
45
+ // If merchant's country is DK, NO, SE, or CH, currency must be EUR.
46
+ if ( in_array( $country, array( 'DK', 'NO', 'SE', 'CH' ) ) ) {
47
+ return $currency === 'EUR';
48
+ } else {
49
+ // For all other countries, Ali pay is available if currency is CNY or
50
+ // currency matches merchant's default currency
51
+ return $currency === 'CNY' || $currency === $default_currency;
52
+ }
53
+ }
54
+
55
+ return false;
56
+ }
57
+
58
+ protected function get_payment_description() {
59
+ return __( 'Gateway will appear when store currency is CNY, or currency matches merchant\'s
60
+ default Stripe currency. For merchants located in DK, NO, SE, & CH, currency must be EUR.', 'woo-stripe-payment' );
61
+ }
62
+ }
63
+
includes/gateways/class-wc-payment-gateway-stripe-applepay.php CHANGED
@@ -26,7 +26,7 @@ class WC_Payment_Gateway_Stripe_ApplePay extends WC_Payment_Gateway_Stripe {
26
  $this->method_description = __( 'Apple Pay gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
27
  $this->has_digital_wallet = true;
28
  parent::__construct();
29
- $this->icon = wc_stripe()->assets_url( 'img/applepay.svg' );
30
  }
31
 
32
  public function init_supports() {
@@ -44,7 +44,7 @@ class WC_Payment_Gateway_Stripe_ApplePay extends WC_Payment_Gateway_Stripe {
44
  array(
45
  $scripts->get_handle( 'wc-stripe' )
46
  ),
47
- wc_stripe()->version(),
48
  true
49
  );
50
  $scripts->localize_script( 'applepay-product', $this->get_localized_params() );
@@ -57,7 +57,7 @@ class WC_Payment_Gateway_Stripe_ApplePay extends WC_Payment_Gateway_Stripe {
57
  array(
58
  $scripts->get_handle( 'wc-stripe' )
59
  ),
60
- wc_stripe()->version(),
61
  true
62
  );
63
  $scripts->localize_script( 'applepay-cart', $this->get_localized_params() );
@@ -70,7 +70,7 @@ class WC_Payment_Gateway_Stripe_ApplePay extends WC_Payment_Gateway_Stripe {
70
  array(
71
  $scripts->get_handle( 'wc-stripe' )
72
  ),
73
- wc_stripe()->version(),
74
  true
75
  );
76
  $scripts->localize_script( 'applepay-checkout', $this->get_localized_params() );
26
  $this->method_description = __( 'Apple Pay gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
27
  $this->has_digital_wallet = true;
28
  parent::__construct();
29
+ $this->icon = stripe_wc()->assets_url( 'img/applepay.svg' );
30
  }
31
 
32
  public function init_supports() {
44
  array(
45
  $scripts->get_handle( 'wc-stripe' )
46
  ),
47
+ stripe_wc()->version(),
48
  true
49
  );
50
  $scripts->localize_script( 'applepay-product', $this->get_localized_params() );
57
  array(
58
  $scripts->get_handle( 'wc-stripe' )
59
  ),
60
+ stripe_wc()->version(),
61
  true
62
  );
63
  $scripts->localize_script( 'applepay-cart', $this->get_localized_params() );
70
  array(
71
  $scripts->get_handle( 'wc-stripe' )
72
  ),
73
+ stripe_wc()->version(),
74
  true
75
  );
76
  $scripts->localize_script( 'applepay-checkout', $this->get_localized_params() );
includes/gateways/class-wc-payment-gateway-stripe-bancontact.php CHANGED
@@ -1,33 +1,33 @@
1
- <?php
2
- defined( 'ABSPATH' ) || exit();
3
-
4
- if ( ! class_exists( 'WC_Payment_Gateway_Stripe_Local_Payment' ) ) {
5
- return;
6
- }
7
-
8
- /**
9
- *
10
- * @package Stripe/Gateways
11
- * @author PaymentPlugins
12
- *
13
- */
14
- class WC_Payment_Gateway_Stripe_Bancontact extends WC_Payment_Gateway_Stripe_Local_Payment {
15
-
16
- use WC_Stripe_Local_Payment_Charge_Trait;
17
-
18
- public function __construct() {
19
- $this->synchronous = false;
20
- $this->local_payment_type = 'bancontact';
21
- $this->currencies = array( 'EUR' );
22
- $this->countries = array( 'BE' );
23
- $this->id = 'stripe_bancontact';
24
- $this->tab_title = __( 'Bancontact', 'woo-stripe-payment' );
25
- $this->template_name = 'local-payment.php';
26
- $this->token_type = 'Stripe_Local';
27
- $this->method_title = __( 'Bancontact', 'woo-stripe-payment' );
28
- $this->method_description = __( 'Bancontact gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
29
- $this->icon = wc_stripe()->assets_url( 'img/bancontact.svg' );
30
- $this->order_button_text = $this->get_order_button_text( __( 'Bancontact', 'woo-stripe-payment' ) );
31
- parent::__construct();
32
- }
33
- }
1
+ <?php
2
+ defined( 'ABSPATH' ) || exit();
3
+
4
+ if ( ! class_exists( 'WC_Payment_Gateway_Stripe_Local_Payment' ) ) {
5
+ return;
6
+ }
7
+
8
+ /**
9
+ *
10
+ * @package Stripe/Gateways
11
+ * @author PaymentPlugins
12
+ *
13
+ */
14
+ class WC_Payment_Gateway_Stripe_Bancontact extends WC_Payment_Gateway_Stripe_Local_Payment {
15
+
16
+ use WC_Stripe_Local_Payment_Charge_Trait;
17
+
18
+ public function __construct() {
19
+ $this->synchronous = false;
20
+ $this->local_payment_type = 'bancontact';
21
+ $this->currencies = array( 'EUR' );
22
+ $this->countries = array( 'BE' );
23
+ $this->id = 'stripe_bancontact';
24
+ $this->tab_title = __( 'Bancontact', 'woo-stripe-payment' );
25
+ $this->template_name = 'local-payment.php';
26
+ $this->token_type = 'Stripe_Local';
27
+ $this->method_title = __( 'Bancontact', 'woo-stripe-payment' );
28
+ $this->method_description = __( 'Bancontact gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
29
+ $this->icon = stripe_wc()->assets_url( 'img/bancontact.svg' );
30
+ $this->order_button_text = $this->get_order_button_text( __( 'Bancontact', 'woo-stripe-payment' ) );
31
+ parent::__construct();
32
+ }
33
+ }
includes/gateways/class-wc-payment-gateway-stripe-becs.php CHANGED
@@ -1,40 +1,40 @@
1
- <?php
2
- defined( 'ABSPATH' ) || exit();
3
-
4
- /**
5
- * Class WC_Payment_Gateway_Stripe_Becs
6
- *
7
- * @since 3.1.7
8
- * @package Stripe/Gateways
9
- * @author PaymentPlugins
10
- */
11
- class WC_Payment_Gateway_Stripe_BECS extends WC_Payment_Gateway_Stripe_Local_Payment {
12
-
13
- use WC_Stripe_Local_Payment_Intent_Trait;
14
-
15
- protected $payment_method_type = 'au_becs_debit';
16
-
17
- public function __construct() {
18
- $this->local_payment_type = 'au_becs_debit';
19
- $this->currencies = array( 'AUD' );
20
- $this->countries = array( 'AU' );
21
- $this->id = 'stripe_becs';
22
- $this->tab_title = __( 'BECS', 'woo-stripe-payment' );
23
- $this->method_title = __( 'BECS', 'woo-stripe-payment' );
24
- $this->method_description = __( 'BECS direct debit gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
25
- $this->icon = ''; //wc_stripe()->assets_url( 'img/becs.svg' );
26
- $this->order_button_text = $this->get_order_button_text( __( 'BECS', 'woo-stripe-payment' ) );
27
- parent::__construct();
28
-
29
- $this->local_payment_description = sprintf(
30
- __(
31
- 'By providing your bank account details and confirming this payment, you agree to this
32
- Direct Debit Request and the %sDirect Debit Request service agreement%s, and authorise Stripe Payments Australia Pty Ltd ACN 160 180 343 Direct
33
- Debit User ID number 507156 (“Stripe”) to debit your account through the Bulk Electronic Clearing System (BECS) on behalf of Stripe Press
34
- (the "Merchant") for any amounts separately communicated to you by the Merchant. You certify that you are either an account holder or an
35
- authorised signatory on the account listed above.',
36
- 'woo-stripe-payment'
37
- )
38
- , '<a href="https://stripe.com/au-becs-dd-service-agreement/legal" target="_blank">', '</a>' );
39
- }
40
- }
1
+ <?php
2
+ defined( 'ABSPATH' ) || exit();
3
+
4
+ /**
5
+ * Class WC_Payment_Gateway_Stripe_Becs
6
+ *
7
+ * @since 3.1.7
8
+ * @package Stripe/Gateways
9
+ * @author PaymentPlugins
10
+ */
11
+ class WC_Payment_Gateway_Stripe_BECS extends WC_Payment_Gateway_Stripe_Local_Payment {
12
+
13
+ use WC_Stripe_Local_Payment_Intent_Trait;
14
+
15
+ protected $payment_method_type = 'au_becs_debit';
16
+
17
+ public function __construct() {
18
+ $this->local_payment_type = 'au_becs_debit';
19
+ $this->currencies = array( 'AUD' );
20
+ $this->countries = array( 'AU' );
21
+ $this->id = 'stripe_becs';
22
+ $this->tab_title = __( 'BECS', 'woo-stripe-payment' );
23
+ $this->method_title = __( 'BECS', 'woo-stripe-payment' );
24
+ $this->method_description = __( 'BECS direct debit gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
25
+ $this->icon = ''; //stripe_wc()->assets_url( 'img/becs.svg' );
26
+ $this->order_button_text = $this->get_order_button_text( __( 'BECS', 'woo-stripe-payment' ) );
27
+ parent::__construct();
28
+
29
+ $this->local_payment_description = sprintf(
30
+ __(
31
+ 'By providing your bank account details and confirming this payment, you agree to this
32
+ Direct Debit Request and the %sDirect Debit Request service agreement%s, and authorise Stripe Payments Australia Pty Ltd ACN 160 180 343 Direct
33
+ Debit User ID number 507156 (“Stripe”) to debit your account through the Bulk Electronic Clearing System (BECS) on behalf of Stripe Press
34
+ (the "Merchant") for any amounts separately communicated to you by the Merchant. You certify that you are either an account holder or an
35
+ authorised signatory on the account listed above.',
36
+ 'woo-stripe-payment'
37
+ )
38
+ , '<a href="https://stripe.com/au-becs-dd-service-agreement/legal" target="_blank">', '</a>' );
39
+ }
40
+ }
includes/gateways/class-wc-payment-gateway-stripe-cc.php CHANGED
@@ -28,8 +28,9 @@ class WC_Payment_Gateway_Stripe_CC extends WC_Payment_Gateway_Stripe {
28
  return wc_stripe_get_template_html(
29
  'card-icons.php',
30
  array(
31
- 'cards' => $this->get_option( 'cards' ),
32
- 'style' => $this->get_option( 'icon_style' ),
 
33
  )
34
  );
35
  }
@@ -57,13 +58,13 @@ class WC_Payment_Gateway_Stripe_CC extends WC_Payment_Gateway_Stripe {
57
  'custom_form' => $this->is_custom_form_active(),
58
  'html' => array( 'card_brand' => sprintf( '<img id="wc-stripe-card" src="%s" />', $this->get_custom_form()['cardBrand'] ) ),
59
  'cards' => array(
60
- 'visa' => wc_stripe()->assets_url( 'img/cards/visa.svg' ),
61
- 'amex' => wc_stripe()->assets_url( 'img/cards/amex.svg' ),
62
- 'mastercard' => wc_stripe()->assets_url( 'img/cards/mastercard.svg' ),
63
- 'discover' => wc_stripe()->assets_url( 'img/cards/discover.svg' ),
64
- 'diners' => wc_stripe()->assets_url( 'img/cards/diners.svg' ),
65
- 'jcb' => wc_stripe()->assets_url( 'img/cards/jcb.svg' ),
66
- 'unionpay' => wc_stripe()->assets_url( 'img/cards/china_union_pay.svg' ),
67
  'unknown' => $this->get_custom_form()['cardBrand'],
68
  ),
69
  'postal_regex' => $this->get_postal_code_regex(),
28
  return wc_stripe_get_template_html(
29
  'card-icons.php',
30
  array(
31
+ 'cards' => $this->get_option( 'cards' ),
32
+ 'style' => $this->get_option( 'icon_style' ),
33
+ 'assets_url' => stripe_wc()->assets_url()
34
  )
35
  );
36
  }
58
  'custom_form' => $this->is_custom_form_active(),
59
  'html' => array( 'card_brand' => sprintf( '<img id="wc-stripe-card" src="%s" />', $this->get_custom_form()['cardBrand'] ) ),
60
  'cards' => array(
61
+ 'visa' => stripe_wc()->assets_url( 'img/cards/visa.svg' ),
62
+ 'amex' => stripe_wc()->assets_url( 'img/cards/amex.svg' ),
63
+ 'mastercard' => stripe_wc()->assets_url( 'img/cards/mastercard.svg' ),
64
+ 'discover' => stripe_wc()->assets_url( 'img/cards/discover.svg' ),
65
+ 'diners' => stripe_wc()->assets_url( 'img/cards/diners.svg' ),
66
+ 'jcb' => stripe_wc()->assets_url( 'img/cards/jcb.svg' ),
67
+ 'unionpay' => stripe_wc()->assets_url( 'img/cards/china_union_pay.svg' ),
68
  'unknown' => $this->get_custom_form()['cardBrand'],
69
  ),
70
  'postal_regex' => $this->get_postal_code_regex(),
includes/gateways/class-wc-payment-gateway-stripe-eps.php CHANGED
@@ -1,32 +1,32 @@
1
- <?php
2
- defined( 'ABSPATH' ) || exit();
3
-
4
- if ( ! class_exists( 'WC_Payment_Gateway_Stripe_Local_Payment' ) ) {
5
- return;
6
- }
7
-
8
- /**
9
- *
10
- * @package Stripe/Gateways
11
- * @author PaymentPlugins
12
- *
13
- */
14
- class WC_Payment_Gateway_Stripe_EPS extends WC_Payment_Gateway_Stripe_Local_Payment {
15
-
16
- use WC_Stripe_Local_Payment_Charge_Trait;
17
-
18
- public function __construct() {
19
- $this->local_payment_type = 'eps';
20
- $this->currencies = array( 'EUR' );
21
- $this->countries = array( 'AT' );
22
- $this->id = 'stripe_eps';
23
- $this->tab_title = __( 'EPS', 'woo-stripe-payment' );
24
- $this->template_name = 'local-payment.php';
25
- $this->token_type = 'Stripe_Local';
26
- $this->method_title = __( 'EPS', 'woo-stripe-payment' );
27
- $this->method_description = __( 'EPS gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
28
- $this->icon = wc_stripe()->assets_url( 'img/eps.svg' );
29
- $this->order_button_text = $this->get_order_button_text( __( 'EPS', 'woo-stripe-payment' ) );
30
- parent::__construct();
31
- }
32
- }
1
+ <?php
2
+ defined( 'ABSPATH' ) || exit();
3
+
4
+ if ( ! class_exists( 'WC_Payment_Gateway_Stripe_Local_Payment' ) ) {
5
+ return;
6
+ }
7
+
8
+ /**
9
+ *
10
+ * @package Stripe/Gateways
11
+ * @author PaymentPlugins
12
+ *
13
+ */
14
+ class WC_Payment_Gateway_Stripe_EPS extends WC_Payment_Gateway_Stripe_Local_Payment {
15
+
16
+ use WC_Stripe_Local_Payment_Charge_Trait;
17
+
18
+ public function __construct() {
19
+ $this->local_payment_type = 'eps';
20
+ $this->currencies = array( 'EUR' );
21
+ $this->countries = array( 'AT' );
22
+ $this->id = 'stripe_eps';
23
+ $this->tab_title = __( 'EPS', 'woo-stripe-payment' );
24
+ $this->template_name = 'local-payment.php';
25
+ $this->token_type = 'Stripe_Local';
26
+ $this->method_title = __( 'EPS', 'woo-stripe-payment' );
27
+ $this->method_description = __( 'EPS gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
28
+ $this->icon = stripe_wc()->assets_url( 'img/eps.svg' );
29
+ $this->order_button_text = $this->get_order_button_text( __( 'EPS', 'woo-stripe-payment' ) );
30
+ parent::__construct();
31
+ }
32
+ }
includes/gateways/class-wc-payment-gateway-stripe-fpx.php CHANGED
@@ -1,39 +1,39 @@
1
- <?php
2
- defined( 'ABSPATH' ) || exit();
3
-
4
- if ( ! class_exists( 'WC_Payment_Gateway_Stripe_Local_Payment' ) ) {
5
- return;
6
- }
7
-
8
- /**
9
- *
10
- * @package Stripe/Gateways
11
- * @author PaymentPlugins
12
- *
13
- */
14
- class WC_Payment_Gateway_Stripe_FPX extends WC_Payment_Gateway_Stripe_Local_Payment {
15
-
16
- use WC_Stripe_Local_Payment_Intent_Trait;
17
-
18
- protected $payment_method_type = 'fpx';
19
-
20
- public function __construct() {
21
- $this->local_payment_type = 'fpx';
22
- $this->currencies = array( 'MYR' );
23
- $this->countries = array();
24
- $this->id = 'stripe_fpx';
25
- $this->tab_title = __( 'FPX', 'woo-stripe-payment' );
26
- $this->method_title = __( 'FPX', 'woo-stripe-payment' );
27
- $this->method_description = __( 'FPX gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
28
- $this->icon = wc_stripe()->assets_url( 'img/fpx.svg' );
29
- $this->order_button_text = $this->get_order_button_text( __( 'FPX', 'woo-stripe-payment' ) );
30
- parent::__construct();
31
- }
32
-
33
- public function get_element_params() {
34
- $params = parent::get_element_params();
35
- $params['accountHolderType'] = 'individual';
36
-
37
- return $params;
38
- }
39
- }
1
+ <?php
2
+ defined( 'ABSPATH' ) || exit();
3
+
4
+ if ( ! class_exists( 'WC_Payment_Gateway_Stripe_Local_Payment' ) ) {
5
+ return;
6
+ }
7
+
8
+ /**
9
+ *
10
+ * @package Stripe/Gateways
11
+ * @author PaymentPlugins
12
+ *
13
+ */
14
+ class WC_Payment_Gateway_Stripe_FPX extends WC_Payment_Gateway_Stripe_Local_Payment {
15
+
16
+ use WC_Stripe_Local_Payment_Intent_Trait;
17
+
18
+ protected $payment_method_type = 'fpx';
19
+
20
+ public function __construct() {
21
+ $this->local_payment_type = 'fpx';
22
+ $this->currencies = array( 'MYR' );
23
+ $this->countries = array();
24
+ $this->id = 'stripe_fpx';
25
+ $this->tab_title = __( 'FPX', 'woo-stripe-payment' );
26
+ $this->method_title = __( 'FPX', 'woo-stripe-payment' );
27
+ $this->method_description = __( 'FPX gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
28
+ $this->icon = stripe_wc()->assets_url( 'img/fpx.svg' );
29
+ $this->order_button_text = $this->get_order_button_text( __( 'FPX', 'woo-stripe-payment' ) );
30
+ parent::__construct();
31
+ }
32
+
33
+ public function get_element_params() {
34
+ $params = parent::get_element_params();
35
+ $params['accountHolderType'] = 'individual';
36
+
37
+ return $params;
38
+ }
39
+ }
includes/gateways/class-wc-payment-gateway-stripe-giropay.php CHANGED
@@ -1,32 +1,32 @@
1
- <?php
2
- defined( 'ABSPATH' ) || exit();
3
-
4
- if ( ! class_exists( 'WC_Payment_Gateway_Stripe_Local_Payment' ) ) {
5
- return;
6
- }
7
-
8
- /**
9
- *
10
- * @package Stripe/Gateways
11
- * @author PaymentPlugins
12
- *
13
- */
14
- class WC_Payment_Gateway_Stripe_Giropay extends WC_Payment_Gateway_Stripe_Local_Payment {
15
-
16
- use WC_Stripe_Local_Payment_Charge_Trait;
17
-
18
- public function __construct() {
19
- $this->local_payment_type = 'giropay';
20
- $this->currencies = array( 'EUR' );
21
- $this->countries = array( 'DE' );
22
- $this->id = 'stripe_giropay';
23
- $this->tab_title = __( 'Giropay', 'woo-stripe-payment' );
24
- $this->template_name = 'local-payment.php';
25
- $this->token_type = 'Stripe_Local';
26
- $this->method_title = __( 'Giropay', 'woo-stripe-payment' );
27
- $this->method_description = __( 'Giropay gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
28
- $this->icon = wc_stripe()->assets_url( 'img/giropay.svg' );
29
- $this->order_button_text = $this->get_order_button_text( __( 'Giropay', 'woo-stripe-payment' ) );
30
- parent::__construct();
31
- }
32
- }
1
+ <?php
2
+ defined( 'ABSPATH' ) || exit();
3
+
4
+ if ( ! class_exists( 'WC_Payment_Gateway_Stripe_Local_Payment' ) ) {
5
+ return;
6
+ }
7
+
8
+ /**
9
+ *
10
+ * @package Stripe/Gateways
11
+ * @author PaymentPlugins
12
+ *
13
+ */
14
+ class WC_Payment_Gateway_Stripe_Giropay extends WC_Payment_Gateway_Stripe_Local_Payment {
15
+
16
+ use WC_Stripe_Local_Payment_Charge_Trait;
17
+
18
+ public function __construct() {
19
+ $this->local_payment_type = 'giropay';
20
+ $this->currencies = array( 'EUR' );
21
+ $this->countries = array( 'DE' );
22
+ $this->id = 'stripe_giropay';
23
+ $this->tab_title = __( 'Giropay', 'woo-stripe-payment' );
24
+ $this->template_name = 'local-payment.php';
25
+ $this->token_type = 'Stripe_Local';
26
+ $this->method_title = __( 'Giropay', 'woo-stripe-payment' );
27
+ $this->method_description = __( 'Giropay gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
28
+ $this->icon = stripe_wc()->assets_url( 'img/giropay.svg' );
29
+ $this->order_button_text = $this->get_order_button_text( __( 'Giropay', 'woo-stripe-payment' ) );
30
+ parent::__construct();
31
+ }
32
+ }
includes/gateways/class-wc-payment-gateway-stripe-googlepay.php CHANGED
@@ -24,7 +24,7 @@ class WC_Payment_Gateway_Stripe_GooglePay extends WC_Payment_Gateway_Stripe {
24
  $this->method_description = __( 'Google Pay gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
25
  $this->has_digital_wallet = true;
26
  parent::__construct();
27
- $this->icon = wc_stripe()->assets_url( 'img/' . $this->get_option( 'icon' ) . '.svg' );
28
  }
29
 
30
  public function init_supports() {
@@ -43,7 +43,7 @@ class WC_Payment_Gateway_Stripe_GooglePay extends WC_Payment_Gateway_Stripe {
43
  $scripts->get_handle( 'wc-stripe' ),
44
  $scripts->get_handle( 'gpay' ),
45
  ),
46
- wc_stripe()->version(),
47
  true
48
  );
49
  $scripts->localize_script( 'googlepay-checkout', $this->get_localized_params() );
@@ -57,7 +57,7 @@ class WC_Payment_Gateway_Stripe_GooglePay extends WC_Payment_Gateway_Stripe {
57
  $scripts->get_handle( 'wc-stripe' ),
58
  $scripts->get_handle( 'gpay' ),
59
  ),
60
- wc_stripe()->version(),
61
  true
62
  );
63
  $scripts->localize_script( 'googlepay-product', $this->get_localized_params() );
@@ -71,22 +71,22 @@ class WC_Payment_Gateway_Stripe_GooglePay extends WC_Payment_Gateway_Stripe {
71
  $scripts->get_handle( 'wc-stripe' ),
72
  $scripts->get_handle( 'gpay' ),
73
  ),
74
- wc_stripe()->version(),
75
  true
76
  );
77
  $scripts->localize_script( 'googlepay-cart', $this->get_localized_params() );
78
  }
79
 
80
  public function enqueue_admin_scripts() {
81
- wp_register_script( 'gpay-external', wc_stripe()->scripts()->global_scripts['gpay'], array(), wc_stripe()->version(), true );
82
  wp_enqueue_script(
83
  'wc-stripe-gpay-admin',
84
- wc_stripe()->assets_url( 'js/admin/googlepay.js' ),
85
  array(
86
  'gpay-external',
87
  'wc-stripe-admin-settings',
88
  ),
89
- wc_stripe()->version(),
90
  true
91
  );
92
  }
@@ -101,7 +101,7 @@ class WC_Payment_Gateway_Stripe_GooglePay extends WC_Payment_Gateway_Stripe {
101
  'button_color' => $this->get_option( 'button_color' ),
102
  'button_style' => $this->get_option( 'button_style' ),
103
  'total_price_label' => __( 'Total', 'woo-stripe-payment' ),
104
- 'routes' => array( 'payment_data' => WC_Stripe_Rest_API::get_endpoint( wc_stripe()->rest_api->googlepay->rest_uri( 'shipping-data' ) ) ),
105
  'messages' => array( 'invalid_amount' => __( 'Please update you product quantity before using Google Pay.', 'woo-stripe-payment' ) )
106
  )
107
  );
24
  $this->method_description = __( 'Google Pay gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
25
  $this->has_digital_wallet = true;
26
  parent::__construct();
27
+ $this->icon = stripe_wc()->assets_url( 'img/' . $this->get_option( 'icon' ) . '.svg' );
28
  }
29
 
30
  public function init_supports() {
43
  $scripts->get_handle( 'wc-stripe' ),
44
  $scripts->get_handle( 'gpay' ),
45
  ),
46
+ stripe_wc()->version(),
47
  true
48
  );
49
  $scripts->localize_script( 'googlepay-checkout', $this->get_localized_params() );
57
  $scripts->get_handle( 'wc-stripe' ),
58
  $scripts->get_handle( 'gpay' ),
59
  ),
60
+ stripe_wc()->version(),
61
  true
62
  );
63
  $scripts->localize_script( 'googlepay-product', $this->get_localized_params() );
71
  $scripts->get_handle( 'wc-stripe' ),
72
  $scripts->get_handle( 'gpay' ),
73
  ),
74
+ stripe_wc()->version(),
75
  true
76
  );
77
  $scripts->localize_script( 'googlepay-cart', $this->get_localized_params() );
78
  }
79
 
80
  public function enqueue_admin_scripts() {
81
+ wp_register_script( 'gpay-external', stripe_wc()->scripts()->global_scripts['gpay'], array(), stripe_wc()->version(), true );
82
  wp_enqueue_script(
83
  'wc-stripe-gpay-admin',
84
+ stripe_wc()->assets_url( 'js/admin/googlepay.js' ),
85
  array(
86
  'gpay-external',
87
  'wc-stripe-admin-settings',
88
  ),
89
+ stripe_wc()->version(),
90
  true
91
  );
92
  }
101
  'button_color' => $this->get_option( 'button_color' ),
102
  'button_style' => $this->get_option( 'button_style' ),
103
  'total_price_label' => __( 'Total', 'woo-stripe-payment' ),
104
+ 'routes' => array( 'payment_data' => WC_Stripe_Rest_API::get_endpoint( stripe_wc()->rest_api->googlepay->rest_uri( 'shipping-data' ) ) ),
105
  'messages' => array( 'invalid_amount' => __( 'Please update you product quantity before using Google Pay.', 'woo-stripe-payment' ) )
106
  )
107
  );
includes/gateways/class-wc-payment-gateway-stripe-grabpay.php CHANGED
@@ -1,32 +1,32 @@
1
- <?php
2
- defined( 'ABSPATH' ) || exit();
3
-
4
- if ( ! class_exists( 'WC_Payment_Gateway_Stripe_Local_Payment' ) ) {
5
- return;
6
- }
7
-
8
- /**
9
- *
10
- * @package Stripe/Gateways
11
- * @author PaymentPlugins
12
- *
13
- */
14
- class WC_Payment_Gateway_Stripe_GrabPay extends WC_Payment_Gateway_Stripe_Local_Payment {
15
-
16
- protected $payment_method_type = 'grabpay';
17
-
18
- use WC_Stripe_Local_Payment_Intent_Trait;
19
-
20
- public function __construct() {
21
- $this->local_payment_type = 'grabpay';
22
- $this->currencies = array( 'SGD' );
23
- $this->countries = array();
24
- $this->id = 'stripe_grabpay';
25
- $this->tab_title = __( 'GrabPay', 'woo-stripe-payment' );
26
- $this->method_title = __( 'GrabPay', 'woo-stripe-payment' );
27
- $this->method_description = __( 'GrabPay gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
28
- $this->icon = wc_stripe()->assets_url( 'img/grabpay.svg' );
29
- $this->order_button_text = $this->get_order_button_text( __( 'GrabPay', 'woo-stripe-payment' ) );
30
- parent::__construct();
31
- }
32
- }
1
+ <?php
2
+ defined( 'ABSPATH' ) || exit();
3
+
4
+ if ( ! class_exists( 'WC_Payment_Gateway_Stripe_Local_Payment' ) ) {
5
+ return;
6
+ }
7
+
8
+ /**
9
+ *
10
+ * @package Stripe/Gateways
11
+ * @author PaymentPlugins
12
+ *
13
+ */
14
+ class WC_Payment_Gateway_Stripe_GrabPay extends WC_Payment_Gateway_Stripe_Local_Payment {
15
+
16
+ protected $payment_method_type = 'grabpay';
17
+
18
+ use WC_Stripe_Local_Payment_Intent_Trait;
19
+
20
+ public function __construct() {
21
+ $this->local_payment_type = 'grabpay';
22
+ $this->currencies = array( 'SGD' );
23
+ $this->countries = array();
24
+ $this->id = 'stripe_grabpay';
25
+ $this->tab_title = __( 'GrabPay', 'woo-stripe-payment' );
26
+ $this->method_title = __( 'GrabPay', 'woo-stripe-payment' );
27
+ $this->method_description = __( 'GrabPay gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
28
+ $this->icon = stripe_wc()->assets_url( 'img/grabpay.svg' );
29
+ $this->order_button_text = $this->get_order_button_text( __( 'GrabPay', 'woo-stripe-payment' ) );
30
+ parent::__construct();
31
+ }
32
+ }
includes/gateways/class-wc-payment-gateway-stripe-ideal.php CHANGED
@@ -1,32 +1,32 @@
1
- <?php
2
- defined( 'ABSPATH' ) || exit();
3
-
4
- if ( ! class_exists( 'WC_Payment_Gateway_Stripe_Local_Payment' ) ) {
5
- return;
6
- }
7
-
8
- /**
9
- *
10
- * @package Stripe/Gateways
11
- * @author PaymentPlugins
12
- *
13
- */
14
- class WC_Payment_Gateway_Stripe_Ideal extends WC_Payment_Gateway_Stripe_Local_Payment {
15
-
16
- protected $payment_method_type = 'ideal';
17
-
18
- use WC_Stripe_Local_Payment_Intent_Trait;
19
-
20
- public function __construct() {
21
- $this->local_payment_type = 'ideal';
22
- $this->currencies = array( 'EUR' );
23
- $this->countries = array( 'NL' );
24
- $this->id = 'stripe_ideal';
25
- $this->tab_title = __( 'iDEAL', 'woo-stripe-payment' );
26
- $this->method_title = __( 'iDEAL', 'woo-stripe-payment' );
27
- $this->method_description = __( 'Ideal gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
28
- $this->icon = wc_stripe()->assets_url( 'img/ideal.svg' );
29
- $this->order_button_text = $this->get_order_button_text( __( 'iDEAL', 'woo-stripe-payment' ) );
30
- parent::__construct();
31
- }
32
- }
1
+ <?php
2
+ defined( 'ABSPATH' ) || exit();
3
+
4
+ if ( ! class_exists( 'WC_Payment_Gateway_Stripe_Local_Payment' ) ) {
5
+ return;
6
+ }
7
+
8
+ /**
9
+ *
10
+ * @package Stripe/Gateways
11
+ * @author PaymentPlugins
12
+ *
13
+ */
14
+ class WC_Payment_Gateway_Stripe_Ideal extends WC_Payment_Gateway_Stripe_Local_Payment {
15
+
16
+ protected $payment_method_type = 'ideal';
17
+
18
+ use WC_Stripe_Local_Payment_Intent_Trait;
19
+
20
+ public function __construct() {
21
+ $this->local_payment_type = 'ideal';
22
+ $this->currencies = array( 'EUR' );
23
+ $this->countries = array( 'NL' );
24
+ $this->id = 'stripe_ideal';
25
+ $this->tab_title = __( 'iDEAL', 'woo-stripe-payment' );
26
+ $this->method_title = __( 'iDEAL', 'woo-stripe-payment' );
27
+ $this->method_description = __( 'Ideal gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
28
+ $this->icon = stripe_wc()->assets_url( 'img/ideal.svg' );
29
+ $this->order_button_text = $this->get_order_button_text( __( 'iDEAL', 'woo-stripe-payment' ) );
30
+ parent::__construct();
31
+ }
32
+ }
includes/gateways/class-wc-payment-gateway-stripe-klarna.php CHANGED
@@ -24,7 +24,7 @@ class WC_Payment_Gateway_Stripe_Klarna extends WC_Payment_Gateway_Stripe_Local_P
24
  $this->token_type = 'Stripe_Local';
25
  $this->method_title = __( 'Klarna', 'woo-stripe-payment' );
26
  $this->method_description = __( 'Klarna gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
27
- $this->icon = wc_stripe()->assets_url( 'img/klarna.svg' );
28
  $this->order_button_text = $this->get_order_button_text( __( 'Klarna', 'woo-stripe-payment' ) );
29
  parent::__construct();
30
  $this->template_name = 'klarna.php';
@@ -57,25 +57,15 @@ class WC_Payment_Gateway_Stripe_Klarna extends WC_Payment_Gateway_Stripe_Local_P
57
  return false;
58
  }
59
 
60
- /**
61
- *
62
- * {@inheritDoc}
63
- *
64
- * @see WC_Payment_Gateway_Stripe::payment_fields()
65
- */
66
- public function payment_fields() {
67
- // this might be an update checkout request. If so, update the source if it exists
68
- if ( is_ajax() && ( $order_id = absint( WC()->session->get( 'order_awaiting_payment' ) ) ) ) {
69
- $order = wc_get_order( $order_id );
70
- if ( $order->get_payment_method() === $this->id && ( $source_id = $order->get_meta( WC_Stripe_Constants::SOURCE_ID, true ) ) ) {
71
- $this->payment_object->get_gateway()->sources->mode( wc_stripe_order_mode( $order ) )->update( $source_id, $this->get_update_source_args( $order ) );
72
- }
73
- }
74
- parent::payment_fields();
75
  }
76
 
77
  public function enqueue_checkout_scripts( $scripts ) {
78
- wc_stripe()->scripts()->enqueue_script( 'klarna', 'https://x.klarnacdn.net/kp/lib/v1/api.js', array(), wc_stripe()->version(), true );
79
  parent::enqueue_checkout_scripts( $scripts );
80
  }
81
 
@@ -94,6 +84,13 @@ class WC_Payment_Gateway_Stripe_Klarna extends WC_Payment_Gateway_Stripe_Local_P
94
  'woo-stripe-payment'
95
  ),
96
  ),
 
 
 
 
 
 
 
97
  ),
98
  parent::get_local_payment_settings()
99
  );
@@ -107,44 +104,38 @@ class WC_Payment_Gateway_Stripe_Klarna extends WC_Payment_Gateway_Stripe_Local_P
107
  }
108
 
109
  /**
110
- *
111
- * {@inheritDoc}
112
- *
113
- * @see WC_Payment_Gateway_Stripe_Local_Payment::get_source_args()
114
  */
115
- public function get_source_args( $order, $update = false ) {
116
- if ( $update ) {
117
- /*
118
- * Use customer if this is an update since customer object has been updated
119
- * with all checkout form data in the update_order_review process.
120
- */
121
- $object = WC()->customer;
122
- } else {
123
- $object = $order;
124
- }
125
-
126
- $args = array_merge_recursive(
127
- parent::get_source_args( $order ),
128
- array(
129
- 'klarna' => array(
130
- 'product' => 'payment',
131
- 'purchase_country' => $object->get_billing_country(),
132
- 'first_name' => $object->get_billing_first_name(),
133
- 'last_name' => $object->get_billing_last_name(),
134
- ),
135
- 'owner' => array(
136
- 'address' => array(
137
- 'city' => $object->get_billing_city(),
138
- 'country' => $object->get_billing_country(),
139
- 'line1' => $object->get_billing_address_1(),
140
- 'line2' => $object->get_billing_address_2(),
141
- 'postal_code' => $object->get_billing_postcode(),
142
- 'state' => $object->get_billing_state(),
143
- ),
144
- ),
145
- )
146
  );
147
- if ( 'US' === $object->get_billing_country() ) {
148
  $args['klarna']['custom_payment_methods'] = 'payin4,installments';
149
  }
150
  $args['source_order'] = array();
@@ -153,78 +144,75 @@ class WC_Payment_Gateway_Stripe_Klarna extends WC_Payment_Gateway_Stripe_Local_P
153
  $args['klarna']['locale'] = str_replace( '_', '-', $locale );
154
  }
155
 
156
- if ( $order->get_shipping_address_1() ) {
157
- $args['klarna']['shipping_first_name'] = $object->get_shipping_first_name();
158
- $args['klarna']['shipping_last_name'] = $object->get_shipping_last_name();
159
  $args['source_order']['shipping']['address'] = array(
160
- 'city' => $object->get_billing_city(),
161
- 'country' => $object->get_shipping_country(),
162
- 'line1' => $object->get_shipping_address_1(),
163
- 'line2' => $object->get_shipping_address_2(),
164
- 'postal_code' => $object->get_shipping_postcode(),
165
- 'state' => $object->get_shipping_state(),
166
  );
167
  }
168
 
169
- foreach ( $order->get_items( 'line_item' ) as $item ) {
170
  /**
171
  *
172
  * @var WC_Order_Item_Product $item
173
  */
174
  $args['source_order']['items'][] = array(
175
  'type' => 'sku',
176
- 'amount' => wc_stripe_add_number_precision( $item->get_subtotal(), $order->get_currency() ),
177
- 'currency' => $order->get_currency(),
178
- 'quantity' => $item->get_quantity(),
179
- 'description' => $item->get_name(),
180
  );
181
  }
182
  // shipping
183
- if ( $order->get_shipping_total() ) {
184
  $args['source_order']['items'][] = array(
185
  'type' => 'shipping',
186
- 'amount' => wc_stripe_add_number_precision( $order->get_shipping_total(), $order->get_currency() ),
187
- 'currency' => $order->get_currency(),
188
  'quantity' => 1,
189
  'description' => __( 'Shipping', 'woo-stripe-payment' ),
190
  );
191
  }
192
  // discount
193
- if ( $order->get_discount_total() ) {
194
  $args['source_order']['items'][] = array(
195
  'type' => 'discount',
196
- 'amount' => - 1 * wc_stripe_add_number_precision( $order->get_discount_total(), $order->get_currency() ),
197
- 'currency' => $order->get_currency(),
198
  'quantity' => 1,
199
  'description' => __( 'Discount', 'woo-stripe-payment' ),
200
  );
201
  }
202
  // fees
203
- if ( $order->get_fees() ) {
204
- $fee_total = 0;
205
- foreach ( $order->get_fees() as $fee ) {
206
- $fee_total += wc_stripe_add_number_precision( $fee->get_total(), $order->get_currency() );
207
- }
208
  $args['source_order']['items'][] = array(
209
  'type' => 'sku',
210
- 'amount' => $fee_total,
211
- 'currency' => $order->get_currency(),
212
  'quantity' => 1,
213
- 'description' => __( 'Fee', 'woo-stripe-payment' ),
214
  );
215
  }
216
  // tax
217
- if ( $order->get_total_tax() ) {
218
  $args['source_order']['items'][] = array(
219
  'type' => 'tax',
220
- 'amount' => wc_stripe_add_number_precision( $order->get_total_tax() ),
221
  'description' => __( 'Tax', 'woo-stripe-payment' ),
222
  'quantity' => 1,
223
- 'currency' => $order->get_currency(),
224
  );
225
  }
226
 
227
  return $args;
 
228
  }
229
 
230
  /**
@@ -252,10 +240,7 @@ class WC_Payment_Gateway_Stripe_Klarna extends WC_Payment_Gateway_Stripe_Local_P
252
  array(
253
  'pay_now' => __( 'Pay Now', 'woo-stripe-payment' ),
254
  'pay_later' => __( 'Pay Later', 'woo-stripe-payment' ),
255
- 'pay_over_time' => __(
256
- 'Pay Over Time',
257
- 'woo-stripe-payment'
258
- ),
259
  )
260
  );
261
  }
@@ -275,6 +260,8 @@ class WC_Payment_Gateway_Stripe_Klarna extends WC_Payment_Gateway_Stripe_Local_P
275
  public function get_localized_params() {
276
  $params = parent::get_localized_params();
277
  $params['messages']['klarna_error'] = __( 'Your purchase is not approved.', 'woo-stripe-payment' );
 
 
278
 
279
  return $params;
280
  }
24
  $this->token_type = 'Stripe_Local';
25
  $this->method_title = __( 'Klarna', 'woo-stripe-payment' );
26
  $this->method_description = __( 'Klarna gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
27
+ $this->icon = stripe_wc()->assets_url( 'img/klarna.svg' );
28
  $this->order_button_text = $this->get_order_button_text( __( 'Klarna', 'woo-stripe-payment' ) );
29
  parent::__construct();
30
  $this->template_name = 'klarna.php';
57
  return false;
58
  }
59
 
60
+ public function output_display_items( $page = 'checkout', $data = array() ) {
61
+ parent::output_display_items( $page, array(
62
+ 'source_args' => $this->get_klarna_args(),
63
+ 'payment_sections' => $this->get_option( 'payment_categories' )
64
+ ) );
 
 
 
 
 
 
 
 
 
 
65
  }
66
 
67
  public function enqueue_checkout_scripts( $scripts ) {
68
+ stripe_wc()->scripts()->enqueue_script( 'klarna', 'https://x.klarnacdn.net/kp/lib/v1/api.js', array(), stripe_wc()->version(), true );
69
  parent::enqueue_checkout_scripts( $scripts );
70
  }
71
 
84
  'woo-stripe-payment'
85
  ),
86
  ),
87
+ 'label_translation' => array(
88
+ 'title' => __( 'Use Stripe translation', 'woo-stripe-payment' ),
89
+ 'type' => 'checkbox',
90
+ 'default' => 'yes',
91
+ 'desc_tip' => true,
92
+ 'description' => __( 'If enabled, the payment option labels will use the Stripe translated text.', 'woo-stripe-payment' )
93
+ )
94
  ),
95
  parent::get_local_payment_settings()
96
  );
104
  }
105
 
106
  /**
107
+ * @return array
108
+ * @since 3.2.8
 
 
109
  */
110
+ public function get_klarna_args() {
111
+ $customer = WC()->customer;
112
+ $cart = WC()->cart;
113
+ $currency = get_woocommerce_currency();
114
+ $args = array(
115
+ 'type' => $this->local_payment_type,
116
+ 'amount' => wc_stripe_add_number_precision( $cart->total, $currency ),
117
+ 'currency' => $currency,
118
+ //'statement_descriptor' => sprintf( __( 'Order %s', 'woo-stripe-payment' ), $order->get_order_number() ),
119
+ 'owner' => array(
120
+ 'name' => sprintf( '%s %s', $customer->get_billing_first_name(), $customer->get_billing_last_name() ),
121
+ 'email' => $customer->get_billing_email(),
122
+ 'address' => array(
123
+ 'city' => $customer->get_billing_city(),
124
+ 'country' => $customer->get_billing_country(),
125
+ 'line1' => $customer->get_billing_address_1(),
126
+ 'line2' => $customer->get_billing_address_2(),
127
+ 'postal_code' => $customer->get_billing_postcode(),
128
+ 'state' => $customer->get_billing_state(),
129
+ )
130
+ ),
131
+ 'klarna' => array(
132
+ 'product' => 'payment',
133
+ 'purchase_country' => $customer->get_billing_country(),
134
+ 'first_name' => $customer->get_billing_first_name(),
135
+ 'last_name' => $customer->get_billing_last_name(),
136
+ ),
 
 
 
 
137
  );
138
+ if ( 'US' === $customer->get_billing_country() ) {
139
  $args['klarna']['custom_payment_methods'] = 'payin4,installments';
140
  }
141
  $args['source_order'] = array();
144
  $args['klarna']['locale'] = str_replace( '_', '-', $locale );
145
  }
146
 
147
+ if ( $cart->needs_shipping() ) {
148
+ $args['klarna']['shipping_first_name'] = $customer->get_shipping_first_name();
149
+ $args['klarna']['shipping_last_name'] = $customer->get_shipping_last_name();
150
  $args['source_order']['shipping']['address'] = array(
151
+ 'city' => $customer->get_shipping_city(),
152
+ 'country' => $customer->get_shipping_country(),
153
+ 'line1' => $customer->get_shipping_address_1(),
154
+ 'line2' => $customer->get_shipping_address_2(),
155
+ 'postal_code' => $customer->get_shipping_postcode(),
156
+ 'state' => $customer->get_shipping_state(),
157
  );
158
  }
159
 
160
+ foreach ( $cart->get_cart_contents() as $item ) {
161
  /**
162
  *
163
  * @var WC_Order_Item_Product $item
164
  */
165
  $args['source_order']['items'][] = array(
166
  'type' => 'sku',
167
+ 'amount' => wc_stripe_add_number_precision( $item['line_subtotal'], $currency ),
168
+ 'currency' => $currency,
169
+ 'quantity' => $item['quantity'],
170
+ 'description' => $item['data']->get_name(),
171
  );
172
  }
173
  // shipping
174
+ if ( $cart->shipping_total ) {
175
  $args['source_order']['items'][] = array(
176
  'type' => 'shipping',
177
+ 'amount' => wc_stripe_add_number_precision( $cart->shipping_total, $currency ),
178
+ 'currency' => $currency,
179
  'quantity' => 1,
180
  'description' => __( 'Shipping', 'woo-stripe-payment' ),
181
  );
182
  }
183
  // discount
184
+ if ( $cart->discount_cart ) {
185
  $args['source_order']['items'][] = array(
186
  'type' => 'discount',
187
+ 'amount' => - 1 * wc_stripe_add_number_precision( $cart->discount_cart, $currency ),
188
+ 'currency' => $currency,
189
  'quantity' => 1,
190
  'description' => __( 'Discount', 'woo-stripe-payment' ),
191
  );
192
  }
193
  // fees
194
+ if ( 0 < $cart->fee_total ) {
 
 
 
 
195
  $args['source_order']['items'][] = array(
196
  'type' => 'sku',
197
+ 'amount' => wc_stripe_add_number_precision( $cart->fee_total, $currency ),
198
+ 'currency' => $currency,
199
  'quantity' => 1,
200
+ 'description' => __( 'Fee total', 'woo-stripe-payment' ),
201
  );
202
  }
203
  // tax
204
+ if ( 0 < $cart->get_total_tax() ) {
205
  $args['source_order']['items'][] = array(
206
  'type' => 'tax',
207
+ 'amount' => wc_stripe_add_number_precision( $cart->get_total_tax(), $currency ),
208
  'description' => __( 'Tax', 'woo-stripe-payment' ),
209
  'quantity' => 1,
210
+ 'currency' => $currency,
211
  );
212
  }
213
 
214
  return $args;
215
+
216
  }
217
 
218
  /**
240
  array(
241
  'pay_now' => __( 'Pay Now', 'woo-stripe-payment' ),
242
  'pay_later' => __( 'Pay Later', 'woo-stripe-payment' ),
243
+ 'pay_over_time' => __( 'Pay Over Time', 'woo-stripe-payment' ),
 
 
 
244
  )
245
  );
246
  }
260
  public function get_localized_params() {
261
  $params = parent::get_localized_params();
262
  $params['messages']['klarna_error'] = __( 'Your purchase is not approved.', 'woo-stripe-payment' );
263
+ $params['klarna_loader'] = '<div class="wc-stripe-klarna-loader"><div></div><div></div><div></div></div>';
264
+ $params['translate'] = $this->is_active( 'label_translation' );
265
 
266
  return $params;
267
  }
includes/gateways/class-wc-payment-gateway-stripe-multibanco.php CHANGED
@@ -1,32 +1,32 @@
1
- <?php
2
- defined( 'ABSPATH' ) || exit();
3
-
4
- if ( ! class_exists( 'WC_Payment_Gateway_Stripe_Local_Payment' ) ) {
5
- return;
6
- }
7
-
8
- /**
9
- *
10
- * @package Stripe/Gateways
11
- * @author PaymentPlugins
12
- *
13
- */
14
- class WC_Payment_Gateway_Stripe_Multibanco extends WC_Payment_Gateway_Stripe_Local_Payment {
15
-
16
- use WC_Stripe_Local_Payment_Charge_Trait;
17
-
18
- public function __construct() {
19
- $this->local_payment_type = 'multibanco';
20
- $this->currencies = array( 'EUR' );
21
- $this->countries = array( 'PT' );
22
- $this->id = 'stripe_multibanco';
23
- $this->tab_title = __( 'Multibanco', 'woo-stripe-payment' );
24
- $this->template_name = 'local-payment.php';
25
- $this->token_type = 'Stripe_Local';
26
- $this->method_title = __( 'Multibanco', 'woo-stripe-payment' );
27
- $this->method_description = __( 'Multibanco gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
28
- $this->icon = wc_stripe()->assets_url( 'img/multibanco.svg' );
29
- $this->order_button_text = $this->get_order_button_text( __( 'Multibanco', 'woo-stripe-payment' ) );
30
- parent::__construct();
31
- }
32
- }
1
+ <?php
2
+ defined( 'ABSPATH' ) || exit();
3
+
4
+ if ( ! class_exists( 'WC_Payment_Gateway_Stripe_Local_Payment' ) ) {
5
+ return;
6
+ }
7
+
8
+ /**
9
+ *
10
+ * @package Stripe/Gateways
11
+ * @author PaymentPlugins
12
+ *
13
+ */
14
+ class WC_Payment_Gateway_Stripe_Multibanco extends WC_Payment_Gateway_Stripe_Local_Payment {
15
+
16
+ use WC_Stripe_Local_Payment_Charge_Trait;
17
+
18
+ public function __construct() {
19
+ $this->local_payment_type = 'multibanco';
20
+ $this->currencies = array( 'EUR' );
21
+ $this->countries = array( 'PT' );
22
+ $this->id = 'stripe_multibanco';
23
+ $this->tab_title = __( 'Multibanco', 'woo-stripe-payment' );
24
+ $this->template_name = 'local-payment.php';
25
+ $this->token_type = 'Stripe_Local';
26
+ $this->method_title = __( 'Multibanco', 'woo-stripe-payment' );
27
+ $this->method_description = __( 'Multibanco gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
28
+ $this->icon = stripe_wc()->assets_url( 'img/multibanco.svg' );
29
+ $this->order_button_text = $this->get_order_button_text( __( 'Multibanco', 'woo-stripe-payment' ) );
30
+ parent::__construct();
31
+ }
32
+ }
includes/gateways/class-wc-payment-gateway-stripe-p24.php CHANGED
@@ -1,32 +1,32 @@
1
- <?php
2
- defined( 'ABSPATH' ) || exit();
3
-
4
- if ( ! class_exists( 'WC_Payment_Gateway_Stripe_Local_Payment' ) ) {
5
- return;
6
- }
7
-
8
- /**
9
- *
10
- * @package Stripe/Gateways
11
- * @author PaymentPlugins
12
- *
13
- */
14
- class WC_Payment_Gateway_Stripe_P24 extends WC_Payment_Gateway_Stripe_Local_Payment {
15
-
16
- use WC_Stripe_Local_Payment_Charge_Trait;
17
-
18
- public function __construct() {
19
- $this->local_payment_type = 'p24';
20
- $this->currencies = array( 'EUR', 'PLN' );
21
- $this->countries = array( 'PL' );
22
- $this->id = 'stripe_p24';
23
- $this->tab_title = __( 'Przelewy24', 'woo-stripe-payment' );
24
- $this->template_name = 'local-payment.php';
25
- $this->token_type = 'Stripe_Local';
26
- $this->method_title = __( 'Przelewy24', 'woo-stripe-payment' );
27
- $this->method_description = __( 'P24 gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
28
- $this->icon = wc_stripe()->assets_url( 'img/p24.svg' );
29
- $this->order_button_text = $this->get_order_button_text( __( 'P24', 'woo-stripe-payment' ) );
30
- parent::__construct();
31
- }
32
- }
1
+ <?php
2
+ defined( 'ABSPATH' ) || exit();
3
+
4
+ if ( ! class_exists( 'WC_Payment_Gateway_Stripe_Local_Payment' ) ) {
5
+ return;
6
+ }
7
+
8
+ /**
9
+ *
10
+ * @package Stripe/Gateways
11
+ * @author PaymentPlugins
12
+ *
13
+ */
14
+ class WC_Payment_Gateway_Stripe_P24 extends WC_Payment_Gateway_Stripe_Local_Payment {
15
+
16
+ use WC_Stripe_Local_Payment_Charge_Trait;
17
+
18
+ public function __construct() {
19
+ $this->local_payment_type = 'p24';
20
+ $this->currencies = array( 'EUR', 'PLN' );
21
+ $this->countries = array( 'PL' );
22
+ $this->id = 'stripe_p24';
23
+ $this->tab_title = __( 'Przelewy24', 'woo-stripe-payment' );
24
+ $this->template_name = 'local-payment.php';
25
+ $this->token_type = 'Stripe_Local';
26
+ $this->method_title = __( 'Przelewy24', 'woo-stripe-payment' );
27
+ $this->method_description = __( 'P24 gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
28
+ $this->icon = stripe_wc()->assets_url( 'img/p24.svg' );
29
+ $this->order_button_text = $this->get_order_button_text( __( 'P24', 'woo-stripe-payment' ) );
30
+ parent::__construct();
31
+ }
32
+ }
includes/gateways/class-wc-payment-gateway-stripe-payment-request.php CHANGED
@@ -57,7 +57,7 @@ class WC_Payment_Gateway_Stripe_Payment_Request extends WC_Payment_Gateway_Strip
57
  $scripts->get_handle( 'wc-stripe' ),
58
  $scripts->get_handle( 'external' ),
59
  ),
60
- wc_stripe()->version(),
61
  true
62
  );
63
 
@@ -73,7 +73,7 @@ class WC_Payment_Gateway_Stripe_Payment_Request extends WC_Payment_Gateway_Strip
73
  'theme' => $this->get_option( 'button_theme' ),
74
  'height' => $this->get_button_height(),
75
  ),
76
- 'icons' => array( 'chrome' => wc_stripe()->assets_url( 'img/chrome.svg' ) ),
77
  'messages' => array(
78
  'invalid_amount' => __( 'Please update you product quantity before paying.', 'woo-stripe-payment' ),
79
  'add_to_cart' => __( 'Adding to cart...', 'woo-stripe-payment' ),
57
  $scripts->get_handle( 'wc-stripe' ),
58
  $scripts->get_handle( 'external' ),
59
  ),
60
+ stripe_wc()->version(),
61
  true
62
  );
63
 
73
  'theme' => $this->get_option( 'button_theme' ),
74
  'height' => $this->get_button_height(),
75
  ),
76
+ 'icons' => array( 'chrome' => stripe_wc()->assets_url( 'img/chrome.svg' ) ),
77
  'messages' => array(
78
  'invalid_amount' => __( 'Please update you product quantity before paying.', 'woo-stripe-payment' ),
79
  'add_to_cart' => __( 'Adding to cart...', 'woo-stripe-payment' ),
includes/gateways/class-wc-payment-gateway-stripe-sepa.php CHANGED
@@ -24,7 +24,7 @@ class WC_Payment_Gateway_Stripe_Sepa extends WC_Payment_Gateway_Stripe_Local_Pay
24
  $this->template_name = 'local-payment.php';
25
  $this->method_title = __( 'Sepa', 'woo-stripe-payment' );
26
  $this->method_description = __( 'Sepa gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
27
- $this->icon = wc_stripe()->assets_url( 'img/sepa.svg' );
28
  $this->order_button_text = $this->get_order_button_text( __( 'SEPA', 'woo-stripe-payment' ) );
29
  parent::__construct();
30
  $this->token_type = 'Stripe_Sepa';
24
  $this->template_name = 'local-payment.php';
25
  $this->method_title = __( 'Sepa', 'woo-stripe-payment' );
26
  $this->method_description = __( 'Sepa gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
27
+ $this->icon = stripe_wc()->assets_url( 'img/sepa.svg' );
28
  $this->order_button_text = $this->get_order_button_text( __( 'SEPA', 'woo-stripe-payment' ) );
29
  parent::__construct();
30
  $this->token_type = 'Stripe_Sepa';
includes/gateways/class-wc-payment-gateway-stripe-sofort.php CHANGED
@@ -1,37 +1,37 @@
1
- <?php
2
- defined( 'ABSPATH' ) || exit();
3
-
4
- if ( ! class_exists( 'WC_Payment_Gateway_Stripe_Local_Payment' ) ) {
5
- return;
6
- }
7
-
8
- /**
9
- *
10
- * @package Stripe/Gateways
11
- * @author PaymentPlugins
12
- *
13
- */
14
- class WC_Payment_Gateway_Stripe_Sofort extends WC_Payment_Gateway_Stripe_Local_Payment {
15
-
16
- use WC_Stripe_Local_Payment_Charge_Trait;
17
-
18
- public function __construct() {
19
- $this->synchronous = false;
20
- $this->local_payment_type = 'sofort';
21
- $this->currencies = array( 'EUR' );
22
- $this->countries = array( 'AT', 'BE', 'DE', 'ES', 'IT', 'NL' );
23
- $this->id = 'stripe_sofort';
24
- $this->tab_title = __( 'Sofort', 'woo-stripe-payment' );
25
- $this->template_name = 'local-payment.php';
26
- $this->token_type = 'Stripe_Local';
27
- $this->method_title = __( 'Sofort', 'woo-stripe-payment' );
28
- $this->method_description = __( 'Sofort gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
29
- $this->icon = wc_stripe()->assets_url( 'img/sofort.svg' );
30
- $this->order_button_text = $this->get_order_button_text( __( 'SOFORT', 'woo-stripe-payment' ) );
31
- parent::__construct();
32
- }
33
-
34
- public function get_source_args( $order ) {
35
- return array_merge( parent::get_source_args( $order ), array( 'sofort' => array( 'country' => $order->get_billing_country() ) ) );
36
- }
37
- }
1
+ <?php
2
+ defined( 'ABSPATH' ) || exit();
3
+
4
+ if ( ! class_exists( 'WC_Payment_Gateway_Stripe_Local_Payment' ) ) {
5
+ return;
6
+ }
7
+
8
+ /**
9
+ *
10
+ * @package Stripe/Gateways
11
+ * @author PaymentPlugins
12
+ *
13
+ */
14
+ class WC_Payment_Gateway_Stripe_Sofort extends WC_Payment_Gateway_Stripe_Local_Payment {
15
+
16
+ use WC_Stripe_Local_Payment_Charge_Trait;
17
+
18
+ public function __construct() {
19
+ $this->synchronous = false;
20
+ $this->local_payment_type = 'sofort';
21
+ $this->currencies = array( 'EUR' );
22
+ $this->countries = array( 'AT', 'BE', 'DE', 'ES', 'IT', 'NL' );
23
+ $this->id = 'stripe_sofort';
24
+ $this->tab_title = __( 'Sofort', 'woo-stripe-payment' );
25
+ $this->template_name = 'local-payment.php';
26
+ $this->token_type = 'Stripe_Local';
27
+ $this->method_title = __( 'Sofort', 'woo-stripe-payment' );
28
+ $this->method_description = __( 'Sofort gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
29
+ $this->icon = stripe_wc()->assets_url( 'img/sofort.svg' );
30
+ $this->order_button_text = $this->get_order_button_text( __( 'SOFORT', 'woo-stripe-payment' ) );
31
+ parent::__construct();
32
+ }
33
+
34
+ public function get_source_args( $order ) {
35
+ return array_merge( parent::get_source_args( $order ), array( 'sofort' => array( 'country' => $order->get_billing_country() ) ) );
36
+ }
37
+ }
includes/gateways/class-wc-payment-gateway-stripe-wechat.php CHANGED
@@ -1,73 +1,73 @@
1
- <?php
2
- defined( 'ABSPATH' ) || exit();
3
-
4
- if ( ! class_exists( 'WC_Payment_Gateway_Stripe_Local_Payment' ) ) {
5
- return;
6
- }
7
-
8
- /**
9
- *
10
- * @package Stripe/Gateways
11
- * @author PaymentPlugins
12
- *
13
- */
14
- class WC_Payment_Gateway_Stripe_WeChat extends WC_Payment_Gateway_Stripe_Local_Payment {
15
-
16
- use WC_Stripe_Local_Payment_Charge_Trait;
17
-
18
- public function __construct() {
19
- $this->local_payment_type = 'wechat';
20
- $this->currencies = array( 'AUD', 'CAD', 'EUR', 'GBP', 'HKD', 'JPY', 'SGD', 'USD' );
21
- // $this->countries = [ 'CN'
22
- // ];
23
- $this->id = 'stripe_wechat';
24
- $this->tab_title = __( 'WeChat', 'woo-stripe-payment' );
25
- $this->template_name = 'local-payment.php';
26
- $this->token_type = 'Stripe_Local';
27
- $this->method_title = __( 'WeChat', 'woo-stripe-payment' );
28
- $this->method_description = __( 'WeChat gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
29
- $this->icon = wc_stripe()->assets_url( 'img/wechat.svg' );
30
- $this->order_button_text = $this->get_order_button_text( __( 'WeChat', 'woo-stripe-payment' ) );
31
- parent::__construct();
32
- }
33
-
34
- /**
35
- *
36
- * {@inheritDoc}
37
- *
38
- * @see WC_Payment_Gateway_Stripe_Local_Payment::get_source_redirect_url()
39
- */
40
- public function get_source_redirect_url( $source, $order ) {
41
- if ( wc_stripe_mode() == 'live' ) {
42
- return sprintf(
43
- '#qrcode=%s',
44
- base64_encode(
45
- wp_json_encode(
46
- array(
47
- 'code' => $source->wechat->qr_code_url,
48
- 'redirect' => $order->get_checkout_order_received_url(),
49
- )
50
- )
51
- )
52
- );
53
- }
54
- // test code
55
- // 'code' => 'weixin:\/\/wxpay\/bizpayurl?pr=tMih4Jo'
56
-
57
- // in test mode just return the redirect url
58
- return $source->wechat->qr_code_url;
59
- }
60
-
61
- /**
62
- *
63
- * {@inheritDoc}
64
- *
65
- * @see WC_Payment_Gateway_Stripe_Local_Payment::get_localized_params()
66
- */
67
- public function get_localized_params() {
68
- $data = parent::get_localized_params();
69
- $data['qr_script'] = sprintf( wc_stripe()->scripts()->assets_url( 'js/frontend/qrcode.js?ver=%s' ), wc_stripe()->version );
70
- $data['qr_message'] = __( 'Scan the QR code using your WeChat app. Once scanned click the Place Order button.', 'woo-stripe-payment' );
71
- return $data;
72
- }
73
- }
1
+ <?php
2
+ defined( 'ABSPATH' ) || exit();
3
+
4
+ if ( ! class_exists( 'WC_Payment_Gateway_Stripe_Local_Payment' ) ) {
5
+ return;
6
+ }
7
+
8
+ /**
9
+ *
10
+ * @package Stripe/Gateways
11
+ * @author PaymentPlugins
12
+ *
13
+ */
14
+ class WC_Payment_Gateway_Stripe_WeChat extends WC_Payment_Gateway_Stripe_Local_Payment {
15
+
16
+ use WC_Stripe_Local_Payment_Charge_Trait;
17
+
18
+ public function __construct() {
19
+ $this->local_payment_type = 'wechat';
20
+ $this->currencies = array( 'AUD', 'CAD', 'EUR', 'GBP', 'HKD', 'JPY', 'SGD', 'USD' );
21
+ // $this->countries = [ 'CN'
22
+ // ];
23
+ $this->id = 'stripe_wechat';
24
+ $this->tab_title = __( 'WeChat', 'woo-stripe-payment' );
25
+ $this->template_name = 'local-payment.php';
26
+ $this->token_type = 'Stripe_Local';
27
+ $this->method_title = __( 'WeChat', 'woo-stripe-payment' );
28
+ $this->method_description = __( 'WeChat gateway that integrates with your Stripe account.', 'woo-stripe-payment' );
29
+ $this->icon = stripe_wc()->assets_url( 'img/wechat.svg' );
30
+ $this->order_button_text = $this->get_order_button_text( __( 'WeChat', 'woo-stripe-payment' ) );
31
+ parent::__construct();
32
+ }
33
+
34
+ /**
35
+ *
36
+ * {@inheritDoc}
37
+ *
38
+ * @see WC_Payment_Gateway_Stripe_Local_Payment::get_source_redirect_url()
39
+ */
40
+ public function get_source_redirect_url( $source, $order ) {
41
+ if ( wc_stripe_mode() == 'live' ) {
42
+ return sprintf(
43
+ '#qrcode=%s',
44
+ base64_encode(
45
+ wp_json_encode(
46
+ array(
47
+ 'code' => $source->wechat->qr_code_url,
48
+ 'redirect' => $order->get_checkout_order_received_url(),
49
+ )
50
+ )
51
+ )
52
+ );
53
+ }
54
+ // test code
55
+ // 'code' => 'weixin:\/\/wxpay\/bizpayurl?pr=tMih4Jo'
56
+
57
+ // in test mode just return the redirect url
58
+ return $source->wechat->qr_code_url;
59
+ }
60
+
61
+ /**
62
+ *
63
+ * {@inheritDoc}
64
+ *
65
+ * @see WC_Payment_Gateway_Stripe_Local_Payment::get_localized_params()
66
+ */
67
+ public function get_localized_params() {
68
+ $data = parent::get_localized_params();
69
+ $data['qr_script'] = sprintf( stripe_wc()->scripts()->assets_url( 'js/frontend/qrcode.js?ver=%s' ), stripe_wc()->version );
70
+ $data['qr_message'] = __( 'Scan the QR code using your WeChat app. Once scanned click the Place Order button.', 'woo-stripe-payment' );
71
+ return $data;
72
+ }
73
+ }
includes/gateways/settings/ach-settings-v2.php DELETED
@@ -1,115 +0,0 @@
1
- <?php
2
- return array(
3
- 'desc' => array(
4
- 'type' => 'description',
5
- 'description' => sprintf( '<div>%s</div>', __( 'For US customers only.', 'woo-stripe-payment' ) ) .
6
- sprintf( '<p>%s</p>', sprintf( __( 'Read through our %1$sdocumentation%2$s to configure ACH payments', 'woo-stripe-payment' ), '<a target="_blank" href="https://docs.paymentplugins.com/wc-stripe/config/#/stripe_ach">', '</a>' ) ),
7
- ),
8
- 'enabled' => array(
9
- 'title' => __( 'Enabled', 'woo-stripe-payment' ),
10
- 'type' => 'checkbox',
11
- 'default' => 'no',
12
- 'value' => 'yes',
13
- 'desc_tip' => true,
14
- 'description' => __( 'If enabled, your site can accept ACH payments through Stripe.', 'woo-stripe-payment' ),
15
- ),
16
- 'environment' => array(
17
- 'type' => 'select',
18
- 'title' => __( 'Plaid Environment', 'woo-stripe-payment' ),
19
- 'options' => array(
20
- 'sandbox' => __( 'Sandbox', 'woo-stripe-payment' ),
21
- 'development' => __( 'Development', 'woo-stripe-payment' ),
22
- 'production' => __( 'Production', 'woo-stripe-payment' ),
23
- ),
24
- 'description' => __( 'This setting determines the Plaid environment you are connecting with. When you are ready to accept live transactions, switch this option to Production.<br><strong>Production</strong> - accept live ACH payments <br><strong>Development</strong> - use real bank login details with test transactions <br><strong>Sandbox</strong> - test integration using test credentials', 'woo-stripe-payment' ),
25
- ),
26
- /* 'plaid_keys' => array( 'type' => 'title',
27
- 'title' => __ ( 'Plaid Keys', 'wo-stripe-paymento' )
28
- ),
29
- 'client_id' => array( 'type' => 'text',
30
- 'title' => __ ( 'Client ID' ),
31
- 'default' => '',
32
- 'description' => __ ( 'ID that identifies your Plaid account.', 'woo-stripe-payment' ),
33
- 'desc_tip' => true
34
- ),
35
- 'public_key' => array( 'type' => 'text',
36
- 'title' => __ ( 'Public Key' ),
37
- 'default' => '',
38
- 'description' => __ ( 'Used to identify ACH payments initiated from your site.', 'woo-stripe-payment' ),
39
- 'desc_tip' => true
40
- ),
41
- 'plaid_secrets' => array( 'type' => 'title',
42
- 'title' => __ ( 'Plaid Secrets', 'wo-stripe-paymento' )
43
- ),
44
- 'sandbox_secret' => array(
45
- 'title' => __ ( 'Sandbox Secret', 'woo-stripe-payment' ),
46
- 'type' => 'password', 'default' => '',
47
- 'description' => __ ( 'Key that acts as a password when connecting to Plaid\'s sandbox environment.', 'woo-stripe-payment' ),
48
- 'desc_tip' => true
49
- ),
50
- 'development_secret' => array(
51
- 'title' => __ ( 'Development Secret', 'woo-stripe-payment' ),
52
- 'type' => 'password', 'default' => '',
53
- 'description' => __ ( '', 'woo-stripe-payment' ),
54
- 'desc_tip' => true
55
- ),
56
- 'production_secret' => array(
57
- 'title' => __ ( 'Production Secret', 'woo-stripe-payment' ),
58
- 'type' => 'password', 'default' => '',
59
- 'description' => __ ( 'Key that acts as a password when connecting to Plaid\'s production environment.', 'woo-stripe-payment' ),
60
- 'desc_tip' => true
61
- ), */
62
- 'general_settings' => array(
63
- 'type' => 'title',
64
- 'title' => __( 'General Settings', 'woo-stripe-payment' ),
65
- ),
66
- 'title_text' => array(
67
- 'type' => 'text',
68
- 'title' => __( 'Title', 'woo-stripe-payment' ),
69
- 'default' => __( 'ACH Payment', 'woo-stripe-payment' ),
70
- 'desc_tip' => true,
71
- 'description' => __( 'Title of the ACH gateway' ),
72
- ),
73
- 'description' => array(
74
- 'title' => __( 'Description', 'woo-stripe-payment' ),
75
- 'type' => 'text',
76
- 'default' => '',
77
- 'description' => __( 'Leave blank if you don\'t want a description to show for the gateway.', 'woo-stripe-payment' ),
78
- 'desc_tip' => true,
79
- ),
80
- 'client_name' => array(
81
- 'type' => 'text',
82
- 'title' => __( 'Client Name', 'woo-stripe-payment' ),
83
- 'default' => get_bloginfo( 'name' ),
84
- 'description' => __( 'The name that appears on the ACH payment screen.', 'woo-stripe-payment' ),
85
- 'desc_tip' => true,
86
- ),
87
- 'method_format' => array(
88
- 'title' => __( 'ACH Display', 'woo-stripe-payment' ),
89
- 'type' => 'select',
90
- 'class' => 'wc-enhanced-select',
91
- 'options' => wp_list_pluck( $this->get_method_formats(), 'example' ),
92
- 'value' => '',
93
- 'default' => 'type_ending_in',
94
- 'desc_tip' => true,
95
- 'description' => __( 'This option allows you to customize how the credit card will display for your customers on orders, subscriptions, etc.' ),
96
- ),
97
- 'fee' => array(
98
- 'title' => __( 'ACH Fee', 'woo-stripe-payment' ),
99
- 'type' => 'ach_fee',
100
- 'class' => '',
101
- 'value' => '',
102
- 'default' => array(
103
- 'type' => 'none',
104
- 'taxable' => 'no',
105
- 'value' => '0',
106
- ),
107
- 'options' => array(
108
- 'none' => __( 'None', 'woo-stripe-payment' ),
109
- 'amount' => __( 'Amount', 'woo-stripe-payment' ),
110
- 'percent' => __( 'Percentage', 'woo-stripe-payment' ),
111
- ),
112
- 'desc_tip' => true,
113
- 'description' => __( 'You can assign a fee to the order for ACH payments. Amount is a static amount and percentage is a percentage of the cart amount.', 'woo-stripe-payment' ),
114
- ),
115
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/gateways/settings/applepay-settings.php CHANGED
@@ -1,126 +1,126 @@
1
- <?php
2
- return array(
3
- 'desc' => array(
4
- 'type' => 'description',
5
- 'description' => sprintf( '<div class="wc-stripe-register-domain"><button class="button button-secondary api-register-domain">%s</button></div><p>%s</p>', __( 'Register Domain', 'woo-stripe-payment' ), sprintf( __( 'This plugin attemps to add the domain association file to your server automatically when you click the Register Domain button. If that fails due to file permssions, you must add the <strong>%1$s.well-known/apple-developer-merchantid-domain-association%2$s</strong> file to your domain and register your domain within the Stripe Dashboard.', 'woo-stripe-payment' ), '<a href="https://stripe.com/files/apple-pay/apple-developer-merchantid-domain-association">', '</a>' ) ) .
6
- '<p>' .
7
- __( 'In order for Apple Pay to display, you must test with an iOS device and have a payment method saved in the Apple Wallet.', 'woo-stripe-payment' ) .
8
- '</p>',
9
- ),
10
- 'enabled' => array(
11
- 'title' => __( 'Enabled', 'woo-stripe-payment' ),
12
- 'type' => 'checkbox',
13
- 'default' => 'no',
14
- 'value' => 'yes',
15
- 'desc_tip' => true,
16
- 'description' => __( 'If enabled, your site can accept Apple Pay payments through Stripe.', 'woo-stripe-payment' ),
17
- ),
18
- 'general_settings' => array(
19
- 'type' => 'title',
20
- 'title' => __( 'General Settings', 'woo-stripe-payment' ),
21
- ),
22
- 'title_text' => array(
23
- 'type' => 'text',
24
- 'title' => __( 'Title', 'woo-stripe-payment' ),
25
- 'default' => __( 'Apple Pay', 'woo-stripe-payment' ),
26
- 'desc_tip' => true,
27
- 'description' => __( 'Title of the Apple Pay gateway' ),
28
- ),
29
- 'description' => array(
30
- 'title' => __( 'Description', 'woo-stripe-payment' ),
31
- 'type' => 'text',
32
- 'default' => '',
33
- 'description' => __( 'Leave blank if you don\'t want a description to show for the gateway.', 'woo-stripe-payment' ),
34
- 'desc_tip' => true,
35
- ),
36
- 'method_format' => array(
37
- 'title' => __( 'Credit Card Display', 'woo-stripe-payment' ),
38
- 'type' => 'select',
39
- 'class' => 'wc-enhanced-select',
40
- 'options' => wp_list_pluck( $this->get_method_formats(), 'example' ),
41
- 'value' => '',
42
- 'default' => 'type_ending_in',
43
- 'desc_tip' => true,
44
- 'description' => __( 'This option allows you to customize how the credit card will display for your customers on orders, subscriptions, etc.' ),
45
- ),
46
- 'charge_type' => array(
47
- 'type' => 'select',
48
- 'title' => __( 'Charge Type', 'woo-stripe-payment' ),
49
- 'default' => 'capture',
50
- 'class' => 'wc-enhanced-select',
51
- 'options' => array(
52
- 'capture' => __( 'Capture', 'woo-stripe-payment' ),
53
- 'authorize' => __( 'Authorize', 'woo-stripe-payment' ),
54
- ),
55
- 'desc_tip' => true,
56
- 'description' => __( 'This option determines whether the customer\'s funds are captured immediately or authorized and can be captured at a later date.', 'woo-stripe-payment' ),
57
- ),
58
- 'payment_sections' => array(
59
- 'type' => 'multiselect',
60
- 'title' => __( 'Payment Sections', 'woo-stripe-payment' ),
61
- 'class' => 'wc-enhanced-select',
62
- 'options' => array(
63
- 'product' => __( 'Product Page', 'woo-stripe-payment' ),
64
- 'cart' => __( 'Cart Page', 'woo-stripe-payment' ),
65
- 'mini_cart' => __( 'Mini Cart', 'woo-stripe-payment' ),
66
- 'checkout_banner' => __( 'Top of Checkout', 'woo-stripe-payment' ),
67
- ),
68
- 'default' => array( 'product', 'cart' ),
69
- 'description' => $this->get_payment_section_description(),
70
- ),
71
- 'order_status' => array(
72
- 'type' => 'select',
73
- 'title' => __( 'Order Status', 'woo-stripe-payment' ),
74
- 'default' => 'default',
75
- 'class' => 'wc-enhanced-select',
76
- 'options' => array_merge( array( 'default' => __( 'Default', 'woo-stripe-payment' ) ), wc_get_order_statuses() ),
77
- 'tool_tip' => true,
78
- 'description' => __( 'This is the status of the order once payment is complete. If <b>Default</b> is selected, then WooCommerce will set the order status automatically based on internal logic which states if a product is virtual and downloadable then status is set to complete. Products that require shipping are set to Processing. Default is the recommended setting as it allows standard WooCommerce code to process the order status.', 'woo-stripe-payment' ),
79
- ),
80
- 'button_section' => array(
81
- 'type' => 'title',
82
- 'title' => __( 'Button Settings', 'woo-stripe-payment' ),
83
- ),
84
- 'button_style' => array(
85
- 'type' => 'select',
86
- 'title' => __( 'Button Design', 'woo-stripe-payment' ),
87
- 'class' => 'wc-enhanced-select',
88
- 'default' => 'apple-pay-button-black',
89
- 'options' => array(
90
- 'apple-pay-button-black' => __( 'Black Button', 'woo-stripe-payment' ),
91
- 'apple-pay-button-white-with-line' => __( 'White With Black Line', 'woo-stripe-payment' ),
92
- 'apple-pay-button-white' => __( 'White Button', 'woo-stripe-payment' ),
93
- ),
94
- 'description' => __( 'This is the style for all Apple Pay buttons presented on your store.', 'woo-stripe-payment' ),
95
- ),
96
- 'button_type_checkout' => array(
97
- 'title' => __( 'Checkout button type', 'woo-stripe-payment' ),
98
- 'type' => 'select',
99
- 'options' => array(
100
- 'plain' => __( 'Standard Button', 'woo-stripe-payment' ),
101
- 'buy' => __( 'Buy with Apple Pay', 'woo-stripe-payment' ),
102
- ),
103
- // 'check-out' => __ ( 'Checkout with Apple Pay', 'woo-stripe-payment' )
104
- 'default' => 'plain',
105
- ),
106
- 'button_type_cart' => array(
107
- 'title' => __( 'Cart button type', 'woo-stripe-payment' ),
108
- 'type' => 'select',
109
- 'options' => array(
110
- 'plain' => __( 'Standard Button', 'woo-stripe-payment' ),
111
- 'buy' => __( 'Buy with Apple Pay', 'woo-stripe-payment' ),
112
- ),
113
- // 'check-out' => __ ( 'Checkout with Apple Pay', 'woo-stripe-payment' )
114
- 'default' => 'plain',
115
- ),
116
- 'button_type_product' => array(
117
- 'title' => __( 'Product button type', 'woo-stripe-payment' ),
118
- 'type' => 'select',
119
- 'options' => array(
120
- 'plain' => __( 'Standard Button', 'woo-stripe-payment' ),
121
- 'buy' => __( 'Buy with Apple Pay', 'woo-stripe-payment' ),
122
- ),
123
- // 'check-out' => __ ( 'Checkout with Apple Pay', 'woo-stripe-payment' )
124
- 'default' => 'buy',
125
- ),
126
- );
1
+ <?php
2
+ return array(
3
+ 'desc' => array(
4
+ 'type' => 'description',
5
+ 'description' => sprintf( '<div class="wc-stripe-register-domain"><button class="button button-secondary api-register-domain">%s</button></div><p>%s</p>', __( 'Register Domain', 'woo-stripe-payment' ), sprintf( __( 'This plugin attemps to add the domain association file to your server automatically when you click the Register Domain button. If that fails due to file permssions, you must add the <strong>%1$s.well-known/apple-developer-merchantid-domain-association%2$s</strong> file to your domain and register your domain within the Stripe Dashboard.', 'woo-stripe-payment' ), '<a href="https://stripe.com/files/apple-pay/apple-developer-merchantid-domain-association">', '</a>' ) ) .
6
+ '<p>' .
7
+ __( 'In order for Apple Pay to display, you must test with an iOS device and have a payment method saved in the Apple Wallet.', 'woo-stripe-payment' ) .
8
+ '</p>',
9
+ ),
10
+ 'enabled' => array(
11
+ 'title' => __( 'Enabled', 'woo-stripe-payment' ),
12
+ 'type' => 'checkbox',
13
+ 'default' => 'no',
14
+ 'value' => 'yes',
15
+ 'desc_tip' => true,
16
+ 'description' => __( 'If enabled, your site can accept Apple Pay payments through Stripe.', 'woo-stripe-payment' ),
17
+ ),
18
+ 'general_settings' => array(
19
+ 'type' => 'title',
20
+ 'title' => __( 'General Settings', 'woo-stripe-payment' ),
21
+ ),
22
+ 'title_text' => array(
23
+ 'type' => 'text',
24
+ 'title' => __( 'Title', 'woo-stripe-payment' ),
25
+ 'default' => __( 'Apple Pay', 'woo-stripe-payment' ),
26
+ 'desc_tip' => true,
27
+ 'description' => __( 'Title of the Apple Pay gateway' ),
28
+ ),
29
+ 'description' => array(
30
+ 'title' => __( 'Description', 'woo-stripe-payment' ),
31
+ 'type' => 'text',
32
+ 'default' => '',
33
+ 'description' => __( 'Leave blank if you don\'t want a description to show for the gateway.', 'woo-stripe-payment' ),
34
+ 'desc_tip' => true,
35
+ ),
36
+ 'method_format' => array(
37
+ 'title' => __( 'Credit Card Display', 'woo-stripe-payment' ),
38
+ 'type' => 'select',
39
+ 'class' => 'wc-enhanced-select',
40
+ 'options' => wp_list_pluck( $this->get_method_formats(), 'example' ),
41
+ 'value' => '',
42
+ 'default' => 'type_ending_in',
43
+ 'desc_tip' => true,
44
+ 'description' => __( 'This option allows you to customize how the credit card will display for your customers on orders, subscriptions, etc.' ),
45
+ ),
46
+ 'charge_type' => array(
47
+ 'type' => 'select',
48
+ 'title' => __( 'Charge Type', 'woo-stripe-payment' ),
49
+ 'default' => 'capture',
50
+ 'class' => 'wc-enhanced-select',
51
+ 'options' => array(
52
+ 'capture' => __( 'Capture', 'woo-stripe-payment' ),
53
+ 'authorize' => __( 'Authorize', 'woo-stripe-payment' ),
54
+ ),
55
+ 'desc_tip' => true,
56
+ 'description' => __( 'This option determines whether the customer\'s funds are captured immediately or authorized and can be captured at a later date.', 'woo-stripe-payment' ),
57
+ ),
58
+ 'payment_sections' => array(
59
+ 'type' => 'multiselect',
60
+ 'title' => __( 'Payment Sections', 'woo-stripe-payment' ),
61
+ 'class' => 'wc-enhanced-select',
62
+ 'options' => array(
63
+ 'product' => __( 'Product Page', 'woo-stripe-payment' ),
64
+ 'cart' => __( 'Cart Page', 'woo-stripe-payment' ),
65
+ 'mini_cart' => __( 'Mini Cart', 'woo-stripe-payment' ),
66
+ 'checkout_banner' => __( 'Top of Checkout', 'woo-stripe-payment' ),
67
+ ),
68
+ 'default' => array( 'product', 'cart' ),
69
+ 'description' => $this->get_payment_section_description(),
70
+ ),
71
+ 'order_status' => array(
72
+ 'type' => 'select',
73
+ 'title' => __( 'Order Status', 'woo-stripe-payment' ),
74
+ 'default' => 'default',
75
+ 'class' => 'wc-enhanced-select',
76
+ 'options' => array_merge( array( 'default' => __( 'Default', 'woo-stripe-payment' ) ), wc_get_order_statuses() ),
77
+ 'tool_tip' => true,
78
+ 'description' => __( 'This is the status of the order once payment is complete. If <b>Default</b> is selected, then WooCommerce will set the order status automatically based on internal logic which states if a product is virtual and downloadable then status is set to complete. Products that require shipping are set to Processing. Default is the recommended setting as it allows standard WooCommerce code to process the order status.', 'woo-stripe-payment' ),
79
+ ),
80
+ 'button_section' => array(
81
+ 'type' => 'title',
82
+ 'title' => __( 'Button Settings', 'woo-stripe-payment' ),
83
+ ),
84
+ 'button_style' => array(
85
+ 'type' => 'select',
86
+ 'title' => __( 'Button Design', 'woo-stripe-payment' ),
87
+ 'class' => 'wc-enhanced-select',
88
+ 'default' => 'apple-pay-button-black',
89
+ 'options' => array(
90
+ 'apple-pay-button-black' => __( 'Black Button', 'woo-stripe-payment' ),
91
+ 'apple-pay-button-white-with-line' => __( 'White With Black Line', 'woo-stripe-payment' ),
92
+ 'apple-pay-button-white' => __( 'White Button', 'woo-stripe-payment' ),
93
+ ),
94
+ 'description' => __( 'This is the style for all Apple Pay buttons presented on your store.', 'woo-stripe-payment' ),
95
+ ),
96
+ 'button_type_checkout' => array(
97
+ 'title' => __( 'Checkout button type', 'woo-stripe-payment' ),
98
+ 'type' => 'select',
99
+ 'options' => array(
100
+ 'plain' => __( 'Standard Button', 'woo-stripe-payment' ),
101
+ 'buy' => __( 'Buy with Apple Pay', 'woo-stripe-payment' ),
102
+ 'check-out' => __( 'Checkout with Apple Pay', 'woo-stripe-payment' )
103
+ ),
104
+ 'default' => 'plain',
105
+ ),
106
+ 'button_type_cart' => array(
107
+ 'title' => __( 'Cart button type', 'woo-stripe-payment' ),
108
+ 'type' => 'select',
109
+ 'options' => array(
110
+ 'plain' => __( 'Standard Button', 'woo-stripe-payment' ),
111
+ 'buy' => __( 'Buy with Apple Pay', 'woo-stripe-payment' ),
112
+ 'check-out' => __( 'Checkout with Apple Pay', 'woo-stripe-payment' )
113
+ ),
114
+ 'default' => 'plain',
115
+ ),
116
+ 'button_type_product' => array(
117
+ 'title' => __( 'Product button type', 'woo-stripe-payment' ),
118
+ 'type' => 'select',
119
+ 'options' => array(
120
+ 'plain' => __( 'Standard Button', 'woo-stripe-payment' ),
121
+ 'buy' => __( 'Buy with Apple Pay', 'woo-stripe-payment' ),
122
+ 'check-out' => __( 'Checkout with Apple Pay', 'woo-stripe-payment' )
123
+ ),
124
+ 'default' => 'buy',
125
+ ),
126
+ );
includes/traits/wc-stripe-settings-trait.php CHANGED
@@ -37,7 +37,7 @@ trait WC_Stripe_Settings_Trait {
37
  }
38
 
39
  public function output_settings_nav() {
40
- include wc_stripe()->plugin_path() . 'includes/admin/views/html-settings-nav.php';
41
  }
42
 
43
  /**
@@ -87,7 +87,7 @@ trait WC_Stripe_Settings_Trait {
87
  )
88
  );
89
  ob_start();
90
- include wc_stripe()->plugin_path() . 'includes/admin/views/html-description.php';
91
 
92
  return ob_get_clean();
93
  }
@@ -108,7 +108,7 @@ trait WC_Stripe_Settings_Trait {
108
  $data['label'] = $data['title'];
109
  }
110
  ob_start();
111
- include wc_stripe()->plugin_path() . 'includes/admin/views/html-paragraph.php';
112
 
113
  return ob_get_clean();
114
  }
@@ -129,7 +129,7 @@ trait WC_Stripe_Settings_Trait {
129
  )
130
  );
131
  ob_start();
132
- include wc_stripe()->plugin_path() . 'includes/admin/views/html-button.php';
133
 
134
  return ob_get_clean();
135
  }
@@ -148,7 +148,7 @@ trait WC_Stripe_Settings_Trait {
148
  )
149
  );
150
  ob_start();
151
- include wc_stripe()->plugin_path() . 'includes/admin/views/html-button-demo.php';
152
 
153
  return ob_get_clean();
154
  }
37
  }
38
 
39
  public function output_settings_nav() {
40
+ include stripe_wc()->plugin_path() . 'includes/admin/views/html-settings-nav.php';
41
  }
42
 
43
  /**
87
  )
88
  );
89
  ob_start();
90
+ include stripe_wc()->plugin_path() . 'includes/admin/views/html-description.php';
91
 
92
  return ob_get_clean();
93
  }
108
  $data['label'] = $data['title'];
109
  }
110
  ob_start();
111
+ include stripe_wc()->plugin_path() . 'includes/admin/views/html-paragraph.php';
112
 
113
  return ob_get_clean();
114
  }
129
  )
130
  );
131
  ob_start();
132
+ include stripe_wc()->plugin_path() . 'includes/admin/views/html-button.php';
133
 
134
  return ob_get_clean();
135
  }
148
  )
149
  );
150
  ob_start();
151
+ include stripe_wc()->plugin_path() . 'includes/admin/views/html-button-demo.php';
152
 
153
  return ob_get_clean();
154
  }
includes/updates/update-3.0.7.php CHANGED
@@ -1,38 +1,38 @@
1
- <?php
2
- defined( 'ABSPATH' ) || exit();
3
-
4
- use Stripe\Webhook;
5
- use Stripe\WebhookEndpoint;
6
- use Stripe\ApiOperations\Delete;
7
-
8
- /**
9
- * This update reconfigured the webhooks for each environment.
10
- */
11
- $environments = array( 'live', 'test' );
12
- $api_settings = wc_stripe()->api_settings;
13
- $url = wc_stripe()->rest_api->webhook->rest_url( 'webhook' );
14
-
15
- foreach ( $environments as $env ) {
16
- $gateway = new WC_Stripe_Gateway();
17
- $webhooks = $gateway->webhooks( $env );
18
-
19
- if ( ! is_wp_error( $webhooks ) ) {
20
- // first delete the webhook if it matches the wp-json webhook. Then re-create it.
21
- foreach ( $webhooks->data as $webhook ) {
22
- /**
23
- *
24
- * @var Stripe\WebhookEndpoint $webhook
25
- */
26
- if ( $webhook['url'] == $url ) {
27
- $webhook->delete();
28
- }
29
- }
30
- }
31
- // now that endpoint is deleted, re-create it and store details.
32
- $webhook = $gateway->create_webhook( $url, array( 'charge.failed', 'charge.succeeded', 'source.chargeable' ), $env );
33
- if ( ! is_wp_error( $webhook ) ) {
34
- $api_settings->update_option( "webhook_url_{$env}", $webhook['url'] );
35
- $api_settings->update_option( "webhook_secret_{$env}", $webhook['secret'] );
36
- $api_settings->update_option( "webhook_id_{$env}", $webhook['id'] );
37
- }
38
- }
1
+ <?php
2
+ defined( 'ABSPATH' ) || exit();
3
+
4
+ use Stripe\Webhook;
5
+ use Stripe\WebhookEndpoint;
6
+ use Stripe\ApiOperations\Delete;
7
+
8
+ /**
9
+ * This update reconfigured the webhooks for each environment.
10
+ */
11
+ $environments = array( 'live', 'test' );
12
+ $api_settings = stripe_wc()->api_settings;
13
+ $url = stripe_wc()->rest_api->webhook->rest_url( 'webhook' );
14
+
15
+ foreach ( $environments as $env ) {
16
+ $gateway = new WC_Stripe_Gateway();
17
+ $webhooks = $gateway->webhooks( $env );
18
+
19
+ if ( ! is_wp_error( $webhooks ) ) {
20
+ // first delete the webhook if it matches the wp-json webhook. Then re-create it.
21
+ foreach ( $webhooks->data as $webhook ) {
22
+ /**
23
+ *
24
+ * @var Stripe\WebhookEndpoint $webhook
25
+ */
26
+ if ( $webhook['url'] == $url ) {
27
+ $webhook->delete();
28
+ }
29
+ }
30
+ }
31
+ // now that endpoint is deleted, re-create it and store details.
32
+ $webhook = $gateway->create_webhook( $url, array( 'charge.failed', 'charge.succeeded', 'source.chargeable' ), $env );
33
+ if ( ! is_wp_error( $webhook ) ) {
34
+ $api_settings->update_option( "webhook_url_{$env}", $webhook['url'] );
35
+ $api_settings->update_option( "webhook_secret_{$env}", $webhook['secret'] );
36
+ $api_settings->update_option( "webhook_id_{$env}", $webhook['id'] );
37
+ }
38
+ }
includes/updates/update-3.1.0.php CHANGED
@@ -1,55 +1,55 @@
1
- <?php
2
- defined( 'ABSPATH' ) || exit();
3
-
4
- // update webhooks to include payment_intent.succeeded
5
- $environments = array( 'live', 'test' );
6
-
7
- foreach ( $environments as $env ) {
8
- $webhook_id = wc_stripe()->api_settings->get_option( "webhook_id_{$env}" );
9
- if ( $webhook_id ) {
10
- $gateway = WC_Stripe_Gateway::load( $env );
11
-
12
- // fetch webhook so we can merge existing events with the new payment_intent.succeeded event
13
- $webhook = $gateway->webhookEndpoints->retrieve( $webhook_id );
14
- if ( ! is_wp_error( $webhook ) ) {
15
- $events = $webhook['enabled_events'];
16
- $events[] = 'payment_intent.succeeded';
17
-
18
- $result = $gateway->webhookEndpoints->update( $webhook_id, array( 'enabled_events' => $events ) );
19
- wc_stripe_log_info( "Webhook {$webhook_id} updated." );
20
- }
21
- }
22
- }
23
-
24
- update_option( 'wc_stripe_connect_notice', 'yes' );
25
-
26
- // send email
27
- ob_start();
28
- WC_Emails::instance()->email_header( __( 'Stripe For WooCommerce Update', 'woo-stripe-payment' ) );
29
- ?>
30
- <p><?php _e( 'Greetings from Payment Plugins,', 'woo-stripe-payment' ); ?></p>
31
- <p><?php _e( 'At Stripe\'s request, we have updated Stripe for WooCommerce to use the new Stripe Connect integration. This new integration offers even more security. Stripe is requesting that all merchants switch.', 'woo-stripe-payment' ); ?></p>
32
- <p><?php printf( __( 'Click %1$shere%2$s to be redirected to your Stripe API settings page then click the <strong>Click to Connect</strong> button.', 'woo-stripe-payment' ), '<a href="' . admin_url( 'admin.php?page=wc-settings&tab=checkout&section=stripe_api' ) . '" target="_blank">', '</a>' ); ?>
33
-
34
-
35
- <p><?php _e( 'Kind Regards,', 'woo-stripe-payment' ); ?></p>
36
- <p><?php _e( 'Payment Plugins' ); ?></p>
37
- <?php
38
- WC_Emails::instance()->email_footer();
39
- $content = ob_get_clean();
40
- $settings = get_option( 'woocommerce_new_order_settings', array( 'recipient' => get_option( 'admin_email', '' ) ) );
41
- $email = new WC_Email();
42
- $email->email_type = 'html';
43
- add_filter(
44
- 'woocommerce_email_from_address',
45
- function ( $from ) {
46
- return 'support@paymentplugins.com';
47
- }
48
- );
49
- add_filter(
50
- 'woocommerce_email_from_name',
51
- function ( $name ) {
52
- return 'Payment Plugins';
53
- }
54
- );
55
- $email->send( $settings['recipient'], __( 'Stripe For WooCommerce Update', 'woo-stripe-payment' ), $content, $email->get_headers(), array() );
1
+ <?php
2
+ defined( 'ABSPATH' ) || exit();
3
+
4
+ // update webhooks to include payment_intent.succeeded
5
+ $environments = array( 'live', 'test' );
6
+
7
+ foreach ( $environments as $env ) {
8
+ $webhook_id = stripe_wc()->api_settings->get_option( "webhook_id_{$env}" );
9
+ if ( $webhook_id ) {
10
+ $gateway = WC_Stripe_Gateway::load( $env );
11
+
12
+ // fetch webhook so we can merge existing events with the new payment_intent.succeeded event
13
+ $webhook = $gateway->webhookEndpoints->retrieve( $webhook_id );
14
+ if ( ! is_wp_error( $webhook ) ) {
15
+ $events = $webhook['enabled_events'];
16
+ $events[] = 'payment_intent.succeeded';
17
+
18
+ $result = $gateway->webhookEndpoints->update( $webhook_id, array( 'enabled_events' => $events ) );
19
+ wc_stripe_log_info( "Webhook {$webhook_id} updated." );
20
+ }
21
+ }
22
+ }
23
+
24
+ update_option( 'wc_stripe_connect_notice', 'yes' );
25
+
26
+ // send email
27
+ ob_start();
28
+ WC_Emails::instance()->email_header( __( 'Stripe For WooCommerce Update', 'woo-stripe-payment' ) );
29
+ ?>
30
+ <p><?php _e( 'Greetings from Payment Plugins,', 'woo-stripe-payment' ); ?></p>
31
+ <p><?php _e( 'At Stripe\'s request, we have updated Stripe for WooCommerce to use the new Stripe Connect integration. This new integration offers even more security. Stripe is requesting that all merchants switch.', 'woo-stripe-payment' ); ?></p>
32
+ <p><?php printf( __( 'Click %1$shere%2$s to be redirected to your Stripe API settings page then click the <strong>Click to Connect</strong> button.', 'woo-stripe-payment' ), '<a href="' . admin_url( 'admin.php?page=wc-settings&tab=checkout&section=stripe_api' ) . '" target="_blank">', '</a>' ); ?>
33
+
34
+
35
+ <p><?php _e( 'Kind Regards,', 'woo-stripe-payment' ); ?></p>
36
+ <p><?php _e( 'Payment Plugins' ); ?></p>
37
+ <?php
38
+ WC_Emails::instance()->email_footer();
39
+ $content = ob_get_clean();
40
+ $settings = get_option( 'woocommerce_new_order_settings', array( 'recipient' => get_option( 'admin_email', '' ) ) );
41
+ $email = new WC_Email();
42
+ $email->email_type = 'html';
43
+ add_filter(
44
+ 'woocommerce_email_from_address',
45
+ function ( $from ) {
46
+ return 'support@paymentplugins.com';
47
+ }
48
+ );
49
+ add_filter(
50
+ 'woocommerce_email_from_name',
51
+ function ( $name ) {
52
+ return 'Payment Plugins';
53
+ }
54
+ );
55
+ $email->send( $settings['recipient'], __( 'Stripe For WooCommerce Update', 'woo-stripe-payment' ), $content, $email->get_headers(), array() );
includes/updates/update-3.1.6.php CHANGED
@@ -2,4 +2,4 @@
2
  /**
3
  * Schedule actions required by the plugin.
4
  */
5
- wc_stripe()->scheduled_actions();
2
  /**
3
  * Schedule actions required by the plugin.
4
  */
5
+ stripe_wc()->scheduled_actions();
includes/updates/update-3.1.7.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- $account_id = wc_stripe()->api_settings->get_option( 'account_id' );
3
  if ( $account_id ) {
4
- wc_stripe()->account_settings->save_account_settings( $account_id );
5
  }
1
  <?php
2
+ $account_id = stripe_wc()->api_settings->get_option( 'account_id' );
3
  if ( $account_id ) {
4
+ stripe_wc()->account_settings->save_account_settings( $account_id );
5
  }
includes/updates/update-3.2.8.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This update replaces use of wc_stripe function with stripe_wc. In version 4.5.4 of the WooCommerce
4
+ * Stripe Payment Gateway plugin, a function named wc_stripe was introduced which creates a critical error
5
+ * due to function having already been declared.
6
+ */
7
+ require_once( ABSPATH . 'wp-admin/includes/file.php' );
8
+ WP_Filesystem();
9
+ /**
10
+ *
11
+ * @var WP_Filesystem_Base $wp_filesystem
12
+ */
13
+ global $wp_filesystem;
14
+
15
+ // check to see if the following files exist
16
+ $templates = array( 'card-icons.php', 'payment-request-icons.php', 'cc-forms/minimalist.php' );
17
+
18
+ if ( $wp_filesystem ) {
19
+ foreach ( $templates as $template_name ) {
20
+ $args = array(
21
+ trailingslashit( stripe_wc()->template_path() ) . $template_name,
22
+ $template_name
23
+ );
24
+ if ( ( $template = locate_template( $args ) ) ) {
25
+ // template exists so replace wc_stripe with stripe_wc function
26
+ if ( ( $contents = $wp_filesystem->get_contents( $template ) ) ) {
27
+ $contents = str_replace( 'wc_stripe', 'stripe_wc', $contents );
28
+ if ( $wp_filesystem->put_contents( $template, $contents ) ) {
29
+ wc_stripe_log_info( sprintf( 'template %s replaced function wc_stripe with stripe_wc', $template_name ) );
30
+ }
31
+ }
32
+ }
33
+ }
34
+ }
includes/wc-stripe-functions.php CHANGED
@@ -11,7 +11,7 @@ defined( 'ABSPATH' ) || exit();
11
  * Wrapper for wc_get_template that returns Stripe specfic templates.
12
  */
13
  function wc_stripe_get_template( $template_name, $args = array() ) {
14
- wc_get_template( $template_name, $args, wc_stripe()->template_path(), wc_stripe()->default_template_path() );
15
  }
16
 
17
  /**
@@ -27,7 +27,7 @@ function wc_stripe_get_template( $template_name, $args = array() ) {
27
  * @package Stripe/Functions
28
  */
29
  function wc_stripe_get_template_html( $template_name, $args = array() ) {
30
- return wc_get_template_html( $template_name, $args, wc_stripe()->template_path(), wc_stripe()->default_template_path() );
31
  }
32
 
33
  /**
@@ -79,7 +79,7 @@ function wc_stripe_hidden_field( $id, $class = '', $value = '' ) {
79
  * @package Stripe/Functions
80
  */
81
  function wc_stripe_mode() {
82
- return apply_filters( 'wc_stripe_mode', wc_stripe()->api_settings->get_option( 'mode' ) );
83
  }
84
 
85
  /**
@@ -94,7 +94,7 @@ function wc_stripe_mode() {
94
  function wc_stripe_get_secret_key( $mode = '' ) {
95
  $mode = empty( $mode ) ? wc_stripe_mode() : $mode;
96
 
97
- return apply_filters( 'wc_stripe_get_secret_key', wc_stripe()->api_settings->get_option( "secret_key_{$mode}" ), $mode );
98
  }
99
 
100
  /**
@@ -109,7 +109,7 @@ function wc_stripe_get_secret_key( $mode = '' ) {
109
  function wc_stripe_get_publishable_key( $mode = '' ) {
110
  $mode = empty( $mode ) ? wc_stripe_mode() : $mode;
111
 
112
- return apply_filters( 'wc_stripe_get_publishable_key', wc_stripe()->api_settings->get_option( "publishable_key_{$mode}" ), $mode );
113
  }
114
 
115
  /**
@@ -120,7 +120,7 @@ function wc_stripe_get_publishable_key( $mode = '' ) {
120
  * @package Stripe/Functions
121
  */
122
  function wc_stripe_get_account_id() {
123
- return apply_filters( 'wc_stripe_get_account_id', wc_stripe()->api_settings->get_option( 'account_id' ) );
124
  }
125
 
126
  /**
@@ -183,7 +183,7 @@ function wc_stripe_woocommerce_payment_token_deleted( $token_id, $token ) {
183
  * @package Stripe/Functions
184
  */
185
  function wc_stripe_log( $level, $message ) {
186
- if ( wc_stripe()->api_settings->is_active( 'debug_log' ) ) {
187
  $log = wc_get_logger();
188
  $log->log( $level, $message, array( 'source' => 'wc-stripe' ) );
189
  }
@@ -236,7 +236,7 @@ function wc_stripe_order_mode( $order ) {
236
  * @since 3.0.0
237
  */
238
  function wc_stripe_payment_gateways( $gateways ) {
239
- return array_merge( $gateways, wc_stripe()->payment_gateways() );
240
  }
241
 
242
  /**
@@ -811,7 +811,7 @@ function wc_stripe_get_custom_forms() {
811
  'bootstrap' => array(
812
  'template' => 'cc-forms/bootstrap.php',
813
  'label' => __( 'Bootstrap form', 'woo-stripe-payment' ),
814
- 'cardBrand' => wc_stripe()->assets_url( 'img/card_brand2.svg' ),
815
  'elementStyles' => array(
816
  'base' => array(
817
  'color' => '#495057',
@@ -837,7 +837,7 @@ function wc_stripe_get_custom_forms() {
837
  'simple' => array(
838
  'template' => 'cc-forms/simple.php',
839
  'label' => __( 'Simple form', 'woo-stripe-payment' ),
840
- 'cardBrand' => wc_stripe()->assets_url( 'img/card_brand2.svg' ),
841
  'elementStyles' => array(
842
  'base' => array(
843
  'color' => '#32325D',
@@ -860,7 +860,7 @@ function wc_stripe_get_custom_forms() {
860
  'minimalist' => array(
861
  'template' => 'cc-forms/minimalist.php',
862
  'label' => __( 'Minimalist form', 'woo-stripe-payment' ),
863
- 'cardBrand' => wc_stripe()->assets_url( 'img/card_brand2.svg' ),
864
  'elementStyles' => array(
865
  'base' => array(
866
  'color' => '#495057',
@@ -886,7 +886,7 @@ function wc_stripe_get_custom_forms() {
886
  'inline' => array(
887
  'template' => 'cc-forms/inline.php',
888
  'label' => __( 'Inline Form', 'woo-stripe-payment' ),
889
- 'cardBrand' => wc_stripe()->assets_url( 'img/card_brand.svg' ),
890
  'elementStyles' => array(
891
  'base' => array(
892
  'color' => '#819efc',
@@ -908,7 +908,7 @@ function wc_stripe_get_custom_forms() {
908
  'rounded' => array(
909
  'template' => 'cc-forms/round.php',
910
  'label' => __( 'Rounded Form', 'woo-stripe-payment' ),
911
- 'cardBrand' => wc_stripe()->assets_url( 'img/card_brand.svg' ),
912
  'elementStyles' => array(
913
  'base' => array(
914
  'color' => '#fff',
11
  * Wrapper for wc_get_template that returns Stripe specfic templates.
12
  */
13
  function wc_stripe_get_template( $template_name, $args = array() ) {
14
+ wc_get_template( $template_name, $args, stripe_wc()->template_path(), stripe_wc()->default_template_path() );
15
  }
16
 
17
  /**
27
  * @package Stripe/Functions
28
  */
29
  function wc_stripe_get_template_html( $template_name, $args = array() ) {
30
+ return wc_get_template_html( $template_name, $args, stripe_wc()->template_path(), stripe_wc()->default_template_path() );
31
  }
32
 
33
  /**
79
  * @package Stripe/Functions
80
  */
81
  function wc_stripe_mode() {
82
+ return apply_filters( 'wc_stripe_mode', stripe_wc()->api_settings->get_option( 'mode' ) );
83
  }
84
 
85
  /**
94
  function wc_stripe_get_secret_key( $mode = '' ) {
95
  $mode = empty( $mode ) ? wc_stripe_mode() : $mode;
96
 
97
+ return apply_filters( 'wc_stripe_get_secret_key', stripe_wc()->api_settings->get_option( "secret_key_{$mode}" ), $mode );
98
  }
99
 
100
  /**
109
  function wc_stripe_get_publishable_key( $mode = '' ) {
110
  $mode = empty( $mode ) ? wc_stripe_mode() : $mode;
111
 
112
+ return apply_filters( 'wc_stripe_get_publishable_key', stripe_wc()->api_settings->get_option( "publishable_key_{$mode}" ), $mode );
113
  }
114
 
115
  /**
120
  * @package Stripe/Functions
121
  */
122
  function wc_stripe_get_account_id() {
123
+ return apply_filters( 'wc_stripe_get_account_id', stripe_wc()->api_settings->get_option( 'account_id' ) );
124
  }
125
 
126
  /**
183
  * @package Stripe/Functions
184
  */
185
  function wc_stripe_log( $level, $message ) {
186
+ if ( stripe_wc()->api_settings->is_active( 'debug_log' ) ) {
187
  $log = wc_get_logger();
188
  $log->log( $level, $message, array( 'source' => 'wc-stripe' ) );
189
  }
236
  * @since 3.0.0
237
  */
238
  function wc_stripe_payment_gateways( $gateways ) {
239
+ return array_merge( $gateways, stripe_wc()->payment_gateways() );
240
  }
241
 
242
  /**
811
  'bootstrap' => array(
812
  'template' => 'cc-forms/bootstrap.php',
813
  'label' => __( 'Bootstrap form', 'woo-stripe-payment' ),
814
+ 'cardBrand' => stripe_wc()->assets_url( 'img/card_brand2.svg' ),
815
  'elementStyles' => array(
816
  'base' => array(
817
  'color' => '#495057',
837
  'simple' => array(
838
  'template' => 'cc-forms/simple.php',
839
  'label' => __( 'Simple form', 'woo-stripe-payment' ),
840
+ 'cardBrand' => stripe_wc()->assets_url( 'img/card_brand2.svg' ),
841
  'elementStyles' => array(
842
  'base' => array(
843
  'color' => '#32325D',
860
  'minimalist' => array(
861
  'template' => 'cc-forms/minimalist.php',
862
  'label' => __( 'Minimalist form', 'woo-stripe-payment' ),
863
+ 'cardBrand' => stripe_wc()->assets_url( 'img/card_brand2.svg' ),
864
  'elementStyles' => array(
865
  'base' => array(
866
  'color' => '#495057',
886
  'inline' => array(
887
  'template' => 'cc-forms/inline.php',
888
  'label' => __( 'Inline Form', 'woo-stripe-payment' ),
889
+ 'cardBrand' => stripe_wc()->assets_url( 'img/card_brand.svg' ),
890
  'elementStyles' => array(
891
  'base' => array(
892
  'color' => '#819efc',
908
  'rounded' => array(
909
  'template' => 'cc-forms/round.php',
910
  'label' => __( 'Rounded Form', 'woo-stripe-payment' ),
911
+ 'cardBrand' => stripe_wc()->assets_url( 'img/card_brand.svg' ),
912
  'elementStyles' => array(
913
  'base' => array(
914
  'color' => '#fff',
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: stripe, ach, klarna, credit card, apple pay, google pay, ideal, sepa, sofo
4
  Requires at least: 3.0.1
5
  Tested up to: 5.5
6
  Requires PHP: 5.6
7
- Stable tag: 3.2.7
8
  Copyright: Payment Plugins
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -58,6 +58,11 @@ If you're site is not loading over https, then Stripe won't render the Payment R
58
  8. Edit payment gateways on the product page
59
 
60
  == Changelog ==
 
 
 
 
 
61
  = 3.2.7 =
62
  * Added - Better support for mixed cart/checkout page using Elementor
63
  * Added - wc_stripe_save_order_meta action added so custom data can be added to order
4
  Requires at least: 3.0.1
5
  Tested up to: 5.5
6
  Requires PHP: 5.6
7
+ Stable tag: 3.2.8
8
  Copyright: Payment Plugins
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
58
  8. Edit payment gateways on the product page
59
 
60
  == Changelog ==
61
+ = 3.2.8 =
62
+ * Updated - Changed function wc_stripe to stripe_wc because WooCommerce Stripe Payment Gateway introduced a function with same name in version 4.5.4 which caused a fatal error.
63
+ * Updated - Apple Pay and GPay - if billing address already populated, don't request it in wallet.
64
+ * Updated - Convert long version of state/province for GPay to abbreviation. California = CA
65
+ * Updated - Updated Klarna checkout flow for improved user experience.
66
  = 3.2.7 =
67
  * Added - Better support for mixed cart/checkout page using Elementor
68
  * Added - wc_stripe_save_order_meta action added so custom data can be added to order
stripe-payments.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Stripe For WooCommerce
4
  * Plugin URI: https://docs.paymentplugins.com/wc-stripe/config/
5
  * Description: Accept credit cards, Google Pay, Apple Pay, ACH, Klarna and more using Stripe.
6
- * Version: 3.2.7
7
  * Author: Payment Plugins, support@paymentplugins.com
8
  * Text Domain: woo-stripe-payment
9
  * Domain Path: /i18n/languages/
3
  * Plugin Name: Stripe For WooCommerce
4
  * Plugin URI: https://docs.paymentplugins.com/wc-stripe/config/
5
  * Description: Accept credit cards, Google Pay, Apple Pay, ACH, Klarna and more using Stripe.
6
+ * Version: 3.2.8
7
  * Author: Payment Plugins, support@paymentplugins.com
8
  * Text Domain: woo-stripe-payment
9
  * Domain Path: /i18n/languages/
templates/card-icons.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
  /**
3
- * @version 3.0.0
4
  */
5
  ?>
6
  <span class="wc-stripe-card-icons-container">
7
- <?php foreach($cards as $id):?>
8
- <img class="wc-stripe-card-icon"
9
- src="<?php echo wc_stripe()->assets_url() . 'img/cards/' . $id . '.svg'?>" />
10
- <?php endforeach;?>
11
  </span>
1
  <?php
2
  /**
3
+ * @version 3.2.8
4
  */
5
  ?>
6
  <span class="wc-stripe-card-icons-container">
7
+ <?php foreach ( $cards as $id ): ?>
8
+ <img class="wc-stripe-card-icon"
9
+ src="<?php echo $assets_url . 'img/cards/' . $id . '.svg' ?>"/>
10
+ <?php endforeach; ?>
11
  </span>
templates/cc-forms/minimalist.php CHANGED
@@ -3,7 +3,7 @@
3
  * @version 3.0.5
4
  */
5
  $steps = $gateway->postal_enabled() ? 4 : 3;
6
- wc_stripe()->scripts()->enqueue_script('cc-forms', wc_stripe()->assets_url('js/frontend/cc-forms.js'), array(wc_stripe()->scripts()->get_handle('credit-card')));
7
  ?>
8
  <div class="wc-stripe-minimalist-form">
9
  <div class="Wc-stripe-steps-container">
3
  * @version 3.0.5
4
  */
5
  $steps = $gateway->postal_enabled() ? 4 : 3;
6
+ stripe_wc()->scripts()->enqueue_script('cc-forms', stripe_wc()->assets_url('js/frontend/cc-forms.js'), array(stripe_wc()->scripts()->get_handle('credit-card')));
7
  ?>
8
  <div class="wc-stripe-minimalist-form">
9
  <div class="Wc-stripe-steps-container">
templates/payment-request-icons.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
  /**
3
- * @version 3.0.0
4
  */
5
  ?>
6
  <div class="wc-stripe-paymentRequest-icons-container">
7
  <img class="wc-stripe-paymentRequest-icon"
8
- src="<?php echo wc_stripe()->assets_url('img/chrome.svg')?>" /> <img
9
  class="wc-stripe-paymentRequest-icon"
10
- src="<?php echo wc_stripe()->assets_url('img/edge.svg')?>" />
11
  </div>
1
  <?php
2
  /**
3
+ * @version 3.2.8
4
  */
5
  ?>
6
  <div class="wc-stripe-paymentRequest-icons-container">
7
  <img class="wc-stripe-paymentRequest-icon"
8
+ src="<?php echo stripe_wc()->assets_url('img/chrome.svg')?>" /> <img
9
  class="wc-stripe-paymentRequest-icon"
10
+ src="<?php echo stripe_wc()->assets_url('img/edge.svg')?>" />
11
  </div>
vendor/composer/installed.json CHANGED
@@ -1,17 +1,17 @@
1
  [
2
  {
3
  "name": "stripe/stripe-php",
4
- "version": "v7.52.0",
5
- "version_normalized": "7.52.0.0",
6
  "source": {
7
  "type": "git",
8
  "url": "https://github.com/stripe/stripe-php.git",
9
- "reference": "51e95c514aff45616dff09791ca5b2f10cf5c4e8"
10
  },
11
  "dist": {
12
  "type": "zip",
13
- "url": "https://api.github.com/repos/stripe/stripe-php/zipball/51e95c514aff45616dff09791ca5b2f10cf5c4e8",
14
- "reference": "51e95c514aff45616dff09791ca5b2f10cf5c4e8",
15
  "shasum": ""
16
  },
17
  "require": {
@@ -21,13 +21,13 @@
21
  "php": ">=5.6.0"
22
  },
23
  "require-dev": {
24
- "friendsofphp/php-cs-fixer": "2.16.1",
25
  "php-coveralls/php-coveralls": "^2.1",
26
  "phpunit/phpunit": "^5.7",
27
  "squizlabs/php_codesniffer": "^3.3",
28
  "symfony/process": "~3.4"
29
  },
30
- "time": "2020-09-08T19:29:20+00:00",
31
  "type": "library",
32
  "extra": {
33
  "branch-alias": {
1
  [
2
  {
3
  "name": "stripe/stripe-php",
4
+ "version": "v7.62.0",
5
+ "version_normalized": "7.62.0.0",
6
  "source": {
7
  "type": "git",
8
  "url": "https://github.com/stripe/stripe-php.git",
9
+ "reference": "9c2fc846d5b2719945e825228474f15314c0fed6"
10
  },
11
  "dist": {
12
  "type": "zip",
13
+ "url": "https://api.github.com/repos/stripe/stripe-php/zipball/9c2fc846d5b2719945e825228474f15314c0fed6",
14
+ "reference": "9c2fc846d5b2719945e825228474f15314c0fed6",
15
  "shasum": ""
16
  },
17
  "require": {
21
  "php": ">=5.6.0"
22
  },
23
  "require-dev": {
24
+ "friendsofphp/php-cs-fixer": "2.16.5",
25
  "php-coveralls/php-coveralls": "^2.1",
26
  "phpunit/phpunit": "^5.7",
27
  "squizlabs/php_codesniffer": "^3.3",
28
  "symfony/process": "~3.4"
29
  },
30
+ "time": "2020-11-09T16:57:44+00:00",
31
  "type": "library",
32
  "extra": {
33
  "branch-alias": {
vendor/stripe/stripe-php/CHANGELOG.md CHANGED
@@ -1,5 +1,38 @@
1
  # Changelog
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ## 7.52.0 - 2020-09-08
4
  * [#1010](https://github.com/stripe/stripe-php/pull/1010) Update PHPDocs
5
 
1
  # Changelog
2
 
3
+ ## 7.62.0 - 2020-11-09
4
+ * [#1041](https://github.com/stripe/stripe-php/pull/1041) Add missing constants on `Event`
5
+ * [#1038](https://github.com/stripe/stripe-php/pull/1038) Update PHPDocs
6
+
7
+ ## 7.61.0 - 2020-10-20
8
+ * [#1030](https://github.com/stripe/stripe-php/pull/1030) Add support for `jp_rn` and `ru_kpp` as a `type` on `TaxId`
9
+
10
+ ## 7.60.0 - 2020-10-15
11
+ * [#1027](https://github.com/stripe/stripe-php/pull/1027) Warn if opts are in params
12
+
13
+ ## 7.58.0 - 2020-10-14
14
+ * [#1026](https://github.com/stripe/stripe-php/pull/1026) Add support for the Payout Reverse API
15
+
16
+ ## 7.57.0 - 2020-09-29
17
+ * [#1020](https://github.com/stripe/stripe-php/pull/1020) Add support for the `SetupAttempt` resource and List API
18
+
19
+ ## 7.56.0 - 2020-09-25
20
+ * [#1019](https://github.com/stripe/stripe-php/pull/1019) Update PHPDocs
21
+
22
+ ## 7.55.0 - 2020-09-24
23
+ * [#1018](https://github.com/stripe/stripe-php/pull/1018) Multiple API changes
24
+ * Updated PHPDocs
25
+ * Added `TYPE_CONTRIBUTION` as a constant on `BalanceTransaction`
26
+
27
+ ## 7.54.0 - 2020-09-23
28
+ * [#1017](https://github.com/stripe/stripe-php/pull/1017) Updated PHPDoc
29
+
30
+ ## 7.53.1 - 2020-09-22
31
+ * [#1015](https://github.com/stripe/stripe-php/pull/1015) Bugfix: don't error on systems with php_uname in disablefunctions with whitespace
32
+
33
+ ## 7.53.0 - 2020-09-21
34
+ * [#1016](https://github.com/stripe/stripe-php/pull/1016) Updated PHPDocs
35
+
36
  ## 7.52.0 - 2020-09-08
37
  * [#1010](https://github.com/stripe/stripe-php/pull/1010) Update PHPDocs
38
 
vendor/stripe/stripe-php/VERSION CHANGED
@@ -1 +1 @@
1
- 7.52.0
1
+ 7.62.0
vendor/stripe/stripe-php/init.php CHANGED
@@ -134,6 +134,7 @@ require __DIR__ . '/lib/Refund.php';
134
  require __DIR__ . '/lib/Reporting/ReportRun.php';
135
  require __DIR__ . '/lib/Reporting/ReportType.php';
136
  require __DIR__ . '/lib/Review.php';
 
137
  require __DIR__ . '/lib/SetupIntent.php';
138
  require __DIR__ . '/lib/Sigma/ScheduledQueryRun.php';
139
  require __DIR__ . '/lib/SKU.php';
@@ -200,6 +201,7 @@ require __DIR__ . '/lib/Service/RefundService.php';
200
  require __DIR__ . '/lib/Service/Reporting/ReportRunService.php';
201
  require __DIR__ . '/lib/Service/Reporting/ReportTypeService.php';
202
  require __DIR__ . '/lib/Service/ReviewService.php';
 
203
  require __DIR__ . '/lib/Service/SetupIntentService.php';
204
  require __DIR__ . '/lib/Service/Sigma/ScheduledQueryRunService.php';
205
  require __DIR__ . '/lib/Service/SkuService.php';
134
  require __DIR__ . '/lib/Reporting/ReportRun.php';
135
  require __DIR__ . '/lib/Reporting/ReportType.php';
136
  require __DIR__ . '/lib/Review.php';
137
+ require __DIR__ . '/lib/SetupAttempt.php';
138
  require __DIR__ . '/lib/SetupIntent.php';
139
  require __DIR__ . '/lib/Sigma/ScheduledQueryRun.php';
140
  require __DIR__ . '/lib/SKU.php';
201
  require __DIR__ . '/lib/Service/Reporting/ReportRunService.php';
202
  require __DIR__ . '/lib/Service/Reporting/ReportTypeService.php';
203
  require __DIR__ . '/lib/Service/ReviewService.php';
204
+ require __DIR__ . '/lib/Service/SetupAttemptService.php';
205
  require __DIR__ . '/lib/Service/SetupIntentService.php';
206
  require __DIR__ . '/lib/Service/Sigma/ScheduledQueryRunService.php';
207
  require __DIR__ . '/lib/Service/SkuService.php';
vendor/stripe/stripe-php/lib/Account.php CHANGED
@@ -127,7 +127,7 @@ class Account extends ApiResource
127
  foreach ($additionalOwners as $i => $v) {
128
  $update = ($v instanceof StripeObject) ? $v->serializeParameters() : $v;
129
 
130
- if ($update !== []) {
131
  if (!$originalValue ||
132
  !\array_key_exists($i, $originalValue) ||
133
  ($update !== $legalEntity->serializeParamsValue($originalValue[$i], null, false, true))) {
127
  foreach ($additionalOwners as $i => $v) {
128
  $update = ($v instanceof StripeObject) ? $v->serializeParameters() : $v;
129
 
130
+ if ([] !== $update) {
131
  if (!$originalValue ||
132
  !\array_key_exists($i, $originalValue) ||
133
  ($update !== $legalEntity->serializeParamsValue($originalValue[$i], null, false, true))) {
vendor/stripe/stripe-php/lib/ApiRequestor.php CHANGED
@@ -27,6 +27,8 @@ class ApiRequestor
27
  */
28
  private static $requestTelemetry;
29
 
 
 
30
  /**
31
  * ApiRequestor constructor.
32
  *
@@ -255,6 +257,27 @@ class ApiRequestor
255
  return null;
256
  }
257
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
258
  /**
259
  * @static
260
  *
@@ -268,7 +291,7 @@ class ApiRequestor
268
  $uaString = 'Stripe/v1 PhpBindings/' . Stripe::VERSION;
269
 
270
  $langVersion = \PHP_VERSION;
271
- $uname_disabled = \in_array('php_uname', \explode(',', \ini_get('disable_functions')), true);
272
  $uname = $uname_disabled ? '(disabled)' : \php_uname();
273
 
274
  $appInfo = Stripe::getAppInfo();
@@ -329,6 +352,21 @@ class ApiRequestor
329
  $clientUAInfo = $this->httpClient()->getUserAgentInfo();
330
  }
331
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
332
  $absUrl = $this->_apiBase . $url;
333
  $params = self::_encodeObjects($params);
334
  $defaultHeaders = $this->_defaultHeaders($myApiKey, $clientUAInfo);
27
  */
28
  private static $requestTelemetry;
29
 
30
+ private static $OPTIONS_KEYS = ['api_key', 'idempotency_key', 'stripe_account', 'stripe_version', 'api_base'];
31
+
32
  /**
33
  * ApiRequestor constructor.
34
  *
257
  return null;
258
  }
259
 
260
+ /**
261
+ * @static
262
+ *
263
+ * @param string $disabledFunctionsOutput - String value of the 'disable_function' setting, as output by \ini_get('disable_functions')
264
+ * @param string $functionName - Name of the function we are interesting in seeing whether or not it is disabled
265
+ * @param mixed $disableFunctionsOutput
266
+ *
267
+ * @return bool
268
+ */
269
+ private static function _isDisabled($disableFunctionsOutput, $functionName)
270
+ {
271
+ $disabledFunctions = \explode(',', $disableFunctionsOutput);
272
+ foreach ($disabledFunctions as $disabledFunction) {
273
+ if (\trim($disabledFunction) === $functionName) {
274
+ return true;
275
+ }
276
+ }
277
+
278
+ return false;
279
+ }
280
+
281
  /**
282
  * @static
283
  *
291
  $uaString = 'Stripe/v1 PhpBindings/' . Stripe::VERSION;
292
 
293
  $langVersion = \PHP_VERSION;
294
+ $uname_disabled = static::_isDisabled(\ini_get('disable_functions'), 'php_uname');
295
  $uname = $uname_disabled ? '(disabled)' : \php_uname();
296
 
297
  $appInfo = Stripe::getAppInfo();
352
  $clientUAInfo = $this->httpClient()->getUserAgentInfo();
353
  }
354
 
355
+ if ($params && \is_array($params)) {
356
+ $optionKeysInParams = \array_filter(
357
+ static::$OPTIONS_KEYS,
358
+ function ($key) use ($params) {
359
+ return \array_key_exists($key, $params);
360
+ }
361
+ );
362
+ if (\count($optionKeysInParams) > 0) {
363
+ $message = \sprintf('Options found in $params: %s. Options should '
364
+ . 'be passed in their own array after $params. (HINT: pass an '
365
+ . 'empty array to $params if you do not have any.)', \implode(', ', $optionKeysInParams));
366
+ \trigger_error($message, \E_USER_WARNING);
367
+ }
368
+ }
369
+
370
  $absUrl = $this->_apiBase . $url;
371
  $params = self::_encodeObjects($params);
372
  $defaultHeaders = $this->_defaultHeaders($myApiKey, $clientUAInfo);
vendor/stripe/stripe-php/lib/ApplicationFeeRefund.php CHANGED
@@ -20,7 +20,7 @@ namespace Stripe;
20
  * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
21
  * @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
22
  * @property string|\Stripe\ApplicationFee $fee ID of the application fee that was refunded.
23
- * @property \Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
24
  */
25
  class ApplicationFeeRefund extends ApiResource
26
  {
20
  * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
21
  * @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
22
  * @property string|\Stripe\ApplicationFee $fee ID of the application fee that was refunded.
23
+ * @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
24
  */
25
  class ApplicationFeeRefund extends ApiResource
26
  {
vendor/stripe/stripe-php/lib/Balance.php CHANGED
@@ -22,6 +22,7 @@ namespace Stripe;
22
  * @property string $object String representing the object's type. Objects of the same type share the same value.
23
  * @property \Stripe\StripeObject[] $available Funds that are available to be transferred or paid out, whether automatically by Stripe or explicitly via the <a href="https://stripe.com/docs/api#transfers">Transfers API</a> or <a href="https://stripe.com/docs/api#payouts">Payouts API</a>. The available balance for each currency and payment type can be found in the <code>source_types</code> property.
24
  * @property \Stripe\StripeObject[] $connect_reserved Funds held due to negative balances on connected Custom accounts. The connect reserve balance for each currency and payment type can be found in the <code>source_types</code> property.
 
25
  * @property \Stripe\StripeObject $issuing
26
  * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
27
  * @property \Stripe\StripeObject[] $pending Funds that are not yet available in the balance, due to the 7-day rolling pay cycle. The pending balance for each currency, and for each payment type, can be found in the <code>source_types</code> property.
22
  * @property string $object String representing the object's type. Objects of the same type share the same value.
23
  * @property \Stripe\StripeObject[] $available Funds that are available to be transferred or paid out, whether automatically by Stripe or explicitly via the <a href="https://stripe.com/docs/api#transfers">Transfers API</a> or <a href="https://stripe.com/docs/api#payouts">Payouts API</a>. The available balance for each currency and payment type can be found in the <code>source_types</code> property.
24
  * @property \Stripe\StripeObject[] $connect_reserved Funds held due to negative balances on connected Custom accounts. The connect reserve balance for each currency and payment type can be found in the <code>source_types</code> property.
25
+ * @property \Stripe\StripeObject[] $instant_available Funds that can be paid out using Instant Payouts.
26
  * @property \Stripe\StripeObject $issuing
27
  * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
28
  * @property \Stripe\StripeObject[] $pending Funds that are not yet available in the balance, due to the 7-day rolling pay cycle. The pending balance for each currency, and for each payment type, can be found in the <code>source_types</code> property.
vendor/stripe/stripe-php/lib/BalanceTransaction.php CHANGED
@@ -27,7 +27,7 @@ namespace Stripe;
27
  * @property string $reporting_category <a href="https://stripe.com/docs/reports/reporting-categories">Learn more</a> about how reporting categories can help you understand balance transactions from an accounting perspective.
28
  * @property null|string|\Stripe\StripeObject $source The Stripe object to which this transaction is related.
29
  * @property string $status If the transaction's net funds are available in the Stripe balance yet. Either <code>available</code> or <code>pending</code>.
30
- * @property string $type Transaction type: <code>adjustment</code>, <code>advance</code>, <code>advance_funding</code>, <code>anticipation_repayment</code>, <code>application_fee</code>, <code>application_fee_refund</code>, <code>charge</code>, <code>connect_collection_transfer</code>, <code>issuing_authorization_hold</code>, <code>issuing_authorization_release</code>, <code>issuing_dispute</code>, <code>issuing_transaction</code>, <code>payment</code>, <code>payment_failure_refund</code>, <code>payment_refund</code>, <code>payout</code>, <code>payout_cancel</code>, <code>payout_failure</code>, <code>refund</code>, <code>refund_failure</code>, <code>reserve_transaction</code>, <code>reserved_funds</code>, <code>stripe_fee</code>, <code>stripe_fx_fee</code>, <code>tax_fee</code>, <code>topup</code>, <code>topup_reversal</code>, <code>transfer</code>, <code>transfer_cancel</code>, <code>transfer_failure</code>, or <code>transfer_refund</code>. <a href="https://stripe.com/docs/reports/balance-transaction-types">Learn more</a> about balance transaction types and what they represent. If you are looking to classify transactions for accounting purposes, you might want to consider <code>reporting_category</code> instead.
31
  */
32
  class BalanceTransaction extends ApiResource
33
  {
@@ -44,6 +44,7 @@ class BalanceTransaction extends ApiResource
44
  const TYPE_APPLICATION_FEE_REFUND = 'application_fee_refund';
45
  const TYPE_CHARGE = 'charge';
46
  const TYPE_CONNECT_COLLECTION_TRANSFER = 'connect_collection_transfer';
 
47
  const TYPE_ISSUING_AUTHORIZATION_HOLD = 'issuing_authorization_hold';
48
  const TYPE_ISSUING_AUTHORIZATION_RELEASE = 'issuing_authorization_release';
49
  const TYPE_ISSUING_DISPUTE = 'issuing_dispute';
27
  * @property string $reporting_category <a href="https://stripe.com/docs/reports/reporting-categories">Learn more</a> about how reporting categories can help you understand balance transactions from an accounting perspective.
28
  * @property null|string|\Stripe\StripeObject $source The Stripe object to which this transaction is related.
29
  * @property string $status If the transaction's net funds are available in the Stripe balance yet. Either <code>available</code> or <code>pending</code>.
30
+ * @property string $type Transaction type: <code>adjustment</code>, <code>advance</code>, <code>advance_funding</code>, <code>anticipation_repayment</code>, <code>application_fee</code>, <code>application_fee_refund</code>, <code>charge</code>, <code>connect_collection_transfer</code>, <code>contribution</code>, <code>issuing_authorization_hold</code>, <code>issuing_authorization_release</code>, <code>issuing_dispute</code>, <code>issuing_transaction</code>, <code>payment</code>, <code>payment_failure_refund</code>, <code>payment_refund</code>, <code>payout</code>, <code>payout_cancel</code>, <code>payout_failure</code>, <code>refund</code>, <code>refund_failure</code>, <code>reserve_transaction</code>, <code>reserved_funds</code>, <code>stripe_fee</code>, <code>stripe_fx_fee</code>, <code>tax_fee</code>, <code>topup</code>, <code>topup_reversal</code>, <code>transfer</code>, <code>transfer_cancel</code>, <code>transfer_failure</code>, or <code>transfer_refund</code>. <a href="https://stripe.com/docs/reports/balance-transaction-types">Learn more</a> about balance transaction types and what they represent. If you are looking to classify transactions for accounting purposes, you might want to consider <code>reporting_category</code> instead.
31
  */
32
  class BalanceTransaction extends ApiResource
33
  {
44
  const TYPE_APPLICATION_FEE_REFUND = 'application_fee_refund';
45
  const TYPE_CHARGE = 'charge';
46
  const TYPE_CONNECT_COLLECTION_TRANSFER = 'connect_collection_transfer';
47
+ const TYPE_CONTRIBUTION = 'contribution';
48
  const TYPE_ISSUING_AUTHORIZATION_HOLD = 'issuing_authorization_hold';
49
  const TYPE_ISSUING_AUTHORIZATION_RELEASE = 'issuing_authorization_release';
50
  const TYPE_ISSUING_DISPUTE = 'issuing_dispute';
vendor/stripe/stripe-php/lib/BitcoinReceiver.php CHANGED
@@ -24,7 +24,7 @@ namespace Stripe;
24
  * @property bool $filled This flag is initially false and updates to true when the customer sends the <code>bitcoin_amount</code> to this receiver.
25
  * @property string $inbound_address A bitcoin address that is specific to this receiver. The customer can send bitcoin to this address to fill the receiver.
26
  * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
27
- * @property \Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
28
  * @property null|string $payment The ID of the payment created from the receiver, if any. Hidden when viewing the receiver with a publishable key.
29
  * @property null|string $refund_address The refund address of this bitcoin receiver.
30
  * @property \Stripe\Collection $transactions A list with one entry for each time that the customer sent bitcoin to the receiver. Hidden when viewing the receiver with a publishable key.
24
  * @property bool $filled This flag is initially false and updates to true when the customer sends the <code>bitcoin_amount</code> to this receiver.
25
  * @property string $inbound_address A bitcoin address that is specific to this receiver. The customer can send bitcoin to this address to fill the receiver.
26
  * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
27
+ * @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
28
  * @property null|string $payment The ID of the payment created from the receiver, if any. Hidden when viewing the receiver with a publishable key.
29
  * @property null|string $refund_address The refund address of this bitcoin receiver.
30
  * @property \Stripe\Collection $transactions A list with one entry for each time that the customer sent bitcoin to the receiver. Hidden when viewing the receiver with a publishable key.
vendor/stripe/stripe-php/lib/Card.php CHANGED
@@ -26,17 +26,17 @@ namespace Stripe;
26
  * @property null|string[] $available_payout_methods A set of available payout methods for this card. Only values from this set should be passed as the <code>method</code> when creating a payout.
27
  * @property string $brand Card brand. Can be <code>American Express</code>, <code>Diners Club</code>, <code>Discover</code>, <code>JCB</code>, <code>MasterCard</code>, <code>UnionPay</code>, <code>Visa</code>, or <code>Unknown</code>.
28
  * @property null|string $country Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.
29
- * @property null|string $currency
30
  * @property null|string|\Stripe\Customer $customer The customer that this card belongs to. This attribute will not be in the card object if the card belongs to an account or recipient instead.
31
  * @property null|string $cvc_check If a CVC was provided, results of the check: <code>pass</code>, <code>fail</code>, <code>unavailable</code>, or <code>unchecked</code>. A result of unchecked indicates that CVC was provided but hasn't been checked yet. Checks are typically performed when attaching a card to a Customer object, or when creating a charge. For more details, see <a href="https://support.stripe.com/questions/check-if-a-card-is-valid-without-a-charge">Check if a card is valid without a charge</a>.
32
  * @property null|bool $default_for_currency Whether this card is the default external account for its currency.
33
  * @property null|string $dynamic_last4 (For tokenized numbers only.) The last four digits of the device account number.
34
  * @property int $exp_month Two-digit number representing the card's expiration month.
35
  * @property int $exp_year Four-digit number representing the card's expiration year.
36
- * @property null|string $fingerprint Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number,for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.
37
  * @property string $funding Card funding type. Can be <code>credit</code>, <code>debit</code>, <code>prepaid</code>, or <code>unknown</code>.
38
  * @property string $last4 The last four digits of the card.
39
- * @property \Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
40
  * @property null|string $name Cardholder name.
41
  * @property null|string|\Stripe\Recipient $recipient The recipient that this card belongs to. This attribute will not be in the card object if the card belongs to a customer or account instead.
42
  * @property null|string $tokenization_method If the card number is tokenized, this is the method that was used. Can be <code>android_pay</code> (includes Google Pay), <code>apple_pay</code>, <code>masterpass</code>, <code>visa_checkout</code>, or null.
26
  * @property null|string[] $available_payout_methods A set of available payout methods for this card. Only values from this set should be passed as the <code>method</code> when creating a payout.
27
  * @property string $brand Card brand. Can be <code>American Express</code>, <code>Diners Club</code>, <code>Discover</code>, <code>JCB</code>, <code>MasterCard</code>, <code>UnionPay</code>, <code>Visa</code>, or <code>Unknown</code>.
28
  * @property null|string $country Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.
29
+ * @property null|string $currency Three-letter <a href="https://stripe.com/docs/payouts">ISO code for currency</a>. Only applicable on accounts (not customers or recipients). The card can be used as a transfer destination for funds in this currency.
30
  * @property null|string|\Stripe\Customer $customer The customer that this card belongs to. This attribute will not be in the card object if the card belongs to an account or recipient instead.
31
  * @property null|string $cvc_check If a CVC was provided, results of the check: <code>pass</code>, <code>fail</code>, <code>unavailable</code>, or <code>unchecked</code>. A result of unchecked indicates that CVC was provided but hasn't been checked yet. Checks are typically performed when attaching a card to a Customer object, or when creating a charge. For more details, see <a href="https://support.stripe.com/questions/check-if-a-card-is-valid-without-a-charge">Check if a card is valid without a charge</a>.
32
  * @property null|bool $default_for_currency Whether this card is the default external account for its currency.
33
  * @property null|string $dynamic_last4 (For tokenized numbers only.) The last four digits of the device account number.
34
  * @property int $exp_month Two-digit number representing the card's expiration month.
35
  * @property int $exp_year Four-digit number representing the card's expiration year.
36
+ * @property null|string $fingerprint Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.
37
  * @property string $funding Card funding type. Can be <code>credit</code>, <code>debit</code>, <code>prepaid</code>, or <code>unknown</code>.
38
  * @property string $last4 The last four digits of the card.
39
+ * @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
40
  * @property null|string $name Cardholder name.
41
  * @property null|string|\Stripe\Recipient $recipient The recipient that this card belongs to. This attribute will not be in the card object if the card belongs to a customer or account instead.
42
  * @property null|string $tokenization_method If the card number is tokenized, this is the method that was used. Can be <code>android_pay</code> (includes Google Pay), <code>apple_pay</code>, <code>masterpass</code>, <code>visa_checkout</code>, or null.
vendor/stripe/stripe-php/lib/Charge.php CHANGED
@@ -16,6 +16,7 @@ namespace Stripe;
16
  * @property string $id Unique identifier for the object.
17
  * @property string $object String representing the object's type. Objects of the same type share the same value.
18
  * @property int $amount Amount intended to be collected by this payment. A positive integer representing how much to charge in the <a href="https://stripe.com/docs/currencies#zero-decimal">smallest currency unit</a> (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or <a href="https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts">equivalent in charge currency</a>. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).
 
19
  * @property int $amount_refunded Amount in %s refunded (can be less than the amount attribute on the charge if a partial refund was issued).
20
  * @property null|string|\Stripe\StripeObject $application ID of the Connect application that created the charge.
21
  * @property null|string|\Stripe\ApplicationFee $application_fee The application fee (if any) for the charge. <a href="https://stripe.com/docs/connect/direct-charges#collecting-fees">See the Connect documentation</a> for details.
@@ -51,7 +52,7 @@ namespace Stripe;
51
  * @property \Stripe\Collection $refunds A list of refunds that have been applied to the charge.
52
  * @property null|string|\Stripe\Review $review ID of the review associated with this charge if one exists.
53
  * @property null|\Stripe\StripeObject $shipping Shipping information for the charge.
54
- * @property null|\Stripe\StripeObject $source This is a legacy field that will be removed in the future. It contains the Source, Card, or BankAccount object used for the charge. For details about the payment method used for this charge, refer to <code>payment_method</code> or <code>payment_method_details</code> instead.
55
  * @property null|string|\Stripe\Transfer $source_transfer The transfer ID which created this charge. Only present if the charge came from another Stripe account. <a href="https://stripe.com/docs/connect/destination-charges">See the Connect documentation</a> for details.
56
  * @property null|string $statement_descriptor For card charges, use <code>statement_descriptor_suffix</code> instead. Otherwise, you can use this value as the complete description of a charge on your customers’ statements. Must contain at least one letter, maximum 22 characters.
57
  * @property null|string $statement_descriptor_suffix Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.
16
  * @property string $id Unique identifier for the object.
17
  * @property string $object String representing the object's type. Objects of the same type share the same value.
18
  * @property int $amount Amount intended to be collected by this payment. A positive integer representing how much to charge in the <a href="https://stripe.com/docs/currencies#zero-decimal">smallest currency unit</a> (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or <a href="https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts">equivalent in charge currency</a>. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).
19
+ * @property int $amount_captured Amount in %s captured (can be less than the amount attribute on the charge if a partial capture was made).
20
  * @property int $amount_refunded Amount in %s refunded (can be less than the amount attribute on the charge if a partial refund was issued).
21
  * @property null|string|\Stripe\StripeObject $application ID of the Connect application that created the charge.
22
  * @property null|string|\Stripe\ApplicationFee $application_fee The application fee (if any) for the charge. <a href="https://stripe.com/docs/connect/direct-charges#collecting-fees">See the Connect documentation</a> for details.
52
  * @property \Stripe\Collection $refunds A list of refunds that have been applied to the charge.
53
  * @property null|string|\Stripe\Review $review ID of the review associated with this charge if one exists.
54
  * @property null|\Stripe\StripeObject $shipping Shipping information for the charge.
55
+ * @property null|\Stripe\Account|\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source $source This is a legacy field that will be removed in the future. It contains the Source, Card, or BankAccount object used for the charge. For details about the payment method used for this charge, refer to <code>payment_method</code> or <code>payment_method_details</code> instead.
56
  * @property null|string|\Stripe\Transfer $source_transfer The transfer ID which created this charge. Only present if the charge came from another Stripe account. <a href="https://stripe.com/docs/connect/destination-charges">See the Connect documentation</a> for details.
57
  * @property null|string $statement_descriptor For card charges, use <code>statement_descriptor_suffix</code> instead. Otherwise, you can use this value as the complete description of a charge on your customers’ statements. Must contain at least one letter, maximum 22 characters.
58
  * @property null|string $statement_descriptor_suffix Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.
vendor/stripe/stripe-php/lib/Checkout/Session.php CHANGED
@@ -37,7 +37,7 @@ namespace Stripe\Checkout;
37
  * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
38
  * @property null|string $locale The IETF language tag of the locale Checkout is displayed in. If blank or <code>auto</code>, the browser's locale is used.
39
  * @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
40
- * @property string $mode The mode of the Checkout Session, one of <code>payment</code>, <code>setup</code>, or <code>subscription</code>.
41
  * @property null|string|\Stripe\PaymentIntent $payment_intent The ID of the PaymentIntent for Checkout Sessions in <code>payment</code> mode.
42
  * @property string[] $payment_method_types A list of the types of payment methods (e.g. card) this Checkout Session is allowed to accept.
43
  * @property string $payment_status The payment status of the Checkout Session, one of <code>paid</code>, <code>unpaid</code>, or <code>no_payment_required</code>. You can use this value to decide when to fulfill your customer's order.
37
  * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
38
  * @property null|string $locale The IETF language tag of the locale Checkout is displayed in. If blank or <code>auto</code>, the browser's locale is used.
39
  * @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
40
+ * @property string $mode The mode of the Checkout Session.
41
  * @property null|string|\Stripe\PaymentIntent $payment_intent The ID of the PaymentIntent for Checkout Sessions in <code>payment</code> mode.
42
  * @property string[] $payment_method_types A list of the types of payment methods (e.g. card) this Checkout Session is allowed to accept.
43
  * @property string $payment_status The payment status of the Checkout Session, one of <code>paid</code>, <code>unpaid</code>, or <code>no_payment_required</code>. You can use this value to decide when to fulfill your customer's order.
vendor/stripe/stripe-php/lib/Coupon.php CHANGED
@@ -22,7 +22,7 @@ namespace Stripe;
22
  * @property null|int $duration_in_months If <code>duration</code> is <code>repeating</code>, the number of months the coupon applies. Null if coupon <code>duration</code> is <code>forever</code> or <code>once</code>.
23
  * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
24
  * @property null|int $max_redemptions Maximum number of times this coupon can be redeemed, in total, across all customers, before it is no longer valid.
25
- * @property \Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
26
  * @property null|string $name Name of the coupon displayed to customers on for instance invoices or receipts.
27
  * @property null|float $percent_off Percent that will be taken off the subtotal of any invoices for this customer for the duration of the coupon. For example, a coupon with percent_off of 50 will make a %s100 invoice %s50 instead.
28
  * @property null|int $redeem_by Date after which the coupon can no longer be redeemed.
22
  * @property null|int $duration_in_months If <code>duration</code> is <code>repeating</code>, the number of months the coupon applies. Null if coupon <code>duration</code> is <code>forever</code> or <code>once</code>.
23
  * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
24
  * @property null|int $max_redemptions Maximum number of times this coupon can be redeemed, in total, across all customers, before it is no longer valid.
25
+ * @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
26
  * @property null|string $name Name of the coupon displayed to customers on for instance invoices or receipts.
27
  * @property null|float $percent_off Percent that will be taken off the subtotal of any invoices for this customer for the duration of the coupon. For example, a coupon with percent_off of 50 will make a %s100 invoice %s50 instead.
28
  * @property null|int $redeem_by Date after which the coupon can no longer be redeemed.
vendor/stripe/stripe-php/lib/CreditNote.php CHANGED
@@ -13,27 +13,27 @@ namespace Stripe;
13
  *
14
  * @property string $id Unique identifier for the object.
15
  * @property string $object String representing the object's type. Objects of the same type share the same value.
16
- * @property int $amount The integer amount in <strong>%s</strong> representing the total amount of the credit note, including tax.
17
  * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
18
  * @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
19
  * @property string|\Stripe\Customer $customer ID of the customer.
20
  * @property null|string|\Stripe\CustomerBalanceTransaction $customer_balance_transaction Customer balance transaction related to this credit note.
21
- * @property int $discount_amount The integer amount in <strong>%s</strong> representing the total amount of discount that was credited.
22
  * @property \Stripe\StripeObject[] $discount_amounts The aggregate amounts calculated per discount for all line items.
23
  * @property string|\Stripe\Invoice $invoice ID of the invoice.
24
  * @property \Stripe\Collection $lines Line items that make up the credit note
25
  * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
26
  * @property null|string $memo Customer-facing text that appears on the credit note PDF.
27
- * @property \Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
28
  * @property string $number A unique number that identifies this particular credit note and appears on the PDF of the credit note and its associated invoice.
29
  * @property null|int $out_of_band_amount Amount that was credited outside of Stripe.
30
  * @property string $pdf The link to download the PDF of the credit note.
31
  * @property null|string $reason Reason for issuing this credit note, one of <code>duplicate</code>, <code>fraudulent</code>, <code>order_change</code>, or <code>product_unsatisfactory</code>
32
  * @property null|string|\Stripe\Refund $refund Refund related to this credit note.
33
  * @property string $status Status of this credit note, one of <code>issued</code> or <code>void</code>. Learn more about <a href="https://stripe.com/docs/billing/invoices/credit-notes#voiding">voiding credit notes</a>.
34
- * @property int $subtotal The integer amount in <strong>%s</strong> representing the amount of the credit note, excluding tax and invoice level discounts.
35
  * @property \Stripe\StripeObject[] $tax_amounts The aggregate amounts calculated per tax rate for all line items.
36
- * @property int $total The integer amount in <strong>%s</strong> representing the total amount of the credit note, including tax and all discount.
37
  * @property string $type Type of this credit note, one of <code>pre_payment</code> or <code>post_payment</code>. A <code>pre_payment</code> credit note means it was issued when the invoice was open. A <code>post_payment</code> credit note means it was issued when the invoice was paid.
38
  * @property null|int $voided_at The time that the credit note was voided.
39
  */
13
  *
14
  * @property string $id Unique identifier for the object.
15
  * @property string $object String representing the object's type. Objects of the same type share the same value.
16
+ * @property int $amount The integer amount in %s representing the total amount of the credit note, including tax.
17
  * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
18
  * @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
19
  * @property string|\Stripe\Customer $customer ID of the customer.
20
  * @property null|string|\Stripe\CustomerBalanceTransaction $customer_balance_transaction Customer balance transaction related to this credit note.
21
+ * @property int $discount_amount The integer amount in %s representing the total amount of discount that was credited.
22
  * @property \Stripe\StripeObject[] $discount_amounts The aggregate amounts calculated per discount for all line items.
23
  * @property string|\Stripe\Invoice $invoice ID of the invoice.
24
  * @property \Stripe\Collection $lines Line items that make up the credit note
25
  * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
26
  * @property null|string $memo Customer-facing text that appears on the credit note PDF.
27
+ * @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
28
  * @property string $number A unique number that identifies this particular credit note and appears on the PDF of the credit note and its associated invoice.
29
  * @property null|int $out_of_band_amount Amount that was credited outside of Stripe.
30
  * @property string $pdf The link to download the PDF of the credit note.
31
  * @property null|string $reason Reason for issuing this credit note, one of <code>duplicate</code>, <code>fraudulent</code>, <code>order_change</code>, or <code>product_unsatisfactory</code>
32
  * @property null|string|\Stripe\Refund $refund Refund related to this credit note.
33
  * @property string $status Status of this credit note, one of <code>issued</code> or <code>void</code>. Learn more about <a href="https://stripe.com/docs/billing/invoices/credit-notes#voiding">voiding credit notes</a>.
34
+ * @property int $subtotal The integer amount in %s representing the amount of the credit note, excluding tax and invoice level discounts.
35
  * @property \Stripe\StripeObject[] $tax_amounts The aggregate amounts calculated per tax rate for all line items.
36
+ * @property int $total The integer amount in %s representing the total amount of the credit note, including tax and all discount.
37
  * @property string $type Type of this credit note, one of <code>pre_payment</code> or <code>post_payment</code>. A <code>pre_payment</code> credit note means it was issued when the invoice was open. A <code>post_payment</code> credit note means it was issued when the invoice was paid.
38
  * @property null|int $voided_at The time that the credit note was voided.
39
  */
vendor/stripe/stripe-php/lib/CreditNoteLineItem.php CHANGED
@@ -7,9 +7,9 @@ namespace Stripe;
7
  /**
8
  * @property string $id Unique identifier for the object.
9
  * @property string $object String representing the object's type. Objects of the same type share the same value.
10
- * @property int $amount The integer amount in <strong>%s</strong> representing the gross amount being credited for this line item, excluding (exclusive) tax and discounts.
11
  * @property null|string $description Description of the item being credited.
12
- * @property int $discount_amount The integer amount in <strong>%s</strong> representing the discount being credited for this line item.
13
  * @property \Stripe\StripeObject[] $discount_amounts The amount of discount calculated per discount for this line item
14
  * @property string $invoice_line_item ID of the invoice line item being credited
15
  * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
7
  /**
8
  * @property string $id Unique identifier for the object.
9
  * @property string $object String representing the object's type. Objects of the same type share the same value.
10
+ * @property int $amount The integer amount in %s representing the gross amount being credited for this line item, excluding (exclusive) tax and discounts.
11
  * @property null|string $description Description of the item being credited.
12
+ * @property int $discount_amount The integer amount in %s representing the discount being credited for this line item.
13
  * @property \Stripe\StripeObject[] $discount_amounts The amount of discount calculated per discount for this line item
14
  * @property string $invoice_line_item ID of the invoice line item being credited
15
  * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
vendor/stripe/stripe-php/lib/Customer.php CHANGED
@@ -20,7 +20,7 @@ namespace Stripe;
20
  * @property int $balance Current balance, if any, being stored on the customer. If negative, the customer has credit to apply to their next invoice. If positive, the customer has an amount owed that will be added to their next invoice. The balance does not refer to any unpaid invoices; it solely takes into account amounts that have yet to be successfully applied to any invoice. This balance is only taken into account as invoices are finalized.
21
  * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
22
  * @property null|string $currency Three-letter <a href="https://stripe.com/docs/currencies">ISO code for the currency</a> the customer can be charged in for recurring billing purposes.
23
- * @property null|string|\Stripe\StripeObject $default_source <p>ID of the default payment source for the customer.</p><p>If you are using payment methods created via the PaymentMethods API, see the <a href="https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method">invoice_settings.default_payment_method</a> field instead.</p>
24
  * @property null|bool $delinquent When the customer's latest invoice is billed by charging automatically, delinquent is true if the invoice's latest charge is failed. When the customer's latest invoice is billed by sending an invoice, delinquent is true if the invoice is not paid by its due date.
25
  * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users.
26
  * @property null|\Stripe\Discount $discount Describes the current discount active on the customer, if there is one.
20
  * @property int $balance Current balance, if any, being stored on the customer. If negative, the customer has credit to apply to their next invoice. If positive, the customer has an amount owed that will be added to their next invoice. The balance does not refer to any unpaid invoices; it solely takes into account amounts that have yet to be successfully applied to any invoice. This balance is only taken into account as invoices are finalized.
21
  * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
22
  * @property null|string $currency Three-letter <a href="https://stripe.com/docs/currencies">ISO code for the currency</a> the customer can be charged in for recurring billing purposes.
23
+ * @property null|string|\Stripe\Account|\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source $default_source <p>ID of the default payment source for the customer.</p><p>If you are using payment methods created via the PaymentMethods API, see the <a href="https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method">invoice_settings.default_payment_method</a> field instead.</p>
24
  * @property null|bool $delinquent When the customer's latest invoice is billed by charging automatically, delinquent is true if the invoice's latest charge is failed. When the customer's latest invoice is billed by sending an invoice, delinquent is true if the invoice is not paid by its due date.
25
  * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users.
26
  * @property null|\Stripe\Discount $discount Describes the current discount active on the customer, if there is one.
vendor/stripe/stripe-php/lib/ErrorObject.php CHANGED
@@ -23,6 +23,9 @@ namespace Stripe;
23
  * returned on a request involving a PaymentIntent.
24
  * @property PaymentMethod $payment_method The PaymentMethod object for errors
25
  * returned on a request involving a PaymentMethod.
 
 
 
26
  * @property SetupIntent $setup_intent The SetupIntent object for errors
27
  * returned on a request involving a SetupIntent.
28
  * @property StripeObject $source The source object for errors returned on a
23
  * returned on a request involving a PaymentIntent.
24
  * @property PaymentMethod $payment_method The PaymentMethod object for errors
25
  * returned on a request involving a PaymentMethod.
26
+ * @property string $payment_method_type If the error is specific to the type
27
+ * of payment method, the payment method type that had a problem. This
28
+ * field is only populated for invoice-related errors.
29
  * @property SetupIntent $setup_intent The SetupIntent object for errors
30
  * returned on a request involving a SetupIntent.
31
  * @property StripeObject $source The source object for errors returned on a
vendor/stripe/stripe-php/lib/Event.php CHANGED
@@ -72,6 +72,7 @@ class Event extends ApiResource
72
  const APPLICATION_FEE_REFUNDED = 'application_fee.refunded';
73
  const APPLICATION_FEE_REFUND_UPDATED = 'application_fee.refund.updated';
74
  const BALANCE_AVAILABLE = 'balance.available';
 
75
  const CHARGE_CAPTURED = 'charge.captured';
76
  const CHARGE_EXPIRED = 'charge.expired';
77
  const CHARGE_FAILED = 'charge.failed';
@@ -106,11 +107,17 @@ class Event extends ApiResource
106
  const CUSTOMER_SOURCE_UPDATED = 'customer.source.updated';
107
  const CUSTOMER_SUBSCRIPTION_CREATED = 'customer.subscription.created';
108
  const CUSTOMER_SUBSCRIPTION_DELETED = 'customer.subscription.deleted';
 
 
109
  const CUSTOMER_SUBSCRIPTION_TRIAL_WILL_END = 'customer.subscription.trial_will_end';
110
  const CUSTOMER_SUBSCRIPTION_UPDATED = 'customer.subscription.updated';
 
 
 
111
  const FILE_CREATED = 'file.created';
112
  const INVOICE_CREATED = 'invoice.created';
113
  const INVOICE_DELETED = 'invoice.deleted';
 
114
  const INVOICE_FINALIZED = 'invoice.finalized';
115
  const INVOICE_MARKED_UNCOLLECTIBLE = 'invoice.marked_uncollectible';
116
  const INVOICE_PAID = 'invoice.paid';
@@ -132,11 +139,14 @@ class Event extends ApiResource
132
  const ISSUING_CARD_UPDATED = 'issuing_card.updated';
133
  const ISSUING_CARDHOLDER_CREATED = 'issuing_cardholder.created';
134
  const ISSUING_CARDHOLDER_UPDATED = 'issuing_cardholder.updated';
 
135
  const ISSUING_DISPUTE_CREATED = 'issuing_dispute.created';
136
  const ISSUING_DISPUTE_FUNDS_REINSTATED = 'issuing_dispute.funds_reinstated';
 
137
  const ISSUING_DISPUTE_UPDATED = 'issuing_dispute.updated';
138
  const ISSUING_TRANSACTION_CREATED = 'issuing_transaction.created';
139
  const ISSUING_TRANSACTION_UPDATED = 'issuing_transaction.updated';
 
140
  const ORDER_CREATED = 'order.created';
141
  const ORDER_PAYMENT_FAILED = 'order.payment_failed';
142
  const ORDER_PAYMENT_SUCCEEDED = 'order.payment_succeeded';
@@ -146,8 +156,11 @@ class Event extends ApiResource
146
  const PAYMENT_INTENT_CANCELED = 'payment_intent.canceled';
147
  const PAYMENT_INTENT_CREATED = 'payment_intent.created';
148
  const PAYMENT_INTENT_PAYMENT_FAILED = 'payment_intent.payment_failed';
 
 
149
  const PAYMENT_INTENT_SUCCEEDED = 'payment_intent.succeeded';
150
  const PAYMENT_METHOD_ATTACHED = 'payment_method.attached';
 
151
  const PAYMENT_METHOD_CARD_AUTOMATICALLY_UPDATED = 'payment_method.card_automatically_updated';
152
  const PAYMENT_METHOD_DETACHED = 'payment_method.detached';
153
  const PAYMENT_METHOD_UPDATED = 'payment_method.updated';
@@ -169,6 +182,11 @@ class Event extends ApiResource
169
  const PRODUCT_CREATED = 'product.created';
170
  const PRODUCT_DELETED = 'product.deleted';
171
  const PRODUCT_UPDATED = 'product.updated';
 
 
 
 
 
172
  const RECIPIENT_CREATED = 'recipient.created';
173
  const RECIPIENT_DELETED = 'recipient.deleted';
174
  const RECIPIENT_UPDATED = 'recipient.updated';
@@ -179,6 +197,7 @@ class Event extends ApiResource
179
  const REVIEW_OPENED = 'review.opened';
180
  const SETUP_INTENT_CANCELED = 'setup_intent.canceled';
181
  const SETUP_INTENT_CREATED = 'setup_intent.created';
 
182
  const SETUP_INTENT_SETUP_FAILED = 'setup_intent.setup_failed';
183
  const SETUP_INTENT_SUCCEEDED = 'setup_intent.succeeded';
184
  const SIGMA_SCHEDULED_QUERY_RUN_CREATED = 'sigma.scheduled_query_run.created';
72
  const APPLICATION_FEE_REFUNDED = 'application_fee.refunded';
73
  const APPLICATION_FEE_REFUND_UPDATED = 'application_fee.refund.updated';
74
  const BALANCE_AVAILABLE = 'balance.available';
75
+ const CAPABILITY_UPDATED = 'capability.updated';
76
  const CHARGE_CAPTURED = 'charge.captured';
77
  const CHARGE_EXPIRED = 'charge.expired';
78
  const CHARGE_FAILED = 'charge.failed';
107
  const CUSTOMER_SOURCE_UPDATED = 'customer.source.updated';
108
  const CUSTOMER_SUBSCRIPTION_CREATED = 'customer.subscription.created';
109
  const CUSTOMER_SUBSCRIPTION_DELETED = 'customer.subscription.deleted';
110
+ const CUSTOMER_SUBSCRIPTION_PENDING_UPDATE_APPLIED = 'customer.subscription.pending_update_applied';
111
+ const CUSTOMER_SUBSCRIPTION_PENDING_UPDATE_EXPIRED = 'customer.subscription.pending_update_expired';
112
  const CUSTOMER_SUBSCRIPTION_TRIAL_WILL_END = 'customer.subscription.trial_will_end';
113
  const CUSTOMER_SUBSCRIPTION_UPDATED = 'customer.subscription.updated';
114
+ const CUSTOMER_TAX_ID_CREATED = 'customer.tax_id.created';
115
+ const CUSTOMER_TAX_ID_DELETED = 'customer.tax_id.deleted';
116
+ const CUSTOMER_TAX_ID_UPDATED = 'customer.tax_id.updated';
117
  const FILE_CREATED = 'file.created';
118
  const INVOICE_CREATED = 'invoice.created';
119
  const INVOICE_DELETED = 'invoice.deleted';
120
+ const INVOICE_FINALIZATION_FAILED = 'invoice.finalization_failed';
121
  const INVOICE_FINALIZED = 'invoice.finalized';
122
  const INVOICE_MARKED_UNCOLLECTIBLE = 'invoice.marked_uncollectible';
123
  const INVOICE_PAID = 'invoice.paid';
139
  const ISSUING_CARD_UPDATED = 'issuing_card.updated';
140
  const ISSUING_CARDHOLDER_CREATED = 'issuing_cardholder.created';
141
  const ISSUING_CARDHOLDER_UPDATED = 'issuing_cardholder.updated';
142
+ const ISSUING_DISPUTE_CLOSED = 'issuing_dispute.closed';
143
  const ISSUING_DISPUTE_CREATED = 'issuing_dispute.created';
144
  const ISSUING_DISPUTE_FUNDS_REINSTATED = 'issuing_dispute.funds_reinstated';
145
+ const ISSUING_DISPUTE_SUBMITTED = 'issuing_dispute.submitted';
146
  const ISSUING_DISPUTE_UPDATED = 'issuing_dispute.updated';
147
  const ISSUING_TRANSACTION_CREATED = 'issuing_transaction.created';
148
  const ISSUING_TRANSACTION_UPDATED = 'issuing_transaction.updated';
149
+ const MANDATE_UPDATED = 'mandate.updated';
150
  const ORDER_CREATED = 'order.created';
151
  const ORDER_PAYMENT_FAILED = 'order.payment_failed';
152
  const ORDER_PAYMENT_SUCCEEDED = 'order.payment_succeeded';
156
  const PAYMENT_INTENT_CANCELED = 'payment_intent.canceled';
157
  const PAYMENT_INTENT_CREATED = 'payment_intent.created';
158
  const PAYMENT_INTENT_PAYMENT_FAILED = 'payment_intent.payment_failed';
159
+ const PAYMENT_INTENT_PROCESSING = 'payment_intent.processing';
160
+ const PAYMENT_INTENT_REQUIRES_ACTION = 'payment_intent.requires_action';
161
  const PAYMENT_INTENT_SUCCEEDED = 'payment_intent.succeeded';
162
  const PAYMENT_METHOD_ATTACHED = 'payment_method.attached';
163
+ const PAYMENT_METHOD_AUTOMATICALLY_UPDATED = 'payment_method.automatically_updated';
164
  const PAYMENT_METHOD_CARD_AUTOMATICALLY_UPDATED = 'payment_method.card_automatically_updated';
165
  const PAYMENT_METHOD_DETACHED = 'payment_method.detached';
166
  const PAYMENT_METHOD_UPDATED = 'payment_method.updated';
182
  const PRODUCT_CREATED = 'product.created';
183
  const PRODUCT_DELETED = 'product.deleted';
184
  const PRODUCT_UPDATED = 'product.updated';
185
+ const PROMOTION_CODE_CREATED = 'promotion_code.created';
186
+ const PROMOTION_CODE_DELETED = 'promotion_code.deleted';
187
+ const PROMOTION_CODE_UPDATED = 'promotion_code.updated';
188
+ const RADAR_EARLY_FRAUD_WARNING_CREATED = 'radar.early_fraud_warning.created';
189
+ const RADAR_EARLY_FRAUD_WARNING_UPDATED = 'radar.early_fraud_warning.updated';
190
  const RECIPIENT_CREATED = 'recipient.created';
191
  const RECIPIENT_DELETED = 'recipient.deleted';
192
  const RECIPIENT_UPDATED = 'recipient.updated';
197
  const REVIEW_OPENED = 'review.opened';
198
  const SETUP_INTENT_CANCELED = 'setup_intent.canceled';
199
  const SETUP_INTENT_CREATED = 'setup_intent.created';
200
+ const SETUP_INTENT_REQUIRES_ACTION = 'setup_intent.requires_action';
201
  const SETUP_INTENT_SETUP_FAILED = 'setup_intent.setup_failed';
202
  const SETUP_INTENT_SUCCEEDED = 'setup_intent.succeeded';
203
  const SIGMA_SCHEDULED_QUERY_RUN_CREATED = 'sigma.scheduled_query_run.created';
vendor/stripe/stripe-php/lib/Invoice.php CHANGED
@@ -67,16 +67,17 @@ namespace Stripe;
67
  * @property null|string $customer_tax_exempt The customer's tax exempt status. Until the invoice is finalized, this field will equal <code>customer.tax_exempt</code>. Once the invoice is finalized, this field will no longer be updated.
68
  * @property null|\Stripe\StripeObject[] $customer_tax_ids The customer's tax IDs. Until the invoice is finalized, this field will contain the same tax IDs as <code>customer.tax_ids</code>. Once the invoice is finalized, this field will no longer be updated.
69
  * @property null|string|\Stripe\PaymentMethod $default_payment_method ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings.
70
- * @property null|string|\Stripe\StripeObject $default_source ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source.
71
  * @property null|\Stripe\TaxRate[] $default_tax_rates The tax rates applied to this invoice, if any.
72
  * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard.
73
- * @property null|\Stripe\Discount $discount Describes the current discount applied to this invoice, if there is one.
74
  * @property null|(string|\Stripe\Discount)[] $discounts The discounts applied to the invoice. Line item discounts are applied before invoice discounts. Use <code>expand[]=discounts</code> to expand each discount.
75
  * @property null|int $due_date The date on which payment for this invoice is due. This value will be <code>null</code> for invoices where <code>collection_method=charge_automatically</code>.
76
  * @property null|int $ending_balance Ending customer balance after the invoice is finalized. Invoices are finalized approximately an hour after successful webhook delivery or when payment collection is attempted for the invoice. If the invoice has not been finalized yet, this will be null.
77
  * @property null|string $footer Footer displayed on the invoice.
78
  * @property null|string $hosted_invoice_url The URL for the hosted invoice page, which allows customers to view and pay an invoice. If the invoice has not been finalized yet, this will be null.
79
  * @property null|string $invoice_pdf The link to download the PDF for the invoice. If the invoice has not been finalized yet, this will be null.
 
80
  * @property \Stripe\Collection $lines The individual line items that make up the invoice. <code>lines</code> is sorted as follows: invoice items in reverse chronological order, followed by the subscription, if any.
81
  * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
82
  * @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
67
  * @property null|string $customer_tax_exempt The customer's tax exempt status. Until the invoice is finalized, this field will equal <code>customer.tax_exempt</code>. Once the invoice is finalized, this field will no longer be updated.
68
  * @property null|\Stripe\StripeObject[] $customer_tax_ids The customer's tax IDs. Until the invoice is finalized, this field will contain the same tax IDs as <code>customer.tax_ids</code>. Once the invoice is finalized, this field will no longer be updated.
69
  * @property null|string|\Stripe\PaymentMethod $default_payment_method ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings.
70
+ * @property null|string|\Stripe\Account|\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source $default_source ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source.
71
  * @property null|\Stripe\TaxRate[] $default_tax_rates The tax rates applied to this invoice, if any.
72
  * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard.
73
+ * @property null|\Stripe\Discount $discount Describes the current discount applied to this invoice, if there is one. Not populated if there are multiple discounts.
74
  * @property null|(string|\Stripe\Discount)[] $discounts The discounts applied to the invoice. Line item discounts are applied before invoice discounts. Use <code>expand[]=discounts</code> to expand each discount.
75
  * @property null|int $due_date The date on which payment for this invoice is due. This value will be <code>null</code> for invoices where <code>collection_method=charge_automatically</code>.
76
  * @property null|int $ending_balance Ending customer balance after the invoice is finalized. Invoices are finalized approximately an hour after successful webhook delivery or when payment collection is attempted for the invoice. If the invoice has not been finalized yet, this will be null.
77
  * @property null|string $footer Footer displayed on the invoice.
78
  * @property null|string $hosted_invoice_url The URL for the hosted invoice page, which allows customers to view and pay an invoice. If the invoice has not been finalized yet, this will be null.
79
  * @property null|string $invoice_pdf The link to download the PDF for the invoice. If the invoice has not been finalized yet, this will be null.
80
+ * @property null|\Stripe\ErrorObject $last_finalization_error The error encountered during the previous attempt to finalize the invoice. This field is cleared when the invoice is successfully finalized.
81
  * @property \Stripe\Collection $lines The individual line items that make up the invoice. <code>lines</code> is sorted as follows: invoice items in reverse chronological order, followed by the subscription, if any.
82
  * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
83
  * @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
vendor/stripe/stripe-php/lib/InvoiceItem.php CHANGED
@@ -25,7 +25,7 @@ namespace Stripe;
25
  * @property null|(string|\Stripe\Discount)[] $discounts The discounts which apply to the invoice item. Item discounts are applied before invoice discounts. Use <code>expand[]=discounts</code> to expand each discount.
26
  * @property null|string|\Stripe\Invoice $invoice The ID of the invoice this invoice item belongs to.
27
  * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
28
- * @property \Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
29
  * @property \Stripe\StripeObject $period
30
  * @property null|\Stripe\Plan $plan If the invoice item is a proration, the plan of the subscription that the proration was computed for.
31
  * @property null|\Stripe\Price $price The price of the invoice item.
@@ -34,7 +34,7 @@ namespace Stripe;
34
  * @property null|string|\Stripe\Subscription $subscription The subscription that this invoice item has been created for, if any.
35
  * @property string $subscription_item The subscription item that this invoice item has been created for, if any.
36
  * @property null|\Stripe\TaxRate[] $tax_rates The tax rates which apply to the invoice item. When set, the <code>default_tax_rates</code> on the invoice do not apply to this invoice item.
37
- * @property null|int $unit_amount Unit Amount (in the <code>currency</code> specified) of the invoice item.
38
  * @property null|string $unit_amount_decimal Same as <code>unit_amount</code>, but contains a decimal value with at most 12 decimal places.
39
  */
40
  class InvoiceItem extends ApiResource
25
  * @property null|(string|\Stripe\Discount)[] $discounts The discounts which apply to the invoice item. Item discounts are applied before invoice discounts. Use <code>expand[]=discounts</code> to expand each discount.
26
  * @property null|string|\Stripe\Invoice $invoice The ID of the invoice this invoice item belongs to.
27
  * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
28
+ * @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
29
  * @property \Stripe\StripeObject $period
30
  * @property null|\Stripe\Plan $plan If the invoice item is a proration, the plan of the subscription that the proration was computed for.
31
  * @property null|\Stripe\Price $price The price of the invoice item.
34
  * @property null|string|\Stripe\Subscription $subscription The subscription that this invoice item has been created for, if any.
35
  * @property string $subscription_item The subscription item that this invoice item has been created for, if any.
36
  * @property null|\Stripe\TaxRate[] $tax_rates The tax rates which apply to the invoice item. When set, the <code>default_tax_rates</code> on the invoice do not apply to this invoice item.
37
+ * @property null|int $unit_amount Unit amount (in the <code>currency</code> specified) of the invoice item.
38
  * @property null|string $unit_amount_decimal Same as <code>unit_amount</code>, but contains a decimal value with at most 12 decimal places.
39
  */
40
  class InvoiceItem extends ApiResource
vendor/stripe/stripe-php/lib/Order.php CHANGED
@@ -27,7 +27,7 @@ namespace Stripe;
27
  * @property string $external_coupon_code External coupon code to load for this order.
28
  * @property \Stripe\OrderItem[] $items List of items constituting the order. An order can have up to 25 items.
29
  * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
30
- * @property \Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
31
  * @property null|\Stripe\Collection $returns A list of returns that have taken place for this order.
32
  * @property null|string $selected_shipping_method The shipping method that is currently selected for this order, if any. If present, it is equal to one of the <code>id</code>s of shipping methods in the <code>shipping_methods</code> array. At order creation time, if there are multiple shipping methods, Stripe will automatically selected the first method.
33
  * @property null|\Stripe\StripeObject $shipping The shipping address for the order. Present if the order is for goods to be shipped.
27
  * @property string $external_coupon_code External coupon code to load for this order.
28
  * @property \Stripe\OrderItem[] $items List of items constituting the order. An order can have up to 25 items.
29
  * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
30
+ * @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
31
  * @property null|\Stripe\Collection $returns A list of returns that have taken place for this order.
32
  * @property null|string $selected_shipping_method The shipping method that is currently selected for this order, if any. If present, it is equal to one of the <code>id</code>s of shipping methods in the <code>shipping_methods</code> array. At order creation time, if there are multiple shipping methods, Stripe will automatically selected the first method.
33
  * @property null|\Stripe\StripeObject $shipping The shipping address for the order. Present if the order is for goods to be shipped.
vendor/stripe/stripe-php/lib/PaymentIntent.php CHANGED
@@ -48,7 +48,7 @@ namespace Stripe;
48
  * @property null|string|\Stripe\Review $review ID of the review associated with this PaymentIntent, if any.
49
  * @property null|string $setup_future_usage <p>Indicates that you intend to make future payments with this PaymentIntent's payment method.</p><p>Providing this parameter will <a href="https://stripe.com/docs/payments/save-during-payment">attach the payment method</a> to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be <a href="https://stripe.com/docs/api/payment_methods/attach">attached</a> to a Customer after the transaction completes.</p><p>When processing card payments, Stripe also uses <code>setup_future_usage</code> to dynamically optimize your payment flow and comply with regional legislation and network rules, such as <a href="https://stripe.com/docs/strong-customer-authentication">SCA</a>.</p>
50
  * @property null|\Stripe\StripeObject $shipping Shipping information for this PaymentIntent.
51
- * @property null|string|\Stripe\StripeObject $source This is a legacy field that will be removed in the future. It is the ID of the Source object that is associated with this PaymentIntent, if one was supplied.
52
  * @property null|string $statement_descriptor For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.
53
  * @property null|string $statement_descriptor_suffix Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.
54
  * @property string $status Status of this PaymentIntent, one of <code>requires_payment_method</code>, <code>requires_confirmation</code>, <code>requires_action</code>, <code>processing</code>, <code>requires_capture</code>, <code>canceled</code>, or <code>succeeded</code>. Read more about each PaymentIntent <a href="https://stripe.com/docs/payments/intents#intent-statuses">status</a>.
48
  * @property null|string|\Stripe\Review $review ID of the review associated with this PaymentIntent, if any.
49
  * @property null|string $setup_future_usage <p>Indicates that you intend to make future payments with this PaymentIntent's payment method.</p><p>Providing this parameter will <a href="https://stripe.com/docs/payments/save-during-payment">attach the payment method</a> to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be <a href="https://stripe.com/docs/api/payment_methods/attach">attached</a> to a Customer after the transaction completes.</p><p>When processing card payments, Stripe also uses <code>setup_future_usage</code> to dynamically optimize your payment flow and comply with regional legislation and network rules, such as <a href="https://stripe.com/docs/strong-customer-authentication">SCA</a>.</p>
50
  * @property null|\Stripe\StripeObject $shipping Shipping information for this PaymentIntent.
51
+ * @property null|string|\Stripe\Account|\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source $source This is a legacy field that will be removed in the future. It is the ID of the Source object that is associated with this PaymentIntent, if one was supplied.
52
  * @property null|string $statement_descriptor For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.
53
  * @property null|string $statement_descriptor_suffix Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.
54
  * @property string $status Status of this PaymentIntent, one of <code>requires_payment_method</code>, <code>requires_confirmation</code>, <code>requires_action</code>, <code>processing</code>, <code>requires_capture</code>, <code>canceled</code>, or <code>succeeded</code>. Read more about each PaymentIntent <a href="https://stripe.com/docs/payments/intents#intent-statuses">status</a>.
vendor/stripe/stripe-php/lib/PaymentMethod.php CHANGED
@@ -33,7 +33,8 @@ namespace Stripe;
33
  * @property \Stripe\StripeObject $ideal
34
  * @property \Stripe\StripeObject $interac_present
35
  * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
36
- * @property \Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
 
37
  * @property \Stripe\StripeObject $p24
38
  * @property \Stripe\StripeObject $sepa_debit
39
  * @property \Stripe\StripeObject $sofort
33
  * @property \Stripe\StripeObject $ideal
34
  * @property \Stripe\StripeObject $interac_present
35
  * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
36
+ * @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
37
+ * @property \Stripe\StripeObject $oxxo
38
  * @property \Stripe\StripeObject $p24
39
  * @property \Stripe\StripeObject $sepa_debit
40
  * @property \Stripe\StripeObject $sofort
vendor/stripe/stripe-php/lib/Payout.php CHANGED
@@ -7,10 +7,10 @@ namespace Stripe;
7
  /**
8
  * A <code>Payout</code> object is created when you receive funds from Stripe, or
9
  * when you initiate a payout to either a bank account or debit card of a <a
10
- * href="/docs/connect/payouts">connected Stripe account</a>. You can retrieve
11
- * individual payouts, as well as list all payouts. Payouts are made on <a
12
- * href="/docs/payouts#payout-schedule">varying schedules</a>, depending on your
13
- * country and industry.
14
  *
15
  * Related guide: <a href="https://stripe.com/docs/payouts">Receiving Payouts</a>.
16
  *
@@ -23,13 +23,15 @@ namespace Stripe;
23
  * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
24
  * @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
25
  * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users.
26
- * @property null|string|\Stripe\StripeObject $destination ID of the bank account or card the payout was sent to.
27
  * @property null|string|\Stripe\BalanceTransaction $failure_balance_transaction If the payout failed or was canceled, this will be the ID of the balance transaction that reversed the initial balance transaction, and puts the funds from the failed payout back in your balance.
28
  * @property null|string $failure_code Error code explaining reason for payout failure if available. See <a href="https://stripe.com/docs/api#payout_failures">Types of payout failures</a> for a list of failure codes.
29
  * @property null|string $failure_message Message to user further explaining reason for payout failure if available.
30
  * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
31
- * @property \Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
32
  * @property string $method The method used to send this payout, which can be <code>standard</code> or <code>instant</code>. <code>instant</code> is only supported for payouts to debit cards. (See <a href="https://stripe.com/blog/instant-payouts-for-marketplaces">Instant payouts for marketplaces</a> for more information.)
 
 
33
  * @property string $source_type The source balance this payout came from. One of <code>card</code>, <code>fpx</code>, or <code>bank_account</code>.
34
  * @property null|string $statement_descriptor Extra information about a payout to be displayed on the user's bank statement.
35
  * @property string $status Current status of the payout: <code>paid</code>, <code>pending</code>, <code>in_transit</code>, <code>canceled</code> or <code>failed</code>. A payout is <code>pending</code> until it is submitted to the bank, when it becomes <code>in_transit</code>. The status then changes to <code>paid</code> if the transaction goes through, or to <code>failed</code> or <code>canceled</code> (within 5 business days). Some failed payouts may initially show as <code>paid</code> but then change to <code>failed</code>.
@@ -86,4 +88,21 @@ class Payout extends ApiResource
86
 
87
  return $this;
88
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  }
7
  /**
8
  * A <code>Payout</code> object is created when you receive funds from Stripe, or
9
  * when you initiate a payout to either a bank account or debit card of a <a
10
+ * href="/docs/connect/bank-debit-card-payouts">connected Stripe account</a>. You
11
+ * can retrieve individual payouts, as well as list all payouts. Payouts are made
12
+ * on <a href="/docs/connect/manage-payout-schedule">varying schedules</a>,
13
+ * depending on your country and industry.
14
  *
15
  * Related guide: <a href="https://stripe.com/docs/payouts">Receiving Payouts</a>.
16
  *
23
  * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
24
  * @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
25
  * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users.
26
+ * @property null|string|\Stripe\BankAccount|\Stripe\Card $destination ID of the bank account or card the payout was sent to.
27
  * @property null|string|\Stripe\BalanceTransaction $failure_balance_transaction If the payout failed or was canceled, this will be the ID of the balance transaction that reversed the initial balance transaction, and puts the funds from the failed payout back in your balance.
28
  * @property null|string $failure_code Error code explaining reason for payout failure if available. See <a href="https://stripe.com/docs/api#payout_failures">Types of payout failures</a> for a list of failure codes.
29
  * @property null|string $failure_message Message to user further explaining reason for payout failure if available.
30
  * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
31
+ * @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
32
  * @property string $method The method used to send this payout, which can be <code>standard</code> or <code>instant</code>. <code>instant</code> is only supported for payouts to debit cards. (See <a href="https://stripe.com/blog/instant-payouts-for-marketplaces">Instant payouts for marketplaces</a> for more information.)
33
+ * @property null|string|\Stripe\Payout $original_payout If the payout reverses another, this is the ID of the original payout.
34
+ * @property null|string|\Stripe\Payout $reversed_by If the payout was reversed, this is the ID of the payout that reverses this payout.
35
  * @property string $source_type The source balance this payout came from. One of <code>card</code>, <code>fpx</code>, or <code>bank_account</code>.
36
  * @property null|string $statement_descriptor Extra information about a payout to be displayed on the user's bank statement.
37
  * @property string $status Current status of the payout: <code>paid</code>, <code>pending</code>, <code>in_transit</code>, <code>canceled</code> or <code>failed</code>. A payout is <code>pending</code> until it is submitted to the bank, when it becomes <code>in_transit</code>. The status then changes to <code>paid</code> if the transaction goes through, or to <code>failed</code> or <code>canceled</code> (within 5 business days). Some failed payouts may initially show as <code>paid</code> but then change to <code>failed</code>.
88
 
89
  return $this;
90
  }
91
+
92
+ /**
93
+ * @param null|array $params
94
+ * @param null|array|string $opts
95
+ *
96
+ * @throws \Stripe\Exception\ApiErrorException if the request fails
97
+ *
98
+ * @return Payout the reversed payout
99
+ */
100
+ public function reverse($params = null, $opts = null)
101
+ {
102
+ $url = $this->instanceUrl() . '/reverse';
103
+ list($response, $opts) = $this->_request('post', $url, $params, $opts);
104
+ $this->refreshFrom($response, $opts);
105
+
106
+ return $this;
107
+ }
108
  }
vendor/stripe/stripe-php/lib/Plan.php CHANGED
@@ -36,7 +36,7 @@ namespace Stripe;
36
  * @property string $interval The frequency at which a subscription is billed. One of <code>day</code>, <code>week</code>, <code>month</code> or <code>year</code>.
37
  * @property int $interval_count The number of intervals (specified in the <code>interval</code> attribute) between subscription billings. For example, <code>interval=month</code> and <code>interval_count=3</code> bills every 3 months.
38
  * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
39
- * @property \Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
40
  * @property null|string $nickname A brief description of the plan, hidden from customers.
41
  * @property null|string|\Stripe\Product $product The product whose pricing this plan determines.
42
  * @property \Stripe\StripeObject[] $tiers Each element represents a pricing tier. This parameter requires <code>billing_scheme</code> to be set to <code>tiered</code>. See also the documentation for <code>billing_scheme</code>.
36
  * @property string $interval The frequency at which a subscription is billed. One of <code>day</code>, <code>week</code>, <code>month</code> or <code>year</code>.
37
  * @property int $interval_count The number of intervals (specified in the <code>interval</code> attribute) between subscription billings. For example, <code>interval=month</code> and <code>interval_count=3</code> bills every 3 months.
38
  * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
39
+ * @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
40
  * @property null|string $nickname A brief description of the plan, hidden from customers.
41
  * @property null|string|\Stripe\Product $product The product whose pricing this plan determines.
42
  * @property \Stripe\StripeObject[] $tiers Each element represents a pricing tier. This parameter requires <code>billing_scheme</code> to be set to <code>tiered</code>. See also the documentation for <code>billing_scheme</code>.
vendor/stripe/stripe-php/lib/PromotionCode.php CHANGED
@@ -18,7 +18,7 @@ namespace Stripe;
18
  * @property null|int $expires_at Date at which the promotion code can no longer be redeemed.
19
  * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
20
  * @property null|int $max_redemptions Maximum number of times this promotion code can be redeemed.
21
- * @property \Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
22
  * @property \Stripe\StripeObject $restrictions
23
  * @property int $times_redeemed Number of times this promotion code has been used.
24
  */
18
  * @property null|int $expires_at Date at which the promotion code can no longer be redeemed.
19
  * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
20
  * @property null|int $max_redemptions Maximum number of times this promotion code can be redeemed.
21
+ * @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
22
  * @property \Stripe\StripeObject $restrictions
23
  * @property int $times_redeemed Number of times this promotion code has been used.
24
  */
vendor/stripe/stripe-php/lib/Refund.php CHANGED
@@ -21,7 +21,7 @@ namespace Stripe;
21
  * @property string $description An arbitrary string attached to the object. Often useful for displaying to users. (Available on non-card refunds only)
22
  * @property string|\Stripe\BalanceTransaction $failure_balance_transaction If the refund failed, this balance transaction describes the adjustment made on your account balance that reverses the initial balance transaction.
23
  * @property string $failure_reason If the refund failed, the reason for refund failure if known. Possible values are <code>lost_or_stolen_card</code>, <code>expired_or_canceled_card</code>, or <code>unknown</code>.
24
- * @property \Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
25
  * @property null|string|\Stripe\PaymentIntent $payment_intent ID of the PaymentIntent that was refunded.
26
  * @property null|string $reason Reason for the refund, either user-provided (<code>duplicate</code>, <code>fraudulent</code>, or <code>requested_by_customer</code>) or generated by Stripe internally (<code>expired_uncaptured_charge</code>).
27
  * @property null|string $receipt_number This is the transaction number that appears on email receipts sent for this refund.
21
  * @property string $description An arbitrary string attached to the object. Often useful for displaying to users. (Available on non-card refunds only)
22
  * @property string|\Stripe\BalanceTransaction $failure_balance_transaction If the refund failed, this balance transaction describes the adjustment made on your account balance that reverses the initial balance transaction.
23
  * @property string $failure_reason If the refund failed, the reason for refund failure if known. Possible values are <code>lost_or_stolen_card</code>, <code>expired_or_canceled_card</code>, or <code>unknown</code>.
24
+ * @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
25
  * @property null|string|\Stripe\PaymentIntent $payment_intent ID of the PaymentIntent that was refunded.
26
  * @property null|string $reason Reason for the refund, either user-provided (<code>duplicate</code>, <code>fraudulent</code>, or <code>requested_by_customer</code>) or generated by Stripe internally (<code>expired_uncaptured_charge</code>).
27
  * @property null|string $receipt_number This is the transaction number that appears on email receipts sent for this refund.
vendor/stripe/stripe-php/lib/Service/CoreServiceFactory.php CHANGED
@@ -44,6 +44,7 @@ namespace Stripe\Service;
44
  * @property RefundService $refunds
45
  * @property Reporting\ReportingServiceFactory $reporting
46
  * @property ReviewService $reviews
 
47
  * @property SetupIntentService $setupIntents
48
  * @property Sigma\SigmaServiceFactory $sigma
49
  * @property SkuService $skus
@@ -101,6 +102,7 @@ class CoreServiceFactory extends \Stripe\Service\AbstractServiceFactory
101
  'refunds' => RefundService::class,
102
  'reporting' => Reporting\ReportingServiceFactory::class,
103
  'reviews' => ReviewService::class,
 
104
  'setupIntents' => SetupIntentService::class,
105
  'sigma' => Sigma\SigmaServiceFactory::class,
106
  'skus' => SkuService::class,
44
  * @property RefundService $refunds
45
  * @property Reporting\ReportingServiceFactory $reporting
46
  * @property ReviewService $reviews
47
+ * @property SetupAttemptService $setupAttempts
48
  * @property SetupIntentService $setupIntents
49
  * @property Sigma\SigmaServiceFactory $sigma
50
  * @property SkuService $skus
102
  'refunds' => RefundService::class,
103
  'reporting' => Reporting\ReportingServiceFactory::class,
104
  'reviews' => ReviewService::class,
105
+ 'setupAttempts' => SetupAttemptService::class,
106
  'setupIntents' => SetupIntentService::class,
107
  'sigma' => Sigma\SigmaServiceFactory::class,
108
  'skus' => SkuService::class,
vendor/stripe/stripe-php/lib/Service/CustomerService.php CHANGED
@@ -24,7 +24,7 @@ class CustomerService extends \Stripe\Service\AbstractService
24
 
25
  /**
26
  * Returns a list of transactions that updated the customer’s <a
27
- * href="/docs/api/customers/object#customer_object-balance"><code>balance</code></a>.
28
  *
29
  * @param string $parentId
30
  * @param null|array $params
@@ -87,8 +87,8 @@ class CustomerService extends \Stripe\Service\AbstractService
87
  }
88
 
89
  /**
90
- * Creates an immutable transaction that updates the customer’s <a
91
- * href="/docs/api/customers/object#customer_object-balance"><code>balance</code></a>.
92
  *
93
  * @param string $parentId
94
  * @param null|array $params
@@ -224,8 +224,8 @@ class CustomerService extends \Stripe\Service\AbstractService
224
  }
225
 
226
  /**
227
- * Retrieves a specific transaction that updated the customer’s <a
228
- * href="/docs/api/customers/object#customer_object-balance"><code>balance</code></a>.
229
  *
230
  * @param string $parentId
231
  * @param string $id
@@ -304,7 +304,7 @@ class CustomerService extends \Stripe\Service\AbstractService
304
  }
305
 
306
  /**
307
- * Most customer balance transaction fields are immutable, but you may update its
308
  * <code>description</code> and <code>metadata</code>.
309
  *
310
  * @param string $parentId
24
 
25
  /**
26
  * Returns a list of transactions that updated the customer’s <a
27
+ * href="/docs/billing/customer/balance">balances</a>.
28
  *
29
  * @param string $parentId
30
  * @param null|array $params
87
  }
88
 
89
  /**
90
+ * Creates an immutable transaction that updates the customer’s credit <a
91
+ * href="/docs/billing/customer/balance">balance</a>.
92
  *
93
  * @param string $parentId
94
  * @param null|array $params
224
  }
225
 
226
  /**
227
+ * Retrieves a specific customer balance transaction that updated the customer’s <a
228
+ * href="/docs/billing/customer/balance">balances</a>.
229
  *
230
  * @param string $parentId
231
  * @param string $id
304
  }
305
 
306
  /**
307
+ * Most credit balance transaction fields are immutable, but you may update its
308
  * <code>description</code> and <code>metadata</code>.
309
  *
310
  * @param string $parentId
vendor/stripe/stripe-php/lib/Service/InvoiceService.php CHANGED
@@ -45,7 +45,10 @@ class InvoiceService extends \Stripe\Service\AbstractService
45
  /**
46
  * This endpoint creates a draft invoice for a given customer. The draft invoice
47
  * created pulls in all pending invoice items on that customer, including
48
- * prorations.
 
 
 
49
  *
50
  * @param null|array $params
51
  * @param null|array|\Stripe\Util\RequestOptions $opts
@@ -175,8 +178,8 @@ class InvoiceService extends \Stripe\Service\AbstractService
175
  /**
176
  * At any time, you can preview the upcoming invoice for a customer. This will show
177
  * you all the charges that are pending, including subscription renewal charges,
178
- * invoice item charges, etc. It will also show you any discount that is applicable
179
- * to the customer.
180
  *
181
  * Note that when you are viewing an upcoming invoice, you are simply viewing a
182
  * preview – the invoice has not yet been created. As such, the upcoming invoice
45
  /**
46
  * This endpoint creates a draft invoice for a given customer. The draft invoice
47
  * created pulls in all pending invoice items on that customer, including
48
+ * prorations. The invoice remains a draft until you <a
49
+ * href="#finalize_invoice">finalize</a> the invoice, which allows you to <a
50
+ * href="#pay_invoice">pay</a> or <a href="#send_invoice">send</a> the invoice to
51
+ * your customers.
52
  *
53
  * @param null|array $params
54
  * @param null|array|\Stripe\Util\RequestOptions $opts
178
  /**
179
  * At any time, you can preview the upcoming invoice for a customer. This will show
180
  * you all the charges that are pending, including subscription renewal charges,
181
+ * invoice item charges, etc. It will also show you any discounts that are
182
+ * applicable to the invoice.
183
  *
184
  * Note that when you are viewing an upcoming invoice, you are simply viewing a
185
  * preview – the invoice has not yet been created. As such, the upcoming invoice
vendor/stripe/stripe-php/lib/Service/PayoutService.php CHANGED
@@ -84,6 +84,29 @@ class PayoutService extends \Stripe\Service\AbstractService
84
  return $this->request('get', $this->buildPath('/v1/payouts/%s', $id), $params, $opts);
85
  }
86
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  /**
88
  * Updates the specified payout by setting the values of the parameters passed. Any
89
  * parameters not provided will be left unchanged. This request accepts only the
84
  return $this->request('get', $this->buildPath('/v1/payouts/%s', $id), $params, $opts);
85
  }
86
 
87
+ /**
88
+ * Reverses a payout by debiting the destination bank account. Only payouts for
89
+ * connected accounts to US bank accounts may be reversed at this time. If the
90
+ * payout is in the <code>pending</code> status,
91
+ * <code>/v1/payouts/:id/cancel</code> should be used instead.
92
+ *
93
+ * By requesting a reversal via <code>/v1/payouts/:id/reverse</code>, you confirm
94
+ * that the authorized signatory of the selected bank account has authorized the
95
+ * debit on the bank account and that no other authorization is required.
96
+ *
97
+ * @param string $id
98
+ * @param null|array $params
99
+ * @param null|array|\Stripe\Util\RequestOptions $opts
100
+ *
101
+ * @throws \Stripe\Exception\ApiErrorException if the request fails
102
+ *
103
+ * @return \Stripe\Payout
104
+ */
105
+ public function reverse($id, $params = null, $opts = null)
106
+ {
107
+ return $this->request('post', $this->buildPath('/v1/payouts/%s/reverse', $id), $params, $opts);
108
+ }
109
+
110
  /**
111
  * Updates the specified payout by setting the values of the parameters passed. Any
112
  * parameters not provided will be left unchanged. This request accepts only the
vendor/stripe/stripe-php/lib/Service/SetupAttemptService.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // File generated from our OpenAPI spec
4
+
5
+ namespace Stripe\Service;
6
+
7
+ class SetupAttemptService extends \Stripe\Service\AbstractService
8
+ {
9
+ /**
10
+ * Returns a list of SetupAttempts associated with a provided SetupIntent.
11
+ *
12
+ * @param null|array $params
13
+ * @param null|array|\Stripe\Util\RequestOptions $opts
14
+ *
15
+ * @throws \Stripe\Exception\ApiErrorException if the request fails
16
+ *
17
+ * @return \Stripe\Collection
18
+ */
19
+ public function all($params = null, $opts = null)
20
+ {
21
+ return $this->requestCollection('get', '/v1/setup_attempts', $params, $opts);
22
+ }
23
+ }
vendor/stripe/stripe-php/lib/Service/SubscriptionScheduleService.php CHANGED
@@ -41,7 +41,7 @@ class SubscriptionScheduleService extends \Stripe\Service\AbstractService
41
  }
42
 
43
  /**
44
- * Creates a new subscription schedule object. Each customer can have up to 25
45
  * active or scheduled subscriptions.
46
  *
47
  * @param null|array $params
41
  }
42
 
43
  /**
44
+ * Creates a new subscription schedule object. Each customer can have up to 500
45
  * active or scheduled subscriptions.
46
  *
47
  * @param null|array $params
vendor/stripe/stripe-php/lib/Service/SubscriptionService.php CHANGED
@@ -56,7 +56,7 @@ class SubscriptionService extends \Stripe\Service\AbstractService
56
 
57
  /**
58
  * Creates a new subscription on an existing customer. Each customer can have up to
59
- * 25 active or scheduled subscriptions.
60
  *
61
  * @param null|array $params
62
  * @param null|array|\Stripe\Util\RequestOptions $opts
56
 
57
  /**
58
  * Creates a new subscription on an existing customer. Each customer can have up to
59
+ * 500 active or scheduled subscriptions.
60
  *
61
  * @param null|array $params
62
  * @param null|array|\Stripe\Util\RequestOptions $opts
vendor/stripe/stripe-php/lib/SetupAttempt.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // File generated from our OpenAPI spec
4
+
5
+ namespace Stripe;
6
+
7
+ /**
8
+ * A SetupAttempt describes one attempted confirmation of a SetupIntent, whether
9
+ * that confirmation was successful or unsuccessful. You can use SetupAttempts to
10
+ * inspect details of a specific attempt at setting up a payment method using a
11
+ * SetupIntent.
12
+ *
13
+ * @property string $id Unique identifier for the object.
14
+ * @property string $object String representing the object's type. Objects of the same type share the same value.
15
+ * @property null|string|\Stripe\StripeObject $application The value of <a href="https://stripe.com/docs/api/setup_intents/object#setup_intent_object-application">application</a> on the SetupIntent at the time of this confirmation.
16
+ * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
17
+ * @property null|string|\Stripe\Customer $customer The value of <a href="https://stripe.com/docs/api/setup_intents/object#setup_intent_object-customer">customer</a> on the SetupIntent at the time of this confirmation.
18
+ * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
19
+ * @property null|string|\Stripe\Account $on_behalf_of The value of <a href="https://stripe.com/docs/api/setup_intents/object#setup_intent_object-on_behalf_of">on_behalf_of</a> on the SetupIntent at the time of this confirmation.
20
+ * @property string|\Stripe\PaymentMethod $payment_method ID of the payment method used with this SetupAttempt.
21
+ * @property \Stripe\StripeObject $payment_method_details
22
+ * @property null|\Stripe\ErrorObject $setup_error The error encountered during this attempt to confirm the SetupIntent, if any.
23
+ * @property string|\Stripe\SetupIntent $setup_intent ID of the SetupIntent that this attempt belongs to.
24
+ * @property string $status Status of this SetupAttempt, one of <code>requires_confirmation</code>, <code>requires_action</code>, <code>processing</code>, <code>succeeded</code>, <code>failed</code>, or <code>abandoned</code>.
25
+ * @property string $usage The value of <a href="https://stripe.com/docs/api/setup_intents/object#setup_intent_object-usage">usage</a> on the SetupIntent at the time of this confirmation, one of <code>off_session</code> or <code>on_session</code>.
26
+ */
27
+ class SetupAttempt extends ApiResource
28
+ {
29
+ const OBJECT_NAME = 'setup_attempt';
30
+
31
+ use ApiOperations\All;
32
+ }
vendor/stripe/stripe-php/lib/SetupIntent.php CHANGED
@@ -49,9 +49,10 @@ namespace Stripe;
49
  * @property null|string|\Stripe\Customer $customer <p>ID of the Customer this SetupIntent belongs to, if one exists.</p><p>If present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent.</p>
50
  * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users.
51
  * @property null|\Stripe\ErrorObject $last_setup_error The error encountered in the previous SetupIntent confirmation.
 
52
  * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
53
  * @property null|string|\Stripe\Mandate $mandate ID of the multi use Mandate generated by the SetupIntent.
54
- * @property \Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
55
  * @property null|\Stripe\StripeObject $next_action If present, this property tells you what actions you need to take in order for your customer to continue payment setup.
56
  * @property null|string|\Stripe\Account $on_behalf_of The account (if any) for which the setup is intended.
57
  * @property null|string|\Stripe\PaymentMethod $payment_method ID of the payment method used with this SetupIntent.
49
  * @property null|string|\Stripe\Customer $customer <p>ID of the Customer this SetupIntent belongs to, if one exists.</p><p>If present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent.</p>
50
  * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users.
51
  * @property null|\Stripe\ErrorObject $last_setup_error The error encountered in the previous SetupIntent confirmation.
52
+ * @property null|string|\Stripe\SetupAttempt $latest_attempt The most recent SetupAttempt for this SetupIntent.
53
  * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
54
  * @property null|string|\Stripe\Mandate $mandate ID of the multi use Mandate generated by the SetupIntent.
55
+ * @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
56
  * @property null|\Stripe\StripeObject $next_action If present, this property tells you what actions you need to take in order for your customer to continue payment setup.
57
  * @property null|string|\Stripe\Account $on_behalf_of The account (if any) for which the setup is intended.
58
  * @property null|string|\Stripe\PaymentMethod $payment_method ID of the payment method used with this SetupIntent.
vendor/stripe/stripe-php/lib/Source.php CHANGED
@@ -91,7 +91,7 @@ class Source extends ApiResource
91
 
92
  $id = $this['id'];
93
  if (!$id) {
94
- $class = \get_class($this);
95
  $msg = "Could not determine which URL to request: {$class} instance "
96
  . "has invalid ID: {$id}";
97
 
91
 
92
  $id = $this['id'];
93
  if (!$id) {
94
+ $class = static::class;
95
  $msg = "Could not determine which URL to request: {$class} instance "
96
  . "has invalid ID: {$id}";
97
 
vendor/stripe/stripe-php/lib/Stripe.php CHANGED
@@ -58,7 +58,7 @@ class Stripe
58
  /** @var float Initial delay between retries, in seconds */
59
  private static $initialNetworkRetryDelay = 0.5;
60
 
61
- const VERSION = '7.52.0';
62
 
63
  /**
64
  * @return string the API key used for requests
58
  /** @var float Initial delay between retries, in seconds */
59
  private static $initialNetworkRetryDelay = 0.5;
60
 
61
+ const VERSION = '7.62.0';
62
 
63
  /**
64
  * @return string the API key used for requests
vendor/stripe/stripe-php/lib/StripeClient.php CHANGED
@@ -44,6 +44,7 @@ namespace Stripe;
44
  * @property \Stripe\Service\RefundService $refunds
45
  * @property \Stripe\Service\Reporting\ReportingServiceFactory $reporting
46
  * @property \Stripe\Service\ReviewService $reviews
 
47
  * @property \Stripe\Service\SetupIntentService $setupIntents
48
  * @property \Stripe\Service\Sigma\SigmaServiceFactory $sigma
49
  * @property \Stripe\Service\SkuService $skus
44
  * @property \Stripe\Service\RefundService $refunds
45
  * @property \Stripe\Service\Reporting\ReportingServiceFactory $reporting
46
  * @property \Stripe\Service\ReviewService $reviews
47
+ * @property \Stripe\Service\SetupAttemptService $setupAttempts
48
  * @property \Stripe\Service\SetupIntentService $setupIntents
49
  * @property \Stripe\Service\Sigma\SigmaServiceFactory $sigma
50
  * @property \Stripe\Service\SkuService $skus
vendor/stripe/stripe-php/lib/StripeObject.php CHANGED
@@ -169,7 +169,7 @@ class StripeObject implements \ArrayAccess, \Countable, \JsonSerializable
169
  return $this->_values[$k];
170
  }
171
  if (!empty($this->_transientValues) && $this->_transientValues->includes($k)) {
172
- $class = \get_class($this);
173
  $attrs = \implode(', ', \array_keys($this->_values));
174
  $message = "Stripe Notice: Undefined property of {$class} instance: {$k}. "
175
  . "HINT: The {$k} attribute was set in the past, however. "
@@ -181,7 +181,7 @@ class StripeObject implements \ArrayAccess, \Countable, \JsonSerializable
181
 
182
  return $nullval;
183
  }
184
- $class = \get_class($this);
185
  Stripe::getLogger()->error("Stripe Notice: Undefined property of {$class} instance: {$k}");
186
 
187
  return $nullval;
@@ -343,14 +343,12 @@ class StripeObject implements \ArrayAccess, \Countable, \JsonSerializable
343
 
344
  // a `null` that makes it out of `serializeParamsValue` signals an empty
345
  // value that we shouldn't appear in the serialized form of the object
346
- $updateParams = \array_filter(
347
  $updateParams,
348
  function ($v) {
349
  return null !== $v;
350
  }
351
  );
352
-
353
- return $updateParams;
354
  }
355
 
356
  public function serializeParamsValue($value, $original, $unsaved, $force, $key = null)
@@ -469,7 +467,7 @@ class StripeObject implements \ArrayAccess, \Countable, \JsonSerializable
469
 
470
  public function __toString()
471
  {
472
- $class = \get_class($this);
473
 
474
  return $class . ' JSON: ' . $this->toJSON();
475
  }
169
  return $this->_values[$k];
170
  }
171
  if (!empty($this->_transientValues) && $this->_transientValues->includes($k)) {
172
+ $class = static::class;
173
  $attrs = \implode(', ', \array_keys($this->_values));
174
  $message = "Stripe Notice: Undefined property of {$class} instance: {$k}. "
175
  . "HINT: The {$k} attribute was set in the past, however. "
181
 
182
  return $nullval;
183
  }
184
+ $class = static::class;
185
  Stripe::getLogger()->error("Stripe Notice: Undefined property of {$class} instance: {$k}");
186
 
187
  return $nullval;
343
 
344
  // a `null` that makes it out of `serializeParamsValue` signals an empty
345
  // value that we shouldn't appear in the serialized form of the object
346
+ return \array_filter(
347
  $updateParams,
348
  function ($v) {
349
  return null !== $v;
350
  }
351
  );
 
 
352
  }
353
 
354
  public function serializeParamsValue($value, $original, $unsaved, $force, $key = null)
467
 
468
  public function __toString()
469
  {
470
+ $class = static::class;
471
 
472
  return $class . ' JSON: ' . $this->toJSON();
473
  }
vendor/stripe/stripe-php/lib/Subscription.php CHANGED
@@ -18,15 +18,15 @@ namespace Stripe;
18
  * @property null|\Stripe\StripeObject $billing_thresholds Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period
19
  * @property null|int $cancel_at A date in the future at which the subscription will automatically get canceled
20
  * @property bool $cancel_at_period_end If the subscription has been canceled with the <code>at_period_end</code> flag set to <code>true</code>, <code>cancel_at_period_end</code> on the subscription will be true. You can use this attribute to determine whether a subscription that has a status of active is scheduled to be canceled at the end of the current period.
21
- * @property null|int $canceled_at If the subscription has been canceled, the date of that cancellation. If the subscription was canceled with <code>cancel_at_period_end</code>, <code>canceled_at</code> will still reflect the date of the initial cancellation request, not the end of the subscription period when the subscription is automatically moved to a canceled state.
22
  * @property null|string $collection_method Either <code>charge_automatically</code>, or <code>send_invoice</code>. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions.
23
  * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
24
  * @property int $current_period_end End of the current period that the subscription has been invoiced for. At the end of this period, a new invoice will be created.
25
  * @property int $current_period_start Start of the current period that the subscription has been invoiced for.
26
  * @property string|\Stripe\Customer $customer ID of the customer who owns the subscription.
27
  * @property null|int $days_until_due Number of days a customer has to pay invoices generated by this subscription. This value will be <code>null</code> for subscriptions where <code>collection_method=charge_automatically</code>.
28
- * @property null|string|\Stripe\PaymentMethod $default_payment_method ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. If not set, invoices will use the default payment method in the customer's invoice settings.
29
- * @property null|string|\Stripe\StripeObject $default_source ID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If not set, defaults to the customer's default source.
30
  * @property null|\Stripe\TaxRate[] $default_tax_rates The tax rates that will apply to any subscription item that does not have <code>tax_rates</code> set. Invoices created will have their <code>default_tax_rates</code> populated from the subscription.
31
  * @property null|\Stripe\Discount $discount Describes the current discount applied to this subscription, if there is one. When billing, a discount applied to a subscription overrides a discount applied on a customer-wide basis.
32
  * @property null|int $ended_at If the subscription has ended, the date the subscription ended.
18
  * @property null|\Stripe\StripeObject $billing_thresholds Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period
19
  * @property null|int $cancel_at A date in the future at which the subscription will automatically get canceled
20
  * @property bool $cancel_at_period_end If the subscription has been canceled with the <code>at_period_end</code> flag set to <code>true</code>, <code>cancel_at_period_end</code> on the subscription will be true. You can use this attribute to determine whether a subscription that has a status of active is scheduled to be canceled at the end of the current period.
21
+ * @property null|int $canceled_at If the subscription has been canceled, the date of that cancellation. If the subscription was canceled with <code>cancel_at_period_end</code>, <code>canceled_at</code> will reflect the time of the most recent update request, not the end of the subscription period when the subscription is automatically moved to a canceled state.
22
  * @property null|string $collection_method Either <code>charge_automatically</code>, or <code>send_invoice</code>. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions.
23
  * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
24
  * @property int $current_period_end End of the current period that the subscription has been invoiced for. At the end of this period, a new invoice will be created.
25
  * @property int $current_period_start Start of the current period that the subscription has been invoiced for.
26
  * @property string|\Stripe\Customer $customer ID of the customer who owns the subscription.
27
  * @property null|int $days_until_due Number of days a customer has to pay invoices generated by this subscription. This value will be <code>null</code> for subscriptions where <code>collection_method=charge_automatically</code>.
28
+ * @property null|string|\Stripe\PaymentMethod $default_payment_method ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over <code>default_source</code>. If neither are set, invoices will use the customer's <a href="https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method">invoice_settings.default_payment_method</a> or <a href="https://stripe.com/docs/api/customers/object#customer_object-default_source">default_source</a>.
29
+ * @property null|string|\Stripe\Account|\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source $default_source ID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If <code>default_payment_method</code> is also set, <code>default_payment_method</code> will take precedence. If neither are set, invoices will use the customer's <a href="https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method">invoice_settings.default_payment_method</a> or <a href="https://stripe.com/docs/api/customers/object#customer_object-default_source">default_source</a>.
30
  * @property null|\Stripe\TaxRate[] $default_tax_rates The tax rates that will apply to any subscription item that does not have <code>tax_rates</code> set. Invoices created will have their <code>default_tax_rates</code> populated from the subscription.
31
  * @property null|\Stripe\Discount $discount Describes the current discount applied to this subscription, if there is one. When billing, a discount applied to a subscription overrides a discount applied on a customer-wide basis.
32
  * @property null|int $ended_at If the subscription has ended, the date the subscription ended.
vendor/stripe/stripe-php/lib/TaxId.php CHANGED
@@ -18,7 +18,7 @@ namespace Stripe;
18
  * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
19
  * @property null|string|\Stripe\Customer $customer ID of the customer.
20
  * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
21
- * @property string $type Type of the tax ID, one of <code>ae_trn</code>, <code>au_abn</code>, <code>br_cnpj</code>, <code>br_cpf</code>, <code>ca_bn</code>, <code>ca_qst</code>, <code>ch_vat</code>, <code>cl_tin</code>, <code>es_cif</code>, <code>eu_vat</code>, <code>hk_br</code>, <code>id_npwp</code>, <code>in_gst</code>, <code>jp_cn</code>, <code>kr_brn</code>, <code>li_uid</code>, <code>mx_rfc</code>, <code>my_frp</code>, <code>my_itn</code>, <code>my_sst</code>, <code>no_vat</code>, <code>nz_gst</code>, <code>ru_inn</code>, <code>sa_vat</code>, <code>sg_gst</code>, <code>sg_uen</code>, <code>th_vat</code>, <code>tw_vat</code>, <code>us_ein</code>, or <code>za_vat</code>. Note that some legacy tax IDs have type <code>unknown</code>
22
  * @property string $value Value of the tax ID.
23
  * @property null|\Stripe\StripeObject $verification Tax ID verification information.
24
  */
@@ -42,6 +42,7 @@ class TaxId extends ApiResource
42
  const TYPE_ID_NPWP = 'id_npwp';
43
  const TYPE_IN_GST = 'in_gst';
44
  const TYPE_JP_CN = 'jp_cn';
 
45
  const TYPE_KR_BRN = 'kr_brn';
46
  const TYPE_LI_UID = 'li_uid';
47
  const TYPE_MX_RFC = 'mx_rfc';
@@ -51,6 +52,7 @@ class TaxId extends ApiResource
51
  const TYPE_NO_VAT = 'no_vat';
52
  const TYPE_NZ_GST = 'nz_gst';
53
  const TYPE_RU_INN = 'ru_inn';
 
54
  const TYPE_SA_VAT = 'sa_vat';
55
  const TYPE_SG_GST = 'sg_gst';
56
  const TYPE_SG_UEN = 'sg_uen';
18
  * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
19
  * @property null|string|\Stripe\Customer $customer ID of the customer.
20
  * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
21
+ * @property string $type Type of the tax ID, one of <code>ae_trn</code>, <code>au_abn</code>, <code>br_cnpj</code>, <code>br_cpf</code>, <code>ca_bn</code>, <code>ca_qst</code>, <code>ch_vat</code>, <code>cl_tin</code>, <code>es_cif</code>, <code>eu_vat</code>, <code>hk_br</code>, <code>id_npwp</code>, <code>in_gst</code>, <code>jp_cn</code>, <code>jp_rn</code>, <code>kr_brn</code>, <code>li_uid</code>, <code>mx_rfc</code>, <code>my_frp</code>, <code>my_itn</code>, <code>my_sst</code>, <code>no_vat</code>, <code>nz_gst</code>, <code>ru_inn</code>, <code>ru_kpp</code>, <code>sa_vat</code>, <code>sg_gst</code>, <code>sg_uen</code>, <code>th_vat</code>, <code>tw_vat</code>, <code>us_ein</code>, or <code>za_vat</code>. Note that some legacy tax IDs have type <code>unknown</code>
22
  * @property string $value Value of the tax ID.
23
  * @property null|\Stripe\StripeObject $verification Tax ID verification information.
24
  */
42
  const TYPE_ID_NPWP = 'id_npwp';
43
  const TYPE_IN_GST = 'in_gst';
44
  const TYPE_JP_CN = 'jp_cn';
45
+ const TYPE_JP_RN = 'jp_rn';
46
  const TYPE_KR_BRN = 'kr_brn';
47
  const TYPE_LI_UID = 'li_uid';
48
  const TYPE_MX_RFC = 'mx_rfc';
52
  const TYPE_NO_VAT = 'no_vat';
53
  const TYPE_NZ_GST = 'nz_gst';
54
  const TYPE_RU_INN = 'ru_inn';
55
+ const TYPE_RU_KPP = 'ru_kpp';
56
  const TYPE_SA_VAT = 'sa_vat';
57
  const TYPE_SG_GST = 'sg_gst';
58
  const TYPE_SG_UEN = 'sg_uen';
vendor/stripe/stripe-php/lib/TaxRate.php CHANGED
@@ -22,9 +22,9 @@ namespace Stripe;
22
  * @property null|string $description An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers.
23
  * @property string $display_name The display name of the tax rates as it will appear to your customer on their receipt email, PDF, and the hosted invoice page.
24
  * @property bool $inclusive This specifies if the tax rate is inclusive or exclusive.
25
- * @property null|string $jurisdiction The jurisdiction for the tax rate.
26
  * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
27
- * @property \Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
28
  * @property float $percentage This represents the tax rate percent out of 100.
29
  */
30
  class TaxRate extends ApiResource
22
  * @property null|string $description An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers.
23
  * @property string $display_name The display name of the tax rates as it will appear to your customer on their receipt email, PDF, and the hosted invoice page.
24
  * @property bool $inclusive This specifies if the tax rate is inclusive or exclusive.
25
+ * @property null|string $jurisdiction The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer’s invoice.
26
  * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
27
+ * @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
28
  * @property float $percentage This represents the tax rate percent out of 100.
29
  */
30
  class TaxRate extends ApiResource
vendor/stripe/stripe-php/lib/TransferReversal.php CHANGED
@@ -29,7 +29,7 @@ namespace Stripe;
29
  * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
30
  * @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
31
  * @property null|string|\Stripe\Refund $destination_payment_refund Linked payment refund for the transfer reversal.
32
- * @property \Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
33
  * @property null|string|\Stripe\Refund $source_refund ID of the refund responsible for the transfer reversal.
34
  * @property string|\Stripe\Transfer $transfer ID of the transfer that was reversed.
35
  */
29
  * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
30
  * @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
31
  * @property null|string|\Stripe\Refund $destination_payment_refund Linked payment refund for the transfer reversal.
32
+ * @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
33
  * @property null|string|\Stripe\Refund $source_refund ID of the refund responsible for the transfer reversal.
34
  * @property string|\Stripe\Transfer $transfer ID of the transfer that was reversed.
35
  */
vendor/stripe/stripe-php/lib/Util/ObjectTypes.php CHANGED
@@ -73,6 +73,7 @@ class ObjectTypes
73
  \Stripe\Reporting\ReportRun::OBJECT_NAME => \Stripe\Reporting\ReportRun::class,
74
  \Stripe\Reporting\ReportType::OBJECT_NAME => \Stripe\Reporting\ReportType::class,
75
  \Stripe\Review::OBJECT_NAME => \Stripe\Review::class,
 
76
  \Stripe\SetupIntent::OBJECT_NAME => \Stripe\SetupIntent::class,
77
  \Stripe\Sigma\ScheduledQueryRun::OBJECT_NAME => \Stripe\Sigma\ScheduledQueryRun::class,
78
  \Stripe\SKU::OBJECT_NAME => \Stripe\SKU::class,
73
  \Stripe\Reporting\ReportRun::OBJECT_NAME => \Stripe\Reporting\ReportRun::class,
74
  \Stripe\Reporting\ReportType::OBJECT_NAME => \Stripe\Reporting\ReportType::class,
75
  \Stripe\Review::OBJECT_NAME => \Stripe\Review::class,
76
+ \Stripe\SetupAttempt::OBJECT_NAME => \Stripe\SetupAttempt::class,
77
  \Stripe\SetupIntent::OBJECT_NAME => \Stripe\SetupIntent::class,
78
  \Stripe\Sigma\ScheduledQueryRun::OBJECT_NAME => \Stripe\Sigma\ScheduledQueryRun::class,
79
  \Stripe\SKU::OBJECT_NAME => \Stripe\SKU::class,
vendor/stripe/stripe-php/lib/Util/Util.php CHANGED
@@ -23,7 +23,7 @@ abstract class Util
23
  if (!\is_array($array)) {
24
  return false;
25
  }
26
- if ($array === []) {
27
  return true;
28
  }
29
  if (\array_keys($array) !== \range(0, \count($array) - 1)) {
23
  if (!\is_array($array)) {
24
  return false;
25
  }
26
+ if ([] === $array) {
27
  return true;
28
  }
29
  if (\array_keys($array) !== \range(0, \count($array) - 1)) {