From 33d0be9e8035a472704e665b048569509e1dedbb Mon Sep 17 00:00:00 2001 From: Ildar Galeev Date: Thu, 24 Feb 2022 14:51:30 +0300 Subject: [PATCH] APM-5: Fix digital wallet flow (#50) --- renovate.json | 4 ++-- .../form-container/wallet-form/fields/sticpay-account.tsx | 4 ++-- .../form-container/wallet-form/wallet-provider-form-group.tsx | 2 +- .../modal/form-container/wallet-form/wallet-provider-logo.tsx | 3 ++- .../wallet-provider-payment-method-item.tsx | 2 +- .../sagas/create-payment-resource/create-digital-wallet.ts | 2 +- src/app/state/payment-method/payment-method.ts | 2 +- src/locale/en.json | 2 +- src/locale/ru.json | 2 +- 9 files changed, 12 insertions(+), 11 deletions(-) diff --git a/renovate.json b/renovate.json index a20bfd6e..ef4cb5d1 100644 --- a/renovate.json +++ b/renovate.json @@ -1,4 +1,4 @@ { - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": ["local>valitydev/.github:renovate-config"] + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": ["local>valitydev/.github:renovate-config"] } diff --git a/src/app/components/app/modal-container/modal/form-container/wallet-form/fields/sticpay-account.tsx b/src/app/components/app/modal-container/modal/form-container/wallet-form/fields/sticpay-account.tsx index 1f08b6fb..7a03c319 100644 --- a/src/app/components/app/modal-container/modal/form-container/wallet-form/fields/sticpay-account.tsx +++ b/src/app/components/app/modal-container/modal/form-container/wallet-form/fields/sticpay-account.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import { connect } from 'react-redux'; import { Field, WrappedFieldProps } from 'redux-form'; -import { State } from 'checkout/state'; +import { KnownDigitalWalletProviders, State } from 'checkout/state'; import { Locale } from 'checkout/locale'; import { Letter } from 'checkout/components'; import { formatEmail, isError, validateEmail } from 'checkout/utils'; @@ -18,7 +18,7 @@ const getCustomInput = (props: EmailDefProps, fieldProps: WrappedFieldProps) => {...fieldProps.meta} error={isError(fieldProps.meta)} icon={} - placeholder={props.locale['digital.wallet.providers'].sticpay.fields.account} + placeholder={props.locale['digital.wallet.providers'][KnownDigitalWalletProviders.Sticpay].fields.account} mark={true} type="email" id="sticpay-account-input" diff --git a/src/app/components/app/modal-container/modal/form-container/wallet-form/wallet-provider-form-group.tsx b/src/app/components/app/modal-container/modal/form-container/wallet-form/wallet-provider-form-group.tsx index 31cfa0ed..2e1564a1 100644 --- a/src/app/components/app/modal-container/modal/form-container/wallet-form/wallet-provider-form-group.tsx +++ b/src/app/components/app/modal-container/modal/form-container/wallet-form/wallet-provider-form-group.tsx @@ -6,7 +6,7 @@ import { SticpayAccount } from './fields'; export const WalletProviderFormGroup: React.FC<{ provider: KnownDigitalWalletProviders }> = (props) => { switch (props.provider) { - case KnownDigitalWalletProviders.sticpay: + case KnownDigitalWalletProviders.Sticpay: return ( diff --git a/src/app/components/app/modal-container/modal/form-container/wallet-form/wallet-provider-logo.tsx b/src/app/components/app/modal-container/modal/form-container/wallet-form/wallet-provider-logo.tsx index f7493400..4d52b8b7 100644 --- a/src/app/components/app/modal-container/modal/form-container/wallet-form/wallet-provider-logo.tsx +++ b/src/app/components/app/modal-container/modal/form-container/wallet-form/wallet-provider-logo.tsx @@ -6,7 +6,7 @@ import { assertUnreachable } from 'checkout/utils'; export const Logo: React.FC<{ provider: KnownDigitalWalletProviders }> = ({ provider }) => { switch (provider) { - case KnownDigitalWalletProviders.sticpay: + case KnownDigitalWalletProviders.Sticpay: return ; default: assertUnreachable(provider); @@ -20,6 +20,7 @@ export const Container = styled.div` align-items: center; justify-content: center; margin-bottom: 20px; + height: 48px; `; export const WalletProviderLogo: React.FC<{ provider: KnownDigitalWalletProviders }> = (props) => ( diff --git a/src/app/components/app/modal-container/modal/form-container/wallet-provider-payment-method-item/wallet-provider-payment-method-item.tsx b/src/app/components/app/modal-container/modal/form-container/wallet-provider-payment-method-item/wallet-provider-payment-method-item.tsx index eeaff2ca..b27167b0 100644 --- a/src/app/components/app/modal-container/modal/form-container/wallet-provider-payment-method-item/wallet-provider-payment-method-item.tsx +++ b/src/app/components/app/modal-container/modal/form-container/wallet-provider-payment-method-item/wallet-provider-payment-method-item.tsx @@ -15,7 +15,7 @@ const toWalletProvider = (props: SticpayPaymentMethodItemProps) => const Icon: React.FC<{ provider: KnownDigitalWalletProviders }> = ({ provider }) => { switch (provider) { - case KnownDigitalWalletProviders.sticpay: + case KnownDigitalWalletProviders.Sticpay: return ; default: assertUnreachable(provider); diff --git a/src/app/sagas/create-payment-resource/create-digital-wallet.ts b/src/app/sagas/create-payment-resource/create-digital-wallet.ts index 1c61e0c4..2e03ff85 100644 --- a/src/app/sagas/create-payment-resource/create-digital-wallet.ts +++ b/src/app/sagas/create-payment-resource/create-digital-wallet.ts @@ -6,7 +6,7 @@ import { assertUnreachable } from 'checkout/utils'; const getID = (formValues: WalletFormValues): string => { switch (formValues.provider) { - case KnownDigitalWalletProviders.sticpay: + case KnownDigitalWalletProviders.Sticpay: return (formValues as SticpayWalletFormValues).sticpayAccount; default: assertUnreachable(formValues.provider); diff --git a/src/app/state/payment-method/payment-method.ts b/src/app/state/payment-method/payment-method.ts index 5726dab2..c072d7fb 100644 --- a/src/app/state/payment-method/payment-method.ts +++ b/src/app/state/payment-method/payment-method.ts @@ -6,7 +6,7 @@ export interface PaymentMethod { } export enum KnownDigitalWalletProviders { - sticpay = 'sticpay' + Sticpay = 'Sticpay' } export interface DigitalWalletPaymentMethod extends PaymentMethod { diff --git a/src/locale/en.json b/src/locale/en.json index 291973fb..28f5a6d2 100644 --- a/src/locale/en.json +++ b/src/locale/en.json @@ -149,7 +149,7 @@ "RejectedByIssuer": "Rejected by issuing bank", "PaymentRejected": "Payment is rejected", "digital.wallet.providers": { - "sticpay": { + "Sticpay": { "name": "Sticpay", "fields": { "account": "Sticpay account (email)" diff --git a/src/locale/ru.json b/src/locale/ru.json index 889b5d42..0b50e7ea 100644 --- a/src/locale/ru.json +++ b/src/locale/ru.json @@ -149,7 +149,7 @@ "RejectedByIssuer": "Отклонено эмитентом", "PaymentRejected": "Платёж отклонен", "digital.wallet.providers": { - "sticpay": { + "Sticpay": { "name": "Sticpay", "fields": { "account": "Sticpay account (email)"