-
Notifications
You must be signed in to change notification settings - Fork 138
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
refactor rjs to resolve button reload error and add types #866
Conversation
6cf9412
to
48f3edd
Compare
types/lib/amazon-pay.d.ts
Outdated
region: string; | ||
|
||
/** | ||
* The customer's locale. This is used to set the language rendered in the UI. | ||
*/ | ||
locale: string; | ||
|
||
/** | ||
* The currency of the payment. | ||
*/ | ||
currency: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't all of these options be optional like you have set gatewayCode
to be?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, it looks like currency
and locale
are set based on the region
. They should not be included as options.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It also looks like there's a sandbox
option that gets used in renderButton
. I think that should be included as well as an optional option.
types/lib/amazon-pay.d.ts
Outdated
gatewayCode?: string | ||
}; | ||
|
||
export type AmazonPayEvent = 'token' | 'error' | 'close'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The AmazonPay
class directly emits a ready
event.
The Frame
class will emit error
, done
, and close
. So you'll need to include done
in this too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I add closed
instead of close
as the Frame
emits closed?
7f9ca03
to
04a975c
Compare
types/lib/amazon-pay.d.ts
Outdated
*/ | ||
sandbox?: boolean; | ||
|
||
merchantId?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The merchant_id
is fetched from the API before emitting the ready
event. I don't think that it can be passed in as an option.
04a975c
to
d23da62
Compare
types/lib/amazon-pay.d.ts
Outdated
/** | ||
* 2 Digit Country Code | ||
*/ | ||
region: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
region
should be optional as well.
types/lib/amazon-pay.d.ts
Outdated
/** | ||
* Renders Amazon Pay button to the page | ||
*/ | ||
renderButton: (element: string | HTMLElement, amazonPayRenderButtonOptions: AmazonPayOptions & AmazonPayRenderButtonOptions) => AmazonPayInstance; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not seeing all of these additional parameters on the renderButton
function. It looks to me like it only accepts a element
parameter that is a string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The renderButton
does not return anything.
types/lib/amazon-pay.d.ts
Outdated
* Attaches an Element to the DOM, as a child of the specified parent target. | ||
* | ||
*/ | ||
attach: (defaultEventName: string, gatewayCode?: string) => AmazonPayInstance; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The attach
function does not accept any parameters and does not return anything.
types/lib/amazon-pay.d.ts
Outdated
/** | ||
* Invokes the Amazon Payment Modal | ||
*/ | ||
start: (amazonPayOptions: AmazonPayOptions) => void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The start
function does not accept any parameters.
d23da62
to
fd9189b
Compare
fd9189b
to
57e8115
Compare
[Full Changelog](v4.26.3...v4.26.4) **Merged Pull Requests** - Update ApplePayPaymentAuthorizedEvent type to match actual object shape [#867](#867) ([shin-](https://github.com/shin-)) - refactor rjs to resolve button reload error and add types [#866](#866) ([jsanderson1130](https://github.com/jsanderson1130)) - Instantiates events only on demand [#865](#865) ([chrissrogers](https://github.com/chrissrogers)) ##### Minified MD5 Checksum ``` 7d8f7e262dd874c99ecdea703abf881a ./build/recurly.min.js ``` ##### [SRI Hash](https://www.srihash.org/) ``` jq8kexKDtApgMeyCW5VrVbH7aOP1s40MsXVBrT/BBReWGolXCFMGSE6qzN9rFLda ```
No description provided.