WooCommerce Stripe Payment Gateway - Version 4.1.11

Version Description

  • 2018-10-17 =
  • Fix - Explicitly set 3DS source id to prevent 3DS source not charging when not required.
  • Fix - Prevent Stripe JS failed live/test check from throwing JS error.
  • Fix - Find order by source ID if charge ID is not found when cancelled webhook is triggered.
  • Fix - Partial refund on Stripe captured charge erroneously refunding total amount.
  • Fix - Capture charge on previously authorized charge, not showing Stripe fees.
  • Fix - Check if payment icons are set before trying to use them.
  • Fix - Can't use method in write context errors.
  • Deprecate - Soft deprecated function is_pre_30 with is_wc_lt function.
  • Add - Ability to update all active subscription's payment method when adding a payment.
  • Add - Hook to show update all active subscription's payment method checkbox wc_stripe_display_update_subs_payment_method_card_checkbox.
  • Add - CSS minification.
  • Update - WC 3.5 compatibility.
  • Update - Stripe API version to 2018-09-24.

See changelog for all versions.

=

Download this release

Release Info

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

Code changes from version 4.1.10 to 4.1.11

Files changed (46) hide show
  1. assets/css/stripe-future-styles.css +1 -0
  2. assets/css/stripe-storefront-styles.css +1 -29
  3. assets/css/stripe-styles.css +1 -158
  4. assets/css/stripe-twentyseventeen-styles.css +1 -31
  5. assets/js/stripe.js +6 -1
  6. assets/js/stripe.min.js +1 -1
  7. changelog.txt +15 -0
  8. includes/abstracts/abstract-wc-stripe-payment-gateway.php +91 -100
  9. includes/admin/class-wc-stripe-admin-notices.php +22 -8
  10. includes/admin/class-wc-stripe-privacy.php +18 -14
  11. includes/admin/stripe-alipay-settings.php +9 -8
  12. includes/admin/stripe-bancontact-settings.php +9 -8
  13. includes/admin/stripe-eps-settings.php +7 -6
  14. includes/admin/stripe-giropay-settings.php +9 -8
  15. includes/admin/stripe-ideal-settings.php +9 -8
  16. includes/admin/stripe-multibanco-settings.php +7 -6
  17. includes/admin/stripe-p24-settings.php +8 -7
  18. includes/admin/stripe-sepa-settings.php +9 -8
  19. includes/admin/stripe-settings.php +23 -22
  20. includes/admin/stripe-sofort-settings.php +9 -8
  21. includes/class-wc-gateway-stripe.php +55 -35
  22. includes/class-wc-stripe-api.php +1 -1
  23. includes/class-wc-stripe-apple-pay-registration.php +10 -7
  24. includes/class-wc-stripe-customer.php +21 -10
  25. includes/class-wc-stripe-exception.php +1 -1
  26. includes/class-wc-stripe-helper.php +54 -37
  27. includes/class-wc-stripe-logger.php +8 -8
  28. includes/class-wc-stripe-order-handler.php +32 -29
  29. includes/class-wc-stripe-sepa-payment-token.php +2 -2
  30. includes/class-wc-stripe-webhook-handler.php +35 -33
  31. includes/compat/class-wc-stripe-pre-orders-compat.php +2 -2
  32. includes/compat/class-wc-stripe-sepa-subs-compat.php +76 -25
  33. includes/compat/class-wc-stripe-subs-compat.php +79 -76
  34. includes/payment-methods/class-wc-gateway-stripe-alipay.php +24 -21
  35. includes/payment-methods/class-wc-gateway-stripe-bancontact.php +16 -13
  36. includes/payment-methods/class-wc-gateway-stripe-eps.php +16 -13
  37. includes/payment-methods/class-wc-gateway-stripe-giropay.php +16 -13
  38. includes/payment-methods/class-wc-gateway-stripe-ideal.php +16 -13
  39. includes/payment-methods/class-wc-gateway-stripe-multibanco.php +19 -16
  40. includes/payment-methods/class-wc-gateway-stripe-p24.php +17 -14
  41. includes/payment-methods/class-wc-gateway-stripe-sepa.php +19 -13
  42. includes/payment-methods/class-wc-gateway-stripe-sofort.php +16 -13
  43. includes/payment-methods/class-wc-stripe-payment-request.php +25 -25
  44. languages/woocommerce-gateway-stripe.pot +519 -464
  45. readme.txt +15 -7
  46. woocommerce-gateway-stripe.php +33 -36
assets/css/stripe-future-styles.css ADDED
@@ -0,0 +1 @@
 
1
+ .wc-stripe-elements-field,.wc-stripe-iban-element-field{border:1px solid #ddd;margin:5px 0;padding:5px;background-color:#fff;outline:0}#payment .methods label[for=payment_method_stripe],#payment .methods label[for=payment_method_stripe_alipay],#payment .methods label[for=payment_method_stripe_bancontact],#payment .methods label[for=payment_method_stripe_eps],#payment .methods label[for=payment_method_stripe_giropay],#payment .methods label[for=payment_method_stripe_ideal],#payment .methods label[for=payment_method_stripe_multibanco],#payment .methods label[for=payment_method_stripe_p24],#payment .methods label[for=payment_method_stripe_sepa],#payment .methods label[for=payment_method_stripe_sofort]{display:inline}#add_payment_method #payment ul.payment_methods li img.stripe-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-icon{max-width:40px;padding-left:3px;margin:0}#add_payment_method #payment ul.payment_methods li img.stripe-bancontact-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-bancontact-icon{max-height:65px;max-width:45px}#add_payment_method #payment ul.payment_methods li img.stripe-ideal-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-ideal-icon{max-height:35px}#add_payment_method #payment ul.payment_methods li img.stripe-p24-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-p24-icon{max-width:65px}#add_payment_method #payment ul.payment_methods li img.stripe-alipay-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-alipay-icon{max-width:50px}#add_payment_method #payment ul.payment_methods li img.stripe-sofort-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-sofort-icon{max-width:55px}#add_payment_method #payment ul.payment_methods li img.stripe-sepa-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-sepa-icon{max-width:50px}#add_payment_method #payment ul.payment_methods li img.stripe-multibanco-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-multibanco-icon{max-height:30px}#add_payment_method #payment ul.payment_methods li img.stripe-eps-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-eps-icon{max-height:30px}#add_payment_method #payment ul.payment_methods li img.stripe-giropay-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-giropay-icon{max-width:50px}#add_payment_method #payment ul.payment_methods li .stripe-credit-card-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-credit-card-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/credit-card.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-visa-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-visa-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/visa.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-amex-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-amex-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/amex.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-diners-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-diners-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/diners.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-discover-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-discover-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/discover.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-jcb-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-jcb-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/jcb.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-maestro-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-maestro-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/maestro.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-mastercard-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-mastercard-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/mastercard.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods .stripe-card-group,.woocommerce-checkout #payment ul.payment_methods .stripe-card-group{position:relative}
assets/css/stripe-storefront-styles.css CHANGED
@@ -1,29 +1 @@
1
- .woocommerce-checkout #payment .payment_method_stripe label[for=payment_method_stripe] { display: block; padding-left: 1.41575em; }
2
- #add_payment_method #payment .payment_method_stripe label[for=payment_method_stripe] { display: block; padding-left: 1.41575em; }
3
-
4
- .woocommerce-checkout #payment .payment_method_stripe_bancontact label[for=payment_method_stripe_bancontact] { display: block; padding-left: 1.41575em; }
5
- #add_payment_method #payment .payment_method_stripe_bancontact label[for=payment_method_stripe_bancontact] { display: block; padding-left: 1.41575em; }
6
-
7
- .woocommerce-checkout #payment .payment_method_stripe_alipay label[for=payment_method_stripe_alipay] { display: block; padding-left: 1.41575em; }
8
- #add_payment_method #payment .payment_method_stripe_alipay label[for=payment_method_stripe_alipay] { display: block; padding-left: 1.41575em; }
9
-
10
- .woocommerce-checkout #payment .payment_method_stripe_eps label[for=payment_method_stripe_eps] { display: block; padding-left: 1.41575em; }
11
- #add_payment_method #payment .payment_method_stripe_eps label[for=payment_method_stripe_eps] { display: block; padding-left: 1.41575em; }
12
-
13
- .woocommerce-checkout #payment .payment_method_stripe_giropay label[for=payment_method_stripe_giropay] { display: block; padding-left: 1.41575em; }
14
- #add_payment_method #payment .payment_method_stripe_giropay label[for=payment_method_stripe_giropay] { display: block; padding-left: 1.41575em; }
15
-
16
- .woocommerce-checkout #payment .payment_method_stripe_ideal label[for=payment_method_stripe_ideal] { display: block; padding-left: 1.41575em; }
17
- #add_payment_method #payment .payment_method_stripe_ideal label[for=payment_method_stripe_ideal] { display: block; padding-left: 1.41575em; }
18
-
19
- .woocommerce-checkout #payment .payment_method_stripe_multibanco label[for=payment_method_stripe_multibanco] { display: block; padding-left: 1.41575em; }
20
- #add_payment_method #payment .payment_method_stripe_multibanco label[for=payment_method_stripe_multibanco] { display: block; padding-left: 1.41575em; }
21
-
22
- .woocommerce-checkout #payment .payment_method_stripe_p24 label[for=payment_method_stripe_p24] { display: block; padding-left: 1.41575em; }
23
- #add_payment_method #payment .payment_method_stripe_p24 label[for=payment_method_stripe_p24] { display: block; padding-left: 1.41575em; }
24
-
25
- .woocommerce-checkout #payment .payment_method_stripe_sepa label[for=payment_method_stripe_sepa] { display: block; padding-left: 1.41575em; }
26
- #add_payment_method #payment .payment_method_stripe_sepa label[for=payment_method_stripe_sepa] { display: block; padding-left: 1.41575em; }
27
-
28
- .woocommerce-checkout #payment .payment_method_stripe_sofort label[for=payment_method_stripe_sofort] { display: block; padding-left: 1.41575em; }
29
- #add_payment_method #payment .payment_method_stripe_sofort label[for=payment_method_stripe_sofort] { display: block; padding-left: 1.41575em; }
1
+ .woocommerce-checkout #payment .payment_method_stripe label[for=payment_method_stripe]{display:block;padding-left:1.41575em}#add_payment_method #payment .payment_method_stripe label[for=payment_method_stripe]{display:block;padding-left:1.41575em}.woocommerce-checkout #payment .payment_method_stripe_bancontact label[for=payment_method_stripe_bancontact]{display:block;padding-left:1.41575em}#add_payment_method #payment .payment_method_stripe_bancontact label[for=payment_method_stripe_bancontact]{display:block;padding-left:1.41575em}.woocommerce-checkout #payment .payment_method_stripe_alipay label[for=payment_method_stripe_alipay]{display:block;padding-left:1.41575em}#add_payment_method #payment .payment_method_stripe_alipay label[for=payment_method_stripe_alipay]{display:block;padding-left:1.41575em}.woocommerce-checkout #payment .payment_method_stripe_eps label[for=payment_method_stripe_eps]{display:block;padding-left:1.41575em}#add_payment_method #payment .payment_method_stripe_eps label[for=payment_method_stripe_eps]{display:block;padding-left:1.41575em}.woocommerce-checkout #payment .payment_method_stripe_giropay label[for=payment_method_stripe_giropay]{display:block;padding-left:1.41575em}#add_payment_method #payment .payment_method_stripe_giropay label[for=payment_method_stripe_giropay]{display:block;padding-left:1.41575em}.woocommerce-checkout #payment .payment_method_stripe_ideal label[for=payment_method_stripe_ideal]{display:block;padding-left:1.41575em}#add_payment_method #payment .payment_method_stripe_ideal label[for=payment_method_stripe_ideal]{display:block;padding-left:1.41575em}.woocommerce-checkout #payment .payment_method_stripe_multibanco label[for=payment_method_stripe_multibanco]{display:block;padding-left:1.41575em}#add_payment_method #payment .payment_method_stripe_multibanco label[for=payment_method_stripe_multibanco]{display:block;padding-left:1.41575em}.woocommerce-checkout #payment .payment_method_stripe_p24 label[for=payment_method_stripe_p24]{display:block;padding-left:1.41575em}#add_payment_method #payment .payment_method_stripe_p24 label[for=payment_method_stripe_p24]{display:block;padding-left:1.41575em}.woocommerce-checkout #payment .payment_method_stripe_sepa label[for=payment_method_stripe_sepa]{display:block;padding-left:1.41575em}#add_payment_method #payment .payment_method_stripe_sepa label[for=payment_method_stripe_sepa]{display:block;padding-left:1.41575em}.woocommerce-checkout #payment .payment_method_stripe_sofort label[for=payment_method_stripe_sofort]{display:block;padding-left:1.41575em}#add_payment_method #payment .payment_method_stripe_sofort label[for=payment_method_stripe_sofort]{display:block;padding-left:1.41575em}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/stripe-styles.css CHANGED
@@ -1,158 +1 @@
1
- .wc-stripe-elements-field, .wc-stripe-iban-element-field { border:1px solid #ddd; margin:5px 0; padding:5px; background-color:#fff; outline:0; }
2
-
3
- #add_payment_method .woocommerce-PaymentMethod label { margin-left: 10px; }
4
- #add_payment_method li { clear: right; }
5
- #add_payment_method #wc-stripe_sepa-form { padding: 10px; }
6
- form#order_review #payment_method_stripe { margin: 25px 0 25px 25px; }
7
- form#order_review #payment_method_stripe_sepa { margin: 25px 0 25px 25px; }
8
- form#order_review .payment_methods label { margin-left: 10px; }
9
- form#order_review li { clear: right; }
10
- form#order_review #wc-stripe_sepa-form { padding: 10px; }
11
- .wc_payment_method .payment_box label { display: inline; }
12
-
13
- .woocommerce-checkout #payment .payment_method_stripe,
14
- #add_payment_method #payment .payment_method_stripe { position: relative; }
15
-
16
- .woocommerce-checkout #payment .payment_method_stripe_bancontact,
17
- #add_payment_method #payment .payment_method_stripe_bancontact { position: relative; }
18
-
19
- .woocommerce-checkout #payment .payment_method_stripe_alipay,
20
- #add_payment_method #payment .payment_method_stripe_alipay { position: relative; }
21
-
22
- .woocommerce-checkout #payment .payment_method_stripe_eps,
23
- #add_payment_method #payment .payment_method_stripe_eps { position: relative; }
24
-
25
- .woocommerce-checkout #payment .payment_method_stripe_giropay,
26
- #add_payment_method #payment .payment_method_stripe_giropay { position: relative; }
27
-
28
- .woocommerce-checkout #payment .payment_method_stripe_ideal,
29
- #add_payment_method #payment .payment_method_stripe_ideal { position: relative; }
30
-
31
- .woocommerce-checkout #payment .payment_method_stripe_multibanco,
32
- #add_payment_method #payment .payment_method_stripe_multibanco { position: relative; }
33
-
34
- .woocommerce-checkout #payment .payment_method_stripe_p24,
35
- #add_payment_method #payment .payment_method_stripe_p24 { position: relative; }
36
-
37
- .woocommerce-checkout #payment .payment_method_stripe_sepa,
38
- #add_payment_method #payment .payment_method_stripe_sepa { position: relative; }
39
-
40
- .woocommerce-checkout #payment .payment_method_stripe_sofort,
41
- #add_payment_method #payment .payment_method_stripe_sofort { position: relative; }
42
-
43
- .woocommerce-checkout #payment input#payment_method_stripe,
44
- #add_payment_method #payment input#payment_method_stripe { position: absolute; top: 6px; }
45
-
46
- .woocommerce-checkout #payment input#payment_method_stripe_bancontact,
47
- #add_payment_method #payment input#payment_method_stripe_bancontact { position: absolute; top: 6px; }
48
-
49
- .woocommerce-checkout #payment input#payment_method_stripe_alipay,
50
- #add_payment_method #payment input#payment_method_stripe_alipay { position: absolute; top: 6px; }
51
-
52
- .woocommerce-checkout #payment input#payment_method_stripe_eps,
53
- #add_payment_method #payment input#payment_method_stripe_eps { position: absolute; top: 6px; }
54
-
55
- .woocommerce-checkout #payment input#payment_method_stripe_giropay,
56
- #add_payment_method #payment input#payment_method_stripe_giropay { position: absolute; top: 6px; }
57
-
58
- .woocommerce-checkout #payment input#payment_method_stripe_ideal,
59
- #add_payment_method #payment input#payment_method_stripe_ideal { position: absolute; top: 6px; }
60
-
61
- .woocommerce-checkout #payment input#payment_method_stripe_multibanco,
62
- #add_payment_method #payment input#payment_method_stripe_multibanco { position: absolute; top: 6px; }
63
-
64
- .woocommerce-checkout #payment input#payment_method_stripe_p24,
65
- #add_payment_method #payment input#payment_method_stripe_p24 { position: absolute; top: 6px; }
66
-
67
- .woocommerce-checkout #payment input#payment_method_stripe_sepa,
68
- #add_payment_method #payment input#payment_method_stripe_sepa { position: absolute; top: 6px; }
69
-
70
- .woocommerce-checkout #payment input#payment_method_stripe_sofort,
71
- #add_payment_method #payment input#payment_method_stripe_sofort { position: absolute; top: 6px; }
72
-
73
- .woocommerce-checkout #payment .payment_method_stripe label[for=payment_method_stripe] { display: block; padding-left: 32px; }
74
- #add_payment_method #payment .payment_method_stripe label[for=payment_method_stripe] { display: block; padding-left: 20px; }
75
-
76
- .woocommerce-checkout #payment .payment_method_stripe_bancontact label[for=payment_method_stripe_bancontact] { display: block; padding-left: 32px; }
77
- #add_payment_method #payment .payment_method_stripe_bancontact label[for=payment_method_stripe_bancontact] { display: block; padding-left: 20px; }
78
-
79
- .woocommerce-checkout #payment .payment_method_stripe_alipay label[for=payment_method_stripe_alipay] { display: block; padding-left: 32px; }
80
- #add_payment_method #payment .payment_method_stripe_alipay label[for=payment_method_stripe_alipay] { display: block; padding-left: 20px; }
81
-
82
- .woocommerce-checkout #payment .payment_method_stripe_eps label[for=payment_method_stripe_eps] { display: block; padding-left: 32px; }
83
- #add_payment_method #payment .payment_method_stripe_eps label[for=payment_method_stripe_eps] { display: block; padding-left: 20px; }
84
-
85
- .woocommerce-checkout #payment .payment_method_stripe_giropay label[for=payment_method_stripe_giropay] { display: block; padding-left: 32px; }
86
- #add_payment_method #payment .payment_method_stripe_giropay label[for=payment_method_stripe_giropay] { display: block; padding-left: 20px; }
87
-
88
- .woocommerce-checkout #payment .payment_method_stripe_ideal label[for=payment_method_stripe_ideal] { display: block; padding-left: 32px; }
89
- #add_payment_method #payment .payment_method_stripe_ideal label[for=payment_method_stripe_ideal] { display: block; padding-left: 20px; }
90
-
91
- .woocommerce-checkout #payment .payment_method_stripe_multibanco label[for=payment_method_stripe_multibanco] { display: block; padding-left: 32px; }
92
- #add_payment_method #payment .payment_method_stripe_multibanco label[for=payment_method_stripe_multibanco] { display: block; padding-left: 20px; }
93
-
94
- .woocommerce-checkout #payment .payment_method_stripe_p24 label[for=payment_method_stripe_p24] { display: block; padding-left: 32px; }
95
- #add_payment_method #payment .payment_method_stripe_p24 label[for=payment_method_stripe_p24] { display: block; padding-left: 20px; }
96
-
97
- .woocommerce-checkout #payment .payment_method_stripe_sepa label[for=payment_method_stripe_sepa] { display: block; padding-left: 32px; }
98
- #add_payment_method #payment .payment_method_stripe_sepa label[for=payment_method_stripe_sepa] { display: block; padding-left: 20px; }
99
-
100
- .woocommerce-checkout #payment .payment_method_stripe_sofort label[for=payment_method_stripe_sofort],
101
- #add_payment_method #payment .payment_method_stripe_sofort label[for=payment_method_stripe_sofort] { display: block; padding-left: 32px; }
102
-
103
- .woocommerce-checkout #payment ul.payment_methods li img.stripe-icon,
104
- #add_payment_method #payment ul.payment_methods li img.stripe-icon { float: right; max-width: 40px; padding-left: 3px; margin: 0; }
105
-
106
- .woocommerce-checkout #payment ul.payment_methods li img.stripe-bancontact-icon,
107
- #add_payment_method #payment ul.payment_methods li img.stripe-bancontact-icon { max-height: 65px; max-width: 45px; }
108
-
109
- .woocommerce-checkout #payment ul.payment_methods li img.stripe-ideal-icon,
110
- #add_payment_method #payment ul.payment_methods li img.stripe-ideal-icon { max-height: 35px; }
111
-
112
- .woocommerce-checkout #payment ul.payment_methods li img.stripe-p24-icon,
113
- #add_payment_method #payment ul.payment_methods li img.stripe-p24-icon { max-width: 65px; }
114
-
115
- .woocommerce-checkout #payment ul.payment_methods li img.stripe-alipay-icon,
116
- #add_payment_method #payment ul.payment_methods li img.stripe-alipay-icon { max-width: 50px; }
117
-
118
- .woocommerce-checkout #payment ul.payment_methods li img.stripe-sofort-icon,
119
- #add_payment_method #payment ul.payment_methods li img.stripe-sofort-icon { max-width: 55px; }
120
-
121
- .woocommerce-checkout #payment ul.payment_methods li img.stripe-sepa-icon,
122
- #add_payment_method #payment ul.payment_methods li img.stripe-sepa-icon { max-width: 50px; }
123
-
124
- .woocommerce-checkout #payment ul.payment_methods li img.stripe-multibanco-icon,
125
- #add_payment_method #payment ul.payment_methods li img.stripe-multibanco-icon { max-height: 30px; }
126
-
127
- .woocommerce-checkout #payment ul.payment_methods li img.stripe-eps-icon,
128
- #add_payment_method #payment ul.payment_methods li img.stripe-eps-icon { max-height: 30px; }
129
-
130
- .woocommerce-checkout #payment ul.payment_methods li img.stripe-giropay-icon,
131
- #add_payment_method #payment ul.payment_methods li img.stripe-giropay-icon { max-width: 50px; }
132
-
133
- .woocommerce-checkout #payment ul.payment_methods li .stripe-credit-card-brand,
134
- #add_payment_method #payment ul.payment_methods li .stripe-credit-card-brand { position: absolute; top: 50%; margin-top: -10px; right: 10px; background: no-repeat url( '../images/credit-card.svg' ); display: block; width: 30px; height: 24px; }
135
-
136
- .woocommerce-checkout #payment ul.payment_methods li .stripe-visa-brand,
137
- #add_payment_method #payment ul.payment_methods li .stripe-visa-brand { position: absolute; top: 50%; margin-top: -10px; right: 10px; background: no-repeat url( '../images/visa.svg' ); display: block; width: 30px; height: 24px; }
138
-
139
- .woocommerce-checkout #payment ul.payment_methods li .stripe-amex-brand,
140
- #add_payment_method #payment ul.payment_methods li .stripe-amex-brand { position: absolute; top: 50%; margin-top: -10px; right: 10px; background: no-repeat url( '../images/amex.svg' ); display: block; width: 30px; height: 24px; }
141
-
142
- .woocommerce-checkout #payment ul.payment_methods li .stripe-diners-brand,
143
- #add_payment_method #payment ul.payment_methods li .stripe-diners-brand { position: absolute; top: 50%; margin-top: -10px; right: 10px; background: no-repeat url( '../images/diners.svg' ); display: block; width: 30px; height: 24px; }
144
-
145
- .woocommerce-checkout #payment ul.payment_methods li .stripe-discover-brand,
146
- #add_payment_method #payment ul.payment_methods li .stripe-discover-brand { position: absolute; top: 50%; margin-top: -10px; right: 10px; background: no-repeat url( '../images/discover.svg' ); display: block; width: 30px; height: 24px; }
147
-
148
- .woocommerce-checkout #payment ul.payment_methods li .stripe-jcb-brand,
149
- #add_payment_method #payment ul.payment_methods li .stripe-jcb-brand { position: absolute; top: 50%; margin-top: -10px; right: 10px; background: no-repeat url( '../images/jcb.svg' ); display: block; width: 30px; height: 24px; }
150
-
151
- .woocommerce-checkout #payment ul.payment_methods li .stripe-maestro-brand,
152
- #add_payment_method #payment ul.payment_methods li .stripe-maestro-brand { position: absolute; top: 50%; margin-top: -10px; right: 10px; background: no-repeat url( '../images/maestro.svg' ); display: block; width: 30px; height: 24px; }
153
-
154
- .woocommerce-checkout #payment ul.payment_methods li .stripe-mastercard-brand,
155
- #add_payment_method #payment ul.payment_methods li .stripe-mastercard-brand { position: absolute; top: 50%; margin-top: -10px; right: 10px; background: no-repeat url( '../images/mastercard.svg' ); display: block; width: 30px; height: 24px; }
156
-
157
- .woocommerce-checkout #payment ul.payment_methods .stripe-card-group,
158
- #add_payment_method #payment ul.payment_methods .stripe-card-group { position: relative; }
1
+ .wc-stripe-elements-field,.wc-stripe-iban-element-field{border:1px solid #ddd;margin:5px 0;padding:5px;background-color:#fff;outline:0}#add_payment_method .woocommerce-PaymentMethod label{margin-left:10px}#add_payment_method li{clear:right}#add_payment_method #wc-stripe_sepa-form{padding:10px}form#order_review #payment_method_stripe{margin:25px 0 25px 25px}form#order_review #payment_method_stripe_sepa{margin:25px 0 25px 25px}form#order_review .payment_methods label{margin-left:10px}form#order_review li{clear:right}form#order_review #wc-stripe_sepa-form{padding:10px}.wc_payment_method .payment_box label{display:inline}#add_payment_method #payment .payment_method_stripe,.woocommerce-checkout #payment .payment_method_stripe{position:relative}#add_payment_method #payment .payment_method_stripe_bancontact,.woocommerce-checkout #payment .payment_method_stripe_bancontact{position:relative}#add_payment_method #payment .payment_method_stripe_alipay,.woocommerce-checkout #payment .payment_method_stripe_alipay{position:relative}#add_payment_method #payment .payment_method_stripe_eps,.woocommerce-checkout #payment .payment_method_stripe_eps{position:relative}#add_payment_method #payment .payment_method_stripe_giropay,.woocommerce-checkout #payment .payment_method_stripe_giropay{position:relative}#add_payment_method #payment .payment_method_stripe_ideal,.woocommerce-checkout #payment .payment_method_stripe_ideal{position:relative}#add_payment_method #payment .payment_method_stripe_multibanco,.woocommerce-checkout #payment .payment_method_stripe_multibanco{position:relative}#add_payment_method #payment .payment_method_stripe_p24,.woocommerce-checkout #payment .payment_method_stripe_p24{position:relative}#add_payment_method #payment .payment_method_stripe_sepa,.woocommerce-checkout #payment .payment_method_stripe_sepa{position:relative}#add_payment_method #payment .payment_method_stripe_sofort,.woocommerce-checkout #payment .payment_method_stripe_sofort{position:relative}#add_payment_method #payment input#payment_method_stripe,.woocommerce-checkout #payment input#payment_method_stripe{position:absolute;top:6px}#add_payment_method #payment input#payment_method_stripe_bancontact,.woocommerce-checkout #payment input#payment_method_stripe_bancontact{position:absolute;top:6px}#add_payment_method #payment input#payment_method_stripe_alipay,.woocommerce-checkout #payment input#payment_method_stripe_alipay{position:absolute;top:6px}#add_payment_method #payment input#payment_method_stripe_eps,.woocommerce-checkout #payment input#payment_method_stripe_eps{position:absolute;top:6px}#add_payment_method #payment input#payment_method_stripe_giropay,.woocommerce-checkout #payment input#payment_method_stripe_giropay{position:absolute;top:6px}#add_payment_method #payment input#payment_method_stripe_ideal,.woocommerce-checkout #payment input#payment_method_stripe_ideal{position:absolute;top:6px}#add_payment_method #payment input#payment_method_stripe_multibanco,.woocommerce-checkout #payment input#payment_method_stripe_multibanco{position:absolute;top:6px}#add_payment_method #payment input#payment_method_stripe_p24,.woocommerce-checkout #payment input#payment_method_stripe_p24{position:absolute;top:6px}#add_payment_method #payment input#payment_method_stripe_sepa,.woocommerce-checkout #payment input#payment_method_stripe_sepa{position:absolute;top:6px}#add_payment_method #payment input#payment_method_stripe_sofort,.woocommerce-checkout #payment input#payment_method_stripe_sofort{position:absolute;top:6px}.woocommerce-checkout #payment .payment_method_stripe label[for=payment_method_stripe]{display:block;padding-left:32px}#add_payment_method #payment .payment_method_stripe label[for=payment_method_stripe]{display:block;padding-left:20px}.woocommerce-checkout #payment .payment_method_stripe_bancontact label[for=payment_method_stripe_bancontact]{display:block;padding-left:32px}#add_payment_method #payment .payment_method_stripe_bancontact label[for=payment_method_stripe_bancontact]{display:block;padding-left:20px}.woocommerce-checkout #payment .payment_method_stripe_alipay label[for=payment_method_stripe_alipay]{display:block;padding-left:32px}#add_payment_method #payment .payment_method_stripe_alipay label[for=payment_method_stripe_alipay]{display:block;padding-left:20px}.woocommerce-checkout #payment .payment_method_stripe_eps label[for=payment_method_stripe_eps]{display:block;padding-left:32px}#add_payment_method #payment .payment_method_stripe_eps label[for=payment_method_stripe_eps]{display:block;padding-left:20px}.woocommerce-checkout #payment .payment_method_stripe_giropay label[for=payment_method_stripe_giropay]{display:block;padding-left:32px}#add_payment_method #payment .payment_method_stripe_giropay label[for=payment_method_stripe_giropay]{display:block;padding-left:20px}.woocommerce-checkout #payment .payment_method_stripe_ideal label[for=payment_method_stripe_ideal]{display:block;padding-left:32px}#add_payment_method #payment .payment_method_stripe_ideal label[for=payment_method_stripe_ideal]{display:block;padding-left:20px}.woocommerce-checkout #payment .payment_method_stripe_multibanco label[for=payment_method_stripe_multibanco]{display:block;padding-left:32px}#add_payment_method #payment .payment_method_stripe_multibanco label[for=payment_method_stripe_multibanco]{display:block;padding-left:20px}.woocommerce-checkout #payment .payment_method_stripe_p24 label[for=payment_method_stripe_p24]{display:block;padding-left:32px}#add_payment_method #payment .payment_method_stripe_p24 label[for=payment_method_stripe_p24]{display:block;padding-left:20px}.woocommerce-checkout #payment .payment_method_stripe_sepa label[for=payment_method_stripe_sepa]{display:block;padding-left:32px}#add_payment_method #payment .payment_method_stripe_sepa label[for=payment_method_stripe_sepa]{display:block;padding-left:20px}#add_payment_method #payment .payment_method_stripe_sofort label[for=payment_method_stripe_sofort],.woocommerce-checkout #payment .payment_method_stripe_sofort label[for=payment_method_stripe_sofort]{display:block;padding-left:32px}#add_payment_method #payment ul.payment_methods li img.stripe-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-icon{float:right;max-width:40px;padding-left:3px;margin:0}#add_payment_method #payment ul.payment_methods li img.stripe-bancontact-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-bancontact-icon{max-height:65px;max-width:45px}#add_payment_method #payment ul.payment_methods li img.stripe-ideal-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-ideal-icon{max-height:35px}#add_payment_method #payment ul.payment_methods li img.stripe-p24-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-p24-icon{max-width:65px}#add_payment_method #payment ul.payment_methods li img.stripe-alipay-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-alipay-icon{max-width:50px}#add_payment_method #payment ul.payment_methods li img.stripe-sofort-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-sofort-icon{max-width:55px}#add_payment_method #payment ul.payment_methods li img.stripe-sepa-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-sepa-icon{max-width:50px}#add_payment_method #payment ul.payment_methods li img.stripe-multibanco-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-multibanco-icon{max-height:30px}#add_payment_method #payment ul.payment_methods li img.stripe-eps-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-eps-icon{max-height:30px}#add_payment_method #payment ul.payment_methods li img.stripe-giropay-icon,.woocommerce-checkout #payment ul.payment_methods li img.stripe-giropay-icon{max-width:50px}#add_payment_method #payment ul.payment_methods li .stripe-credit-card-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-credit-card-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/credit-card.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-visa-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-visa-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/visa.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-amex-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-amex-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/amex.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-diners-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-diners-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/diners.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-discover-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-discover-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/discover.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-jcb-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-jcb-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/jcb.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-maestro-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-maestro-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/maestro.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods li .stripe-mastercard-brand,.woocommerce-checkout #payment ul.payment_methods li .stripe-mastercard-brand{position:absolute;top:50%;margin-top:-10px;right:10px;background:no-repeat url(../images/mastercard.svg);display:block;width:30px;height:24px}#add_payment_method #payment ul.payment_methods .stripe-card-group,.woocommerce-checkout #payment ul.payment_methods .stripe-card-group{position:relative}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/stripe-twentyseventeen-styles.css CHANGED
@@ -1,31 +1 @@
1
- .woocommerce-checkout #payment .payment_method_stripe label[for=payment_method_stripe] { display: block; padding-left:0; }
2
- #add_payment_method #payment .payment_method_stripe label[for=payment_method_stripe] { display: block; padding-left: 20px; }
3
-
4
- .woocommerce-checkout #payment .payment_method_stripe_bancontact label[for=payment_method_stripe_bancontact] { display: block; padding-left:0; }
5
- #add_payment_method #payment .payment_method_stripe_bancontact label[for=payment_method_stripe_bancontact] { display: block; padding-left: 20px; }
6
-
7
- .woocommerce-checkout #payment .payment_method_stripe_alipay label[for=payment_method_stripe_alipay] { display: block; padding-left:0; }
8
- #add_payment_method #payment .payment_method_stripe_alipay label[for=payment_method_stripe_alipay] { display: block; padding-left: 20px; }
9
-
10
- .woocommerce-checkout #payment .payment_method_stripe_eps label[for=payment_method_stripe_eps] { display: block; padding-left:0; }
11
- #add_payment_method #payment .payment_method_stripe_eps label[for=payment_method_stripe_eps] { display: block; padding-left: 20px; }
12
-
13
- .woocommerce-checkout #payment .payment_method_stripe_giropay label[for=payment_method_stripe_giropay] { display: block; padding-left:0; }
14
- #add_payment_method #payment .payment_method_stripe_giropay label[for=payment_method_stripe_giropay] { display: block; padding-left: 20px; }
15
-
16
- .woocommerce-checkout #payment .payment_method_stripe_ideal label[for=payment_method_stripe_ideal] { display: block; padding-left:0; }
17
- #add_payment_method #payment .payment_method_stripe_ideal label[for=payment_method_stripe_ideal] { display: block; padding-left: 20px; }
18
-
19
- .woocommerce-checkout #payment .payment_method_stripe_multibanco label[for=payment_method_stripe_multibanco] { display: block; padding-left:0; }
20
- #add_payment_method #payment .payment_method_stripe_multibanco label[for=payment_method_stripe_multibanco] { display: block; padding-left: 20px; }
21
-
22
- .woocommerce-checkout #payment .payment_method_stripe_p24 label[for=payment_method_stripe_p24] { display: block; padding-left:0; }
23
- #add_payment_method #payment .payment_method_stripe_p24 label[for=payment_method_stripe_p24] { display: block; padding-left: 20px; }
24
-
25
- .woocommerce-checkout #payment .payment_method_stripe_sepa label[for=payment_method_stripe_sepa] { display: block; padding-left:0; }
26
- #add_payment_method #payment .payment_method_stripe_sepa label[for=payment_method_stripe_sepa] { display: block; padding-left: 20px; }
27
-
28
- .woocommerce-checkout #payment .payment_method_stripe_sofort label[for=payment_method_stripe_sofort] { display: block; padding-left:0; }
29
- #add_payment_method #payment .payment_method_stripe_sofort label[for=payment_method_stripe_sofort] { display: block; padding-left: 20px; }
30
-
31
- .woocommerce-PaymentMethods li { list-style-type: none; }
1
+ .woocommerce-checkout #payment .payment_method_stripe label[for=payment_method_stripe]{display:block;padding-left:0}#add_payment_method #payment .payment_method_stripe label[for=payment_method_stripe]{display:block;padding-left:20px}.woocommerce-checkout #payment .payment_method_stripe_bancontact label[for=payment_method_stripe_bancontact]{display:block;padding-left:0}#add_payment_method #payment .payment_method_stripe_bancontact label[for=payment_method_stripe_bancontact]{display:block;padding-left:20px}.woocommerce-checkout #payment .payment_method_stripe_alipay label[for=payment_method_stripe_alipay]{display:block;padding-left:0}#add_payment_method #payment .payment_method_stripe_alipay label[for=payment_method_stripe_alipay]{display:block;padding-left:20px}.woocommerce-checkout #payment .payment_method_stripe_eps label[for=payment_method_stripe_eps]{display:block;padding-left:0}#add_payment_method #payment .payment_method_stripe_eps label[for=payment_method_stripe_eps]{display:block;padding-left:20px}.woocommerce-checkout #payment .payment_method_stripe_giropay label[for=payment_method_stripe_giropay]{display:block;padding-left:0}#add_payment_method #payment .payment_method_stripe_giropay label[for=payment_method_stripe_giropay]{display:block;padding-left:20px}.woocommerce-checkout #payment .payment_method_stripe_ideal label[for=payment_method_stripe_ideal]{display:block;padding-left:0}#add_payment_method #payment .payment_method_stripe_ideal label[for=payment_method_stripe_ideal]{display:block;padding-left:20px}.woocommerce-checkout #payment .payment_method_stripe_multibanco label[for=payment_method_stripe_multibanco]{display:block;padding-left:0}#add_payment_method #payment .payment_method_stripe_multibanco label[for=payment_method_stripe_multibanco]{display:block;padding-left:20px}.woocommerce-checkout #payment .payment_method_stripe_p24 label[for=payment_method_stripe_p24]{display:block;padding-left:0}#add_payment_method #payment .payment_method_stripe_p24 label[for=payment_method_stripe_p24]{display:block;padding-left:20px}.woocommerce-checkout #payment .payment_method_stripe_sepa label[for=payment_method_stripe_sepa]{display:block;padding-left:0}#add_payment_method #payment .payment_method_stripe_sepa label[for=payment_method_stripe_sepa]{display:block;padding-left:20px}.woocommerce-checkout #payment .payment_method_stripe_sofort label[for=payment_method_stripe_sofort]{display:block;padding-left:0}#add_payment_method #payment .payment_method_stripe_sofort label[for=payment_method_stripe_sofort]{display:block;padding-left:20px}.woocommerce-PaymentMethods li{list-style-type:none}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/stripe.js CHANGED
@@ -3,7 +3,12 @@
3
  jQuery( function( $ ) {
4
  'use strict';
5
 
6
- var stripe = Stripe( wc_stripe_params.key );
 
 
 
 
 
7
 
8
  var stripe_elements_options = Object.keys( wc_stripe_params.elements_options ).length ? wc_stripe_params.elements_options : {},
9
  sepa_elements_options = Object.keys( wc_stripe_params.sepa_elements_options ).length ? wc_stripe_params.sepa_elements_options : {},
3
  jQuery( function( $ ) {
4
  'use strict';
5
 
6
+ try {
7
+ var stripe = Stripe( wc_stripe_params.key );
8
+ } catch( error ) {
9
+ console.log( error );
10
+ return;
11
+ }
12
 
13
  var stripe_elements_options = Object.keys( wc_stripe_params.elements_options ).length ? wc_stripe_params.elements_options : {},
14
  sepa_elements_options = Object.keys( wc_stripe_params.sepa_elements_options ).length ? wc_stripe_params.sepa_elements_options : {},
assets/js/stripe.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(function(s){"use strict";var t,o,n,a=Stripe(wc_stripe_params.key),e=Object.keys(wc_stripe_params.elements_options).length?wc_stripe_params.elements_options:{},r=Object.keys(wc_stripe_params.sepa_elements_options).length?wc_stripe_params.sepa_elements_options:{},i=a.elements(e),c=i.create("iban",r),p={getAjaxURL:function(e){return wc_stripe_params.ajaxurl.toString().replace("%%endpoint%%","wc_stripe_"+e)},unmountElements:function(){"yes"===wc_stripe_params.inline_cc_form?t.unmount("#stripe-card-element"):(t.unmount("#stripe-card-element"),o.unmount("#stripe-exp-element"),n.unmount("#stripe-cvc-element"))},mountElements:function(){s("#stripe-card-element").length&&("yes"===wc_stripe_params.inline_cc_form?t.mount("#stripe-card-element"):(t.mount("#stripe-card-element"),o.mount("#stripe-exp-element"),n.mount("#stripe-cvc-element")))},createElements:function(){var e={base:{iconColor:"#666EE8",color:"#31325F",fontSize:"15px","::placeholder":{color:"#CFD7E0"}}},r={focus:"focused",empty:"empty",invalid:"invalid"};e=wc_stripe_params.elements_styling?wc_stripe_params.elements_styling:e,r=wc_stripe_params.elements_classes?wc_stripe_params.elements_classes:r,"yes"===wc_stripe_params.inline_cc_form?(t=i.create("card",{style:e,hidePostalCode:!0})).addEventListener("change",function(e){p.onCCFormChange(),e.error&&s(document.body).trigger("stripeError",e)}):(t=i.create("cardNumber",{style:e,classes:r}),o=i.create("cardExpiry",{style:e,classes:r}),n=i.create("cardCvc",{style:e,classes:r}),t.addEventListener("change",function(e){p.onCCFormChange(),p.updateCardBrand(e.brand),e.error&&s(document.body).trigger("stripeError",e)}),o.addEventListener("change",function(e){p.onCCFormChange(),e.error&&s(document.body).trigger("stripeError",e)}),n.addEventListener("change",function(e){p.onCCFormChange(),e.error&&s(document.body).trigger("stripeError",e)})),"yes"===wc_stripe_params.is_checkout?s(document.body).on("updated_checkout",function(){t&&p.unmountElements(),p.mountElements(),s("#stripe-iban-element").length&&c.mount("#stripe-iban-element")}):(s("form#add_payment_method").length||s("form#order_review").length)&&(p.mountElements(),s("#stripe-iban-element").length&&c.mount("#stripe-iban-element"))},updateCardBrand:function(e){var r={visa:"stripe-visa-brand",mastercard:"stripe-mastercard-brand",amex:"stripe-amex-brand",discover:"stripe-discover-brand",diners:"stripe-diners-brand",jcb:"stripe-jcb-brand",unknown:"stripe-credit-card-brand"},t=s(".stripe-card-brand"),o="stripe-credit-card-brand";e in r&&(o=r[e]),s.each(r,function(e,r){t.removeClass(r)}),t.addClass(o)},init:function(){"yes"!==wc_stripe_params.is_change_payment_page&&"yes"!==wc_stripe_params.is_pay_for_order_page||s(document.body).trigger("wc-credit-card-form-init"),this.stripe_checkout_submit=!1,s("form.woocommerce-checkout").length&&(this.form=s("form.woocommerce-checkout")),s("form.woocommerce-checkout").on("checkout_place_order_stripe checkout_place_order_stripe_bancontact checkout_place_order_stripe_sofort checkout_place_order_stripe_giropay checkout_place_order_stripe_ideal checkout_place_order_stripe_alipay checkout_place_order_stripe_sepa",this.onSubmit),s("form#order_review").length&&(this.form=s("form#order_review")),s("form#order_review, form#add_payment_method").on("submit",this.onSubmit),s("form#add_payment_method").length&&(this.form=s("form#add_payment_method")),s("form.woocommerce-checkout").on("change",this.reset),s(document).on("stripeError",this.onError).on("checkout_error",this.reset),c.on("change",this.onSepaError),p.createElements(),"yes"===wc_stripe_params.is_stripe_checkout&&s(document.body).on("click",".wc-stripe-checkout-button",function(){return p.openModal(),!1})},isStripeChosen:function(){return s("#payment_method_stripe, #payment_method_stripe_bancontact, #payment_method_stripe_sofort, #payment_method_stripe_giropay, #payment_method_stripe_ideal, #payment_method_stripe_alipay, #payment_method_stripe_sepa, #payment_method_stripe_eps, #payment_method_stripe_multibanco").is(":checked")||s("#payment_method_stripe").is(":checked")&&"new"===s('input[name="wc-stripe-payment-token"]:checked').val()||s("#payment_method_stripe_sepa").is(":checked")&&"new"===s('input[name="wc-stripe-payment-token"]:checked').val()},isStripeSaveCardChosen:function(){return s("#payment_method_stripe").is(":checked")&&s('input[name="wc-stripe-payment-token"]').is(":checked")&&"new"!==s('input[name="wc-stripe-payment-token"]:checked').val()||s("#payment_method_stripe_sepa").is(":checked")&&s('input[name="wc-stripe_sepa-payment-token"]').is(":checked")&&"new"!==s('input[name="wc-stripe_sepa-payment-token"]:checked').val()},isStripeCardChosen:function(){return s("#payment_method_stripe").is(":checked")},isBancontactChosen:function(){return s("#payment_method_stripe_bancontact").is(":checked")},isGiropayChosen:function(){return s("#payment_method_stripe_giropay").is(":checked")},isIdealChosen:function(){return s("#payment_method_stripe_ideal").is(":checked")},isSofortChosen:function(){return s("#payment_method_stripe_sofort").is(":checked")},isAlipayChosen:function(){return s("#payment_method_stripe_alipay").is(":checked")},isSepaChosen:function(){return s("#payment_method_stripe_sepa").is(":checked")},isP24Chosen:function(){return s("#payment_method_stripe_p24").is(":checked")},isEpsChosen:function(){return s("#payment_method_stripe_eps").is(":checked")},isMultibancoChosen:function(){return s("#payment_method_stripe_multibanco").is(":checked")},hasSource:function(){return 0<s("input.stripe-source").length},hasToken:function(){return 0<s("input.stripe_token").length},isMobile:function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},isStripeModalNeeded:function(e){var r=p.form.find("input.stripe_token");return(!p.stripe_submit||!r)&&!!p.isStripeChosen()},block:function(){p.isMobile()||p.form.block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},unblock:function(){p.form.unblock()},getSelectedPaymentElement:function(){return s('.payment_methods input[name="payment_method"]:checked')},openModal:function(){var t=p.form,e=s("#stripe-payment-data");p.reset();StripeCheckout.open({key:wc_stripe_params.key,billingAddress:e.data("billing-address"),zipCode:e.data("verify-zip"),amount:e.data("amount"),name:e.data("name"),description:e.data("description"),currency:e.data("currency"),image:e.data("image"),locale:e.data("locale"),email:s("#billing_email").val()||e.data("email"),panelLabel:e.data("panel-label"),allowRememberMe:e.data("allow-remember-me"),token:function(e){if(t.find("input.stripe_source").remove(),"token"===e.object)a.createSource({type:"card",token:e.id}).then(p.sourceResponse);else if("source"===e.object){var r={source:e};p.sourceResponse(r)}},closed:p.onClose()})},resetModal:function(){p.reset(),p.stripe_checkout_submit=!1},onClose:function(){p.unblock()},getOwnerDetails:function(){var e=s("#billing_first_name").length?s("#billing_first_name").val():wc_stripe_params.billing_first_name,r=s("#billing_last_name").length?s("#billing_last_name").val():wc_stripe_params.billing_last_name,t={owner:{name:"",address:{},email:"",phone:""}};return t.owner.name=e,t.owner.name=e&&r?e+" "+r:s("#stripe-payment-data").data("full-name"),t.owner.email=s("#billing_email").val(),t.owner.phone=s("#billing_phone").val(),(void 0===t.owner.phone||t.owner.phone.length<=0)&&delete t.owner.phone,(void 0===t.owner.email||t.owner.email.length<=0)&&(s("#stripe-payment-data").data("email").length?t.owner.email=s("#stripe-payment-data").data("email"):delete t.owner.email),(void 0===t.owner.name||t.owner.name.length<=0)&&delete t.owner.name,0<s("#billing_address_1").length?(t.owner.address.line1=s("#billing_address_1").val(),t.owner.address.line2=s("#billing_address_2").val(),t.owner.address.state=s("#billing_state").val(),t.owner.address.city=s("#billing_city").val(),t.owner.address.postal_code=s("#billing_postcode").val(),t.owner.address.country=s("#billing_country").val()):wc_stripe_params.billing_address_1&&(t.owner.address.line1=wc_stripe_params.billing_address_1,t.owner.address.line2=wc_stripe_params.billing_address_2,t.owner.address.state=wc_stripe_params.billing_state,t.owner.address.city=wc_stripe_params.billing_city,t.owner.address.postal_code=wc_stripe_params.billing_postcode,t.owner.address.country=wc_stripe_params.billing_country),t},createSource:function(){var e=p.getOwnerDetails(),r="card";if(p.isBancontactChosen()&&(r="bancontact"),p.isSepaChosen()&&(r="sepa_debit"),p.isIdealChosen()&&(r="ideal"),p.isSofortChosen()&&(r="sofort"),p.isGiropayChosen()&&(r="giropay"),p.isAlipayChosen()&&(r="alipay"),"card"===r)a.createSource(t,e).then(p.sourceResponse);else{switch(r){case"bancontact":case"giropay":case"ideal":case"sofort":case"alipay":e.amount=s("#stripe-"+r+"-payment-data").data("amount"),e.currency=s("#stripe-"+r+"-payment-data").data("currency"),e.redirect={return_url:wc_stripe_params.return_url},wc_stripe_params.statement_descriptor&&(e.statement_descriptor=wc_stripe_params.statement_descriptor)}switch(r){case"sepa_debit":e.currency=s("#stripe-"+r+"-payment-data").data("currency"),e.mandate={notification_method:wc_stripe_params.sepa_mandate_notification};break;case"ideal":e.ideal={bank:s("#stripe-ideal-bank").val()};break;case"alipay":e.currency=s("#stripe-"+r+"-payment-data").data("currency"),e.amount=s("#stripe-"+r+"-payment-data").data("amount");break;case"sofort":e.sofort={country:s("#billing_country").val()}}"sepa_debit"===(e.type=r)?a.createSource(c,e).then(p.sourceResponse):a.createSource(e).then(p.sourceResponse)}},sourceResponse:function(e){e.error?s(document.body).trigger("stripeError",e):"no"===wc_stripe_params.allow_prepaid_card&&"card"===e.source.type&&"prepaid"===e.source.card.funding?(e.error={message:wc_stripe_params.no_prepaid_card_msg},"yes"===wc_stripe_params.is_stripe_checkout?p.submitError('<ul class="woocommerce-error"><li>'+wc_stripe_params.no_prepaid_card_msg+"</li></ul>"):s(document.body).trigger("stripeError",e)):p.processStripeResponse(e.source)},processStripeResponse:function(e){p.reset(),p.form.append("<input type='hidden' class='stripe-source' name='stripe_source' value='"+e.id+"'/>"),s("form#add_payment_method").length&&s(p.form).off("submit",p.form.onSubmit),p.form.submit()},onSubmit:function(e){if(p.isStripeChosen()){if(p.isStripeSaveCardChosen()||p.hasSource()||p.hasToken())return s("form#add_payment_method").length?(e.preventDefault(),"yes"===wc_stripe_params.is_stripe_checkout&&p.isStripeModalNeeded()&&p.isStripeCardChosen()?p.openModal():(p.block(),p.createSource()),!1):void 0;if(e.preventDefault(),p.block(),"yes"===wc_stripe_params.is_stripe_checkout&&p.isStripeModalNeeded()&&p.isStripeCardChosen())return"yes"===wc_stripe_params.is_checkout||(p.openModal(),!1);if(p.isBancontactChosen()||p.isGiropayChosen()||p.isIdealChosen()||p.isAlipayChosen()||p.isSofortChosen()||p.isP24Chosen()||p.isEpsChosen()||p.isMultibancoChosen()){if(s("form#order_review").length)return s("form#order_review").off("submit",this.onSubmit),p.form.submit(),!1;if(s("form.woocommerce-checkout").length)return!0;if(s("form#add_payment_method").length)return s("form#add_payment_method").off("submit",this.onSubmit),p.form.submit(),!1}return p.createSource(),!1}},onCCFormChange:function(){p.reset()},reset:function(){s(".wc-stripe-error, .stripe-source, .stripe_token").remove(),"yes"===wc_stripe_params.is_stripe_checkout&&(p.stripe_submit=!1)},onSepaError:function(e){var r=p.getSelectedPaymentElement().parents("li").eq(0).find(".stripe-source-errors");e.error?(console.log(e.error.message),s(r).html('<ul class="woocommerce_error woocommerce-error wc-stripe-error"><li>'+e.error.message+"</li></ul>")):s(r).html("")},onError:function(e,r){var t=r.error.message,o=p.getSelectedPaymentElement().parents("li").eq(0).find(".stripe-source-errors");if(p.isSepaChosen()&&"invalid_owner_name"===r.error.code&&wc_stripe_params.hasOwnProperty(r.error.code)){var n='<ul class="woocommerce-error"><li>'+wc_stripe_params[r.error.code]+"</li></ul>";return p.submitError(n)}"invalid_request_error"!==r.error.type&&"api_connection_error"!==r.error.type&&"api_error"!==r.error.type&&"authentication_error"!==r.error.type&&"rate_limit_error"!==r.error.type||(t=wc_stripe_params.invalid_request_error),"card_error"===r.error.type&&wc_stripe_params.hasOwnProperty(r.error.code)&&(t=wc_stripe_params[r.error.code]),"validation_error"===r.error.type&&wc_stripe_params.hasOwnProperty(r.error.code)&&(t=wc_stripe_params[r.error.code]),p.reset(),s(".woocommerce-NoticeGroup-checkout").remove(),console.log(r.error.message),s(o).html('<ul class="woocommerce_error woocommerce-error wc-stripe-error"><li>'+t+"</li></ul>"),s(".wc-stripe-error").length&&s("html, body").animate({scrollTop:s(".wc-stripe-error").offset().top-200},200),p.unblock()},submitError:function(e){s(".woocommerce-NoticeGroup-checkout, .woocommerce-error, .woocommerce-message").remove(),p.form.prepend('<div class="woocommerce-NoticeGroup woocommerce-NoticeGroup-checkout">'+e+"</div>"),p.form.removeClass("processing").unblock(),p.form.find(".input-text, select, input:checkbox").blur();var r="";s("#add_payment_method").length&&(r=s("#add_payment_method")),s("#order_review").length&&(r=s("#order_review")),s("form.checkout").length&&(r=s("form.checkout")),r.length&&s("html, body").animate({scrollTop:r.offset().top-100},500),s(document.body).trigger("checkout_error"),p.unblock()}};p.init()});
1
+ jQuery(function(a){"use strict";try{var o=Stripe(wc_stripe_params.key)}catch(e){return void console.log(e)}var t,n,s,e=Object.keys(wc_stripe_params.elements_options).length?wc_stripe_params.elements_options:{},r=Object.keys(wc_stripe_params.sepa_elements_options).length?wc_stripe_params.sepa_elements_options:{},i=o.elements(e),c=i.create("iban",r),p={getAjaxURL:function(e){return wc_stripe_params.ajaxurl.toString().replace("%%endpoint%%","wc_stripe_"+e)},unmountElements:function(){"yes"===wc_stripe_params.inline_cc_form?t.unmount("#stripe-card-element"):(t.unmount("#stripe-card-element"),n.unmount("#stripe-exp-element"),s.unmount("#stripe-cvc-element"))},mountElements:function(){a("#stripe-card-element").length&&("yes"===wc_stripe_params.inline_cc_form?t.mount("#stripe-card-element"):(t.mount("#stripe-card-element"),n.mount("#stripe-exp-element"),s.mount("#stripe-cvc-element")))},createElements:function(){var e={base:{iconColor:"#666EE8",color:"#31325F",fontSize:"15px","::placeholder":{color:"#CFD7E0"}}},r={focus:"focused",empty:"empty",invalid:"invalid"};e=wc_stripe_params.elements_styling?wc_stripe_params.elements_styling:e,r=wc_stripe_params.elements_classes?wc_stripe_params.elements_classes:r,"yes"===wc_stripe_params.inline_cc_form?(t=i.create("card",{style:e,hidePostalCode:!0})).addEventListener("change",function(e){p.onCCFormChange(),e.error&&a(document.body).trigger("stripeError",e)}):(t=i.create("cardNumber",{style:e,classes:r}),n=i.create("cardExpiry",{style:e,classes:r}),s=i.create("cardCvc",{style:e,classes:r}),t.addEventListener("change",function(e){p.onCCFormChange(),p.updateCardBrand(e.brand),e.error&&a(document.body).trigger("stripeError",e)}),n.addEventListener("change",function(e){p.onCCFormChange(),e.error&&a(document.body).trigger("stripeError",e)}),s.addEventListener("change",function(e){p.onCCFormChange(),e.error&&a(document.body).trigger("stripeError",e)})),"yes"===wc_stripe_params.is_checkout?a(document.body).on("updated_checkout",function(){t&&p.unmountElements(),p.mountElements(),a("#stripe-iban-element").length&&c.mount("#stripe-iban-element")}):(a("form#add_payment_method").length||a("form#order_review").length)&&(p.mountElements(),a("#stripe-iban-element").length&&c.mount("#stripe-iban-element"))},updateCardBrand:function(e){var r={visa:"stripe-visa-brand",mastercard:"stripe-mastercard-brand",amex:"stripe-amex-brand",discover:"stripe-discover-brand",diners:"stripe-diners-brand",jcb:"stripe-jcb-brand",unknown:"stripe-credit-card-brand"},t=a(".stripe-card-brand"),o="stripe-credit-card-brand";e in r&&(o=r[e]),a.each(r,function(e,r){t.removeClass(r)}),t.addClass(o)},init:function(){"yes"!==wc_stripe_params.is_change_payment_page&&"yes"!==wc_stripe_params.is_pay_for_order_page||a(document.body).trigger("wc-credit-card-form-init"),this.stripe_checkout_submit=!1,a("form.woocommerce-checkout").length&&(this.form=a("form.woocommerce-checkout")),a("form.woocommerce-checkout").on("checkout_place_order_stripe checkout_place_order_stripe_bancontact checkout_place_order_stripe_sofort checkout_place_order_stripe_giropay checkout_place_order_stripe_ideal checkout_place_order_stripe_alipay checkout_place_order_stripe_sepa",this.onSubmit),a("form#order_review").length&&(this.form=a("form#order_review")),a("form#order_review, form#add_payment_method").on("submit",this.onSubmit),a("form#add_payment_method").length&&(this.form=a("form#add_payment_method")),a("form.woocommerce-checkout").on("change",this.reset),a(document).on("stripeError",this.onError).on("checkout_error",this.reset),c.on("change",this.onSepaError),p.createElements(),"yes"===wc_stripe_params.is_stripe_checkout&&a(document.body).on("click",".wc-stripe-checkout-button",function(){return p.openModal(),!1})},isStripeChosen:function(){return a("#payment_method_stripe, #payment_method_stripe_bancontact, #payment_method_stripe_sofort, #payment_method_stripe_giropay, #payment_method_stripe_ideal, #payment_method_stripe_alipay, #payment_method_stripe_sepa, #payment_method_stripe_eps, #payment_method_stripe_multibanco").is(":checked")||a("#payment_method_stripe").is(":checked")&&"new"===a('input[name="wc-stripe-payment-token"]:checked').val()||a("#payment_method_stripe_sepa").is(":checked")&&"new"===a('input[name="wc-stripe-payment-token"]:checked').val()},isStripeSaveCardChosen:function(){return a("#payment_method_stripe").is(":checked")&&a('input[name="wc-stripe-payment-token"]').is(":checked")&&"new"!==a('input[name="wc-stripe-payment-token"]:checked').val()||a("#payment_method_stripe_sepa").is(":checked")&&a('input[name="wc-stripe_sepa-payment-token"]').is(":checked")&&"new"!==a('input[name="wc-stripe_sepa-payment-token"]:checked').val()},isStripeCardChosen:function(){return a("#payment_method_stripe").is(":checked")},isBancontactChosen:function(){return a("#payment_method_stripe_bancontact").is(":checked")},isGiropayChosen:function(){return a("#payment_method_stripe_giropay").is(":checked")},isIdealChosen:function(){return a("#payment_method_stripe_ideal").is(":checked")},isSofortChosen:function(){return a("#payment_method_stripe_sofort").is(":checked")},isAlipayChosen:function(){return a("#payment_method_stripe_alipay").is(":checked")},isSepaChosen:function(){return a("#payment_method_stripe_sepa").is(":checked")},isP24Chosen:function(){return a("#payment_method_stripe_p24").is(":checked")},isEpsChosen:function(){return a("#payment_method_stripe_eps").is(":checked")},isMultibancoChosen:function(){return a("#payment_method_stripe_multibanco").is(":checked")},hasSource:function(){return 0<a("input.stripe-source").length},hasToken:function(){return 0<a("input.stripe_token").length},isMobile:function(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},isStripeModalNeeded:function(e){var r=p.form.find("input.stripe_token");return(!p.stripe_submit||!r)&&!!p.isStripeChosen()},block:function(){p.isMobile()||p.form.block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},unblock:function(){p.form.unblock()},getSelectedPaymentElement:function(){return a('.payment_methods input[name="payment_method"]:checked')},openModal:function(){var t=p.form,e=a("#stripe-payment-data");p.reset();StripeCheckout.open({key:wc_stripe_params.key,billingAddress:e.data("billing-address"),zipCode:e.data("verify-zip"),amount:e.data("amount"),name:e.data("name"),description:e.data("description"),currency:e.data("currency"),image:e.data("image"),locale:e.data("locale"),email:a("#billing_email").val()||e.data("email"),panelLabel:e.data("panel-label"),allowRememberMe:e.data("allow-remember-me"),token:function(e){if(t.find("input.stripe_source").remove(),"token"===e.object)o.createSource({type:"card",token:e.id}).then(p.sourceResponse);else if("source"===e.object){var r={source:e};p.sourceResponse(r)}},closed:p.onClose()})},resetModal:function(){p.reset(),p.stripe_checkout_submit=!1},onClose:function(){p.unblock()},getOwnerDetails:function(){var e=a("#billing_first_name").length?a("#billing_first_name").val():wc_stripe_params.billing_first_name,r=a("#billing_last_name").length?a("#billing_last_name").val():wc_stripe_params.billing_last_name,t={owner:{name:"",address:{},email:"",phone:""}};return t.owner.name=e,t.owner.name=e&&r?e+" "+r:a("#stripe-payment-data").data("full-name"),t.owner.email=a("#billing_email").val(),t.owner.phone=a("#billing_phone").val(),(void 0===t.owner.phone||t.owner.phone.length<=0)&&delete t.owner.phone,(void 0===t.owner.email||t.owner.email.length<=0)&&(a("#stripe-payment-data").data("email").length?t.owner.email=a("#stripe-payment-data").data("email"):delete t.owner.email),(void 0===t.owner.name||t.owner.name.length<=0)&&delete t.owner.name,0<a("#billing_address_1").length?(t.owner.address.line1=a("#billing_address_1").val(),t.owner.address.line2=a("#billing_address_2").val(),t.owner.address.state=a("#billing_state").val(),t.owner.address.city=a("#billing_city").val(),t.owner.address.postal_code=a("#billing_postcode").val(),t.owner.address.country=a("#billing_country").val()):wc_stripe_params.billing_address_1&&(t.owner.address.line1=wc_stripe_params.billing_address_1,t.owner.address.line2=wc_stripe_params.billing_address_2,t.owner.address.state=wc_stripe_params.billing_state,t.owner.address.city=wc_stripe_params.billing_city,t.owner.address.postal_code=wc_stripe_params.billing_postcode,t.owner.address.country=wc_stripe_params.billing_country),t},createSource:function(){var e=p.getOwnerDetails(),r="card";if(p.isBancontactChosen()&&(r="bancontact"),p.isSepaChosen()&&(r="sepa_debit"),p.isIdealChosen()&&(r="ideal"),p.isSofortChosen()&&(r="sofort"),p.isGiropayChosen()&&(r="giropay"),p.isAlipayChosen()&&(r="alipay"),"card"===r)o.createSource(t,e).then(p.sourceResponse);else{switch(r){case"bancontact":case"giropay":case"ideal":case"sofort":case"alipay":e.amount=a("#stripe-"+r+"-payment-data").data("amount"),e.currency=a("#stripe-"+r+"-payment-data").data("currency"),e.redirect={return_url:wc_stripe_params.return_url},wc_stripe_params.statement_descriptor&&(e.statement_descriptor=wc_stripe_params.statement_descriptor)}switch(r){case"sepa_debit":e.currency=a("#stripe-"+r+"-payment-data").data("currency"),e.mandate={notification_method:wc_stripe_params.sepa_mandate_notification};break;case"ideal":e.ideal={bank:a("#stripe-ideal-bank").val()};break;case"alipay":e.currency=a("#stripe-"+r+"-payment-data").data("currency"),e.amount=a("#stripe-"+r+"-payment-data").data("amount");break;case"sofort":e.sofort={country:a("#billing_country").val()}}"sepa_debit"===(e.type=r)?o.createSource(c,e).then(p.sourceResponse):o.createSource(e).then(p.sourceResponse)}},sourceResponse:function(e){e.error?a(document.body).trigger("stripeError",e):"no"===wc_stripe_params.allow_prepaid_card&&"card"===e.source.type&&"prepaid"===e.source.card.funding?(e.error={message:wc_stripe_params.no_prepaid_card_msg},"yes"===wc_stripe_params.is_stripe_checkout?p.submitError('<ul class="woocommerce-error"><li>'+wc_stripe_params.no_prepaid_card_msg+"</li></ul>"):a(document.body).trigger("stripeError",e)):p.processStripeResponse(e.source)},processStripeResponse:function(e){p.reset(),p.form.append("<input type='hidden' class='stripe-source' name='stripe_source' value='"+e.id+"'/>"),a("form#add_payment_method").length&&a(p.form).off("submit",p.form.onSubmit),p.form.submit()},onSubmit:function(e){if(p.isStripeChosen()){if(p.isStripeSaveCardChosen()||p.hasSource()||p.hasToken())return a("form#add_payment_method").length?(e.preventDefault(),"yes"===wc_stripe_params.is_stripe_checkout&&p.isStripeModalNeeded()&&p.isStripeCardChosen()?p.openModal():(p.block(),p.createSource()),!1):void 0;if(e.preventDefault(),p.block(),"yes"===wc_stripe_params.is_stripe_checkout&&p.isStripeModalNeeded()&&p.isStripeCardChosen())return"yes"===wc_stripe_params.is_checkout||(p.openModal(),!1);if(p.isBancontactChosen()||p.isGiropayChosen()||p.isIdealChosen()||p.isAlipayChosen()||p.isSofortChosen()||p.isP24Chosen()||p.isEpsChosen()||p.isMultibancoChosen()){if(a("form#order_review").length)return a("form#order_review").off("submit",this.onSubmit),p.form.submit(),!1;if(a("form.woocommerce-checkout").length)return!0;if(a("form#add_payment_method").length)return a("form#add_payment_method").off("submit",this.onSubmit),p.form.submit(),!1}return p.createSource(),!1}},onCCFormChange:function(){p.reset()},reset:function(){a(".wc-stripe-error, .stripe-source, .stripe_token").remove(),"yes"===wc_stripe_params.is_stripe_checkout&&(p.stripe_submit=!1)},onSepaError:function(e){var r=p.getSelectedPaymentElement().parents("li").eq(0).find(".stripe-source-errors");e.error?(console.log(e.error.message),a(r).html('<ul class="woocommerce_error woocommerce-error wc-stripe-error"><li>'+e.error.message+"</li></ul>")):a(r).html("")},onError:function(e,r){var t=r.error.message,o=p.getSelectedPaymentElement().parents("li").eq(0).find(".stripe-source-errors");if(p.isSepaChosen()&&"invalid_owner_name"===r.error.code&&wc_stripe_params.hasOwnProperty(r.error.code)){var n='<ul class="woocommerce-error"><li>'+wc_stripe_params[r.error.code]+"</li></ul>";return p.submitError(n)}"invalid_request_error"!==r.error.type&&"api_connection_error"!==r.error.type&&"api_error"!==r.error.type&&"authentication_error"!==r.error.type&&"rate_limit_error"!==r.error.type||(t=wc_stripe_params.invalid_request_error),"card_error"===r.error.type&&wc_stripe_params.hasOwnProperty(r.error.code)&&(t=wc_stripe_params[r.error.code]),"validation_error"===r.error.type&&wc_stripe_params.hasOwnProperty(r.error.code)&&(t=wc_stripe_params[r.error.code]),p.reset(),a(".woocommerce-NoticeGroup-checkout").remove(),console.log(r.error.message),a(o).html('<ul class="woocommerce_error woocommerce-error wc-stripe-error"><li>'+t+"</li></ul>"),a(".wc-stripe-error").length&&a("html, body").animate({scrollTop:a(".wc-stripe-error").offset().top-200},200),p.unblock()},submitError:function(e){a(".woocommerce-NoticeGroup-checkout, .woocommerce-error, .woocommerce-message").remove(),p.form.prepend('<div class="woocommerce-NoticeGroup woocommerce-NoticeGroup-checkout">'+e+"</div>"),p.form.removeClass("processing").unblock(),p.form.find(".input-text, select, input:checkbox").blur();var r="";a("#add_payment_method").length&&(r=a("#add_payment_method")),a("#order_review").length&&(r=a("#order_review")),a("form.checkout").length&&(r=a("form.checkout")),r.length&&a("html, body").animate({scrollTop:r.offset().top-100},500),a(document.body).trigger("checkout_error"),p.unblock()}};p.init()});
changelog.txt CHANGED
@@ -1,5 +1,20 @@
1
  *** Changelog ***
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  = 4.1.10 - 2018-09-17 =
4
  * Fix - When 3DS card redirect status is "not_required", charge the 3DS source.
5
  * Fix - Payment Request not validating quantity before payment sheet shows.
1
  *** Changelog ***
2
 
3
+ = 4.1.11 - 2018-10-17 =
4
+ * Fix - Explicitly set 3DS source id to prevent 3DS source not charging when not required.
5
+ * Fix - Prevent Stripe JS failed live/test check from throwing JS error.
6
+ * Fix - Find order by source ID if charge ID is not found when cancelled webhook is triggered.
7
+ * Fix - Partial refund on Stripe captured charge erroneously refunding total amount.
8
+ * Fix - Capture charge on previously authorized charge, not showing Stripe fees.
9
+ * Fix - Check if payment icons are set before trying to use them.
10
+ * Fix - Can't use method in write context errors.
11
+ * Deprecate - Soft deprecated function is_pre_30 with is_wc_lt function.
12
+ * Add - Ability to update all active subscription's payment method when adding a payment.
13
+ * Add - Hook to show update all active subscription's payment method checkbox `wc_stripe_display_update_subs_payment_method_card_checkbox`.
14
+ * Add - CSS minification.
15
+ * Update - WC 3.5 compatibility.
16
+ * Update - Stripe API version to 2018-09-24.
17
+
18
  = 4.1.10 - 2018-09-17 =
19
  * Fix - When 3DS card redirect status is "not_required", charge the 3DS source.
20
  * Fix - Payment Request not validating quantity before payment sheet shows.
includes/abstracts/abstract-wc-stripe-payment-gateway.php CHANGED
@@ -3,6 +3,8 @@ if ( ! defined( 'ABSPATH' ) ) {
3
  exit;
4
  }
5
 
 
 
6
  /**
7
  * Abstract class that will be inherited by all payment methods.
8
  *
@@ -220,24 +222,27 @@ abstract class WC_Stripe_Payment_Gateway extends WC_Payment_Gateway_CC {
220
  * @return array
221
  */
222
  public function payment_icons() {
223
- return apply_filters( 'wc_stripe_payment_icons', array(
224
- 'visa' => '<img src="' . WC_STRIPE_PLUGIN_URL . '/assets/images/visa.svg" class="stripe-visa-icon stripe-icon" alt="Visa" />',
225
- 'amex' => '<img src="' . WC_STRIPE_PLUGIN_URL . '/assets/images/amex.svg" class="stripe-amex-icon stripe-icon" alt="American Express" />',
226
- 'mastercard' => '<img src="' . WC_STRIPE_PLUGIN_URL . '/assets/images/mastercard.svg" class="stripe-mastercard-icon stripe-icon" alt="Mastercard" />',
227
- 'discover' => '<img src="' . WC_STRIPE_PLUGIN_URL . '/assets/images/discover.svg" class="stripe-discover-icon stripe-icon" alt="Discover" />',
228
- 'diners' => '<img src="' . WC_STRIPE_PLUGIN_URL . '/assets/images/diners.svg" class="stripe-diners-icon stripe-icon" alt="Diners" />',
229
- 'jcb' => '<img src="' . WC_STRIPE_PLUGIN_URL . '/assets/images/jcb.svg" class="stripe-jcb-icon stripe-icon" alt="JCB" />',
230
- 'alipay' => '<img src="' . WC_STRIPE_PLUGIN_URL . '/assets/images/alipay.svg" class="stripe-alipay-icon stripe-icon" alt="Alipay" />',
231
- 'wechat' => '<img src="' . WC_STRIPE_PLUGIN_URL . '/assets/images/wechat.svg" class="stripe-wechat-icon stripe-icon" alt="Wechat Pay" />',
232
- 'bancontact' => '<img src="' . WC_STRIPE_PLUGIN_URL . '/assets/images/bancontact.svg" class="stripe-bancontact-icon stripe-icon" alt="Bancontact" />',
233
- 'ideal' => '<img src="' . WC_STRIPE_PLUGIN_URL . '/assets/images/ideal.svg" class="stripe-ideal-icon stripe-icon" alt="iDeal" />',
234
- 'p24' => '<img src="' . WC_STRIPE_PLUGIN_URL . '/assets/images/p24.svg" class="stripe-p24-icon stripe-icon" alt="P24" />',
235
- 'giropay' => '<img src="' . WC_STRIPE_PLUGIN_URL . '/assets/images/giropay.svg" class="stripe-giropay-icon stripe-icon" alt="Giropay" />',
236
- 'eps' => '<img src="' . WC_STRIPE_PLUGIN_URL . '/assets/images/eps.svg" class="stripe-eps-icon stripe-icon" alt="EPS" />',
237
- 'multibanco' => '<img src="' . WC_STRIPE_PLUGIN_URL . '/assets/images/multibanco.svg" class="stripe-multibanco-icon stripe-icon" alt="Multibanco" />',
238
- 'sofort' => '<img src="' . WC_STRIPE_PLUGIN_URL . '/assets/images/sofort.svg" class="stripe-sofort-icon stripe-icon" alt="SOFORT" />',
239
- 'sepa' => '<img src="' . WC_STRIPE_PLUGIN_URL . '/assets/images/sepa.svg" class="stripe-sepa-icon stripe-icon" alt="SEPA" />',
240
- ) );
 
 
 
241
  }
242
 
243
  /**
@@ -278,11 +283,11 @@ abstract class WC_Stripe_Payment_Gateway extends WC_Payment_Gateway_CC {
278
  * @version 4.0.0
279
  */
280
  public function get_stripe_customer_id( $order ) {
281
- $customer = get_user_meta( WC_Stripe_Helper::is_pre_30() ? $order->customer_user : $order->get_customer_id(), '_stripe_customer_id', true );
282
 
283
  if ( empty( $customer ) ) {
284
  // Try to get it via the order.
285
- if ( WC_Stripe_Helper::is_pre_30() ) {
286
  return get_post_meta( $order->id, '_stripe_customer_id', true );
287
  } else {
288
  return $order->get_meta( '_stripe_customer_id', true );
@@ -308,7 +313,7 @@ abstract class WC_Stripe_Payment_Gateway extends WC_Payment_Gateway_CC {
308
  $id = uniqid();
309
  }
310
 
311
- $order_id = WC_Stripe_Helper::is_pre_30() ? $order->id : $order->get_id();
312
 
313
  $args = array(
314
  'utm_nooverride' => '1',
@@ -340,23 +345,23 @@ abstract class WC_Stripe_Payment_Gateway extends WC_Payment_Gateway_CC {
340
  * @return array()
341
  */
342
  public function generate_payment_request( $order, $prepared_source ) {
343
- $settings = get_option( 'woocommerce_stripe_settings', array() );
344
- $statement_descriptor = ! empty( $settings['statement_descriptor'] ) ? str_replace( "'", '', $settings['statement_descriptor'] ) : '';
345
- $capture = ! empty( $settings['capture'] ) && 'yes' === $settings['capture'] ? true : false;
346
- $post_data = array();
347
- $post_data['currency'] = strtolower( WC_Stripe_Helper::is_pre_30() ? $order->get_order_currency() : $order->get_currency() );
348
- $post_data['amount'] = WC_Stripe_Helper::get_stripe_amount( $order->get_total(), $post_data['currency'] );
349
  /* translators: 1) blog name 2) order number */
350
- $post_data['description'] = sprintf( __( '%1$s - Order %2$s', 'woocommerce-gateway-stripe' ), wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ), $order->get_order_number() );
351
- $billing_email = WC_Stripe_Helper::is_pre_30() ? $order->billing_email : $order->get_billing_email();
352
- $billing_first_name = WC_Stripe_Helper::is_pre_30() ? $order->billing_first_name : $order->get_billing_first_name();
353
- $billing_last_name = WC_Stripe_Helper::is_pre_30() ? $order->billing_last_name : $order->get_billing_last_name();
354
 
355
  if ( ! empty( $billing_email ) && apply_filters( 'wc_stripe_send_stripe_receipt', false ) ) {
356
  $post_data['receipt_email'] = $billing_email;
357
  }
358
 
359
- switch ( WC_Stripe_Helper::is_pre_30() ? $order->payment_method : $order->get_payment_method() ) {
360
  case 'stripe':
361
  if ( ! empty( $statement_descriptor ) ) {
362
  $post_data['statement_descriptor'] = WC_Stripe_Helper::clean_statement_descriptor( $statement_descriptor );
@@ -379,7 +384,7 @@ abstract class WC_Stripe_Payment_Gateway extends WC_Payment_Gateway_CC {
379
  'order_id' => $order->get_order_number(),
380
  );
381
 
382
- if ( $this->has_subscription( WC_Stripe_Helper::is_pre_30() ? $order->id : $order->get_id() ) ) {
383
  $metadata += array(
384
  'payment_type' => 'recurring',
385
  'site_url' => esc_url( get_site_url() ),
@@ -413,12 +418,12 @@ abstract class WC_Stripe_Payment_Gateway extends WC_Payment_Gateway_CC {
413
  public function process_response( $response, $order ) {
414
  WC_Stripe_Logger::log( 'Processing response: ' . print_r( $response, true ) );
415
 
416
- $order_id = WC_Stripe_Helper::is_pre_30() ? $order->id : $order->get_id();
417
 
418
  $captured = ( isset( $response->captured ) && $response->captured ) ? 'yes' : 'no';
419
 
420
  // Store charge data.
421
- WC_Stripe_Helper::is_pre_30() ? update_post_meta( $order_id, '_stripe_charge_captured', $captured ) : $order->update_meta_data( '_stripe_charge_captured', $captured );
422
 
423
  // Store other data such as fees.
424
  if ( isset( $response->balance_transaction ) && isset( $response->balance_transaction->fee ) ) {
@@ -441,13 +446,13 @@ abstract class WC_Stripe_Payment_Gateway extends WC_Payment_Gateway_CC {
441
  * take care of the status changes.
442
  */
443
  if ( 'pending' === $response->status ) {
444
- $order_stock_reduced = WC_Stripe_Helper::is_pre_30() ? get_post_meta( $order_id, '_order_stock_reduced', true ) : $order->get_meta( '_order_stock_reduced', true );
445
 
446
  if ( ! $order_stock_reduced ) {
447
- WC_Stripe_Helper::is_pre_30() ? $order->reduce_order_stock() : wc_reduce_stock_levels( $order_id );
448
  }
449
 
450
- WC_Stripe_Helper::is_pre_30() ? update_post_meta( $order_id, '_transaction_id', $response->id ) : $order->set_transaction_id( $response->id );
451
  /* translators: transaction id */
452
  $order->update_status( 'on-hold', sprintf( __( 'Stripe charge awaiting payment: %s.', 'woocommerce-gateway-stripe' ), $response->id ) );
453
  }
@@ -466,10 +471,10 @@ abstract class WC_Stripe_Payment_Gateway extends WC_Payment_Gateway_CC {
466
  throw new WC_Stripe_Exception( print_r( $response, true ), $localized_message );
467
  }
468
  } else {
469
- WC_Stripe_Helper::is_pre_30() ? update_post_meta( $order_id, '_transaction_id', $response->id ) : $order->set_transaction_id( $response->id );
470
 
471
  if ( $order->has_status( array( 'pending', 'failed' ) ) ) {
472
- WC_Stripe_Helper::is_pre_30() ? $order->reduce_order_stock() : wc_reduce_stock_levels( $order_id );
473
  }
474
 
475
  /* translators: transaction id */
@@ -509,14 +514,14 @@ abstract class WC_Stripe_Payment_Gateway extends WC_Payment_Gateway_CC {
509
  * @return object $details
510
  */
511
  public function get_owner_details( $order ) {
512
- $billing_first_name = WC_Stripe_Helper::is_pre_30() ? $order->billing_first_name : $order->get_billing_first_name();
513
- $billing_last_name = WC_Stripe_Helper::is_pre_30() ? $order->billing_last_name : $order->get_billing_last_name();
514
 
515
  $details = array();
516
 
517
  $name = $billing_first_name . ' ' . $billing_last_name;
518
- $email = WC_Stripe_Helper::is_pre_30() ? $order->billing_email : $order->get_billing_email();
519
- $phone = WC_Stripe_Helper::is_pre_30() ? $order->billing_phone : $order->get_billing_phone();
520
 
521
  if ( ! empty( $phone ) ) {
522
  $details['phone'] = $phone;
@@ -530,12 +535,12 @@ abstract class WC_Stripe_Payment_Gateway extends WC_Payment_Gateway_CC {
530
  $details['email'] = $email;
531
  }
532
 
533
- $details['address']['line1'] = WC_Stripe_Helper::is_pre_30() ? $order->billing_address_1 : $order->get_billing_address_1();
534
- $details['address']['line2'] = WC_Stripe_Helper::is_pre_30() ? $order->billing_address_2 : $order->get_billing_address_2();
535
- $details['address']['state'] = WC_Stripe_Helper::is_pre_30() ? $order->billing_state : $order->get_billing_state();
536
- $details['address']['city'] = WC_Stripe_Helper::is_pre_30() ? $order->billing_city : $order->get_billing_city();
537
- $details['address']['postal_code'] = WC_Stripe_Helper::is_pre_30() ? $order->billing_postcode : $order->get_billing_postcode();
538
- $details['address']['country'] = WC_Stripe_Helper::is_pre_30() ? $order->billing_country : $order->get_billing_country();
539
 
540
  return (object) apply_filters( 'wc_stripe_owner_details', $details, $order );
541
  }
@@ -569,11 +574,16 @@ abstract class WC_Stripe_Payment_Gateway extends WC_Payment_Gateway_CC {
569
  * @return bool
570
  */
571
  public function is_3ds_required( $source_object ) {
572
- return apply_filters( 'wc_stripe_require_3ds', (
 
 
573
  $source_object && ! empty( $source_object->card ) ) &&
574
  ( 'card' === $source_object->type && 'required' === $source_object->card->three_d_secure ||
575
  ( $this->three_d_secure && 'recommended' === $source_object->card->three_d_secure )
576
- ), $source_object, $this->three_d_secure );
 
 
 
577
  }
578
 
579
  /**
@@ -632,9 +642,9 @@ abstract class WC_Stripe_Payment_Gateway extends WC_Payment_Gateway_CC {
632
  * @return mixed
633
  */
634
  public function create_3ds_source( $order, $source_object, $return_url = '' ) {
635
- $currency = WC_Stripe_Helper::is_pre_30() ? $order->get_order_currency() : $order->get_currency();
636
- $order_id = WC_Stripe_Helper::is_pre_30() ? $order->id : $order->get_id();
637
- $return_url = empty( $return_url ) ? $this->get_stripe_return_url( $order ) : $return_url;
638
 
639
  $post_data = array();
640
  $post_data['amount'] = WC_Stripe_Helper::get_stripe_amount( $order->get_total(), $currency );
@@ -663,14 +673,14 @@ abstract class WC_Stripe_Payment_Gateway extends WC_Payment_Gateway_CC {
663
  * @return object
664
  */
665
  public function prepare_source( $user_id, $force_save_source = false ) {
666
- $customer = new WC_Stripe_Customer( $user_id );
667
- $set_customer = true;
668
- $force_save_source = apply_filters( 'wc_stripe_force_save_source', $force_save_source, $customer );
669
- $source_object = '';
670
- $source_id = '';
671
- $wc_token_id = false;
672
- $payment_method = isset( $_POST['payment_method'] ) ? wc_clean( $_POST['payment_method'] ) : 'stripe';
673
- $is_token = false;
674
 
675
  // New CC info was entered and we have a new source to process.
676
  if ( ! empty( $_POST['stripe_source'] ) ) {
@@ -763,7 +773,7 @@ abstract class WC_Stripe_Payment_Gateway extends WC_Payment_Gateway_CC {
763
  $source_object = false;
764
 
765
  if ( $order ) {
766
- $order_id = WC_Stripe_Helper::is_pre_30() ? $order->id : $order->get_id();
767
 
768
  $stripe_customer_id = get_post_meta( $order_id, '_stripe_customer_id', true );
769
 
@@ -771,14 +781,14 @@ abstract class WC_Stripe_Payment_Gateway extends WC_Payment_Gateway_CC {
771
  $stripe_customer->set_id( $stripe_customer_id );
772
  }
773
 
774
- $source_id = WC_Stripe_Helper::is_pre_30() ? get_post_meta( $order_id, '_stripe_source_id', true ) : $order->get_meta( '_stripe_source_id', true );
775
 
776
  // Since 4.0.0, we changed card to source so we need to account for that.
777
  if ( empty( $source_id ) ) {
778
- $source_id = WC_Stripe_Helper::is_pre_30() ? get_post_meta( $order_id, '_stripe_card_id', true ) : $order->get_meta( '_stripe_card_id', true );
779
 
780
  // Take this opportunity to update the key name.
781
- WC_Stripe_Helper::is_pre_30() ? update_post_meta( $order_id, '_stripe_source_id', $source_id ) : $order->update_meta_data( '_stripe_source_id', $source_id );
782
 
783
  if ( is_callable( array( $order, 'save' ) ) ) {
784
  $order->save();
@@ -814,11 +824,11 @@ abstract class WC_Stripe_Payment_Gateway extends WC_Payment_Gateway_CC {
814
  * @param stdClass $source Source information.
815
  */
816
  public function save_source_to_order( $order, $source ) {
817
- $order_id = WC_Stripe_Helper::is_pre_30() ? $order->id : $order->get_id();
818
 
819
  // Store source in the order.
820
  if ( $source->customer ) {
821
- if ( WC_Stripe_Helper::is_pre_30() ) {
822
  update_post_meta( $order_id, '_stripe_customer_id', $source->customer );
823
  } else {
824
  $order->update_meta_data( '_stripe_customer_id', $source->customer );
@@ -826,7 +836,7 @@ abstract class WC_Stripe_Payment_Gateway extends WC_Payment_Gateway_CC {
826
  }
827
 
828
  if ( $source->source ) {
829
- if ( WC_Stripe_Helper::is_pre_30() ) {
830
  update_post_meta( $order_id, '_stripe_source_id', $source->source );
831
  } else {
832
  $order->update_meta_data( '_stripe_source_id', $source->source );
@@ -848,7 +858,7 @@ abstract class WC_Stripe_Payment_Gateway extends WC_Payment_Gateway_CC {
848
  * @param int $balance_transaction_id
849
  */
850
  public function update_fees( $order, $balance_transaction_id ) {
851
- $order_id = WC_Stripe_Helper::is_pre_30() ? $order->id : $order->get_id();
852
 
853
  $balance_transaction = WC_Stripe_API::retrieve( 'balance/history/' . $balance_transaction_id );
854
 
@@ -870,6 +880,9 @@ abstract class WC_Stripe_Payment_Gateway extends WC_Payment_Gateway_CC {
870
  WC_Stripe_Helper::update_stripe_fee( $order, $fee );
871
  WC_Stripe_Helper::update_stripe_net( $order, $net );
872
 
 
 
 
873
  if ( is_callable( array( $order, 'save' ) ) ) {
874
  $order->save();
875
  }
@@ -879,30 +892,6 @@ abstract class WC_Stripe_Payment_Gateway extends WC_Payment_Gateway_CC {
879
  }
880
  }
881
 
882
- /**
883
- * Updates Stripe currency in order meta.
884
- *
885
- * @since 4.1.7
886
- * @param object $order The order object
887
- * @param int $balance_transaction_id
888
- */
889
- public function update_currency( $order, $balance_transaction_id ) {
890
- $order_id = WC_Stripe_Helper::is_pre_30() ? $order->id : $order->get_id();
891
-
892
- $balance_transaction = WC_Stripe_API::retrieve( 'balance/history/' . $balance_transaction_id );
893
-
894
- if ( empty( $balance_transaction->error ) ) {
895
- $currency = ! empty( $balance_transaction->currency ) ? strtoupper( $balance_transaction->currency ) : null;
896
- WC_Stripe_Helper::update_stripe_currency( $order, $currency );
897
-
898
- if ( is_callable( array( $order, 'save' ) ) ) {
899
- $order->save();
900
- }
901
- } else {
902
- WC_Stripe_Logger::log( "Unable to update currency meta for order: {$order_id}" );
903
- }
904
- }
905
-
906
  /**
907
  * Refund a charge.
908
  *
@@ -921,7 +910,7 @@ abstract class WC_Stripe_Payment_Gateway extends WC_Payment_Gateway_CC {
921
 
922
  $request = array();
923
 
924
- if ( WC_Stripe_Helper::is_pre_30() ) {
925
  $order_currency = get_post_meta( $order_id, '_order_currency', true );
926
  $captured = get_post_meta( $order_id, '_stripe_charge_captured', true );
927
  } else {
@@ -958,11 +947,11 @@ abstract class WC_Stripe_Payment_Gateway extends WC_Payment_Gateway_CC {
958
  return $response;
959
 
960
  } elseif ( ! empty( $response->id ) ) {
961
- WC_Stripe_Helper::is_pre_30() ? update_post_meta( $order_id, '_stripe_refund_id', $response->id ) : $order->update_meta_data( '_stripe_refund_id', $response->id );
962
 
963
  $amount = wc_price( $response->amount / 100 );
964
 
965
- if ( in_array( strtolower( WC_Stripe_Helper::is_pre_30() ? $order->get_order_currency() : $order->get_currency() ), WC_Stripe_Helper::no_decimal_currencies() ) ) {
966
  $amount = wc_price( $response->amount );
967
  }
968
 
@@ -974,7 +963,7 @@ abstract class WC_Stripe_Payment_Gateway extends WC_Payment_Gateway_CC {
974
  $refund_message = ( isset( $captured ) && 'yes' === $captured ) ? sprintf( __( 'Refunded %1$s - Refund ID: %2$s - Reason: %3$s', 'woocommerce-gateway-stripe' ), $amount, $response->id, $reason ) : __( 'Pre-Authorization Released', 'woocommerce-gateway-stripe' );
975
 
976
  $order->add_order_note( $refund_message );
977
- WC_Stripe_Logger::log( 'Success: ' . html_entity_decode( strip_tags( $refund_message ) ) );
978
 
979
  return true;
980
  }
@@ -989,7 +978,7 @@ abstract class WC_Stripe_Payment_Gateway extends WC_Payment_Gateway_CC {
989
  */
990
  public function add_payment_method() {
991
  $error = false;
992
- $error_msg = __( 'There was a problem adding the card.', 'woocommerce-gateway-stripe' );
993
  $source_id = '';
994
 
995
  if ( empty( $_POST['stripe_source'] ) && empty( $_POST['stripe_token'] ) || ! is_user_logged_in() ) {
@@ -1024,6 +1013,8 @@ abstract class WC_Stripe_Payment_Gateway extends WC_Payment_Gateway_CC {
1024
  return;
1025
  }
1026
 
 
 
1027
  return array(
1028
  'result' => 'success',
1029
  'redirect' => wc_get_endpoint_url( 'payment-methods' ),
3
  exit;
4
  }
5
 
6
+ // phpcs:disable WordPress.Files.FileName
7
+
8
  /**
9
  * Abstract class that will be inherited by all payment methods.
10
  *
222
  * @return array
223
  */
224
  public function payment_icons() {
225
+ return apply_filters(
226
+ 'wc_stripe_payment_icons',
227
+ array(
228
+ 'visa' => '<img src="' . WC_STRIPE_PLUGIN_URL . '/assets/images/visa.svg" class="stripe-visa-icon stripe-icon" alt="Visa" />',
229
+ 'amex' => '<img src="' . WC_STRIPE_PLUGIN_URL . '/assets/images/amex.svg" class="stripe-amex-icon stripe-icon" alt="American Express" />',
230
+ 'mastercard' => '<img src="' . WC_STRIPE_PLUGIN_URL . '/assets/images/mastercard.svg" class="stripe-mastercard-icon stripe-icon" alt="Mastercard" />',
231
+ 'discover' => '<img src="' . WC_STRIPE_PLUGIN_URL . '/assets/images/discover.svg" class="stripe-discover-icon stripe-icon" alt="Discover" />',
232
+ 'diners' => '<img src="' . WC_STRIPE_PLUGIN_URL . '/assets/images/diners.svg" class="stripe-diners-icon stripe-icon" alt="Diners" />',
233
+ 'jcb' => '<img src="' . WC_STRIPE_PLUGIN_URL . '/assets/images/jcb.svg" class="stripe-jcb-icon stripe-icon" alt="JCB" />',
234
+ 'alipay' => '<img src="' . WC_STRIPE_PLUGIN_URL . '/assets/images/alipay.svg" class="stripe-alipay-icon stripe-icon" alt="Alipay" />',
235
+ 'wechat' => '<img src="' . WC_STRIPE_PLUGIN_URL . '/assets/images/wechat.svg" class="stripe-wechat-icon stripe-icon" alt="Wechat Pay" />',
236
+ 'bancontact' => '<img src="' . WC_STRIPE_PLUGIN_URL . '/assets/images/bancontact.svg" class="stripe-bancontact-icon stripe-icon" alt="Bancontact" />',
237
+ 'ideal' => '<img src="' . WC_STRIPE_PLUGIN_URL . '/assets/images/ideal.svg" class="stripe-ideal-icon stripe-icon" alt="iDeal" />',
238
+ 'p24' => '<img src="' . WC_STRIPE_PLUGIN_URL . '/assets/images/p24.svg" class="stripe-p24-icon stripe-icon" alt="P24" />',
239
+ 'giropay' => '<img src="' . WC_STRIPE_PLUGIN_URL . '/assets/images/giropay.svg" class="stripe-giropay-icon stripe-icon" alt="Giropay" />',
240
+ 'eps' => '<img src="' . WC_STRIPE_PLUGIN_URL . '/assets/images/eps.svg" class="stripe-eps-icon stripe-icon" alt="EPS" />',
241
+ 'multibanco' => '<img src="' . WC_STRIPE_PLUGIN_URL . '/assets/images/multibanco.svg" class="stripe-multibanco-icon stripe-icon" alt="Multibanco" />',
242
+ 'sofort' => '<img src="' . WC_STRIPE_PLUGIN_URL . '/assets/images/sofort.svg" class="stripe-sofort-icon stripe-icon" alt="SOFORT" />',
243
+ 'sepa' => '<img src="' . WC_STRIPE_PLUGIN_URL . '/assets/images/sepa.svg" class="stripe-sepa-icon stripe-icon" alt="SEPA" />',
244
+ )
245
+ );
246
  }
247
 
248
  /**
283
  * @version 4.0.0
284
  */
285
  public function get_stripe_customer_id( $order ) {
286
+ $customer = get_user_meta( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->customer_user : $order->get_customer_id(), '_stripe_customer_id', true );
287
 
288
  if ( empty( $customer ) ) {
289
  // Try to get it via the order.
290
+ if ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ) {
291
  return get_post_meta( $order->id, '_stripe_customer_id', true );
292
  } else {
293
  return $order->get_meta( '_stripe_customer_id', true );
313
  $id = uniqid();
314
  }
315
 
316
+ $order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();
317
 
318
  $args = array(
319
  'utm_nooverride' => '1',
345
  * @return array()
346
  */
347
  public function generate_payment_request( $order, $prepared_source ) {
348
+ $settings = get_option( 'woocommerce_stripe_settings', array() );
349
+ $statement_descriptor = ! empty( $settings['statement_descriptor'] ) ? str_replace( "'", '', $settings['statement_descriptor'] ) : '';
350
+ $capture = ! empty( $settings['capture'] ) && 'yes' === $settings['capture'] ? true : false;
351
+ $post_data = array();
352
+ $post_data['currency'] = strtolower( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->get_order_currency() : $order->get_currency() );
353
+ $post_data['amount'] = WC_Stripe_Helper::get_stripe_amount( $order->get_total(), $post_data['currency'] );
354
  /* translators: 1) blog name 2) order number */
355
+ $post_data['description'] = sprintf( __( '%1$s - Order %2$s', 'woocommerce-gateway-stripe' ), wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ), $order->get_order_number() );
356
+ $billing_email = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->billing_email : $order->get_billing_email();
357
+ $billing_first_name = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->billing_first_name : $order->get_billing_first_name();
358
+ $billing_last_name = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->billing_last_name : $order->get_billing_last_name();
359
 
360
  if ( ! empty( $billing_email ) && apply_filters( 'wc_stripe_send_stripe_receipt', false ) ) {
361
  $post_data['receipt_email'] = $billing_email;
362
  }
363
 
364
+ switch ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->payment_method : $order->get_payment_method() ) {
365
  case 'stripe':
366
  if ( ! empty( $statement_descriptor ) ) {
367
  $post_data['statement_descriptor'] = WC_Stripe_Helper::clean_statement_descriptor( $statement_descriptor );
384
  'order_id' => $order->get_order_number(),
385
  );
386
 
387
+ if ( $this->has_subscription( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id() ) ) {
388
  $metadata += array(
389
  'payment_type' => 'recurring',
390
  'site_url' => esc_url( get_site_url() ),
418
  public function process_response( $response, $order ) {
419
  WC_Stripe_Logger::log( 'Processing response: ' . print_r( $response, true ) );
420
 
421
+ $order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();
422
 
423
  $captured = ( isset( $response->captured ) && $response->captured ) ? 'yes' : 'no';
424
 
425
  // Store charge data.
426
+ WC_Stripe_Helper::is_wc_lt( '3.0' ) ? update_post_meta( $order_id, '_stripe_charge_captured', $captured ) : $order->update_meta_data( '_stripe_charge_captured', $captured );
427
 
428
  // Store other data such as fees.
429
  if ( isset( $response->balance_transaction ) && isset( $response->balance_transaction->fee ) ) {
446
  * take care of the status changes.
447
  */
448
  if ( 'pending' === $response->status ) {
449
+ $order_stock_reduced = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? get_post_meta( $order_id, '_order_stock_reduced', true ) : $order->get_meta( '_order_stock_reduced', true );
450
 
451
  if ( ! $order_stock_reduced ) {
452
+ WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->reduce_order_stock() : wc_reduce_stock_levels( $order_id );
453
  }
454
 
455
+ WC_Stripe_Helper::is_wc_lt( '3.0' ) ? update_post_meta( $order_id, '_transaction_id', $response->id ) : $order->set_transaction_id( $response->id );
456
  /* translators: transaction id */
457
  $order->update_status( 'on-hold', sprintf( __( 'Stripe charge awaiting payment: %s.', 'woocommerce-gateway-stripe' ), $response->id ) );
458
  }
471
  throw new WC_Stripe_Exception( print_r( $response, true ), $localized_message );
472
  }
473
  } else {
474
+ WC_Stripe_Helper::is_wc_lt( '3.0' ) ? update_post_meta( $order_id, '_transaction_id', $response->id ) : $order->set_transaction_id( $response->id );
475
 
476
  if ( $order->has_status( array( 'pending', 'failed' ) ) ) {
477
+ WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->reduce_order_stock() : wc_reduce_stock_levels( $order_id );
478
  }
479
 
480
  /* translators: transaction id */
514
  * @return object $details
515
  */
516
  public function get_owner_details( $order ) {
517
+ $billing_first_name = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->billing_first_name : $order->get_billing_first_name();
518
+ $billing_last_name = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->billing_last_name : $order->get_billing_last_name();
519
 
520
  $details = array();
521
 
522
  $name = $billing_first_name . ' ' . $billing_last_name;
523
+ $email = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->billing_email : $order->get_billing_email();
524
+ $phone = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->billing_phone : $order->get_billing_phone();
525
 
526
  if ( ! empty( $phone ) ) {
527
  $details['phone'] = $phone;
535
  $details['email'] = $email;
536
  }
537
 
538
+ $details['address']['line1'] = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->billing_address_1 : $order->get_billing_address_1();
539
+ $details['address']['line2'] = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->billing_address_2 : $order->get_billing_address_2();
540
+ $details['address']['state'] = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->billing_state : $order->get_billing_state();
541
+ $details['address']['city'] = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->billing_city : $order->get_billing_city();
542
+ $details['address']['postal_code'] = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->billing_postcode : $order->get_billing_postcode();
543
+ $details['address']['country'] = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->billing_country : $order->get_billing_country();
544
 
545
  return (object) apply_filters( 'wc_stripe_owner_details', $details, $order );
546
  }
574
  * @return bool
575
  */
576
  public function is_3ds_required( $source_object ) {
577
+ return apply_filters(
578
+ 'wc_stripe_require_3ds',
579
+ (
580
  $source_object && ! empty( $source_object->card ) ) &&
581
  ( 'card' === $source_object->type && 'required' === $source_object->card->three_d_secure ||
582
  ( $this->three_d_secure && 'recommended' === $source_object->card->three_d_secure )
583
+ ),
584
+ $source_object,
585
+ $this->three_d_secure
586
+ );
587
  }
588
 
589
  /**
642
  * @return mixed
643
  */
644
  public function create_3ds_source( $order, $source_object, $return_url = '' ) {
645
+ $currency = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->get_order_currency() : $order->get_currency();
646
+ $order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();
647
+ $return_url = empty( $return_url ) ? $this->get_stripe_return_url( $order ) : $return_url;
648
 
649
  $post_data = array();
650
  $post_data['amount'] = WC_Stripe_Helper::get_stripe_amount( $order->get_total(), $currency );
673
  * @return object
674
  */
675
  public function prepare_source( $user_id, $force_save_source = false ) {
676
+ $customer = new WC_Stripe_Customer( $user_id );
677
+ $set_customer = true;
678
+ $force_save_source = apply_filters( 'wc_stripe_force_save_source', $force_save_source, $customer );
679
+ $source_object = '';
680
+ $source_id = '';
681
+ $wc_token_id = false;
682
+ $payment_method = isset( $_POST['payment_method'] ) ? wc_clean( $_POST['payment_method'] ) : 'stripe';
683
+ $is_token = false;
684
 
685
  // New CC info was entered and we have a new source to process.
686
  if ( ! empty( $_POST['stripe_source'] ) ) {
773
  $source_object = false;
774
 
775
  if ( $order ) {
776
+ $order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();
777
 
778
  $stripe_customer_id = get_post_meta( $order_id, '_stripe_customer_id', true );
779
 
781
  $stripe_customer->set_id( $stripe_customer_id );
782
  }
783
 
784
+ $source_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? get_post_meta( $order_id, '_stripe_source_id', true ) : $order->get_meta( '_stripe_source_id', true );
785
 
786
  // Since 4.0.0, we changed card to source so we need to account for that.
787
  if ( empty( $source_id ) ) {
788
+ $source_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? get_post_meta( $order_id, '_stripe_card_id', true ) : $order->get_meta( '_stripe_card_id', true );
789
 
790
  // Take this opportunity to update the key name.
791
+ WC_Stripe_Helper::is_wc_lt( '3.0' ) ? update_post_meta( $order_id, '_stripe_source_id', $source_id ) : $order->update_meta_data( '_stripe_source_id', $source_id );
792
 
793
  if ( is_callable( array( $order, 'save' ) ) ) {
794
  $order->save();
824
  * @param stdClass $source Source information.
825
  */
826
  public function save_source_to_order( $order, $source ) {
827
+ $order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();
828
 
829
  // Store source in the order.
830
  if ( $source->customer ) {
831
+ if ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ) {
832
  update_post_meta( $order_id, '_stripe_customer_id', $source->customer );
833
  } else {
834
  $order->update_meta_data( '_stripe_customer_id', $source->customer );
836
  }
837
 
838
  if ( $source->source ) {
839
+ if ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ) {
840
  update_post_meta( $order_id, '_stripe_source_id', $source->source );
841
  } else {
842
  $order->update_meta_data( '_stripe_source_id', $source->source );
858
  * @param int $balance_transaction_id
859
  */
860
  public function update_fees( $order, $balance_transaction_id ) {
861
+ $order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();
862
 
863
  $balance_transaction = WC_Stripe_API::retrieve( 'balance/history/' . $balance_transaction_id );
864
 
880
  WC_Stripe_Helper::update_stripe_fee( $order, $fee );
881
  WC_Stripe_Helper::update_stripe_net( $order, $net );
882
 
883
+ $currency = ! empty( $balance_transaction->currency ) ? strtoupper( $balance_transaction->currency ) : null;
884
+ WC_Stripe_Helper::update_stripe_currency( $order, $currency );
885
+
886
  if ( is_callable( array( $order, 'save' ) ) ) {
887
  $order->save();
888
  }
892
  }
893
  }
894
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
895
  /**
896
  * Refund a charge.
897
  *
910
 
911
  $request = array();
912
 
913
+ if ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ) {
914
  $order_currency = get_post_meta( $order_id, '_order_currency', true );
915
  $captured = get_post_meta( $order_id, '_stripe_charge_captured', true );
916
  } else {
947
  return $response;
948
 
949
  } elseif ( ! empty( $response->id ) ) {
950
+ WC_Stripe_Helper::is_wc_lt( '3.0' ) ? update_post_meta( $order_id, '_stripe_refund_id', $response->id ) : $order->update_meta_data( '_stripe_refund_id', $response->id );
951
 
952
  $amount = wc_price( $response->amount / 100 );
953
 
954
+ if ( in_array( strtolower( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->get_order_currency() : $order->get_currency() ), WC_Stripe_Helper::no_decimal_currencies() ) ) {
955
  $amount = wc_price( $response->amount );
956
  }
957
 
963
  $refund_message = ( isset( $captured ) && 'yes' === $captured ) ? sprintf( __( 'Refunded %1$s - Refund ID: %2$s - Reason: %3$s', 'woocommerce-gateway-stripe' ), $amount, $response->id, $reason ) : __( 'Pre-Authorization Released', 'woocommerce-gateway-stripe' );
964
 
965
  $order->add_order_note( $refund_message );
966
+ WC_Stripe_Logger::log( 'Success: ' . html_entity_decode( wp_strip_all_tags( $refund_message ) ) );
967
 
968
  return true;
969
  }
978
  */
979
  public function add_payment_method() {
980
  $error = false;
981
+ $error_msg = __( 'There was a problem adding the payment method.', 'woocommerce-gateway-stripe' );
982
  $source_id = '';
983
 
984
  if ( empty( $_POST['stripe_source'] ) && empty( $_POST['stripe_token'] ) || ! is_user_logged_in() ) {
1013
  return;
1014
  }
1015
 
1016
+ do_action( 'wc_stripe_add_payment_method_' . $_POST['payment_method'] . '_success', $source_id, $source_object );
1017
+
1018
  return array(
1019
  'result' => 'success',
1020
  'redirect' => wc_get_endpoint_url( 'payment-methods' ),
includes/admin/class-wc-stripe-admin-notices.php CHANGED
@@ -60,9 +60,9 @@ class WC_Stripe_Admin_Notices {
60
  echo '<div class="' . esc_attr( $notice['class'] ) . '" style="position:relative;">';
61
 
62
  if ( $notice['dismissible'] ) {
63
- ?>
64
  <a href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wc-stripe-hide-notice', $notice_key ), 'wc_stripe_hide_notices_nonce', '_wc_stripe_notice_nonce' ) ); ?>" class="woocommerce-message-close notice-dismiss" style="position:absolute;right:1px;padding:9px;text-decoration:none;"></a>
65
- <?php
66
  }
67
 
68
  echo '<p>';
@@ -99,6 +99,7 @@ class WC_Stripe_Admin_Notices {
99
  * @version 4.0.0
100
  */
101
  public function stripe_check_environment() {
 
102
  $show_ssl_notice = get_option( 'wc_stripe_show_ssl_notice' );
103
  $show_keys_notice = get_option( 'wc_stripe_show_keys_notice' );
104
  $show_phpver_notice = get_option( 'wc_stripe_show_phpver_notice' );
@@ -123,6 +124,17 @@ class WC_Stripe_Admin_Notices {
123
  }
124
  }
125
 
 
 
 
 
 
 
 
 
 
 
 
126
  if ( empty( $show_wcver_notice ) ) {
127
  if ( version_compare( WC_VERSION, WC_STRIPE_MIN_WC_VER, '<' ) ) {
128
  /* translators: 1) int version 2) int version */
@@ -154,8 +166,7 @@ class WC_Stripe_Admin_Notices {
154
  if (
155
  ! empty( $test_pub_key ) && ! preg_match( '/^pk_test_/', $test_pub_key )
156
  || ( ! empty( $test_secret_key ) && ! preg_match( '/^sk_test_/', $test_secret_key )
157
- && ! empty( $test_secret_key ) && ! preg_match( '/^rk_test_/', $test_secret_key ) ) )
158
- {
159
  $setting_link = $this->get_setting_link();
160
  /* translators: 1) link */
161
  $this->add_admin_notice( 'keys', 'notice notice-error', sprintf( __( 'Stripe is in test mode however your test keys may not be valid. Test keys start with pk_test and sk_test or rk_test. Please go to your settings and, <a href="%s">set your Stripe account keys</a>.', 'woocommerce-gateway-stripe' ), $setting_link ), true );
@@ -164,8 +175,7 @@ class WC_Stripe_Admin_Notices {
164
  if (
165
  ! empty( $live_pub_key ) && ! preg_match( '/^pk_live_/', $live_pub_key )
166
  || ( ! empty( $live_secret_key ) && ! preg_match( '/^sk_live_/', $live_secret_key )
167
- && ! empty( $live_secret_key ) && ! preg_match( '/^rk_live_/', $live_secret_key ) ) )
168
- {
169
  $setting_link = $this->get_setting_link();
170
  /* translators: 1) link */
171
  $this->add_admin_notice( 'keys', 'notice notice-error', sprintf( __( 'Stripe is in live mode however your test keys may not be valid. Live keys start with pk_live and sk_live or rk_live. Please go to your settings and, <a href="%s">set your Stripe account keys</a>.', 'woocommerce-gateway-stripe' ), $setting_link ), true );
@@ -200,7 +210,8 @@ class WC_Stripe_Admin_Notices {
200
  }
201
 
202
  if ( ! in_array( get_woocommerce_currency(), $gateway->get_supported_currency() ) ) {
203
- $this->add_admin_notice( $method, 'notice notice-error', sprintf( __( '%s is enabled - it requires store currency to be set to %s', 'woocommerce-gateway-stripe' ), $method, implode( ', ', $gateway->get_supported_currency() ) ), true );
 
204
  }
205
  }
206
  }
@@ -224,7 +235,10 @@ class WC_Stripe_Admin_Notices {
224
  $notice = wc_clean( $_GET['wc-stripe-hide-notice'] );
225
 
226
  switch ( $notice ) {
227
- case 'phpver':
 
 
 
228
  update_option( 'wc_stripe_show_phpver_notice', 'no' );
229
  break;
230
  case 'wcver':
60
  echo '<div class="' . esc_attr( $notice['class'] ) . '" style="position:relative;">';
61
 
62
  if ( $notice['dismissible'] ) {
63
+ ?>
64
  <a href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wc-stripe-hide-notice', $notice_key ), 'wc_stripe_hide_notices_nonce', '_wc_stripe_notice_nonce' ) ); ?>" class="woocommerce-message-close notice-dismiss" style="position:absolute;right:1px;padding:9px;text-decoration:none;"></a>
65
+ <?php
66
  }
67
 
68
  echo '<p>';
99
  * @version 4.0.0
100
  */
101
  public function stripe_check_environment() {
102
+ $show_styles_notice = get_option( 'wc_stripe_show_styles_notice' );
103
  $show_ssl_notice = get_option( 'wc_stripe_show_ssl_notice' );
104
  $show_keys_notice = get_option( 'wc_stripe_show_keys_notice' );
105
  $show_phpver_notice = get_option( 'wc_stripe_show_phpver_notice' );
124
  }
125
  }
126
 
127
+ // To be removed 4.1.12.
128
+ if ( empty( $show_styles_notice ) ) {
129
+ if ( version_compare( WC_STRIPE_VERSION, '4.1.12', '<' ) ) {
130
+ $message = __( 'Action required: In January 2019 we will be introducing changes that could effect how Stripe looks in your checkout. <a href="https://docs.woocommerce.com/document/stripe/#section-45" target="_blank">Learn more</a> about how to make sure your site continues to look great.', 'woocommerce-gateway-stripe' );
131
+
132
+ $this->add_admin_notice( 'styles', 'notice notice-warning', $message, true );
133
+
134
+ return;
135
+ }
136
+ }
137
+
138
  if ( empty( $show_wcver_notice ) ) {
139
  if ( version_compare( WC_VERSION, WC_STRIPE_MIN_WC_VER, '<' ) ) {
140
  /* translators: 1) int version 2) int version */
166
  if (
167
  ! empty( $test_pub_key ) && ! preg_match( '/^pk_test_/', $test_pub_key )
168
  || ( ! empty( $test_secret_key ) && ! preg_match( '/^sk_test_/', $test_secret_key )
169
+ && ! empty( $test_secret_key ) && ! preg_match( '/^rk_test_/', $test_secret_key ) ) ) {
 
170
  $setting_link = $this->get_setting_link();
171
  /* translators: 1) link */
172
  $this->add_admin_notice( 'keys', 'notice notice-error', sprintf( __( 'Stripe is in test mode however your test keys may not be valid. Test keys start with pk_test and sk_test or rk_test. Please go to your settings and, <a href="%s">set your Stripe account keys</a>.', 'woocommerce-gateway-stripe' ), $setting_link ), true );
175
  if (
176
  ! empty( $live_pub_key ) && ! preg_match( '/^pk_live_/', $live_pub_key )
177
  || ( ! empty( $live_secret_key ) && ! preg_match( '/^sk_live_/', $live_secret_key )
178
+ && ! empty( $live_secret_key ) && ! preg_match( '/^rk_live_/', $live_secret_key ) ) ) {
 
179
  $setting_link = $this->get_setting_link();
180
  /* translators: 1) link */
181
  $this->add_admin_notice( 'keys', 'notice notice-error', sprintf( __( 'Stripe is in live mode however your test keys may not be valid. Live keys start with pk_live and sk_live or rk_live. Please go to your settings and, <a href="%s">set your Stripe account keys</a>.', 'woocommerce-gateway-stripe' ), $setting_link ), true );
210
  }
211
 
212
  if ( ! in_array( get_woocommerce_currency(), $gateway->get_supported_currency() ) ) {
213
+ /* translators: %1$s Payment method, %2$s List of supported currencies */
214
+ $this->add_admin_notice( $method, 'notice notice-error', sprintf( __( '%1$s is enabled - it requires store currency to be set to %2$s', 'woocommerce-gateway-stripe' ), $method, implode( ', ', $gateway->get_supported_currency() ) ), true );
215
  }
216
  }
217
  }
235
  $notice = wc_clean( $_GET['wc-stripe-hide-notice'] );
236
 
237
  switch ( $notice ) {
238
+ case 'styles':
239
+ update_option( 'wc_stripe_show_styles_notice', 'no' );
240
+ break;
241
+ case 'styles':
242
  update_option( 'wc_stripe_show_phpver_notice', 'no' );
243
  break;
244
  case 'wcver':
includes/admin/class-wc-stripe-privacy.php CHANGED
@@ -60,7 +60,7 @@ class WC_Stripe_Privacy extends WC_Abstract_Privacy {
60
  protected function get_stripe_orders( $email_address, $page ) {
61
  $user = get_user_by( 'email', $email_address ); // Check if user has an ID in the DB to load stored personal data.
62
 
63
- $order_query = array(
64
  'payment_method' => array( 'stripe', 'stripe_alipay', 'stripe_bancontact', 'stripe_eps', 'stripe_giropay', 'stripe_ideal', 'stripe_multibanco', 'stripe_p24', 'stripe_sepa', 'stripe_sofort' ),
65
  'limit' => 10,
66
  'page' => $page,
@@ -80,6 +80,7 @@ class WC_Stripe_Privacy extends WC_Abstract_Privacy {
80
  *
81
  */
82
  public function get_privacy_message() {
 
83
  return wpautop( sprintf( __( 'By using this extension, you may be storing personal data or sharing data with an external service. <a href="%s" target="_blank">Learn more about how this works, including what you may want to include in your privacy policy.</a>', 'woocommerce-gateway-stripe' ), 'https://docs.woocommerce.com/document/privacy-payments/#woocommerce-gateway-stripe' ) );
84
  }
85
 
@@ -141,7 +142,7 @@ class WC_Stripe_Privacy extends WC_Abstract_Privacy {
141
  $data_to_export = array();
142
 
143
  $meta_query = array(
144
- 'relation' => 'AND',
145
  array(
146
  'key' => '_payment_method',
147
  'value' => array( 'stripe', 'stripe_alipay', 'stripe_bancontact', 'stripe_eps', 'stripe_giropay', 'stripe_ideal', 'stripe_multibanco', 'stripe_p24', 'stripe_sepa', 'stripe_sofort' ),
@@ -154,10 +155,10 @@ class WC_Stripe_Privacy extends WC_Abstract_Privacy {
154
  ),
155
  );
156
 
157
- $subscription_query = array(
158
- 'posts_per_page' => 10,
159
- 'page' => $page,
160
- 'meta_query' => $meta_query,
161
  );
162
 
163
  $subscriptions = wcs_get_subscriptions( $subscription_query );
@@ -247,8 +248,8 @@ class WC_Stripe_Privacy extends WC_Abstract_Privacy {
247
  $stripe_source_id = get_user_meta( $user->ID, '_stripe_source_id', true );
248
  }
249
 
250
- $items_removed = false;
251
- $messages = array();
252
 
253
  if ( ! empty( $stripe_customer_id ) || ! empty( $stripe_source_id ) ) {
254
  $items_removed = true;
@@ -283,14 +284,14 @@ class WC_Stripe_Privacy extends WC_Abstract_Privacy {
283
  $order = wc_get_order( $order->get_id() );
284
 
285
  list( $removed, $retained, $msgs ) = $this->maybe_handle_order( $order );
286
- $items_removed |= $removed;
287
- $items_retained |= $retained;
288
- $messages = array_merge( $messages, $msgs );
289
 
290
  list( $removed, $retained, $msgs ) = $this->maybe_handle_subscription( $order );
291
- $items_removed |= $removed;
292
- $items_retained |= $retained;
293
- $messages = array_merge( $messages, $msgs );
294
  }
295
 
296
  // Tell core if we have more orders to work on still
@@ -329,10 +330,12 @@ class WC_Stripe_Privacy extends WC_Abstract_Privacy {
329
  }
330
 
331
  if ( ! $this->is_retention_expired( $order->get_date_created()->getTimestamp() ) ) {
 
332
  return array( false, true, array( sprintf( __( 'Order ID %d is less than set retention days. Personal data retained. (Stripe)', 'woocommerce-gateway-stripe' ), $order->get_id() ) ) );
333
  }
334
 
335
  if ( $subscription->has_status( apply_filters( 'wc_stripe_privacy_eraser_subs_statuses', array( 'on-hold', 'active' ) ) ) ) {
 
336
  return array( false, true, array( sprintf( __( 'Order ID %d contains an active Subscription. Personal data retained. (Stripe)', 'woocommerce-gateway-stripe' ), $order->get_id() ) ) );
337
  }
338
 
@@ -364,6 +367,7 @@ class WC_Stripe_Privacy extends WC_Abstract_Privacy {
364
  $stripe_customer_id = get_post_meta( $order_id, '_stripe_customer_id', true );
365
 
366
  if ( ! $this->is_retention_expired( $order->get_date_created()->getTimestamp() ) ) {
 
367
  return array( false, true, array( sprintf( __( 'Order ID %d is less than set retention days. Personal data retained. (Stripe)', 'woocommerce-gateway-stripe' ), $order->get_id() ) ) );
368
  }
369
 
60
  protected function get_stripe_orders( $email_address, $page ) {
61
  $user = get_user_by( 'email', $email_address ); // Check if user has an ID in the DB to load stored personal data.
62
 
63
+ $order_query = array(
64
  'payment_method' => array( 'stripe', 'stripe_alipay', 'stripe_bancontact', 'stripe_eps', 'stripe_giropay', 'stripe_ideal', 'stripe_multibanco', 'stripe_p24', 'stripe_sepa', 'stripe_sofort' ),
65
  'limit' => 10,
66
  'page' => $page,
80
  *
81
  */
82
  public function get_privacy_message() {
83
+ /* translators: %s URL to docs */
84
  return wpautop( sprintf( __( 'By using this extension, you may be storing personal data or sharing data with an external service. <a href="%s" target="_blank">Learn more about how this works, including what you may want to include in your privacy policy.</a>', 'woocommerce-gateway-stripe' ), 'https://docs.woocommerce.com/document/privacy-payments/#woocommerce-gateway-stripe' ) );
85
  }
86
 
142
  $data_to_export = array();
143
 
144
  $meta_query = array(
145
+ 'relation' => 'AND',
146
  array(
147
  'key' => '_payment_method',
148
  'value' => array( 'stripe', 'stripe_alipay', 'stripe_bancontact', 'stripe_eps', 'stripe_giropay', 'stripe_ideal', 'stripe_multibanco', 'stripe_p24', 'stripe_sepa', 'stripe_sofort' ),
155
  ),
156
  );
157
 
158
+ $subscription_query = array(
159
+ 'posts_per_page' => 10,
160
+ 'page' => $page,
161
+ 'meta_query' => $meta_query,
162
  );
163
 
164
  $subscriptions = wcs_get_subscriptions( $subscription_query );
248
  $stripe_source_id = get_user_meta( $user->ID, '_stripe_source_id', true );
249
  }
250
 
251
+ $items_removed = false;
252
+ $messages = array();
253
 
254
  if ( ! empty( $stripe_customer_id ) || ! empty( $stripe_source_id ) ) {
255
  $items_removed = true;
284
  $order = wc_get_order( $order->get_id() );
285
 
286
  list( $removed, $retained, $msgs ) = $this->maybe_handle_order( $order );
287
+ $items_removed |= $removed;
288
+ $items_retained |= $retained;
289
+ $messages = array_merge( $messages, $msgs );
290
 
291
  list( $removed, $retained, $msgs ) = $this->maybe_handle_subscription( $order );
292
+ $items_removed |= $removed;
293
+ $items_retained |= $retained;
294
+ $messages = array_merge( $messages, $msgs );
295
  }
296
 
297
  // Tell core if we have more orders to work on still
330
  }
331
 
332
  if ( ! $this->is_retention_expired( $order->get_date_created()->getTimestamp() ) ) {
333
+ /* translators: %d Order ID */
334
  return array( false, true, array( sprintf( __( 'Order ID %d is less than set retention days. Personal data retained. (Stripe)', 'woocommerce-gateway-stripe' ), $order->get_id() ) ) );
335
  }
336
 
337
  if ( $subscription->has_status( apply_filters( 'wc_stripe_privacy_eraser_subs_statuses', array( 'on-hold', 'active' ) ) ) ) {
338
+ /* translators: %d Order ID */
339
  return array( false, true, array( sprintf( __( 'Order ID %d contains an active Subscription. Personal data retained. (Stripe)', 'woocommerce-gateway-stripe' ), $order->get_id() ) ) );
340
  }
341
 
367
  $stripe_customer_id = get_post_meta( $order_id, '_stripe_customer_id', true );
368
 
369
  if ( ! $this->is_retention_expired( $order->get_date_created()->getTimestamp() ) ) {
370
+ /* translators: %d Order ID */
371
  return array( false, true, array( sprintf( __( 'Order ID %d is less than set retention days. Personal data retained. (Stripe)', 'woocommerce-gateway-stripe' ), $order->get_id() ) ) );
372
  }
373
 
includes/admin/stripe-alipay-settings.php CHANGED
@@ -3,28 +3,29 @@ if ( ! defined( 'ABSPATH' ) ) {
3
  exit;
4
  }
5
 
6
- return apply_filters( 'wc_stripe_alipay_settings',
 
7
  array(
8
- 'geo_target' => array(
9
  'description' => __( 'Relevant Payer Geography: China', 'woocommerce-gateway-stripe' ),
10
  'type' => 'title',
11
  ),
12
- 'guide' => array(
13
  'description' => __( '<a href="https://stripe.com/payments/payment-methods-guide#alipay" target="_blank">Payment Method Guide</a>', 'woocommerce-gateway-stripe' ),
14
  'type' => 'title',
15
  ),
16
- 'activation' => array(
17
  'description' => __( 'Must be activated from your Stripe Dashboard Settings <a href="https://dashboard.stripe.com/account/payments/settings" target="_blank">here</a>', 'woocommerce-gateway-stripe' ),
18
- 'type' => 'title',
19
  ),
20
- 'enabled' => array(
21
  'title' => __( 'Enable/Disable', 'woocommerce-gateway-stripe' ),
22
  'label' => __( 'Enable Stripe Alipay', 'woocommerce-gateway-stripe' ),
23
  'type' => 'checkbox',
24
  'description' => '',
25
  'default' => 'no',
26
  ),
27
- 'title' => array(
28
  'title' => __( 'Title', 'woocommerce-gateway-stripe' ),
29
  'type' => 'text',
30
  'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe' ),
@@ -38,7 +39,7 @@ return apply_filters( 'wc_stripe_alipay_settings',
38
  'default' => __( 'You will be redirected to Alipay.', 'woocommerce-gateway-stripe' ),
39
  'desc_tip' => true,
40
  ),
41
- 'webhook' => array(
42
  'title' => __( 'Webhook Endpoints', 'woocommerce-gateway-stripe' ),
43
  'type' => 'title',
44
  /* translators: webhook URL */
3
  exit;
4
  }
5
 
6
+ return apply_filters(
7
+ 'wc_stripe_alipay_settings',
8
  array(
9
+ 'geo_target' => array(
10
  'description' => __( 'Relevant Payer Geography: China', 'woocommerce-gateway-stripe' ),
11
  'type' => 'title',
12
  ),
13
+ 'guide' => array(
14
  'description' => __( '<a href="https://stripe.com/payments/payment-methods-guide#alipay" target="_blank">Payment Method Guide</a>', 'woocommerce-gateway-stripe' ),
15
  'type' => 'title',
16
  ),
17
+ 'activation' => array(
18
  'description' => __( 'Must be activated from your Stripe Dashboard Settings <a href="https://dashboard.stripe.com/account/payments/settings" target="_blank">here</a>', 'woocommerce-gateway-stripe' ),
19
+ 'type' => 'title',
20
  ),
21
+ 'enabled' => array(
22
  'title' => __( 'Enable/Disable', 'woocommerce-gateway-stripe' ),
23
  'label' => __( 'Enable Stripe Alipay', 'woocommerce-gateway-stripe' ),
24
  'type' => 'checkbox',
25
  'description' => '',
26
  'default' => 'no',
27
  ),
28
+ 'title' => array(
29
  'title' => __( 'Title', 'woocommerce-gateway-stripe' ),
30
  'type' => 'text',
31
  'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe' ),
39
  'default' => __( 'You will be redirected to Alipay.', 'woocommerce-gateway-stripe' ),
40
  'desc_tip' => true,
41
  ),
42
+ 'webhook' => array(
43
  'title' => __( 'Webhook Endpoints', 'woocommerce-gateway-stripe' ),
44
  'type' => 'title',
45
  /* translators: webhook URL */
includes/admin/stripe-bancontact-settings.php CHANGED
@@ -3,28 +3,29 @@ if ( ! defined( 'ABSPATH' ) ) {
3
  exit;
4
  }
5
 
6
- return apply_filters( 'wc_stripe_bancontact_settings',
 
7
  array(
8
- 'geo_target' => array(
9
  'description' => __( 'Relevant Payer Geography: Belgium', 'woocommerce-gateway-stripe' ),
10
  'type' => 'title',
11
  ),
12
- 'guide' => array(
13
  'description' => __( '<a href="https://stripe.com/payments/payment-methods-guide#bancontact" target="_blank">Payment Method Guide</a>', 'woocommerce-gateway-stripe' ),
14
  'type' => 'title',
15
  ),
16
- 'activation' => array(
17
  'description' => __( 'Must be activated from your Stripe Dashboard Settings <a href="https://dashboard.stripe.com/account/payments/settings" target="_blank">here</a>', 'woocommerce-gateway-stripe' ),
18
- 'type' => 'title',
19
  ),
20
- 'enabled' => array(
21
  'title' => __( 'Enable/Disable', 'woocommerce-gateway-stripe' ),
22
  'label' => __( 'Enable Stripe Bancontact', 'woocommerce-gateway-stripe' ),
23
  'type' => 'checkbox',
24
  'description' => '',
25
  'default' => 'no',
26
  ),
27
- 'title' => array(
28
  'title' => __( 'Title', 'woocommerce-gateway-stripe' ),
29
  'type' => 'text',
30
  'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe' ),
@@ -38,7 +39,7 @@ return apply_filters( 'wc_stripe_bancontact_settings',
38
  'default' => __( 'You will be redirected to Bancontact.', 'woocommerce-gateway-stripe' ),
39
  'desc_tip' => true,
40
  ),
41
- 'webhook' => array(
42
  'title' => __( 'Webhook Endpoints', 'woocommerce-gateway-stripe' ),
43
  'type' => 'title',
44
  /* translators: webhook URL */
3
  exit;
4
  }
5
 
6
+ return apply_filters(
7
+ 'wc_stripe_bancontact_settings',
8
  array(
9
+ 'geo_target' => array(
10
  'description' => __( 'Relevant Payer Geography: Belgium', 'woocommerce-gateway-stripe' ),
11
  'type' => 'title',
12
  ),
13
+ 'guide' => array(
14
  'description' => __( '<a href="https://stripe.com/payments/payment-methods-guide#bancontact" target="_blank">Payment Method Guide</a>', 'woocommerce-gateway-stripe' ),
15
  'type' => 'title',
16
  ),
17
+ 'activation' => array(
18
  'description' => __( 'Must be activated from your Stripe Dashboard Settings <a href="https://dashboard.stripe.com/account/payments/settings" target="_blank">here</a>', 'woocommerce-gateway-stripe' ),
19
+ 'type' => 'title',
20
  ),
21
+ 'enabled' => array(
22
  'title' => __( 'Enable/Disable', 'woocommerce-gateway-stripe' ),
23
  'label' => __( 'Enable Stripe Bancontact', 'woocommerce-gateway-stripe' ),
24
  'type' => 'checkbox',
25
  'description' => '',
26
  'default' => 'no',
27
  ),
28
+ 'title' => array(
29
  'title' => __( 'Title', 'woocommerce-gateway-stripe' ),
30
  'type' => 'text',
31
  'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe' ),
39
  'default' => __( 'You will be redirected to Bancontact.', 'woocommerce-gateway-stripe' ),
40
  'desc_tip' => true,
41
  ),
42
+ 'webhook' => array(
43
  'title' => __( 'Webhook Endpoints', 'woocommerce-gateway-stripe' ),
44
  'type' => 'title',
45
  /* translators: webhook URL */
includes/admin/stripe-eps-settings.php CHANGED
@@ -3,24 +3,25 @@ if ( ! defined( 'ABSPATH' ) ) {
3
  exit;
4
  }
5
 
6
- return apply_filters( 'wc_stripe_eps_settings',
 
7
  array(
8
- 'geo_target' => array(
9
  'description' => __( 'Relevant Payer Geography: Austria', 'woocommerce-gateway-stripe' ),
10
  'type' => 'title',
11
  ),
12
- 'activation' => array(
13
  'description' => __( 'Must be activated from your Stripe Dashboard Settings <a href="https://dashboard.stripe.com/account/payments/settings" target="_blank">here</a>', 'woocommerce-gateway-stripe' ),
14
  'type' => 'title',
15
  ),
16
- 'enabled' => array(
17
  'title' => __( 'Enable/Disable', 'woocommerce-gateway-stripe' ),
18
  'label' => __( 'Enable Stripe EPS', 'woocommerce-gateway-stripe' ),
19
  'type' => 'checkbox',
20
  'description' => '',
21
  'default' => 'no',
22
  ),
23
- 'title' => array(
24
  'title' => __( 'Title', 'woocommerce-gateway-stripe' ),
25
  'type' => 'text',
26
  'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe' ),
@@ -34,7 +35,7 @@ return apply_filters( 'wc_stripe_eps_settings',
34
  'default' => __( 'You will be redirected to EPS.', 'woocommerce-gateway-stripe' ),
35
  'desc_tip' => true,
36
  ),
37
- 'webhook' => array(
38
  'title' => __( 'Webhook Enpoints', 'woocommerce-gateway-stripe' ),
39
  'type' => 'title',
40
  /* translators: webhook URL */
3
  exit;
4
  }
5
 
6
+ return apply_filters(
7
+ 'wc_stripe_eps_settings',
8
  array(
9
+ 'geo_target' => array(
10
  'description' => __( 'Relevant Payer Geography: Austria', 'woocommerce-gateway-stripe' ),
11
  'type' => 'title',
12
  ),
13
+ 'activation' => array(
14
  'description' => __( 'Must be activated from your Stripe Dashboard Settings <a href="https://dashboard.stripe.com/account/payments/settings" target="_blank">here</a>', 'woocommerce-gateway-stripe' ),
15
  'type' => 'title',
16
  ),
17
+ 'enabled' => array(
18
  'title' => __( 'Enable/Disable', 'woocommerce-gateway-stripe' ),
19
  'label' => __( 'Enable Stripe EPS', 'woocommerce-gateway-stripe' ),
20
  'type' => 'checkbox',
21
  'description' => '',
22
  'default' => 'no',
23
  ),
24
+ 'title' => array(
25
  'title' => __( 'Title', 'woocommerce-gateway-stripe' ),
26
  'type' => 'text',
27
  'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe' ),
35
  'default' => __( 'You will be redirected to EPS.', 'woocommerce-gateway-stripe' ),
36
  'desc_tip' => true,
37
  ),
38
+ 'webhook' => array(
39
  'title' => __( 'Webhook Enpoints', 'woocommerce-gateway-stripe' ),
40
  'type' => 'title',
41
  /* translators: webhook URL */
includes/admin/stripe-giropay-settings.php CHANGED
@@ -3,28 +3,29 @@ if ( ! defined( 'ABSPATH' ) ) {
3
  exit;
4
  }
5
 
6
- return apply_filters( 'wc_stripe_giropay_settings',
 
7
  array(
8
- 'geo_target' => array(
9
  'description' => __( 'Relevant Payer Geography: Germany', 'woocommerce-gateway-stripe' ),
10
  'type' => 'title',
11
  ),
12
- 'guide' => array(
13
  'description' => __( '<a href="https://stripe.com/payments/payment-methods-guide#giropay" target="_blank">Payment Method Guide</a>', 'woocommerce-gateway-stripe' ),
14
  'type' => 'title',
15
  ),
16
- 'activation' => array(
17
  'description' => __( 'Must be activated from your Stripe Dashboard Settings <a href="https://dashboard.stripe.com/account/payments/settings" target="_blank">here</a>', 'woocommerce-gateway-stripe' ),
18
- 'type' => 'title',
19
  ),
20
- 'enabled' => array(
21
  'title' => __( 'Enable/Disable', 'woocommerce-gateway-stripe' ),
22
  'label' => __( 'Enable Stripe Giropay', 'woocommerce-gateway-stripe' ),
23
  'type' => 'checkbox',
24
  'description' => '',
25
  'default' => 'no',
26
  ),
27
- 'title' => array(
28
  'title' => __( 'Title', 'woocommerce-gateway-stripe' ),
29
  'type' => 'text',
30
  'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe' ),
@@ -38,7 +39,7 @@ return apply_filters( 'wc_stripe_giropay_settings',
38
  'default' => __( 'You will be redirected to Giropay.', 'woocommerce-gateway-stripe' ),
39
  'desc_tip' => true,
40
  ),
41
- 'webhook' => array(
42
  'title' => __( 'Webhook Endpoints', 'woocommerce-gateway-stripe' ),
43
  'type' => 'title',
44
  /* translators: webhook URL */
3
  exit;
4
  }
5
 
6
+ return apply_filters(
7
+ 'wc_stripe_giropay_settings',
8
  array(
9
+ 'geo_target' => array(
10
  'description' => __( 'Relevant Payer Geography: Germany', 'woocommerce-gateway-stripe' ),
11
  'type' => 'title',
12
  ),
13
+ 'guide' => array(
14
  'description' => __( '<a href="https://stripe.com/payments/payment-methods-guide#giropay" target="_blank">Payment Method Guide</a>', 'woocommerce-gateway-stripe' ),
15
  'type' => 'title',
16
  ),
17
+ 'activation' => array(
18
  'description' => __( 'Must be activated from your Stripe Dashboard Settings <a href="https://dashboard.stripe.com/account/payments/settings" target="_blank">here</a>', 'woocommerce-gateway-stripe' ),
19
+ 'type' => 'title',
20
  ),
21
+ 'enabled' => array(
22
  'title' => __( 'Enable/Disable', 'woocommerce-gateway-stripe' ),
23
  'label' => __( 'Enable Stripe Giropay', 'woocommerce-gateway-stripe' ),
24
  'type' => 'checkbox',
25
  'description' => '',
26
  'default' => 'no',
27
  ),
28
+ 'title' => array(
29
  'title' => __( 'Title', 'woocommerce-gateway-stripe' ),
30
  'type' => 'text',
31
  'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe' ),
39
  'default' => __( 'You will be redirected to Giropay.', 'woocommerce-gateway-stripe' ),
40
  'desc_tip' => true,
41
  ),
42
+ 'webhook' => array(
43
  'title' => __( 'Webhook Endpoints', 'woocommerce-gateway-stripe' ),
44
  'type' => 'title',
45
  /* translators: webhook URL */
includes/admin/stripe-ideal-settings.php CHANGED
@@ -3,28 +3,29 @@ if ( ! defined( 'ABSPATH' ) ) {
3
  exit;
4
  }
5
 
6
- return apply_filters( 'wc_stripe_ideal_settings',
 
7
  array(
8
- 'geo_target' => array(
9
  'description' => __( 'Relevant Payer Geography: The Netherlands', 'woocommerce-gateway-stripe' ),
10
  'type' => 'title',
11
  ),
12
- 'guide' => array(
13
  'description' => __( '<a href="https://stripe.com/payments/payment-methods-guide#ideal" target="_blank">Payment Method Guide</a>', 'woocommerce-gateway-stripe' ),
14
  'type' => 'title',
15
  ),
16
- 'activation' => array(
17
  'description' => __( 'Must be activated from your Stripe Dashboard Settings <a href="https://dashboard.stripe.com/account/payments/settings" target="_blank">here</a>', 'woocommerce-gateway-stripe' ),
18
- 'type' => 'title',
19
  ),
20
- 'enabled' => array(
21
  'title' => __( 'Enable/Disable', 'woocommerce-gateway-stripe' ),
22
  'label' => __( 'Enable Stripe iDeal', 'woocommerce-gateway-stripe' ),
23
  'type' => 'checkbox',
24
  'description' => '',
25
  'default' => 'no',
26
  ),
27
- 'title' => array(
28
  'title' => __( 'Title', 'woocommerce-gateway-stripe' ),
29
  'type' => 'text',
30
  'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe' ),
@@ -38,7 +39,7 @@ return apply_filters( 'wc_stripe_ideal_settings',
38
  'default' => __( 'You will be redirected to iDeal.', 'woocommerce-gateway-stripe' ),
39
  'desc_tip' => true,
40
  ),
41
- 'webhook' => array(
42
  'title' => __( 'Webhook Endpoints', 'woocommerce-gateway-stripe' ),
43
  'type' => 'title',
44
  /* translators: webhook URL */
3
  exit;
4
  }
5
 
6
+ return apply_filters(
7
+ 'wc_stripe_ideal_settings',
8
  array(
9
+ 'geo_target' => array(
10
  'description' => __( 'Relevant Payer Geography: The Netherlands', 'woocommerce-gateway-stripe' ),
11
  'type' => 'title',
12
  ),
13
+ 'guide' => array(
14
  'description' => __( '<a href="https://stripe.com/payments/payment-methods-guide#ideal" target="_blank">Payment Method Guide</a>', 'woocommerce-gateway-stripe' ),
15
  'type' => 'title',
16
  ),
17
+ 'activation' => array(
18
  'description' => __( 'Must be activated from your Stripe Dashboard Settings <a href="https://dashboard.stripe.com/account/payments/settings" target="_blank">here</a>', 'woocommerce-gateway-stripe' ),
19
+ 'type' => 'title',
20
  ),
21
+ 'enabled' => array(
22
  'title' => __( 'Enable/Disable', 'woocommerce-gateway-stripe' ),
23
  'label' => __( 'Enable Stripe iDeal', 'woocommerce-gateway-stripe' ),
24
  'type' => 'checkbox',
25
  'description' => '',
26
  'default' => 'no',
27
  ),
28
+ 'title' => array(
29
  'title' => __( 'Title', 'woocommerce-gateway-stripe' ),
30
  'type' => 'text',
31
  'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe' ),
39
  'default' => __( 'You will be redirected to iDeal.', 'woocommerce-gateway-stripe' ),
40
  'desc_tip' => true,
41
  ),
42
+ 'webhook' => array(
43
  'title' => __( 'Webhook Endpoints', 'woocommerce-gateway-stripe' ),
44
  'type' => 'title',
45
  /* translators: webhook URL */
includes/admin/stripe-multibanco-settings.php CHANGED
@@ -3,24 +3,25 @@ if ( ! defined( 'ABSPATH' ) ) {
3
  exit;
4
  }
5
 
6
- return apply_filters( 'wc_stripe_multibanco_settings',
 
7
  array(
8
- 'geo_target' => array(
9
  'description' => __( 'Relevant Payer Geography: Portugal', 'woocommerce-gateway-stripe' ),
10
  'type' => 'title',
11
  ),
12
- 'activation' => array(
13
  'description' => __( 'Must be activated from your Stripe Dashboard Settings <a href="https://dashboard.stripe.com/account/payments/settings" target="_blank">here</a>', 'woocommerce-gateway-stripe' ),
14
  'type' => 'title',
15
  ),
16
- 'enabled' => array(
17
  'title' => __( 'Enable/Disable', 'woocommerce-gateway-stripe' ),
18
  'label' => __( 'Enable Stripe Multibanco', 'woocommerce-gateway-stripe' ),
19
  'type' => 'checkbox',
20
  'description' => '',
21
  'default' => 'no',
22
  ),
23
- 'title' => array(
24
  'title' => __( 'Title', 'woocommerce-gateway-stripe' ),
25
  'type' => 'text',
26
  'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe' ),
@@ -34,7 +35,7 @@ return apply_filters( 'wc_stripe_multibanco_settings',
34
  'default' => __( 'You will be redirected to Multibanco.', 'woocommerce-gateway-stripe' ),
35
  'desc_tip' => true,
36
  ),
37
- 'webhook' => array(
38
  'title' => __( 'Webhook Endpoints', 'woocommerce-gateway-stripe' ),
39
  'type' => 'title',
40
  /* translators: webhook URL */
3
  exit;
4
  }
5
 
6
+ return apply_filters(
7
+ 'wc_stripe_multibanco_settings',
8
  array(
9
+ 'geo_target' => array(
10
  'description' => __( 'Relevant Payer Geography: Portugal', 'woocommerce-gateway-stripe' ),
11
  'type' => 'title',
12
  ),
13
+ 'activation' => array(
14
  'description' => __( 'Must be activated from your Stripe Dashboard Settings <a href="https://dashboard.stripe.com/account/payments/settings" target="_blank">here</a>', 'woocommerce-gateway-stripe' ),
15
  'type' => 'title',
16
  ),
17
+ 'enabled' => array(
18
  'title' => __( 'Enable/Disable', 'woocommerce-gateway-stripe' ),
19
  'label' => __( 'Enable Stripe Multibanco', 'woocommerce-gateway-stripe' ),
20
  'type' => 'checkbox',
21
  'description' => '',
22
  'default' => 'no',
23
  ),
24
+ 'title' => array(
25
  'title' => __( 'Title', 'woocommerce-gateway-stripe' ),
26
  'type' => 'text',
27
  'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe' ),
35
  'default' => __( 'You will be redirected to Multibanco.', 'woocommerce-gateway-stripe' ),
36
  'desc_tip' => true,
37
  ),
38
+ 'webhook' => array(
39
  'title' => __( 'Webhook Endpoints', 'woocommerce-gateway-stripe' ),
40
  'type' => 'title',
41
  /* translators: webhook URL */
includes/admin/stripe-p24-settings.php CHANGED
@@ -3,24 +3,25 @@ if ( ! defined( 'ABSPATH' ) ) {
3
  exit;
4
  }
5
 
6
- return apply_filters( 'wc_stripe_p24_settings',
 
7
  array(
8
- 'geo_target' => array(
9
  'description' => __( 'Relevant Payer Geography: Poland', 'woocommerce-gateway-stripe' ),
10
  'type' => 'title',
11
  ),
12
- 'activation' => array(
13
  'description' => __( 'Must be activated from your Stripe Dashboard Settings <a href="https://dashboard.stripe.com/account/payments/settings" target="_blank">here</a>', 'woocommerce-gateway-stripe' ),
14
- 'type' => 'title',
15
  ),
16
- 'enabled' => array(
17
  'title' => __( 'Enable/Disable', 'woocommerce-gateway-stripe' ),
18
  'label' => __( 'Enable Stripe P24', 'woocommerce-gateway-stripe' ),
19
  'type' => 'checkbox',
20
  'description' => '',
21
  'default' => 'no',
22
  ),
23
- 'title' => array(
24
  'title' => __( 'Title', 'woocommerce-gateway-stripe' ),
25
  'type' => 'text',
26
  'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe' ),
@@ -34,7 +35,7 @@ return apply_filters( 'wc_stripe_p24_settings',
34
  'default' => __( 'You will be redirected to P24.', 'woocommerce-gateway-stripe' ),
35
  'desc_tip' => true,
36
  ),
37
- 'webhook' => array(
38
  'title' => __( 'Webhook Endpoints', 'woocommerce-gateway-stripe' ),
39
  'type' => 'title',
40
  /* translators: webhook URL */
3
  exit;
4
  }
5
 
6
+ return apply_filters(
7
+ 'wc_stripe_p24_settings',
8
  array(
9
+ 'geo_target' => array(
10
  'description' => __( 'Relevant Payer Geography: Poland', 'woocommerce-gateway-stripe' ),
11
  'type' => 'title',
12
  ),
13
+ 'activation' => array(
14
  'description' => __( 'Must be activated from your Stripe Dashboard Settings <a href="https://dashboard.stripe.com/account/payments/settings" target="_blank">here</a>', 'woocommerce-gateway-stripe' ),
15
+ 'type' => 'title',
16
  ),
17
+ 'enabled' => array(
18
  'title' => __( 'Enable/Disable', 'woocommerce-gateway-stripe' ),
19
  'label' => __( 'Enable Stripe P24', 'woocommerce-gateway-stripe' ),
20
  'type' => 'checkbox',
21
  'description' => '',
22
  'default' => 'no',
23
  ),
24
+ 'title' => array(
25
  'title' => __( 'Title', 'woocommerce-gateway-stripe' ),
26
  'type' => 'text',
27
  'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe' ),
35
  'default' => __( 'You will be redirected to P24.', 'woocommerce-gateway-stripe' ),
36
  'desc_tip' => true,
37
  ),
38
+ 'webhook' => array(
39
  'title' => __( 'Webhook Endpoints', 'woocommerce-gateway-stripe' ),
40
  'type' => 'title',
41
  /* translators: webhook URL */
includes/admin/stripe-sepa-settings.php CHANGED
@@ -3,28 +3,29 @@ if ( ! defined( 'ABSPATH' ) ) {
3
  exit;
4
  }
5
 
6
- return apply_filters( 'wc_stripe_sepa_settings',
 
7
  array(
8
- 'geo_target' => array(
9
  'description' => __( 'Relevant Payer Geography: France, Germany, Spain, Belgium, Netherlands, Luxembourg, Italy, Portugal, Austria, Ireland', 'woocommerce-gateway-stripe' ),
10
  'type' => 'title',
11
  ),
12
- 'guide' => array(
13
  'description' => __( '<a href="https://stripe.com/payments/payment-methods-guide#sepa-direct-debit" target="_blank">Payment Method Guide</a>', 'woocommerce-gateway-stripe' ),
14
  'type' => 'title',
15
  ),
16
- 'activation' => array(
17
  'description' => __( 'Must be activated from your Stripe Dashboard Settings <a href="https://dashboard.stripe.com/account/payments/settings" target="_blank">here</a>', 'woocommerce-gateway-stripe' ),
18
- 'type' => 'title',
19
  ),
20
- 'enabled' => array(
21
  'title' => __( 'Enable/Disable', 'woocommerce-gateway-stripe' ),
22
  'label' => __( 'Enable Stripe SEPA Direct Debit', 'woocommerce-gateway-stripe' ),
23
  'type' => 'checkbox',
24
  'description' => '',
25
  'default' => 'no',
26
  ),
27
- 'title' => array(
28
  'title' => __( 'Title', 'woocommerce-gateway-stripe' ),
29
  'type' => 'text',
30
  'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe' ),
@@ -38,7 +39,7 @@ return apply_filters( 'wc_stripe_sepa_settings',
38
  'default' => __( 'Mandate Information.', 'woocommerce-gateway-stripe' ),
39
  'desc_tip' => true,
40
  ),
41
- 'webhook' => array(
42
  'title' => __( 'Webhook Endpoints', 'woocommerce-gateway-stripe' ),
43
  'type' => 'title',
44
  /* translators: webhook URL */
3
  exit;
4
  }
5
 
6
+ return apply_filters(
7
+ 'wc_stripe_sepa_settings',
8
  array(
9
+ 'geo_target' => array(
10
  'description' => __( 'Relevant Payer Geography: France, Germany, Spain, Belgium, Netherlands, Luxembourg, Italy, Portugal, Austria, Ireland', 'woocommerce-gateway-stripe' ),
11
  'type' => 'title',
12
  ),
13
+ 'guide' => array(
14
  'description' => __( '<a href="https://stripe.com/payments/payment-methods-guide#sepa-direct-debit" target="_blank">Payment Method Guide</a>', 'woocommerce-gateway-stripe' ),
15
  'type' => 'title',
16
  ),
17
+ 'activation' => array(
18
  'description' => __( 'Must be activated from your Stripe Dashboard Settings <a href="https://dashboard.stripe.com/account/payments/settings" target="_blank">here</a>', 'woocommerce-gateway-stripe' ),
19
+ 'type' => 'title',
20
  ),
21
+ 'enabled' => array(
22
  'title' => __( 'Enable/Disable', 'woocommerce-gateway-stripe' ),
23
  'label' => __( 'Enable Stripe SEPA Direct Debit', 'woocommerce-gateway-stripe' ),
24
  'type' => 'checkbox',
25
  'description' => '',
26
  'default' => 'no',
27
  ),
28
+ 'title' => array(
29
  'title' => __( 'Title', 'woocommerce-gateway-stripe' ),
30
  'type' => 'text',
31
  'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe' ),
39
  'default' => __( 'Mandate Information.', 'woocommerce-gateway-stripe' ),
40
  'desc_tip' => true,
41
  ),
42
+ 'webhook' => array(
43
  'title' => __( 'Webhook Endpoints', 'woocommerce-gateway-stripe' ),
44
  'type' => 'title',
45
  /* translators: webhook URL */
includes/admin/stripe-settings.php CHANGED
@@ -3,36 +3,37 @@ if ( ! defined( 'ABSPATH' ) ) {
3
  exit;
4
  }
5
 
6
- return apply_filters( 'wc_stripe_settings',
 
7
  array(
8
- 'enabled' => array(
9
  'title' => __( 'Enable/Disable', 'woocommerce-gateway-stripe' ),
10
  'label' => __( 'Enable Stripe', 'woocommerce-gateway-stripe' ),
11
  'type' => 'checkbox',
12
  'description' => '',
13
  'default' => 'no',
14
  ),
15
- 'title' => array(
16
  'title' => __( 'Title', 'woocommerce-gateway-stripe' ),
17
  'type' => 'text',
18
  'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe' ),
19
  'default' => __( 'Credit Card (Stripe)', 'woocommerce-gateway-stripe' ),
20
  'desc_tip' => true,
21
  ),
22
- 'description' => array(
23
  'title' => __( 'Description', 'woocommerce-gateway-stripe' ),
24
  'type' => 'text',
25
  'description' => __( 'This controls the description which the user sees during checkout.', 'woocommerce-gateway-stripe' ),
26
  'default' => __( 'Pay with your credit card via Stripe.', 'woocommerce-gateway-stripe' ),
27
  'desc_tip' => true,
28
  ),
29
- 'webhook' => array(
30
  'title' => __( 'Webhook Endpoints', 'woocommerce-gateway-stripe' ),
31
  'type' => 'title',
32
  /* translators: webhook URL */
33
  'description' => $this->display_admin_settings_webhook_description(),
34
  ),
35
- 'testmode' => array(
36
  'title' => __( 'Test mode', 'woocommerce-gateway-stripe' ),
37
  'label' => __( 'Enable Test Mode', 'woocommerce-gateway-stripe' ),
38
  'type' => 'checkbox',
@@ -40,49 +41,49 @@ return apply_filters( 'wc_stripe_settings',
40
  'default' => 'yes',
41
  'desc_tip' => true,
42
  ),
43
- 'test_publishable_key' => array(
44
  'title' => __( 'Test Publishable Key', 'woocommerce-gateway-stripe' ),
45
  'type' => 'password',
46
  'description' => __( 'Get your API keys from your stripe account.', 'woocommerce-gateway-stripe' ),
47
  'default' => '',
48
  'desc_tip' => true,
49
  ),
50
- 'test_secret_key' => array(
51
  'title' => __( 'Test Secret Key', 'woocommerce-gateway-stripe' ),
52
  'type' => 'password',
53
  'description' => __( 'Get your API keys from your stripe account.', 'woocommerce-gateway-stripe' ),
54
  'default' => '',
55
  'desc_tip' => true,
56
  ),
57
- 'publishable_key' => array(
58
  'title' => __( 'Live Publishable Key', 'woocommerce-gateway-stripe' ),
59
  'type' => 'password',
60
  'description' => __( 'Get your API keys from your stripe account.', 'woocommerce-gateway-stripe' ),
61
  'default' => '',
62
  'desc_tip' => true,
63
  ),
64
- 'secret_key' => array(
65
  'title' => __( 'Live Secret Key', 'woocommerce-gateway-stripe' ),
66
  'type' => 'password',
67
  'description' => __( 'Get your API keys from your stripe account.', 'woocommerce-gateway-stripe' ),
68
  'default' => '',
69
  'desc_tip' => true,
70
  ),
71
- 'inline_cc_form' => array(
72
  'title' => __( 'Inline Credit Card Form', 'woocommerce-gateway-stripe' ),
73
  'type' => 'checkbox',
74
  'description' => __( 'Choose the style you want to show for your credit card form. When unchecked, the credit card form will display separate credit card number field, expiry date field and cvc field.', 'woocommerce-gateway-stripe' ),
75
  'default' => 'no',
76
  'desc_tip' => true,
77
  ),
78
- 'statement_descriptor' => array(
79
  'title' => __( 'Statement Descriptor', 'woocommerce-gateway-stripe' ),
80
  'type' => 'text',
81
  'description' => __( 'This may be up to 22 characters. The statement description must contain at least one letter, may not include ><"\' characters, and will appear on your customer\'s statement in capital letters.', 'woocommerce-gateway-stripe' ),
82
  'default' => '',
83
  'desc_tip' => true,
84
  ),
85
- 'capture' => array(
86
  'title' => __( 'Capture', 'woocommerce-gateway-stripe' ),
87
  'label' => __( 'Capture charge immediately', 'woocommerce-gateway-stripe' ),
88
  'type' => 'checkbox',
@@ -90,7 +91,7 @@ return apply_filters( 'wc_stripe_settings',
90
  'default' => 'yes',
91
  'desc_tip' => true,
92
  ),
93
- 'three_d_secure' => array(
94
  'title' => __( '3D Secure', 'woocommerce-gateway-stripe' ),
95
  'label' => __( 'Require 3D Secure when applicable', 'woocommerce-gateway-stripe' ),
96
  'type' => 'checkbox',
@@ -98,7 +99,7 @@ return apply_filters( 'wc_stripe_settings',
98
  'default' => 'yes',
99
  'desc_tip' => true,
100
  ),
101
- 'stripe_checkout' => array(
102
  'title' => __( 'Stripe Modal Checkout', 'woocommerce-gateway-stripe' ),
103
  'label' => __( 'Enable Stripe Checkout', 'woocommerce-gateway-stripe' ),
104
  'type' => 'checkbox',
@@ -106,21 +107,21 @@ return apply_filters( 'wc_stripe_settings',
106
  'default' => 'no',
107
  'desc_tip' => true,
108
  ),
109
- 'stripe_checkout_image' => array(
110
  'title' => __( 'Stripe Checkout Image', 'woocommerce-gateway-stripe' ),
111
  'description' => __( 'Optionally enter the URL to a 128x128px image of your brand or product. e.g. <code>https://yoursite.com/wp-content/uploads/2013/09/yourimage.jpg</code>', 'woocommerce-gateway-stripe' ),
112
  'type' => 'text',
113
  'default' => '',
114
  'desc_tip' => true,
115
  ),
116
- 'stripe_checkout_description' => array(
117
  'title' => __( 'Stripe Checkout Description', 'woocommerce-gateway-stripe' ),
118
  'type' => 'text',
119
  'description' => __( 'Shows a description of your store on Stripe Modal Checkout.', 'woocommerce-gateway-stripe' ),
120
  'default' => '',
121
  'desc_tip' => true,
122
  ),
123
- 'payment_request' => array(
124
  'title' => __( 'Payment Request Buttons', 'woocommerce-gateway-stripe' ),
125
  /* translators: 1) br tag 2) opening anchor tag 3) closing anchor tag */
126
  'label' => sprintf( __( 'Enable Payment Request Buttons. (Apple Pay/Chrome Payment Request API) %1$sBy using Apple Pay, you agree to %2$s and %3$s\'s terms of service.', 'woocommerce-gateway-stripe' ), '<br />', '<a href="https://stripe.com/apple-pay/legal" target="_blank">Stripe</a>', '<a href="https://developer.apple.com/apple-pay/acceptable-use-guidelines-for-websites/" target="_blank">Apple</a>' ),
@@ -129,7 +130,7 @@ return apply_filters( 'wc_stripe_settings',
129
  'default' => 'yes',
130
  'desc_tip' => true,
131
  ),
132
- 'payment_request_button_type' => array(
133
  'title' => __( 'Payment Request Button Type', 'woocommerce-gateway-stripe' ),
134
  'label' => __( 'Button Type', 'woocommerce-gateway-stripe' ),
135
  'type' => 'select',
@@ -142,7 +143,7 @@ return apply_filters( 'wc_stripe_settings',
142
  'donate' => __( 'Donate', 'woocommerce-gateway-stripe' ),
143
  ),
144
  ),
145
- 'payment_request_button_theme' => array(
146
  'title' => __( 'Payment Request Button Theme', 'woocommerce-gateway-stripe' ),
147
  'label' => __( 'Button Theme', 'woocommerce-gateway-stripe' ),
148
  'type' => 'select',
@@ -163,7 +164,7 @@ return apply_filters( 'wc_stripe_settings',
163
  'default' => '44',
164
  'desc_tip' => true,
165
  ),
166
- 'saved_cards' => array(
167
  'title' => __( 'Saved Cards', 'woocommerce-gateway-stripe' ),
168
  'label' => __( 'Enable Payment via Saved Cards', 'woocommerce-gateway-stripe' ),
169
  'type' => 'checkbox',
@@ -171,7 +172,7 @@ return apply_filters( 'wc_stripe_settings',
171
  'default' => 'no',
172
  'desc_tip' => true,
173
  ),
174
- 'logging' => array(
175
  'title' => __( 'Logging', 'woocommerce-gateway-stripe' ),
176
  'label' => __( 'Log debug messages', 'woocommerce-gateway-stripe' ),
177
  'type' => 'checkbox',
3
  exit;
4
  }
5
 
6
+ return apply_filters(
7
+ 'wc_stripe_settings',
8
  array(
9
+ 'enabled' => array(
10
  'title' => __( 'Enable/Disable', 'woocommerce-gateway-stripe' ),
11
  'label' => __( 'Enable Stripe', 'woocommerce-gateway-stripe' ),
12
  'type' => 'checkbox',
13
  'description' => '',
14
  'default' => 'no',
15
  ),
16
+ 'title' => array(
17
  'title' => __( 'Title', 'woocommerce-gateway-stripe' ),
18
  'type' => 'text',
19
  'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe' ),
20
  'default' => __( 'Credit Card (Stripe)', 'woocommerce-gateway-stripe' ),
21
  'desc_tip' => true,
22
  ),
23
+ 'description' => array(
24
  'title' => __( 'Description', 'woocommerce-gateway-stripe' ),
25
  'type' => 'text',
26
  'description' => __( 'This controls the description which the user sees during checkout.', 'woocommerce-gateway-stripe' ),
27
  'default' => __( 'Pay with your credit card via Stripe.', 'woocommerce-gateway-stripe' ),
28
  'desc_tip' => true,
29
  ),
30
+ 'webhook' => array(
31
  'title' => __( 'Webhook Endpoints', 'woocommerce-gateway-stripe' ),
32
  'type' => 'title',
33
  /* translators: webhook URL */
34
  'description' => $this->display_admin_settings_webhook_description(),
35
  ),
36
+ 'testmode' => array(
37
  'title' => __( 'Test mode', 'woocommerce-gateway-stripe' ),
38
  'label' => __( 'Enable Test Mode', 'woocommerce-gateway-stripe' ),
39
  'type' => 'checkbox',
41
  'default' => 'yes',
42
  'desc_tip' => true,
43
  ),
44
+ 'test_publishable_key' => array(
45
  'title' => __( 'Test Publishable Key', 'woocommerce-gateway-stripe' ),
46
  'type' => 'password',
47
  'description' => __( 'Get your API keys from your stripe account.', 'woocommerce-gateway-stripe' ),
48
  'default' => '',
49
  'desc_tip' => true,
50
  ),
51
+ 'test_secret_key' => array(
52
  'title' => __( 'Test Secret Key', 'woocommerce-gateway-stripe' ),
53
  'type' => 'password',
54
  'description' => __( 'Get your API keys from your stripe account.', 'woocommerce-gateway-stripe' ),
55
  'default' => '',
56
  'desc_tip' => true,
57
  ),
58
+ 'publishable_key' => array(
59
  'title' => __( 'Live Publishable Key', 'woocommerce-gateway-stripe' ),
60
  'type' => 'password',
61
  'description' => __( 'Get your API keys from your stripe account.', 'woocommerce-gateway-stripe' ),
62
  'default' => '',
63
  'desc_tip' => true,
64
  ),
65
+ 'secret_key' => array(
66
  'title' => __( 'Live Secret Key', 'woocommerce-gateway-stripe' ),
67
  'type' => 'password',
68
  'description' => __( 'Get your API keys from your stripe account.', 'woocommerce-gateway-stripe' ),
69
  'default' => '',
70
  'desc_tip' => true,
71
  ),
72
+ 'inline_cc_form' => array(
73
  'title' => __( 'Inline Credit Card Form', 'woocommerce-gateway-stripe' ),
74
  'type' => 'checkbox',
75
  'description' => __( 'Choose the style you want to show for your credit card form. When unchecked, the credit card form will display separate credit card number field, expiry date field and cvc field.', 'woocommerce-gateway-stripe' ),
76
  'default' => 'no',
77
  'desc_tip' => true,
78
  ),
79
+ 'statement_descriptor' => array(
80
  'title' => __( 'Statement Descriptor', 'woocommerce-gateway-stripe' ),
81
  'type' => 'text',
82
  'description' => __( 'This may be up to 22 characters. The statement description must contain at least one letter, may not include ><"\' characters, and will appear on your customer\'s statement in capital letters.', 'woocommerce-gateway-stripe' ),
83
  'default' => '',
84
  'desc_tip' => true,
85
  ),
86
+ 'capture' => array(
87
  'title' => __( 'Capture', 'woocommerce-gateway-stripe' ),
88
  'label' => __( 'Capture charge immediately', 'woocommerce-gateway-stripe' ),
89
  'type' => 'checkbox',
91
  'default' => 'yes',
92
  'desc_tip' => true,
93
  ),
94
+ 'three_d_secure' => array(
95
  'title' => __( '3D Secure', 'woocommerce-gateway-stripe' ),
96
  'label' => __( 'Require 3D Secure when applicable', 'woocommerce-gateway-stripe' ),
97
  'type' => 'checkbox',
99
  'default' => 'yes',
100
  'desc_tip' => true,
101
  ),
102
+ 'stripe_checkout' => array(
103
  'title' => __( 'Stripe Modal Checkout', 'woocommerce-gateway-stripe' ),
104
  'label' => __( 'Enable Stripe Checkout', 'woocommerce-gateway-stripe' ),
105
  'type' => 'checkbox',
107
  'default' => 'no',
108
  'desc_tip' => true,
109
  ),
110
+ 'stripe_checkout_image' => array(
111
  'title' => __( 'Stripe Checkout Image', 'woocommerce-gateway-stripe' ),
112
  'description' => __( 'Optionally enter the URL to a 128x128px image of your brand or product. e.g. <code>https://yoursite.com/wp-content/uploads/2013/09/yourimage.jpg</code>', 'woocommerce-gateway-stripe' ),
113
  'type' => 'text',
114
  'default' => '',
115
  'desc_tip' => true,
116
  ),
117
+ 'stripe_checkout_description' => array(
118
  'title' => __( 'Stripe Checkout Description', 'woocommerce-gateway-stripe' ),
119
  'type' => 'text',
120
  'description' => __( 'Shows a description of your store on Stripe Modal Checkout.', 'woocommerce-gateway-stripe' ),
121
  'default' => '',
122
  'desc_tip' => true,
123
  ),
124
+ 'payment_request' => array(
125
  'title' => __( 'Payment Request Buttons', 'woocommerce-gateway-stripe' ),
126
  /* translators: 1) br tag 2) opening anchor tag 3) closing anchor tag */
127
  'label' => sprintf( __( 'Enable Payment Request Buttons. (Apple Pay/Chrome Payment Request API) %1$sBy using Apple Pay, you agree to %2$s and %3$s\'s terms of service.', 'woocommerce-gateway-stripe' ), '<br />', '<a href="https://stripe.com/apple-pay/legal" target="_blank">Stripe</a>', '<a href="https://developer.apple.com/apple-pay/acceptable-use-guidelines-for-websites/" target="_blank">Apple</a>' ),
130
  'default' => 'yes',
131
  'desc_tip' => true,
132
  ),
133
+ 'payment_request_button_type' => array(
134
  'title' => __( 'Payment Request Button Type', 'woocommerce-gateway-stripe' ),
135
  'label' => __( 'Button Type', 'woocommerce-gateway-stripe' ),
136
  'type' => 'select',
143
  'donate' => __( 'Donate', 'woocommerce-gateway-stripe' ),
144
  ),
145
  ),
146
+ 'payment_request_button_theme' => array(
147
  'title' => __( 'Payment Request Button Theme', 'woocommerce-gateway-stripe' ),
148
  'label' => __( 'Button Theme', 'woocommerce-gateway-stripe' ),
149
  'type' => 'select',
164
  'default' => '44',
165
  'desc_tip' => true,
166
  ),
167
+ 'saved_cards' => array(
168
  'title' => __( 'Saved Cards', 'woocommerce-gateway-stripe' ),
169
  'label' => __( 'Enable Payment via Saved Cards', 'woocommerce-gateway-stripe' ),
170
  'type' => 'checkbox',
172
  'default' => 'no',
173
  'desc_tip' => true,
174
  ),
175
+ 'logging' => array(
176
  'title' => __( 'Logging', 'woocommerce-gateway-stripe' ),
177
  'label' => __( 'Log debug messages', 'woocommerce-gateway-stripe' ),
178
  'type' => 'checkbox',
includes/admin/stripe-sofort-settings.php CHANGED
@@ -3,28 +3,29 @@ if ( ! defined( 'ABSPATH' ) ) {
3
  exit;
4
  }
5
 
6
- return apply_filters( 'wc_stripe_sofort_settings',
 
7
  array(
8
- 'geo_target' => array(
9
  'description' => __( 'Relevant Payer Geography: Germany, Austria', 'woocommerce-gateway-stripe' ),
10
  'type' => 'title',
11
  ),
12
- 'guide' => array(
13
  'description' => __( '<a href="https://stripe.com/payments/payment-methods-guide#sofort" target="_blank">Payment Method Guide</a>', 'woocommerce-gateway-stripe' ),
14
  'type' => 'title',
15
  ),
16
- 'activation' => array(
17
  'description' => __( 'Must be activated from your Stripe Dashboard Settings <a href="https://dashboard.stripe.com/account/payments/settings" target="_blank">here</a>', 'woocommerce-gateway-stripe' ),
18
- 'type' => 'title',
19
  ),
20
- 'enabled' => array(
21
  'title' => __( 'Enable/Disable', 'woocommerce-gateway-stripe' ),
22
  'label' => __( 'Enable Stripe SOFORT', 'woocommerce-gateway-stripe' ),
23
  'type' => 'checkbox',
24
  'description' => '',
25
  'default' => 'no',
26
  ),
27
- 'title' => array(
28
  'title' => __( 'Title', 'woocommerce-gateway-stripe' ),
29
  'type' => 'text',
30
  'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe' ),
@@ -38,7 +39,7 @@ return apply_filters( 'wc_stripe_sofort_settings',
38
  'default' => __( 'You will be redirected to SOFORT.', 'woocommerce-gateway-stripe' ),
39
  'desc_tip' => true,
40
  ),
41
- 'webhook' => array(
42
  'title' => __( 'Webhook Endpoints', 'woocommerce-gateway-stripe' ),
43
  'type' => 'title',
44
  /* translators: webhook URL */
3
  exit;
4
  }
5
 
6
+ return apply_filters(
7
+ 'wc_stripe_sofort_settings',
8
  array(
9
+ 'geo_target' => array(
10
  'description' => __( 'Relevant Payer Geography: Germany, Austria', 'woocommerce-gateway-stripe' ),
11
  'type' => 'title',
12
  ),
13
+ 'guide' => array(
14
  'description' => __( '<a href="https://stripe.com/payments/payment-methods-guide#sofort" target="_blank">Payment Method Guide</a>', 'woocommerce-gateway-stripe' ),
15
  'type' => 'title',
16
  ),
17
+ 'activation' => array(
18
  'description' => __( 'Must be activated from your Stripe Dashboard Settings <a href="https://dashboard.stripe.com/account/payments/settings" target="_blank">here</a>', 'woocommerce-gateway-stripe' ),
19
+ 'type' => 'title',
20
  ),
21
+ 'enabled' => array(
22
  'title' => __( 'Enable/Disable', 'woocommerce-gateway-stripe' ),
23
  'label' => __( 'Enable Stripe SOFORT', 'woocommerce-gateway-stripe' ),
24
  'type' => 'checkbox',
25
  'description' => '',
26
  'default' => 'no',
27
  ),
28
+ 'title' => array(
29
  'title' => __( 'Title', 'woocommerce-gateway-stripe' ),
30
  'type' => 'text',
31
  'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe' ),
39
  'default' => __( 'You will be redirected to SOFORT.', 'woocommerce-gateway-stripe' ),
40
  'desc_tip' => true,
41
  ),
42
+ 'webhook' => array(
43
  'title' => __( 'Webhook Endpoints', 'woocommerce-gateway-stripe' ),
44
  'type' => 'title',
45
  /* translators: webhook URL */
includes/class-wc-gateway-stripe.php CHANGED
@@ -111,9 +111,9 @@ class WC_Gateway_Stripe extends WC_Stripe_Payment_Gateway {
111
  * Constructor
112
  */
113
  public function __construct() {
114
- $this->retry_interval = 1;
115
- $this->id = 'stripe';
116
- $this->method_title = __( 'Stripe', 'woocommerce-gateway-stripe' );
117
  /* translators: 1) link to Stripe register page 2) link to Stripe api keys page */
118
  $this->method_description = sprintf( __( 'Stripe works by adding payment fields on the checkout and then sending the details to Stripe for verification. <a href="%1$s" target="_blank">Sign up</a> for a Stripe account, and <a href="%2$s" target="_blank">get your Stripe account keys</a>.', 'woocommerce-gateway-stripe' ), 'https://dashboard.stripe.com/register', 'https://dashboard.stripe.com/account/apikeys' );
119
  $this->has_fields = true;
@@ -236,14 +236,14 @@ class WC_Gateway_Stripe extends WC_Stripe_Payment_Gateway {
236
 
237
  $icons_str = '';
238
 
239
- $icons_str .= $icons['visa'];
240
- $icons_str .= $icons['amex'];
241
- $icons_str .= $icons['mastercard'];
242
 
243
  if ( 'USD' === get_woocommerce_currency() ) {
244
- $icons_str .= $icons['discover'];
245
- $icons_str .= $icons['jcb'];
246
- $icons_str .= $icons['diners'];
247
  }
248
 
249
  return apply_filters( 'woocommerce_gateway_icon', $icons_str, $this->id );
@@ -264,7 +264,8 @@ class WC_Gateway_Stripe extends WC_Stripe_Payment_Gateway {
264
  $display_tokenization = $this->supports( 'tokenization' ) && is_checkout() && $this->saved_cards;
265
  $total = WC()->cart->total;
266
  $user_email = '';
267
- $description = ! empty( $this->get_description() ) ? $this->get_description() : '';
 
268
  $firstname = '';
269
  $lastname = '';
270
 
@@ -272,7 +273,7 @@ class WC_Gateway_Stripe extends WC_Stripe_Payment_Gateway {
272
  if ( isset( $_GET['pay_for_order'] ) && ! empty( $_GET['key'] ) ) {
273
  $order = wc_get_order( wc_get_order_id_by_order_key( wc_clean( $_GET['key'] ) ) );
274
  $total = $order->get_total();
275
- $user_email = WC_Stripe_Helper::is_pre_30() ? $order->billing_email : $order->get_billing_email();
276
  } else {
277
  if ( $user->ID ) {
278
  $user_email = get_user_meta( $user->ID, 'billing_email', true );
@@ -298,7 +299,7 @@ class WC_Gateway_Stripe extends WC_Stripe_Payment_Gateway {
298
  echo '<div
299
  id="stripe-payment-data"
300
  data-panel-label="' . esc_attr( $pay_button_text ) . '"
301
- data-description="' . esc_attr( strip_tags( $this->stripe_checkout_description ) ) . '"
302
  data-email="' . esc_attr( $user_email ) . '"
303
  data-verify-zip="' . esc_attr( apply_filters( 'wc_stripe_checkout_verify_zip', false ) ? 'true' : 'false' ) . '"
304
  data-billing-address="' . esc_attr( apply_filters( 'wc_stripe_checkout_require_billing_address', false ) ? 'true' : 'false' ) . '"
@@ -339,6 +340,8 @@ class WC_Gateway_Stripe extends WC_Stripe_Payment_Gateway {
339
  }
340
  }
341
 
 
 
342
  echo '</div>';
343
 
344
  ob_end_flush();
@@ -450,17 +453,26 @@ class WC_Gateway_Stripe extends WC_Stripe_Payment_Gateway {
450
 
451
  $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
452
 
453
- wp_register_style( 'stripe_styles', plugins_url( 'assets/css/stripe-styles.css', WC_STRIPE_MAIN_FILE ), array(), WC_STRIPE_VERSION );
454
- wp_enqueue_style( 'stripe_styles' );
 
 
 
 
 
 
 
 
455
 
456
- if ( 'storefront' === $current_theme->get_template() ) {
457
- wp_register_style( 'stripe_storefront_styles', plugins_url( 'assets/css/stripe-storefront-styles.css', WC_STRIPE_MAIN_FILE ), array(), WC_STRIPE_VERSION );
458
- wp_enqueue_style( 'stripe_storefront_styles' );
459
- }
460
 
461
- if ( 'twentyseventeen' === $current_theme->get_template() ) {
462
- wp_register_style( 'stripe_twentyseventeen_styles', plugins_url( 'assets/css/stripe-twentyseventeen-styles.css', WC_STRIPE_MAIN_FILE ), array(), WC_STRIPE_VERSION );
463
- wp_enqueue_style( 'stripe_twentyseventeen_styles' );
 
464
  }
465
 
466
  wp_register_script( 'stripe_checkout', 'https://checkout.stripe.com/checkout.js', '', WC_STRIPE_VERSION, true );
@@ -479,14 +491,14 @@ class WC_Gateway_Stripe extends WC_Stripe_Payment_Gateway {
479
  $order = wc_get_order( $order_id );
480
 
481
  if ( is_a( $order, 'WC_Order' ) ) {
482
- $stripe_params['billing_first_name'] = WC_Stripe_Helper::is_pre_30() ? $order->billing_first_name : $order->get_billing_first_name();
483
- $stripe_params['billing_last_name'] = WC_Stripe_Helper::is_pre_30() ? $order->billing_last_name : $order->get_billing_last_name();
484
- $stripe_params['billing_address_1'] = WC_Stripe_Helper::is_pre_30() ? $order->billing_address_1 : $order->get_billing_address_1();
485
- $stripe_params['billing_address_2'] = WC_Stripe_Helper::is_pre_30() ? $order->billing_address_2 : $order->get_billing_address_2();
486
- $stripe_params['billing_state'] = WC_Stripe_Helper::is_pre_30() ? $order->billing_state : $order->get_billing_state();
487
- $stripe_params['billing_city'] = WC_Stripe_Helper::is_pre_30() ? $order->billing_city : $order->get_billing_city();
488
- $stripe_params['billing_postcode'] = WC_Stripe_Helper::is_pre_30() ? $order->billing_postcode : $order->get_billing_postcode();
489
- $stripe_params['billing_country'] = WC_Stripe_Helper::is_pre_30() ? $order->billing_country : $order->get_billing_country();
490
  }
491
  }
492
 
@@ -503,7 +515,14 @@ class WC_Gateway_Stripe extends WC_Stripe_Payment_Gateway {
503
  $stripe_params['stripe_nonce'] = wp_create_nonce( '_wc_stripe_nonce' );
504
  $stripe_params['statement_descriptor'] = $this->statement_descriptor;
505
  $stripe_params['elements_options'] = apply_filters( 'wc_stripe_elements_options', array() );
506
- $stripe_params['sepa_elements_options'] = apply_filters( 'wc_stripe_sepa_elements_options', array( 'supportedCountries' => array( 'SEPA' ), 'placeholderCountry' => WC()->countries->get_base_country(), 'style' => array( 'base' => array( 'fontSize' => '15px' ) ) ) );
 
 
 
 
 
 
 
507
  $stripe_params['invalid_owner_name'] = __( 'Billing First Name and Last Name are required.', 'woocommerce-gateway-stripe' );
508
  $stripe_params['is_stripe_checkout'] = $this->stripe_checkout ? 'yes' : 'no';
509
  $stripe_params['is_change_payment_page'] = isset( $_GET['change_payment_method'] ) ? 'yes' : 'no';
@@ -545,7 +564,7 @@ class WC_Gateway_Stripe extends WC_Stripe_Payment_Gateway {
545
  if ( ! empty( $_GET['key'] ) ) {
546
  $order = wc_get_order( wc_get_order_id_by_order_key( wc_clean( $_GET['key'] ) ) );
547
  $total = $order->get_total();
548
- $user_email = WC_Stripe_Helper::is_pre_30() ? $order->billing_email : $order->get_billing_email();
549
  } else {
550
  if ( $user->ID ) {
551
  $user_email = get_user_meta( $user->ID, 'billing_email', true );
@@ -561,7 +580,7 @@ class WC_Gateway_Stripe extends WC_Stripe_Payment_Gateway {
561
  echo '<div
562
  id="stripe-payment-data"
563
  data-panel-label="' . esc_attr( apply_filters( 'wc_stripe_checkout_label', '' ) ) . '"
564
- data-description="' . esc_attr( strip_tags( $this->stripe_checkout_description ) ) . '"
565
  data-email="' . esc_attr( $user_email ) . '"
566
  data-verify-zip="' . esc_attr( apply_filters( 'wc_stripe_checkout_verify_zip', false ) ? 'true' : 'false' ) . '"
567
  data-billing-address="' . esc_attr( apply_filters( 'wc_stripe_checkout_require_billing_address', false ) ? 'true' : 'false' ) . '"
@@ -689,7 +708,7 @@ class WC_Gateway_Stripe extends WC_Stripe_Payment_Gateway {
689
  $create_account = ! empty( $_POST['createaccount'] ) ? true : false;
690
 
691
  if ( $create_account ) {
692
- $new_customer_id = WC_Stripe_Helper::is_pre_30() ? $order->customer_user : $order->get_customer_id();
693
  $new_stripe_customer = new WC_Stripe_Customer( $new_customer_id );
694
  $new_stripe_customer->create_customer();
695
  }
@@ -735,7 +754,7 @@ class WC_Gateway_Stripe extends WC_Stripe_Payment_Gateway {
735
  }
736
 
737
  // Update order meta with 3DS source.
738
- if ( WC_Stripe_Helper::is_pre_30() ) {
739
  update_post_meta( $order_id, '_stripe_source_id', $response->id );
740
  } else {
741
  $order->update_meta_data( '_stripe_source_id', $response->id );
@@ -756,6 +775,7 @@ class WC_Gateway_Stripe extends WC_Stripe_Payment_Gateway {
756
  } elseif ( 'not_required' === $response->redirect->status && 'chargeable' === $response->status ) {
757
  // Override the original source object with 3DS.
758
  $prepared_source->source_object = $response;
 
759
  }
760
  }
761
 
@@ -774,7 +794,7 @@ class WC_Gateway_Stripe extends WC_Stripe_Payment_Gateway {
774
  if ( ! empty( $response->error ) ) {
775
  // Customer param wrong? The user may have been deleted on stripe's end. Remove customer_id. Can be retried without.
776
  if ( $this->is_no_such_customer_error( $response->error ) ) {
777
- if ( WC_Stripe_Helper::is_pre_30() ) {
778
  delete_user_meta( $order->customer_user, '_stripe_customer_id' );
779
  delete_post_meta( $order_id, '_stripe_customer_id' );
780
  } else {
111
  * Constructor
112
  */
113
  public function __construct() {
114
+ $this->retry_interval = 1;
115
+ $this->id = 'stripe';
116
+ $this->method_title = __( 'Stripe', 'woocommerce-gateway-stripe' );
117
  /* translators: 1) link to Stripe register page 2) link to Stripe api keys page */
118
  $this->method_description = sprintf( __( 'Stripe works by adding payment fields on the checkout and then sending the details to Stripe for verification. <a href="%1$s" target="_blank">Sign up</a> for a Stripe account, and <a href="%2$s" target="_blank">get your Stripe account keys</a>.', 'woocommerce-gateway-stripe' ), 'https://dashboard.stripe.com/register', 'https://dashboard.stripe.com/account/apikeys' );
119
  $this->has_fields = true;
236
 
237
  $icons_str = '';
238
 
239
+ $icons_str .= isset( $icons['visa'] ) ? $icons['visa'] : '';
240
+ $icons_str .= isset( $icons['amex'] ) ? $icons['amex'] : '';
241
+ $icons_str .= isset( $icons['mastercard'] ) ? $icons['mastercard'] : '';
242
 
243
  if ( 'USD' === get_woocommerce_currency() ) {
244
+ $icons_str .= isset( $icons['discover'] ) ? $icons['discover'] : '';
245
+ $icons_str .= isset( $icons['jcb'] ) ? $icons['jcb'] : '';
246
+ $icons_str .= isset( $icons['diners'] ) ? $icons['diners'] : '';
247
  }
248
 
249
  return apply_filters( 'woocommerce_gateway_icon', $icons_str, $this->id );
264
  $display_tokenization = $this->supports( 'tokenization' ) && is_checkout() && $this->saved_cards;
265
  $total = WC()->cart->total;
266
  $user_email = '';
267
+ $description = $this->get_description();
268
+ $description = ! empty( $description ) ? $description : '';
269
  $firstname = '';
270
  $lastname = '';
271
 
273
  if ( isset( $_GET['pay_for_order'] ) && ! empty( $_GET['key'] ) ) {
274
  $order = wc_get_order( wc_get_order_id_by_order_key( wc_clean( $_GET['key'] ) ) );
275
  $total = $order->get_total();
276
+ $user_email = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->billing_email : $order->get_billing_email();
277
  } else {
278
  if ( $user->ID ) {
279
  $user_email = get_user_meta( $user->ID, 'billing_email', true );
299
  echo '<div
300
  id="stripe-payment-data"
301
  data-panel-label="' . esc_attr( $pay_button_text ) . '"
302
+ data-description="' . esc_attr( wp_strip_all_tags( $this->stripe_checkout_description ) ) . '"
303
  data-email="' . esc_attr( $user_email ) . '"
304
  data-verify-zip="' . esc_attr( apply_filters( 'wc_stripe_checkout_verify_zip', false ) ? 'true' : 'false' ) . '"
305
  data-billing-address="' . esc_attr( apply_filters( 'wc_stripe_checkout_require_billing_address', false ) ? 'true' : 'false' ) . '"
340
  }
341
  }
342
 
343
+ do_action( 'wc_stripe_cards_payment_fields', $this->id );
344
+
345
  echo '</div>';
346
 
347
  ob_end_flush();
453
 
454
  $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
455
 
456
+ /*
457
+ * Load future stripped styles only to admin. This will
458
+ * give them the chance to make changes.
459
+ */
460
+ if ( current_user_can( 'administrator' ) ) {
461
+ wp_register_style( 'stripe_styles', plugins_url( 'assets/css/stripe-future-styles.css', WC_STRIPE_MAIN_FILE ), array(), WC_STRIPE_VERSION );
462
+ wp_enqueue_style( 'stripe_styles' );
463
+ } else {
464
+ wp_register_style( 'stripe_styles', plugins_url( 'assets/css/stripe-styles.css', WC_STRIPE_MAIN_FILE ), array(), WC_STRIPE_VERSION );
465
+ wp_enqueue_style( 'stripe_styles' );
466
 
467
+ if ( 'storefront' === $current_theme->get_template() ) {
468
+ wp_register_style( 'stripe_storefront_styles', plugins_url( 'assets/css/stripe-storefront-styles.css', WC_STRIPE_MAIN_FILE ), array(), WC_STRIPE_VERSION );
469
+ wp_enqueue_style( 'stripe_storefront_styles' );
470
+ }
471
 
472
+ if ( 'twentyseventeen' === $current_theme->get_template() ) {
473
+ wp_register_style( 'stripe_twentyseventeen_styles', plugins_url( 'assets/css/stripe-twentyseventeen-styles.css', WC_STRIPE_MAIN_FILE ), array(), WC_STRIPE_VERSION );
474
+ wp_enqueue_style( 'stripe_twentyseventeen_styles' );
475
+ }
476
  }
477
 
478
  wp_register_script( 'stripe_checkout', 'https://checkout.stripe.com/checkout.js', '', WC_STRIPE_VERSION, true );
491
  $order = wc_get_order( $order_id );
492
 
493
  if ( is_a( $order, 'WC_Order' ) ) {
494
+ $stripe_params['billing_first_name'] = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->billing_first_name : $order->get_billing_first_name();
495
+ $stripe_params['billing_last_name'] = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->billing_last_name : $order->get_billing_last_name();
496
+ $stripe_params['billing_address_1'] = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->billing_address_1 : $order->get_billing_address_1();
497
+ $stripe_params['billing_address_2'] = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->billing_address_2 : $order->get_billing_address_2();
498
+ $stripe_params['billing_state'] = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->billing_state : $order->get_billing_state();
499
+ $stripe_params['billing_city'] = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->billing_city : $order->get_billing_city();
500
+ $stripe_params['billing_postcode'] = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->billing_postcode : $order->get_billing_postcode();
501
+ $stripe_params['billing_country'] = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->billing_country : $order->get_billing_country();
502
  }
503
  }
504
 
515
  $stripe_params['stripe_nonce'] = wp_create_nonce( '_wc_stripe_nonce' );
516
  $stripe_params['statement_descriptor'] = $this->statement_descriptor;
517
  $stripe_params['elements_options'] = apply_filters( 'wc_stripe_elements_options', array() );
518
+ $stripe_params['sepa_elements_options'] = apply_filters(
519
+ 'wc_stripe_sepa_elements_options',
520
+ array(
521
+ 'supportedCountries' => array( 'SEPA' ),
522
+ 'placeholderCountry' => WC()->countries->get_base_country(),
523
+ 'style' => array( 'base' => array( 'fontSize' => '15px' ) ),
524
+ )
525
+ );
526
  $stripe_params['invalid_owner_name'] = __( 'Billing First Name and Last Name are required.', 'woocommerce-gateway-stripe' );
527
  $stripe_params['is_stripe_checkout'] = $this->stripe_checkout ? 'yes' : 'no';
528
  $stripe_params['is_change_payment_page'] = isset( $_GET['change_payment_method'] ) ? 'yes' : 'no';
564
  if ( ! empty( $_GET['key'] ) ) {
565
  $order = wc_get_order( wc_get_order_id_by_order_key( wc_clean( $_GET['key'] ) ) );
566
  $total = $order->get_total();
567
+ $user_email = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->billing_email : $order->get_billing_email();
568
  } else {
569
  if ( $user->ID ) {
570
  $user_email = get_user_meta( $user->ID, 'billing_email', true );
580
  echo '<div
581
  id="stripe-payment-data"
582
  data-panel-label="' . esc_attr( apply_filters( 'wc_stripe_checkout_label', '' ) ) . '"
583
+ data-description="' . esc_attr( wp_strip_all_tags( $this->stripe_checkout_description ) ) . '"
584
  data-email="' . esc_attr( $user_email ) . '"
585
  data-verify-zip="' . esc_attr( apply_filters( 'wc_stripe_checkout_verify_zip', false ) ? 'true' : 'false' ) . '"
586
  data-billing-address="' . esc_attr( apply_filters( 'wc_stripe_checkout_require_billing_address', false ) ? 'true' : 'false' ) . '"
708
  $create_account = ! empty( $_POST['createaccount'] ) ? true : false;
709
 
710
  if ( $create_account ) {
711
+ $new_customer_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->customer_user : $order->get_customer_id();
712
  $new_stripe_customer = new WC_Stripe_Customer( $new_customer_id );
713
  $new_stripe_customer->create_customer();
714
  }
754
  }
755
 
756
  // Update order meta with 3DS source.
757
+ if ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ) {
758
  update_post_meta( $order_id, '_stripe_source_id', $response->id );
759
  } else {
760
  $order->update_meta_data( '_stripe_source_id', $response->id );
775
  } elseif ( 'not_required' === $response->redirect->status && 'chargeable' === $response->status ) {
776
  // Override the original source object with 3DS.
777
  $prepared_source->source_object = $response;
778
+ $prepared_source->source = $response->id;
779
  }
780
  }
781
 
794
  if ( ! empty( $response->error ) ) {
795
  // Customer param wrong? The user may have been deleted on stripe's end. Remove customer_id. Can be retried without.
796
  if ( $this->is_no_such_customer_error( $response->error ) ) {
797
+ if ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ) {
798
  delete_user_meta( $order->customer_user, '_stripe_customer_id' );
799
  delete_post_meta( $order_id, '_stripe_customer_id' );
800
  } else {
includes/class-wc-stripe-api.php CHANGED
@@ -14,7 +14,7 @@ class WC_Stripe_API {
14
  * Stripe API Endpoint
15
  */
16
  const ENDPOINT = 'https://api.stripe.com/v1/';
17
- const STRIPE_API_VERSION = '2018-09-06';
18
 
19
  /**
20
  * Secret API Key.
14
  * Stripe API Endpoint
15
  */
16
  const ENDPOINT = 'https://api.stripe.com/v1/';
17
+ const STRIPE_API_VERSION = '2018-09-24';
18
 
19
  /**
20
  * Secret API Key.
includes/class-wc-stripe-apple-pay-registration.php CHANGED
@@ -138,10 +138,13 @@ class WC_Stripe_Apple_Pay_Registration {
138
  'Authorization' => 'Bearer ' . $secret_key,
139
  );
140
 
141
- $response = wp_remote_post( $endpoint, array(
142
- 'headers' => $headers,
143
- 'body' => http_build_query( $data ),
144
- ) );
 
 
 
145
 
146
  if ( is_wp_error( $response ) ) {
147
  /* translators: error message */
@@ -193,7 +196,7 @@ class WC_Stripe_Apple_Pay_Registration {
193
 
194
  // No errors to this point, verification success!
195
  $this->stripe_settings['apple_pay_domain_set'] = 'yes';
196
- $this->apple_pay_domain_set = true;
197
 
198
  update_option( 'woocommerce_stripe_settings', $this->stripe_settings );
199
 
@@ -217,7 +220,7 @@ class WC_Stripe_Apple_Pay_Registration {
217
  if ( ! $this->stripe_enabled ) {
218
  return;
219
  }
220
-
221
  if ( ! current_user_can( 'manage_woocommerce' ) ) {
222
  return;
223
  }
@@ -225,7 +228,7 @@ class WC_Stripe_Apple_Pay_Registration {
225
  if ( $this->payment_request && ! empty( $this->apple_pay_verify_notice ) ) {
226
  $allowed_html = array(
227
  'a' => array(
228
- 'href' => array(),
229
  'title' => array(),
230
  ),
231
  );
138
  'Authorization' => 'Bearer ' . $secret_key,
139
  );
140
 
141
+ $response = wp_remote_post(
142
+ $endpoint,
143
+ array(
144
+ 'headers' => $headers,
145
+ 'body' => http_build_query( $data ),
146
+ )
147
+ );
148
 
149
  if ( is_wp_error( $response ) ) {
150
  /* translators: error message */
196
 
197
  // No errors to this point, verification success!
198
  $this->stripe_settings['apple_pay_domain_set'] = 'yes';
199
+ $this->apple_pay_domain_set = true;
200
 
201
  update_option( 'woocommerce_stripe_settings', $this->stripe_settings );
202
 
220
  if ( ! $this->stripe_enabled ) {
221
  return;
222
  }
223
+
224
  if ( ! current_user_can( 'manage_woocommerce' ) ) {
225
  return;
226
  }
228
  if ( $this->payment_request && ! empty( $this->apple_pay_verify_notice ) ) {
229
  $allowed_html = array(
230
  'a' => array(
231
+ 'href' => array(),
232
  'title' => array(),
233
  ),
234
  );
includes/class-wc-stripe-customer.php CHANGED
@@ -116,7 +116,7 @@ class WC_Stripe_Customer {
116
  $billing_last_name = get_user_meta( $user->ID, 'last_name', true );
117
  }
118
 
119
- $description = __( 'Name', 'woocommerce-gateway-stripe' ) . ': ' . $billing_first_name . ' ' . $billing_last_name . ' ' . __( 'Username', 'woocommerce-gateway-stripe' ) . ': ' . $user->user_login;
120
 
121
  $defaults = array(
122
  'email' => $user->user_email,
@@ -179,9 +179,12 @@ class WC_Stripe_Customer {
179
  $this->set_id( $this->create_customer() );
180
  }
181
 
182
- $response = WC_Stripe_API::request( array(
183
- 'source' => $source_id,
184
- ), 'customers/' . $this->get_id() . '/sources' );
 
 
 
185
 
186
  $wc_token = false;
187
 
@@ -259,9 +262,13 @@ class WC_Stripe_Customer {
259
 
260
  $sources = get_transient( 'stripe_sources_' . $this->get_id() );
261
 
262
- $response = WC_Stripe_API::request( array(
263
- 'limit' => 100,
264
- ), 'customers/' . $this->get_id() . '/sources', 'GET' );
 
 
 
 
265
 
266
  if ( ! empty( $response->error ) ) {
267
  return array();
@@ -301,9 +308,13 @@ class WC_Stripe_Customer {
301
  * @param string $source_id
302
  */
303
  public function set_default_source( $source_id ) {
304
- $response = WC_Stripe_API::request( array(
305
- 'default_source' => sanitize_text_field( $source_id ),
306
- ), 'customers/' . $this->get_id(), 'POST' );
 
 
 
 
307
 
308
  $this->clear_cache();
309
 
116
  $billing_last_name = get_user_meta( $user->ID, 'last_name', true );
117
  }
118
 
119
+ $description = __( 'Name', 'woocommerce-gateway-stripe' ) . ': ' . $billing_first_name . ' ' . $billing_last_name . ' ' . __( 'Username', 'woocommerce-gateway-stripe' ) . ': ' . $user->user_login;
120
 
121
  $defaults = array(
122
  'email' => $user->user_email,
179
  $this->set_id( $this->create_customer() );
180
  }
181
 
182
+ $response = WC_Stripe_API::request(
183
+ array(
184
+ 'source' => $source_id,
185
+ ),
186
+ 'customers/' . $this->get_id() . '/sources'
187
+ );
188
 
189
  $wc_token = false;
190
 
262
 
263
  $sources = get_transient( 'stripe_sources_' . $this->get_id() );
264
 
265
+ $response = WC_Stripe_API::request(
266
+ array(
267
+ 'limit' => 100,
268
+ ),
269
+ 'customers/' . $this->get_id() . '/sources',
270
+ 'GET'
271
+ );
272
 
273
  if ( ! empty( $response->error ) ) {
274
  return array();
308
  * @param string $source_id
309
  */
310
  public function set_default_source( $source_id ) {
311
+ $response = WC_Stripe_API::request(
312
+ array(
313
+ 'default_source' => sanitize_text_field( $source_id ),
314
+ ),
315
+ 'customers/' . $this->get_id(),
316
+ 'POST'
317
+ );
318
 
319
  $this->clear_cache();
320
 
includes/class-wc-stripe-exception.php CHANGED
@@ -8,7 +8,7 @@
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
- exit; // Exit if accessed directly
12
  }
13
 
14
  class WC_Stripe_Exception extends Exception {
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
+ exit;
12
  }
13
 
14
  class WC_Stripe_Exception extends Exception {
includes/class-wc-stripe-helper.php CHANGED
@@ -27,9 +27,9 @@ class WC_Stripe_Helper {
27
  return false;
28
  }
29
 
30
- $order_id = WC_Stripe_Helper::is_pre_30() ? $order->id : $order->get_id();
31
 
32
- return WC_Stripe_Helper::is_pre_30() ? get_post_meta( $order_id, self::META_NAME_STRIPE_CURRENCY, true ) : $order->get_meta( self::META_NAME_STRIPE_CURRENCY, true );
33
  }
34
 
35
  /**
@@ -44,9 +44,9 @@ class WC_Stripe_Helper {
44
  return false;
45
  }
46
 
47
- $order_id = WC_Stripe_Helper::is_pre_30() ? $order->id : $order->get_id();
48
 
49
- WC_Stripe_Helper::is_pre_30() ? update_post_meta( $order_id, self::META_NAME_STRIPE_CURRENCY, $currency ) : $order->update_meta_data( self::META_NAME_STRIPE_CURRENCY, $currency );
50
  }
51
 
52
  /**
@@ -61,13 +61,13 @@ class WC_Stripe_Helper {
61
  return false;
62
  }
63
 
64
- $order_id = WC_Stripe_Helper::is_pre_30() ? $order->id : $order->get_id();
65
 
66
- $amount = WC_Stripe_Helper::is_pre_30() ? get_post_meta( $order_id, self::META_NAME_FEE, true ) : $order->get_meta( self::META_NAME_FEE, true );
67
 
68
  // If not found let's check for legacy name.
69
  if ( empty( $amount ) ) {
70
- $amount = WC_Stripe_Helper::is_pre_30() ? get_post_meta( $order_id, self::LEGACY_META_NAME_FEE, true ) : $order->get_meta( self::LEGACY_META_NAME_FEE, true );
71
 
72
  // If found update to new name.
73
  if ( $amount ) {
@@ -90,9 +90,9 @@ class WC_Stripe_Helper {
90
  return false;
91
  }
92
 
93
- $order_id = WC_Stripe_Helper::is_pre_30() ? $order->id : $order->get_id();
94
 
95
- WC_Stripe_Helper::is_pre_30() ? update_post_meta( $order_id, self::META_NAME_FEE, $amount ) : $order->update_meta_data( self::META_NAME_FEE, $amount );
96
  }
97
 
98
  /**
@@ -106,7 +106,7 @@ class WC_Stripe_Helper {
106
  return false;
107
  }
108
 
109
- $order_id = WC_Stripe_Helper::is_pre_30() ? $order->id : $order->get_id();
110
 
111
  delete_post_meta( $order_id, self::META_NAME_FEE );
112
  delete_post_meta( $order_id, self::LEGACY_META_NAME_FEE );
@@ -124,13 +124,13 @@ class WC_Stripe_Helper {
124
  return false;
125
  }
126
 
127
- $order_id = WC_Stripe_Helper::is_pre_30() ? $order->id : $order->get_id();
128
 
129
- $amount = WC_Stripe_Helper::is_pre_30() ? get_post_meta( $order_id, self::META_NAME_NET, true ) : $order->get_meta( self::META_NAME_NET, true );
130
 
131
  // If not found let's check for legacy name.
132
  if ( empty( $amount ) ) {
133
- $amount = WC_Stripe_Helper::is_pre_30() ? get_post_meta( $order_id, self::LEGACY_META_NAME_NET, true ) : $order->get_meta( self::LEGACY_META_NAME_NET, true );
134
 
135
  // If found update to new name.
136
  if ( $amount ) {
@@ -153,9 +153,9 @@ class WC_Stripe_Helper {
153
  return false;
154
  }
155
 
156
- $order_id = WC_Stripe_Helper::is_pre_30() ? $order->id : $order->get_id();
157
 
158
- WC_Stripe_Helper::is_pre_30() ? update_post_meta( $order_id, self::META_NAME_NET, $amount ) : $order->update_meta_data( self::META_NAME_NET, $amount );
159
  }
160
 
161
  /**
@@ -169,7 +169,7 @@ class WC_Stripe_Helper {
169
  return false;
170
  }
171
 
172
- $order_id = WC_Stripe_Helper::is_pre_30() ? $order->id : $order->get_id();
173
 
174
  delete_post_meta( $order_id, self::META_NAME_NET );
175
  delete_post_meta( $order_id, self::LEGACY_META_NAME_NET );
@@ -203,25 +203,28 @@ class WC_Stripe_Helper {
203
  * @return array
204
  */
205
  public static function get_localized_messages() {
206
- return apply_filters( 'wc_stripe_localized_messages', array(
207
- 'invalid_number' => __( 'The card number is not a valid credit card number.', 'woocommerce-gateway-stripe' ),
208
- 'invalid_expiry_month' => __( 'The card\'s expiration month is invalid.', 'woocommerce-gateway-stripe' ),
209
- 'invalid_expiry_year' => __( 'The card\'s expiration year is invalid.', 'woocommerce-gateway-stripe' ),
210
- 'invalid_cvc' => __( 'The card\'s security code is invalid.', 'woocommerce-gateway-stripe' ),
211
- 'incorrect_number' => __( 'The card number is incorrect.', 'woocommerce-gateway-stripe' ),
212
- 'incomplete_number' => __( 'The card number is incomplete.', 'woocommerce-gateway-stripe' ),
213
- 'incomplete_cvc' => __( 'The card\'s security code is incomplete.', 'woocommerce-gateway-stripe' ),
214
- 'incomplete_expiry' => __( 'The card\'s expiration date is incomplete.', 'woocommerce-gateway-stripe' ),
215
- 'expired_card' => __( 'The card has expired.', 'woocommerce-gateway-stripe' ),
216
- 'incorrect_cvc' => __( 'The card\'s security code is incorrect.', 'woocommerce-gateway-stripe' ),
217
- 'incorrect_zip' => __( 'The card\'s zip code failed validation.', 'woocommerce-gateway-stripe' ),
218
- 'invalid_expiry_year_past' => __( 'The card\'s expiration year is in the past', 'woocommerce-gateway-stripe' ),
219
- 'card_declined' => __( 'The card was declined.', 'woocommerce-gateway-stripe' ),
220
- 'missing' => __( 'There is no card on a customer that is being charged.', 'woocommerce-gateway-stripe' ),
221
- 'processing_error' => __( 'An error occurred while processing the card.', 'woocommerce-gateway-stripe' ),
222
- 'invalid_request_error' => __( 'Unable to process this payment, please try again or use alternative method.', 'woocommerce-gateway-stripe' ),
223
- 'invalid_sofort_country' => __( 'The billing country is not accepted by SOFORT. Please try another country.', 'woocommerce-gateway-stripe' ),
224
- ) );
 
 
 
225
  }
226
 
227
  /**
@@ -351,12 +354,26 @@ class WC_Stripe_Helper {
351
  /**
352
  * Check if WC version is pre 3.0.
353
  *
 
354
  * @since 4.0.0
355
- * @version 4.0.0
356
  * @return bool
357
  */
358
  public static function is_pre_30() {
359
- return version_compare( WC_VERSION, '3.0.0', '<' );
 
 
 
 
 
 
 
 
 
 
 
 
 
360
  }
361
 
362
  /**
27
  return false;
28
  }
29
 
30
+ $order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();
31
 
32
+ return WC_Stripe_Helper::is_wc_lt( '3.0' ) ? get_post_meta( $order_id, self::META_NAME_STRIPE_CURRENCY, true ) : $order->get_meta( self::META_NAME_STRIPE_CURRENCY, true );
33
  }
34
 
35
  /**
44
  return false;
45
  }
46
 
47
+ $order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();
48
 
49
+ WC_Stripe_Helper::is_wc_lt( '3.0' ) ? update_post_meta( $order_id, self::META_NAME_STRIPE_CURRENCY, $currency ) : $order->update_meta_data( self::META_NAME_STRIPE_CURRENCY, $currency );
50
  }
51
 
52
  /**
61
  return false;
62
  }
63
 
64
+ $order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();
65
 
66
+ $amount = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? get_post_meta( $order_id, self::META_NAME_FEE, true ) : $order->get_meta( self::META_NAME_FEE, true );
67
 
68
  // If not found let's check for legacy name.
69
  if ( empty( $amount ) ) {
70
+ $amount = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? get_post_meta( $order_id, self::LEGACY_META_NAME_FEE, true ) : $order->get_meta( self::LEGACY_META_NAME_FEE, true );
71
 
72
  // If found update to new name.
73
  if ( $amount ) {
90
  return false;
91
  }
92
 
93
+ $order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();
94
 
95
+ WC_Stripe_Helper::is_wc_lt( '3.0' ) ? update_post_meta( $order_id, self::META_NAME_FEE, $amount ) : $order->update_meta_data( self::META_NAME_FEE, $amount );
96
  }
97
 
98
  /**
106
  return false;
107
  }
108
 
109
+ $order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();
110
 
111
  delete_post_meta( $order_id, self::META_NAME_FEE );
112
  delete_post_meta( $order_id, self::LEGACY_META_NAME_FEE );
124
  return false;
125
  }
126
 
127
+ $order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();
128
 
129
+ $amount = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? get_post_meta( $order_id, self::META_NAME_NET, true ) : $order->get_meta( self::META_NAME_NET, true );
130
 
131
  // If not found let's check for legacy name.
132
  if ( empty( $amount ) ) {
133
+ $amount = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? get_post_meta( $order_id, self::LEGACY_META_NAME_NET, true ) : $order->get_meta( self::LEGACY_META_NAME_NET, true );
134
 
135
  // If found update to new name.
136
  if ( $amount ) {
153
  return false;
154
  }
155
 
156
+ $order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();
157
 
158
+ WC_Stripe_Helper::is_wc_lt( '3.0' ) ? update_post_meta( $order_id, self::META_NAME_NET, $amount ) : $order->update_meta_data( self::META_NAME_NET, $amount );
159
  }
160
 
161
  /**
169
  return false;
170
  }
171
 
172
+ $order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();
173
 
174
  delete_post_meta( $order_id, self::META_NAME_NET );
175
  delete_post_meta( $order_id, self::LEGACY_META_NAME_NET );
203
  * @return array
204
  */
205
  public static function get_localized_messages() {
206
+ return apply_filters(
207
+ 'wc_stripe_localized_messages',
208
+ array(
209
+ 'invalid_number' => __( 'The card number is not a valid credit card number.', 'woocommerce-gateway-stripe' ),
210
+ 'invalid_expiry_month' => __( 'The card\'s expiration month is invalid.', 'woocommerce-gateway-stripe' ),
211
+ 'invalid_expiry_year' => __( 'The card\'s expiration year is invalid.', 'woocommerce-gateway-stripe' ),
212
+ 'invalid_cvc' => __( 'The card\'s security code is invalid.', 'woocommerce-gateway-stripe' ),
213
+ 'incorrect_number' => __( 'The card number is incorrect.', 'woocommerce-gateway-stripe' ),
214
+ 'incomplete_number' => __( 'The card number is incomplete.', 'woocommerce-gateway-stripe' ),
215
+ 'incomplete_cvc' => __( 'The card\'s security code is incomplete.', 'woocommerce-gateway-stripe' ),
216
+ 'incomplete_expiry' => __( 'The card\'s expiration date is incomplete.', 'woocommerce-gateway-stripe' ),
217
+ 'expired_card' => __( 'The card has expired.', 'woocommerce-gateway-stripe' ),
218
+ 'incorrect_cvc' => __( 'The card\'s security code is incorrect.', 'woocommerce-gateway-stripe' ),
219
+ 'incorrect_zip' => __( 'The card\'s zip code failed validation.', 'woocommerce-gateway-stripe' ),
220
+ 'invalid_expiry_year_past' => __( 'The card\'s expiration year is in the past', 'woocommerce-gateway-stripe' ),
221
+ 'card_declined' => __( 'The card was declined.', 'woocommerce-gateway-stripe' ),
222
+ 'missing' => __( 'There is no card on a customer that is being charged.', 'woocommerce-gateway-stripe' ),
223
+ 'processing_error' => __( 'An error occurred while processing the card.', 'woocommerce-gateway-stripe' ),
224
+ 'invalid_request_error' => __( 'Unable to process this payment, please try again or use alternative method.', 'woocommerce-gateway-stripe' ),
225
+ 'invalid_sofort_country' => __( 'The billing country is not accepted by SOFORT. Please try another country.', 'woocommerce-gateway-stripe' ),
226
+ )
227
+ );
228
  }
229
 
230
  /**
354
  /**
355
  * Check if WC version is pre 3.0.
356
  *
357
+ * @todo Remove in the future.
358
  * @since 4.0.0
359
+ * @deprecated 4.1.11
360
  * @return bool
361
  */
362
  public static function is_pre_30() {
363
+ error_log( 'is_pre_30() function has been deprecated since 4.1.11. Please use is_wc_lt( $version ) instead.' );
364
+
365
+ return self::is_wc_lt( '3.0' );
366
+ }
367
+
368
+ /**
369
+ * Checks if WC version is less than passed in version.
370
+ *
371
+ * @since 4.1.11
372
+ * @param string $version Version to check against.
373
+ * @return bool
374
+ */
375
+ public static function is_wc_lt( $version ) {
376
+ return version_compare( WC_VERSION, $version, '<' );
377
  }
378
 
379
  /**
includes/class-wc-stripe-logger.php CHANGED
@@ -27,10 +27,10 @@ class WC_Stripe_Logger {
27
 
28
  if ( apply_filters( 'wc_stripe_logging', true, $message ) ) {
29
  if ( empty( self::$logger ) ) {
30
- if ( version_compare( WC_VERSION, '3.0.0', '>=' ) ) {
31
- self::$logger = wc_get_logger();
32
- } else {
33
  self::$logger = new WC_Logger();
 
 
34
  }
35
  }
36
 
@@ -47,20 +47,20 @@ class WC_Stripe_Logger {
47
  $formatted_end_time = date_i18n( get_option( 'date_format' ) . ' g:ia', $end_time );
48
  $elapsed_time = round( abs( $end_time - $start_time ) / 60, 2 );
49
 
50
- $log_entry = "\n" . '====Stripe Version: ' . WC_STRIPE_VERSION . '====' . "\n";
51
  $log_entry .= '====Start Log ' . $formatted_start_time . '====' . "\n" . $message . "\n";
52
  $log_entry .= '====End Log ' . $formatted_end_time . ' (' . $elapsed_time . ')====' . "\n\n";
53
 
54
  } else {
55
- $log_entry = "\n" . '====Stripe Version: ' . WC_STRIPE_VERSION . '====' . "\n";
56
  $log_entry .= '====Start Log====' . "\n" . $message . "\n" . '====End Log====' . "\n\n";
57
 
58
  }
59
 
60
- if ( version_compare( WC_VERSION, '3.0.0', '>=' ) ) {
61
- self::$logger->debug( $log_entry, array( 'source' => self::WC_LOG_FILENAME ) );
62
- } else {
63
  self::$logger->add( self::WC_LOG_FILENAME, $log_entry );
 
 
64
  }
65
  }
66
  }
27
 
28
  if ( apply_filters( 'wc_stripe_logging', true, $message ) ) {
29
  if ( empty( self::$logger ) ) {
30
+ if ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ) {
 
 
31
  self::$logger = new WC_Logger();
32
+ } else {
33
+ self::$logger = wc_get_logger();
34
  }
35
  }
36
 
47
  $formatted_end_time = date_i18n( get_option( 'date_format' ) . ' g:ia', $end_time );
48
  $elapsed_time = round( abs( $end_time - $start_time ) / 60, 2 );
49
 
50
+ $log_entry = "\n" . '====Stripe Version: ' . WC_STRIPE_VERSION . '====' . "\n";
51
  $log_entry .= '====Start Log ' . $formatted_start_time . '====' . "\n" . $message . "\n";
52
  $log_entry .= '====End Log ' . $formatted_end_time . ' (' . $elapsed_time . ')====' . "\n\n";
53
 
54
  } else {
55
+ $log_entry = "\n" . '====Stripe Version: ' . WC_STRIPE_VERSION . '====' . "\n";
56
  $log_entry .= '====Start Log====' . "\n" . $message . "\n" . '====End Log====' . "\n\n";
57
 
58
  }
59
 
60
+ if ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ) {
 
 
61
  self::$logger->add( self::WC_LOG_FILENAME, $log_entry );
62
+ } else {
63
+ self::$logger->debug( $log_entry, array( 'source' => self::WC_LOG_FILENAME ) );
64
  }
65
  }
66
  }
includes/class-wc-stripe-order-handler.php CHANGED
@@ -127,7 +127,7 @@ class WC_Stripe_Order_Handler extends WC_Stripe_Payment_Gateway {
127
  if ( ! empty( $response->error ) ) {
128
  // Customer param wrong? The user may have been deleted on stripe's end. Remove customer_id. Can be retried without.
129
  if ( $this->is_no_such_customer_error( $response->error ) ) {
130
- if ( WC_Stripe_Helper::is_pre_30() ) {
131
  delete_user_meta( $order->customer_user, '_stripe_customer_id' );
132
  delete_post_meta( $order_id, '_stripe_customer_id' );
133
  } else {
@@ -225,9 +225,10 @@ class WC_Stripe_Order_Handler extends WC_Stripe_Payment_Gateway {
225
  public function capture_payment( $order_id ) {
226
  $order = wc_get_order( $order_id );
227
 
228
- if ( 'stripe' === ( WC_Stripe_Helper::is_pre_30() ? $order->payment_method : $order->get_payment_method() ) ) {
229
- $charge = WC_Stripe_Helper::is_pre_30() ? get_post_meta( $order_id, '_transaction_id', true ) : $order->get_transaction_id();
230
- $captured = WC_Stripe_Helper::is_pre_30() ? get_post_meta( $order_id, '_stripe_charge_captured', true ) : $order->get_meta( '_stripe_charge_captured', true );
 
231
 
232
  if ( $charge && 'no' === $captured ) {
233
  $order_total = $order->get_total();
@@ -236,38 +237,40 @@ class WC_Stripe_Order_Handler extends WC_Stripe_Payment_Gateway {
236
  $order_total = $order_total - $order->get_total_refunded();
237
  }
238
 
239
- $result = WC_Stripe_API::request( array(
240
- 'amount' => WC_Stripe_Helper::get_stripe_amount( $order_total ),
241
- 'expand[]' => 'balance_transaction',
242
- ), 'charges/' . $charge . '/capture' );
243
 
244
  if ( ! empty( $result->error ) ) {
245
  /* translators: error message */
246
- $order->update_status( 'failed', sprintf( __( 'Unable to capture charge! %s', 'woocommerce-gateway-stripe' ), $result->error->message ) );
247
- } else {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
248
  /* translators: transaction id */
249
  $order->add_order_note( sprintf( __( 'Stripe charge complete (Charge ID: %s)', 'woocommerce-gateway-stripe' ), $result->id ) );
250
- WC_Stripe_Helper::is_pre_30() ? update_post_meta( $order_id, '_stripe_charge_captured', 'yes' ) : $order->update_meta_data( '_stripe_charge_captured', 'yes' );
251
 
252
  // Store other data such as fees
253
- WC_Stripe_Helper::is_pre_30() ? update_post_meta( $order_id, '_transaction_id', $result->id ) : $order->set_transaction_id( $result->id );
254
-
255
- if ( isset( $result->balance_transaction ) && isset( $result->balance_transaction->fee ) ) {
256
- // Fees and Net needs to both come from Stripe to be accurate as the returned
257
- // values are in the local currency of the Stripe account, not from WC.
258
- $fee = ! empty( $result->balance_transaction->fee ) ? WC_Stripe_Helper::format_balance_fee( $result->balance_transaction, 'fee' ) : 0;
259
- $net = ! empty( $result->balance_transaction->net ) ? WC_Stripe_Helper::format_balance_fee( $result->balance_transaction, 'net' ) : 0;
260
- WC_Stripe_Helper::update_stripe_fee( $order, $fee );
261
- WC_Stripe_Helper::update_stripe_net( $order, $net );
262
-
263
- // Store currency stripe.
264
- $currency = ! empty( $result->balance_transaction->currency ) ? strtoupper( $result->balance_transaction->currency ) : null;
265
- WC_Stripe_Helper::update_stripe_currency( $order, $currency );
266
- }
267
 
268
- if ( is_callable( array( $order, 'save' ) ) ) {
269
- $order->save();
270
- }
271
  }
272
 
273
  // This hook fires when admin manually changes order status to processing or completed.
@@ -286,7 +289,7 @@ class WC_Stripe_Order_Handler extends WC_Stripe_Payment_Gateway {
286
  public function cancel_payment( $order_id ) {
287
  $order = wc_get_order( $order_id );
288
 
289
- if ( 'stripe' === ( WC_Stripe_Helper::is_pre_30() ? $order->payment_method : $order->get_payment_method() ) ) {
290
  $this->process_refund( $order_id );
291
 
292
  // This hook fires when admin manually changes order status to cancel.
127
  if ( ! empty( $response->error ) ) {
128
  // Customer param wrong? The user may have been deleted on stripe's end. Remove customer_id. Can be retried without.
129
  if ( $this->is_no_such_customer_error( $response->error ) ) {
130
+ if ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ) {
131
  delete_user_meta( $order->customer_user, '_stripe_customer_id' );
132
  delete_post_meta( $order_id, '_stripe_customer_id' );
133
  } else {
225
  public function capture_payment( $order_id ) {
226
  $order = wc_get_order( $order_id );
227
 
228
+ if ( 'stripe' === ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->payment_method : $order->get_payment_method() ) ) {
229
+ $charge = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? get_post_meta( $order_id, '_transaction_id', true ) : $order->get_transaction_id();
230
+ $captured = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? get_post_meta( $order_id, '_stripe_charge_captured', true ) : $order->get_meta( '_stripe_charge_captured', true );
231
+ $is_stripe_captured = false;
232
 
233
  if ( $charge && 'no' === $captured ) {
234
  $order_total = $order->get_total();
237
  $order_total = $order_total - $order->get_total_refunded();
238
  }
239
 
240
+ // First retrieve charge to see if it has been captured.
241
+ $result = WC_Stripe_API::retrieve( 'charges/' . $charge );
 
 
242
 
243
  if ( ! empty( $result->error ) ) {
244
  /* translators: error message */
245
+ $order->add_order_note( sprintf( __( 'Unable to capture charge! %s', 'woocommerce-gateway-stripe' ), $result->error->message ) );
246
+ } elseif ( false === $result->captured ) {
247
+ $result = WC_Stripe_API::request(
248
+ array(
249
+ 'amount' => WC_Stripe_Helper::get_stripe_amount( $order_total ),
250
+ 'expand[]' => 'balance_transaction',
251
+ ),
252
+ 'charges/' . $charge . '/capture'
253
+ );
254
+
255
+ if ( ! empty( $result->error ) ) {
256
+ /* translators: error message */
257
+ $order->update_status( 'failed', sprintf( __( 'Unable to capture charge! %s', 'woocommerce-gateway-stripe' ), $result->error->message ) );
258
+ } else {
259
+ $is_stripe_captured = true;
260
+ }
261
+ } elseif ( true === $result->captured ) {
262
+ $is_stripe_captured = true;
263
+ }
264
+
265
+ if ( $is_stripe_captured ) {
266
  /* translators: transaction id */
267
  $order->add_order_note( sprintf( __( 'Stripe charge complete (Charge ID: %s)', 'woocommerce-gateway-stripe' ), $result->id ) );
268
+ WC_Stripe_Helper::is_wc_lt( '3.0' ) ? update_post_meta( $order_id, '_stripe_charge_captured', 'yes' ) : $order->update_meta_data( '_stripe_charge_captured', 'yes' );
269
 
270
  // Store other data such as fees
271
+ WC_Stripe_Helper::is_wc_lt( '3.0' ) ? update_post_meta( $order_id, '_transaction_id', $result->id ) : $order->set_transaction_id( $result->id );
 
 
 
 
 
 
 
 
 
 
 
 
 
272
 
273
+ $this->update_fees( $order, $result->balance_transaction );
 
 
274
  }
275
 
276
  // This hook fires when admin manually changes order status to processing or completed.
289
  public function cancel_payment( $order_id ) {
290
  $order = wc_get_order( $order_id );
291
 
292
+ if ( 'stripe' === ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->payment_method : $order->get_payment_method() ) ) {
293
  $this->process_refund( $order_id );
294
 
295
  // This hook fires when admin manually changes order status to cancel.
includes/class-wc-stripe-sepa-payment-token.php CHANGED
@@ -86,7 +86,7 @@ class WC_Payment_Token_SEPA extends WC_Payment_Token {
86
  * @return string Last 4 digits
87
  */
88
  public function get_last4( $context = 'view' ) {
89
- return WC_Stripe_Helper::is_pre_30() ? $this->get_meta( 'last4' ) : $this->get_prop( 'last4', $context );
90
  }
91
 
92
  /**
@@ -96,6 +96,6 @@ class WC_Payment_Token_SEPA extends WC_Payment_Token {
96
  * @param string $last4
97
  */
98
  public function set_last4( $last4 ) {
99
- WC_Stripe_Helper::is_pre_30() ? $this->add_meta_data( 'last4', $last4, true ) : $this->set_prop( 'last4', $last4 );
100
  }
101
  }
86
  * @return string Last 4 digits
87
  */
88
  public function get_last4( $context = 'view' ) {
89
+ return WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $this->get_meta( 'last4' ) : $this->get_prop( 'last4', $context );
90
  }
91
 
92
  /**
96
  * @param string $last4
97
  */
98
  public function set_last4( $last4 ) {
99
+ WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $this->add_meta_data( 'last4', $last4, true ) : $this->set_prop( 'last4', $last4 );
100
  }
101
  }
includes/class-wc-stripe-webhook-handler.php CHANGED
@@ -134,7 +134,7 @@ class WC_Stripe_Webhook_Handler extends WC_Stripe_Payment_Gateway {
134
  return;
135
  }
136
 
137
- $order_id = WC_Stripe_Helper::is_pre_30() ? $order->id : $order->get_id();
138
  $source_id = $notification->data->object->id;
139
 
140
  $is_pending_receiver = ( 'receiver' === $notification->data->object->flow );
@@ -170,7 +170,7 @@ class WC_Stripe_Webhook_Handler extends WC_Stripe_Payment_Gateway {
170
  if ( ! empty( $response->error ) ) {
171
  // Customer param wrong? The user may have been deleted on stripe's end. Remove customer_id. Can be retried without.
172
  if ( $this->is_no_such_customer_error( $response->error ) ) {
173
- if ( WC_Stripe_Helper::is_pre_30() ) {
174
  delete_user_meta( $order->customer_user, '_stripe_customer_id' );
175
  delete_post_meta( $order_id, '_stripe_customer_id' );
176
  } else {
@@ -265,7 +265,7 @@ class WC_Stripe_Webhook_Handler extends WC_Stripe_Payment_Gateway {
265
 
266
  do_action( 'wc_gateway_stripe_process_webhook_payment_error', $order, $notification );
267
 
268
- $order_id = WC_Stripe_Helper::is_pre_30() ? $order->id : $order->get_id();
269
  $this->send_failed_order_email( $order_id );
270
  }
271
 
@@ -285,17 +285,17 @@ class WC_Stripe_Webhook_Handler extends WC_Stripe_Payment_Gateway {
285
  return;
286
  }
287
 
288
- $order_id = WC_Stripe_Helper::is_pre_30() ? $order->id : $order->get_id();
289
 
290
- if ( 'stripe' === ( WC_Stripe_Helper::is_pre_30() ? $order->payment_method : $order->get_payment_method() ) ) {
291
- $charge = WC_Stripe_Helper::is_pre_30() ? get_post_meta( $order_id, '_transaction_id', true ) : $order->get_transaction_id();
292
- $captured = WC_Stripe_Helper::is_pre_30() ? get_post_meta( $order_id, '_stripe_charge_captured', true ) : $order->get_meta( '_stripe_charge_captured', true );
293
 
294
  if ( $charge && 'no' === $captured ) {
295
- WC_Stripe_Helper::is_pre_30() ? update_post_meta( $order_id, '_stripe_charge_captured', 'yes' ) : $order->update_meta_data( '_stripe_charge_captured', 'yes' );
296
 
297
  // Store other data such as fees
298
- WC_Stripe_Helper::is_pre_30() ? update_post_meta( $order_id, '_transaction_id', $notification->data->object->id ) : $order->set_transaction_id( $notification->data->object->id );
299
 
300
  if ( isset( $notification->data->object->balance_transaction ) ) {
301
  $this->update_fees( $order, $notification->data->object->balance_transaction );
@@ -342,18 +342,17 @@ class WC_Stripe_Webhook_Handler extends WC_Stripe_Payment_Gateway {
342
  return;
343
  }
344
 
345
- $order_id = WC_Stripe_Helper::is_pre_30() ? $order->id : $order->get_id();
346
 
347
  if ( 'on-hold' !== $order->get_status() ) {
348
  return;
349
  }
350
 
351
  // Store other data such as fees
352
- WC_Stripe_Helper::is_pre_30() ? update_post_meta( $order_id, '_transaction_id', $notification->data->object->id ) : $order->set_transaction_id( $notification->data->object->id );
353
 
354
  if ( isset( $notification->data->object->balance_transaction ) ) {
355
  $this->update_fees( $order, $notification->data->object->balance_transaction );
356
- $this->update_currency( $order, $notification->data->object->balance_transaction );
357
  }
358
 
359
  $order->payment_complete( $notification->data->object->id );
@@ -381,7 +380,7 @@ class WC_Stripe_Webhook_Handler extends WC_Stripe_Payment_Gateway {
381
  return;
382
  }
383
 
384
- $order_id = WC_Stripe_Helper::is_pre_30() ? $order->id : $order->get_id();
385
 
386
  // If order status is already in failed status don't continue.
387
  if ( 'failed' === $order->get_status() ) {
@@ -404,18 +403,19 @@ class WC_Stripe_Webhook_Handler extends WC_Stripe_Payment_Gateway {
404
  public function process_webhook_source_canceled( $notification ) {
405
  $order = WC_Stripe_Helper::get_order_by_charge_id( $notification->data->object->id );
406
 
 
407
  if ( ! $order ) {
408
- WC_Stripe_Logger::log( 'Could not find order via charge ID: ' . $notification->data->object->id );
409
- return;
410
- }
411
-
412
- $order_id = WC_Stripe_Helper::is_pre_30() ? $order->id : $order->get_id();
413
 
414
- if ( 'on-hold' !== $order->get_status() || 'cancelled' !== $order->get_status() ) {
415
- return;
 
 
416
  }
417
 
418
- $order->update_status( 'cancelled', __( 'This payment has cancelled.', 'woocommerce-gateway-stripe' ) );
 
 
419
 
420
  do_action( 'wc_gateway_stripe_process_webhook_payment_error', $order, $notification );
421
  }
@@ -435,12 +435,12 @@ class WC_Stripe_Webhook_Handler extends WC_Stripe_Payment_Gateway {
435
  return;
436
  }
437
 
438
- $order_id = WC_Stripe_Helper::is_pre_30() ? $order->id : $order->get_id();
439
 
440
- if ( 'stripe' === ( WC_Stripe_Helper::is_pre_30() ? $order->payment_method : $order->get_payment_method() ) ) {
441
- $charge = WC_Stripe_Helper::is_pre_30() ? get_post_meta( $order_id, '_transaction_id', true ) : $order->get_transaction_id();
442
- $captured = WC_Stripe_Helper::is_pre_30() ? get_post_meta( $order_id, '_stripe_charge_captured', true ) : $order->get_meta( '_stripe_charge_captured', true );
443
- $refund_id = WC_Stripe_Helper::is_pre_30() ? get_post_meta( $order_id, '_stripe_refund_id', true ) : $order->get_meta( '_stripe_refund_id', true );
444
 
445
  // If the refund ID matches, don't continue to prevent double refunding.
446
  if ( $notification->data->object->refunds->data[0]->id === $refund_id ) {
@@ -452,21 +452,23 @@ class WC_Stripe_Webhook_Handler extends WC_Stripe_Payment_Gateway {
452
  $reason = ( isset( $captured ) && 'yes' === $captured ) ? __( 'Refunded via Stripe Dashboard', 'woocommerce-gateway-stripe' ) : __( 'Pre-Authorization Released via Stripe Dashboard', 'woocommerce-gateway-stripe' );
453
 
454
  // Create the refund.
455
- $refund = wc_create_refund( array(
456
- 'order_id' => $order_id,
457
- 'amount' => $this->get_refund_amount( $notification ),
458
- 'reason' => $reason,
459
- ) );
 
 
460
 
461
  if ( is_wp_error( $refund ) ) {
462
  WC_Stripe_Logger::log( $refund->get_error_message() );
463
  }
464
 
465
- WC_Stripe_Helper::is_pre_30() ? update_post_meta( $order_id, '_stripe_refund_id', $notification->data->object->refunds->data[0]->id ) : $order->update_meta_data( '_stripe_refund_id', $notification->data->object->refunds->data[0]->id );
466
 
467
  $amount = wc_price( $notification->data->object->refunds->data[0]->amount / 100 );
468
 
469
- if ( in_array( strtolower( WC_Stripe_Helper::is_pre_30() ? $order->get_order_currency() : $order->get_currency() ), WC_Stripe_Helper::no_decimal_currencies() ) ) {
470
  $amount = wc_price( $notification->data->object->refunds->data[0]->amount );
471
  }
472
 
134
  return;
135
  }
136
 
137
+ $order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();
138
  $source_id = $notification->data->object->id;
139
 
140
  $is_pending_receiver = ( 'receiver' === $notification->data->object->flow );
170
  if ( ! empty( $response->error ) ) {
171
  // Customer param wrong? The user may have been deleted on stripe's end. Remove customer_id. Can be retried without.
172
  if ( $this->is_no_such_customer_error( $response->error ) ) {
173
+ if ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ) {
174
  delete_user_meta( $order->customer_user, '_stripe_customer_id' );
175
  delete_post_meta( $order_id, '_stripe_customer_id' );
176
  } else {
265
 
266
  do_action( 'wc_gateway_stripe_process_webhook_payment_error', $order, $notification );
267
 
268
+ $order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();
269
  $this->send_failed_order_email( $order_id );
270
  }
271
 
285
  return;
286
  }
287
 
288
+ $order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();
289
 
290
+ if ( 'stripe' === ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->payment_method : $order->get_payment_method() ) ) {
291
+ $charge = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? get_post_meta( $order_id, '_transaction_id', true ) : $order->get_transaction_id();
292
+ $captured = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? get_post_meta( $order_id, '_stripe_charge_captured', true ) : $order->get_meta( '_stripe_charge_captured', true );
293
 
294
  if ( $charge && 'no' === $captured ) {
295
+ WC_Stripe_Helper::is_wc_lt( '3.0' ) ? update_post_meta( $order_id, '_stripe_charge_captured', 'yes' ) : $order->update_meta_data( '_stripe_charge_captured', 'yes' );
296
 
297
  // Store other data such as fees
298
+ WC_Stripe_Helper::is_wc_lt( '3.0' ) ? update_post_meta( $order_id, '_transaction_id', $notification->data->object->id ) : $order->set_transaction_id( $notification->data->object->id );
299
 
300
  if ( isset( $notification->data->object->balance_transaction ) ) {
301
  $this->update_fees( $order, $notification->data->object->balance_transaction );
342
  return;
343
  }
344
 
345
+ $order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();
346
 
347
  if ( 'on-hold' !== $order->get_status() ) {
348
  return;
349
  }
350
 
351
  // Store other data such as fees
352
+ WC_Stripe_Helper::is_wc_lt( '3.0' ) ? update_post_meta( $order_id, '_transaction_id', $notification->data->object->id ) : $order->set_transaction_id( $notification->data->object->id );
353
 
354
  if ( isset( $notification->data->object->balance_transaction ) ) {
355
  $this->update_fees( $order, $notification->data->object->balance_transaction );
 
356
  }
357
 
358
  $order->payment_complete( $notification->data->object->id );
380
  return;
381
  }
382
 
383
+ $order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();
384
 
385
  // If order status is already in failed status don't continue.
386
  if ( 'failed' === $order->get_status() ) {
403
  public function process_webhook_source_canceled( $notification ) {
404
  $order = WC_Stripe_Helper::get_order_by_charge_id( $notification->data->object->id );
405
 
406
+ // If can't find order by charge ID, try source ID.
407
  if ( ! $order ) {
408
+ $order = WC_Stripe_Helper::get_order_by_source_id( $notification->data->object->id );
 
 
 
 
409
 
410
+ if ( ! $order ) {
411
+ WC_Stripe_Logger::log( 'Could not find order via charge/source ID: ' . $notification->data->object->id );
412
+ return;
413
+ }
414
  }
415
 
416
+ if ( 'cancelled' !== $order->get_status() ) {
417
+ $order->update_status( 'cancelled', __( 'This payment has cancelled.', 'woocommerce-gateway-stripe' ) );
418
+ }
419
 
420
  do_action( 'wc_gateway_stripe_process_webhook_payment_error', $order, $notification );
421
  }
435
  return;
436
  }
437
 
438
+ $order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();
439
 
440
+ if ( 'stripe' === ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->payment_method : $order->get_payment_method() ) ) {
441
+ $charge = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? get_post_meta( $order_id, '_transaction_id', true ) : $order->get_transaction_id();
442
+ $captured = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? get_post_meta( $order_id, '_stripe_charge_captured', true ) : $order->get_meta( '_stripe_charge_captured', true );
443
+ $refund_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? get_post_meta( $order_id, '_stripe_refund_id', true ) : $order->get_meta( '_stripe_refund_id', true );
444
 
445
  // If the refund ID matches, don't continue to prevent double refunding.
446
  if ( $notification->data->object->refunds->data[0]->id === $refund_id ) {
452
  $reason = ( isset( $captured ) && 'yes' === $captured ) ? __( 'Refunded via Stripe Dashboard', 'woocommerce-gateway-stripe' ) : __( 'Pre-Authorization Released via Stripe Dashboard', 'woocommerce-gateway-stripe' );
453
 
454
  // Create the refund.
455
+ $refund = wc_create_refund(
456
+ array(
457
+ 'order_id' => $order_id,
458
+ 'amount' => $this->get_refund_amount( $notification ),
459
+ 'reason' => $reason,
460
+ )
461
+ );
462
 
463
  if ( is_wp_error( $refund ) ) {
464
  WC_Stripe_Logger::log( $refund->get_error_message() );
465
  }
466
 
467
+ WC_Stripe_Helper::is_wc_lt( '3.0' ) ? update_post_meta( $order_id, '_stripe_refund_id', $notification->data->object->refunds->data[0]->id ) : $order->update_meta_data( '_stripe_refund_id', $notification->data->object->refunds->data[0]->id );
468
 
469
  $amount = wc_price( $notification->data->object->refunds->data[0]->amount / 100 );
470
 
471
+ if ( in_array( strtolower( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->get_order_currency() : $order->get_currency() ), WC_Stripe_Helper::no_decimal_currencies() ) ) {
472
  $amount = wc_price( $notification->data->object->refunds->data[0]->amount );
473
  }
474
 
includes/compat/class-wc-stripe-pre-orders-compat.php CHANGED
@@ -28,7 +28,7 @@ class WC_Stripe_Pre_Orders_Compat extends WC_Stripe_Payment_Gateway {
28
  * @param object $order
29
  */
30
  public function remove_order_source_before_retry( $order ) {
31
- $order_id = WC_Stripe_Helper::is_pre_30() ? $order->id : $order->get_id();
32
  delete_post_meta( $order_id, '_stripe_source_id' );
33
  // For BW compat will remove in the future.
34
  delete_post_meta( $order_id, '_stripe_card_id' );
@@ -39,7 +39,7 @@ class WC_Stripe_Pre_Orders_Compat extends WC_Stripe_Payment_Gateway {
39
  * @param object $order
40
  */
41
  public function remove_order_customer_before_retry( $order ) {
42
- $order_id = WC_Stripe_Helper::is_pre_30() ? $order->id : $order->get_id();
43
  delete_post_meta( $order_id, '_stripe_customer_id' );
44
  }
45
 
28
  * @param object $order
29
  */
30
  public function remove_order_source_before_retry( $order ) {
31
+ $order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();
32
  delete_post_meta( $order_id, '_stripe_source_id' );
33
  // For BW compat will remove in the future.
34
  delete_post_meta( $order_id, '_stripe_card_id' );
39
  * @param object $order
40
  */
41
  public function remove_order_customer_before_retry( $order ) {
42
+ $order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();
43
  delete_post_meta( $order_id, '_stripe_customer_id' );
44
  }
45
 
includes/compat/class-wc-stripe-sepa-subs-compat.php CHANGED
@@ -20,6 +20,8 @@ class WC_Stripe_Sepa_Subs_Compat extends WC_Gateway_Stripe_Sepa {
20
  add_action( 'wcs_resubscribe_order_created', array( $this, 'delete_resubscribe_meta' ), 10 );
21
  add_action( 'wcs_renewal_order_created', array( $this, 'delete_renewal_meta' ), 10 );
22
  add_action( 'woocommerce_subscription_failing_payment_method_updated_stripe', array( $this, 'update_failing_payment_method' ), 10, 2 );
 
 
23
 
24
  // Display the credit card used for a subscription in the "My Subscriptions" table.
25
  add_filter( 'woocommerce_my_subscriptions_payment_method', array( $this, 'maybe_render_subscription_payment_method' ), 10, 2 );
@@ -74,6 +76,52 @@ class WC_Stripe_Sepa_Subs_Compat extends WC_Gateway_Stripe_Sepa {
74
  return ( isset( $_GET['pay_for_order'] ) && isset( $_GET['change_payment_method'] ) );
75
  }
76
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  /**
78
  * Updates other subscription sources.
79
  *
@@ -83,7 +131,7 @@ class WC_Stripe_Sepa_Subs_Compat extends WC_Gateway_Stripe_Sepa {
83
  public function save_source_to_order( $order, $source ) {
84
  parent::save_source_to_order( $order, $source );
85
 
86
- $order_id = WC_Stripe_Helper::is_pre_30() ? $order->id : $order->get_id();
87
 
88
  // Also store it on the subscriptions being purchased or paid for in the order.
89
  if ( function_exists( 'wcs_order_contains_subscription' ) && wcs_order_contains_subscription( $order_id ) ) {
@@ -95,7 +143,7 @@ class WC_Stripe_Sepa_Subs_Compat extends WC_Gateway_Stripe_Sepa {
95
  }
96
 
97
  foreach ( $subscriptions as $subscription ) {
98
- $subscription_id = WC_Stripe_Helper::is_pre_30() ? $subscription->id : $subscription->get_id();
99
  update_post_meta( $subscription_id, '_stripe_customer_id', $source->customer );
100
  update_post_meta( $subscription_id, '_stripe_source_id', $source->source );
101
  }
@@ -137,6 +185,8 @@ class WC_Stripe_Sepa_Subs_Compat extends WC_Gateway_Stripe_Sepa {
137
 
138
  $this->save_source_to_order( $subscription, $prepared_source );
139
 
 
 
140
  return array(
141
  'result' => 'success',
142
  'redirect' => $this->get_return_url( $subscription ),
@@ -175,7 +225,7 @@ class WC_Stripe_Sepa_Subs_Compat extends WC_Gateway_Stripe_Sepa {
175
  return new WP_Error( 'stripe_error', sprintf( __( 'Sorry, the minimum allowed order total is %1$s to use this payment method.', 'woocommerce-gateway-stripe' ), wc_price( WC_Stripe_Helper::get_minimum_amount() / 100 ) ) );
176
  }
177
 
178
- $order_id = WC_Stripe_Helper::is_pre_30() ? $renewal_order->id : $renewal_order->get_id();
179
 
180
  // Get source from order
181
  $prepared_source = $this->prepare_order_source( $renewal_order );
@@ -256,10 +306,10 @@ class WC_Stripe_Sepa_Subs_Compat extends WC_Gateway_Stripe_Sepa {
256
  * @param int $resubscribe_order The order created for the customer to resubscribe to the old expired/cancelled subscription
257
  */
258
  public function delete_resubscribe_meta( $resubscribe_order ) {
259
- delete_post_meta( ( WC_Stripe_Helper::is_pre_30() ? $resubscribe_order->id : $resubscribe_order->get_id() ), '_stripe_customer_id' );
260
- delete_post_meta( ( WC_Stripe_Helper::is_pre_30() ? $resubscribe_order->id : $resubscribe_order->get_id() ), '_stripe_source_id' );
261
  // For BW compat will remove in future
262
- delete_post_meta( ( WC_Stripe_Helper::is_pre_30() ? $resubscribe_order->id : $resubscribe_order->get_id() ), '_stripe_card_id' );
263
  $this->delete_renewal_meta( $resubscribe_order );
264
  }
265
 
@@ -284,7 +334,7 @@ class WC_Stripe_Sepa_Subs_Compat extends WC_Gateway_Stripe_Sepa {
284
  * @return void
285
  */
286
  public function update_failing_payment_method( $subscription, $renewal_order ) {
287
- if ( WC_Stripe_Helper::is_pre_30() ) {
288
  update_post_meta( $subscription->id, '_stripe_customer_id', $renewal_order->stripe_customer_id );
289
  update_post_meta( $subscription->id, '_stripe_source_id', $renewal_order->stripe_source_id );
290
 
@@ -304,23 +354,23 @@ class WC_Stripe_Sepa_Subs_Compat extends WC_Gateway_Stripe_Sepa {
304
  * @return array
305
  */
306
  public function add_subscription_payment_meta( $payment_meta, $subscription ) {
307
- $source_id = get_post_meta( ( WC_Stripe_Helper::is_pre_30() ? $subscription->id : $subscription->get_id() ), '_stripe_source_id', true );
308
 
309
  // For BW compat will remove in future.
310
  if ( empty( $source_id ) ) {
311
- $source_id = get_post_meta( ( WC_Stripe_Helper::is_pre_30() ? $subscription->id : $subscription->get_id() ), '_stripe_card_id', true );
312
 
313
  // Take this opportunity to update the key name.
314
- WC_Stripe_Helper::is_pre_30() ? update_post_meta( $subscription->id, '_stripe_source_id', $source_id ) : update_post_meta( $subscription->get_id(), '_stripe_source_id', $source_id );
315
  }
316
 
317
  $payment_meta[ $this->id ] = array(
318
  'post_meta' => array(
319
  '_stripe_customer_id' => array(
320
- 'value' => get_post_meta( ( WC_Stripe_Helper::is_pre_30() ? $subscription->id : $subscription->get_id() ), '_stripe_customer_id', true ),
321
  'label' => 'Stripe Customer ID',
322
  ),
323
- '_stripe_source_id' => array(
324
  'value' => $source_id,
325
  'label' => 'Stripe Source ID',
326
  ),
@@ -367,25 +417,25 @@ class WC_Stripe_Sepa_Subs_Compat extends WC_Gateway_Stripe_Sepa {
367
  * @return string the subscription payment method
368
  */
369
  public function maybe_render_subscription_payment_method( $payment_method_to_display, $subscription ) {
370
- $customer_user = WC_Stripe_Helper::is_pre_30() ? $subscription->customer_user : $subscription->get_customer_id();
371
 
372
  // bail for other payment methods
373
- if ( ( WC_Stripe_Helper::is_pre_30() ? $subscription->payment_method : $subscription->get_payment_method() ) !== $this->id || ! $customer_user ) {
374
  return $payment_method_to_display;
375
  }
376
 
377
- $stripe_source_id = get_post_meta( ( WC_Stripe_Helper::is_pre_30() ? $subscription->id : $subscription->get_id() ), '_stripe_source_id', true );
378
 
379
  // For BW compat will remove in future.
380
  if ( empty( $stripe_source_id ) ) {
381
- $stripe_source_id = get_post_meta( ( WC_Stripe_Helper::is_pre_30() ? $subscription->id : $subscription->get_id() ), '_stripe_card_id', true );
382
 
383
  // Take this opportunity to update the key name.
384
- WC_Stripe_Helper::is_pre_30() ? update_post_meta( $subscription->id, '_stripe_source_id', $stripe_source_id ) : update_post_meta( $subscription->get_id(), '_stripe_source_id', $stripe_source_id );
385
  }
386
 
387
  $stripe_customer = new WC_Stripe_Customer();
388
- $stripe_customer_id = get_post_meta( ( WC_Stripe_Helper::is_pre_30() ? $subscription->id : $subscription->get_id() ), '_stripe_customer_id', true );
389
 
390
  // If we couldn't find a Stripe customer linked to the subscription, fallback to the user meta data.
391
  if ( ! $stripe_customer_id || ! is_string( $stripe_customer_id ) ) {
@@ -404,20 +454,22 @@ class WC_Stripe_Sepa_Subs_Compat extends WC_Gateway_Stripe_Sepa {
404
 
405
  // If we couldn't find a Stripe customer linked to the account, fallback to the order meta data.
406
  if ( ( ! $stripe_customer_id || ! is_string( $stripe_customer_id ) ) && false !== $subscription->order ) {
407
- $stripe_customer_id = get_post_meta( ( WC_Stripe_Helper::is_pre_30() ? $subscription->order->id : $subscription->get_parent_id() ), '_stripe_customer_id', true );
408
- $stripe_source_id = get_post_meta( ( WC_Stripe_Helper::is_pre_30() ? $subscription->order->id : $subscription->get_parent_id() ), '_stripe_source_id', true );
409
 
410
  // For BW compat will remove in future.
411
  if ( empty( $stripe_source_id ) ) {
412
- $stripe_source_id = get_post_meta( ( WC_Stripe_Helper::is_pre_30() ? $subscription->order->id : $subscription->get_parent_id() ), '_stripe_card_id', true );
413
 
414
  // Take this opportunity to update the key name.
415
- WC_Stripe_Helper::is_pre_30() ? update_post_meta( $subscription->order->id, '_stripe_source_id', $stripe_source_id ) : update_post_meta( $subscription->get_parent_id(), '_stripe_source_id', $stripe_source_id );
416
  }
417
  }
418
 
419
  $stripe_customer->set_id( $stripe_customer_id );
420
- $sources = $stripe_customer->get_sources();
 
 
421
 
422
  if ( $sources ) {
423
  foreach ( $sources as $source ) {
@@ -425,9 +477,8 @@ class WC_Stripe_Sepa_Subs_Compat extends WC_Gateway_Stripe_Sepa {
425
  if ( $source->sepa_debit ) {
426
  /* translators: 1) last 4 digits of SEPA Direct Debit */
427
  $payment_method_to_display = sprintf( __( 'Via SEPA Direct Debit ending in %1$s', 'woocommerce-gateway-stripe' ), $source->sepa_debit->last4 );
428
- } else {
429
- $payment_method_to_display = __( 'N/A', 'woocommerce-gateway-stripe' );
430
  }
 
431
  break;
432
  }
433
  }
20
  add_action( 'wcs_resubscribe_order_created', array( $this, 'delete_resubscribe_meta' ), 10 );
21
  add_action( 'wcs_renewal_order_created', array( $this, 'delete_renewal_meta' ), 10 );
22
  add_action( 'woocommerce_subscription_failing_payment_method_updated_stripe', array( $this, 'update_failing_payment_method' ), 10, 2 );
23
+ add_action( 'wc_stripe_sepa_payment_fields', array( $this, 'display_update_subs_payment_checkout' ) );
24
+ add_action( 'wc_stripe_add_payment_method_' . $this->id . '_success', array( $this, 'handle_add_payment_method_success' ), 10, 2 );
25
 
26
  // Display the credit card used for a subscription in the "My Subscriptions" table.
27
  add_filter( 'woocommerce_my_subscriptions_payment_method', array( $this, 'maybe_render_subscription_payment_method' ), 10, 2 );
76
  return ( isset( $_GET['pay_for_order'] ) && isset( $_GET['change_payment_method'] ) );
77
  }
78
 
79
+ /**
80
+ * Displays a checkbox to allow users to update all subs payments with new
81
+ * payment.
82
+ *
83
+ * @since 4.1.11
84
+ */
85
+ public function display_update_subs_payment_checkout() {
86
+ if (
87
+ apply_filters( 'wc_stripe_display_update_subs_payment_method_card_checkbox', true ) &&
88
+ wcs_user_has_subscription( get_current_user_id(), '', 'active' ) &&
89
+ is_add_payment_method_page()
90
+ ) {
91
+ printf(
92
+ '<p class="form-row">
93
+ <input id="wc-%1$s-update-subs-payment-method-card" name="wc-%1$s-update-subs-payment-method-card" type="checkbox" value="true" style="width:auto;" />
94
+ <label for="wc-%1$s-update-subs-payment-method-card" style="display:inline;">%2$s</label>
95
+ </p>',
96
+ esc_attr( $this->id ),
97
+ esc_html( apply_filters( 'wc_stripe_save_to_subs_text', __( 'Update the Payment Method used for all of my active subscriptions (optional).', 'woocommerce-gateway-stripe' ) ) )
98
+ );
99
+ }
100
+ }
101
+
102
+ /**
103
+ * Updates all active subscriptions payment method.
104
+ *
105
+ * @since 4.1.11
106
+ * @param string $source_id
107
+ * @param object $source_object
108
+ */
109
+ public function handle_add_payment_method_success( $source_id, $source_object ) {
110
+ if ( isset( $_POST[ 'wc-' . $this->id . '-update-subs-payment-method-card' ] ) ) {
111
+ $all_subs = wcs_get_users_subscriptions();
112
+
113
+ if ( ! empty( $all_subs ) ) {
114
+ foreach ( $all_subs as $sub ) {
115
+ if ( 'active' === $sub->get_status() ) {
116
+ update_post_meta( $sub->get_id(), '_stripe_source_id', $source_id );
117
+ update_post_meta( $sub->get_id(), '_payment_method', $this->id );
118
+ update_post_meta( $sub->get_id(), '_payment_method_title', $this->method_title );
119
+ }
120
+ }
121
+ }
122
+ }
123
+ }
124
+
125
  /**
126
  * Updates other subscription sources.
127
  *
131
  public function save_source_to_order( $order, $source ) {
132
  parent::save_source_to_order( $order, $source );
133
 
134
+ $order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();
135
 
136
  // Also store it on the subscriptions being purchased or paid for in the order.
137
  if ( function_exists( 'wcs_order_contains_subscription' ) && wcs_order_contains_subscription( $order_id ) ) {
143
  }
144
 
145
  foreach ( $subscriptions as $subscription ) {
146
+ $subscription_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $subscription->id : $subscription->get_id();
147
  update_post_meta( $subscription_id, '_stripe_customer_id', $source->customer );
148
  update_post_meta( $subscription_id, '_stripe_source_id', $source->source );
149
  }
185
 
186
  $this->save_source_to_order( $subscription, $prepared_source );
187
 
188
+ do_action( 'wc_stripe_change_subs_payment_method_success', $prepared_source->source, $prepared_source );
189
+
190
  return array(
191
  'result' => 'success',
192
  'redirect' => $this->get_return_url( $subscription ),
225
  return new WP_Error( 'stripe_error', sprintf( __( 'Sorry, the minimum allowed order total is %1$s to use this payment method.', 'woocommerce-gateway-stripe' ), wc_price( WC_Stripe_Helper::get_minimum_amount() / 100 ) ) );
226
  }
227
 
228
+ $order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $renewal_order->id : $renewal_order->get_id();
229
 
230
  // Get source from order
231
  $prepared_source = $this->prepare_order_source( $renewal_order );
306
  * @param int $resubscribe_order The order created for the customer to resubscribe to the old expired/cancelled subscription
307
  */
308
  public function delete_resubscribe_meta( $resubscribe_order ) {
309
+ delete_post_meta( ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $resubscribe_order->id : $resubscribe_order->get_id() ), '_stripe_customer_id' );
310
+ delete_post_meta( ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $resubscribe_order->id : $resubscribe_order->get_id() ), '_stripe_source_id' );
311
  // For BW compat will remove in future
312
+ delete_post_meta( ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $resubscribe_order->id : $resubscribe_order->get_id() ), '_stripe_card_id' );
313
  $this->delete_renewal_meta( $resubscribe_order );
314
  }
315
 
334
  * @return void
335
  */
336
  public function update_failing_payment_method( $subscription, $renewal_order ) {
337
+ if ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ) {
338
  update_post_meta( $subscription->id, '_stripe_customer_id', $renewal_order->stripe_customer_id );
339
  update_post_meta( $subscription->id, '_stripe_source_id', $renewal_order->stripe_source_id );
340
 
354
  * @return array
355
  */
356
  public function add_subscription_payment_meta( $payment_meta, $subscription ) {
357
+ $source_id = get_post_meta( ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $subscription->id : $subscription->get_id() ), '_stripe_source_id', true );
358
 
359
  // For BW compat will remove in future.
360
  if ( empty( $source_id ) ) {
361
+ $source_id = get_post_meta( ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $subscription->id : $subscription->get_id() ), '_stripe_card_id', true );
362
 
363
  // Take this opportunity to update the key name.
364
+ WC_Stripe_Helper::is_wc_lt( '3.0' ) ? update_post_meta( $subscription->id, '_stripe_source_id', $source_id ) : update_post_meta( $subscription->get_id(), '_stripe_source_id', $source_id );
365
  }
366
 
367
  $payment_meta[ $this->id ] = array(
368
  'post_meta' => array(
369
  '_stripe_customer_id' => array(
370
+ 'value' => get_post_meta( ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $subscription->id : $subscription->get_id() ), '_stripe_customer_id', true ),
371
  'label' => 'Stripe Customer ID',
372
  ),
373
+ '_stripe_source_id' => array(
374
  'value' => $source_id,
375
  'label' => 'Stripe Source ID',
376
  ),
417
  * @return string the subscription payment method
418
  */
419
  public function maybe_render_subscription_payment_method( $payment_method_to_display, $subscription ) {
420
+ $customer_user = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $subscription->customer_user : $subscription->get_customer_id();
421
 
422
  // bail for other payment methods
423
+ if ( ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $subscription->payment_method : $subscription->get_payment_method() ) !== $this->id || ! $customer_user ) {
424
  return $payment_method_to_display;
425
  }
426
 
427
+ $stripe_source_id = get_post_meta( ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $subscription->id : $subscription->get_id() ), '_stripe_source_id', true );
428
 
429
  // For BW compat will remove in future.
430
  if ( empty( $stripe_source_id ) ) {
431
+ $stripe_source_id = get_post_meta( ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $subscription->id : $subscription->get_id() ), '_stripe_card_id', true );
432
 
433
  // Take this opportunity to update the key name.
434
+ WC_Stripe_Helper::is_wc_lt( '3.0' ) ? update_post_meta( $subscription->id, '_stripe_source_id', $stripe_source_id ) : update_post_meta( $subscription->get_id(), '_stripe_source_id', $stripe_source_id );
435
  }
436
 
437
  $stripe_customer = new WC_Stripe_Customer();
438
+ $stripe_customer_id = get_post_meta( ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $subscription->id : $subscription->get_id() ), '_stripe_customer_id', true );
439
 
440
  // If we couldn't find a Stripe customer linked to the subscription, fallback to the user meta data.
441
  if ( ! $stripe_customer_id || ! is_string( $stripe_customer_id ) ) {
454
 
455
  // If we couldn't find a Stripe customer linked to the account, fallback to the order meta data.
456
  if ( ( ! $stripe_customer_id || ! is_string( $stripe_customer_id ) ) && false !== $subscription->order ) {
457
+ $stripe_customer_id = get_post_meta( ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $subscription->order->id : $subscription->get_parent_id() ), '_stripe_customer_id', true );
458
+ $stripe_source_id = get_post_meta( ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $subscription->order->id : $subscription->get_parent_id() ), '_stripe_source_id', true );
459
 
460
  // For BW compat will remove in future.
461
  if ( empty( $stripe_source_id ) ) {
462
+ $stripe_source_id = get_post_meta( ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $subscription->order->id : $subscription->get_parent_id() ), '_stripe_card_id', true );
463
 
464
  // Take this opportunity to update the key name.
465
+ WC_Stripe_Helper::is_wc_lt( '3.0' ) ? update_post_meta( $subscription->order->id, '_stripe_source_id', $stripe_source_id ) : update_post_meta( $subscription->get_parent_id(), '_stripe_source_id', $stripe_source_id );
466
  }
467
  }
468
 
469
  $stripe_customer->set_id( $stripe_customer_id );
470
+
471
+ $sources = $stripe_customer->get_sources();
472
+ $payment_method_to_display = __( 'N/A', 'woocommerce-gateway-stripe' );
473
 
474
  if ( $sources ) {
475
  foreach ( $sources as $source ) {
477
  if ( $source->sepa_debit ) {
478
  /* translators: 1) last 4 digits of SEPA Direct Debit */
479
  $payment_method_to_display = sprintf( __( 'Via SEPA Direct Debit ending in %1$s', 'woocommerce-gateway-stripe' ), $source->sepa_debit->last4 );
 
 
480
  }
481
+
482
  break;
483
  }
484
  }
includes/compat/class-wc-stripe-subs-compat.php CHANGED
@@ -20,6 +20,8 @@ class WC_Stripe_Subs_Compat extends WC_Gateway_Stripe {
20
  add_action( 'wcs_resubscribe_order_created', array( $this, 'delete_resubscribe_meta' ), 10 );
21
  add_action( 'wcs_renewal_order_created', array( $this, 'delete_renewal_meta' ), 10 );
22
  add_action( 'woocommerce_subscription_failing_payment_method_updated_stripe', array( $this, 'update_failing_payment_method' ), 10, 2 );
 
 
23
 
24
  // display the credit card used for a subscription in the "My Subscriptions" table
25
  add_filter( 'woocommerce_my_subscriptions_payment_method', array( $this, 'maybe_render_subscription_payment_method' ), 10, 2 );
@@ -74,10 +76,57 @@ class WC_Stripe_Subs_Compat extends WC_Gateway_Stripe {
74
  return ( isset( $_GET['pay_for_order'] ) && isset( $_GET['change_payment_method'] ) );
75
  }
76
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  /**
78
  * Process the payment method change for subscriptions.
79
  *
80
  * @since 4.0.4
 
81
  * @param int $order_id
82
  */
83
  public function change_subs_payment_method( $order_id ) {
@@ -99,40 +148,7 @@ class WC_Stripe_Subs_Compat extends WC_Gateway_Stripe {
99
 
100
  $this->save_source_to_order( $subscription, $prepared_source );
101
 
102
- /*
103
- * Check if card 3DS is required or optional with 3DS setting.
104
- * Will need to first create 3DS source and require redirection
105
- * for customer to login to their credit card company.
106
- * Note that if we need to save source, the original source must be first
107
- * attached to a customer in Stripe before it can be charged.
108
- */
109
- if ( $this->is_3ds_required( $source_object ) ) {
110
- $order = $subscription->get_parent();
111
- $response = $this->create_3ds_source( $order, $source_object, $subscription->get_view_order_url() );
112
-
113
- if ( ! empty( $response->error ) ) {
114
- $localized_message = $response->error->message;
115
-
116
- $order->add_order_note( $localized_message );
117
-
118
- throw new WC_Stripe_Exception( print_r( $response, true ), $localized_message );
119
- }
120
-
121
- // Update order meta with 3DS source.
122
- if ( WC_Stripe_Helper::is_pre_30() ) {
123
- update_post_meta( $order_id, '_stripe_source_id', $response->id );
124
- } else {
125
- $subscription->update_meta_data( '_stripe_source_id', $response->id );
126
- $subscription->save();
127
- }
128
-
129
- WC_Stripe_Logger::log( 'Info: Redirecting to 3DS...' );
130
-
131
- return array(
132
- 'result' => 'success',
133
- 'redirect' => esc_url_raw( $response->redirect->url ),
134
- );
135
- }
136
 
137
  return array(
138
  'result' => 'success',
@@ -190,7 +206,7 @@ class WC_Stripe_Subs_Compat extends WC_Gateway_Stripe {
190
  return new WP_Error( 'stripe_error', sprintf( __( 'Sorry, the minimum allowed order total is %1$s to use this payment method.', 'woocommerce-gateway-stripe' ), wc_price( WC_Stripe_Helper::get_minimum_amount() / 100 ) ) );
191
  }
192
 
193
- $order_id = WC_Stripe_Helper::is_pre_30() ? $renewal_order->id : $renewal_order->get_id();
194
 
195
  // Get source from order
196
  $prepared_source = $this->prepare_order_source( $renewal_order );
@@ -275,7 +291,7 @@ class WC_Stripe_Subs_Compat extends WC_Gateway_Stripe {
275
  public function save_source_to_order( $order, $source ) {
276
  parent::save_source_to_order( $order, $source );
277
 
278
- $order_id = WC_Stripe_Helper::is_pre_30() ? $order->id : $order->get_id();
279
 
280
  // Also store it on the subscriptions being purchased or paid for in the order
281
  if ( function_exists( 'wcs_order_contains_subscription' ) && wcs_order_contains_subscription( $order_id ) ) {
@@ -287,7 +303,7 @@ class WC_Stripe_Subs_Compat extends WC_Gateway_Stripe {
287
  }
288
 
289
  foreach ( $subscriptions as $subscription ) {
290
- $subscription_id = WC_Stripe_Helper::is_pre_30() ? $subscription->id : $subscription->get_id();
291
  update_post_meta( $subscription_id, '_stripe_customer_id', $source->customer );
292
  update_post_meta( $subscription_id, '_stripe_source_id', $source->source );
293
  }
@@ -298,10 +314,10 @@ class WC_Stripe_Subs_Compat extends WC_Gateway_Stripe {
298
  * @param int $resubscribe_order The order created for the customer to resubscribe to the old expired/cancelled subscription
299
  */
300
  public function delete_resubscribe_meta( $resubscribe_order ) {
301
- delete_post_meta( ( WC_Stripe_Helper::is_pre_30() ? $resubscribe_order->id : $resubscribe_order->get_id() ), '_stripe_customer_id' );
302
- delete_post_meta( ( WC_Stripe_Helper::is_pre_30() ? $resubscribe_order->id : $resubscribe_order->get_id() ), '_stripe_source_id' );
303
  // For BW compat will remove in future
304
- delete_post_meta( ( WC_Stripe_Helper::is_pre_30() ? $resubscribe_order->id : $resubscribe_order->get_id() ), '_stripe_card_id' );
305
  $this->delete_renewal_meta( $resubscribe_order );
306
  }
307
 
@@ -326,7 +342,7 @@ class WC_Stripe_Subs_Compat extends WC_Gateway_Stripe {
326
  * @return void
327
  */
328
  public function update_failing_payment_method( $subscription, $renewal_order ) {
329
- if ( WC_Stripe_Helper::is_pre_30() ) {
330
  update_post_meta( $subscription->id, '_stripe_customer_id', $renewal_order->stripe_customer_id );
331
  update_post_meta( $subscription->id, '_stripe_source_id', $renewal_order->stripe_source_id );
332
 
@@ -346,23 +362,25 @@ class WC_Stripe_Subs_Compat extends WC_Gateway_Stripe {
346
  * @return array
347
  */
348
  public function add_subscription_payment_meta( $payment_meta, $subscription ) {
349
- $source_id = get_post_meta( ( WC_Stripe_Helper::is_pre_30() ? $subscription->id : $subscription->get_id() ), '_stripe_source_id', true );
 
350
 
351
  // For BW compat will remove in future.
352
  if ( empty( $source_id ) ) {
353
- $source_id = get_post_meta( ( WC_Stripe_Helper::is_pre_30() ? $subscription->id : $subscription->get_id() ), '_stripe_card_id', true );
354
 
355
  // Take this opportunity to update the key name.
356
- WC_Stripe_Helper::is_pre_30() ? update_post_meta( $subscription->id, '_stripe_source_id', $source_id ) : update_post_meta( $subscription->get_id(), '_stripe_source_id', $source_id );
 
357
  }
358
 
359
  $payment_meta[ $this->id ] = array(
360
  'post_meta' => array(
361
  '_stripe_customer_id' => array(
362
- 'value' => get_post_meta( ( WC_Stripe_Helper::is_pre_30() ? $subscription->id : $subscription->get_id() ), '_stripe_customer_id', true ),
363
  'label' => 'Stripe Customer ID',
364
  ),
365
- '_stripe_source_id' => array(
366
  'value' => $source_id,
367
  'label' => 'Stripe Source ID',
368
  ),
@@ -411,25 +429,25 @@ class WC_Stripe_Subs_Compat extends WC_Gateway_Stripe {
411
  * @return string the subscription payment method
412
  */
413
  public function maybe_render_subscription_payment_method( $payment_method_to_display, $subscription ) {
414
- $customer_user = WC_Stripe_Helper::is_pre_30() ? $subscription->customer_user : $subscription->get_customer_id();
415
 
416
  // bail for other payment methods
417
- if ( ( WC_Stripe_Helper::is_pre_30() ? $subscription->payment_method : $subscription->get_payment_method() ) !== $this->id || ! $customer_user ) {
418
  return $payment_method_to_display;
419
  }
420
 
421
- $stripe_source_id = get_post_meta( ( WC_Stripe_Helper::is_pre_30() ? $subscription->id : $subscription->get_id() ), '_stripe_source_id', true );
422
 
423
  // For BW compat will remove in future.
424
  if ( empty( $stripe_source_id ) ) {
425
- $stripe_source_id = get_post_meta( ( WC_Stripe_Helper::is_pre_30() ? $subscription->id : $subscription->get_id() ), '_stripe_card_id', true );
426
 
427
  // Take this opportunity to update the key name.
428
- WC_Stripe_Helper::is_pre_30() ? update_post_meta( $subscription->id, '_stripe_source_id', $stripe_source_id ) : update_post_meta( $subscription->get_id(), '_stripe_source_id', $stripe_source_id );
429
  }
430
 
431
  $stripe_customer = new WC_Stripe_Customer();
432
- $stripe_customer_id = get_post_meta( ( WC_Stripe_Helper::is_pre_30() ? $subscription->id : $subscription->get_id() ), '_stripe_customer_id', true );
433
 
434
  // If we couldn't find a Stripe customer linked to the subscription, fallback to the user meta data.
435
  if ( ! $stripe_customer_id || ! is_string( $stripe_customer_id ) ) {
@@ -448,24 +466,25 @@ class WC_Stripe_Subs_Compat extends WC_Gateway_Stripe {
448
 
449
  // If we couldn't find a Stripe customer linked to the account, fallback to the order meta data.
450
  if ( ( ! $stripe_customer_id || ! is_string( $stripe_customer_id ) ) && false !== $subscription->order ) {
451
- $stripe_customer_id = get_post_meta( ( WC_Stripe_Helper::is_pre_30() ? $subscription->order->id : $subscription->get_parent_id() ), '_stripe_customer_id', true );
452
- $stripe_source_id = get_post_meta( ( WC_Stripe_Helper::is_pre_30() ? $subscription->order->id : $subscription->get_parent_id() ), '_stripe_source_id', true );
453
 
454
  // For BW compat will remove in future.
455
  if ( empty( $stripe_source_id ) ) {
456
- $stripe_source_id = get_post_meta( ( WC_Stripe_Helper::is_pre_30() ? $subscription->order->id : $subscription->get_parent_id() ), '_stripe_card_id', true );
457
 
458
  // Take this opportunity to update the key name.
459
- WC_Stripe_Helper::is_pre_30() ? update_post_meta( $subscription->order->id, '_stripe_source_id', $stripe_source_id ) : update_post_meta( $subscription->get_parent_id(), '_stripe_source_id', $stripe_source_id );
460
  }
461
  }
462
 
463
  $stripe_customer->set_id( $stripe_customer_id );
464
- $sources = $stripe_customer->get_sources();
 
 
465
 
466
  if ( $sources ) {
467
- $card = false;
468
- $found_source = false;
469
 
470
  foreach ( $sources as $source ) {
471
  if ( isset( $source->type ) && 'card' === $source->type ) {
@@ -475,28 +494,12 @@ class WC_Stripe_Subs_Compat extends WC_Gateway_Stripe {
475
  }
476
 
477
  if ( $source->id === $stripe_source_id ) {
478
- $found_source = true;
479
-
480
  if ( $card ) {
481
  /* translators: 1) card brand 2) last 4 digits */
482
  $payment_method_to_display = sprintf( __( 'Via %1$s card ending in %2$s', 'woocommerce-gateway-stripe' ), ( isset( $card->brand ) ? $card->brand : __( 'N/A', 'woocommerce-gateway-stripe' ) ), $card->last4 );
483
- } else {
484
- $payment_method_to_display = __( 'N/A', 'woocommerce-gateway-stripe' );
485
  }
486
- break;
487
- }
488
- }
489
 
490
- if ( ! $found_source ) {
491
- if ( isset( $sources[0]->type ) && 'card' === $sources[0]->type ) {
492
- $card = $sources[0]->card;
493
- }
494
-
495
- if ( $card ) {
496
- /* translators: 1) card brand 2) last 4 digits */
497
- $payment_method_to_display = sprintf( __( 'Via %1$s card ending in %2$s', 'woocommerce-gateway-stripe' ), ( isset( $card->brand ) ? $card->brand : __( 'N/A', 'woocommerce-gateway-stripe' ) ), $card->last4 );
498
- } else {
499
- $payment_method_to_display = __( 'N/A', 'woocommerce-gateway-stripe' );
500
  }
501
  }
502
  }
20
  add_action( 'wcs_resubscribe_order_created', array( $this, 'delete_resubscribe_meta' ), 10 );
21
  add_action( 'wcs_renewal_order_created', array( $this, 'delete_renewal_meta' ), 10 );
22
  add_action( 'woocommerce_subscription_failing_payment_method_updated_stripe', array( $this, 'update_failing_payment_method' ), 10, 2 );
23
+ add_action( 'wc_stripe_cards_payment_fields', array( $this, 'display_update_subs_payment_checkout' ) );
24
+ add_action( 'wc_stripe_add_payment_method_' . $this->id . '_success', array( $this, 'handle_add_payment_method_success' ), 10, 2 );
25
 
26
  // display the credit card used for a subscription in the "My Subscriptions" table
27
  add_filter( 'woocommerce_my_subscriptions_payment_method', array( $this, 'maybe_render_subscription_payment_method' ), 10, 2 );
76
  return ( isset( $_GET['pay_for_order'] ) && isset( $_GET['change_payment_method'] ) );
77
  }
78
 
79
+ /**
80
+ * Displays a checkbox to allow users to update all subs payments with new
81
+ * payment.
82
+ *
83
+ * @since 4.1.11
84
+ */
85
+ public function display_update_subs_payment_checkout() {
86
+ if (
87
+ apply_filters( 'wc_stripe_display_update_subs_payment_method_card_checkbox', true ) &&
88
+ wcs_user_has_subscription( get_current_user_id(), '', 'active' ) &&
89
+ is_add_payment_method_page()
90
+ ) {
91
+ printf(
92
+ '<p class="form-row">
93
+ <input id="wc-%1$s-update-subs-payment-method-card" name="wc-%1$s-update-subs-payment-method-card" type="checkbox" value="true" style="width:auto;" />
94
+ <label for="wc-%1$s-update-subs-payment-method-card" style="display:inline;">%2$s</label>
95
+ </p>',
96
+ esc_attr( $this->id ),
97
+ esc_html( apply_filters( 'wc_stripe_save_to_subs_text', __( 'Update the Payment Method used for all of my active subscriptions (optional).', 'woocommerce-gateway-stripe' ) ) )
98
+ );
99
+ }
100
+ }
101
+
102
+ /**
103
+ * Updates all active subscriptions payment method.
104
+ *
105
+ * @since 4.1.11
106
+ * @param string $source_id
107
+ * @param object $source_object
108
+ */
109
+ public function handle_add_payment_method_success( $source_id, $source_object ) {
110
+ if ( isset( $_POST[ 'wc-' . $this->id . '-update-subs-payment-method-card' ] ) ) {
111
+ $all_subs = wcs_get_users_subscriptions();
112
+
113
+ if ( ! empty( $all_subs ) ) {
114
+ foreach ( $all_subs as $sub ) {
115
+ if ( 'active' === $sub->get_status() ) {
116
+ update_post_meta( $sub->get_id(), '_stripe_source_id', $source_id );
117
+ update_post_meta( $sub->get_id(), '_payment_method', $this->id );
118
+ update_post_meta( $sub->get_id(), '_payment_method_title', $this->method_title );
119
+ }
120
+ }
121
+ }
122
+ }
123
+ }
124
+
125
  /**
126
  * Process the payment method change for subscriptions.
127
  *
128
  * @since 4.0.4
129
+ * @since 4.1.11 Remove 3DS check as it is not needed.
130
  * @param int $order_id
131
  */
132
  public function change_subs_payment_method( $order_id ) {
148
 
149
  $this->save_source_to_order( $subscription, $prepared_source );
150
 
151
+ do_action( 'wc_stripe_change_subs_payment_method_success', $prepared_source->source, $prepared_source );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
 
153
  return array(
154
  'result' => 'success',
206
  return new WP_Error( 'stripe_error', sprintf( __( 'Sorry, the minimum allowed order total is %1$s to use this payment method.', 'woocommerce-gateway-stripe' ), wc_price( WC_Stripe_Helper::get_minimum_amount() / 100 ) ) );
207
  }
208
 
209
+ $order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $renewal_order->id : $renewal_order->get_id();
210
 
211
  // Get source from order
212
  $prepared_source = $this->prepare_order_source( $renewal_order );
291
  public function save_source_to_order( $order, $source ) {
292
  parent::save_source_to_order( $order, $source );
293
 
294
+ $order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();
295
 
296
  // Also store it on the subscriptions being purchased or paid for in the order
297
  if ( function_exists( 'wcs_order_contains_subscription' ) && wcs_order_contains_subscription( $order_id ) ) {
303
  }
304
 
305
  foreach ( $subscriptions as $subscription ) {
306
+ $subscription_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $subscription->id : $subscription->get_id();
307
  update_post_meta( $subscription_id, '_stripe_customer_id', $source->customer );
308
  update_post_meta( $subscription_id, '_stripe_source_id', $source->source );
309
  }
314
  * @param int $resubscribe_order The order created for the customer to resubscribe to the old expired/cancelled subscription
315
  */
316
  public function delete_resubscribe_meta( $resubscribe_order ) {
317
+ delete_post_meta( ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $resubscribe_order->id : $resubscribe_order->get_id() ), '_stripe_customer_id' );
318
+ delete_post_meta( ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $resubscribe_order->id : $resubscribe_order->get_id() ), '_stripe_source_id' );
319
  // For BW compat will remove in future
320
+ delete_post_meta( ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $resubscribe_order->id : $resubscribe_order->get_id() ), '_stripe_card_id' );
321
  $this->delete_renewal_meta( $resubscribe_order );
322
  }
323
 
342
  * @return void
343
  */
344
  public function update_failing_payment_method( $subscription, $renewal_order ) {
345
+ if ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ) {
346
  update_post_meta( $subscription->id, '_stripe_customer_id', $renewal_order->stripe_customer_id );
347
  update_post_meta( $subscription->id, '_stripe_source_id', $renewal_order->stripe_source_id );
348
 
362
  * @return array
363
  */
364
  public function add_subscription_payment_meta( $payment_meta, $subscription ) {
365
+ $subscription_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $subscription->id : $subscription->get_id();
366
+ $source_id = get_post_meta( $subscription_id, '_stripe_source_id', true );
367
 
368
  // For BW compat will remove in future.
369
  if ( empty( $source_id ) ) {
370
+ $source_id = get_post_meta( $subscription_id, '_stripe_card_id', true );
371
 
372
  // Take this opportunity to update the key name.
373
+ update_post_meta( $subscription_id, '_stripe_source_id', $source_id );
374
+ delete_post_meta( $subscription_id, '_stripe_card_id', $source_id );
375
  }
376
 
377
  $payment_meta[ $this->id ] = array(
378
  'post_meta' => array(
379
  '_stripe_customer_id' => array(
380
+ 'value' => get_post_meta( $subscription_id, '_stripe_customer_id', true ),
381
  'label' => 'Stripe Customer ID',
382
  ),
383
+ '_stripe_source_id' => array(
384
  'value' => $source_id,
385
  'label' => 'Stripe Source ID',
386
  ),
429
  * @return string the subscription payment method
430
  */
431
  public function maybe_render_subscription_payment_method( $payment_method_to_display, $subscription ) {
432
+ $customer_user = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $subscription->customer_user : $subscription->get_customer_id();
433
 
434
  // bail for other payment methods
435
+ if ( ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $subscription->payment_method : $subscription->get_payment_method() ) !== $this->id || ! $customer_user ) {
436
  return $payment_method_to_display;
437
  }
438
 
439
+ $stripe_source_id = get_post_meta( ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $subscription->id : $subscription->get_id() ), '_stripe_source_id', true );
440
 
441
  // For BW compat will remove in future.
442
  if ( empty( $stripe_source_id ) ) {
443
+ $stripe_source_id = get_post_meta( ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $subscription->id : $subscription->get_id() ), '_stripe_card_id', true );
444
 
445
  // Take this opportunity to update the key name.
446
+ WC_Stripe_Helper::is_wc_lt( '3.0' ) ? update_post_meta( $subscription->id, '_stripe_source_id', $stripe_source_id ) : update_post_meta( $subscription->get_id(), '_stripe_source_id', $stripe_source_id );
447
  }
448
 
449
  $stripe_customer = new WC_Stripe_Customer();
450
+ $stripe_customer_id = get_post_meta( ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $subscription->id : $subscription->get_id() ), '_stripe_customer_id', true );
451
 
452
  // If we couldn't find a Stripe customer linked to the subscription, fallback to the user meta data.
453
  if ( ! $stripe_customer_id || ! is_string( $stripe_customer_id ) ) {
466
 
467
  // If we couldn't find a Stripe customer linked to the account, fallback to the order meta data.
468
  if ( ( ! $stripe_customer_id || ! is_string( $stripe_customer_id ) ) && false !== $subscription->order ) {
469
+ $stripe_customer_id = get_post_meta( ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $subscription->order->id : $subscription->get_parent_id() ), '_stripe_customer_id', true );
470
+ $stripe_source_id = get_post_meta( ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $subscription->order->id : $subscription->get_parent_id() ), '_stripe_source_id', true );
471
 
472
  // For BW compat will remove in future.
473
  if ( empty( $stripe_source_id ) ) {
474
+ $stripe_source_id = get_post_meta( ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $subscription->order->id : $subscription->get_parent_id() ), '_stripe_card_id', true );
475
 
476
  // Take this opportunity to update the key name.
477
+ WC_Stripe_Helper::is_wc_lt( '3.0' ) ? update_post_meta( $subscription->order->id, '_stripe_source_id', $stripe_source_id ) : update_post_meta( $subscription->get_parent_id(), '_stripe_source_id', $stripe_source_id );
478
  }
479
  }
480
 
481
  $stripe_customer->set_id( $stripe_customer_id );
482
+
483
+ $sources = $stripe_customer->get_sources();
484
+ $payment_method_to_display = __( 'N/A', 'woocommerce-gateway-stripe' );
485
 
486
  if ( $sources ) {
487
+ $card = false;
 
488
 
489
  foreach ( $sources as $source ) {
490
  if ( isset( $source->type ) && 'card' === $source->type ) {
494
  }
495
 
496
  if ( $source->id === $stripe_source_id ) {
 
 
497
  if ( $card ) {
498
  /* translators: 1) card brand 2) last 4 digits */
499
  $payment_method_to_display = sprintf( __( 'Via %1$s card ending in %2$s', 'woocommerce-gateway-stripe' ), ( isset( $card->brand ) ? $card->brand : __( 'N/A', 'woocommerce-gateway-stripe' ) ), $card->last4 );
 
 
500
  }
 
 
 
501
 
502
+ break;
 
 
 
 
 
 
 
 
 
503
  }
504
  }
505
  }
includes/payment-methods/class-wc-gateway-stripe-alipay.php CHANGED
@@ -56,11 +56,11 @@ class WC_Gateway_Stripe_Alipay extends WC_Stripe_Payment_Gateway {
56
  * Constructor
57
  */
58
  public function __construct() {
59
- $this->id = 'stripe_alipay';
60
- $this->method_title = __( 'Stripe Alipay', 'woocommerce-gateway-stripe' );
61
  /* translators: link */
62
- $this->method_description = sprintf( __( 'All other general Stripe settings can be adjusted <a href="%s">here</a>.', 'woocommerce-gateway-stripe' ), admin_url( 'admin.php?page=wc-settings&tab=checkout&section=stripe' ) );
63
- $this->supports = array(
64
  'products',
65
  'refunds',
66
  );
@@ -98,17 +98,20 @@ class WC_Gateway_Stripe_Alipay extends WC_Stripe_Payment_Gateway {
98
  * @return array
99
  */
100
  public function get_supported_currency() {
101
- return apply_filters( 'wc_stripe_alipay_supported_currencies', array(
102
- 'EUR',
103
- 'AUD',
104
- 'CAD',
105
- 'GBP',
106
- 'HKD',
107
- 'JPY',
108
- 'NZD',
109
- 'SGD',
110
- 'USD',
111
- ) );
 
 
 
112
  }
113
 
114
  /**
@@ -138,7 +141,7 @@ class WC_Gateway_Stripe_Alipay extends WC_Stripe_Payment_Gateway {
138
 
139
  $icons_str = '';
140
 
141
- $icons_str .= $icons['alipay'];
142
 
143
  return apply_filters( 'woocommerce_gateway_icon', $icons_str, $this->id );
144
  }
@@ -181,7 +184,7 @@ class WC_Gateway_Stripe_Alipay extends WC_Stripe_Payment_Gateway {
181
 
182
  if ( is_add_payment_method_page() ) {
183
  $pay_button_text = __( 'Add Payment', 'woocommerce-gateway-stripe' );
184
- $total = '';
185
  } else {
186
  $pay_button_text = '';
187
  }
@@ -207,8 +210,8 @@ class WC_Gateway_Stripe_Alipay extends WC_Stripe_Payment_Gateway {
207
  * @return mixed
208
  */
209
  public function create_source( $order ) {
210
- $currency = WC_Stripe_Helper::is_pre_30() ? $order->get_order_currency() : $order->get_currency();
211
- $order_id = WC_Stripe_Helper::is_pre_30() ? $order->id : $order->get_id();
212
  $return_url = $this->get_stripe_return_url( $order );
213
  $post_data = array();
214
  $post_data['amount'] = WC_Stripe_Helper::get_stripe_amount( $order->get_total(), $currency );
@@ -248,7 +251,7 @@ class WC_Gateway_Stripe_Alipay extends WC_Stripe_Payment_Gateway {
248
  $create_account = ! empty( $_POST['createaccount'] ) ? true : false;
249
 
250
  if ( $create_account ) {
251
- $new_customer_id = WC_Stripe_Helper::is_pre_30() ? $order->customer_user : $order->get_customer_id();
252
  $new_stripe_customer = new WC_Stripe_Customer( $new_customer_id );
253
  $new_stripe_customer->create_customer();
254
  }
@@ -261,7 +264,7 @@ class WC_Gateway_Stripe_Alipay extends WC_Stripe_Payment_Gateway {
261
  throw new WC_Stripe_Exception( print_r( $response, true ), $response->error->message );
262
  }
263
 
264
- if ( WC_Stripe_Helper::is_pre_30() ) {
265
  update_post_meta( $order_id, '_stripe_source_id', $response->id );
266
  } else {
267
  $order->update_meta_data( '_stripe_source_id', $response->id );
56
  * Constructor
57
  */
58
  public function __construct() {
59
+ $this->id = 'stripe_alipay';
60
+ $this->method_title = __( 'Stripe Alipay', 'woocommerce-gateway-stripe' );
61
  /* translators: link */
62
+ $this->method_description = sprintf( __( 'All other general Stripe settings can be adjusted <a href="%s">here</a>.', 'woocommerce-gateway-stripe' ), admin_url( 'admin.php?page=wc-settings&tab=checkout&section=stripe' ) );
63
+ $this->supports = array(
64
  'products',
65
  'refunds',
66
  );
98
  * @return array
99
  */
100
  public function get_supported_currency() {
101
+ return apply_filters(
102
+ 'wc_stripe_alipay_supported_currencies',
103
+ array(
104
+ 'EUR',
105
+ 'AUD',
106
+ 'CAD',
107
+ 'GBP',
108
+ 'HKD',
109
+ 'JPY',
110
+ 'NZD',
111
+ 'SGD',
112
+ 'USD',
113
+ )
114
+ );
115
  }
116
 
117
  /**
141
 
142
  $icons_str = '';
143
 
144
+ $icons_str .= isset( $icons['alipay'] ) ? $icons['alipay'] : '';
145
 
146
  return apply_filters( 'woocommerce_gateway_icon', $icons_str, $this->id );
147
  }
184
 
185
  if ( is_add_payment_method_page() ) {
186
  $pay_button_text = __( 'Add Payment', 'woocommerce-gateway-stripe' );
187
+ $total = '';
188
  } else {
189
  $pay_button_text = '';
190
  }
210
  * @return mixed
211
  */
212
  public function create_source( $order ) {
213
+ $currency = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->get_order_currency() : $order->get_currency();
214
+ $order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();
215
  $return_url = $this->get_stripe_return_url( $order );
216
  $post_data = array();
217
  $post_data['amount'] = WC_Stripe_Helper::get_stripe_amount( $order->get_total(), $currency );
251
  $create_account = ! empty( $_POST['createaccount'] ) ? true : false;
252
 
253
  if ( $create_account ) {
254
+ $new_customer_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->customer_user : $order->get_customer_id();
255
  $new_stripe_customer = new WC_Stripe_Customer( $new_customer_id );
256
  $new_stripe_customer->create_customer();
257
  }
264
  throw new WC_Stripe_Exception( print_r( $response, true ), $response->error->message );
265
  }
266
 
267
+ if ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ) {
268
  update_post_meta( $order_id, '_stripe_source_id', $response->id );
269
  } else {
270
  $order->update_meta_data( '_stripe_source_id', $response->id );
includes/payment-methods/class-wc-gateway-stripe-bancontact.php CHANGED
@@ -56,11 +56,11 @@ class WC_Gateway_Stripe_Bancontact extends WC_Stripe_Payment_Gateway {
56
  * Constructor
57
  */
58
  public function __construct() {
59
- $this->id = 'stripe_bancontact';
60
- $this->method_title = __( 'Stripe Bancontact', 'woocommerce-gateway-stripe' );
61
  /* translators: link */
62
- $this->method_description = sprintf( __( 'All other general Stripe settings can be adjusted <a href="%s">here</a>.', 'woocommerce-gateway-stripe' ), admin_url( 'admin.php?page=wc-settings&tab=checkout&section=stripe' ) );
63
- $this->supports = array(
64
  'products',
65
  'refunds',
66
  );
@@ -98,9 +98,12 @@ class WC_Gateway_Stripe_Bancontact extends WC_Stripe_Payment_Gateway {
98
  * @return array
99
  */
100
  public function get_supported_currency() {
101
- return apply_filters( 'wc_stripe_bancontact_supported_currencies', array(
102
- 'EUR',
103
- ) );
 
 
 
104
  }
105
 
106
  /**
@@ -130,7 +133,7 @@ class WC_Gateway_Stripe_Bancontact extends WC_Stripe_Payment_Gateway {
130
 
131
  $icons_str = '';
132
 
133
- $icons_str .= $icons['bancontact'];
134
 
135
  return apply_filters( 'woocommerce_gateway_icon', $icons_str, $this->id );
136
  }
@@ -174,7 +177,7 @@ class WC_Gateway_Stripe_Bancontact extends WC_Stripe_Payment_Gateway {
174
 
175
  if ( is_add_payment_method_page() ) {
176
  $pay_button_text = __( 'Add Payment', 'woocommerce-gateway-stripe' );
177
- $total = '';
178
  } else {
179
  $pay_button_text = '';
180
  }
@@ -200,8 +203,8 @@ class WC_Gateway_Stripe_Bancontact extends WC_Stripe_Payment_Gateway {
200
  * @return mixed
201
  */
202
  public function create_source( $order ) {
203
- $currency = WC_Stripe_Helper::is_pre_30() ? $order->get_order_currency() : $order->get_currency();
204
- $order_id = WC_Stripe_Helper::is_pre_30() ? $order->id : $order->get_id();
205
  $return_url = $this->get_stripe_return_url( $order );
206
  $post_data = array();
207
  $post_data['amount'] = WC_Stripe_Helper::get_stripe_amount( $order->get_total(), $currency );
@@ -242,7 +245,7 @@ class WC_Gateway_Stripe_Bancontact extends WC_Stripe_Payment_Gateway {
242
  $create_account = ! empty( $_POST['createaccount'] ) ? true : false;
243
 
244
  if ( $create_account ) {
245
- $new_customer_id = WC_Stripe_Helper::is_pre_30() ? $order->customer_user : $order->get_customer_id();
246
  $new_stripe_customer = new WC_Stripe_Customer( $new_customer_id );
247
  $new_stripe_customer->create_customer();
248
  }
@@ -255,7 +258,7 @@ class WC_Gateway_Stripe_Bancontact extends WC_Stripe_Payment_Gateway {
255
  throw new WC_Stripe_Exception( print_r( $response, true ), $response->error->message );
256
  }
257
 
258
- if ( WC_Stripe_Helper::is_pre_30() ) {
259
  update_post_meta( $order_id, '_stripe_source_id', $response->id );
260
  } else {
261
  $order->update_meta_data( '_stripe_source_id', $response->id );
56
  * Constructor
57
  */
58
  public function __construct() {
59
+ $this->id = 'stripe_bancontact';
60
+ $this->method_title = __( 'Stripe Bancontact', 'woocommerce-gateway-stripe' );
61
  /* translators: link */
62
+ $this->method_description = sprintf( __( 'All other general Stripe settings can be adjusted <a href="%s">here</a>.', 'woocommerce-gateway-stripe' ), admin_url( 'admin.php?page=wc-settings&tab=checkout&section=stripe' ) );
63
+ $this->supports = array(
64
  'products',
65
  'refunds',
66
  );
98
  * @return array
99
  */
100
  public function get_supported_currency() {
101
+ return apply_filters(
102
+ 'wc_stripe_bancontact_supported_currencies',
103
+ array(
104
+ 'EUR',
105
+ )
106
+ );
107
  }
108
 
109
  /**
133
 
134
  $icons_str = '';
135
 
136
+ $icons_str .= isset( $icons['bancontact'] ) ? $icons['bancontact'] : '';
137
 
138
  return apply_filters( 'woocommerce_gateway_icon', $icons_str, $this->id );
139
  }
177
 
178
  if ( is_add_payment_method_page() ) {
179
  $pay_button_text = __( 'Add Payment', 'woocommerce-gateway-stripe' );
180
+ $total = '';
181
  } else {
182
  $pay_button_text = '';
183
  }
203
  * @return mixed
204
  */
205
  public function create_source( $order ) {
206
+ $currency = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->get_order_currency() : $order->get_currency();
207
+ $order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();
208
  $return_url = $this->get_stripe_return_url( $order );
209
  $post_data = array();
210
  $post_data['amount'] = WC_Stripe_Helper::get_stripe_amount( $order->get_total(), $currency );
245
  $create_account = ! empty( $_POST['createaccount'] ) ? true : false;
246
 
247
  if ( $create_account ) {
248
+ $new_customer_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->customer_user : $order->get_customer_id();
249
  $new_stripe_customer = new WC_Stripe_Customer( $new_customer_id );
250
  $new_stripe_customer->create_customer();
251
  }
258
  throw new WC_Stripe_Exception( print_r( $response, true ), $response->error->message );
259
  }
260
 
261
+ if ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ) {
262
  update_post_meta( $order_id, '_stripe_source_id', $response->id );
263
  } else {
264
  $order->update_meta_data( '_stripe_source_id', $response->id );
includes/payment-methods/class-wc-gateway-stripe-eps.php CHANGED
@@ -56,11 +56,11 @@ class WC_Gateway_Stripe_Eps extends WC_Stripe_Payment_Gateway {
56
  * Constructor
57
  */
58
  public function __construct() {
59
- $this->id = 'stripe_eps';
60
- $this->method_title = __( 'Stripe EPS', 'woocommerce-gateway-stripe' );
61
  /* translators: link */
62
- $this->method_description = sprintf( __( 'All other general Stripe settings can be adjusted <a href="%s">here</a>.', 'woocommerce-gateway-stripe' ), admin_url( 'admin.php?page=wc-settings&tab=checkout&section=stripe' ) );
63
- $this->supports = array(
64
  'products',
65
  'refunds',
66
  );
@@ -98,9 +98,12 @@ class WC_Gateway_Stripe_Eps extends WC_Stripe_Payment_Gateway {
98
  * @return array
99
  */
100
  public function get_supported_currency() {
101
- return apply_filters( 'wc_stripe_eps_supported_currencies', array(
102
- 'EUR',
103
- ) );
 
 
 
104
  }
105
 
106
  /**
@@ -130,7 +133,7 @@ class WC_Gateway_Stripe_Eps extends WC_Stripe_Payment_Gateway {
130
 
131
  $icons_str = '';
132
 
133
- $icons_str .= $icons['eps'];
134
 
135
  return apply_filters( 'woocommerce_gateway_icon', $icons_str, $this->id );
136
  }
@@ -174,7 +177,7 @@ class WC_Gateway_Stripe_Eps extends WC_Stripe_Payment_Gateway {
174
 
175
  if ( is_add_payment_method_page() ) {
176
  $pay_button_text = __( 'Add Payment', 'woocommerce-gateway-stripe' );
177
- $total = '';
178
  } else {
179
  $pay_button_text = '';
180
  }
@@ -200,8 +203,8 @@ class WC_Gateway_Stripe_Eps extends WC_Stripe_Payment_Gateway {
200
  * @return mixed
201
  */
202
  public function create_source( $order ) {
203
- $currency = WC_Stripe_Helper::is_pre_30() ? $order->get_order_currency() : $order->get_currency();
204
- $order_id = WC_Stripe_Helper::is_pre_30() ? $order->id : $order->get_id();
205
  $return_url = $this->get_stripe_return_url( $order );
206
  $post_data = array();
207
  $post_data['amount'] = WC_Stripe_Helper::get_stripe_amount( $order->get_total(), $currency );
@@ -241,7 +244,7 @@ class WC_Gateway_Stripe_Eps extends WC_Stripe_Payment_Gateway {
241
  $create_account = ! empty( $_POST['createaccount'] ) ? true : false;
242
 
243
  if ( $create_account ) {
244
- $new_customer_id = WC_Stripe_Helper::is_pre_30() ? $order->customer_user : $order->get_customer_id();
245
  $new_stripe_customer = new WC_Stripe_Customer( $new_customer_id );
246
  $new_stripe_customer->create_customer();
247
  }
@@ -254,7 +257,7 @@ class WC_Gateway_Stripe_Eps extends WC_Stripe_Payment_Gateway {
254
  throw new Exception( $response->error->message );
255
  }
256
 
257
- if ( WC_Stripe_Helper::is_pre_30() ) {
258
  update_post_meta( $order_id, '_stripe_source_id', $response->id );
259
  } else {
260
  $order->update_meta_data( '_stripe_source_id', $response->id );
56
  * Constructor
57
  */
58
  public function __construct() {
59
+ $this->id = 'stripe_eps';
60
+ $this->method_title = __( 'Stripe EPS', 'woocommerce-gateway-stripe' );
61
  /* translators: link */
62
+ $this->method_description = sprintf( __( 'All other general Stripe settings can be adjusted <a href="%s">here</a>.', 'woocommerce-gateway-stripe' ), admin_url( 'admin.php?page=wc-settings&tab=checkout&section=stripe' ) );
63
+ $this->supports = array(
64
  'products',
65
  'refunds',
66
  );
98
  * @return array
99
  */
100
  public function get_supported_currency() {
101
+ return apply_filters(
102
+ 'wc_stripe_eps_supported_currencies',
103
+ array(
104
+ 'EUR',
105
+ )
106
+ );
107
  }
108
 
109
  /**
133
 
134
  $icons_str = '';
135
 
136
+ $icons_str .= isset( $icons['eps'] ) ? $icons['eps'] : '';
137
 
138
  return apply_filters( 'woocommerce_gateway_icon', $icons_str, $this->id );
139
  }
177
 
178
  if ( is_add_payment_method_page() ) {
179
  $pay_button_text = __( 'Add Payment', 'woocommerce-gateway-stripe' );
180
+ $total = '';
181
  } else {
182
  $pay_button_text = '';
183
  }
203
  * @return mixed
204
  */
205
  public function create_source( $order ) {
206
+ $currency = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->get_order_currency() : $order->get_currency();
207
+ $order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();
208
  $return_url = $this->get_stripe_return_url( $order );
209
  $post_data = array();
210
  $post_data['amount'] = WC_Stripe_Helper::get_stripe_amount( $order->get_total(), $currency );
244
  $create_account = ! empty( $_POST['createaccount'] ) ? true : false;
245
 
246
  if ( $create_account ) {
247
+ $new_customer_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->customer_user : $order->get_customer_id();
248
  $new_stripe_customer = new WC_Stripe_Customer( $new_customer_id );
249
  $new_stripe_customer->create_customer();
250
  }
257
  throw new Exception( $response->error->message );
258
  }
259
 
260
+ if ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ) {
261
  update_post_meta( $order_id, '_stripe_source_id', $response->id );
262
  } else {
263
  $order->update_meta_data( '_stripe_source_id', $response->id );
includes/payment-methods/class-wc-gateway-stripe-giropay.php CHANGED
@@ -56,11 +56,11 @@ class WC_Gateway_Stripe_Giropay extends WC_Stripe_Payment_Gateway {
56
  * Constructor
57
  */
58
  public function __construct() {
59
- $this->id = 'stripe_giropay';
60
- $this->method_title = __( 'Stripe Giropay', 'woocommerce-gateway-stripe' );
61
  /* translators: link */
62
- $this->method_description = sprintf( __( 'All other general Stripe settings can be adjusted <a href="%s">here</a>.', 'woocommerce-gateway-stripe' ), admin_url( 'admin.php?page=wc-settings&tab=checkout&section=stripe' ) );
63
- $this->supports = array(
64
  'products',
65
  'refunds',
66
  );
@@ -98,9 +98,12 @@ class WC_Gateway_Stripe_Giropay extends WC_Stripe_Payment_Gateway {
98
  * @return array
99
  */
100
  public function get_supported_currency() {
101
- return apply_filters( 'wc_stripe_giropay_supported_currencies', array(
102
- 'EUR',
103
- ) );
 
 
 
104
  }
105
 
106
  /**
@@ -130,7 +133,7 @@ class WC_Gateway_Stripe_Giropay extends WC_Stripe_Payment_Gateway {
130
 
131
  $icons_str = '';
132
 
133
- $icons_str .= $icons['giropay'];
134
 
135
  return apply_filters( 'woocommerce_gateway_icon', $icons_str, $this->id );
136
  }
@@ -174,7 +177,7 @@ class WC_Gateway_Stripe_Giropay extends WC_Stripe_Payment_Gateway {
174
 
175
  if ( is_add_payment_method_page() ) {
176
  $pay_button_text = __( 'Add Payment', 'woocommerce-gateway-stripe' );
177
- $total = '';
178
  } else {
179
  $pay_button_text = '';
180
  }
@@ -200,8 +203,8 @@ class WC_Gateway_Stripe_Giropay extends WC_Stripe_Payment_Gateway {
200
  * @return mixed
201
  */
202
  public function create_source( $order ) {
203
- $currency = WC_Stripe_Helper::is_pre_30() ? $order->get_order_currency() : $order->get_currency();
204
- $order_id = WC_Stripe_Helper::is_pre_30() ? $order->id : $order->get_id();
205
  $return_url = $this->get_stripe_return_url( $order );
206
  $post_data = array();
207
  $post_data['amount'] = WC_Stripe_Helper::get_stripe_amount( $order->get_total(), $currency );
@@ -241,7 +244,7 @@ class WC_Gateway_Stripe_Giropay extends WC_Stripe_Payment_Gateway {
241
  $create_account = ! empty( $_POST['createaccount'] ) ? true : false;
242
 
243
  if ( $create_account ) {
244
- $new_customer_id = WC_Stripe_Helper::is_pre_30() ? $order->customer_user : $order->get_customer_id();
245
  $new_stripe_customer = new WC_Stripe_Customer( $new_customer_id );
246
  $new_stripe_customer->create_customer();
247
  }
@@ -254,7 +257,7 @@ class WC_Gateway_Stripe_Giropay extends WC_Stripe_Payment_Gateway {
254
  throw new WC_Stripe_Exception( print_r( $response, true ), $response->error->message );
255
  }
256
 
257
- if ( WC_Stripe_Helper::is_pre_30() ) {
258
  update_post_meta( $order_id, '_stripe_source_id', $response->id );
259
  } else {
260
  $order->update_meta_data( '_stripe_source_id', $response->id );
56
  * Constructor
57
  */
58
  public function __construct() {
59
+ $this->id = 'stripe_giropay';
60
+ $this->method_title = __( 'Stripe Giropay', 'woocommerce-gateway-stripe' );
61
  /* translators: link */
62
+ $this->method_description = sprintf( __( 'All other general Stripe settings can be adjusted <a href="%s">here</a>.', 'woocommerce-gateway-stripe' ), admin_url( 'admin.php?page=wc-settings&tab=checkout&section=stripe' ) );
63
+ $this->supports = array(
64
  'products',
65
  'refunds',
66
  );
98
  * @return array
99
  */
100
  public function get_supported_currency() {
101
+ return apply_filters(
102
+ 'wc_stripe_giropay_supported_currencies',
103
+ array(
104
+ 'EUR',
105
+ )
106
+ );
107
  }
108
 
109
  /**
133
 
134
  $icons_str = '';
135
 
136
+ $icons_str .= isset( $icons['giropay'] ) ? $icons['giropay'] : '';
137
 
138
  return apply_filters( 'woocommerce_gateway_icon', $icons_str, $this->id );
139
  }
177
 
178
  if ( is_add_payment_method_page() ) {
179
  $pay_button_text = __( 'Add Payment', 'woocommerce-gateway-stripe' );
180
+ $total = '';
181
  } else {
182
  $pay_button_text = '';
183
  }
203
  * @return mixed
204
  */
205
  public function create_source( $order ) {
206
+ $currency = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->get_order_currency() : $order->get_currency();
207
+ $order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();
208
  $return_url = $this->get_stripe_return_url( $order );
209
  $post_data = array();
210
  $post_data['amount'] = WC_Stripe_Helper::get_stripe_amount( $order->get_total(), $currency );
244
  $create_account = ! empty( $_POST['createaccount'] ) ? true : false;
245
 
246
  if ( $create_account ) {
247
+ $new_customer_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->customer_user : $order->get_customer_id();
248
  $new_stripe_customer = new WC_Stripe_Customer( $new_customer_id );
249
  $new_stripe_customer->create_customer();
250
  }
257
  throw new WC_Stripe_Exception( print_r( $response, true ), $response->error->message );
258
  }
259
 
260
+ if ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ) {
261
  update_post_meta( $order_id, '_stripe_source_id', $response->id );
262
  } else {
263
  $order->update_meta_data( '_stripe_source_id', $response->id );
includes/payment-methods/class-wc-gateway-stripe-ideal.php CHANGED
@@ -56,11 +56,11 @@ class WC_Gateway_Stripe_Ideal extends WC_Stripe_Payment_Gateway {
56
  * Constructor
57
  */
58
  public function __construct() {
59
- $this->id = 'stripe_ideal';
60
- $this->method_title = __( 'Stripe iDeal', 'woocommerce-gateway-stripe' );
61
  /* translators: link */
62
- $this->method_description = sprintf( __( 'All other general Stripe settings can be adjusted <a href="%s">here</a>.', 'woocommerce-gateway-stripe' ), admin_url( 'admin.php?page=wc-settings&tab=checkout&section=stripe' ) );
63
- $this->supports = array(
64
  'products',
65
  'refunds',
66
  );
@@ -98,9 +98,12 @@ class WC_Gateway_Stripe_Ideal extends WC_Stripe_Payment_Gateway {
98
  * @return array
99
  */
100
  public function get_supported_currency() {
101
- return apply_filters( 'wc_stripe_ideal_supported_currencies', array(
102
- 'EUR',
103
- ) );
 
 
 
104
  }
105
 
106
  /**
@@ -130,7 +133,7 @@ class WC_Gateway_Stripe_Ideal extends WC_Stripe_Payment_Gateway {
130
 
131
  $icons_str = '';
132
 
133
- $icons_str .= $icons['ideal'];
134
 
135
  return apply_filters( 'woocommerce_gateway_icon', $icons_str, $this->id );
136
  }
@@ -174,7 +177,7 @@ class WC_Gateway_Stripe_Ideal extends WC_Stripe_Payment_Gateway {
174
 
175
  if ( is_add_payment_method_page() ) {
176
  $pay_button_text = __( 'Add Payment', 'woocommerce-gateway-stripe' );
177
- $total = '';
178
  } else {
179
  $pay_button_text = '';
180
  }
@@ -200,8 +203,8 @@ class WC_Gateway_Stripe_Ideal extends WC_Stripe_Payment_Gateway {
200
  * @return mixed
201
  */
202
  public function create_source( $order ) {
203
- $currency = WC_Stripe_Helper::is_pre_30() ? $order->get_order_currency() : $order->get_currency();
204
- $order_id = WC_Stripe_Helper::is_pre_30() ? $order->id : $order->get_id();
205
  $return_url = $this->get_stripe_return_url( $order );
206
  $post_data = array();
207
  $post_data['amount'] = WC_Stripe_Helper::get_stripe_amount( $order->get_total(), $currency );
@@ -241,7 +244,7 @@ class WC_Gateway_Stripe_Ideal extends WC_Stripe_Payment_Gateway {
241
  $create_account = ! empty( $_POST['createaccount'] ) ? true : false;
242
 
243
  if ( $create_account ) {
244
- $new_customer_id = WC_Stripe_Helper::is_pre_30() ? $order->customer_user : $order->get_customer_id();
245
  $new_stripe_customer = new WC_Stripe_Customer( $new_customer_id );
246
  $new_stripe_customer->create_customer();
247
  }
@@ -254,7 +257,7 @@ class WC_Gateway_Stripe_Ideal extends WC_Stripe_Payment_Gateway {
254
  throw new WC_Stripe_Exception( print_r( $response, true ), $response->error->message );
255
  }
256
 
257
- if ( WC_Stripe_Helper::is_pre_30() ) {
258
  update_post_meta( $order_id, '_stripe_source_id', $response->id );
259
  } else {
260
  $order->update_meta_data( '_stripe_source_id', $response->id );
56
  * Constructor
57
  */
58
  public function __construct() {
59
+ $this->id = 'stripe_ideal';
60
+ $this->method_title = __( 'Stripe iDeal', 'woocommerce-gateway-stripe' );
61
  /* translators: link */
62
+ $this->method_description = sprintf( __( 'All other general Stripe settings can be adjusted <a href="%s">here</a>.', 'woocommerce-gateway-stripe' ), admin_url( 'admin.php?page=wc-settings&tab=checkout&section=stripe' ) );
63
+ $this->supports = array(
64
  'products',
65
  'refunds',
66
  );
98
  * @return array
99
  */
100
  public function get_supported_currency() {
101
+ return apply_filters(
102
+ 'wc_stripe_ideal_supported_currencies',
103
+ array(
104
+ 'EUR',
105
+ )
106
+ );
107
  }
108
 
109
  /**
133
 
134
  $icons_str = '';
135
 
136
+ $icons_str .= isset( $icons['ideal'] ) ? $icons['ideal'] : '';
137
 
138
  return apply_filters( 'woocommerce_gateway_icon', $icons_str, $this->id );
139
  }
177
 
178
  if ( is_add_payment_method_page() ) {
179
  $pay_button_text = __( 'Add Payment', 'woocommerce-gateway-stripe' );
180
+ $total = '';
181
  } else {
182
  $pay_button_text = '';
183
  }
203
  * @return mixed
204
  */
205
  public function create_source( $order ) {
206
+ $currency = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->get_order_currency() : $order->get_currency();
207
+ $order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();
208
  $return_url = $this->get_stripe_return_url( $order );
209
  $post_data = array();
210
  $post_data['amount'] = WC_Stripe_Helper::get_stripe_amount( $order->get_total(), $currency );
244
  $create_account = ! empty( $_POST['createaccount'] ) ? true : false;
245
 
246
  if ( $create_account ) {
247
+ $new_customer_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->customer_user : $order->get_customer_id();
248
  $new_stripe_customer = new WC_Stripe_Customer( $new_customer_id );
249
  $new_stripe_customer->create_customer();
250
  }
257
  throw new WC_Stripe_Exception( print_r( $response, true ), $response->error->message );
258
  }
259
 
260
+ if ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ) {
261
  update_post_meta( $order_id, '_stripe_source_id', $response->id );
262
  } else {
263
  $order->update_meta_data( '_stripe_source_id', $response->id );
includes/payment-methods/class-wc-gateway-stripe-multibanco.php CHANGED
@@ -56,11 +56,11 @@ class WC_Gateway_Stripe_Multibanco extends WC_Stripe_Payment_Gateway {
56
  * Constructor
57
  */
58
  public function __construct() {
59
- $this->id = 'stripe_multibanco';
60
- $this->method_title = __( 'Stripe Multibanco', 'woocommerce-gateway-stripe' );
61
  /* translators: link */
62
- $this->method_description = sprintf( __( 'All other general Stripe settings can be adjusted <a href="%s">here</a>.', 'woocommerce-gateway-stripe' ), admin_url( 'admin.php?page=wc-settings&tab=checkout&section=stripe' ) );
63
- $this->supports = array(
64
  'products',
65
  'refunds',
66
  );
@@ -102,9 +102,12 @@ class WC_Gateway_Stripe_Multibanco extends WC_Stripe_Payment_Gateway {
102
  * @return array
103
  */
104
  public function get_supported_currency() {
105
- return apply_filters( 'wc_stripe_multibanco_supported_currencies', array(
106
- 'EUR',
107
- ) );
 
 
 
108
  }
109
 
110
  /**
@@ -134,7 +137,7 @@ class WC_Gateway_Stripe_Multibanco extends WC_Stripe_Payment_Gateway {
134
 
135
  $icons_str = '';
136
 
137
- $icons_str .= $icons['multibanco'];
138
 
139
  return apply_filters( 'woocommerce_gateway_icon', $icons_str, $this->id );
140
  }
@@ -178,7 +181,7 @@ class WC_Gateway_Stripe_Multibanco extends WC_Stripe_Payment_Gateway {
178
 
179
  if ( is_add_payment_method_page() ) {
180
  $pay_button_text = __( 'Add Payment', 'woocommerce-gateway-stripe' );
181
- $total = '';
182
  } else {
183
  $pay_button_text = '';
184
  }
@@ -214,9 +217,9 @@ class WC_Gateway_Stripe_Multibanco extends WC_Stripe_Payment_Gateway {
214
  * @param bool $plain_text
215
  */
216
  public function email_instructions( $order, $sent_to_admin, $plain_text = false ) {
217
- $order_id = WC_Stripe_Helper::is_pre_30() ? $order->id : $order->get_id();
218
 
219
- $payment_method = WC_Stripe_Helper::is_pre_30() ? $order->payment_method : $order->get_payment_method();
220
 
221
  if ( ! $sent_to_admin && 'stripe_multibanco' === $payment_method && $order->has_status( 'on-hold' ) ) {
222
  WC_Stripe_Logger::log( 'Sending multibanco email for order #' . $order_id );
@@ -282,7 +285,7 @@ class WC_Gateway_Stripe_Multibanco extends WC_Stripe_Payment_Gateway {
282
  'reference' => $source_object->multibanco->reference,
283
  );
284
 
285
- $order_id = WC_Stripe_Helper::is_pre_30() ? $order->id : $order->get_id();
286
 
287
  update_post_meta( $order_id, '_stripe_multibanco', $data );
288
  }
@@ -296,8 +299,8 @@ class WC_Gateway_Stripe_Multibanco extends WC_Stripe_Payment_Gateway {
296
  * @return mixed
297
  */
298
  public function create_source( $order ) {
299
- $currency = WC_Stripe_Helper::is_pre_30() ? $order->get_order_currency() : $order->get_currency();
300
- $order_id = WC_Stripe_Helper::is_pre_30() ? $order->id : $order->get_id();
301
  $return_url = $this->get_stripe_return_url( $order );
302
  $post_data = array();
303
  $post_data['amount'] = WC_Stripe_Helper::get_stripe_amount( $order->get_total(), $currency );
@@ -337,7 +340,7 @@ class WC_Gateway_Stripe_Multibanco extends WC_Stripe_Payment_Gateway {
337
  $create_account = ! empty( $_POST['createaccount'] ) ? true : false;
338
 
339
  if ( $create_account ) {
340
- $new_customer_id = WC_Stripe_Helper::is_pre_30() ? $order->customer_user : $order->get_customer_id();
341
  $new_stripe_customer = new WC_Stripe_Customer( $new_customer_id );
342
  $new_stripe_customer->create_customer();
343
  }
@@ -350,7 +353,7 @@ class WC_Gateway_Stripe_Multibanco extends WC_Stripe_Payment_Gateway {
350
  throw new Exception( $response->error->message );
351
  }
352
 
353
- if ( WC_Stripe_Helper::is_pre_30() ) {
354
  update_post_meta( $order_id, '_stripe_source_id', $response->id );
355
  } else {
356
  $order->update_meta_data( '_stripe_source_id', $response->id );
56
  * Constructor
57
  */
58
  public function __construct() {
59
+ $this->id = 'stripe_multibanco';
60
+ $this->method_title = __( 'Stripe Multibanco', 'woocommerce-gateway-stripe' );
61
  /* translators: link */
62
+ $this->method_description = sprintf( __( 'All other general Stripe settings can be adjusted <a href="%s">here</a>.', 'woocommerce-gateway-stripe' ), admin_url( 'admin.php?page=wc-settings&tab=checkout&section=stripe' ) );
63
+ $this->supports = array(
64
  'products',
65
  'refunds',
66
  );
102
  * @return array
103
  */
104
  public function get_supported_currency() {
105
+ return apply_filters(
106
+ 'wc_stripe_multibanco_supported_currencies',
107
+ array(
108
+ 'EUR',
109
+ )
110
+ );
111
  }
112
 
113
  /**
137
 
138
  $icons_str = '';
139
 
140
+ $icons_str .= isset( $icons['multibanco'] ) ? $icons['multibanco'] : '';
141
 
142
  return apply_filters( 'woocommerce_gateway_icon', $icons_str, $this->id );
143
  }
181
 
182
  if ( is_add_payment_method_page() ) {
183
  $pay_button_text = __( 'Add Payment', 'woocommerce-gateway-stripe' );
184
+ $total = '';
185
  } else {
186
  $pay_button_text = '';
187
  }
217
  * @param bool $plain_text
218
  */
219
  public function email_instructions( $order, $sent_to_admin, $plain_text = false ) {
220
+ $order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();
221
 
222
+ $payment_method = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->payment_method : $order->get_payment_method();
223
 
224
  if ( ! $sent_to_admin && 'stripe_multibanco' === $payment_method && $order->has_status( 'on-hold' ) ) {
225
  WC_Stripe_Logger::log( 'Sending multibanco email for order #' . $order_id );
285
  'reference' => $source_object->multibanco->reference,
286
  );
287
 
288
+ $order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();
289
 
290
  update_post_meta( $order_id, '_stripe_multibanco', $data );
291
  }
299
  * @return mixed
300
  */
301
  public function create_source( $order ) {
302
+ $currency = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->get_order_currency() : $order->get_currency();
303
+ $order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();
304
  $return_url = $this->get_stripe_return_url( $order );
305
  $post_data = array();
306
  $post_data['amount'] = WC_Stripe_Helper::get_stripe_amount( $order->get_total(), $currency );
340
  $create_account = ! empty( $_POST['createaccount'] ) ? true : false;
341
 
342
  if ( $create_account ) {
343
+ $new_customer_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->customer_user : $order->get_customer_id();
344
  $new_stripe_customer = new WC_Stripe_Customer( $new_customer_id );
345
  $new_stripe_customer->create_customer();
346
  }
353
  throw new Exception( $response->error->message );
354
  }
355
 
356
+ if ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ) {
357
  update_post_meta( $order_id, '_stripe_source_id', $response->id );
358
  } else {
359
  $order->update_meta_data( '_stripe_source_id', $response->id );
includes/payment-methods/class-wc-gateway-stripe-p24.php CHANGED
@@ -56,11 +56,11 @@ class WC_Gateway_Stripe_P24 extends WC_Stripe_Payment_Gateway {
56
  * Constructor
57
  */
58
  public function __construct() {
59
- $this->id = 'stripe_p24';
60
- $this->method_title = __( 'Stripe P24', 'woocommerce-gateway-stripe' );
61
  /* translators: link */
62
- $this->method_description = sprintf( __( 'All other general Stripe settings can be adjusted <a href="%s">here</a>.', 'woocommerce-gateway-stripe' ), admin_url( 'admin.php?page=wc-settings&tab=checkout&section=stripe' ) );
63
- $this->supports = array(
64
  'products',
65
  'refunds',
66
  );
@@ -98,10 +98,13 @@ class WC_Gateway_Stripe_P24 extends WC_Stripe_Payment_Gateway {
98
  * @return array
99
  */
100
  public function get_supported_currency() {
101
- return apply_filters( 'wc_stripe_p24_supported_currencies', array(
102
- 'EUR',
103
- 'PLN',
104
- ) );
 
 
 
105
  }
106
 
107
  /**
@@ -131,7 +134,7 @@ class WC_Gateway_Stripe_P24 extends WC_Stripe_Payment_Gateway {
131
 
132
  $icons_str = '';
133
 
134
- $icons_str .= $icons['p24'];
135
 
136
  return apply_filters( 'woocommerce_gateway_icon', $icons_str, $this->id );
137
  }
@@ -175,7 +178,7 @@ class WC_Gateway_Stripe_P24 extends WC_Stripe_Payment_Gateway {
175
 
176
  if ( is_add_payment_method_page() ) {
177
  $pay_button_text = __( 'Add Payment', 'woocommerce-gateway-stripe' );
178
- $total = '';
179
  } else {
180
  $pay_button_text = '';
181
  }
@@ -201,8 +204,8 @@ class WC_Gateway_Stripe_P24 extends WC_Stripe_Payment_Gateway {
201
  * @return mixed
202
  */
203
  public function create_source( $order ) {
204
- $currency = WC_Stripe_Helper::is_pre_30() ? $order->get_order_currency() : $order->get_currency();
205
- $order_id = WC_Stripe_Helper::is_pre_30() ? $order->id : $order->get_id();
206
  $return_url = $this->get_stripe_return_url( $order );
207
  $post_data = array();
208
  $post_data['amount'] = WC_Stripe_Helper::get_stripe_amount( $order->get_total(), $currency );
@@ -238,7 +241,7 @@ class WC_Gateway_Stripe_P24 extends WC_Stripe_Payment_Gateway {
238
  $create_account = ! empty( $_POST['createaccount'] ) ? true : false;
239
 
240
  if ( $create_account ) {
241
- $new_customer_id = WC_Stripe_Helper::is_pre_30() ? $order->customer_user : $order->get_customer_id();
242
  $new_stripe_customer = new WC_Stripe_Customer( $new_customer_id );
243
  $new_stripe_customer->create_customer();
244
  }
@@ -251,7 +254,7 @@ class WC_Gateway_Stripe_P24 extends WC_Stripe_Payment_Gateway {
251
  throw new WC_Stripe_Exception( print_r( $response, true ), $response->error->message );
252
  }
253
 
254
- if ( WC_Stripe_Helper::is_pre_30() ) {
255
  update_post_meta( $order_id, '_stripe_source_id', $response->id );
256
  } else {
257
  $order->update_meta_data( '_stripe_source_id', $response->id );
56
  * Constructor
57
  */
58
  public function __construct() {
59
+ $this->id = 'stripe_p24';
60
+ $this->method_title = __( 'Stripe P24', 'woocommerce-gateway-stripe' );
61
  /* translators: link */
62
+ $this->method_description = sprintf( __( 'All other general Stripe settings can be adjusted <a href="%s">here</a>.', 'woocommerce-gateway-stripe' ), admin_url( 'admin.php?page=wc-settings&tab=checkout&section=stripe' ) );
63
+ $this->supports = array(
64
  'products',
65
  'refunds',
66
  );
98
  * @return array
99
  */
100
  public function get_supported_currency() {
101
+ return apply_filters(
102
+ 'wc_stripe_p24_supported_currencies',
103
+ array(
104
+ 'EUR',
105
+ 'PLN',
106
+ )
107
+ );
108
  }
109
 
110
  /**
134
 
135
  $icons_str = '';
136
 
137
+ $icons_str .= isset( $icons['p24'] ) ? $icons['p24'] : '';
138
 
139
  return apply_filters( 'woocommerce_gateway_icon', $icons_str, $this->id );
140
  }
178
 
179
  if ( is_add_payment_method_page() ) {
180
  $pay_button_text = __( 'Add Payment', 'woocommerce-gateway-stripe' );
181
+ $total = '';
182
  } else {
183
  $pay_button_text = '';
184
  }
204
  * @return mixed
205
  */
206
  public function create_source( $order ) {
207
+ $currency = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->get_order_currency() : $order->get_currency();
208
+ $order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();
209
  $return_url = $this->get_stripe_return_url( $order );
210
  $post_data = array();
211
  $post_data['amount'] = WC_Stripe_Helper::get_stripe_amount( $order->get_total(), $currency );
241
  $create_account = ! empty( $_POST['createaccount'] ) ? true : false;
242
 
243
  if ( $create_account ) {
244
+ $new_customer_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->customer_user : $order->get_customer_id();
245
  $new_stripe_customer = new WC_Stripe_Customer( $new_customer_id );
246
  $new_stripe_customer->create_customer();
247
  }
254
  throw new WC_Stripe_Exception( print_r( $response, true ), $response->error->message );
255
  }
256
 
257
+ if ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ) {
258
  update_post_meta( $order_id, '_stripe_source_id', $response->id );
259
  } else {
260
  $order->update_meta_data( '_stripe_source_id', $response->id );
includes/payment-methods/class-wc-gateway-stripe-sepa.php CHANGED
@@ -70,13 +70,13 @@ class WC_Gateway_Stripe_Sepa extends WC_Stripe_Payment_Gateway {
70
  * Constructor
71
  */
72
  public function __construct() {
73
- $this->retry_interval = 1;
74
- $this->id = 'stripe_sepa';
75
- $this->method_title = __( 'Stripe SEPA Direct Debit', 'woocommerce-gateway-stripe' );
76
  /* translators: link */
77
- $this->method_description = sprintf( __( 'All other general Stripe settings can be adjusted <a href="%s">here</a>.', 'woocommerce-gateway-stripe' ), admin_url( 'admin.php?page=wc-settings&tab=checkout&section=stripe' ) );
78
- $this->has_fields = true;
79
- $this->supports = array(
80
  'products',
81
  'refunds',
82
  'tokenization',
@@ -133,9 +133,12 @@ class WC_Gateway_Stripe_Sepa extends WC_Stripe_Payment_Gateway {
133
  * @return array
134
  */
135
  public function get_supported_currency() {
136
- return apply_filters( 'wc_stripe_sepa_supported_currencies', array(
137
- 'EUR',
138
- ) );
 
 
 
139
  }
140
 
141
  /**
@@ -169,7 +172,7 @@ class WC_Gateway_Stripe_Sepa extends WC_Stripe_Payment_Gateway {
169
 
170
  $icons_str = '';
171
 
172
- $icons_str .= $icons['sepa'];
173
 
174
  return apply_filters( 'woocommerce_gateway_icon', $icons_str, $this->id );
175
  }
@@ -244,7 +247,8 @@ class WC_Gateway_Stripe_Sepa extends WC_Stripe_Payment_Gateway {
244
  public function payment_fields() {
245
  $total = WC()->cart->total;
246
  $display_tokenization = $this->supports( 'tokenization' ) && is_checkout() && $this->saved_cards;
247
- $description = ! empty( $this->get_description() ) ? $this->get_description() : '';
 
248
 
249
  // If paying from order, we need to get total from order not cart.
250
  if ( isset( $_GET['pay_for_order'] ) && ! empty( $_GET['key'] ) ) {
@@ -280,6 +284,8 @@ class WC_Gateway_Stripe_Sepa extends WC_Stripe_Payment_Gateway {
280
  $this->save_payment_method_checkbox();
281
  }
282
 
 
 
283
  echo '</div>';
284
  }
285
 
@@ -306,7 +312,7 @@ class WC_Gateway_Stripe_Sepa extends WC_Stripe_Payment_Gateway {
306
  $create_account = ! empty( $_POST['createaccount'] ) ? true : false;
307
 
308
  if ( $create_account ) {
309
- $new_customer_id = WC_Stripe_Helper::is_pre_30() ? $order->customer_user : $order->get_customer_id();
310
  $new_stripe_customer = new WC_Stripe_Customer( $new_customer_id );
311
  $new_stripe_customer->create_customer();
312
  }
@@ -330,7 +336,7 @@ class WC_Gateway_Stripe_Sepa extends WC_Stripe_Payment_Gateway {
330
  if ( ! empty( $response->error ) ) {
331
  // Customer param wrong? The user may have been deleted on stripe's end. Remove customer_id. Can be retried without.
332
  if ( $this->is_no_such_customer_error( $response->error ) ) {
333
- if ( WC_Stripe_Helper::is_pre_30() ) {
334
  delete_user_meta( $order->customer_user, '_stripe_customer_id' );
335
  delete_post_meta( $order_id, '_stripe_customer_id' );
336
  } else {
70
  * Constructor
71
  */
72
  public function __construct() {
73
+ $this->retry_interval = 1;
74
+ $this->id = 'stripe_sepa';
75
+ $this->method_title = __( 'Stripe SEPA Direct Debit', 'woocommerce-gateway-stripe' );
76
  /* translators: link */
77
+ $this->method_description = sprintf( __( 'All other general Stripe settings can be adjusted <a href="%s">here</a>.', 'woocommerce-gateway-stripe' ), admin_url( 'admin.php?page=wc-settings&tab=checkout&section=stripe' ) );
78
+ $this->has_fields = true;
79
+ $this->supports = array(
80
  'products',
81
  'refunds',
82
  'tokenization',
133
  * @return array
134
  */
135
  public function get_supported_currency() {
136
+ return apply_filters(
137
+ 'wc_stripe_sepa_supported_currencies',
138
+ array(
139
+ 'EUR',
140
+ )
141
+ );
142
  }
143
 
144
  /**
172
 
173
  $icons_str = '';
174
 
175
+ $icons_str .= isset( $icons['sepa'] ) ? $icons['sepa'] : '';
176
 
177
  return apply_filters( 'woocommerce_gateway_icon', $icons_str, $this->id );
178
  }
247
  public function payment_fields() {
248
  $total = WC()->cart->total;
249
  $display_tokenization = $this->supports( 'tokenization' ) && is_checkout() && $this->saved_cards;
250
+ $description = $this->get_description();
251
+ $description = ! empty( $description ) ? $description : '';
252
 
253
  // If paying from order, we need to get total from order not cart.
254
  if ( isset( $_GET['pay_for_order'] ) && ! empty( $_GET['key'] ) ) {
284
  $this->save_payment_method_checkbox();
285
  }
286
 
287
+ do_action( 'wc_stripe_sepa_payment_fields', $this->id );
288
+
289
  echo '</div>';
290
  }
291
 
312
  $create_account = ! empty( $_POST['createaccount'] ) ? true : false;
313
 
314
  if ( $create_account ) {
315
+ $new_customer_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->customer_user : $order->get_customer_id();
316
  $new_stripe_customer = new WC_Stripe_Customer( $new_customer_id );
317
  $new_stripe_customer->create_customer();
318
  }
336
  if ( ! empty( $response->error ) ) {
337
  // Customer param wrong? The user may have been deleted on stripe's end. Remove customer_id. Can be retried without.
338
  if ( $this->is_no_such_customer_error( $response->error ) ) {
339
+ if ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ) {
340
  delete_user_meta( $order->customer_user, '_stripe_customer_id' );
341
  delete_post_meta( $order_id, '_stripe_customer_id' );
342
  } else {
includes/payment-methods/class-wc-gateway-stripe-sofort.php CHANGED
@@ -56,11 +56,11 @@ class WC_Gateway_Stripe_Sofort extends WC_Stripe_Payment_Gateway {
56
  * Constructor
57
  */
58
  public function __construct() {
59
- $this->id = 'stripe_sofort';
60
- $this->method_title = __( 'Stripe SOFORT', 'woocommerce-gateway-stripe' );
61
  /* translators: link */
62
- $this->method_description = sprintf( __( 'All other general Stripe settings can be adjusted <a href="%s">here</a>.', 'woocommerce-gateway-stripe' ), admin_url( 'admin.php?page=wc-settings&tab=checkout&section=stripe' ) );
63
- $this->supports = array(
64
  'products',
65
  'refunds',
66
  );
@@ -98,9 +98,12 @@ class WC_Gateway_Stripe_Sofort extends WC_Stripe_Payment_Gateway {
98
  * @return array
99
  */
100
  public function get_supported_currency() {
101
- return apply_filters( 'wc_stripe_sofort_supported_currencies', array(
102
- 'EUR',
103
- ) );
 
 
 
104
  }
105
 
106
  /**
@@ -130,7 +133,7 @@ class WC_Gateway_Stripe_Sofort extends WC_Stripe_Payment_Gateway {
130
 
131
  $icons_str = '';
132
 
133
- $icons_str .= $icons['sofort'];
134
 
135
  return apply_filters( 'woocommerce_gateway_icon', $icons_str, $this->id );
136
  }
@@ -174,7 +177,7 @@ class WC_Gateway_Stripe_Sofort extends WC_Stripe_Payment_Gateway {
174
 
175
  if ( is_add_payment_method_page() ) {
176
  $pay_button_text = __( 'Add Payment', 'woocommerce-gateway-stripe' );
177
- $total = '';
178
  } else {
179
  $pay_button_text = '';
180
  }
@@ -200,8 +203,8 @@ class WC_Gateway_Stripe_Sofort extends WC_Stripe_Payment_Gateway {
200
  * @return mixed
201
  */
202
  public function create_source( $order ) {
203
- $currency = WC_Stripe_Helper::is_pre_30() ? $order->get_order_currency() : $order->get_currency();
204
- $bank_country = WC_Stripe_Helper::is_pre_30() ? $order->billing_country : $order->get_billing_country();
205
  $return_url = $this->get_stripe_return_url( $order );
206
  $post_data = array();
207
  $post_data['amount'] = WC_Stripe_Helper::get_stripe_amount( $order->get_total(), $currency );
@@ -245,7 +248,7 @@ class WC_Gateway_Stripe_Sofort extends WC_Stripe_Payment_Gateway {
245
  $create_account = ! empty( $_POST['createaccount'] ) ? true : false;
246
 
247
  if ( $create_account ) {
248
- $new_customer_id = WC_Stripe_Helper::is_pre_30() ? $order->customer_user : $order->get_customer_id();
249
  $new_stripe_customer = new WC_Stripe_Customer( $new_customer_id );
250
  $new_stripe_customer->create_customer();
251
  }
@@ -266,7 +269,7 @@ class WC_Gateway_Stripe_Sofort extends WC_Stripe_Payment_Gateway {
266
  throw new WC_Stripe_Exception( print_r( $response, true ), $localized_message );
267
  }
268
 
269
- if ( WC_Stripe_Helper::is_pre_30() ) {
270
  update_post_meta( $order_id, '_stripe_source_id', $response->id );
271
  } else {
272
  $order->update_meta_data( '_stripe_source_id', $response->id );
56
  * Constructor
57
  */
58
  public function __construct() {
59
+ $this->id = 'stripe_sofort';
60
+ $this->method_title = __( 'Stripe SOFORT', 'woocommerce-gateway-stripe' );
61
  /* translators: link */
62
+ $this->method_description = sprintf( __( 'All other general Stripe settings can be adjusted <a href="%s">here</a>.', 'woocommerce-gateway-stripe' ), admin_url( 'admin.php?page=wc-settings&tab=checkout&section=stripe' ) );
63
+ $this->supports = array(
64
  'products',
65
  'refunds',
66
  );
98
  * @return array
99
  */
100
  public function get_supported_currency() {
101
+ return apply_filters(
102
+ 'wc_stripe_sofort_supported_currencies',
103
+ array(
104
+ 'EUR',
105
+ )
106
+ );
107
  }
108
 
109
  /**
133
 
134
  $icons_str = '';
135
 
136
+ $icons_str .= isset( $icons['sofort'] ) ? $icons['sofort'] : '';
137
 
138
  return apply_filters( 'woocommerce_gateway_icon', $icons_str, $this->id );
139
  }
177
 
178
  if ( is_add_payment_method_page() ) {
179
  $pay_button_text = __( 'Add Payment', 'woocommerce-gateway-stripe' );
180
+ $total = '';
181
  } else {
182
  $pay_button_text = '';
183
  }
203
  * @return mixed
204
  */
205
  public function create_source( $order ) {
206
+ $currency = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->get_order_currency() : $order->get_currency();
207
+ $bank_country = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->billing_country : $order->get_billing_country();
208
  $return_url = $this->get_stripe_return_url( $order );
209
  $post_data = array();
210
  $post_data['amount'] = WC_Stripe_Helper::get_stripe_amount( $order->get_total(), $currency );
248
  $create_account = ! empty( $_POST['createaccount'] ) ? true : false;
249
 
250
  if ( $create_account ) {
251
+ $new_customer_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->customer_user : $order->get_customer_id();
252
  $new_stripe_customer = new WC_Stripe_Customer( $new_customer_id );
253
  $new_stripe_customer->create_customer();
254
  }
269
  throw new WC_Stripe_Exception( print_r( $response, true ), $localized_message );
270
  }
271
 
272
+ if ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ) {
273
  update_post_meta( $order_id, '_stripe_source_id', $response->id );
274
  } else {
275
  $order->update_meta_data( '_stripe_source_id', $response->id );
includes/payment-methods/class-wc-stripe-payment-request.php CHANGED
@@ -179,7 +179,7 @@ class WC_Stripe_Payment_Request {
179
  * a new hook was added to WooCommerce 3.0. In older versions of WooCommerce,
180
  * CSS is used to position the button.
181
  */
182
- if ( WC_Stripe_Helper::is_pre_30() ) {
183
  add_action( 'woocommerce_after_add_to_cart_button', array( $this, 'display_payment_request_button_html' ), 1 );
184
  add_action( 'woocommerce_after_add_to_cart_button', array( $this, 'display_payment_request_button_separator_html' ), 2 );
185
  } else {
@@ -260,8 +260,8 @@ class WC_Stripe_Payment_Request {
260
  $items = array();
261
 
262
  $items[] = array(
263
- 'label' => WC_Stripe_Helper::is_pre_30() ? $product->name : $product->get_name(),
264
- 'amount' => WC_Stripe_Helper::get_stripe_amount( WC_Stripe_Helper::is_pre_30() ? $product->price : $product->get_price() ),
265
  );
266
 
267
  if ( wc_tax_enabled() ) {
@@ -290,7 +290,7 @@ class WC_Stripe_Payment_Request {
290
  $data['displayItems'] = $items;
291
  $data['total'] = array(
292
  'label' => apply_filters( 'wc_stripe_payment_request_total_label', $this->total_label ),
293
- 'amount' => WC_Stripe_Helper::get_stripe_amount( WC_Stripe_Helper::is_pre_30() ? $product->price : $product->get_price() ),
294
  'pending' => true,
295
  );
296
 
@@ -312,7 +312,7 @@ class WC_Stripe_Payment_Request {
312
  return $title;
313
  }
314
 
315
- if ( WC_Stripe_Helper::is_pre_30() ) {
316
  $method_title = get_post_meta( $post->ID, '_payment_method_title', true );
317
  } else {
318
  $order = wc_get_order( $post->ID );
@@ -380,7 +380,7 @@ class WC_Stripe_Payment_Request {
380
  $payment_request_type = wc_clean( $_POST['payment_request_type'] );
381
 
382
  if ( 'apple_pay' === $payment_request_type ) {
383
- if ( WC_Stripe_Helper::is_pre_30() ) {
384
  update_post_meta( $order_id, '_payment_method_title', 'Apple Pay (Stripe)' );
385
  } else {
386
  $order->set_payment_method_title( 'Apple Pay (Stripe)' );
@@ -389,7 +389,7 @@ class WC_Stripe_Payment_Request {
389
  }
390
 
391
  if ( 'payment_request_api' === $payment_request_type ) {
392
- if ( WC_Stripe_Helper::is_pre_30() ) {
393
  update_post_meta( $order_id, '_payment_method_title', 'Chrome Payment Request (Stripe)' );
394
  } else {
395
  $order->set_payment_method_title( 'Chrome Payment Request (Stripe)' );
@@ -432,7 +432,7 @@ class WC_Stripe_Payment_Request {
432
  foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
433
  $_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key );
434
 
435
- if ( ! in_array( ( WC_Stripe_Helper::is_pre_30() ? $_product->product_type : $_product->get_type() ), $this->supported_product_types() ) ) {
436
  return false;
437
  }
438
 
@@ -473,7 +473,7 @@ class WC_Stripe_Payment_Request {
473
 
474
  $product = wc_get_product( $post->ID );
475
 
476
- if ( ! is_object( $product ) || ! in_array( ( WC_Stripe_Helper::is_pre_30() ? $product->product_type : $product->get_type() ), $this->supported_product_types() ) ) {
477
  return;
478
  }
479
 
@@ -559,7 +559,7 @@ class WC_Stripe_Payment_Request {
559
  if ( is_product() ) {
560
  $product = wc_get_product( $post->ID );
561
 
562
- if ( ! is_object( $product ) || ! in_array( ( WC_Stripe_Helper::is_pre_30() ? $product->product_type : $product->get_type() ), $this->supported_product_types() ) ) {
563
  return;
564
  }
565
 
@@ -613,7 +613,7 @@ class WC_Stripe_Payment_Request {
613
  if ( is_product() ) {
614
  $product = wc_get_product( $post->ID );
615
 
616
- if ( ! is_object( $product ) || ! in_array( ( WC_Stripe_Helper::is_pre_30() ? $product->product_type : $product->get_type() ), $this->supported_product_types() ) ) {
617
  return;
618
  }
619
 
@@ -804,10 +804,10 @@ class WC_Stripe_Payment_Request {
804
  $product = wc_get_product( $product_id );
805
  $variation_id = null;
806
 
807
- if ( 'variable' === ( WC_Stripe_Helper::is_pre_30() ? $product->product_type : $product->get_type() ) && isset( $_POST['attributes'] ) ) {
808
  $attributes = array_map( 'wc_clean', $_POST['attributes'] );
809
 
810
- if ( WC_Stripe_Helper::is_pre_30() ) {
811
  $variation_id = $product->get_matching_variation( $attributes );
812
  } else {
813
  $data_store = WC_Data_Store::load( 'product' );
@@ -817,7 +817,7 @@ class WC_Stripe_Payment_Request {
817
  if ( ! empty( $variation_id ) ) {
818
  $product = wc_get_product( $variation_id );
819
  }
820
- } elseif ( 'simple' === ( WC_Stripe_Helper::is_pre_30() ? $product->product_type : $product->get_type() ) ) {
821
  $product = wc_get_product( $product_id );
822
  }
823
 
@@ -831,7 +831,7 @@ class WC_Stripe_Payment_Request {
831
  throw new Exception( sprintf( __( 'You cannot add that amount of "%1$s"; to the cart because there is not enough stock (%2$s remaining).', 'woocommerce-gateway-stripe' ), $product->get_name(), wc_format_stock_quantity_for_display( $product->get_stock_quantity(), $product ) ) );
832
  }
833
 
834
- $total = $qty * ( WC_Stripe_Helper::is_pre_30() ? $product->price : $product->get_price() );
835
 
836
  $quantity_label = 1 < $qty ? ' (x' . $qty . ')' : '';
837
 
@@ -839,7 +839,7 @@ class WC_Stripe_Payment_Request {
839
  $items = array();
840
 
841
  $items[] = array(
842
- 'label' => ( WC_Stripe_Helper::is_pre_30() ? $product->name : $product->get_name() ) . $quantity_label,
843
  'amount' => WC_Stripe_Helper::get_stripe_amount( $total ),
844
  );
845
 
@@ -879,7 +879,7 @@ class WC_Stripe_Payment_Request {
879
 
880
  wp_send_json( $data );
881
  } catch ( Exception $e ) {
882
- wp_send_json( array( 'error' => strip_tags( $e->getMessage() ) ) );
883
  }
884
  }
885
 
@@ -906,10 +906,10 @@ class WC_Stripe_Payment_Request {
906
  // First empty the cart to prevent wrong calculation.
907
  WC()->cart->empty_cart();
908
 
909
- if ( 'variable' === ( WC_Stripe_Helper::is_pre_30() ? $product->product_type : $product->get_type() ) && isset( $_POST['attributes'] ) ) {
910
  $attributes = array_map( 'wc_clean', $_POST['attributes'] );
911
 
912
- if ( WC_Stripe_Helper::is_pre_30() ) {
913
  $variation_id = $product->get_matching_variation( $attributes );
914
  } else {
915
  $data_store = WC_Data_Store::load( 'product' );
@@ -919,7 +919,7 @@ class WC_Stripe_Payment_Request {
919
  WC()->cart->add_to_cart( $product->get_id(), $qty, $variation_id, $attributes );
920
  }
921
 
922
- if ( 'simple' === ( WC_Stripe_Helper::is_pre_30() ? $product->product_type : $product->get_type() ) ) {
923
  WC()->cart->add_to_cart( $product->get_id(), $qty );
924
  }
925
 
@@ -1017,7 +1017,7 @@ class WC_Stripe_Payment_Request {
1017
  * to convert that to abbreviation as WC is expecting that.
1018
  */
1019
  if ( 2 < strlen( $state ) && ! empty( $wc_states ) ) {
1020
- $state = array_search( ucwords( strtolower( $state ) ), $wc_states );
1021
  }
1022
 
1023
  WC()->shipping->reset_shipping();
@@ -1030,11 +1030,11 @@ class WC_Stripe_Payment_Request {
1030
  WC()->customer->set_location( $country, $state, $postcode, $city );
1031
  WC()->customer->set_shipping_location( $country, $state, $postcode, $city );
1032
  } else {
1033
- WC_Stripe_Helper::is_pre_30() ? WC()->customer->set_to_base() : WC()->customer->set_billing_address_to_base();
1034
- WC_Stripe_Helper::is_pre_30() ? WC()->customer->set_shipping_to_base() : WC()->customer->set_shipping_address_to_base();
1035
  }
1036
 
1037
- if ( WC_Stripe_Helper::is_pre_30() ) {
1038
  WC()->customer->calculated_shipping( true );
1039
  } else {
1040
  WC()->customer->set_calculated_shipping( true );
@@ -1114,7 +1114,7 @@ class WC_Stripe_Payment_Request {
1114
  $subtotal += $cart_item['line_subtotal'];
1115
  $quantity_label = 1 < $cart_item['quantity'] ? ' (x' . $cart_item['quantity'] . ')' : '';
1116
 
1117
- $product_name = WC_Stripe_Helper::is_pre_30() ? $cart_item['data']->post->post_title : $cart_item['data']->get_name();
1118
 
1119
  $item = array(
1120
  'label' => $product_name . $quantity_label,
179
  * a new hook was added to WooCommerce 3.0. In older versions of WooCommerce,
180
  * CSS is used to position the button.
181
  */
182
+ if ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ) {
183
  add_action( 'woocommerce_after_add_to_cart_button', array( $this, 'display_payment_request_button_html' ), 1 );
184
  add_action( 'woocommerce_after_add_to_cart_button', array( $this, 'display_payment_request_button_separator_html' ), 2 );
185
  } else {
260
  $items = array();
261
 
262
  $items[] = array(
263
+ 'label' => WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $product->name : $product->get_name(),
264
+ 'amount' => WC_Stripe_Helper::get_stripe_amount( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $product->price : $product->get_price() ),
265
  );
266
 
267
  if ( wc_tax_enabled() ) {
290
  $data['displayItems'] = $items;
291
  $data['total'] = array(
292
  'label' => apply_filters( 'wc_stripe_payment_request_total_label', $this->total_label ),
293
+ 'amount' => WC_Stripe_Helper::get_stripe_amount( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $product->price : $product->get_price() ),
294
  'pending' => true,
295
  );
296
 
312
  return $title;
313
  }
314
 
315
+ if ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ) {
316
  $method_title = get_post_meta( $post->ID, '_payment_method_title', true );
317
  } else {
318
  $order = wc_get_order( $post->ID );
380
  $payment_request_type = wc_clean( $_POST['payment_request_type'] );
381
 
382
  if ( 'apple_pay' === $payment_request_type ) {
383
+ if ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ) {
384
  update_post_meta( $order_id, '_payment_method_title', 'Apple Pay (Stripe)' );
385
  } else {
386
  $order->set_payment_method_title( 'Apple Pay (Stripe)' );
389
  }
390
 
391
  if ( 'payment_request_api' === $payment_request_type ) {
392
+ if ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ) {
393
  update_post_meta( $order_id, '_payment_method_title', 'Chrome Payment Request (Stripe)' );
394
  } else {
395
  $order->set_payment_method_title( 'Chrome Payment Request (Stripe)' );
432
  foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
433
  $_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key );
434
 
435
+ if ( ! in_array( ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $_product->product_type : $_product->get_type() ), $this->supported_product_types() ) ) {
436
  return false;
437
  }
438
 
473
 
474
  $product = wc_get_product( $post->ID );
475
 
476
+ if ( ! is_object( $product ) || ! in_array( ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $product->product_type : $product->get_type() ), $this->supported_product_types() ) ) {
477
  return;
478
  }
479
 
559
  if ( is_product() ) {
560
  $product = wc_get_product( $post->ID );
561
 
562
+ if ( ! is_object( $product ) || ! in_array( ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $product->product_type : $product->get_type() ), $this->supported_product_types() ) ) {
563
  return;
564
  }
565
 
613
  if ( is_product() ) {
614
  $product = wc_get_product( $post->ID );
615
 
616
+ if ( ! is_object( $product ) || ! in_array( ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $product->product_type : $product->get_type() ), $this->supported_product_types() ) ) {
617
  return;
618
  }
619
 
804
  $product = wc_get_product( $product_id );
805
  $variation_id = null;
806
 
807
+ if ( 'variable' === ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $product->product_type : $product->get_type() ) && isset( $_POST['attributes'] ) ) {
808
  $attributes = array_map( 'wc_clean', $_POST['attributes'] );
809
 
810
+ if ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ) {
811
  $variation_id = $product->get_matching_variation( $attributes );
812
  } else {
813
  $data_store = WC_Data_Store::load( 'product' );
817
  if ( ! empty( $variation_id ) ) {
818
  $product = wc_get_product( $variation_id );
819
  }
820
+ } elseif ( 'simple' === ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $product->product_type : $product->get_type() ) ) {
821
  $product = wc_get_product( $product_id );
822
  }
823
 
831
  throw new Exception( sprintf( __( 'You cannot add that amount of "%1$s"; to the cart because there is not enough stock (%2$s remaining).', 'woocommerce-gateway-stripe' ), $product->get_name(), wc_format_stock_quantity_for_display( $product->get_stock_quantity(), $product ) ) );
832
  }
833
 
834
+ $total = $qty * ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $product->price : $product->get_price() );
835
 
836
  $quantity_label = 1 < $qty ? ' (x' . $qty . ')' : '';
837
 
839
  $items = array();
840
 
841
  $items[] = array(
842
+ 'label' => ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $product->name : $product->get_name() ) . $quantity_label,
843
  'amount' => WC_Stripe_Helper::get_stripe_amount( $total ),
844
  );
845
 
879
 
880
  wp_send_json( $data );
881
  } catch ( Exception $e ) {
882
+ wp_send_json( array( 'error' => wp_strip_all_tags( $e->getMessage() ) ) );
883
  }
884
  }
885
 
906
  // First empty the cart to prevent wrong calculation.
907
  WC()->cart->empty_cart();
908
 
909
+ if ( 'variable' === ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $product->product_type : $product->get_type() ) && isset( $_POST['attributes'] ) ) {
910
  $attributes = array_map( 'wc_clean', $_POST['attributes'] );
911
 
912
+ if ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ) {
913
  $variation_id = $product->get_matching_variation( $attributes );
914
  } else {
915
  $data_store = WC_Data_Store::load( 'product' );
919
  WC()->cart->add_to_cart( $product->get_id(), $qty, $variation_id, $attributes );
920
  }
921
 
922
+ if ( 'simple' === ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $product->product_type : $product->get_type() ) ) {
923
  WC()->cart->add_to_cart( $product->get_id(), $qty );
924
  }
925
 
1017
  * to convert that to abbreviation as WC is expecting that.
1018
  */
1019
  if ( 2 < strlen( $state ) && ! empty( $wc_states ) ) {
1020
+ $state = array_search( ucwords( strtolower( $state ) ), $wc_states, true );
1021
  }
1022
 
1023
  WC()->shipping->reset_shipping();
1030
  WC()->customer->set_location( $country, $state, $postcode, $city );
1031
  WC()->customer->set_shipping_location( $country, $state, $postcode, $city );
1032
  } else {
1033
+ WC_Stripe_Helper::is_wc_lt( '3.0' ) ? WC()->customer->set_to_base() : WC()->customer->set_billing_address_to_base();
1034
+ WC_Stripe_Helper::is_wc_lt( '3.0' ) ? WC()->customer->set_shipping_to_base() : WC()->customer->set_shipping_address_to_base();
1035
  }
1036
 
1037
+ if ( WC_Stripe_Helper::is_wc_lt( '3.0' ) ) {
1038
  WC()->customer->calculated_shipping( true );
1039
  } else {
1040
  WC()->customer->set_calculated_shipping( true );
1114
  $subtotal += $cart_item['line_subtotal'];
1115
  $quantity_label = 1 < $cart_item['quantity'] ? ' (x' . $cart_item['quantity'] . ')' : '';
1116
 
1117
+ $product_name = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $cart_item['data']->post->post_title : $cart_item['data']->get_name();
1118
 
1119
  $item = array(
1120
  'label' => $product_name . $quantity_label,
languages/woocommerce-gateway-stripe.pot CHANGED
@@ -1,145 +1,166 @@
1
- # <!=Copyright (C) 2018 WooCommerce
2
- # This file is distributed under the same license as the WooCommerce Stripe Gateway package.=!>
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WooCommerce Stripe Gateway 4.1.9\n"
6
- "Report-Msgid-Bugs-To: https://docs.woocommerce.com\n"
7
- "POT-Creation-Date: 2018-09-13 17:20:49+00:00\n"
 
8
  "MIME-Version: 1.0\n"
9
- "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "PO-Revision-Date: 2018-MO-DA HO:MI+ZONE\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
 
14
 
 
15
  #. translators: 1) webhook url
16
-
17
- #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:22
18
- msgid "You must add the following webhook endpoint <strong style=\"background-color:#ddd;\">&nbsp;%s&nbsp;</strong> to your <a href=\"https://dashboard.stripe.com/account/webhooks\" target=\"_blank\">Stripe account settings</a>. This will enable you to receive notifications on the charge statuses."
 
 
 
19
  msgstr ""
20
 
21
- #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:37
22
  msgid "Save payment information to my account for future purchases."
23
  msgstr ""
24
 
 
 
 
25
  #. translators: 1) dollar amount
26
  #. translators: minimum amount
27
-
28
- #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:254
29
- #: includes/compat/class-wc-stripe-sepa-subs-compat.php:175
30
- #: includes/compat/class-wc-stripe-subs-compat.php:190
31
  msgid "Sorry, the minimum allowed order total is %1$s to use this payment method."
32
  msgstr ""
33
 
 
34
  #. translators: 1) blog name 2) order number
35
-
36
- #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:350
37
  msgid "%1$s - Order %2$s"
38
  msgstr ""
39
 
40
- #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:377
41
  msgid "customer_name"
42
  msgstr ""
43
 
44
- #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:378
45
  msgid "customer_email"
46
  msgstr ""
47
 
 
48
  #. translators: transaction id
49
-
50
- #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:452
51
  msgid "Stripe charge awaiting payment: %s."
52
  msgstr ""
53
 
54
- #. translators: transaction id
55
-
56
- #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:459
57
- #: includes/class-wc-stripe-order-handler.php:249
58
  #: includes/class-wc-stripe-webhook-handler.php:314
59
- #: includes/class-wc-stripe-webhook-handler.php:362
 
60
  msgid "Stripe charge complete (Charge ID: %s)"
61
  msgstr ""
62
 
63
- #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:464
64
- #: includes/class-wc-gateway-stripe.php:706
65
- #: includes/compat/class-wc-stripe-sepa-subs-compat.php:134
66
- #: includes/compat/class-wc-stripe-subs-compat.php:96
67
  msgid "Payment processing failed. Please retry."
68
  msgstr ""
69
 
 
70
  #. translators: transaction id
71
-
72
- #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:476
73
- msgid "Stripe charge authorized (Charge ID: %s). Process order to take payment, or cancel to remove the pre-authorization."
74
  msgstr ""
75
 
76
- #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:702
77
  msgid "Invalid payment method. Please input a new card number."
78
  msgstr ""
79
 
 
80
  #. translators: 1) dollar amount 2) transaction id 3) refund message
81
-
82
- #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:974
83
  msgid "Refunded %1$s - Refund ID: %2$s - Reason: %3$s"
84
  msgstr ""
85
 
86
- #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:974
87
  msgid "Pre-Authorization Released"
88
  msgstr ""
89
 
90
- #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:992
91
- msgid "There was a problem adding the card."
92
  msgstr ""
93
 
 
94
  #. translators: 1) int version 2) int version
 
 
 
 
95
 
96
- #: includes/admin/class-wc-stripe-admin-notices.php:118
97
- msgid "WooCommerce Stripe - The minimum PHP version required for this plugin is %1$s. You are running %2$s."
 
 
 
 
 
98
  msgstr ""
99
 
 
100
  #. translators: 1) int version 2) int version
101
-
102
- #: includes/admin/class-wc-stripe-admin-notices.php:129
103
- msgid "WooCommerce Stripe - The minimum WooCommerce version required for this plugin is %1$s. You are running %2$s."
104
  msgstr ""
105
 
106
- #: includes/admin/class-wc-stripe-admin-notices.php:139
107
  msgid "WooCommerce Stripe - cURL is not installed."
108
  msgstr ""
109
 
 
110
  #. translators: 1) link
111
-
112
- #: includes/admin/class-wc-stripe-admin-notices.php:149
113
- msgid "Stripe is almost ready. To get started, <a href=\"%s\">set your Stripe account keys</a>."
114
  msgstr ""
115
 
 
116
  #. translators: 1) link
117
-
118
- #: includes/admin/class-wc-stripe-admin-notices.php:161
119
- msgid "Stripe is in test mode however your test keys may not be valid. Test keys start with pk_test and sk_test or rk_test. Please go to your settings and, <a href=\"%s\">set your Stripe account keys</a>."
 
120
  msgstr ""
121
 
 
122
  #. translators: 1) link
123
-
124
- #: includes/admin/class-wc-stripe-admin-notices.php:171
125
- msgid "Stripe is in live mode however your test keys may not be valid. Live keys start with pk_live and sk_live or rk_live. Please go to your settings and, <a href=\"%s\">set your Stripe account keys</a>."
 
126
  msgstr ""
127
 
 
128
  #. translators: 1) link
129
-
130
- #: includes/admin/class-wc-stripe-admin-notices.php:180
131
- msgid "Stripe is enabled, but a SSL certificate is not detected. Your checkout may not be secure! Please ensure your server has a valid <a href=\"%1$s\" target=\"_blank\">SSL certificate</a>"
 
132
  msgstr ""
133
 
134
- #: includes/admin/class-wc-stripe-admin-notices.php:203
135
- msgid "%s is enabled - it requires store currency to be set to %s"
 
136
  msgstr ""
137
 
138
- #: includes/admin/class-wc-stripe-admin-notices.php:217
139
  msgid "Action failed. Please refresh the page and retry."
140
  msgstr ""
141
 
142
- #: includes/admin/class-wc-stripe-admin-notices.php:221
143
  msgid "Cheatin&#8217; huh?"
144
  msgstr ""
145
 
@@ -174,644 +195,709 @@ msgid "Retains any Stripe data such as Stripe customer ID, source ID."
174
  msgstr ""
175
 
176
  #: includes/admin/class-wc-stripe-privacy.php:41
177
- #: includes/compat/class-wc-stripe-sepa-subs-compat.php:429
178
- #: includes/compat/class-wc-stripe-subs-compat.php:482
179
  #: includes/compat/class-wc-stripe-subs-compat.php:484
180
- #: includes/compat/class-wc-stripe-subs-compat.php:497
181
  #: includes/compat/class-wc-stripe-subs-compat.php:499
182
  msgid "N/A"
183
  msgstr ""
184
 
185
- #: includes/admin/class-wc-stripe-privacy.php:83
186
- msgid "By using this extension, you may be storing personal data or sharing data with an external service. <a href=\"%s\" target=\"_blank\">Learn more about how this works, including what you may want to include in your privacy policy.</a>"
 
 
 
 
 
187
  msgstr ""
188
 
189
- #: includes/admin/class-wc-stripe-privacy.php:106
190
  msgid "Orders"
191
  msgstr ""
192
 
193
- #: includes/admin/class-wc-stripe-privacy.php:110
194
- #: includes/admin/class-wc-stripe-privacy.php:175
195
- #: includes/admin/class-wc-stripe-privacy.php:215
196
  msgid "Stripe payment id"
197
  msgstr ""
198
 
199
- #: includes/admin/class-wc-stripe-privacy.php:114
200
- #: includes/admin/class-wc-stripe-privacy.php:179
201
- #: includes/admin/class-wc-stripe-privacy.php:219
202
  msgid "Stripe customer id"
203
  msgstr ""
204
 
205
- #: includes/admin/class-wc-stripe-privacy.php:171
206
  msgid "Subscriptions"
207
  msgstr ""
208
 
209
- #: includes/admin/class-wc-stripe-privacy.php:211
210
  msgid "Customer Data"
211
  msgstr ""
212
 
213
- #: includes/admin/class-wc-stripe-privacy.php:257
214
  msgid "Stripe User Data Erased."
215
  msgstr ""
216
 
217
- #: includes/admin/class-wc-stripe-privacy.php:332
218
- #: includes/admin/class-wc-stripe-privacy.php:367
219
- msgid "Order ID %d is less than set retention days. Personal data retained. (Stripe)"
 
 
 
220
  msgstr ""
221
 
222
- #: includes/admin/class-wc-stripe-privacy.php:336
223
- msgid "Order ID %d contains an active Subscription. Personal data retained. (Stripe)"
 
 
 
224
  msgstr ""
225
 
226
- #: includes/admin/class-wc-stripe-privacy.php:351
227
  msgid "Stripe Subscription Data Erased."
228
  msgstr ""
229
 
230
- #: includes/admin/class-wc-stripe-privacy.php:378
231
  msgid "Stripe personal data erased."
232
  msgstr ""
233
 
234
- #: includes/admin/stripe-alipay-settings.php:9
235
  msgid "Relevant Payer Geography: China"
236
  msgstr ""
237
 
238
- #: includes/admin/stripe-alipay-settings.php:13
239
- msgid "<a href=\"https://stripe.com/payments/payment-methods-guide#alipay\" target=\"_blank\">Payment Method Guide</a>"
240
- msgstr ""
241
-
242
- #: includes/admin/stripe-alipay-settings.php:17
243
- #: includes/admin/stripe-bancontact-settings.php:17
244
- #: includes/admin/stripe-eps-settings.php:13
245
- #: includes/admin/stripe-giropay-settings.php:17
246
- #: includes/admin/stripe-ideal-settings.php:17
247
- #: includes/admin/stripe-multibanco-settings.php:13
248
- #: includes/admin/stripe-p24-settings.php:13
249
- #: includes/admin/stripe-sepa-settings.php:17
250
- #: includes/admin/stripe-sofort-settings.php:17
251
- msgid "Must be activated from your Stripe Dashboard Settings <a href=\"https://dashboard.stripe.com/account/payments/settings\" target=\"_blank\">here</a>"
252
- msgstr ""
253
-
254
- #: includes/admin/stripe-alipay-settings.php:21
255
- #: includes/admin/stripe-bancontact-settings.php:21
256
- #: includes/admin/stripe-eps-settings.php:17
257
- #: includes/admin/stripe-giropay-settings.php:21
258
- #: includes/admin/stripe-ideal-settings.php:21
259
- #: includes/admin/stripe-multibanco-settings.php:17
260
- #: includes/admin/stripe-p24-settings.php:17
261
- #: includes/admin/stripe-sepa-settings.php:21
262
- #: includes/admin/stripe-settings.php:9
263
- #: includes/admin/stripe-sofort-settings.php:21
264
- msgid "Enable/Disable"
265
  msgstr ""
266
 
267
  #: includes/admin/stripe-alipay-settings.php:22
 
 
 
 
 
 
 
 
 
 
 
 
 
268
  msgid "Enable Stripe Alipay"
269
  msgstr ""
270
 
271
- #: includes/admin/stripe-alipay-settings.php:28
272
- #: includes/admin/stripe-bancontact-settings.php:28
273
- #: includes/admin/stripe-eps-settings.php:24
274
- #: includes/admin/stripe-giropay-settings.php:28
275
- #: includes/admin/stripe-ideal-settings.php:28
276
- #: includes/admin/stripe-multibanco-settings.php:24
277
- #: includes/admin/stripe-p24-settings.php:24
278
- #: includes/admin/stripe-sepa-settings.php:28
279
- #: includes/admin/stripe-settings.php:16
280
- #: includes/admin/stripe-sofort-settings.php:28
281
  msgid "Title"
282
  msgstr ""
283
 
284
- #: includes/admin/stripe-alipay-settings.php:30
285
- #: includes/admin/stripe-bancontact-settings.php:30
286
- #: includes/admin/stripe-eps-settings.php:26
287
- #: includes/admin/stripe-giropay-settings.php:30
288
- #: includes/admin/stripe-ideal-settings.php:30
289
- #: includes/admin/stripe-multibanco-settings.php:26
290
- #: includes/admin/stripe-p24-settings.php:26
291
- #: includes/admin/stripe-sepa-settings.php:30
292
- #: includes/admin/stripe-settings.php:18
293
- #: includes/admin/stripe-sofort-settings.php:30
294
  msgid "This controls the title which the user sees during checkout."
295
  msgstr ""
296
 
297
- #: includes/admin/stripe-alipay-settings.php:31
298
  msgid "Alipay"
299
  msgstr ""
300
 
301
- #: includes/admin/stripe-alipay-settings.php:35
302
- #: includes/admin/stripe-bancontact-settings.php:35
303
- #: includes/admin/stripe-eps-settings.php:31
304
- #: includes/admin/stripe-giropay-settings.php:35
305
- #: includes/admin/stripe-ideal-settings.php:35
306
- #: includes/admin/stripe-multibanco-settings.php:31
307
- #: includes/admin/stripe-p24-settings.php:31
308
- #: includes/admin/stripe-sepa-settings.php:35
309
- #: includes/admin/stripe-settings.php:23
310
- #: includes/admin/stripe-sofort-settings.php:35
311
  msgid "Description"
312
  msgstr ""
313
 
314
- #: includes/admin/stripe-alipay-settings.php:37
315
- #: includes/admin/stripe-bancontact-settings.php:37
316
- #: includes/admin/stripe-eps-settings.php:33
317
- #: includes/admin/stripe-giropay-settings.php:37
318
- #: includes/admin/stripe-ideal-settings.php:37
319
- #: includes/admin/stripe-multibanco-settings.php:33
320
- #: includes/admin/stripe-p24-settings.php:33
321
- #: includes/admin/stripe-sepa-settings.php:37
322
- #: includes/admin/stripe-settings.php:25
323
- #: includes/admin/stripe-sofort-settings.php:37
324
  msgid "This controls the description which the user sees during checkout."
325
  msgstr ""
326
 
327
- #: includes/admin/stripe-alipay-settings.php:38
328
  msgid "You will be redirected to Alipay."
329
  msgstr ""
330
 
331
- #: includes/admin/stripe-alipay-settings.php:42
332
- #: includes/admin/stripe-bancontact-settings.php:42
333
- #: includes/admin/stripe-giropay-settings.php:42
334
- #: includes/admin/stripe-ideal-settings.php:42
335
- #: includes/admin/stripe-multibanco-settings.php:38
336
- #: includes/admin/stripe-p24-settings.php:38
337
- #: includes/admin/stripe-sepa-settings.php:42
338
- #: includes/admin/stripe-settings.php:30
339
- #: includes/admin/stripe-sofort-settings.php:42
340
  msgid "Webhook Endpoints"
341
  msgstr ""
342
 
343
- #: includes/admin/stripe-bancontact-settings.php:9
344
  msgid "Relevant Payer Geography: Belgium"
345
  msgstr ""
346
 
347
- #: includes/admin/stripe-bancontact-settings.php:13
348
- msgid "<a href=\"https://stripe.com/payments/payment-methods-guide#bancontact\" target=\"_blank\">Payment Method Guide</a>"
 
 
349
  msgstr ""
350
 
351
- #: includes/admin/stripe-bancontact-settings.php:22
352
  msgid "Enable Stripe Bancontact"
353
  msgstr ""
354
 
355
- #: includes/admin/stripe-bancontact-settings.php:31
356
  msgid "Bancontact"
357
  msgstr ""
358
 
359
- #: includes/admin/stripe-bancontact-settings.php:38
360
  msgid "You will be redirected to Bancontact."
361
  msgstr ""
362
 
363
- #: includes/admin/stripe-eps-settings.php:9
364
  msgid "Relevant Payer Geography: Austria"
365
  msgstr ""
366
 
367
- #: includes/admin/stripe-eps-settings.php:18
368
  msgid "Enable Stripe EPS"
369
  msgstr ""
370
 
371
- #: includes/admin/stripe-eps-settings.php:27
372
  msgid "EPS"
373
  msgstr ""
374
 
375
- #: includes/admin/stripe-eps-settings.php:34
376
  msgid "You will be redirected to EPS."
377
  msgstr ""
378
 
379
- #: includes/admin/stripe-eps-settings.php:38
380
  msgid "Webhook Enpoints"
381
  msgstr ""
382
 
383
- #: includes/admin/stripe-giropay-settings.php:9
384
  msgid "Relevant Payer Geography: Germany"
385
  msgstr ""
386
 
387
- #: includes/admin/stripe-giropay-settings.php:13
388
- msgid "<a href=\"https://stripe.com/payments/payment-methods-guide#giropay\" target=\"_blank\">Payment Method Guide</a>"
 
 
389
  msgstr ""
390
 
391
- #: includes/admin/stripe-giropay-settings.php:22
392
  msgid "Enable Stripe Giropay"
393
  msgstr ""
394
 
395
- #: includes/admin/stripe-giropay-settings.php:31
396
  msgid "Giropay"
397
  msgstr ""
398
 
399
- #: includes/admin/stripe-giropay-settings.php:38
400
  msgid "You will be redirected to Giropay."
401
  msgstr ""
402
 
403
- #: includes/admin/stripe-ideal-settings.php:9
404
  msgid "Relevant Payer Geography: The Netherlands"
405
  msgstr ""
406
 
407
- #: includes/admin/stripe-ideal-settings.php:13
408
- msgid "<a href=\"https://stripe.com/payments/payment-methods-guide#ideal\" target=\"_blank\">Payment Method Guide</a>"
 
 
409
  msgstr ""
410
 
411
- #: includes/admin/stripe-ideal-settings.php:22
412
  msgid "Enable Stripe iDeal"
413
  msgstr ""
414
 
415
- #: includes/admin/stripe-ideal-settings.php:31
416
  msgid "iDeal"
417
  msgstr ""
418
 
419
- #: includes/admin/stripe-ideal-settings.php:38
420
  msgid "You will be redirected to iDeal."
421
  msgstr ""
422
 
423
- #: includes/admin/stripe-multibanco-settings.php:9
424
  msgid "Relevant Payer Geography: Portugal"
425
  msgstr ""
426
 
427
- #: includes/admin/stripe-multibanco-settings.php:18
428
  msgid "Enable Stripe Multibanco"
429
  msgstr ""
430
 
431
- #: includes/admin/stripe-multibanco-settings.php:27
432
  msgid "Multibanco"
433
  msgstr ""
434
 
435
- #: includes/admin/stripe-multibanco-settings.php:34
436
  msgid "You will be redirected to Multibanco."
437
  msgstr ""
438
 
439
- #: includes/admin/stripe-p24-settings.php:9
440
  msgid "Relevant Payer Geography: Poland"
441
  msgstr ""
442
 
443
- #: includes/admin/stripe-p24-settings.php:18
444
  msgid "Enable Stripe P24"
445
  msgstr ""
446
 
447
- #: includes/admin/stripe-p24-settings.php:27
448
  msgid "Przelewy24 (P24)"
449
  msgstr ""
450
 
451
- #: includes/admin/stripe-p24-settings.php:34
452
  msgid "You will be redirected to P24."
453
  msgstr ""
454
 
455
- #: includes/admin/stripe-sepa-settings.php:9
456
- msgid "Relevant Payer Geography: France, Germany, Spain, Belgium, Netherlands, Luxembourg, Italy, Portugal, Austria, Ireland"
 
 
457
  msgstr ""
458
 
459
- #: includes/admin/stripe-sepa-settings.php:13
460
- msgid "<a href=\"https://stripe.com/payments/payment-methods-guide#sepa-direct-debit\" target=\"_blank\">Payment Method Guide</a>"
 
 
 
461
  msgstr ""
462
 
463
- #: includes/admin/stripe-sepa-settings.php:22
464
  msgid "Enable Stripe SEPA Direct Debit"
465
  msgstr ""
466
 
467
- #: includes/admin/stripe-sepa-settings.php:31
468
  msgid "SEPA Direct Debit"
469
  msgstr ""
470
 
471
- #: includes/admin/stripe-sepa-settings.php:38
472
  msgid "Mandate Information."
473
  msgstr ""
474
 
475
- #: includes/admin/stripe-settings.php:10
476
  msgid "Enable Stripe"
477
  msgstr ""
478
 
479
- #: includes/admin/stripe-settings.php:19
480
  msgid "Credit Card (Stripe)"
481
  msgstr ""
482
 
483
- #: includes/admin/stripe-settings.php:26
484
  msgid "Pay with your credit card via Stripe."
485
  msgstr ""
486
 
 
487
  #. translators: webhook URL
488
-
489
- #: includes/admin/stripe-settings.php:36
490
  msgid "Test mode"
491
  msgstr ""
492
 
493
- #: includes/admin/stripe-settings.php:37
494
  msgid "Enable Test Mode"
495
  msgstr ""
496
 
497
- #: includes/admin/stripe-settings.php:39
498
  msgid "Place the payment gateway in test mode using test API keys."
499
  msgstr ""
500
 
501
- #: includes/admin/stripe-settings.php:44
502
  msgid "Test Publishable Key"
503
  msgstr ""
504
 
505
- #: includes/admin/stripe-settings.php:46 includes/admin/stripe-settings.php:53
506
- #: includes/admin/stripe-settings.php:60 includes/admin/stripe-settings.php:67
507
  msgid "Get your API keys from your stripe account."
508
  msgstr ""
509
 
510
- #: includes/admin/stripe-settings.php:51
511
  msgid "Test Secret Key"
512
  msgstr ""
513
 
514
- #: includes/admin/stripe-settings.php:58
515
  msgid "Live Publishable Key"
516
  msgstr ""
517
 
518
- #: includes/admin/stripe-settings.php:65
519
  msgid "Live Secret Key"
520
  msgstr ""
521
 
522
- #: includes/admin/stripe-settings.php:72
523
  msgid "Inline Credit Card Form"
524
  msgstr ""
525
 
526
- #: includes/admin/stripe-settings.php:74
527
- msgid "Choose the style you want to show for your credit card form. When unchecked, the credit card form will display separate credit card number field, expiry date field and cvc field."
 
 
 
528
  msgstr ""
529
 
530
- #: includes/admin/stripe-settings.php:79
531
  msgid "Statement Descriptor"
532
  msgstr ""
533
 
534
- #: includes/admin/stripe-settings.php:81
535
- msgid "This may be up to 22 characters. The statement description must contain at least one letter, may not include ><\"' characters, and will appear on your customer's statement in capital letters."
 
 
 
536
  msgstr ""
537
 
538
- #: includes/admin/stripe-settings.php:86
539
  msgid "Capture"
540
  msgstr ""
541
 
542
- #: includes/admin/stripe-settings.php:87
543
  msgid "Capture charge immediately"
544
  msgstr ""
545
 
546
- #: includes/admin/stripe-settings.php:89
547
- msgid "Whether or not to immediately capture the charge. When unchecked, the charge issues an authorization and will need to be captured later. Uncaptured charges expire in 7 days."
 
 
 
548
  msgstr ""
549
 
550
- #: includes/admin/stripe-settings.php:94
551
  msgid "3D Secure"
552
  msgstr ""
553
 
554
- #: includes/admin/stripe-settings.php:95
555
  msgid "Require 3D Secure when applicable"
556
  msgstr ""
557
 
558
- #: includes/admin/stripe-settings.php:97
559
- msgid "Some payment methods have 3D Secure feature. This is an extra security layer for your store. Choose how to handle payments when 3D Secure is recommended. Enabling would require customers to use 3D Secure when recommended."
 
 
 
 
560
  msgstr ""
561
 
562
- #: includes/admin/stripe-settings.php:102
563
  msgid "Stripe Modal Checkout"
564
  msgstr ""
565
 
566
- #: includes/admin/stripe-settings.php:103
567
  msgid "Enable Stripe Checkout"
568
  msgstr ""
569
 
570
- #: includes/admin/stripe-settings.php:105
571
- msgid "If enabled, this option shows a \"pay\" button and modal credit card form on the checkout, instead of credit card fields directly on the page. We recommend you leave this disabled and use the embedded form as that is the preferred method."
 
 
 
 
572
  msgstr ""
573
 
574
- #: includes/admin/stripe-settings.php:110
575
  msgid "Stripe Checkout Image"
576
  msgstr ""
577
 
578
- #: includes/admin/stripe-settings.php:111
579
- msgid "Optionally enter the URL to a 128x128px image of your brand or product. e.g. <code>https://yoursite.com/wp-content/uploads/2013/09/yourimage.jpg</code>"
 
 
 
580
  msgstr ""
581
 
582
- #: includes/admin/stripe-settings.php:117
583
  msgid "Stripe Checkout Description"
584
  msgstr ""
585
 
586
- #: includes/admin/stripe-settings.php:119
587
  msgid "Shows a description of your store on Stripe Modal Checkout."
588
  msgstr ""
589
 
590
- #: includes/admin/stripe-settings.php:124
591
  msgid "Payment Request Buttons"
592
  msgstr ""
593
 
 
594
  #. translators: 1) br tag 2) opening anchor tag 3) closing anchor tag
595
-
596
- #: includes/admin/stripe-settings.php:126
597
- msgid "Enable Payment Request Buttons. (Apple Pay/Chrome Payment Request API) %1$sBy using Apple Pay, you agree to %2$s and %3$s's terms of service."
598
  msgstr ""
599
 
600
- #: includes/admin/stripe-settings.php:128
601
- msgid "If enabled, users will be able to pay using Apple Pay or Chrome Payment Request if supported by the browser."
 
 
602
  msgstr ""
603
 
604
- #: includes/admin/stripe-settings.php:133
605
  msgid "Payment Request Button Type"
606
  msgstr ""
607
 
608
- #: includes/admin/stripe-settings.php:134
609
  msgid "Button Type"
610
  msgstr ""
611
 
612
- #: includes/admin/stripe-settings.php:136
613
  msgid "Select the button type you would like to show."
614
  msgstr ""
615
 
616
- #: includes/admin/stripe-settings.php:140
617
  msgid "Default"
618
  msgstr ""
619
 
620
- #: includes/admin/stripe-settings.php:141
621
  msgid "Buy"
622
  msgstr ""
623
 
624
- #: includes/admin/stripe-settings.php:142
625
  msgid "Donate"
626
  msgstr ""
627
 
628
- #: includes/admin/stripe-settings.php:146
629
  msgid "Payment Request Button Theme"
630
  msgstr ""
631
 
632
- #: includes/admin/stripe-settings.php:147
633
  msgid "Button Theme"
634
  msgstr ""
635
 
636
- #: includes/admin/stripe-settings.php:149
637
  msgid "Select the button theme you would like to show."
638
  msgstr ""
639
 
640
- #: includes/admin/stripe-settings.php:153
641
  msgid "Dark"
642
  msgstr ""
643
 
644
- #: includes/admin/stripe-settings.php:154
645
  msgid "Light"
646
  msgstr ""
647
 
648
- #: includes/admin/stripe-settings.php:155
649
  msgid "Light-Outline"
650
  msgstr ""
651
 
652
- #: includes/admin/stripe-settings.php:159
653
  msgid "Payment Request Button Height"
654
  msgstr ""
655
 
656
- #: includes/admin/stripe-settings.php:160
657
  msgid "Button Height"
658
  msgstr ""
659
 
660
- #: includes/admin/stripe-settings.php:162
661
- msgid "Enter the height you would like the button to be in pixels. Width will always be 100%."
 
 
662
  msgstr ""
663
 
664
- #: includes/admin/stripe-settings.php:167
665
  msgid "Saved Cards"
666
  msgstr ""
667
 
668
- #: includes/admin/stripe-settings.php:168
669
  msgid "Enable Payment via Saved Cards"
670
  msgstr ""
671
 
672
- #: includes/admin/stripe-settings.php:170
673
- msgid "If enabled, users will be able to pay with a saved card during checkout. Card details are saved on Stripe servers, not on your store."
 
 
674
  msgstr ""
675
 
676
- #: includes/admin/stripe-settings.php:175
677
  msgid "Logging"
678
  msgstr ""
679
 
680
- #: includes/admin/stripe-settings.php:176
681
  msgid "Log debug messages"
682
  msgstr ""
683
 
684
- #: includes/admin/stripe-settings.php:178
685
  msgid "Save debug messages to the WooCommerce System Status log."
686
  msgstr ""
687
 
688
- #: includes/admin/stripe-sofort-settings.php:9
689
  msgid "Relevant Payer Geography: Germany, Austria"
690
  msgstr ""
691
 
692
- #: includes/admin/stripe-sofort-settings.php:13
693
- msgid "<a href=\"https://stripe.com/payments/payment-methods-guide#sofort\" target=\"_blank\">Payment Method Guide</a>"
 
 
694
  msgstr ""
695
 
696
- #: includes/admin/stripe-sofort-settings.php:22
697
  msgid "Enable Stripe SOFORT"
698
  msgstr ""
699
 
700
- #: includes/admin/stripe-sofort-settings.php:31
701
  msgid "SOFORT"
702
  msgstr ""
703
 
704
- #: includes/admin/stripe-sofort-settings.php:38
705
  msgid "You will be redirected to SOFORT."
706
  msgstr ""
707
 
708
- #. translators: 1) link to Stripe register page 2) link to Stripe api keys page
709
-
710
  #: includes/class-wc-gateway-stripe.php:118
711
- msgid "Stripe works by adding payment fields on the checkout and then sending the details to Stripe for verification. <a href=\"%1$s\" target=\"_blank\">Sign up</a> for a Stripe account, and <a href=\"%2$s\" target=\"_blank\">get your Stripe account keys</a>."
 
 
 
 
 
712
  msgstr ""
713
 
714
  #: includes/class-wc-gateway-stripe.php:162
715
  msgid "Continue to payment"
716
  msgstr ""
717
 
718
- #. translators: 1) Opening anchor tag 2) closing anchor tag
719
-
720
  #: includes/class-wc-gateway-stripe.php:224
721
- msgid "If your billing address has been changed for saved payment methods, be sure to remove any %1$ssaved payment methods%2$s on file and re-add them."
 
 
 
722
  msgstr ""
723
 
724
- #: includes/class-wc-gateway-stripe.php:284
725
  msgid "Add Card"
726
  msgstr ""
727
 
728
- #: includes/class-wc-gateway-stripe.php:290
729
  msgid "Change Payment Method"
730
  msgstr ""
731
 
 
732
  #. translators: link to Stripe testing page
733
-
734
- #: includes/class-wc-gateway-stripe.php:317
735
- msgid "TEST MODE ENABLED. In test mode, you can use the card number 4242424242424242 with any CVC and a valid expiration date or check the <a href=\"%s\" target=\"_blank\">Testing Stripe documentation</a> for more card numbers."
 
 
736
  msgstr ""
737
 
738
- #: includes/class-wc-gateway-stripe.php:360
739
  msgid "Credit or debit card"
740
  msgstr ""
741
 
742
- #: includes/class-wc-gateway-stripe.php:368
743
  msgid "Card Number"
744
  msgstr ""
745
 
746
- #: includes/class-wc-gateway-stripe.php:379
747
  msgid "Expiry Date"
748
  msgstr ""
749
 
750
- #: includes/class-wc-gateway-stripe.php:387
751
  msgid "Card Code (CVC)"
752
  msgstr ""
753
 
754
- #: includes/class-wc-gateway-stripe.php:472
755
  msgid "Please accept the terms and conditions first"
756
  msgstr ""
757
 
758
- #: includes/class-wc-gateway-stripe.php:473
759
  msgid "Please fill in required checkout fields first"
760
  msgstr ""
761
 
762
- #: includes/class-wc-gateway-stripe.php:493
763
- #: includes/class-wc-gateway-stripe.php:701
764
- #: includes/compat/class-wc-stripe-subs-compat.php:91
765
- msgid "Sorry, we're not accepting prepaid cards at this time. Your credit card has not been charge. Please try with alternative payment method."
 
 
766
  msgstr ""
767
 
768
- #: includes/class-wc-gateway-stripe.php:494
769
  msgid "Please enter your IBAN account name."
770
  msgstr ""
771
 
772
- #: includes/class-wc-gateway-stripe.php:495
773
  msgid "Please enter your IBAN account number."
774
  msgstr ""
775
 
776
- #: includes/class-wc-gateway-stripe.php:507
777
  msgid "Billing First Name and Last Name are required."
778
  msgstr ""
779
 
780
- #: includes/class-wc-gateway-stripe.php:591
781
  msgid "Place Order"
782
  msgstr ""
783
 
784
- #: includes/class-wc-gateway-stripe.php:791
785
  #: includes/class-wc-stripe-order-handler.php:144
786
  #: includes/class-wc-stripe-webhook-handler.php:187
787
- #: includes/payment-methods/class-wc-gateway-stripe-sepa.php:347
788
  msgid "This card is no longer available and has been removed."
789
  msgstr ""
790
 
791
- #: includes/class-wc-gateway-stripe.php:810
792
  #: includes/class-wc-stripe-order-handler.php:162
793
  #: includes/class-wc-stripe-webhook-handler.php:206
794
- #: includes/compat/class-wc-stripe-sepa-subs-compat.php:222
795
- #: includes/compat/class-wc-stripe-subs-compat.php:237
796
- #: includes/payment-methods/class-wc-gateway-stripe-sepa.php:367
797
- msgid "Sorry, we are unable to process your payment at this time. Please retry later."
 
 
798
  msgstr ""
799
 
 
800
  #. translators: error message
801
-
802
- #: includes/class-wc-gateway-stripe.php:887
803
  msgid "This represents the fee Stripe collects for the transaction."
804
  msgstr ""
805
 
806
- #: includes/class-wc-gateway-stripe.php:888
807
  msgid "Stripe Fee:"
808
  msgstr ""
809
 
810
- #: includes/class-wc-gateway-stripe.php:924
811
- msgid "This represents the net total that will be credited to your Stripe bank account. This may be in the currency that is set in your Stripe account."
 
 
812
  msgstr ""
813
 
814
- #: includes/class-wc-gateway-stripe.php:925
815
  msgid "Stripe Payout:"
816
  msgstr ""
817
 
@@ -823,25 +909,25 @@ msgstr ""
823
  msgid "Unable to verify domain - missing secret key."
824
  msgstr ""
825
 
 
 
826
  #. translators: error message
827
-
828
- #: includes/class-wc-stripe-apple-pay-registration.php:148
829
- #: includes/class-wc-stripe-apple-pay-registration.php:157
830
  msgid "Unable to verify domain - %s"
831
  msgstr ""
832
 
833
- #: includes/class-wc-stripe-apple-pay-registration.php:180
834
  msgid "Unable to create domain association folder to domain root."
835
  msgstr ""
836
 
837
- #: includes/class-wc-stripe-apple-pay-registration.php:186
838
  msgid "Unable to copy domain association file to domain root."
839
  msgstr ""
840
 
 
841
  #. translators: 1) HTML anchor open tag 2) HTML anchor closing tag
842
-
843
- #: includes/class-wc-stripe-apple-pay-registration.php:243
844
- msgid "Apple Pay domain verification failed. Please check the %1$slog%2$s to see the issue. (Logging must be enabled to see recorded logs)"
845
  msgstr ""
846
 
847
  #: includes/class-wc-stripe-customer.php:119
@@ -852,88 +938,87 @@ msgstr ""
852
  msgid "Username"
853
  msgstr ""
854
 
855
- #: includes/class-wc-stripe-customer.php:200
856
  msgid "Unable to add payment source."
857
  msgstr ""
858
 
859
- #: includes/class-wc-stripe-helper.php:207
860
  msgid "The card number is not a valid credit card number."
861
  msgstr ""
862
 
863
- #: includes/class-wc-stripe-helper.php:208
864
  msgid "The card's expiration month is invalid."
865
  msgstr ""
866
 
867
- #: includes/class-wc-stripe-helper.php:209
868
  msgid "The card's expiration year is invalid."
869
  msgstr ""
870
 
871
- #: includes/class-wc-stripe-helper.php:210
872
  msgid "The card's security code is invalid."
873
  msgstr ""
874
 
875
- #: includes/class-wc-stripe-helper.php:211
876
  msgid "The card number is incorrect."
877
  msgstr ""
878
 
879
- #: includes/class-wc-stripe-helper.php:212
880
  msgid "The card number is incomplete."
881
  msgstr ""
882
 
883
- #: includes/class-wc-stripe-helper.php:213
884
  msgid "The card's security code is incomplete."
885
  msgstr ""
886
 
887
- #: includes/class-wc-stripe-helper.php:214
888
  msgid "The card's expiration date is incomplete."
889
  msgstr ""
890
 
891
- #: includes/class-wc-stripe-helper.php:215
892
  msgid "The card has expired."
893
  msgstr ""
894
 
895
- #: includes/class-wc-stripe-helper.php:216
896
  msgid "The card's security code is incorrect."
897
  msgstr ""
898
 
899
- #: includes/class-wc-stripe-helper.php:217
900
  msgid "The card's zip code failed validation."
901
  msgstr ""
902
 
903
- #: includes/class-wc-stripe-helper.php:218
904
  msgid "The card's expiration year is in the past"
905
  msgstr ""
906
 
907
- #: includes/class-wc-stripe-helper.php:219
908
  msgid "The card was declined."
909
  msgstr ""
910
 
911
- #: includes/class-wc-stripe-helper.php:220
912
  msgid "There is no card on a customer that is being charged."
913
  msgstr ""
914
 
915
- #: includes/class-wc-stripe-helper.php:221
916
  msgid "An error occurred while processing the card."
917
  msgstr ""
918
 
919
- #: includes/class-wc-stripe-helper.php:222
920
  #: includes/class-wc-stripe-order-handler.php:95
921
  msgid "Unable to process this payment, please try again or use alternative method."
922
  msgstr ""
923
 
924
- #: includes/class-wc-stripe-helper.php:223
925
  msgid "The billing country is not accepted by SOFORT. Please try another country."
926
  msgstr ""
927
 
928
- #. translators: error message
929
-
930
  #: includes/class-wc-stripe-order-handler.php:194
 
931
  msgid "Stripe payment failed: %s"
932
  msgstr ""
933
 
 
 
934
  #. translators: error message
935
-
936
- #: includes/class-wc-stripe-order-handler.php:246
937
  msgid "Unable to capture charge! %s"
938
  msgstr ""
939
 
@@ -941,29 +1026,29 @@ msgstr ""
941
  msgid "SEPA IBAN"
942
  msgstr ""
943
 
944
- #. translators: last 4 digits of IBAN account
945
-
946
  #: includes/class-wc-stripe-sepa-payment-token.php:41
 
947
  msgid "SEPA IBAN ending in %s"
948
  msgstr ""
949
 
950
- #. translators: 1) The URL to the order.
951
-
952
  #: includes/class-wc-stripe-webhook-handler.php:264
953
- msgid "A dispute was created for this order. Response is needed. Please go to your <a href=\"%s\" title=\"Stripe Dashboard\" target=\"_blank\">Stripe Dashboard</a> to review this dispute."
 
 
 
 
954
  msgstr ""
955
 
956
- #. translators: partial captured amount
957
-
958
  #: includes/class-wc-stripe-webhook-handler.php:309
 
959
  msgid "This charge was partially captured via Stripe Dashboard in the amount of: %s"
960
  msgstr ""
961
 
962
- #: includes/class-wc-stripe-webhook-handler.php:391
963
  msgid "This payment failed to clear."
964
  msgstr ""
965
 
966
- #: includes/class-wc-stripe-webhook-handler.php:418
967
  msgid "This payment has cancelled."
968
  msgstr ""
969
 
@@ -972,25 +1057,25 @@ msgid "Refunded via Stripe Dashboard"
972
  msgstr ""
973
 
974
  #: includes/class-wc-stripe-webhook-handler.php:452
975
- #: includes/class-wc-stripe-webhook-handler.php:478
976
  msgid "Pre-Authorization Released via Stripe Dashboard"
977
  msgstr ""
978
 
 
979
  #. translators: 1) dollar amount 2) transaction id 3) refund message
980
-
981
- #: includes/class-wc-stripe-webhook-handler.php:478
982
  msgid "Refunded %1$s - Refund ID: %2$s - %3$s"
983
  msgstr ""
984
 
 
985
  #. translators: 1) The URL to the order. 2) The reason type.
986
-
987
- #: includes/class-wc-stripe-webhook-handler.php:500
988
- msgid "A review has been opened for this order. Action is needed. Please go to your <a href=\"%1$s\" title=\"Stripe Dashboard\" target=\"_blank\">Stripe Dashboard</a> to review the issue. Reason: (%2$s)"
 
989
  msgstr ""
990
 
 
991
  #. translators: 1) The reason type.
992
-
993
- #: includes/class-wc-stripe-webhook-handler.php:524
994
  msgid "The opened review for this order is now closed. Reason: (%s)"
995
  msgstr ""
996
 
@@ -998,54 +1083,58 @@ msgstr ""
998
  msgid "Unable to store payment details. Please try again."
999
  msgstr ""
1000
 
1001
- #. translators: error message
1002
-
1003
  #: includes/compat/class-wc-stripe-pre-orders-compat.php:120
 
1004
  msgid "Stripe Transaction Failed (%s)"
1005
  msgstr ""
1006
 
1007
- #: includes/compat/class-wc-stripe-sepa-subs-compat.php:185
1008
- #: includes/compat/class-wc-stripe-subs-compat.php:200
 
 
 
 
 
 
 
1009
  msgid "Customer not found"
1010
  msgstr ""
1011
 
 
 
1012
  #. translators: error message
1013
-
1014
- #: includes/compat/class-wc-stripe-sepa-subs-compat.php:345
1015
- #: includes/compat/class-wc-stripe-subs-compat.php:389
1016
  msgid "A \"Stripe Customer ID\" value is required."
1017
  msgstr ""
1018
 
1019
- #: includes/compat/class-wc-stripe-sepa-subs-compat.php:347
1020
- #: includes/compat/class-wc-stripe-subs-compat.php:391
1021
- msgid "Invalid customer ID. A valid \"Stripe Customer ID\" must begin with \"cus_\"."
 
 
1022
  msgstr ""
1023
 
1024
- #: includes/compat/class-wc-stripe-sepa-subs-compat.php:356
1025
- #: includes/compat/class-wc-stripe-subs-compat.php:400
1026
- msgid "Invalid source ID. A valid source \"Stripe Source ID\" must begin with \"src_\" or \"card_\"."
 
 
1027
  msgstr ""
1028
 
 
1029
  #. translators: 1) last 4 digits of SEPA Direct Debit
1030
-
1031
- #: includes/compat/class-wc-stripe-sepa-subs-compat.php:427
1032
  msgid "Via SEPA Direct Debit ending in %1$s"
1033
  msgstr ""
1034
 
 
1035
  #. translators: 1) card brand 2) last 4 digits
1036
-
1037
- #: includes/compat/class-wc-stripe-subs-compat.php:482
1038
- #: includes/compat/class-wc-stripe-subs-compat.php:497
1039
  msgid "Via %1$s card ending in %2$s"
1040
  msgstr ""
1041
 
1042
  #: includes/payment-methods/class-wc-gateway-stripe-alipay.php:60
1043
- #: woocommerce-gateway-stripe.php:255
1044
  msgid "Stripe Alipay"
1045
  msgstr ""
1046
 
1047
- #. translators: link
1048
-
1049
  #: includes/payment-methods/class-wc-gateway-stripe-alipay.php:62
1050
  #: includes/payment-methods/class-wc-gateway-stripe-bancontact.php:62
1051
  #: includes/payment-methods/class-wc-gateway-stripe-eps.php:62
@@ -1055,95 +1144,104 @@ msgstr ""
1055
  #: includes/payment-methods/class-wc-gateway-stripe-p24.php:62
1056
  #: includes/payment-methods/class-wc-gateway-stripe-sepa.php:77
1057
  #: includes/payment-methods/class-wc-gateway-stripe-sofort.php:62
 
1058
  msgid "All other general Stripe settings can be adjusted <a href=\"%s\">here</a>."
1059
  msgstr ""
1060
 
1061
- #: includes/payment-methods/class-wc-gateway-stripe-alipay.php:183
1062
- #: includes/payment-methods/class-wc-gateway-stripe-bancontact.php:176
1063
- #: includes/payment-methods/class-wc-gateway-stripe-eps.php:176
1064
- #: includes/payment-methods/class-wc-gateway-stripe-giropay.php:176
1065
- #: includes/payment-methods/class-wc-gateway-stripe-ideal.php:176
1066
- #: includes/payment-methods/class-wc-gateway-stripe-multibanco.php:180
1067
- #: includes/payment-methods/class-wc-gateway-stripe-p24.php:177
1068
- #: includes/payment-methods/class-wc-gateway-stripe-sofort.php:176
1069
  msgid "Add Payment"
1070
  msgstr ""
1071
 
1072
  #: includes/payment-methods/class-wc-gateway-stripe-bancontact.php:60
1073
- #: woocommerce-gateway-stripe.php:249
1074
  msgid "Stripe Bancontact"
1075
  msgstr ""
1076
 
1077
  #: includes/payment-methods/class-wc-gateway-stripe-eps.php:60
1078
- #: woocommerce-gateway-stripe.php:252
1079
  msgid "Stripe EPS"
1080
  msgstr ""
1081
 
1082
  #: includes/payment-methods/class-wc-gateway-stripe-giropay.php:60
1083
- #: woocommerce-gateway-stripe.php:251
1084
  msgid "Stripe Giropay"
1085
  msgstr ""
1086
 
1087
  #: includes/payment-methods/class-wc-gateway-stripe-ideal.php:60
1088
- #: woocommerce-gateway-stripe.php:253
1089
  msgid "Stripe iDeal"
1090
  msgstr ""
1091
 
1092
  #: includes/payment-methods/class-wc-gateway-stripe-multibanco.php:60
1093
- #: woocommerce-gateway-stripe.php:257
1094
  msgid "Stripe Multibanco"
1095
  msgstr ""
1096
 
1097
- #: includes/payment-methods/class-wc-gateway-stripe-multibanco.php:239
1098
- #: includes/payment-methods/class-wc-gateway-stripe-multibanco.php:251
1099
  msgid "MULTIBANCO INFORMAÇÕES DE ENCOMENDA:"
1100
  msgstr ""
1101
 
1102
- #: includes/payment-methods/class-wc-gateway-stripe-multibanco.php:241
1103
- #: includes/payment-methods/class-wc-gateway-stripe-multibanco.php:254
1104
  msgid "Montante:"
1105
  msgstr ""
1106
 
1107
- #: includes/payment-methods/class-wc-gateway-stripe-multibanco.php:244
1108
- #: includes/payment-methods/class-wc-gateway-stripe-multibanco.php:258
1109
  msgid "Entidade:"
1110
  msgstr ""
1111
 
1112
- #: includes/payment-methods/class-wc-gateway-stripe-multibanco.php:247
1113
- #: includes/payment-methods/class-wc-gateway-stripe-multibanco.php:262
1114
  msgid "Referencia:"
1115
  msgstr ""
1116
 
1117
- #: includes/payment-methods/class-wc-gateway-stripe-multibanco.php:363
1118
  msgid "Awaiting Multibanco payment"
1119
  msgstr ""
1120
 
1121
  #: includes/payment-methods/class-wc-gateway-stripe-p24.php:60
1122
- #: woocommerce-gateway-stripe.php:254
1123
  msgid "Stripe P24"
1124
  msgstr ""
1125
 
1126
  #: includes/payment-methods/class-wc-gateway-stripe-sepa.php:75
1127
- #: woocommerce-gateway-stripe.php:256
1128
  msgid "Stripe SEPA Direct Debit"
1129
  msgstr ""
1130
 
 
1131
  #. translators: statement descriptor
1132
-
1133
- #: includes/payment-methods/class-wc-gateway-stripe-sepa.php:209
1134
- msgid "By providing your IBAN and confirming this payment, you are authorizing %s and Stripe, our payment service provider, to send instructions to your bank to debit your account and your bank to debit your account in accordance with those instructions. You are entitled to a refund from your bank under the terms and conditions of your agreement with your bank. A refund must be claimed within 8 weeks starting from the date on which your account was debited."
 
 
 
 
 
1135
  msgstr ""
1136
 
1137
- #: includes/payment-methods/class-wc-gateway-stripe-sepa.php:225
1138
  msgid "IBAN."
1139
  msgstr ""
1140
 
1141
- #: includes/payment-methods/class-wc-gateway-stripe-sepa.php:265
1142
- msgid "TEST MODE ENABLED. In test mode, you can use IBAN number DE89370400440532013000."
 
 
1143
  msgstr ""
1144
 
1145
  #: includes/payment-methods/class-wc-gateway-stripe-sofort.php:60
1146
- #: woocommerce-gateway-stripe.php:250
1147
  msgid "Stripe SOFORT"
1148
  msgstr ""
1149
 
@@ -1168,9 +1266,8 @@ msgstr ""
1168
  msgid "Sorry, we're not accepting prepaid cards at this time."
1169
  msgstr ""
1170
 
1171
- #. translators: Do not translate the [option] placeholder
1172
-
1173
  #: includes/payment-methods/class-wc-stripe-payment-request.php:506
 
1174
  msgid "Unknown shipping option \"[option]\"."
1175
  msgstr ""
1176
 
@@ -1183,10 +1280,11 @@ msgstr ""
1183
  msgid "Unable to find shipping method for address."
1184
  msgstr ""
1185
 
1186
- #. translators: 1: product name 2: quantity in stock
1187
-
1188
  #: includes/payment-methods/class-wc-stripe-payment-request.php:831
1189
- msgid "You cannot add that amount of \"%1$s\"; to the cart because there is not enough stock (%2$s remaining)."
 
 
 
1190
  msgstr ""
1191
 
1192
  #: includes/payment-methods/class-wc-stripe-payment-request.php:985
@@ -1197,68 +1295,25 @@ msgstr ""
1197
  msgid "Discount"
1198
  msgstr ""
1199
 
1200
- #: node_modules/grunt-wp-i18n/test/fixtures/basic-theme/exclude/file.php:3
1201
- #: node_modules/grunt-wp-i18n/test/fixtures/plugin-include/plugin-include.php:6
1202
- msgid "Exclude"
1203
- msgstr ""
1204
-
1205
- #: node_modules/grunt-wp-i18n/test/fixtures/plugin-include/include/file.php:2
1206
- msgid "Include"
1207
- msgstr ""
1208
-
1209
- #: node_modules/grunt-wp-i18n/test/fixtures/text-domains/add-domain.php:2
1210
- #: node_modules/grunt-wp-i18n/test/fixtures/text-domains/update-all-domains.php:2
1211
- #: node_modules/grunt-wp-i18n/test/fixtures/text-domains/update-all-domains.php:3
1212
- #: node_modules/grunt-wp-i18n/test/fixtures/text-domains/update-all-domains.php:4
1213
- #: node_modules/grunt-wp-i18n/test/fixtures/text-domains/update-domains.php:2
1214
- #: node_modules/grunt-wp-i18n/test/fixtures/text-domains/update-domains.php:3
1215
- msgid "String"
1216
- msgstr ""
1217
-
1218
- #: node_modules/grunt-wp-i18n/test/fixtures/text-domains/update-all-domains.php:6
1219
- #: node_modules/grunt-wp-i18n/test/fixtures/text-domains/update-all-domains.php:7
1220
- #: node_modules/grunt-wp-i18n/test/fixtures/text-domains/update-all-domains.php:8
1221
- msgctxt "a string"
1222
- msgid "String"
1223
- msgstr ""
1224
-
1225
- #: node_modules/grunt-wp-i18n/test/fixtures/text-domains/update-all-domains.php:9
1226
- #: node_modules/grunt-wp-i18n/test/fixtures/text-domains/update-all-domains.php:10
1227
- #: node_modules/grunt-wp-i18n/test/fixtures/text-domains/update-all-domains.php:11
1228
- msgid "1 Star"
1229
- msgid_plural "%s Stars"
1230
- msgstr[0] ""
1231
- msgstr[1] ""
1232
-
1233
- #. translators: A single line translators comment.
1234
-
1235
- #: node_modules/grunt-wp-i18n/test/fixtures/translator-comments/translator-comments.php:7
1236
- msgid "A"
1237
- msgstr ""
1238
-
1239
- #. translators: A multiline translators comment.
1240
-
1241
- #: node_modules/grunt-wp-i18n/test/fixtures/translator-comments/translator-comments.php:15
1242
- msgid "B"
1243
- msgstr ""
1244
-
1245
  #. translators: 1. URL link.
1246
-
1247
- #: woocommerce-gateway-stripe.php:30
1248
- msgid "Stripe requires WooCommerce to be installed and active. You can download %s here."
1249
  msgstr ""
1250
 
1251
- #: woocommerce-gateway-stripe.php:196
1252
  msgid "Settings"
1253
  msgstr ""
1254
 
1255
- #: woocommerce-gateway-stripe.php:197
1256
  msgid "Docs"
1257
  msgstr ""
1258
 
1259
- #: woocommerce-gateway-stripe.php:198
1260
  msgid "Support"
1261
  msgstr ""
 
1262
  #. Plugin Name of the plugin/theme
1263
  msgid "WooCommerce Stripe Gateway"
1264
  msgstr ""
@@ -1277,4 +1332,4 @@ msgstr ""
1277
 
1278
  #. Author URI of the plugin/theme
1279
  msgid "https://woocommerce.com/"
1280
- msgstr ""
1
+ # Copyright (C) 2018 WooCommerce
2
+ # This file is distributed under the same license as the WooCommerce Stripe Gateway package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: WooCommerce Stripe Gateway 4.1.11\n"
6
+ "Report-Msgid-Bugs-To: "
7
+ "https://wordpress.org/support/plugin/woocommerce-gateway-stripe\n"
8
+ "POT-Creation-Date: 2018-10-17 15:00:09+00:00\n"
9
  "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
  "PO-Revision-Date: 2018-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
15
+ "X-Generator: node-wp-i18n 1.2.1\n"
16
 
17
+ #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:24
18
  #. translators: 1) webhook url
19
+ msgid ""
20
+ "You must add the following webhook endpoint <strong "
21
+ "style=\"background-color:#ddd;\">&nbsp;%s&nbsp;</strong> to your <a "
22
+ "href=\"https://dashboard.stripe.com/account/webhooks\" "
23
+ "target=\"_blank\">Stripe account settings</a>. This will enable you to "
24
+ "receive notifications on the charge statuses."
25
  msgstr ""
26
 
27
+ #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:39
28
  msgid "Save payment information to my account for future purchases."
29
  msgstr ""
30
 
31
+ #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:259
32
+ #: includes/compat/class-wc-stripe-sepa-subs-compat.php:225
33
+ #: includes/compat/class-wc-stripe-subs-compat.php:206
34
  #. translators: 1) dollar amount
35
  #. translators: minimum amount
 
 
 
 
36
  msgid "Sorry, the minimum allowed order total is %1$s to use this payment method."
37
  msgstr ""
38
 
39
+ #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:355
40
  #. translators: 1) blog name 2) order number
 
 
41
  msgid "%1$s - Order %2$s"
42
  msgstr ""
43
 
44
+ #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:382
45
  msgid "customer_name"
46
  msgstr ""
47
 
48
+ #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:383
49
  msgid "customer_email"
50
  msgstr ""
51
 
52
+ #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:457
53
  #. translators: transaction id
 
 
54
  msgid "Stripe charge awaiting payment: %s."
55
  msgstr ""
56
 
57
+ #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:464
58
+ #: includes/class-wc-stripe-order-handler.php:267
 
 
59
  #: includes/class-wc-stripe-webhook-handler.php:314
60
+ #: includes/class-wc-stripe-webhook-handler.php:361
61
+ #. translators: transaction id
62
  msgid "Stripe charge complete (Charge ID: %s)"
63
  msgstr ""
64
 
65
+ #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:469
66
+ #: includes/class-wc-gateway-stripe.php:725
67
+ #: includes/compat/class-wc-stripe-sepa-subs-compat.php:182
68
+ #: includes/compat/class-wc-stripe-subs-compat.php:145
69
  msgid "Payment processing failed. Please retry."
70
  msgstr ""
71
 
72
+ #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:481
73
  #. translators: transaction id
74
+ msgid ""
75
+ "Stripe charge authorized (Charge ID: %s). Process order to take payment, or "
76
+ "cancel to remove the pre-authorization."
77
  msgstr ""
78
 
79
+ #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:712
80
  msgid "Invalid payment method. Please input a new card number."
81
  msgstr ""
82
 
83
+ #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:963
84
  #. translators: 1) dollar amount 2) transaction id 3) refund message
 
 
85
  msgid "Refunded %1$s - Refund ID: %2$s - Reason: %3$s"
86
  msgstr ""
87
 
88
+ #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:963
89
  msgid "Pre-Authorization Released"
90
  msgstr ""
91
 
92
+ #: includes/abstracts/abstract-wc-stripe-payment-gateway.php:981
93
+ msgid "There was a problem adding the payment method."
94
  msgstr ""
95
 
96
+ #: includes/admin/class-wc-stripe-admin-notices.php:119
97
  #. translators: 1) int version 2) int version
98
+ msgid ""
99
+ "WooCommerce Stripe - The minimum PHP version required for this plugin is "
100
+ "%1$s. You are running %2$s."
101
+ msgstr ""
102
 
103
+ #: includes/admin/class-wc-stripe-admin-notices.php:130
104
+ msgid ""
105
+ "Action required: In January 2019 we will be introducing changes that could "
106
+ "effect how Stripe looks in your checkout. <a "
107
+ "href=\"https://docs.woocommerce.com/document/stripe/#section-45\" "
108
+ "target=\"_blank\">Learn more</a> about how to make sure your site continues "
109
+ "to look great."
110
  msgstr ""
111
 
112
+ #: includes/admin/class-wc-stripe-admin-notices.php:141
113
  #. translators: 1) int version 2) int version
114
+ msgid ""
115
+ "WooCommerce Stripe - The minimum WooCommerce version required for this "
116
+ "plugin is %1$s. You are running %2$s."
117
  msgstr ""
118
 
119
+ #: includes/admin/class-wc-stripe-admin-notices.php:151
120
  msgid "WooCommerce Stripe - cURL is not installed."
121
  msgstr ""
122
 
123
+ #: includes/admin/class-wc-stripe-admin-notices.php:161
124
  #. translators: 1) link
125
+ msgid ""
126
+ "Stripe is almost ready. To get started, <a href=\"%s\">set your Stripe "
127
+ "account keys</a>."
128
  msgstr ""
129
 
130
+ #: includes/admin/class-wc-stripe-admin-notices.php:172
131
  #. translators: 1) link
132
+ msgid ""
133
+ "Stripe is in test mode however your test keys may not be valid. Test keys "
134
+ "start with pk_test and sk_test or rk_test. Please go to your settings and, "
135
+ "<a href=\"%s\">set your Stripe account keys</a>."
136
  msgstr ""
137
 
138
+ #: includes/admin/class-wc-stripe-admin-notices.php:181
139
  #. translators: 1) link
140
+ msgid ""
141
+ "Stripe is in live mode however your test keys may not be valid. Live keys "
142
+ "start with pk_live and sk_live or rk_live. Please go to your settings and, "
143
+ "<a href=\"%s\">set your Stripe account keys</a>."
144
  msgstr ""
145
 
146
+ #: includes/admin/class-wc-stripe-admin-notices.php:190
147
  #. translators: 1) link
148
+ msgid ""
149
+ "Stripe is enabled, but a SSL certificate is not detected. Your checkout may "
150
+ "not be secure! Please ensure your server has a valid <a href=\"%1$s\" "
151
+ "target=\"_blank\">SSL certificate</a>"
152
  msgstr ""
153
 
154
+ #: includes/admin/class-wc-stripe-admin-notices.php:214
155
+ #. translators: %1$s Payment method, %2$s List of supported currencies
156
+ msgid "%1$s is enabled - it requires store currency to be set to %2$s"
157
  msgstr ""
158
 
159
+ #: includes/admin/class-wc-stripe-admin-notices.php:228
160
  msgid "Action failed. Please refresh the page and retry."
161
  msgstr ""
162
 
163
+ #: includes/admin/class-wc-stripe-admin-notices.php:232
164
  msgid "Cheatin&#8217; huh?"
165
  msgstr ""
166
 
195
  msgstr ""
196
 
197
  #: includes/admin/class-wc-stripe-privacy.php:41
198
+ #: includes/compat/class-wc-stripe-sepa-subs-compat.php:472
 
199
  #: includes/compat/class-wc-stripe-subs-compat.php:484
 
200
  #: includes/compat/class-wc-stripe-subs-compat.php:499
201
  msgid "N/A"
202
  msgstr ""
203
 
204
+ #: includes/admin/class-wc-stripe-privacy.php:84
205
+ #. translators: %s URL to docs
206
+ msgid ""
207
+ "By using this extension, you may be storing personal data or sharing data "
208
+ "with an external service. <a href=\"%s\" target=\"_blank\">Learn more about "
209
+ "how this works, including what you may want to include in your privacy "
210
+ "policy.</a>"
211
  msgstr ""
212
 
213
+ #: includes/admin/class-wc-stripe-privacy.php:107
214
  msgid "Orders"
215
  msgstr ""
216
 
217
+ #: includes/admin/class-wc-stripe-privacy.php:111
218
+ #: includes/admin/class-wc-stripe-privacy.php:176
219
+ #: includes/admin/class-wc-stripe-privacy.php:216
220
  msgid "Stripe payment id"
221
  msgstr ""
222
 
223
+ #: includes/admin/class-wc-stripe-privacy.php:115
224
+ #: includes/admin/class-wc-stripe-privacy.php:180
225
+ #: includes/admin/class-wc-stripe-privacy.php:220
226
  msgid "Stripe customer id"
227
  msgstr ""
228
 
229
+ #: includes/admin/class-wc-stripe-privacy.php:172
230
  msgid "Subscriptions"
231
  msgstr ""
232
 
233
+ #: includes/admin/class-wc-stripe-privacy.php:212
234
  msgid "Customer Data"
235
  msgstr ""
236
 
237
+ #: includes/admin/class-wc-stripe-privacy.php:258
238
  msgid "Stripe User Data Erased."
239
  msgstr ""
240
 
241
+ #: includes/admin/class-wc-stripe-privacy.php:334
242
+ #: includes/admin/class-wc-stripe-privacy.php:371
243
+ #. translators: %d Order ID
244
+ msgid ""
245
+ "Order ID %d is less than set retention days. Personal data retained. "
246
+ "(Stripe)"
247
  msgstr ""
248
 
249
+ #: includes/admin/class-wc-stripe-privacy.php:339
250
+ #. translators: %d Order ID
251
+ msgid ""
252
+ "Order ID %d contains an active Subscription. Personal data retained. "
253
+ "(Stripe)"
254
  msgstr ""
255
 
256
+ #: includes/admin/class-wc-stripe-privacy.php:354
257
  msgid "Stripe Subscription Data Erased."
258
  msgstr ""
259
 
260
+ #: includes/admin/class-wc-stripe-privacy.php:382
261
  msgid "Stripe personal data erased."
262
  msgstr ""
263
 
264
+ #: includes/admin/stripe-alipay-settings.php:10
265
  msgid "Relevant Payer Geography: China"
266
  msgstr ""
267
 
268
+ #: includes/admin/stripe-alipay-settings.php:14
269
+ msgid ""
270
+ "<a href=\"https://stripe.com/payments/payment-methods-guide#alipay\" "
271
+ "target=\"_blank\">Payment Method Guide</a>"
272
+ msgstr ""
273
+
274
+ #: includes/admin/stripe-alipay-settings.php:18
275
+ #: includes/admin/stripe-bancontact-settings.php:18
276
+ #: includes/admin/stripe-eps-settings.php:14
277
+ #: includes/admin/stripe-giropay-settings.php:18
278
+ #: includes/admin/stripe-ideal-settings.php:18
279
+ #: includes/admin/stripe-multibanco-settings.php:14
280
+ #: includes/admin/stripe-p24-settings.php:14
281
+ #: includes/admin/stripe-sepa-settings.php:18
282
+ #: includes/admin/stripe-sofort-settings.php:18
283
+ msgid ""
284
+ "Must be activated from your Stripe Dashboard Settings <a "
285
+ "href=\"https://dashboard.stripe.com/account/payments/settings\" "
286
+ "target=\"_blank\">here</a>"
 
 
 
 
 
 
 
 
287
  msgstr ""
288
 
289
  #: includes/admin/stripe-alipay-settings.php:22
290
+ #: includes/admin/stripe-bancontact-settings.php:22
291
+ #: includes/admin/stripe-eps-settings.php:18
292
+ #: includes/admin/stripe-giropay-settings.php:22
293
+ #: includes/admin/stripe-ideal-settings.php:22
294
+ #: includes/admin/stripe-multibanco-settings.php:18
295
+ #: includes/admin/stripe-p24-settings.php:18
296
+ #: includes/admin/stripe-sepa-settings.php:22
297
+ #: includes/admin/stripe-settings.php:10
298
+ #: includes/admin/stripe-sofort-settings.php:22
299
+ msgid "Enable/Disable"
300
+ msgstr ""
301
+
302
+ #: includes/admin/stripe-alipay-settings.php:23
303
  msgid "Enable Stripe Alipay"
304
  msgstr ""
305
 
306
+ #: includes/admin/stripe-alipay-settings.php:29
307
+ #: includes/admin/stripe-bancontact-settings.php:29
308
+ #: includes/admin/stripe-eps-settings.php:25
309
+ #: includes/admin/stripe-giropay-settings.php:29
310
+ #: includes/admin/stripe-ideal-settings.php:29
311
+ #: includes/admin/stripe-multibanco-settings.php:25
312
+ #: includes/admin/stripe-p24-settings.php:25
313
+ #: includes/admin/stripe-sepa-settings.php:29
314
+ #: includes/admin/stripe-settings.php:17
315
+ #: includes/admin/stripe-sofort-settings.php:29
316
  msgid "Title"
317
  msgstr ""
318
 
319
+ #: includes/admin/stripe-alipay-settings.php:31
320
+ #: includes/admin/stripe-bancontact-settings.php:31
321
+ #: includes/admin/stripe-eps-settings.php:27
322
+ #: includes/admin/stripe-giropay-settings.php:31
323
+ #: includes/admin/stripe-ideal-settings.php:31
324
+ #: includes/admin/stripe-multibanco-settings.php:27
325
+ #: includes/admin/stripe-p24-settings.php:27
326
+ #: includes/admin/stripe-sepa-settings.php:31
327
+ #: includes/admin/stripe-settings.php:19
328
+ #: includes/admin/stripe-sofort-settings.php:31
329
  msgid "This controls the title which the user sees during checkout."
330
  msgstr ""
331
 
332
+ #: includes/admin/stripe-alipay-settings.php:32
333
  msgid "Alipay"
334
  msgstr ""
335
 
336
+ #: includes/admin/stripe-alipay-settings.php:36
337
+ #: includes/admin/stripe-bancontact-settings.php:36
338
+ #: includes/admin/stripe-eps-settings.php:32
339
+ #: includes/admin/stripe-giropay-settings.php:36
340
+ #: includes/admin/stripe-ideal-settings.php:36
341
+ #: includes/admin/stripe-multibanco-settings.php:32
342
+ #: includes/admin/stripe-p24-settings.php:32
343
+ #: includes/admin/stripe-sepa-settings.php:36
344
+ #: includes/admin/stripe-settings.php:24
345
+ #: includes/admin/stripe-sofort-settings.php:36
346
  msgid "Description"
347
  msgstr ""
348
 
349
+ #: includes/admin/stripe-alipay-settings.php:38
350
+ #: includes/admin/stripe-bancontact-settings.php:38
351
+ #: includes/admin/stripe-eps-settings.php:34
352
+ #: includes/admin/stripe-giropay-settings.php:38
353
+ #: includes/admin/stripe-ideal-settings.php:38
354
+ #: includes/admin/stripe-multibanco-settings.php:34
355
+ #: includes/admin/stripe-p24-settings.php:34
356
+ #: includes/admin/stripe-sepa-settings.php:38
357
+ #: includes/admin/stripe-settings.php:26
358
+ #: includes/admin/stripe-sofort-settings.php:38
359
  msgid "This controls the description which the user sees during checkout."
360
  msgstr ""
361
 
362
+ #: includes/admin/stripe-alipay-settings.php:39
363
  msgid "You will be redirected to Alipay."
364
  msgstr ""
365
 
366
+ #: includes/admin/stripe-alipay-settings.php:43
367
+ #: includes/admin/stripe-bancontact-settings.php:43
368
+ #: includes/admin/stripe-giropay-settings.php:43
369
+ #: includes/admin/stripe-ideal-settings.php:43
370
+ #: includes/admin/stripe-multibanco-settings.php:39
371
+ #: includes/admin/stripe-p24-settings.php:39
372
+ #: includes/admin/stripe-sepa-settings.php:43
373
+ #: includes/admin/stripe-settings.php:31
374
+ #: includes/admin/stripe-sofort-settings.php:43
375
  msgid "Webhook Endpoints"
376
  msgstr ""
377
 
378
+ #: includes/admin/stripe-bancontact-settings.php:10
379
  msgid "Relevant Payer Geography: Belgium"
380
  msgstr ""
381
 
382
+ #: includes/admin/stripe-bancontact-settings.php:14
383
+ msgid ""
384
+ "<a href=\"https://stripe.com/payments/payment-methods-guide#bancontact\" "
385
+ "target=\"_blank\">Payment Method Guide</a>"
386
  msgstr ""
387
 
388
+ #: includes/admin/stripe-bancontact-settings.php:23
389
  msgid "Enable Stripe Bancontact"
390
  msgstr ""
391
 
392
+ #: includes/admin/stripe-bancontact-settings.php:32
393
  msgid "Bancontact"
394
  msgstr ""
395
 
396
+ #: includes/admin/stripe-bancontact-settings.php:39
397
  msgid "You will be redirected to Bancontact."
398
  msgstr ""
399
 
400
+ #: includes/admin/stripe-eps-settings.php:10
401
  msgid "Relevant Payer Geography: Austria"
402
  msgstr ""
403
 
404
+ #: includes/admin/stripe-eps-settings.php:19
405
  msgid "Enable Stripe EPS"
406
  msgstr ""
407
 
408
+ #: includes/admin/stripe-eps-settings.php:28
409
  msgid "EPS"
410
  msgstr ""
411
 
412
+ #: includes/admin/stripe-eps-settings.php:35
413
  msgid "You will be redirected to EPS."
414
  msgstr ""
415
 
416
+ #: includes/admin/stripe-eps-settings.php:39
417
  msgid "Webhook Enpoints"
418
  msgstr ""
419
 
420
+ #: includes/admin/stripe-giropay-settings.php:10
421
  msgid "Relevant Payer Geography: Germany"
422
  msgstr ""
423
 
424
+ #: includes/admin/stripe-giropay-settings.php:14
425
+ msgid ""
426
+ "<a href=\"https://stripe.com/payments/payment-methods-guide#giropay\" "
427
+ "target=\"_blank\">Payment Method Guide</a>"
428
  msgstr ""
429
 
430
+ #: includes/admin/stripe-giropay-settings.php:23
431
  msgid "Enable Stripe Giropay"
432
  msgstr ""
433
 
434
+ #: includes/admin/stripe-giropay-settings.php:32
435
  msgid "Giropay"
436
  msgstr ""
437
 
438
+ #: includes/admin/stripe-giropay-settings.php:39
439
  msgid "You will be redirected to Giropay."
440
  msgstr ""
441
 
442
+ #: includes/admin/stripe-ideal-settings.php:10
443
  msgid "Relevant Payer Geography: The Netherlands"
444
  msgstr ""
445
 
446
+ #: includes/admin/stripe-ideal-settings.php:14
447
+ msgid ""
448
+ "<a href=\"https://stripe.com/payments/payment-methods-guide#ideal\" "
449
+ "target=\"_blank\">Payment Method Guide</a>"
450
  msgstr ""
451
 
452
+ #: includes/admin/stripe-ideal-settings.php:23
453
  msgid "Enable Stripe iDeal"
454
  msgstr ""
455
 
456
+ #: includes/admin/stripe-ideal-settings.php:32
457
  msgid "iDeal"
458
  msgstr ""
459
 
460
+ #: includes/admin/stripe-ideal-settings.php:39
461
  msgid "You will be redirected to iDeal."
462
  msgstr ""
463
 
464
+ #: includes/admin/stripe-multibanco-settings.php:10
465
  msgid "Relevant Payer Geography: Portugal"
466
  msgstr ""
467
 
468
+ #: includes/admin/stripe-multibanco-settings.php:19
469
  msgid "Enable Stripe Multibanco"
470
  msgstr ""
471
 
472
+ #: includes/admin/stripe-multibanco-settings.php:28
473
  msgid "Multibanco"
474
  msgstr ""
475
 
476
+ #: includes/admin/stripe-multibanco-settings.php:35
477
  msgid "You will be redirected to Multibanco."
478
  msgstr ""
479
 
480
+ #: includes/admin/stripe-p24-settings.php:10
481
  msgid "Relevant Payer Geography: Poland"
482
  msgstr ""
483
 
484
+ #: includes/admin/stripe-p24-settings.php:19
485
  msgid "Enable Stripe P24"
486
  msgstr ""
487
 
488
+ #: includes/admin/stripe-p24-settings.php:28
489
  msgid "Przelewy24 (P24)"
490
  msgstr ""
491
 
492
+ #: includes/admin/stripe-p24-settings.php:35
493
  msgid "You will be redirected to P24."
494
  msgstr ""
495
 
496
+ #: includes/admin/stripe-sepa-settings.php:10
497
+ msgid ""
498
+ "Relevant Payer Geography: France, Germany, Spain, Belgium, Netherlands, "
499
+ "Luxembourg, Italy, Portugal, Austria, Ireland"
500
  msgstr ""
501
 
502
+ #: includes/admin/stripe-sepa-settings.php:14
503
+ msgid ""
504
+ "<a "
505
+ "href=\"https://stripe.com/payments/payment-methods-guide#sepa-direct-debit\""
506
+ " target=\"_blank\">Payment Method Guide</a>"
507
  msgstr ""
508
 
509
+ #: includes/admin/stripe-sepa-settings.php:23
510
  msgid "Enable Stripe SEPA Direct Debit"
511
  msgstr ""
512
 
513
+ #: includes/admin/stripe-sepa-settings.php:32
514
  msgid "SEPA Direct Debit"
515
  msgstr ""
516
 
517
+ #: includes/admin/stripe-sepa-settings.php:39
518
  msgid "Mandate Information."
519
  msgstr ""
520
 
521
+ #: includes/admin/stripe-settings.php:11
522
  msgid "Enable Stripe"
523
  msgstr ""
524
 
525
+ #: includes/admin/stripe-settings.php:20
526
  msgid "Credit Card (Stripe)"
527
  msgstr ""
528
 
529
+ #: includes/admin/stripe-settings.php:27
530
  msgid "Pay with your credit card via Stripe."
531
  msgstr ""
532
 
533
+ #: includes/admin/stripe-settings.php:37
534
  #. translators: webhook URL
 
 
535
  msgid "Test mode"
536
  msgstr ""
537
 
538
+ #: includes/admin/stripe-settings.php:38
539
  msgid "Enable Test Mode"
540
  msgstr ""
541
 
542
+ #: includes/admin/stripe-settings.php:40
543
  msgid "Place the payment gateway in test mode using test API keys."
544
  msgstr ""
545
 
546
+ #: includes/admin/stripe-settings.php:45
547
  msgid "Test Publishable Key"
548
  msgstr ""
549
 
550
+ #: includes/admin/stripe-settings.php:47 includes/admin/stripe-settings.php:54
551
+ #: includes/admin/stripe-settings.php:61 includes/admin/stripe-settings.php:68
552
  msgid "Get your API keys from your stripe account."
553
  msgstr ""
554
 
555
+ #: includes/admin/stripe-settings.php:52
556
  msgid "Test Secret Key"
557
  msgstr ""
558
 
559
+ #: includes/admin/stripe-settings.php:59
560
  msgid "Live Publishable Key"
561
  msgstr ""
562
 
563
+ #: includes/admin/stripe-settings.php:66
564
  msgid "Live Secret Key"
565
  msgstr ""
566
 
567
+ #: includes/admin/stripe-settings.php:73
568
  msgid "Inline Credit Card Form"
569
  msgstr ""
570
 
571
+ #: includes/admin/stripe-settings.php:75
572
+ msgid ""
573
+ "Choose the style you want to show for your credit card form. When "
574
+ "unchecked, the credit card form will display separate credit card number "
575
+ "field, expiry date field and cvc field."
576
  msgstr ""
577
 
578
+ #: includes/admin/stripe-settings.php:80
579
  msgid "Statement Descriptor"
580
  msgstr ""
581
 
582
+ #: includes/admin/stripe-settings.php:82
583
+ msgid ""
584
+ "This may be up to 22 characters. The statement description must contain at "
585
+ "least one letter, may not include ><\"' characters, and will appear on your "
586
+ "customer's statement in capital letters."
587
  msgstr ""
588
 
589
+ #: includes/admin/stripe-settings.php:87
590
  msgid "Capture"
591
  msgstr ""
592
 
593
+ #: includes/admin/stripe-settings.php:88
594
  msgid "Capture charge immediately"
595
  msgstr ""
596
 
597
+ #: includes/admin/stripe-settings.php:90
598
+ msgid ""
599
+ "Whether or not to immediately capture the charge. When unchecked, the "
600
+ "charge issues an authorization and will need to be captured later. "
601
+ "Uncaptured charges expire in 7 days."
602
  msgstr ""
603
 
604
+ #: includes/admin/stripe-settings.php:95
605
  msgid "3D Secure"
606
  msgstr ""
607
 
608
+ #: includes/admin/stripe-settings.php:96
609
  msgid "Require 3D Secure when applicable"
610
  msgstr ""
611
 
612
+ #: includes/admin/stripe-settings.php:98
613
+ msgid ""
614
+ "Some payment methods have 3D Secure feature. This is an extra security "
615
+ "layer for your store. Choose how to handle payments when 3D Secure is "
616
+ "recommended. Enabling would require customers to use 3D Secure when "
617
+ "recommended."
618
  msgstr ""
619
 
620
+ #: includes/admin/stripe-settings.php:103
621
  msgid "Stripe Modal Checkout"
622
  msgstr ""
623
 
624
+ #: includes/admin/stripe-settings.php:104
625
  msgid "Enable Stripe Checkout"
626
  msgstr ""
627
 
628
+ #: includes/admin/stripe-settings.php:106
629
+ msgid ""
630
+ "If enabled, this option shows a \"pay\" button and modal credit card form "
631
+ "on the checkout, instead of credit card fields directly on the page. We "
632
+ "recommend you leave this disabled and use the embedded form as that is the "
633
+ "preferred method."
634
  msgstr ""
635
 
636
+ #: includes/admin/stripe-settings.php:111
637
  msgid "Stripe Checkout Image"
638
  msgstr ""
639
 
640
+ #: includes/admin/stripe-settings.php:112
641
+ msgid ""
642
+ "Optionally enter the URL to a 128x128px image of your brand or product. "
643
+ "e.g. "
644
+ "<code>https://yoursite.com/wp-content/uploads/2013/09/yourimage.jpg</code>"
645
  msgstr ""
646
 
647
+ #: includes/admin/stripe-settings.php:118
648
  msgid "Stripe Checkout Description"
649
  msgstr ""
650
 
651
+ #: includes/admin/stripe-settings.php:120
652
  msgid "Shows a description of your store on Stripe Modal Checkout."
653
  msgstr ""
654
 
655
+ #: includes/admin/stripe-settings.php:125
656
  msgid "Payment Request Buttons"
657
  msgstr ""
658
 
659
+ #: includes/admin/stripe-settings.php:127
660
  #. translators: 1) br tag 2) opening anchor tag 3) closing anchor tag
661
+ msgid ""
662
+ "Enable Payment Request Buttons. (Apple Pay/Chrome Payment Request API) "
663
+ "%1$sBy using Apple Pay, you agree to %2$s and %3$s's terms of service."
664
  msgstr ""
665
 
666
+ #: includes/admin/stripe-settings.php:129
667
+ msgid ""
668
+ "If enabled, users will be able to pay using Apple Pay or Chrome Payment "
669
+ "Request if supported by the browser."
670
  msgstr ""
671
 
672
+ #: includes/admin/stripe-settings.php:134
673
  msgid "Payment Request Button Type"
674
  msgstr ""
675
 
676
+ #: includes/admin/stripe-settings.php:135
677
  msgid "Button Type"
678
  msgstr ""
679
 
680
+ #: includes/admin/stripe-settings.php:137
681
  msgid "Select the button type you would like to show."
682
  msgstr ""
683
 
684
+ #: includes/admin/stripe-settings.php:141
685
  msgid "Default"
686
  msgstr ""
687
 
688
+ #: includes/admin/stripe-settings.php:142
689
  msgid "Buy"
690
  msgstr ""
691
 
692
+ #: includes/admin/stripe-settings.php:143
693
  msgid "Donate"
694
  msgstr ""
695
 
696
+ #: includes/admin/stripe-settings.php:147
697
  msgid "Payment Request Button Theme"
698
  msgstr ""
699
 
700
+ #: includes/admin/stripe-settings.php:148
701
  msgid "Button Theme"
702
  msgstr ""
703
 
704
+ #: includes/admin/stripe-settings.php:150
705
  msgid "Select the button theme you would like to show."
706
  msgstr ""
707
 
708
+ #: includes/admin/stripe-settings.php:154
709
  msgid "Dark"
710
  msgstr ""
711
 
712
+ #: includes/admin/stripe-settings.php:155
713
  msgid "Light"
714
  msgstr ""
715
 
716
+ #: includes/admin/stripe-settings.php:156
717
  msgid "Light-Outline"
718
  msgstr ""
719
 
720
+ #: includes/admin/stripe-settings.php:160
721
  msgid "Payment Request Button Height"
722
  msgstr ""
723
 
724
+ #: includes/admin/stripe-settings.php:161
725
  msgid "Button Height"
726
  msgstr ""
727
 
728
+ #: includes/admin/stripe-settings.php:163
729
+ msgid ""
730
+ "Enter the height you would like the button to be in pixels. Width will "
731
+ "always be 100%."
732
  msgstr ""
733
 
734
+ #: includes/admin/stripe-settings.php:168
735
  msgid "Saved Cards"
736
  msgstr ""
737
 
738
+ #: includes/admin/stripe-settings.php:169
739
  msgid "Enable Payment via Saved Cards"
740
  msgstr ""
741
 
742
+ #: includes/admin/stripe-settings.php:171
743
+ msgid ""
744
+ "If enabled, users will be able to pay with a saved card during checkout. "
745
+ "Card details are saved on Stripe servers, not on your store."
746
  msgstr ""
747
 
748
+ #: includes/admin/stripe-settings.php:176
749
  msgid "Logging"
750
  msgstr ""
751
 
752
+ #: includes/admin/stripe-settings.php:177
753
  msgid "Log debug messages"
754
  msgstr ""
755
 
756
+ #: includes/admin/stripe-settings.php:179
757
  msgid "Save debug messages to the WooCommerce System Status log."
758
  msgstr ""
759
 
760
+ #: includes/admin/stripe-sofort-settings.php:10
761
  msgid "Relevant Payer Geography: Germany, Austria"
762
  msgstr ""
763
 
764
+ #: includes/admin/stripe-sofort-settings.php:14
765
+ msgid ""
766
+ "<a href=\"https://stripe.com/payments/payment-methods-guide#sofort\" "
767
+ "target=\"_blank\">Payment Method Guide</a>"
768
  msgstr ""
769
 
770
+ #: includes/admin/stripe-sofort-settings.php:23
771
  msgid "Enable Stripe SOFORT"
772
  msgstr ""
773
 
774
+ #: includes/admin/stripe-sofort-settings.php:32
775
  msgid "SOFORT"
776
  msgstr ""
777
 
778
+ #: includes/admin/stripe-sofort-settings.php:39
779
  msgid "You will be redirected to SOFORT."
780
  msgstr ""
781
 
 
 
782
  #: includes/class-wc-gateway-stripe.php:118
783
+ #. translators: 1) link to Stripe register page 2) link to Stripe api keys page
784
+ msgid ""
785
+ "Stripe works by adding payment fields on the checkout and then sending the "
786
+ "details to Stripe for verification. <a href=\"%1$s\" target=\"_blank\">Sign "
787
+ "up</a> for a Stripe account, and <a href=\"%2$s\" target=\"_blank\">get "
788
+ "your Stripe account keys</a>."
789
  msgstr ""
790
 
791
  #: includes/class-wc-gateway-stripe.php:162
792
  msgid "Continue to payment"
793
  msgstr ""
794
 
 
 
795
  #: includes/class-wc-gateway-stripe.php:224
796
+ #. translators: 1) Opening anchor tag 2) closing anchor tag
797
+ msgid ""
798
+ "If your billing address has been changed for saved payment methods, be sure "
799
+ "to remove any %1$ssaved payment methods%2$s on file and re-add them."
800
  msgstr ""
801
 
802
+ #: includes/class-wc-gateway-stripe.php:285
803
  msgid "Add Card"
804
  msgstr ""
805
 
806
+ #: includes/class-wc-gateway-stripe.php:291
807
  msgid "Change Payment Method"
808
  msgstr ""
809
 
810
+ #: includes/class-wc-gateway-stripe.php:318
811
  #. translators: link to Stripe testing page
812
+ msgid ""
813
+ "TEST MODE ENABLED. In test mode, you can use the card number "
814
+ "4242424242424242 with any CVC and a valid expiration date or check the <a "
815
+ "href=\"%s\" target=\"_blank\">Testing Stripe documentation</a> for more "
816
+ "card numbers."
817
  msgstr ""
818
 
819
+ #: includes/class-wc-gateway-stripe.php:363
820
  msgid "Credit or debit card"
821
  msgstr ""
822
 
823
+ #: includes/class-wc-gateway-stripe.php:371
824
  msgid "Card Number"
825
  msgstr ""
826
 
827
+ #: includes/class-wc-gateway-stripe.php:382
828
  msgid "Expiry Date"
829
  msgstr ""
830
 
831
+ #: includes/class-wc-gateway-stripe.php:390
832
  msgid "Card Code (CVC)"
833
  msgstr ""
834
 
835
+ #: includes/class-wc-gateway-stripe.php:484
836
  msgid "Please accept the terms and conditions first"
837
  msgstr ""
838
 
839
+ #: includes/class-wc-gateway-stripe.php:485
840
  msgid "Please fill in required checkout fields first"
841
  msgstr ""
842
 
843
+ #: includes/class-wc-gateway-stripe.php:505
844
+ #: includes/class-wc-gateway-stripe.php:720
845
+ #: includes/compat/class-wc-stripe-subs-compat.php:140
846
+ msgid ""
847
+ "Sorry, we're not accepting prepaid cards at this time. Your credit card has "
848
+ "not been charge. Please try with alternative payment method."
849
  msgstr ""
850
 
851
+ #: includes/class-wc-gateway-stripe.php:506
852
  msgid "Please enter your IBAN account name."
853
  msgstr ""
854
 
855
+ #: includes/class-wc-gateway-stripe.php:507
856
  msgid "Please enter your IBAN account number."
857
  msgstr ""
858
 
859
+ #: includes/class-wc-gateway-stripe.php:526
860
  msgid "Billing First Name and Last Name are required."
861
  msgstr ""
862
 
863
+ #: includes/class-wc-gateway-stripe.php:610
864
  msgid "Place Order"
865
  msgstr ""
866
 
867
+ #: includes/class-wc-gateway-stripe.php:811
868
  #: includes/class-wc-stripe-order-handler.php:144
869
  #: includes/class-wc-stripe-webhook-handler.php:187
870
+ #: includes/payment-methods/class-wc-gateway-stripe-sepa.php:353
871
  msgid "This card is no longer available and has been removed."
872
  msgstr ""
873
 
874
+ #: includes/class-wc-gateway-stripe.php:830
875
  #: includes/class-wc-stripe-order-handler.php:162
876
  #: includes/class-wc-stripe-webhook-handler.php:206
877
+ #: includes/compat/class-wc-stripe-sepa-subs-compat.php:272
878
+ #: includes/compat/class-wc-stripe-subs-compat.php:253
879
+ #: includes/payment-methods/class-wc-gateway-stripe-sepa.php:373
880
+ msgid ""
881
+ "Sorry, we are unable to process your payment at this time. Please retry "
882
+ "later."
883
  msgstr ""
884
 
885
+ #: includes/class-wc-gateway-stripe.php:907
886
  #. translators: error message
 
 
887
  msgid "This represents the fee Stripe collects for the transaction."
888
  msgstr ""
889
 
890
+ #: includes/class-wc-gateway-stripe.php:908
891
  msgid "Stripe Fee:"
892
  msgstr ""
893
 
894
+ #: includes/class-wc-gateway-stripe.php:944
895
+ msgid ""
896
+ "This represents the net total that will be credited to your Stripe bank "
897
+ "account. This may be in the currency that is set in your Stripe account."
898
  msgstr ""
899
 
900
+ #: includes/class-wc-gateway-stripe.php:945
901
  msgid "Stripe Payout:"
902
  msgstr ""
903
 
909
  msgid "Unable to verify domain - missing secret key."
910
  msgstr ""
911
 
912
+ #: includes/class-wc-stripe-apple-pay-registration.php:151
913
+ #: includes/class-wc-stripe-apple-pay-registration.php:160
914
  #. translators: error message
 
 
 
915
  msgid "Unable to verify domain - %s"
916
  msgstr ""
917
 
918
+ #: includes/class-wc-stripe-apple-pay-registration.php:183
919
  msgid "Unable to create domain association folder to domain root."
920
  msgstr ""
921
 
922
+ #: includes/class-wc-stripe-apple-pay-registration.php:189
923
  msgid "Unable to copy domain association file to domain root."
924
  msgstr ""
925
 
926
+ #: includes/class-wc-stripe-apple-pay-registration.php:246
927
  #. translators: 1) HTML anchor open tag 2) HTML anchor closing tag
928
+ msgid ""
929
+ "Apple Pay domain verification failed. Please check the %1$slog%2$s to see "
930
+ "the issue. (Logging must be enabled to see recorded logs)"
931
  msgstr ""
932
 
933
  #: includes/class-wc-stripe-customer.php:119
938
  msgid "Username"
939
  msgstr ""
940
 
941
+ #: includes/class-wc-stripe-customer.php:203
942
  msgid "Unable to add payment source."
943
  msgstr ""
944
 
945
+ #: includes/class-wc-stripe-helper.php:209
946
  msgid "The card number is not a valid credit card number."
947
  msgstr ""
948
 
949
+ #: includes/class-wc-stripe-helper.php:210
950
  msgid "The card's expiration month is invalid."
951
  msgstr ""
952
 
953
+ #: includes/class-wc-stripe-helper.php:211
954
  msgid "The card's expiration year is invalid."
955
  msgstr ""
956
 
957
+ #: includes/class-wc-stripe-helper.php:212
958
  msgid "The card's security code is invalid."
959
  msgstr ""
960
 
961
+ #: includes/class-wc-stripe-helper.php:213
962
  msgid "The card number is incorrect."
963
  msgstr ""
964
 
965
+ #: includes/class-wc-stripe-helper.php:214
966
  msgid "The card number is incomplete."
967
  msgstr ""
968
 
969
+ #: includes/class-wc-stripe-helper.php:215
970
  msgid "The card's security code is incomplete."
971
  msgstr ""
972
 
973
+ #: includes/class-wc-stripe-helper.php:216
974
  msgid "The card's expiration date is incomplete."
975
  msgstr ""
976
 
977
+ #: includes/class-wc-stripe-helper.php:217
978
  msgid "The card has expired."
979
  msgstr ""
980
 
981
+ #: includes/class-wc-stripe-helper.php:218
982
  msgid "The card's security code is incorrect."
983
  msgstr ""
984
 
985
+ #: includes/class-wc-stripe-helper.php:219
986
  msgid "The card's zip code failed validation."
987
  msgstr ""
988
 
989
+ #: includes/class-wc-stripe-helper.php:220
990
  msgid "The card's expiration year is in the past"
991
  msgstr ""
992
 
993
+ #: includes/class-wc-stripe-helper.php:221
994
  msgid "The card was declined."
995
  msgstr ""
996
 
997
+ #: includes/class-wc-stripe-helper.php:222
998
  msgid "There is no card on a customer that is being charged."
999
  msgstr ""
1000
 
1001
+ #: includes/class-wc-stripe-helper.php:223
1002
  msgid "An error occurred while processing the card."
1003
  msgstr ""
1004
 
1005
+ #: includes/class-wc-stripe-helper.php:224
1006
  #: includes/class-wc-stripe-order-handler.php:95
1007
  msgid "Unable to process this payment, please try again or use alternative method."
1008
  msgstr ""
1009
 
1010
+ #: includes/class-wc-stripe-helper.php:225
1011
  msgid "The billing country is not accepted by SOFORT. Please try another country."
1012
  msgstr ""
1013
 
 
 
1014
  #: includes/class-wc-stripe-order-handler.php:194
1015
+ #. translators: error message
1016
  msgid "Stripe payment failed: %s"
1017
  msgstr ""
1018
 
1019
+ #: includes/class-wc-stripe-order-handler.php:245
1020
+ #: includes/class-wc-stripe-order-handler.php:257
1021
  #. translators: error message
 
 
1022
  msgid "Unable to capture charge! %s"
1023
  msgstr ""
1024
 
1026
  msgid "SEPA IBAN"
1027
  msgstr ""
1028
 
 
 
1029
  #: includes/class-wc-stripe-sepa-payment-token.php:41
1030
+ #. translators: last 4 digits of IBAN account
1031
  msgid "SEPA IBAN ending in %s"
1032
  msgstr ""
1033
 
 
 
1034
  #: includes/class-wc-stripe-webhook-handler.php:264
1035
+ #. translators: 1) The URL to the order.
1036
+ msgid ""
1037
+ "A dispute was created for this order. Response is needed. Please go to your "
1038
+ "<a href=\"%s\" title=\"Stripe Dashboard\" target=\"_blank\">Stripe "
1039
+ "Dashboard</a> to review this dispute."
1040
  msgstr ""
1041
 
 
 
1042
  #: includes/class-wc-stripe-webhook-handler.php:309
1043
+ #. translators: partial captured amount
1044
  msgid "This charge was partially captured via Stripe Dashboard in the amount of: %s"
1045
  msgstr ""
1046
 
1047
+ #: includes/class-wc-stripe-webhook-handler.php:390
1048
  msgid "This payment failed to clear."
1049
  msgstr ""
1050
 
1051
+ #: includes/class-wc-stripe-webhook-handler.php:417
1052
  msgid "This payment has cancelled."
1053
  msgstr ""
1054
 
1057
  msgstr ""
1058
 
1059
  #: includes/class-wc-stripe-webhook-handler.php:452
1060
+ #: includes/class-wc-stripe-webhook-handler.php:480
1061
  msgid "Pre-Authorization Released via Stripe Dashboard"
1062
  msgstr ""
1063
 
1064
+ #: includes/class-wc-stripe-webhook-handler.php:480
1065
  #. translators: 1) dollar amount 2) transaction id 3) refund message
 
 
1066
  msgid "Refunded %1$s - Refund ID: %2$s - %3$s"
1067
  msgstr ""
1068
 
1069
+ #: includes/class-wc-stripe-webhook-handler.php:502
1070
  #. translators: 1) The URL to the order. 2) The reason type.
1071
+ msgid ""
1072
+ "A review has been opened for this order. Action is needed. Please go to "
1073
+ "your <a href=\"%1$s\" title=\"Stripe Dashboard\" target=\"_blank\">Stripe "
1074
+ "Dashboard</a> to review the issue. Reason: (%2$s)"
1075
  msgstr ""
1076
 
1077
+ #: includes/class-wc-stripe-webhook-handler.php:526
1078
  #. translators: 1) The reason type.
 
 
1079
  msgid "The opened review for this order is now closed. Reason: (%s)"
1080
  msgstr ""
1081
 
1083
  msgid "Unable to store payment details. Please try again."
1084
  msgstr ""
1085
 
 
 
1086
  #: includes/compat/class-wc-stripe-pre-orders-compat.php:120
1087
+ #. translators: error message
1088
  msgid "Stripe Transaction Failed (%s)"
1089
  msgstr ""
1090
 
1091
+ #: includes/compat/class-wc-stripe-sepa-subs-compat.php:97
1092
+ #: includes/compat/class-wc-stripe-subs-compat.php:97
1093
+ msgid ""
1094
+ "Update the Payment Method used for all of my active subscriptions "
1095
+ "(optional)."
1096
+ msgstr ""
1097
+
1098
+ #: includes/compat/class-wc-stripe-sepa-subs-compat.php:235
1099
+ #: includes/compat/class-wc-stripe-subs-compat.php:216
1100
  msgid "Customer not found"
1101
  msgstr ""
1102
 
1103
+ #: includes/compat/class-wc-stripe-sepa-subs-compat.php:395
1104
+ #: includes/compat/class-wc-stripe-subs-compat.php:407
1105
  #. translators: error message
 
 
 
1106
  msgid "A \"Stripe Customer ID\" value is required."
1107
  msgstr ""
1108
 
1109
+ #: includes/compat/class-wc-stripe-sepa-subs-compat.php:397
1110
+ #: includes/compat/class-wc-stripe-subs-compat.php:409
1111
+ msgid ""
1112
+ "Invalid customer ID. A valid \"Stripe Customer ID\" must begin with "
1113
+ "\"cus_\"."
1114
  msgstr ""
1115
 
1116
+ #: includes/compat/class-wc-stripe-sepa-subs-compat.php:406
1117
+ #: includes/compat/class-wc-stripe-subs-compat.php:418
1118
+ msgid ""
1119
+ "Invalid source ID. A valid source \"Stripe Source ID\" must begin with "
1120
+ "\"src_\" or \"card_\"."
1121
  msgstr ""
1122
 
1123
+ #: includes/compat/class-wc-stripe-sepa-subs-compat.php:479
1124
  #. translators: 1) last 4 digits of SEPA Direct Debit
 
 
1125
  msgid "Via SEPA Direct Debit ending in %1$s"
1126
  msgstr ""
1127
 
1128
+ #: includes/compat/class-wc-stripe-subs-compat.php:499
1129
  #. translators: 1) card brand 2) last 4 digits
 
 
 
1130
  msgid "Via %1$s card ending in %2$s"
1131
  msgstr ""
1132
 
1133
  #: includes/payment-methods/class-wc-gateway-stripe-alipay.php:60
1134
+ #: woocommerce-gateway-stripe.php:252
1135
  msgid "Stripe Alipay"
1136
  msgstr ""
1137
 
 
 
1138
  #: includes/payment-methods/class-wc-gateway-stripe-alipay.php:62
1139
  #: includes/payment-methods/class-wc-gateway-stripe-bancontact.php:62
1140
  #: includes/payment-methods/class-wc-gateway-stripe-eps.php:62
1144
  #: includes/payment-methods/class-wc-gateway-stripe-p24.php:62
1145
  #: includes/payment-methods/class-wc-gateway-stripe-sepa.php:77
1146
  #: includes/payment-methods/class-wc-gateway-stripe-sofort.php:62
1147
+ #. translators: link
1148
  msgid "All other general Stripe settings can be adjusted <a href=\"%s\">here</a>."
1149
  msgstr ""
1150
 
1151
+ #: includes/payment-methods/class-wc-gateway-stripe-alipay.php:186
1152
+ #: includes/payment-methods/class-wc-gateway-stripe-bancontact.php:179
1153
+ #: includes/payment-methods/class-wc-gateway-stripe-eps.php:179
1154
+ #: includes/payment-methods/class-wc-gateway-stripe-giropay.php:179
1155
+ #: includes/payment-methods/class-wc-gateway-stripe-ideal.php:179
1156
+ #: includes/payment-methods/class-wc-gateway-stripe-multibanco.php:183
1157
+ #: includes/payment-methods/class-wc-gateway-stripe-p24.php:180
1158
+ #: includes/payment-methods/class-wc-gateway-stripe-sofort.php:179
1159
  msgid "Add Payment"
1160
  msgstr ""
1161
 
1162
  #: includes/payment-methods/class-wc-gateway-stripe-bancontact.php:60
1163
+ #: woocommerce-gateway-stripe.php:246
1164
  msgid "Stripe Bancontact"
1165
  msgstr ""
1166
 
1167
  #: includes/payment-methods/class-wc-gateway-stripe-eps.php:60
1168
+ #: woocommerce-gateway-stripe.php:249
1169
  msgid "Stripe EPS"
1170
  msgstr ""
1171
 
1172
  #: includes/payment-methods/class-wc-gateway-stripe-giropay.php:60
1173
+ #: woocommerce-gateway-stripe.php:248
1174
  msgid "Stripe Giropay"
1175
  msgstr ""
1176
 
1177
  #: includes/payment-methods/class-wc-gateway-stripe-ideal.php:60
1178
+ #: woocommerce-gateway-stripe.php:250
1179
  msgid "Stripe iDeal"
1180
  msgstr ""
1181
 
1182
  #: includes/payment-methods/class-wc-gateway-stripe-multibanco.php:60
1183
+ #: woocommerce-gateway-stripe.php:254
1184
  msgid "Stripe Multibanco"
1185
  msgstr ""
1186
 
1187
+ #: includes/payment-methods/class-wc-gateway-stripe-multibanco.php:242
1188
+ #: includes/payment-methods/class-wc-gateway-stripe-multibanco.php:254
1189
  msgid "MULTIBANCO INFORMAÇÕES DE ENCOMENDA:"
1190
  msgstr ""
1191
 
1192
+ #: includes/payment-methods/class-wc-gateway-stripe-multibanco.php:244
1193
+ #: includes/payment-methods/class-wc-gateway-stripe-multibanco.php:257
1194
  msgid "Montante:"
1195
  msgstr ""
1196
 
1197
+ #: includes/payment-methods/class-wc-gateway-stripe-multibanco.php:247
1198
+ #: includes/payment-methods/class-wc-gateway-stripe-multibanco.php:261
1199
  msgid "Entidade:"
1200
  msgstr ""
1201
 
1202
+ #: includes/payment-methods/class-wc-gateway-stripe-multibanco.php:250
1203
+ #: includes/payment-methods/class-wc-gateway-stripe-multibanco.php:265
1204
  msgid "Referencia:"
1205
  msgstr ""
1206
 
1207
+ #: includes/payment-methods/class-wc-gateway-stripe-multibanco.php:366
1208
  msgid "Awaiting Multibanco payment"
1209
  msgstr ""
1210
 
1211
  #: includes/payment-methods/class-wc-gateway-stripe-p24.php:60
1212
+ #: woocommerce-gateway-stripe.php:251
1213
  msgid "Stripe P24"
1214
  msgstr ""
1215
 
1216
  #: includes/payment-methods/class-wc-gateway-stripe-sepa.php:75
1217
+ #: woocommerce-gateway-stripe.php:253
1218
  msgid "Stripe SEPA Direct Debit"
1219
  msgstr ""
1220
 
1221
+ #: includes/payment-methods/class-wc-gateway-stripe-sepa.php:212
1222
  #. translators: statement descriptor
1223
+ msgid ""
1224
+ "By providing your IBAN and confirming this payment, you are authorizing %s "
1225
+ "and Stripe, our payment service provider, to send instructions to your bank "
1226
+ "to debit your account and your bank to debit your account in accordance "
1227
+ "with those instructions. You are entitled to a refund from your bank under "
1228
+ "the terms and conditions of your agreement with your bank. A refund must be "
1229
+ "claimed within 8 weeks starting from the date on which your account was "
1230
+ "debited."
1231
  msgstr ""
1232
 
1233
+ #: includes/payment-methods/class-wc-gateway-stripe-sepa.php:228
1234
  msgid "IBAN."
1235
  msgstr ""
1236
 
1237
+ #: includes/payment-methods/class-wc-gateway-stripe-sepa.php:269
1238
+ msgid ""
1239
+ "TEST MODE ENABLED. In test mode, you can use IBAN number "
1240
+ "DE89370400440532013000."
1241
  msgstr ""
1242
 
1243
  #: includes/payment-methods/class-wc-gateway-stripe-sofort.php:60
1244
+ #: woocommerce-gateway-stripe.php:247
1245
  msgid "Stripe SOFORT"
1246
  msgstr ""
1247
 
1266
  msgid "Sorry, we're not accepting prepaid cards at this time."
1267
  msgstr ""
1268
 
 
 
1269
  #: includes/payment-methods/class-wc-stripe-payment-request.php:506
1270
+ #. translators: Do not translate the [option] placeholder
1271
  msgid "Unknown shipping option \"[option]\"."
1272
  msgstr ""
1273
 
1280
  msgid "Unable to find shipping method for address."
1281
  msgstr ""
1282
 
 
 
1283
  #: includes/payment-methods/class-wc-stripe-payment-request.php:831
1284
+ #. translators: 1: product name 2: quantity in stock
1285
+ msgid ""
1286
+ "You cannot add that amount of \"%1$s\"; to the cart because there is not "
1287
+ "enough stock (%2$s remaining)."
1288
  msgstr ""
1289
 
1290
  #: includes/payment-methods/class-wc-stripe-payment-request.php:985
1295
  msgid "Discount"
1296
  msgstr ""
1297
 
1298
+ #: woocommerce-gateway-stripe.php:32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1299
  #. translators: 1. URL link.
1300
+ msgid ""
1301
+ "Stripe requires WooCommerce to be installed and active. You can download %s "
1302
+ "here."
1303
  msgstr ""
1304
 
1305
+ #: woocommerce-gateway-stripe.php:193
1306
  msgid "Settings"
1307
  msgstr ""
1308
 
1309
+ #: woocommerce-gateway-stripe.php:194
1310
  msgid "Docs"
1311
  msgstr ""
1312
 
1313
+ #: woocommerce-gateway-stripe.php:195
1314
  msgid "Support"
1315
  msgstr ""
1316
+
1317
  #. Plugin Name of the plugin/theme
1318
  msgid "WooCommerce Stripe Gateway"
1319
  msgstr ""
1332
 
1333
  #. Author URI of the plugin/theme
1334
  msgid "https://woocommerce.com/"
1335
+ msgstr ""
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: credit card, stripe, apple pay, payment request, google pay, sepa, sofort,
4
  Requires at least: 4.4
5
  Tested up to: 4.9
6
  Requires PHP: 5.6
7
- Stable tag: 4.1.10
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
  Attributions: thorsten-stripe
@@ -101,12 +101,20 @@ If you get stuck, you can ask for help in the Plugin Forum.
101
 
102
  == Changelog ==
103
 
104
- = 4.1.10 - 2018-09-17 =
105
- * Fix - When 3DS card redirect status is "not_required", charge the 3DS source.
106
- * Fix - Payment Request not validating quantity before payment sheet shows.
107
- * Fix - Test mode info not showing when description field is left blank.
108
- * Add - Filter for Payment Request localized parameters `wc_stripe_payment_request_params`.
109
- * Update - Stripe API version to 2018-09-06.
 
 
 
 
 
 
 
 
110
 
111
  [See changelog for all versions](https://raw.githubusercontent.com/woothemes/woocommerce-gateway-stripe/master/changelog.txt).
112
 
4
  Requires at least: 4.4
5
  Tested up to: 4.9
6
  Requires PHP: 5.6
7
+ Stable tag: 4.1.11
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
  Attributions: thorsten-stripe
101
 
102
  == Changelog ==
103
 
104
+ = 4.1.11 - 2018-10-17 =
105
+ * Fix - Explicitly set 3DS source id to prevent 3DS source not charging when not required.
106
+ * Fix - Prevent Stripe JS failed live/test check from throwing JS error.
107
+ * Fix - Find order by source ID if charge ID is not found when cancelled webhook is triggered.
108
+ * Fix - Partial refund on Stripe captured charge erroneously refunding total amount.
109
+ * Fix - Capture charge on previously authorized charge, not showing Stripe fees.
110
+ * Fix - Check if payment icons are set before trying to use them.
111
+ * Fix - Can't use method in write context errors.
112
+ * Deprecate - Soft deprecated function is_pre_30 with is_wc_lt function.
113
+ * Add - Ability to update all active subscription's payment method when adding a payment.
114
+ * Add - Hook to show update all active subscription's payment method checkbox `wc_stripe_display_update_subs_payment_method_card_checkbox`.
115
+ * Add - CSS minification.
116
+ * Update - WC 3.5 compatibility.
117
+ * Update - Stripe API version to 2018-09-24.
118
 
119
  [See changelog for all versions](https://raw.githubusercontent.com/woothemes/woocommerce-gateway-stripe/master/changelog.txt).
120
 
woocommerce-gateway-stripe.php CHANGED
@@ -5,11 +5,11 @@
5
  * Description: Take credit card payments on your store using Stripe.
6
  * Author: WooCommerce
7
  * Author URI: https://woocommerce.com/
8
- * Version: 4.1.10
9
  * Requires at least: 4.4
10
  * Tested up to: 4.9
11
  * WC requires at least: 2.6
12
- * WC tested up to: 3.4
13
  * Text Domain: woocommerce-gateway-stripe
14
  * Domain Path: /languages
15
  *
@@ -19,6 +19,8 @@ if ( ! defined( 'ABSPATH' ) ) {
19
  exit;
20
  }
21
 
 
 
22
  /**
23
  * WooCommerce fallback notice.
24
  *
@@ -44,7 +46,7 @@ function woocommerce_gateway_stripe_init() {
44
  /**
45
  * Required minimums and constants
46
  */
47
- define( 'WC_STRIPE_VERSION', '4.1.10' );
48
  define( 'WC_STRIPE_MIN_PHP_VER', '5.6.0' );
49
  define( 'WC_STRIPE_MIN_WC_VER', '2.6.0' );
50
  define( 'WC_STRIPE_MAIN_FILE', __FILE__ );
@@ -58,11 +60,6 @@ function woocommerce_gateway_stripe_init() {
58
  */
59
  private static $instance;
60
 
61
- /**
62
- * @var Reference to logging class.
63
- */
64
- private static $log;
65
-
66
  /**
67
  * Returns the *Singleton* instance of this class.
68
  *
@@ -108,41 +105,41 @@ function woocommerce_gateway_stripe_init() {
108
  */
109
  public function init() {
110
  if ( is_admin() ) {
111
- require_once( dirname( __FILE__ ) . '/includes/admin/class-wc-stripe-privacy.php' );
112
  }
113
 
114
- require_once( dirname( __FILE__ ) . '/includes/class-wc-stripe-exception.php' );
115
- require_once( dirname( __FILE__ ) . '/includes/class-wc-stripe-logger.php' );
116
- require_once( dirname( __FILE__ ) . '/includes/class-wc-stripe-helper.php' );
117
- include_once( dirname( __FILE__ ) . '/includes/class-wc-stripe-api.php' );
118
- require_once( dirname( __FILE__ ) . '/includes/abstracts/abstract-wc-stripe-payment-gateway.php' );
119
- require_once( dirname( __FILE__ ) . '/includes/class-wc-stripe-webhook-handler.php' );
120
- require_once( dirname( __FILE__ ) . '/includes/class-wc-stripe-sepa-payment-token.php' );
121
- require_once( dirname( __FILE__ ) . '/includes/class-wc-stripe-apple-pay-registration.php' );
122
- require_once( dirname( __FILE__ ) . '/includes/compat/class-wc-stripe-pre-orders-compat.php' );
123
- require_once( dirname( __FILE__ ) . '/includes/class-wc-gateway-stripe.php' );
124
- require_once( dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-bancontact.php' );
125
- require_once( dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-sofort.php' );
126
- require_once( dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-giropay.php' );
127
- require_once( dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-eps.php' );
128
- require_once( dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-ideal.php' );
129
- require_once( dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-p24.php' );
130
- require_once( dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-alipay.php' );
131
- require_once( dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-sepa.php' );
132
- require_once( dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-multibanco.php' );
133
- require_once( dirname( __FILE__ ) . '/includes/payment-methods/class-wc-stripe-payment-request.php' );
134
- require_once( dirname( __FILE__ ) . '/includes/compat/class-wc-stripe-subs-compat.php' );
135
- require_once( dirname( __FILE__ ) . '/includes/compat/class-wc-stripe-sepa-subs-compat.php' );
136
- require_once( dirname( __FILE__ ) . '/includes/class-wc-stripe-order-handler.php' );
137
- require_once( dirname( __FILE__ ) . '/includes/class-wc-stripe-payment-tokens.php' );
138
- require_once( dirname( __FILE__ ) . '/includes/class-wc-stripe-customer.php' );
139
 
140
  if ( is_admin() ) {
141
- require_once( dirname( __FILE__ ) . '/includes/admin/class-wc-stripe-admin-notices.php' );
142
  }
143
 
144
  // REMOVE IN THE FUTURE.
145
- require_once( dirname( __FILE__ ) . '/includes/deprecated/class-wc-stripe-apple-pay.php' );
146
 
147
  add_filter( 'woocommerce_payment_gateways', array( $this, 'add_gateways' ) );
148
  add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'plugin_action_links' ) );
5
  * Description: Take credit card payments on your store using Stripe.
6
  * Author: WooCommerce
7
  * Author URI: https://woocommerce.com/
8
+ * Version: 4.1.11
9
  * Requires at least: 4.4
10
  * Tested up to: 4.9
11
  * WC requires at least: 2.6
12
+ * WC tested up to: 3.5
13
  * Text Domain: woocommerce-gateway-stripe
14
  * Domain Path: /languages
15
  *
19
  exit;
20
  }
21
 
22
+ // phpcs:disable WordPress.Files.FileName
23
+
24
  /**
25
  * WooCommerce fallback notice.
26
  *
46
  /**
47
  * Required minimums and constants
48
  */
49
+ define( 'WC_STRIPE_VERSION', '4.1.11' );
50
  define( 'WC_STRIPE_MIN_PHP_VER', '5.6.0' );
51
  define( 'WC_STRIPE_MIN_WC_VER', '2.6.0' );
52
  define( 'WC_STRIPE_MAIN_FILE', __FILE__ );
60
  */
61
  private static $instance;
62
 
 
 
 
 
 
63
  /**
64
  * Returns the *Singleton* instance of this class.
65
  *
105
  */
106
  public function init() {
107
  if ( is_admin() ) {
108
+ require_once dirname( __FILE__ ) . '/includes/admin/class-wc-stripe-privacy.php';
109
  }
110
 
111
+ require_once dirname( __FILE__ ) . '/includes/class-wc-stripe-exception.php';
112
+ require_once dirname( __FILE__ ) . '/includes/class-wc-stripe-logger.php';
113
+ require_once dirname( __FILE__ ) . '/includes/class-wc-stripe-helper.php';
114
+ include_once dirname( __FILE__ ) . '/includes/class-wc-stripe-api.php';
115
+ require_once dirname( __FILE__ ) . '/includes/abstracts/abstract-wc-stripe-payment-gateway.php';
116
+ require_once dirname( __FILE__ ) . '/includes/class-wc-stripe-webhook-handler.php';
117
+ require_once dirname( __FILE__ ) . '/includes/class-wc-stripe-sepa-payment-token.php';
118
+ require_once dirname( __FILE__ ) . '/includes/class-wc-stripe-apple-pay-registration.php';
119
+ require_once dirname( __FILE__ ) . '/includes/compat/class-wc-stripe-pre-orders-compat.php';
120
+ require_once dirname( __FILE__ ) . '/includes/class-wc-gateway-stripe.php';
121
+ require_once dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-bancontact.php';
122
+ require_once dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-sofort.php';
123
+ require_once dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-giropay.php';
124
+ require_once dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-eps.php';
125
+ require_once dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-ideal.php';
126
+ require_once dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-p24.php';
127
+ require_once dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-alipay.php';
128
+ require_once dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-sepa.php';
129
+ require_once dirname( __FILE__ ) . '/includes/payment-methods/class-wc-gateway-stripe-multibanco.php';
130
+ require_once dirname( __FILE__ ) . '/includes/payment-methods/class-wc-stripe-payment-request.php';
131
+ require_once dirname( __FILE__ ) . '/includes/compat/class-wc-stripe-subs-compat.php';
132
+ require_once dirname( __FILE__ ) . '/includes/compat/class-wc-stripe-sepa-subs-compat.php';
133
+ require_once dirname( __FILE__ ) . '/includes/class-wc-stripe-order-handler.php';
134
+ require_once dirname( __FILE__ ) . '/includes/class-wc-stripe-payment-tokens.php';
135
+ require_once dirname( __FILE__ ) . '/includes/class-wc-stripe-customer.php';
136
 
137
  if ( is_admin() ) {
138
+ require_once dirname( __FILE__ ) . '/includes/admin/class-wc-stripe-admin-notices.php';
139
  }
140
 
141
  // REMOVE IN THE FUTURE.
142
+ require_once dirname( __FILE__ ) . '/includes/deprecated/class-wc-stripe-apple-pay.php';
143
 
144
  add_filter( 'woocommerce_payment_gateways', array( $this, 'add_gateways' ) );
145
  add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'plugin_action_links' ) );