-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #866 from recurly/amazon_pay_refactor
refactor rjs to resolve button reload error and add types
- Loading branch information
Showing
4 changed files
with
72 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { Emitter } from './emitter'; | ||
|
||
export type AmazonPayOptions = { | ||
/** | ||
* 2 Digit Country Code | ||
*/ | ||
region?: string; | ||
|
||
/** | ||
* Specify which Payment Gateway in Recurly must handle the payment. | ||
*/ | ||
gatewayCode?: string | ||
|
||
/** | ||
* Sets button to Sandbox environment | ||
*/ | ||
sandbox?: boolean; | ||
}; | ||
|
||
export type AmazonPayEvent = 'ready' | 'token' | 'error' | 'close' | 'done'; | ||
|
||
export interface AmazonPayInstance extends Emitter<AmazonPayEvent> { | ||
/** | ||
* Invokes the Amazon Payment Modal | ||
*/ | ||
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters