|
1 | 1 | "use strict"; |
2 | 2 |
|
3 | | -const STRIPE_PK = 'pk_live_eSasX216vGvC26GdbVwA011V'; |
4 | | -const STRIPE_PLANS = {'EUR': 'plan_GgW4ovr7c6upzx', 'USD': 'plan_GejOEdJtfL3kdH'}; // live |
5 | | -const STRIPE_PHP_URL = 'https://api.cryptomator.org/stripe/prepare_payment.php'; |
6 | | - |
7 | | -//const STRIPE_PK = 'pk_test_JhF3MoFQGw2Is0DB3BSv345P'; |
8 | | -//const STRIPE_PLANS = {'EUR': 'plan_GgVY2JfD49bc02', 'USD': 'plan_GgVZwj545E0uH3'}; // test |
9 | | -//const STRIPE_PHP_URL = 'http://localhost/stripe/prepare_payment.php'; |
| 3 | +const STRIPE_PHP_URL = BASE_API_URL + '/stripe/prepare_payment.php'; |
10 | 4 |
|
11 | 5 | class OneTimePayment { |
12 | 6 |
|
13 | 7 | /** |
14 | 8 | * Initializes the one-time payments helper and stores a references to the status object that can be observed by AlpineJS |
15 | 9 | * @param {Object} status |
16 | 10 | * @param {boolean} status.validCardNum Whether the Stripe input field considers the credit card number valid |
17 | | - * @param {string} status.captcha The captcha (if reCAPTCHA validation finished) or null |
| 11 | + * @param {string} status.captcha The captcha (if captcha validation finished) or null |
18 | 12 | * @param {string} status.errorMessage An error message or null |
19 | 13 | * @param {boolean} status.inProgress Whether an async payment task is currently running |
20 | 14 | * @param {boolean} status.success Whether the payment succeeded |
@@ -127,21 +121,13 @@ class OneTimePayment { |
127 | 121 | this._status.success = false; |
128 | 122 | this._status.errorMessage = error.message; |
129 | 123 | this._status.inProgress = false; |
130 | | - if (grecaptcha) { |
131 | | - this._status.captcha = ''; |
132 | | - grecaptcha.reset(); |
133 | | - } |
134 | 124 | } |
135 | 125 |
|
136 | 126 | onPaymentSucceeded() { |
137 | 127 | console.info('Stripe payment succeeded!'); |
138 | 128 | this._status.success = true; |
139 | 129 | this._status.errorMessage = ''; |
140 | 130 | this._status.inProgress = false; |
141 | | - if (grecaptcha) { |
142 | | - this._status.captcha = ''; |
143 | | - grecaptcha.reset(); |
144 | | - } |
145 | 131 | } |
146 | 132 |
|
147 | 133 | } |
|
0 commit comments