diff --git a/src/fastlane/fastlane.ts b/src/fastlane/fastlane.ts index 1e1df95..b06e5f4 100644 --- a/src/fastlane/fastlane.ts +++ b/src/fastlane/fastlane.ts @@ -32,6 +32,7 @@ export default class Fastlane { public identity: IFastlaneInstance['identity']; public FastlaneCardComponent: IFastlaneInstance['FastlaneCardComponent']; public FastlanePaymentComponent: IFastlaneInstance['FastlanePaymentComponent']; + public FastlaneWatermarkComponent: IFastlaneInstance['FastlaneWatermarkComponent']; setLocale: IFastlaneInstance['setLocale']; constructor( @@ -50,6 +51,7 @@ export default class Fastlane { }; this.FastlaneCardComponent = instance.FastlaneCardComponent.bind(instance); this.FastlanePaymentComponent = instance.FastlanePaymentComponent.bind(instance); + this.FastlaneWatermarkComponent = instance.FastlaneWatermarkComponent.bind(instance); } private showShippingAddressSelector = async () => { diff --git a/src/types/fastlane.ts b/src/types/fastlane.ts index 38640ff..ae2fe18 100644 --- a/src/types/fastlane.ts +++ b/src/types/fastlane.ts @@ -39,6 +39,10 @@ export interface IFastlaneCardComponent { }) => Promise; } +export interface IFastlaneWatermarkComponent { + render: (container: string) => null; +} + interface Field { placeholder?: string; prefill?: string; @@ -59,6 +63,10 @@ export interface IFastlaneComponentOptions { shippingAddress?: IFastlaneAddress; } +export interface IFastlaneWatermarkOptions { + includeAdditionalInfo: boolean; +} + export interface IFastlaneAuthenticatedCustomerResult { authenticationState: 'succeeded'|'failed'|'canceled'|'not_found'; profileData: { @@ -97,6 +105,7 @@ export interface IFastlaneInstance { }; FastlanePaymentComponent: (options: IFastlaneComponentOptions) => Promise; FastlaneCardComponent: (options: Omit) => IFastlaneCardComponent; + FastlaneWatermarkComponent: (options: IFastlaneWatermarkOptions) => IFastlaneWatermarkComponent; } export interface IFastlaneOptions { diff --git a/tests/fastlane/fastlane.test.ts b/tests/fastlane/fastlane.test.ts index 930461d..668b933 100644 --- a/tests/fastlane/fastlane.test.ts +++ b/tests/fastlane/fastlane.test.ts @@ -5,6 +5,7 @@ describe('testing Fastlane class', () => { setLocale: jest.fn(), FastlaneCardComponent: jest.fn(), FastlanePaymentComponent: jest.fn(), + FastlaneWatermarkComponent: jest.fn(), identity: { lookupCustomerByEmail: jest.fn(), triggerAuthenticationFlow: jest.fn(), diff --git a/tests/fastlane/initFastlane.test.ts b/tests/fastlane/initFastlane.test.ts index 0d2a0c3..2d491ec 100644 --- a/tests/fastlane/initFastlane.test.ts +++ b/tests/fastlane/initFastlane.test.ts @@ -74,6 +74,7 @@ describe('testing initFastlane function', () => { setLocale: jest.fn(), FastlaneCardComponent: jest.fn(), FastlanePaymentComponent: jest.fn(), + FastlaneWatermarkComponent: jest.fn(), identity: { lookupCustomerByEmail: jest.fn(), }, @@ -143,6 +144,7 @@ describe('testing initFastlane function', () => { setLocale: jest.fn(), FastlaneCardComponent: jest.fn(), FastlanePaymentComponent: jest.fn(), + FastlaneWatermarkComponent: jest.fn(), identity: { lookupCustomerByEmail: jest.fn(), }, @@ -215,6 +217,7 @@ describe('testing initFastlane function', () => { setLocale: jest.fn(), FastlaneCardComponent: jest.fn(), FastlanePaymentComponent: jest.fn(), + FastlaneWatermarkComponent: jest.fn(), identity: { lookupCustomerByEmail: jest.fn(), }, @@ -261,6 +264,7 @@ describe('testing initFastlane function', () => { setLocale: jest.fn(), FastlaneCardComponent: jest.fn(), FastlanePaymentComponent: jest.fn(), + FastlaneWatermarkComponent: jest.fn(), identity: { lookupCustomerByEmail: jest.fn(), },