@@ -1,29 +1,29 @@ |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) { |
|
2 | +if ( ! defined('ABSPATH')) { |
|
3 | 3 | exit; |
4 | 4 | } |
5 | 5 | |
6 | -return apply_filters( 'wc_stripe_sepa_settings', |
|
6 | +return apply_filters('wc_stripe_sepa_settings', |
|
7 | 7 | array( |
8 | 8 | 'enabled' => array( |
9 | - 'title' => __( 'Enable/Disable', 'woocommerce-gateway-stripe' ), |
|
10 | - 'label' => __( 'Enable Stripe SEPA Direct Debit', 'woocommerce-gateway-stripe' ), |
|
9 | + 'title' => __('Enable/Disable', 'woocommerce-gateway-stripe'), |
|
10 | + 'label' => __('Enable Stripe SEPA Direct Debit', 'woocommerce-gateway-stripe'), |
|
11 | 11 | 'type' => 'checkbox', |
12 | 12 | 'description' => '', |
13 | 13 | 'default' => 'no', |
14 | 14 | ), |
15 | 15 | 'title' => array( |
16 | - 'title' => __( 'Title', 'woocommerce-gateway-stripe' ), |
|
16 | + 'title' => __('Title', 'woocommerce-gateway-stripe'), |
|
17 | 17 | 'type' => 'text', |
18 | - 'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe' ), |
|
19 | - 'default' => __( 'SEPA Direct Debit', 'woocommerce-gateway-stripe' ), |
|
18 | + 'description' => __('This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe'), |
|
19 | + 'default' => __('SEPA Direct Debit', 'woocommerce-gateway-stripe'), |
|
20 | 20 | 'desc_tip' => true, |
21 | 21 | ), |
22 | 22 | 'description' => array( |
23 | - 'title' => __( 'Description', 'woocommerce-gateway-stripe' ), |
|
23 | + 'title' => __('Description', 'woocommerce-gateway-stripe'), |
|
24 | 24 | 'type' => 'text', |
25 | - 'description' => __( 'This controls the description which the user sees during checkout.', 'woocommerce-gateway-stripe' ), |
|
26 | - 'default' => __( 'Mandate Information.', 'woocommerce-gateway-stripe' ), |
|
25 | + 'description' => __('This controls the description which the user sees during checkout.', 'woocommerce-gateway-stripe'), |
|
26 | + 'default' => __('Mandate Information.', 'woocommerce-gateway-stripe'), |
|
27 | 27 | 'desc_tip' => true, |
28 | 28 | ), |
29 | 29 | ) |
@@ -1,29 +1,29 @@ |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) { |
|
2 | +if ( ! defined('ABSPATH')) { |
|
3 | 3 | exit; |
4 | 4 | } |
5 | 5 | |
6 | -return apply_filters( 'wc_stripe_alipay_settings', |
|
6 | +return apply_filters('wc_stripe_alipay_settings', |
|
7 | 7 | array( |
8 | 8 | 'enabled' => array( |
9 | - 'title' => __( 'Enable/Disable', 'woocommerce-gateway-stripe' ), |
|
10 | - 'label' => __( 'Enable Stripe Alipay', 'woocommerce-gateway-stripe' ), |
|
9 | + 'title' => __('Enable/Disable', 'woocommerce-gateway-stripe'), |
|
10 | + 'label' => __('Enable Stripe Alipay', 'woocommerce-gateway-stripe'), |
|
11 | 11 | 'type' => 'checkbox', |
12 | 12 | 'description' => '', |
13 | 13 | 'default' => 'no', |
14 | 14 | ), |
15 | 15 | 'title' => array( |
16 | - 'title' => __( 'Title', 'woocommerce-gateway-stripe' ), |
|
16 | + 'title' => __('Title', 'woocommerce-gateway-stripe'), |
|
17 | 17 | 'type' => 'text', |
18 | - 'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe' ), |
|
19 | - 'default' => __( 'Alipay', 'woocommerce-gateway-stripe' ), |
|
18 | + 'description' => __('This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe'), |
|
19 | + 'default' => __('Alipay', 'woocommerce-gateway-stripe'), |
|
20 | 20 | 'desc_tip' => true, |
21 | 21 | ), |
22 | 22 | 'description' => array( |
23 | - 'title' => __( 'Description', 'woocommerce-gateway-stripe' ), |
|
23 | + 'title' => __('Description', 'woocommerce-gateway-stripe'), |
|
24 | 24 | 'type' => 'text', |
25 | - 'description' => __( 'This controls the description which the user sees during checkout.', 'woocommerce-gateway-stripe' ), |
|
26 | - 'default' => __( 'You will be redirected to Alipay.', 'woocommerce-gateway-stripe' ), |
|
25 | + 'description' => __('This controls the description which the user sees during checkout.', 'woocommerce-gateway-stripe'), |
|
26 | + 'default' => __('You will be redirected to Alipay.', 'woocommerce-gateway-stripe'), |
|
27 | 27 | 'desc_tip' => true, |
28 | 28 | ), |
29 | 29 | ) |
@@ -1,29 +1,29 @@ |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) { |
|
2 | +if ( ! defined('ABSPATH')) { |
|
3 | 3 | exit; |
4 | 4 | } |
5 | 5 | |
6 | -return apply_filters( 'wc_stripe_ideal_settings', |
|
6 | +return apply_filters('wc_stripe_ideal_settings', |
|
7 | 7 | array( |
8 | 8 | 'enabled' => array( |
9 | - 'title' => __( 'Enable/Disable', 'woocommerce-gateway-stripe' ), |
|
10 | - 'label' => __( 'Enable Stripe iDeal', 'woocommerce-gateway-stripe' ), |
|
9 | + 'title' => __('Enable/Disable', 'woocommerce-gateway-stripe'), |
|
10 | + 'label' => __('Enable Stripe iDeal', 'woocommerce-gateway-stripe'), |
|
11 | 11 | 'type' => 'checkbox', |
12 | 12 | 'description' => '', |
13 | 13 | 'default' => 'no', |
14 | 14 | ), |
15 | 15 | 'title' => array( |
16 | - 'title' => __( 'Title', 'woocommerce-gateway-stripe' ), |
|
16 | + 'title' => __('Title', 'woocommerce-gateway-stripe'), |
|
17 | 17 | 'type' => 'text', |
18 | - 'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe' ), |
|
19 | - 'default' => __( 'iDeal', 'woocommerce-gateway-stripe' ), |
|
18 | + 'description' => __('This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe'), |
|
19 | + 'default' => __('iDeal', 'woocommerce-gateway-stripe'), |
|
20 | 20 | 'desc_tip' => true, |
21 | 21 | ), |
22 | 22 | 'description' => array( |
23 | - 'title' => __( 'Description', 'woocommerce-gateway-stripe' ), |
|
23 | + 'title' => __('Description', 'woocommerce-gateway-stripe'), |
|
24 | 24 | 'type' => 'text', |
25 | - 'description' => __( 'This controls the description which the user sees during checkout.', 'woocommerce-gateway-stripe' ), |
|
26 | - 'default' => __( 'You will be redirected to iDeal.', 'woocommerce-gateway-stripe' ), |
|
25 | + 'description' => __('This controls the description which the user sees during checkout.', 'woocommerce-gateway-stripe'), |
|
26 | + 'default' => __('You will be redirected to iDeal.', 'woocommerce-gateway-stripe'), |
|
27 | 27 | 'desc_tip' => true, |
28 | 28 | ), |
29 | 29 | ) |
@@ -1,184 +1,184 @@ |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) { |
|
2 | +if ( ! defined('ABSPATH')) { |
|
3 | 3 | exit; |
4 | 4 | } |
5 | 5 | |
6 | -return apply_filters( 'wc_stripe_settings', |
|
6 | +return apply_filters('wc_stripe_settings', |
|
7 | 7 | array( |
8 | 8 | 'enabled' => array( |
9 | - 'title' => __( 'Enable/Disable', 'woocommerce-gateway-stripe' ), |
|
10 | - 'label' => __( 'Enable Stripe', 'woocommerce-gateway-stripe' ), |
|
9 | + 'title' => __('Enable/Disable', 'woocommerce-gateway-stripe'), |
|
10 | + 'label' => __('Enable Stripe', 'woocommerce-gateway-stripe'), |
|
11 | 11 | 'type' => 'checkbox', |
12 | 12 | 'description' => '', |
13 | 13 | 'default' => 'no', |
14 | 14 | ), |
15 | 15 | 'title' => array( |
16 | - 'title' => __( 'Title', 'woocommerce-gateway-stripe' ), |
|
16 | + 'title' => __('Title', 'woocommerce-gateway-stripe'), |
|
17 | 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' ), |
|
18 | + 'description' => __('This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe'), |
|
19 | + 'default' => __('Credit Card (Stripe)', 'woocommerce-gateway-stripe'), |
|
20 | 20 | 'desc_tip' => true, |
21 | 21 | ), |
22 | 22 | 'description' => array( |
23 | - 'title' => __( 'Description', 'woocommerce-gateway-stripe' ), |
|
23 | + 'title' => __('Description', 'woocommerce-gateway-stripe'), |
|
24 | 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' ), |
|
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 | 27 | 'desc_tip' => true, |
28 | 28 | ), |
29 | 29 | 'testmode' => array( |
30 | - 'title' => __( 'Test mode', 'woocommerce-gateway-stripe' ), |
|
31 | - 'label' => __( 'Enable Test Mode', 'woocommerce-gateway-stripe' ), |
|
30 | + 'title' => __('Test mode', 'woocommerce-gateway-stripe'), |
|
31 | + 'label' => __('Enable Test Mode', 'woocommerce-gateway-stripe'), |
|
32 | 32 | 'type' => 'checkbox', |
33 | - 'description' => __( 'Place the payment gateway in test mode using test API keys.', 'woocommerce-gateway-stripe' ), |
|
33 | + 'description' => __('Place the payment gateway in test mode using test API keys.', 'woocommerce-gateway-stripe'), |
|
34 | 34 | 'default' => 'yes', |
35 | 35 | 'desc_tip' => true, |
36 | 36 | ), |
37 | 37 | 'test_publishable_key' => array( |
38 | - 'title' => __( 'Test Publishable Key', 'woocommerce-gateway-stripe' ), |
|
38 | + 'title' => __('Test Publishable Key', 'woocommerce-gateway-stripe'), |
|
39 | 39 | 'type' => 'text', |
40 | - 'description' => __( 'Get your API keys from your stripe account.', 'woocommerce-gateway-stripe' ), |
|
40 | + 'description' => __('Get your API keys from your stripe account.', 'woocommerce-gateway-stripe'), |
|
41 | 41 | 'default' => '', |
42 | 42 | 'desc_tip' => true, |
43 | 43 | ), |
44 | 44 | 'test_secret_key' => array( |
45 | - 'title' => __( 'Test Secret Key', 'woocommerce-gateway-stripe' ), |
|
45 | + 'title' => __('Test Secret Key', 'woocommerce-gateway-stripe'), |
|
46 | 46 | 'type' => 'text', |
47 | - 'description' => __( 'Get your API keys from your stripe account.', 'woocommerce-gateway-stripe' ), |
|
47 | + 'description' => __('Get your API keys from your stripe account.', 'woocommerce-gateway-stripe'), |
|
48 | 48 | 'default' => '', |
49 | 49 | 'desc_tip' => true, |
50 | 50 | ), |
51 | 51 | 'publishable_key' => array( |
52 | - 'title' => __( 'Live Publishable Key', 'woocommerce-gateway-stripe' ), |
|
52 | + 'title' => __('Live Publishable Key', 'woocommerce-gateway-stripe'), |
|
53 | 53 | 'type' => 'text', |
54 | - 'description' => __( 'Get your API keys from your stripe account.', 'woocommerce-gateway-stripe' ), |
|
54 | + 'description' => __('Get your API keys from your stripe account.', 'woocommerce-gateway-stripe'), |
|
55 | 55 | 'default' => '', |
56 | 56 | 'desc_tip' => true, |
57 | 57 | ), |
58 | 58 | 'secret_key' => array( |
59 | - 'title' => __( 'Live Secret Key', 'woocommerce-gateway-stripe' ), |
|
59 | + 'title' => __('Live Secret Key', 'woocommerce-gateway-stripe'), |
|
60 | 60 | 'type' => 'text', |
61 | - 'description' => __( 'Get your API keys from your stripe account.', 'woocommerce-gateway-stripe' ), |
|
61 | + 'description' => __('Get your API keys from your stripe account.', 'woocommerce-gateway-stripe'), |
|
62 | 62 | 'default' => '', |
63 | 63 | 'desc_tip' => true, |
64 | 64 | ), |
65 | 65 | 'statement_descriptor' => array( |
66 | - 'title' => __( 'Statement Descriptor', 'woocommerce-gateway-stripe' ), |
|
66 | + 'title' => __('Statement Descriptor', 'woocommerce-gateway-stripe'), |
|
67 | 67 | 'type' => 'text', |
68 | - 'description' => __( 'Extra information about a charge. This will appear on your customer’s credit card statement.', 'woocommerce-gateway-stripe' ), |
|
68 | + 'description' => __('Extra information about a charge. This will appear on your customer’s credit card statement.', 'woocommerce-gateway-stripe'), |
|
69 | 69 | 'default' => '', |
70 | 70 | 'desc_tip' => true, |
71 | 71 | ), |
72 | 72 | 'capture' => array( |
73 | - 'title' => __( 'Capture', 'woocommerce-gateway-stripe' ), |
|
74 | - 'label' => __( 'Capture charge immediately', 'woocommerce-gateway-stripe' ), |
|
73 | + 'title' => __('Capture', 'woocommerce-gateway-stripe'), |
|
74 | + 'label' => __('Capture charge immediately', 'woocommerce-gateway-stripe'), |
|
75 | 75 | 'type' => 'checkbox', |
76 | - 'description' => __( 'Whether or not to immediately capture the charge. When unchecked, the charge issues an authorization and will need to be captured later. Uncaptured charges expire in 7 days.', 'woocommerce-gateway-stripe' ), |
|
76 | + 'description' => __('Whether or not to immediately capture the charge. When unchecked, the charge issues an authorization and will need to be captured later. Uncaptured charges expire in 7 days.', 'woocommerce-gateway-stripe'), |
|
77 | 77 | 'default' => 'yes', |
78 | 78 | 'desc_tip' => true, |
79 | 79 | ), |
80 | 80 | 'three_d_secure' => array( |
81 | - 'title' => __( '3D Secure', 'woocommerce-gateway-stripe' ), |
|
82 | - 'label' => __( 'Require 3D Secure when applicable', 'woocommerce-gateway-stripe' ), |
|
81 | + 'title' => __('3D Secure', 'woocommerce-gateway-stripe'), |
|
82 | + 'label' => __('Require 3D Secure when applicable', 'woocommerce-gateway-stripe'), |
|
83 | 83 | 'type' => 'checkbox', |
84 | - 'description' => __( 'Some payment methods have 3D Secure feature. This is an extra security layer for your store. Choose how to handle payments when 3D Secure is optional. Enabling would require customers to use 3D Secure when optional.', 'woocommerce-gateway-stripe' ), |
|
84 | + 'description' => __('Some payment methods have 3D Secure feature. This is an extra security layer for your store. Choose how to handle payments when 3D Secure is optional. Enabling would require customers to use 3D Secure when optional.', 'woocommerce-gateway-stripe'), |
|
85 | 85 | 'default' => 'no', |
86 | 86 | 'desc_tip' => true, |
87 | 87 | ), |
88 | 88 | 'stripe_checkout' => array( |
89 | - 'title' => __( 'Stripe Checkout', 'woocommerce-gateway-stripe' ), |
|
90 | - 'label' => __( 'Enable Stripe Checkout', 'woocommerce-gateway-stripe' ), |
|
89 | + 'title' => __('Stripe Checkout', 'woocommerce-gateway-stripe'), |
|
90 | + 'label' => __('Enable Stripe Checkout', 'woocommerce-gateway-stripe'), |
|
91 | 91 | 'type' => 'checkbox', |
92 | - 'description' => __( 'If enabled, this option shows a "pay" button and modal credit card form on the checkout, instead of credit card fields directly on the page.', 'woocommerce-gateway-stripe' ), |
|
92 | + 'description' => __('If enabled, this option shows a "pay" button and modal credit card form on the checkout, instead of credit card fields directly on the page.', 'woocommerce-gateway-stripe'), |
|
93 | 93 | 'default' => 'no', |
94 | 94 | 'desc_tip' => true, |
95 | 95 | ), |
96 | 96 | 'stripe_checkout_locale' => array( |
97 | - 'title' => __( 'Stripe Checkout locale', 'woocommerce-gateway-stripe' ), |
|
97 | + 'title' => __('Stripe Checkout locale', 'woocommerce-gateway-stripe'), |
|
98 | 98 | 'type' => 'select', |
99 | 99 | 'class' => 'wc-enhanced-select', |
100 | - 'description' => __( 'Language to display in Stripe Checkout modal. Specify Auto to display Checkout in the user\'s preferred language, if available. English will be used by default.', 'woocommerce-gateway-stripe' ), |
|
100 | + 'description' => __('Language to display in Stripe Checkout modal. Specify Auto to display Checkout in the user\'s preferred language, if available. English will be used by default.', 'woocommerce-gateway-stripe'), |
|
101 | 101 | 'default' => 'en', |
102 | 102 | 'desc_tip' => true, |
103 | 103 | 'options' => array( |
104 | - 'auto' => __( 'Auto', 'woocommerce-gateway-stripe' ), |
|
105 | - 'zh' => __( 'Simplified Chinese', 'woocommerce-gateway-stripe' ), |
|
106 | - 'da' => __( 'Danish', 'woocommerce-gateway-stripe' ), |
|
107 | - 'nl' => __( 'Dutch', 'woocommerce-gateway-stripe' ), |
|
108 | - 'en' => __( 'English', 'woocommerce-gateway-stripe' ), |
|
109 | - 'fi' => __( 'Finnish', 'woocommerce-gateway-stripe' ), |
|
110 | - 'fr' => __( 'French', 'woocommerce-gateway-stripe' ), |
|
111 | - 'de' => __( 'German', 'woocommerce-gateway-stripe' ), |
|
112 | - 'it' => __( 'Italian', 'woocommerce-gateway-stripe' ), |
|
113 | - 'ja' => __( 'Japanese', 'woocommerce-gateway-stripe' ), |
|
114 | - 'no' => __( 'Norwegian', 'woocommerce-gateway-stripe' ), |
|
115 | - 'es' => __( 'Spanish', 'woocommerce-gateway-stripe' ), |
|
116 | - 'sv' => __( 'Swedish', 'woocommerce-gateway-stripe' ), |
|
104 | + 'auto' => __('Auto', 'woocommerce-gateway-stripe'), |
|
105 | + 'zh' => __('Simplified Chinese', 'woocommerce-gateway-stripe'), |
|
106 | + 'da' => __('Danish', 'woocommerce-gateway-stripe'), |
|
107 | + 'nl' => __('Dutch', 'woocommerce-gateway-stripe'), |
|
108 | + 'en' => __('English', 'woocommerce-gateway-stripe'), |
|
109 | + 'fi' => __('Finnish', 'woocommerce-gateway-stripe'), |
|
110 | + 'fr' => __('French', 'woocommerce-gateway-stripe'), |
|
111 | + 'de' => __('German', 'woocommerce-gateway-stripe'), |
|
112 | + 'it' => __('Italian', 'woocommerce-gateway-stripe'), |
|
113 | + 'ja' => __('Japanese', 'woocommerce-gateway-stripe'), |
|
114 | + 'no' => __('Norwegian', 'woocommerce-gateway-stripe'), |
|
115 | + 'es' => __('Spanish', 'woocommerce-gateway-stripe'), |
|
116 | + 'sv' => __('Swedish', 'woocommerce-gateway-stripe'), |
|
117 | 117 | ), |
118 | 118 | ), |
119 | 119 | 'stripe_bitcoin' => array( |
120 | - 'title' => __( 'Bitcoin Currency', 'woocommerce-gateway-stripe' ), |
|
121 | - 'label' => __( 'Enable Bitcoin Currency', 'woocommerce-gateway-stripe' ), |
|
120 | + 'title' => __('Bitcoin Currency', 'woocommerce-gateway-stripe'), |
|
121 | + 'label' => __('Enable Bitcoin Currency', 'woocommerce-gateway-stripe'), |
|
122 | 122 | 'type' => 'checkbox', |
123 | - 'description' => __( 'If enabled, an option to accept bitcoin will show on the checkout modal. Note: Stripe Checkout needs to be enabled and store currency must be set to USD.', 'woocommerce-gateway-stripe' ), |
|
123 | + 'description' => __('If enabled, an option to accept bitcoin will show on the checkout modal. Note: Stripe Checkout needs to be enabled and store currency must be set to USD.', 'woocommerce-gateway-stripe'), |
|
124 | 124 | 'default' => 'no', |
125 | 125 | 'desc_tip' => true, |
126 | 126 | ), |
127 | 127 | 'stripe_checkout_image' => array( |
128 | - 'title' => __( 'Stripe Checkout Image', 'woocommerce-gateway-stripe' ), |
|
129 | - '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' ), |
|
128 | + 'title' => __('Stripe Checkout Image', 'woocommerce-gateway-stripe'), |
|
129 | + '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'), |
|
130 | 130 | 'type' => 'text', |
131 | 131 | 'default' => '', |
132 | 132 | 'desc_tip' => true, |
133 | 133 | ), |
134 | 134 | 'request_payment_api' => array( |
135 | - 'title' => __( 'Payment Request API', 'woocommerce-gateway-stripe' ), |
|
136 | - 'label' => __( 'Enable Payment Request API', 'woocommerce-gateway-stripe' ), |
|
135 | + 'title' => __('Payment Request API', 'woocommerce-gateway-stripe'), |
|
136 | + 'label' => __('Enable Payment Request API', 'woocommerce-gateway-stripe'), |
|
137 | 137 | 'type' => 'checkbox', |
138 | - 'description' => __( 'If enabled, users will be able to pay using the Payment Request API if supported by the browser.', 'woocommerce-gateway-stripe' ), |
|
138 | + 'description' => __('If enabled, users will be able to pay using the Payment Request API if supported by the browser.', 'woocommerce-gateway-stripe'), |
|
139 | 139 | 'default' => 'no', |
140 | 140 | 'desc_tip' => true, |
141 | 141 | ), |
142 | 142 | 'apple_pay' => array( |
143 | - 'title' => __( 'Apple Pay', 'woocommerce-gateway-stripe' ), |
|
144 | - 'label' => sprintf( __( 'Enable Apple Pay. %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>' ), |
|
143 | + 'title' => __('Apple Pay', 'woocommerce-gateway-stripe'), |
|
144 | + 'label' => sprintf(__('Enable Apple Pay. %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>'), |
|
145 | 145 | 'type' => 'checkbox', |
146 | - 'description' => __( 'If enabled, users will be able to pay with Apple Pay.', 'woocommerce-gateway-stripe' ), |
|
146 | + 'description' => __('If enabled, users will be able to pay with Apple Pay.', 'woocommerce-gateway-stripe'), |
|
147 | 147 | 'default' => 'yes', |
148 | 148 | 'desc_tip' => true, |
149 | 149 | ), |
150 | 150 | 'apple_pay_button' => array( |
151 | - 'title' => __( 'Apple Pay Button Style', 'woocommerce-gateway-stripe' ), |
|
152 | - 'label' => __( 'Button Style', 'woocommerce-gateway-stripe' ), |
|
151 | + 'title' => __('Apple Pay Button Style', 'woocommerce-gateway-stripe'), |
|
152 | + 'label' => __('Button Style', 'woocommerce-gateway-stripe'), |
|
153 | 153 | 'type' => 'select', |
154 | - 'description' => __( 'Select the button style you would like to show.', 'woocommerce-gateway-stripe' ), |
|
154 | + 'description' => __('Select the button style you would like to show.', 'woocommerce-gateway-stripe'), |
|
155 | 155 | 'default' => 'black', |
156 | 156 | 'desc_tip' => true, |
157 | 157 | 'options' => array( |
158 | - 'black' => __( 'Black', 'woocommerce-gateway-stripe' ), |
|
159 | - 'white' => __( 'White', 'woocommerce-gateway-stripe' ), |
|
158 | + 'black' => __('Black', 'woocommerce-gateway-stripe'), |
|
159 | + 'white' => __('White', 'woocommerce-gateway-stripe'), |
|
160 | 160 | ), |
161 | 161 | ), |
162 | 162 | 'apple_pay_button_lang' => array( |
163 | - 'title' => __( 'Apple Pay Button Language', 'woocommerce-gateway-stripe' ), |
|
164 | - 'description' => sprintf( __( 'Enter the 2 letter ISO code for the language you would like your Apple Pay Button to display in. Reference available ISO codes <a href="%s" target="_blank">here</a>.', 'woocommerce-gateway-stripe' ), 'http://www.w3schools.com/tags/ref_language_codes.asp' ), |
|
163 | + 'title' => __('Apple Pay Button Language', 'woocommerce-gateway-stripe'), |
|
164 | + 'description' => sprintf(__('Enter the 2 letter ISO code for the language you would like your Apple Pay Button to display in. Reference available ISO codes <a href="%s" target="_blank">here</a>.', 'woocommerce-gateway-stripe'), 'http://www.w3schools.com/tags/ref_language_codes.asp'), |
|
165 | 165 | 'type' => 'text', |
166 | 166 | 'default' => 'en', |
167 | 167 | 'desc_tip' => false, |
168 | 168 | ), |
169 | 169 | 'saved_cards' => array( |
170 | - 'title' => __( 'Saved Cards', 'woocommerce-gateway-stripe' ), |
|
171 | - 'label' => __( 'Enable Payment via Saved Cards', 'woocommerce-gateway-stripe' ), |
|
170 | + 'title' => __('Saved Cards', 'woocommerce-gateway-stripe'), |
|
171 | + 'label' => __('Enable Payment via Saved Cards', 'woocommerce-gateway-stripe'), |
|
172 | 172 | 'type' => 'checkbox', |
173 | - 'description' => __( 'If enabled, users will be able to pay with a saved card during checkout. Card details are saved on Stripe servers, not on your store.', 'woocommerce-gateway-stripe' ), |
|
173 | + 'description' => __('If enabled, users will be able to pay with a saved card during checkout. Card details are saved on Stripe servers, not on your store.', 'woocommerce-gateway-stripe'), |
|
174 | 174 | 'default' => 'no', |
175 | 175 | 'desc_tip' => true, |
176 | 176 | ), |
177 | 177 | 'logging' => array( |
178 | - 'title' => __( 'Logging', 'woocommerce-gateway-stripe' ), |
|
179 | - 'label' => __( 'Log debug messages', 'woocommerce-gateway-stripe' ), |
|
178 | + 'title' => __('Logging', 'woocommerce-gateway-stripe'), |
|
179 | + 'label' => __('Log debug messages', 'woocommerce-gateway-stripe'), |
|
180 | 180 | 'type' => 'checkbox', |
181 | - 'description' => __( 'Save debug messages to the WooCommerce System Status log.', 'woocommerce-gateway-stripe' ), |
|
181 | + 'description' => __('Save debug messages to the WooCommerce System Status log.', 'woocommerce-gateway-stripe'), |
|
182 | 182 | 'default' => 'no', |
183 | 183 | 'desc_tip' => true, |
184 | 184 | ), |
@@ -1,29 +1,29 @@ |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) { |
|
2 | +if ( ! defined('ABSPATH')) { |
|
3 | 3 | exit; |
4 | 4 | } |
5 | 5 | |
6 | -return apply_filters( 'wc_stripe_giropay_settings', |
|
6 | +return apply_filters('wc_stripe_giropay_settings', |
|
7 | 7 | array( |
8 | 8 | 'enabled' => array( |
9 | - 'title' => __( 'Enable/Disable', 'woocommerce-gateway-stripe' ), |
|
10 | - 'label' => __( 'Enable Stripe Giropay', 'woocommerce-gateway-stripe' ), |
|
9 | + 'title' => __('Enable/Disable', 'woocommerce-gateway-stripe'), |
|
10 | + 'label' => __('Enable Stripe Giropay', 'woocommerce-gateway-stripe'), |
|
11 | 11 | 'type' => 'checkbox', |
12 | 12 | 'description' => '', |
13 | 13 | 'default' => 'no', |
14 | 14 | ), |
15 | 15 | 'title' => array( |
16 | - 'title' => __( 'Title', 'woocommerce-gateway-stripe' ), |
|
16 | + 'title' => __('Title', 'woocommerce-gateway-stripe'), |
|
17 | 17 | 'type' => 'text', |
18 | - 'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe' ), |
|
19 | - 'default' => __( 'Giropay', 'woocommerce-gateway-stripe' ), |
|
18 | + 'description' => __('This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe'), |
|
19 | + 'default' => __('Giropay', 'woocommerce-gateway-stripe'), |
|
20 | 20 | 'desc_tip' => true, |
21 | 21 | ), |
22 | 22 | 'description' => array( |
23 | - 'title' => __( 'Description', 'woocommerce-gateway-stripe' ), |
|
23 | + 'title' => __('Description', 'woocommerce-gateway-stripe'), |
|
24 | 24 | 'type' => 'text', |
25 | - 'description' => __( 'This controls the description which the user sees during checkout.', 'woocommerce-gateway-stripe' ), |
|
26 | - 'default' => __( 'You will be redirected to Giropay.', 'woocommerce-gateway-stripe' ), |
|
25 | + 'description' => __('This controls the description which the user sees during checkout.', 'woocommerce-gateway-stripe'), |
|
26 | + 'default' => __('You will be redirected to Giropay.', 'woocommerce-gateway-stripe'), |
|
27 | 27 | 'desc_tip' => true, |
28 | 28 | ), |
29 | 29 | ) |
@@ -1,29 +1,29 @@ |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) { |
|
2 | +if ( ! defined('ABSPATH')) { |
|
3 | 3 | exit; |
4 | 4 | } |
5 | 5 | |
6 | -return apply_filters( 'wc_stripe_bitcoin_settings', |
|
6 | +return apply_filters('wc_stripe_bitcoin_settings', |
|
7 | 7 | array( |
8 | 8 | 'enabled' => array( |
9 | - 'title' => __( 'Enable/Disable', 'woocommerce-gateway-stripe' ), |
|
10 | - 'label' => __( 'Enable Stripe Bitcoin', 'woocommerce-gateway-stripe' ), |
|
9 | + 'title' => __('Enable/Disable', 'woocommerce-gateway-stripe'), |
|
10 | + 'label' => __('Enable Stripe Bitcoin', 'woocommerce-gateway-stripe'), |
|
11 | 11 | 'type' => 'checkbox', |
12 | 12 | 'description' => '', |
13 | 13 | 'default' => 'no', |
14 | 14 | ), |
15 | 15 | 'title' => array( |
16 | - 'title' => __( 'Title', 'woocommerce-gateway-stripe' ), |
|
16 | + 'title' => __('Title', 'woocommerce-gateway-stripe'), |
|
17 | 17 | 'type' => 'text', |
18 | - 'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe' ), |
|
19 | - 'default' => __( 'Bitcoin', 'woocommerce-gateway-stripe' ), |
|
18 | + 'description' => __('This controls the title which the user sees during checkout.', 'woocommerce-gateway-stripe'), |
|
19 | + 'default' => __('Bitcoin', 'woocommerce-gateway-stripe'), |
|
20 | 20 | 'desc_tip' => true, |
21 | 21 | ), |
22 | 22 | 'description' => array( |
23 | - 'title' => __( 'Description', 'woocommerce-gateway-stripe' ), |
|
23 | + 'title' => __('Description', 'woocommerce-gateway-stripe'), |
|
24 | 24 | 'type' => 'text', |
25 | - 'description' => __( 'This controls the description which the user sees during checkout.', 'woocommerce-gateway-stripe' ), |
|
26 | - 'default' => __( 'Bitcoin payment information will be provided when you place the order.', 'woocommerce-gateway-stripe' ), |
|
25 | + 'description' => __('This controls the description which the user sees during checkout.', 'woocommerce-gateway-stripe'), |
|
26 | + 'default' => __('Bitcoin payment information will be provided when you place the order.', 'woocommerce-gateway-stripe'), |
|
27 | 27 | 'desc_tip' => true, |
28 | 28 | ), |
29 | 29 | ) |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) { |
|
2 | +if ( ! defined('ABSPATH')) { |
|
3 | 3 | exit; |
4 | 4 | } |
5 | 5 | |
@@ -32,10 +32,10 @@ discard block |
||
32 | 32 | * Constructor |
33 | 33 | * @param integer $user_id |
34 | 34 | */ |
35 | - public function __construct( $user_id = 0 ) { |
|
36 | - if ( $user_id ) { |
|
37 | - $this->set_user_id( $user_id ); |
|
38 | - $this->set_id( get_user_meta( $user_id, '_stripe_customer_id', true ) ); |
|
35 | + public function __construct($user_id = 0) { |
|
36 | + if ($user_id) { |
|
37 | + $this->set_user_id($user_id); |
|
38 | + $this->set_id(get_user_meta($user_id, '_stripe_customer_id', true)); |
|
39 | 39 | } |
40 | 40 | } |
41 | 41 | |
@@ -51,8 +51,8 @@ discard block |
||
51 | 51 | * Set Stripe customer ID. |
52 | 52 | * @param [type] $id [description] |
53 | 53 | */ |
54 | - public function set_id( $id ) { |
|
55 | - $this->id = wc_clean( $id ); |
|
54 | + public function set_id($id) { |
|
55 | + $this->id = wc_clean($id); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -60,15 +60,15 @@ discard block |
||
60 | 60 | * @return int |
61 | 61 | */ |
62 | 62 | public function get_user_id() { |
63 | - return absint( $this->user_id ); |
|
63 | + return absint($this->user_id); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
67 | 67 | * Set User ID used by WordPress. |
68 | 68 | * @param int $user_id |
69 | 69 | */ |
70 | - public function set_user_id( $user_id ) { |
|
71 | - $this->user_id = absint( $user_id ); |
|
70 | + public function set_user_id($user_id) { |
|
71 | + $this->user_id = absint($user_id); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | /** |
@@ -76,13 +76,13 @@ discard block |
||
76 | 76 | * @return WP_User |
77 | 77 | */ |
78 | 78 | protected function get_user() { |
79 | - return $this->get_user_id() ? get_user_by( 'id', $this->get_user_id() ) : false; |
|
79 | + return $this->get_user_id() ? get_user_by('id', $this->get_user_id()) : false; |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
83 | 83 | * Store data from the Stripe API about this customer |
84 | 84 | */ |
85 | - public function set_customer_data( $data ) { |
|
85 | + public function set_customer_data($data) { |
|
86 | 86 | $this->customer_data = $data; |
87 | 87 | } |
88 | 88 | |
@@ -90,12 +90,12 @@ discard block |
||
90 | 90 | * Get data from the Stripe API about this customer |
91 | 91 | */ |
92 | 92 | public function get_customer_data() { |
93 | - if ( empty( $this->customer_data ) && $this->get_id() && false === ( $this->customer_data = get_transient( 'stripe_customer_' . $this->get_id() ) ) ) { |
|
94 | - $response = WC_Stripe_API::request( array(), 'customers/' . $this->get_id() ); |
|
93 | + if (empty($this->customer_data) && $this->get_id() && false === ($this->customer_data = get_transient('stripe_customer_' . $this->get_id()))) { |
|
94 | + $response = WC_Stripe_API::request(array(), 'customers/' . $this->get_id()); |
|
95 | 95 | |
96 | - if ( ! is_wp_error( $response ) ) { |
|
97 | - $this->set_customer_data( $response ); |
|
98 | - set_transient( 'stripe_customer_' . $this->get_id(), $response, HOUR_IN_SECONDS * 48 ); |
|
96 | + if ( ! is_wp_error($response)) { |
|
97 | + $this->set_customer_data($response); |
|
98 | + set_transient('stripe_customer_' . $this->get_id(), $response, HOUR_IN_SECONDS * 48); |
|
99 | 99 | } |
100 | 100 | } |
101 | 101 | return $this->customer_data; |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | $data = $this->get_customer_data(); |
110 | 110 | $source = ''; |
111 | 111 | |
112 | - if ( $data ) { |
|
112 | + if ($data) { |
|
113 | 113 | $source = $data->default_source; |
114 | 114 | } |
115 | 115 | |
@@ -121,12 +121,12 @@ discard block |
||
121 | 121 | * @param array $args |
122 | 122 | * @return WP_Error|int |
123 | 123 | */ |
124 | - public function create_customer( $args = array() ) { |
|
125 | - $billing_email = filter_var( $_POST['billing_email'], FILTER_SANITIZE_EMAIL ); |
|
124 | + public function create_customer($args = array()) { |
|
125 | + $billing_email = filter_var($_POST['billing_email'], FILTER_SANITIZE_EMAIL); |
|
126 | 126 | |
127 | - if ( $user = $this->get_user() ) { |
|
128 | - $billing_first_name = get_user_meta( $user->ID, 'billing_first_name', true ); |
|
129 | - $billing_last_name = get_user_meta( $user->ID, 'billing_last_name', true ); |
|
127 | + if ($user = $this->get_user()) { |
|
128 | + $billing_first_name = get_user_meta($user->ID, 'billing_first_name', true); |
|
129 | + $billing_last_name = get_user_meta($user->ID, 'billing_last_name', true); |
|
130 | 130 | |
131 | 131 | $defaults = array( |
132 | 132 | 'email' => $user->user_email, |
@@ -134,33 +134,33 @@ discard block |
||
134 | 134 | ); |
135 | 135 | } else { |
136 | 136 | $defaults = array( |
137 | - 'email' => ! empty( $billing_email ) ? $billing_email : '', |
|
137 | + 'email' => ! empty($billing_email) ? $billing_email : '', |
|
138 | 138 | 'description' => '', |
139 | 139 | ); |
140 | 140 | } |
141 | 141 | |
142 | 142 | $metadata = array(); |
143 | 143 | |
144 | - $defaults['metadata'] = apply_filters( 'wc_stripe_customer_metadata', $metadata, $user ); |
|
144 | + $defaults['metadata'] = apply_filters('wc_stripe_customer_metadata', $metadata, $user); |
|
145 | 145 | |
146 | - $args = wp_parse_args( $args, $defaults ); |
|
147 | - $response = WC_Stripe_API::request( apply_filters( 'wc_stripe_create_customer_args', $args ), 'customers' ); |
|
146 | + $args = wp_parse_args($args, $defaults); |
|
147 | + $response = WC_Stripe_API::request(apply_filters('wc_stripe_create_customer_args', $args), 'customers'); |
|
148 | 148 | |
149 | - if ( is_wp_error( $response ) ) { |
|
149 | + if (is_wp_error($response)) { |
|
150 | 150 | return $response; |
151 | - } elseif ( empty( $response->id ) ) { |
|
152 | - return new WP_Error( 'stripe_error', __( 'Could not create Stripe customer.', 'woocommerce-gateway-stripe' ) ); |
|
151 | + } elseif (empty($response->id)) { |
|
152 | + return new WP_Error('stripe_error', __('Could not create Stripe customer.', 'woocommerce-gateway-stripe')); |
|
153 | 153 | } |
154 | 154 | |
155 | - $this->set_id( $response->id ); |
|
155 | + $this->set_id($response->id); |
|
156 | 156 | $this->clear_cache(); |
157 | - $this->set_customer_data( $response ); |
|
157 | + $this->set_customer_data($response); |
|
158 | 158 | |
159 | - if ( $this->get_user_id() ) { |
|
160 | - update_user_meta( $this->get_user_id(), '_stripe_customer_id', $response->id ); |
|
159 | + if ($this->get_user_id()) { |
|
160 | + update_user_meta($this->get_user_id(), '_stripe_customer_id', $response->id); |
|
161 | 161 | } |
162 | 162 | |
163 | - do_action( 'woocommerce_stripe_add_customer', $args, $response ); |
|
163 | + do_action('woocommerce_stripe_add_customer', $args, $response); |
|
164 | 164 | |
165 | 165 | return $response->id; |
166 | 166 | } |
@@ -171,61 +171,61 @@ discard block |
||
171 | 171 | * @param bool $retry |
172 | 172 | * @return WP_Error|int |
173 | 173 | */ |
174 | - public function add_source( $token, $retry = true ) { |
|
175 | - if ( ! $this->get_id() ) { |
|
176 | - if ( ( $response = $this->create_customer() ) && is_wp_error( $response ) ) { |
|
174 | + public function add_source($token, $retry = true) { |
|
175 | + if ( ! $this->get_id()) { |
|
176 | + if (($response = $this->create_customer()) && is_wp_error($response)) { |
|
177 | 177 | return $response; |
178 | 178 | } |
179 | 179 | } |
180 | 180 | |
181 | - $response = WC_Stripe_API::request( array( |
|
181 | + $response = WC_Stripe_API::request(array( |
|
182 | 182 | 'source' => $token, |
183 | - ), 'customers/' . $this->get_id() . '/sources' ); |
|
183 | + ), 'customers/' . $this->get_id() . '/sources'); |
|
184 | 184 | |
185 | - if ( is_wp_error( $response ) ) { |
|
185 | + if (is_wp_error($response)) { |
|
186 | 186 | // It is possible the WC user once was linked to a customer on Stripe |
187 | 187 | // but no longer exists. Instead of failing, lets try to create a |
188 | 188 | // new customer. |
189 | - if ( preg_match( '/No such customer:/', $response->get_error_message() ) ) { |
|
190 | - delete_user_meta( $this->get_user_id(), '_stripe_customer_id' ); |
|
189 | + if (preg_match('/No such customer:/', $response->get_error_message())) { |
|
190 | + delete_user_meta($this->get_user_id(), '_stripe_customer_id'); |
|
191 | 191 | $this->create_customer(); |
192 | - return $this->add_source( $token, false ); |
|
193 | - } elseif ( 'customer' === $response->get_error_code() && $retry ) { |
|
192 | + return $this->add_source($token, false); |
|
193 | + } elseif ('customer' === $response->get_error_code() && $retry) { |
|
194 | 194 | $this->create_customer(); |
195 | - return $this->add_source( $token, false ); |
|
195 | + return $this->add_source($token, false); |
|
196 | 196 | } else { |
197 | 197 | return $response; |
198 | 198 | } |
199 | - } elseif ( empty( $response->id ) ) { |
|
200 | - return new WP_Error( 'error', __( 'Unable to add card', 'woocommerce-gateway-stripe' ) ); |
|
199 | + } elseif (empty($response->id)) { |
|
200 | + return new WP_Error('error', __('Unable to add card', 'woocommerce-gateway-stripe')); |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | // Add token to WooCommerce |
204 | - if ( $this->get_user_id() && class_exists( 'WC_Payment_Token_CC' ) ) { |
|
204 | + if ($this->get_user_id() && class_exists('WC_Payment_Token_CC')) { |
|
205 | 205 | $token = new WC_Payment_Token_CC(); |
206 | - $token->set_token( $response->id ); |
|
207 | - $token->set_gateway_id( 'stripe' ); |
|
206 | + $token->set_token($response->id); |
|
207 | + $token->set_gateway_id('stripe'); |
|
208 | 208 | |
209 | - if ( 'source' === $response->object ) { |
|
209 | + if ('source' === $response->object) { |
|
210 | 210 | // Check if it is a 3d secure source. |
211 | - if ( 'three_d_secure' === $response->type ) { |
|
211 | + if ('three_d_secure' === $response->type) { |
|
212 | 212 | $card = $response->three_d_secure->card; |
213 | 213 | } else { |
214 | 214 | $card = $response->card; |
215 | 215 | } |
216 | 216 | } |
217 | 217 | |
218 | - $token->set_card_type( strtolower( $card->brand ) ); |
|
219 | - $token->set_last4( $card->last4 ); |
|
220 | - $token->set_expiry_month( $card->exp_month ); |
|
221 | - $token->set_expiry_year( $card->exp_year ); |
|
222 | - $token->set_user_id( $this->get_user_id() ); |
|
218 | + $token->set_card_type(strtolower($card->brand)); |
|
219 | + $token->set_last4($card->last4); |
|
220 | + $token->set_expiry_month($card->exp_month); |
|
221 | + $token->set_expiry_year($card->exp_year); |
|
222 | + $token->set_user_id($this->get_user_id()); |
|
223 | 223 | $token->save(); |
224 | 224 | } |
225 | 225 | |
226 | 226 | $this->clear_cache(); |
227 | 227 | |
228 | - do_action( 'woocommerce_stripe_add_source', $this->get_id(), $token, $response ); |
|
228 | + do_action('woocommerce_stripe_add_source', $this->get_id(), $token, $response); |
|
229 | 229 | |
230 | 230 | return $response->id; |
231 | 231 | } |
@@ -239,20 +239,20 @@ discard block |
||
239 | 239 | public function get_sources() { |
240 | 240 | $sources = array(); |
241 | 241 | |
242 | - if ( $this->get_id() && false === ( $sources = get_transient( 'stripe_sources_' . $this->get_id() ) ) ) { |
|
243 | - $response = WC_Stripe_API::request( array( |
|
242 | + if ($this->get_id() && false === ($sources = get_transient('stripe_sources_' . $this->get_id()))) { |
|
243 | + $response = WC_Stripe_API::request(array( |
|
244 | 244 | 'limit' => 100, |
245 | - ), 'customers/' . $this->get_id() . '/sources', 'GET' ); |
|
245 | + ), 'customers/' . $this->get_id() . '/sources', 'GET'); |
|
246 | 246 | |
247 | - if ( is_wp_error( $response ) ) { |
|
247 | + if (is_wp_error($response)) { |
|
248 | 248 | return array(); |
249 | 249 | } |
250 | 250 | |
251 | - if ( is_array( $response->data ) ) { |
|
251 | + if (is_array($response->data)) { |
|
252 | 252 | $sources = $response->data; |
253 | 253 | } |
254 | 254 | |
255 | - set_transient( 'stripe_sources_' . $this->get_id(), $sources, HOUR_IN_SECONDS * 48 ); |
|
255 | + set_transient('stripe_sources_' . $this->get_id(), $sources, HOUR_IN_SECONDS * 48); |
|
256 | 256 | } |
257 | 257 | |
258 | 258 | return $sources; |
@@ -262,13 +262,13 @@ discard block |
||
262 | 262 | * Delete a source from stripe. |
263 | 263 | * @param string $source_id |
264 | 264 | */ |
265 | - public function delete_source( $source_id ) { |
|
266 | - $response = WC_Stripe_API::request( array(), 'customers/' . $this->get_id() . '/sources/' . sanitize_text_field( $source_id ), 'DELETE' ); |
|
265 | + public function delete_source($source_id) { |
|
266 | + $response = WC_Stripe_API::request(array(), 'customers/' . $this->get_id() . '/sources/' . sanitize_text_field($source_id), 'DELETE'); |
|
267 | 267 | |
268 | 268 | $this->clear_cache(); |
269 | 269 | |
270 | - if ( ! is_wp_error( $response ) ) { |
|
271 | - do_action( 'wc_stripe_delete_source', $this->get_id(), $response ); |
|
270 | + if ( ! is_wp_error($response)) { |
|
271 | + do_action('wc_stripe_delete_source', $this->get_id(), $response); |
|
272 | 272 | |
273 | 273 | return true; |
274 | 274 | } |
@@ -280,15 +280,15 @@ discard block |
||
280 | 280 | * Set default source in Stripe |
281 | 281 | * @param string $source_id |
282 | 282 | */ |
283 | - public function set_default_source( $source_id ) { |
|
284 | - $response = WC_Stripe_API::request( array( |
|
285 | - 'default_source' => sanitize_text_field( $source_id ), |
|
286 | - ), 'customers/' . $this->get_id(), 'POST' ); |
|
283 | + public function set_default_source($source_id) { |
|
284 | + $response = WC_Stripe_API::request(array( |
|
285 | + 'default_source' => sanitize_text_field($source_id), |
|
286 | + ), 'customers/' . $this->get_id(), 'POST'); |
|
287 | 287 | |
288 | 288 | $this->clear_cache(); |
289 | 289 | |
290 | - if ( ! is_wp_error( $response ) ) { |
|
291 | - do_action( 'wc_stripe_set_default_source', $this->get_id(), $response ); |
|
290 | + if ( ! is_wp_error($response)) { |
|
291 | + do_action('wc_stripe_set_default_source', $this->get_id(), $response); |
|
292 | 292 | |
293 | 293 | return true; |
294 | 294 | } |
@@ -300,8 +300,8 @@ discard block |
||
300 | 300 | * Deletes caches for this users cards. |
301 | 301 | */ |
302 | 302 | public function clear_cache() { |
303 | - delete_transient( 'stripe_sources_' . $this->get_id() ); |
|
304 | - delete_transient( 'stripe_customer_' . $this->get_id() ); |
|
303 | + delete_transient('stripe_sources_' . $this->get_id()); |
|
304 | + delete_transient('stripe_customer_' . $this->get_id()); |
|
305 | 305 | $this->customer_data = array(); |
306 | 306 | } |
307 | 307 | } |