Skip to content

Commit b31bd3d

Browse files
authored
fix: APP-406 email always required when buying with credit card (#2580)
1 parent 7e52853 commit b31bd3d

File tree

5 files changed

+18
-18
lines changed

5 files changed

+18
-18
lines changed

web-marketplace/src/components/organisms/PaymentInfoForm/PaymentInfoForm.CustomerInfo.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ export const CustomerInfo = ({
7676
<Trans>
7777
Input an email address to receive a receipt of your purchase.
7878
<i>
79-
Take note: we will email you a prompt to associate this email
80-
with your account for easier future access. This is entirely
81-
optional.
79+
Note: You will receive an email with instructions to link this
80+
email to your account, allowing for easier access going forward,
81+
if desired.
8282
</i>
8383
</Trans>
8484
) : paymentOption === PAYMENT_OPTIONS.CARD ? (
@@ -95,7 +95,7 @@ export const CustomerInfo = ({
9595
error={!!errors['email']}
9696
helperText={errors['email']?.message}
9797
disabled={!!accountEmail}
98-
optional={!!wallet?.address}
98+
optional={paymentOption === PAYMENT_OPTIONS.CRYPTO}
9999
/>
100100
{!accountId && !wallet?.address && (
101101
<CheckboxLabel

web-marketplace/src/components/organisms/PaymentInfoForm/PaymentInfoForm.schema.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
import { z } from 'zod';
22

3-
import { Wallet } from 'lib/wallet/wallet';
4-
53
import { PAYMENT_OPTIONS } from 'pages/BuyCredits/BuyCredits.constants';
64
import { PaymentOptionsType } from 'pages/BuyCredits/BuyCredits.types';
75

8-
export const paymentInfoFormSchema = (
9-
paymentOption: PaymentOptionsType,
10-
wallet?: Wallet,
11-
) =>
6+
export const paymentInfoFormSchema = (paymentOption: PaymentOptionsType) =>
127
z.object({
138
name:
149
paymentOption === PAYMENT_OPTIONS.CARD ? z.string().min(1) : z.string(),
1510
email:
16-
paymentOption === PAYMENT_OPTIONS.CARD && !wallet?.address
11+
paymentOption === PAYMENT_OPTIONS.CARD
1712
? z.string().email().min(1)
1813
: z.union([z.literal(''), z.string().email().nullable()]),
1914
createAccount: z.boolean(),

web-marketplace/src/components/organisms/PaymentInfoForm/PaymentInfoForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export const PaymentInfoForm = ({
5959
const [paymentInfoValid, setPaymentInfoValid] = useState(false);
6060

6161
const form = useZodForm({
62-
schema: paymentInfoFormSchema(paymentOption, wallet),
62+
schema: paymentInfoFormSchema(paymentOption),
6363
defaultValues: {
6464
email: initialValues?.email || accountEmail,
6565
name: initialValues?.name || accountName,

web-marketplace/src/lib/i18n/locales/en.po

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2223,9 +2223,13 @@ msgid "Information"
22232223
msgstr ""
22242224

22252225
#: src/components/organisms/PaymentInfoForm/PaymentInfoForm.CustomerInfo.tsx:76
2226-
msgid "Input an email address to receive a receipt of your purchase.<0>Take note: we will email you a prompt to associate this email with your account for easier future access. This is entirely optional.</0>"
2226+
msgid "Input an email address to receive a receipt of your purchase.<0>Note: You will receive an email with instructions to link this email to your account, allowing for easier access going forward, if desired.</0>"
22272227
msgstr ""
22282228

2229+
#: src/components/organisms/PaymentInfoForm/PaymentInfoForm.CustomerInfo.tsx:76
2230+
#~ msgid "Input an email address to receive a receipt of your purchase.<0>Take note: we will email you a prompt to associate this email with your account for easier future access. This is entirely optional.</0>"
2231+
#~ msgstr ""
2232+
22292233
#: src/pages/BuyCredits/BuyCredits.constants.ts:8
22302234
msgid "Insufficient balance"
22312235
msgstr ""

web-marketplace/src/lib/i18n/locales/es.po

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ msgstr ""
2222
#: src/components/organisms/CreditActivityTable/CreditActivityTable.tsx:65
2323
#: src/components/organisms/Documentation/Documentation.constants.ts:11
2424
#: src/pages/CreditClassDetails/CreditClassDetailsWithContent/CreditClassDetailsWithContent.constants.ts:35
25-
msgid ""
26-
msgstr ""
27-
2825
#: src/lib/constants/shared.constants.tsx:96
2926
msgid "- see less"
3027
msgstr "- ver menos"
@@ -2225,8 +2222,12 @@ msgid "Information"
22252222
msgstr "Información"
22262223

22272224
#: src/components/organisms/PaymentInfoForm/PaymentInfoForm.CustomerInfo.tsx:76
2228-
msgid "Input an email address to receive a receipt of your purchase.<0>Take note: we will email you a prompt to associate this email with your account for easier future access. This is entirely optional.</0>"
2229-
msgstr "Ingresa una dirección de correo electrónico para recibir un recibo de tu compra.<0>Toma nota: te enviaremos un correo electrónico con un mensaje para que asocies este correo electrónico con tu cuenta para facilitar el acceso en el futuro. Esto es completamente opcional.</0>"
2225+
msgid "Input an email address to receive a receipt of your purchase.<0>Note: You will receive an email with instructions to link this email to your account, allowing for easier access going forward, if desired.</0>"
2226+
msgstr "Ingrese una dirección de correo electrónico para recibir un recibo de su compra.<0>Nota: Recibirá un correo electrónico con instrucciones para vincular este correo electrónico a su cuenta, lo que permitirá un acceso más fácil en el futuro, si lo desea.</0>"
2227+
2228+
#: src/components/organisms/PaymentInfoForm/PaymentInfoForm.CustomerInfo.tsx:76
2229+
#~ msgid "Input an email address to receive a receipt of your purchase.<0>Take note: we will email you a prompt to associate this email with your account for easier future access. This is entirely optional.</0>"
2230+
#~ msgstr "Ingresa una dirección de correo electrónico para recibir un recibo de tu compra.<0>Toma nota: te enviaremos un correo electrónico con un mensaje para que asocies este correo electrónico con tu cuenta para facilitar el acceso en el futuro. Esto es completamente opcional.</0>"
22302231

22312232
#: src/pages/BuyCredits/BuyCredits.constants.ts:8
22322233
msgid "Insufficient balance"

0 commit comments

Comments
 (0)