Skip to content

Commit

Permalink
fix: added utility function (#368)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pritish Budhiraja authored May 16, 2024
1 parent 7a759a0 commit 4c2c5a1
Show file tree
Hide file tree
Showing 11 changed files with 258 additions and 490 deletions.
4 changes: 1 addition & 3 deletions src/BrowserSpec.res
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ let broswerInfo = () => {
("time_zone", date.getTimezoneOffset()->JSON.Encode.float),
("java_enabled", true->JSON.Encode.bool),
("java_script_enabled", true->JSON.Encode.bool),
]
->Dict.fromArray
->JSON.Encode.object,
]->Utils.getJsonFromArrayOfJson,
),
]
}
3 changes: 1 addition & 2 deletions src/Components/SavedMethods.res
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,7 @@ let make = (
) {
intent(
~bodyArr=savedPaymentMethodBody
->Dict.fromArray
->JSON.Encode.object
->getJsonFromArrayOfJson
->flattenObject(true)
->mergeTwoFlattenedJsonDicts(requiredFieldsBody)
->getArrayOfTupleFromDict,
Expand Down
3 changes: 1 addition & 2 deletions src/Payments/ApplePay.res
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ let make = (
} else {
let requiredFieldsBodyArr =
requestBody
->Dict.fromArray
->JSON.Encode.object
->getJsonFromArrayOfJson
->flattenObject(true)
->mergeTwoFlattenedJsonDicts(requiredFieldsBody)
->getArrayOfTupleFromDict
Expand Down
3 changes: 1 addition & 2 deletions src/Payments/CardPayment.res
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,7 @@ let make = (
intent(
~bodyArr={
(isBancontact ? banContactBody : cardBody)
->Dict.fromArray
->JSON.Encode.object
->getJsonFromArrayOfJson
->flattenObject(true)
->mergeTwoFlattenedJsonDicts(requiredFieldsBody)
->getArrayOfTupleFromDict
Expand Down
3 changes: 1 addition & 2 deletions src/Payments/GPay.res
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ let make = (

let body = {
gPayBody
->Dict.fromArray
->JSON.Encode.object
->getJsonFromArrayOfJson
->flattenObject(true)
->mergeTwoFlattenedJsonDicts(requiredFieldsBody)
->getArrayOfTupleFromDict
Expand Down
Loading

0 comments on commit 4c2c5a1

Please sign in to comment.