Skip to content

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

bc-dronov
Copy link
Contributor

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

@bc-dronov bc-dronov requested a review from PavlenkoM May 30, 2025 14:58
@bc-dronov bc-dronov requested a review from a team as a code owner May 30, 2025 14:58
@bc-dronov bc-dronov force-pushed the feat/stripe-link_v2-strategy branch 3 times, most recently from fbd1c89 to 9d671d3 Compare May 30, 2025 15:26
@bc-dronov bc-dronov force-pushed the feat/stripe-link_v2-strategy branch from 9d671d3 to 1f31fc5 Compare May 30, 2025 15:29
@bigcommerce bigcommerce deleted a comment from bcsnyk May 30, 2025
@bigcommerce bigcommerce deleted a comment from bcsnyk May 30, 2025
@bigcommerce bigcommerce deleted a comment from bcsnyk May 30, 2025
toResolvableModule,
} from '@bigcommerce/checkout-sdk/payment-integration-api';

import StripeUPEScriptLoader from '../stripe-utils/stripe-script-loader';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import StripeUPEScriptLoader from '../stripe-utils/stripe-script-loader';
import { StripeScriptLoader } from '../stripe-utils';

Copy link
Contributor Author

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()),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
new StripeUPEScriptLoader(getScriptLoader()),
new StripeScriptLoader(getScriptLoader()),

Copy link
Contributor Author

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',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
event: 'change' | 'ready' | 'shippingaddresschange' | 'shippingratechange' | 'confirm',
event: StripeElementEvent,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines 625 to 660
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;
}
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants