Skip to content

Commit b52ccd0

Browse files
committed
fixed captcha reset in cardpayments
1 parent 58c9063 commit b52ccd0

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

assets/js/cardpayments.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ class OneTimePayment {
1919
* @param {boolean} status.inProgress Whether an async payment task is currently running
2020
* @param {boolean} status.success Whether the payment succeeded
2121
*/
22-
constructor(status) {
22+
constructor(status, captcha) {
2323
this._status = status;
24+
this._captcha = captcha;
2425
}
2526

2627
/**
@@ -127,8 +128,7 @@ class OneTimePayment {
127128
this._status.success = false;
128129
this._status.errorMessage = error.message;
129130
this._status.inProgress = false;
130-
this._status.captcha = null;
131-
// TODO: reset captcha
131+
this._captcha.reset();
132132
}
133133

134134
onPaymentSucceeded() {

layouts/partials/captcha.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@
1212
verifying: '{{ i18n "altcha_verifying" }}',
1313
waitAlert: '{{ i18n "altcha_waitAlert" }}'
1414
})"
15-
></altcha-widget>
15+
x-ref="captcha"
16+
></altcha-widget>

layouts/partials/donate-creditcard.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div x-data="{amount: 15, currency: 'EUR', frequency: 'once', oneTimePayment: null, oneTimePaymentStatus: {validCardNum: false, captcha: null, errorMessage: '', inProgress: false, success: false}, recurringPayment: new RecurringPayment(), acceptTerms: false, captchaState: null}" x-init="oneTimePayment = new OneTimePayment(oneTimePaymentStatus)">
1+
<div x-data="{amount: 15, currency: 'EUR', frequency: 'once', oneTimePayment: null, oneTimePaymentStatus: {validCardNum: false, captcha: null, errorMessage: '', inProgress: false, success: false}, recurringPayment: new RecurringPayment(), acceptTerms: false, captchaState: null}" x-init="oneTimePayment = new OneTimePayment(oneTimePaymentStatus, $refs.captcha)">
22
<div class="flex flex-wrap md:flex-nowrap">
33
<div class="w-full mb-4 md:w-1/2 md:pr-3">
44
<label class="label-uppercase mb-2">{{ i18n "donate_creditcard_amount" }}</label>

0 commit comments

Comments
 (0)