Skip to content

Commit db1a712

Browse files
authored
Added ACH story (#2821)
* Added ACH story * Updated comment
1 parent 8baeefc commit db1a712

File tree

2 files changed

+49
-1
lines changed

2 files changed

+49
-1
lines changed
+10-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
import { Placeholders } from './components/AchInput/types';
22
import { UIElementProps } from '../internal/UIElement/types';
3+
import { AddressData } from '../../types/global-types';
34

45
export interface AchConfiguration extends UIElementProps {
56
storedPaymentMethodId?: string;
67
holderNameRequired?: boolean;
78
hasHolderName?: boolean;
89
enableStoreDetails: boolean;
9-
bankAccountNumber: string;
10+
bankAccountNumber?: string; // Applies when a storedPM
1011
placeholders?: Placeholders;
12+
/**
13+
* Object that contains placeholder information that you can use to prefill fields.
14+
* - merchant set config option
15+
*/
16+
data?: {
17+
holderName?: string;
18+
billingAddress?: Partial<AddressData>;
19+
};
1120
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import { MetaConfiguration, PaymentMethodStoryProps, StoryConfiguration } from '../types';
2+
import { getStoryContextCheckout } from '../../utils/get-story-context-checkout';
3+
import { AchConfiguration } from '../../../src/components/Ach/types';
4+
import { Container } from '../Container';
5+
import { Ach } from '../../../src';
6+
7+
type ACHStory = StoryConfiguration<AchConfiguration>;
8+
9+
const meta: MetaConfiguration<AchConfiguration> = {
10+
title: 'Components/ACH'
11+
};
12+
13+
export const Default: ACHStory = {
14+
render: (args: PaymentMethodStoryProps<AchConfiguration>, context) => {
15+
const { componentConfiguration } = args;
16+
const checkout = getStoryContextCheckout(context);
17+
const ach = new Ach(checkout, componentConfiguration);
18+
return <Container element={ach} />;
19+
},
20+
args: {
21+
countryCode: 'US',
22+
componentConfiguration: {
23+
data: {
24+
holderName: 'B. Fish',
25+
billingAddress: {
26+
street: 'Infinite Loop',
27+
postalCode: '95014',
28+
city: 'Cupertino',
29+
houseNumberOrName: '1',
30+
country: 'US',
31+
stateOrProvince: 'CA'
32+
}
33+
},
34+
enableStoreDetails: false
35+
}
36+
}
37+
};
38+
39+
export default meta;

0 commit comments

Comments
 (0)