-
Notifications
You must be signed in to change notification settings - Fork 108
feat: added get intent call for v2 #1207
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
base: main
Are you sure you want to change the base?
Conversation
src/Utilities/UnifiedHelpersV2.res
Outdated
| dict | ||
| ->Dict.get(key) | ||
| ->Option.flatMap(JSON.Decode.object) | ||
| ->Option.getOr(Dict.make()) |
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.
use Utils.getDictFromDict
| ->Option.getOr(Dict.make()) | ||
| let response = intentDict->itemToIntentObjMapper | ||
|
|
||
| LoadedIntent(response) |
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.
why this state? No loading and all??
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.
Loading is by default value and after getting the response we are setting it to Loaded
src/Utilities/PaymentHelpersV2.res
Outdated
| } | ||
|
|
||
| let uri = `${endpoint}/v2/payments/${paymentId}/get-intent` | ||
| fetchApi(uri, ~method=#GET, ~headers=headers->ApiEndpoint.addCustomPodHeader(~customPodUri)) |
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.
Change to async await structure. Please refactor thsi file - src/Utilities/PaymentHelpersV2.res similar to src/Utilities/PaymentHelpers.res. It's a long due task pending
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.
Added this one to async await structure, Disabled logging since its not in V2 yet, Will refactor the other calls as well in the upcoming PR
83deb77
Type of Change
Description
#1206
Added
get-intentcall for v2.Its a new API call where other info related to a payment will come other than payment methods enabled and saved methods.
For example -
payment-typeHow did you test it?
Tested from SDK

Response -
Checklist
npm run re:build