Skip to content

Commit

Permalink
Updates recurly-js types
Browse files Browse the repository at this point in the history
  • Loading branch information
recurly-integrations authored Jul 30, 2024
1 parent 4bad7de commit 6a1ca10
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions types/recurly__recurly-js/lib/alternative-payment-methods.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Address } from './address';
import { Emitter } from './emitter';

export type AlternativePaymentMethodEvents = 'token' | 'error' | 'valid';
Expand Down Expand Up @@ -31,7 +32,7 @@ export type AdyenAlternativePaymentMethodOptions = {
componentConfig?: { [key: string]: any }
};

export type AlternativePaymentMethodOptions = {
export type AlternativePaymentMethodStartOptions = {
/**
* List of payment methods to be presented to the customer.
*/
Expand Down Expand Up @@ -79,18 +80,25 @@ export type AlternativePaymentMethodOptions = {
adyen?: AdyenAlternativePaymentMethodOptions
};

export type AlternativePaymentMethodSubmitOptions = {
/**
* Sets the customer billing address on the generated token.
*/
billingAddress?: Address;
};

export interface AlternativePaymentMethodsInstance extends Emitter<AlternativePaymentMethodEvents> {
/**
* Start the PaymentMethods and render the components.
*/
start: (data: AlternativePaymentMethodOptions) => Promise<void>;
start: (data: AlternativePaymentMethodStartOptions) => Promise<void>;

/**
* Submit the customer payment information and produce a token.
* Call this function only when the payment information provided by the customer is valid, by listening the 'valid' event.
* The token can be retrieved through the 'token' event.
*/
submit: () => Promise<void>;
submit: (args: AlternativePaymentMethodSubmitOptions) => Promise<void>;

/**
* Some payment methods require additional action from the shopper such as: to scan a QR code,
Expand Down

0 comments on commit 6a1ca10

Please sign in to comment.