-
Notifications
You must be signed in to change notification settings - Fork 557
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: update message object to accept array offer param and send offer as string #2392
base: main
Are you sure you want to change the base?
Conversation
… delimited string instead of array
src/ui/buttons/props.js
Outdated
@@ -430,7 +430,7 @@ export type ApplePaySessionConfigRequest = ( | |||
|
|||
export type ButtonMessage = {| | |||
amount?: number, | |||
offer?: $ReadOnlyArray<$Values<typeof MESSAGE_OFFER>>, | |||
offer?: $Values<typeof MESSAGE_OFFER> | 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.
if this is going to be a comma separated string, should the type just be 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.
that is a good call, as the join
statement makes the output a generic string, instead of our strict flow type.
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 think this may be meant to be $ReadOnlyArray<$Values<typeof MESSAGE_OFFER>> | string
since we want to accept the input as both and array or comma-delimited string. The merchant input will be ["a", "b"]
vs "a,b"
for better ergonomics. We convert it internally to a comma-delimited string so that we pass it to the endpoint as a string to get around the zoid
dotify
encoding issue.
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.
Oh apologies. I misspoke and got my wires crossed. ButtonMessage
is the output of the function and not the input. 😅 My comment above can be disregarded.
Description
Ensures that the message object
offer
input remains an array but output results in message havingoffer
property as a comma-delimited stringWhy are we making these changes? Include references to any related Jira tasks or GitHub Issues
Reproduction Steps (if applicable)
Screenshots (if applicable)
Dependent Changes (if applicable)
Groups who should review (if applicable)
❤️ Thank you!