Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
0564841
feat: add datatrans payment method
basilkot Oct 14, 2025
9669e07
Merge branch 'dev' into feat/VCST-3955
basilkot Oct 14, 2025
a81639a
fix: warning
basilkot Oct 14, 2025
6f9bcc6
Merge branch 'feat/VCST-3955' of https://github.com/VirtoCommerce/vc-…
basilkot Oct 14, 2025
de980dc
fix: validation
basilkot Oct 14, 2025
f41b678
fix: localization for "pay now" button
basilkot Oct 14, 2025
2c8a5cf
fix: script node removing
basilkot Oct 14, 2025
ae33de7
fix: remove redundant event
basilkot Oct 14, 2025
d9c7436
fix: bank card validation
basilkot Oct 14, 2025
1f8e89a
Merge branch 'dev' into feat/VCST-3955
basilkot Oct 14, 2025
fb4cdb2
fix: french localization
basilkot Oct 14, 2025
1ea4847
fix: use globalThis instead of window
basilkot Oct 15, 2025
225638d
Merge branch 'dev' into feat/VCST-3955
basilkot Oct 16, 2025
8657881
Merge branch 'dev' into feat/VCST-3955
Aleksandra-Mitricheva Oct 22, 2025
65650bd
Merge branch 'dev' into feat/VCST-3955
Aleksandra-Mitricheva Oct 22, 2025
b08e7d4
Merge branch 'dev' into feat/VCST-3955
Aleksandra-Mitricheva Oct 28, 2025
33d2e80
fix: validation
basilkot Oct 29, 2025
cf43b00
Merge branch 'dev' into feat/VCST-3955
Aleksandra-Mitricheva Oct 29, 2025
cb74eb9
fix: refactor localization
basilkot Oct 30, 2025
1684b0e
feat: add cart and cvv validation messages
basilkot Oct 30, 2025
06212c1
Merge branch 'feat/VCST-3955' of https://github.com/VirtoCommerce/vc-…
basilkot Oct 30, 2025
ce14ec1
Merge branch 'dev' into feat/VCST-3955
Aleksandra-Mitricheva Oct 30, 2025
5c9a8e8
fix: date length validation
basilkot Oct 30, 2025
5168603
Merge branch 'feat/VCST-3955' of https://github.com/VirtoCommerce/vc-…
basilkot Oct 30, 2025
16c46fd
fix: validation after onload
basilkot Oct 30, 2025
6be5772
Merge branch 'dev' into feat/VCST-3955
Aleksandra-Mitricheva Oct 30, 2025
0e67758
fix: inactive pay button when page loads
basilkot Oct 30, 2025
33b5991
fix: "try again" button localization
basilkot Oct 30, 2025
8ca8f9e
fix: reformat code
basilkot Oct 30, 2025
47f7880
fix: render flow
basilkot Oct 30, 2025
9bec937
chore: small codestyle fixes
basilkot Oct 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions client-app/pages/account/order-payment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -247,22 +247,29 @@
<PaymentProcessingManual v-if="paymentMethodCode === 'DefaultManualPaymentMethod'" />

<PaymentProcessingAuthorizeNet
v-if="paymentMethodCode === 'AuthorizeNetPaymentMethod'"
v-else-if="paymentMethodCode === 'AuthorizeNetPaymentMethod'"
:order="order"
:disabled="loading"
@success="success = true"
@fail="failure = true"
/>

<PaymentProcessingSkyflow
v-if="paymentMethodCode === 'SkyflowPaymentMethod'"
v-else-if="paymentMethodCode === 'SkyflowPaymentMethod'"
:order="order"
@success="success = true"
@fail="failure = true"
/>

<PaymentProcessingCyberSource
v-if="paymentMethodCode === 'CyberSourcePaymentMethod'"
v-else-if="paymentMethodCode === 'CyberSourcePaymentMethod'"
:order="order"
@success="success = true"
@fail="failure = true"
/>

<PaymentProcessingDatatrans
v-else-if="paymentMethodCode === 'DatatransPaymentMethod'"
:order="order"
@success="success = true"
@fail="failure = true"
Expand Down Expand Up @@ -321,6 +328,7 @@ import type { Optional } from "utility-types";
import AddOrUpdateAddressModal from "@/shared/account/components/add-or-update-address-modal.vue";
import PaymentProcessingAuthorizeNet from "@/shared/payment/components/payment-processing-authorize-net.vue";
import PaymentProcessingCyberSource from "@/shared/payment/components/payment-processing-cyber-source.vue";
import PaymentProcessingDatatrans from "@/shared/payment/components/payment-processing-datatrans.vue";
import PaymentProcessingSkyflow from "@/shared/payment/components/payment-processing-skyflow.vue";

interface IProps {
Expand Down Expand Up @@ -374,6 +382,9 @@ const paymentMethodType = computed<number | undefined>(() => payment.value?.paym
const paymentMethodCode = computed<string | undefined>(() => payment.value?.paymentMethod?.code);

function tryAgain() {
const url = new URL(globalThis.location.href);
url.search = "";
globalThis.history.replaceState({}, document.title, url.toString());
location.reload();
}

Expand Down
11 changes: 11 additions & 0 deletions client-app/pages/checkout/payment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,28 @@
@success="onPaymentResult(true)"
@fail="onPaymentResult(false)"
/>

<PaymentProcessingSkyflow
v-else-if="paymentTypeName === 'SkyflowPaymentMethod'"
:order="placedOrder"
@success="onPaymentResult(true)"
@fail="onPaymentResult(false)"
/>

<PaymentProcessingCyberSource
v-else-if="paymentTypeName === 'CyberSourcePaymentMethod'"
:order="placedOrder"
@success="onPaymentResult(true)"
@fail="onPaymentResult(false)"
/>

<PaymentProcessingDatatrans
v-else-if="paymentTypeName === 'DatatransPaymentMethod'"
:order="placedOrder"
@success="onPaymentResult(true)"
@fail="onPaymentResult(false)"
/>

<ExtensionPointList
v-else-if="
paymentTypeName &&
Expand Down Expand Up @@ -70,6 +80,7 @@ import { PaymentActionType, PaymentProcessingRedirection } from "@/shared/paymen
import type { PaymentInType } from "@/core/api/graphql/types";
import PaymentProcessingAuthorizeNet from "@/shared/payment/components/payment-processing-authorize-net.vue";
import PaymentProcessingCyberSource from "@/shared/payment/components/payment-processing-cyber-source.vue";
import PaymentProcessingDatatrans from "@/shared/payment/components/payment-processing-datatrans.vue";
import PaymentProcessingSkyflow from "@/shared/payment/components/payment-processing-skyflow.vue";

const router = useRouter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ vi.mock("vue-i18n", () => {

const EXPIRATION_FIELD_LABEL = "shared.payment.bank_card_form.expiration_date_label";
const ERROR_MESSAGES = {
MONTH: "shared.payment.authorize_net.errors.month",
MONTH: "shared.payment.bank_card_form.errors.month",
MONTH_INCOMPLETE: "shared.payment.bank_card_form.month_label must be exactly 2 characters",
YEAR_INCOMPLETE: "shared.payment.bank_card_form.year_label must be exactly 2 characters",
} as const;
Expand Down
2 changes: 1 addition & 1 deletion client-app/shared/payment/components/bank-card-form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ const monthYupSchema = yup
.string()
.required()
.length(2)
.matches(/^(0?[1-9]|1[0-2])$/, t("shared.payment.authorize_net.errors.month"))
.matches(/^(0?[1-9]|1[0-2])$/, t("shared.payment.bank_card_form.errors.month"))
.label(labels.value.monthLabel);

const validationSchema = toTypedSchema(
Expand Down
1 change: 1 addition & 0 deletions client-app/shared/payment/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export { default as PaymentProcessingDatatrans } from "./payment-processing-datatrans.vue";
export { default as PaymentProcessingManual } from "./payment-processing-manual.vue";
export { default as PaymentProcessingRedirection } from "./payment-processing-redirection.vue";
export { default as PaymentProcessingSkyflow } from "./payment-processing-skyflow.vue";
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
data-test-id="pay-now-button"
@click="sendPaymentData"
>
{{ $t("shared.payment.authorize_net.pay_now_button") }}
{{ $t("shared.payment.bank_card_form.pay_now_button") }}
</VcButton>
</div>
</div>
Expand Down Expand Up @@ -118,27 +118,27 @@ function showErrors(messages: Accept.Message[]) {
messages.forEach(({ code, text }) => {
switch (code) {
case "E_WC_05":
bankCardErrors.value.number = t("shared.payment.authorize_net.errors.number");
bankCardErrors.value.number = t("shared.payment.bank_card_form.errors.card_number");
break;

case "E_WC_06":
bankCardErrors.value.month = t("shared.payment.authorize_net.errors.month");
bankCardErrors.value.month = t("shared.payment.bank_card_form.errors.month");
break;

case "E_WC_07":
bankCardErrors.value.year = t("shared.payment.authorize_net.errors.year");
bankCardErrors.value.year = t("shared.payment.bank_card_form.errors.year");
break;

case "E_WC_08":
bankCardErrors.value.year = t("shared.payment.authorize_net.errors.expiration_date");
bankCardErrors.value.year = t("shared.payment.bank_card_form.errors.expiration_date");
break;

case "E_WC_15":
bankCardErrors.value.securityCode = t("shared.payment.authorize_net.errors.security_code");
bankCardErrors.value.securityCode = t("shared.payment.bank_card_form.errors.security_code");
break;

case "E_WC_17":
bankCardErrors.value.cardholderName = t("shared.payment.authorize_net.errors.cardholder_name");
bankCardErrors.value.cardholderName = t("shared.payment.bank_card_form.errors.cardholder_name");
break;

default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
data-test-id="pay-now-button"
@click="sendPaymentData"
>
{{ $t("shared.payment.authorize_net.pay_now_button") }}
{{ $t("shared.payment.bank_card_form.pay_now_button") }}
</VcButton>
</div>
</template>
Expand Down Expand Up @@ -259,7 +259,6 @@ async function createToken(options: Record<string, unknown>): Promise<string> {
return new Promise((resolve, reject) => {
microform.createToken(options, (err: unknown, token: string) => {
if (err) {
// eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
reject(err);
} else {
resolve(token);
Expand Down Expand Up @@ -376,8 +375,8 @@ async function useDynamicScript(url: string, integrity?: string): Promise<void>
}

function removeScript() {
if (scriptTag.value && scriptTag.value.parentNode) {
scriptTag.value.parentNode.removeChild(scriptTag.value);
if (scriptTag.value) {
scriptTag.value.remove();
}
}

Expand Down
Loading