Skip to content

Commit

Permalink
refactor: refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanskar2001 committed Nov 21, 2024
1 parent 30bd83f commit f4d0ef3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
8 changes: 7 additions & 1 deletion src/components/elements/ButtonElement.res
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,14 @@ let make = (
}
}

let confirmSamsungPay = (status, response) => {
let confirmSamsungPay = status => {
if status->ThreeDsUtils.isStatusSuccess {
let response =
status.message
->JSON.parseExn
->JSON.Decode.object
->Option.getOr(Dict.make())

let obj = response->SamsungPayType.itemToObjMapper

let payment_method_data =
Expand Down
2 changes: 1 addition & 1 deletion src/components/modules/SamsungPayModule.res
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ open ExternalThreeDsTypes

type module_ = {
checkSamsungPayValidity: (string, statusType => unit) => unit,
presentSamsungPayPaymentSheet: ((statusType, Dict.t<JSON.t>) => unit) => unit,
presentSamsungPayPaymentSheet: (statusType => unit) => unit,
isAvailable: bool,
}

Expand Down
6 changes: 3 additions & 3 deletions src/types/SamsungPayType.res
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ let get3DSData = (dict, str) => {
let getPaymentMethodData = dict => {
{
payment_credential: {
card_brand: getString(dict, "card_brand", ""),
card_brand: getString(dict, "payment_card_brand", ""),
recurring_payment: getBool(dict, "recurring_payment", false),
card_last4digits: getString(dict, "card_last4digits", ""),
card_last4digits: getString(dict, "payment_last4_fpan", ""),
method: getString(dict, "method", ""),
\"3_d_s": get3DSData(dict, "3_d_s"),
\"3_d_s": get3DSData(dict, "3DS"),
},
}
}
Expand Down

0 comments on commit f4d0ef3

Please sign in to comment.