Skip to content

Commit

Permalink
add attach/renderButton to instance
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Anderson committed Jan 12, 2024
1 parent 48f3edd commit fd9189b
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions types/lib/amazon-pay.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,37 @@ export type AmazonPayOptions = {
/**
* 2 Digit Country Code
*/
region: string;
region?: string;

/**
* The customer's locale. This is used to set the language rendered in the UI.
*/
locale: string;

/**
* The currency of the payment.
* Specify which Payment Gateway in Recurly must handle the payment.
*/
currency: string;
gatewayCode?: string

/**
* Specify which Payment Gateway in Recurly must handle the payment.
* Sets button to Sandbox environment
*/
gatewayCode?: string
sandbox?: boolean;
};

export type AmazonPayEvent = 'token' | 'error' | 'close';
export type AmazonPayEvent = 'ready' | 'token' | 'error' | 'close' | 'done';

export interface AmazonPayInstance extends Emitter<AmazonPayEvent> {
/**
* Invokes the Amazon Payment Modal
*/
start: (amazonPayOptions: AmazonPayOptions) => void;
start: () => void;

/**
* Attaches an Element to the DOM, as a child of the specified parent target.
*
*/
attach: () => void;

/**
* Renders Amazon Pay button to the page
*/
renderButton: (element: string) => void;
}

export type AmazonPay = (amazonPayOptions?: AmazonPayOptions) => AmazonPayInstance;

0 comments on commit fd9189b

Please sign in to comment.