Commit db1a712 1 parent 8baeefc commit db1a712 Copy full SHA for db1a712
File tree 2 files changed +49
-1
lines changed
storybook/stories/components
2 files changed +49
-1
lines changed Original file line number Diff line number Diff line change 1
1
import { Placeholders } from './components/AchInput/types' ;
2
2
import { UIElementProps } from '../internal/UIElement/types' ;
3
+ import { AddressData } from '../../types/global-types' ;
3
4
4
5
export interface AchConfiguration extends UIElementProps {
5
6
storedPaymentMethodId ?: string ;
6
7
holderNameRequired ?: boolean ;
7
8
hasHolderName ?: boolean ;
8
9
enableStoreDetails : boolean ;
9
- bankAccountNumber : string ;
10
+ bankAccountNumber ? : string ; // Applies when a storedPM
10
11
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
+ } ;
11
20
}
Original file line number Diff line number Diff line change
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 ;
You can’t perform that action at this time.
0 commit comments