APM-5: Fix digital wallet flow (#50)

This commit is contained in:
Ildar Galeev 2022-02-24 14:51:30 +03:00 committed by GitHub
parent 91b5c51144
commit 33d0be9e80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 12 additions and 11 deletions

View File

@ -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={<Letter />}
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"

View File

@ -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 (
<FormGroup>
<SticpayAccount />

View File

@ -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 <ReactSVG src="/assets/wallet-providers/logos/sticpay.svg" />;
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) => (

View File

@ -15,7 +15,7 @@ const toWalletProvider = (props: SticpayPaymentMethodItemProps) =>
const Icon: React.FC<{ provider: KnownDigitalWalletProviders }> = ({ provider }) => {
switch (provider) {
case KnownDigitalWalletProviders.sticpay:
case KnownDigitalWalletProviders.Sticpay:
return <ReactSVG src="/assets/wallet-providers/logos/sticpay.svg" />;
default:
assertUnreachable(provider);

View File

@ -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);

View File

@ -6,7 +6,7 @@ export interface PaymentMethod {
}
export enum KnownDigitalWalletProviders {
sticpay = 'sticpay'
Sticpay = 'Sticpay'
}
export interface DigitalWalletPaymentMethod extends PaymentMethod {

View File

@ -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)"

View File

@ -149,7 +149,7 @@
"RejectedByIssuer": "Отклонено эмитентом",
"PaymentRejected": "Платёж отклонен",
"digital.wallet.providers": {
"sticpay": {
"Sticpay": {
"name": "Sticpay",
"fields": {
"account": "Sticpay account (email)"