-
Notifications
You must be signed in to change notification settings - Fork 221
feat(payment): Stripe Link V2 strategy added #2885
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
fbd1c89
to
9d671d3
Compare
9d671d3
to
1f31fc5
Compare
packages/stripe-integration/src/stripe-utils/stripe-script-loader.ts
Outdated
Show resolved
Hide resolved
packages/stripe-integration/src/stripe-ocs/stripe-link-v2-customer-strategy.ts
Outdated
Show resolved
Hide resolved
packages/stripe-integration/src/stripe-ocs/stripe-ocs-customer-initialize-options.ts
Outdated
Show resolved
Hide resolved
packages/stripe-integration/src/stripe-ocs/stripe-link-v2-customer-strategy.ts
Outdated
Show resolved
Hide resolved
packages/stripe-integration/src/stripe-ocs/stripe-link-v2-customer-strategy.ts
Outdated
Show resolved
Hide resolved
packages/stripe-integration/src/stripe-ocs/stripe-link-v2-customer-strategy.ts
Outdated
Show resolved
Hide resolved
packages/stripe-integration/src/stripe-ocs/stripe-link-v2-customer-strategy.ts
Outdated
Show resolved
Hide resolved
packages/stripe-integration/src/stripe-ocs/stripe-link-v2-customer-strategy.ts
Outdated
Show resolved
Hide resolved
toResolvableModule, | ||
} from '@bigcommerce/checkout-sdk/payment-integration-api'; | ||
|
||
import StripeUPEScriptLoader from '../stripe-utils/stripe-script-loader'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import StripeUPEScriptLoader from '../stripe-utils/stripe-script-loader'; | |
import { StripeScriptLoader } from '../stripe-utils'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
) => { | ||
return new StripeLinkV2CustomerStrategy( | ||
paymentIntegrationService, | ||
new StripeUPEScriptLoader(getScriptLoader()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new StripeUPEScriptLoader(getScriptLoader()), | |
new StripeScriptLoader(getScriptLoader()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -154,7 +154,10 @@ export interface StripeElement { | |||
* in addition to some Element-specific keys. | |||
* https://stripe.com/docs/js/element/events/on_change?type=paymentElement | |||
*/ | |||
on(event: 'change' | 'ready', handler: (event: StripeEventType) => void): void; | |||
on( | |||
event: 'change' | 'ready' | 'shippingaddresschange' | 'shippingratechange' | 'confirm', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
event: 'change' | 'ready' | 'shippingaddresschange' | 'shippingratechange' | 'confirm', | |
event: StripeElementEvent, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
export interface StripeLinkV2Event { | ||
value?: null; | ||
address?: { | ||
city?: string; | ||
country?: string; | ||
postal_code?: string; | ||
state?: string; | ||
}; | ||
shippingRate?: StripeLinkV2ShippingRate; | ||
elementType: string; | ||
expressPaymentType: string; | ||
resolve(data: StripeLinkV2EventResolveData): void; | ||
} | ||
|
||
export interface StripeLinkV2EventResolveData { | ||
lineItems?: LineItem[]; | ||
allowedShippingCountries?: string[]; | ||
shippingAddressRequired?: boolean; | ||
shippingRates?: StripeLinkV2ShippingRate[]; | ||
billingAddressRequired?: boolean; | ||
emailRequired?: boolean; | ||
phoneNumberRequired?: boolean; | ||
} | ||
|
||
export interface StripeLinkV2ShippingRate { | ||
id: string; | ||
amount: number; | ||
displayName: string; | ||
} | ||
|
||
export interface StripeLinkV2Options { | ||
clientSecret?: string; | ||
mode?: string; | ||
currency?: string; | ||
amount?: number; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case if it is Stripe OCS + Link v2 specific interfaces, lets move it to stripe-ocs
folder.
Create a file for such OCS specific interfaces stripe-ocs/stripe-ocs.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
What?
Added Stripe Link v2 customer strategy.
For now it works without onConfirm method, as it will be implemented together with backend.
Testing / Proof
443655094-7bda7daa-b030-4f96-9217-040006459bb9.mov
@bigcommerce/team-checkout @bigcommerce/team-payments