|
|
@@ -123,7 +123,7 @@
|
|
|
class="col bg-surface input-border-dark"
|
|
|
hide-bottom-space
|
|
|
input-class="text-text"
|
|
|
- mask="##/####"
|
|
|
+ mask="##/##"
|
|
|
outlined
|
|
|
:error="!!serverErrors.expiration"
|
|
|
:error-message="serverErrors.expiration"
|
|
|
@@ -159,7 +159,7 @@
|
|
|
mask="####"
|
|
|
outlined
|
|
|
placeholder="***"
|
|
|
- type="password"
|
|
|
+ type="text"
|
|
|
unmasked-value
|
|
|
:error="!!serverErrors.cvv"
|
|
|
:error-message="serverErrors.cvv"
|
|
|
@@ -426,17 +426,26 @@ const validateExpiration = (val) => {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- if (!validateCardExpiration(val)) {
|
|
|
- return t('profile.payments.expired_card');
|
|
|
+ const [month, year] = val.split("/");
|
|
|
+
|
|
|
+ if (!month || !year) {
|
|
|
+ return t("profile.payments.expired_card");
|
|
|
}
|
|
|
|
|
|
- return true;
|
|
|
+ return validateCardExpiration(`${month}/20${year}`)
|
|
|
+ ? true
|
|
|
+ : t("profile.payments.expired_card");
|
|
|
};
|
|
|
|
|
|
//
|
|
|
|
|
|
const onOKClick = async () => {
|
|
|
const valid = await formRef.value?.validate();
|
|
|
+ const expirationFormatted = (() => {
|
|
|
+ const [month, year] = form.expiration.split("/");
|
|
|
+
|
|
|
+ return `${month}/20${year}`;
|
|
|
+})();
|
|
|
|
|
|
if (!valid) {
|
|
|
return;
|
|
|
@@ -447,7 +456,7 @@ const onOKClick = async () => {
|
|
|
brand: form.brand,
|
|
|
card_name: form.card_name,
|
|
|
client_id: props.paymentMethod ? props.paymentMethod.client_id : props.clientId,
|
|
|
- expiration: form.expiration,
|
|
|
+ expiration: expirationFormatted,
|
|
|
holder_name: form.holder_name,
|
|
|
is_active: form.is_active,
|
|
|
last_four_digits: form.last_four_digits,
|
|
|
@@ -465,7 +474,7 @@ const onOKClick = async () => {
|
|
|
|
|
|
const payload = {
|
|
|
client_id: props.paymentMethod ? props.paymentMethod.client_id : props.clientId,
|
|
|
- expiration: form.expiration,
|
|
|
+ expiration: expirationFormatted,
|
|
|
holder_name: form.holder_name,
|
|
|
last_four_digits: form.last_four_digits,
|
|
|
token,
|