Skip to content

Commit

Permalink
fix : resolve conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
JeevaRamu0104 committed Nov 30, 2023
2 parents 798b57a + 3f7d40b commit 2e31d56
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion config/FeatureFlag.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
"business_profile": false,
"generate_report": false,
"forgot_password": false
}
}
3 changes: 2 additions & 1 deletion src/screens/HyperSwitch/HSwitchUtils.res
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,8 @@ module CardLoader = {

let checkStripePlusPayPal = (enumDetails: QuickStartTypes.responseType) => {
enumDetails.stripeConnected.processorID->Js.String2.length > 0 &&
enumDetails.paypalConnected.processorID->Js.String2.length > 0
enumDetails.paypalConnected.processorID->Js.String2.length > 0 &&
enumDetails.sPTestPayment
? true
: false
}
Expand Down
1 change: 1 addition & 0 deletions src/screens/HyperSwitch/SDKPayment/SDKPaymentTypes.res
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ type paymentType = {
amount: int,
currency: string,
profile_id: string,
customer_id: string,
}
2 changes: 2 additions & 0 deletions src/screens/HyperSwitch/SDKPayment/SDKPaymentUtils.res
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ let initialValueForForm: string => SDKPaymentTypes.paymentType = profileId => {
amount: 100,
currency: "United States-USD",
profile_id: profileId,
customer_id: "hyperswitch_sdk_demo_id",
}

let getTypedValueForPayment: Js.Json.t => SDKPaymentTypes.paymentType = values => {
Expand All @@ -11,6 +12,7 @@ let getTypedValueForPayment: Js.Json.t => SDKPaymentTypes.paymentType = values =
amount: dictOfValues->getInt("amount", 100),
currency: dictOfValues->getString("currency", "United States-USD"),
profile_id: dictOfValues->getString("profile_id", ""),
customer_id: dictOfValues->getString("customer_id", ""),
}
}

Expand Down
1 change: 1 addition & 0 deletions src/screens/HyperSwitch/SDKPayment/TestPayment.res
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ let make = (
->Js.Json.number,
),
("profile_id", initialValues.profile_id->Js.Json.string),
("customer_id", "hyperswitch_sdk_demo_id"->Js.Json.string),
])->Js.Json.object_
let response = await updateDetails(url, body, Post)
let clientSecret = response->getDictFromJsonObject->getOptionString("client_secret")
Expand Down
15 changes: 5 additions & 10 deletions src/screens/HyperSwitch/SDKPayment/WebSDK.res
Original file line number Diff line number Diff line change
Expand Up @@ -215,16 +215,11 @@ module CheckoutForm = {
->ignore
}
React.useEffect1(() => {
let id = Js.String2.split(clientSecret, "_secret_")[0]->Belt.Option.getWithDefault("")
switch Some(id) {
| None | Some("") => ()
| Some(id) =>
hyper.retrievePaymentIntent(id)
->then(_ => {
resolve()
})
->ignore
}
hyper.retrievePaymentIntent(clientSecret)
->then(_ => {
resolve()
})
->ignore

None
}, [hyper])
Expand Down

0 comments on commit 2e31d56

Please sign in to comment.