-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5687ba4
commit 2812f4c
Showing
9 changed files
with
91 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
import { h } from 'preact'; | ||
import { MetaConfiguration, StoryConfiguration } from '../../types'; | ||
import { FastlaneInSinglePageApp } from './FastlaneInSinglePageApp'; | ||
import { ComponentContainer } from '../../ComponentContainer'; | ||
|
||
import Dropin from '../../../../src/components/Dropin/Dropin'; | ||
import Card from '../../../../src/components/Card/Card'; | ||
import PayPal from '../../../../src/components/PayPal/Paypal'; | ||
import Fastlane from '../../../../src/components/PayPalFastlane'; | ||
import { Checkout } from '../../Checkout'; | ||
|
||
type FastlaneStory = StoryConfiguration<{}>; | ||
|
||
|
@@ -9,8 +17,32 @@ const meta: MetaConfiguration<FastlaneStory> = { | |
|
||
export const Default: FastlaneStory = { | ||
render: checkoutConfig => { | ||
const allowedPaymentTypes = ['scheme', 'paypal', 'fastlane']; | ||
const paymentMethodsOverride = { | ||
paymentMethods: [ | ||
{ | ||
type: 'scheme', | ||
name: 'Card', | ||
brands: ['mc', 'visa'] | ||
}, | ||
{ | ||
configuration: { merchantId: 'QSXMR9W7GV8NY', intent: 'capture' }, | ||
name: 'PayPal', | ||
type: 'paypal' | ||
}, | ||
{ | ||
name: 'Fastlane', | ||
type: 'fastlane', | ||
brands: ['mc', 'visa'] | ||
} | ||
] | ||
}; | ||
|
||
return <FastlaneInSinglePageApp checkoutConfig={{ paymentMethodsOverride, ...checkoutConfig }} />; | ||
} | ||
}; | ||
|
||
export const WithMockedRecognizedFlow: FastlaneStory = { | ||
render: checkoutConfig => { | ||
const paymentMethodsOverride = { | ||
paymentMethods: [ | ||
{ | ||
|
@@ -31,7 +63,23 @@ export const Default: FastlaneStory = { | |
] | ||
}; | ||
|
||
return <FastlaneInSinglePageApp checkoutConfig={{ allowedPaymentTypes, paymentMethodsOverride, ...checkoutConfig }} />; | ||
return ( | ||
<Checkout checkoutConfig={{ ...checkoutConfig, paymentMethodsOverride }}> | ||
{checkout => ( | ||
<ComponentContainer | ||
element={ | ||
new Dropin(checkout, { | ||
showStoredPaymentMethods: false, | ||
paymentMethodComponents: [Card, PayPal, Fastlane], | ||
paymentMethodsConfiguration: { | ||
fastlane: { tokenId: 'xxx', customerId: 'sss', lastFour: '1111', brand: 'visa', email: '[email protected]' } | ||
} | ||
}) | ||
} | ||
/> | ||
)} | ||
</Checkout> | ||
); | ||
} | ||
}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters