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' ) ) ) );