Skip to content

Commit

Permalink
Merge branch 'main' of github.com:juspay/hyperswitch-web into locally…
Browse files Browse the repository at this point in the history
…-connect-documentation
  • Loading branch information
Pritish Budhiraja committed May 6, 2024
2 parents 39324b4 + 763f9c5 commit 3f5f370
Show file tree
Hide file tree
Showing 9 changed files with 173 additions and 253 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## [0.50.1](https://github.com/juspay/hyperswitch-web/compare/v0.50.0...v0.50.1) (2024-05-06)

# [0.50.0](https://github.com/juspay/hyperswitch-web/compare/v0.49.2...v0.50.0) (2024-05-06)


Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "orca-payment-page",
"version": "0.50.0",
"version": "0.50.1",
"main": "index.js",
"private": true,
"dependencies": {
Expand Down
20 changes: 14 additions & 6 deletions src/Components/DynamicFields.res
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ let make = (
~isAllStoredCardsHaveName,
(),
)
->DynamicFieldsUtils.updateDynamicFields(billingAddress, ())
->DynamicFieldsUtils.updateDynamicFields(billingAddress, ~list, ~paymentMethod, ~isSavedCardFlow, ())
->Belt.SortArray.stableSortBy(PaymentMethodsRecord.sortPaymentMethodFields)
//<...>//
}, (requiredFields, isAllStoredCardsHaveName, isSavedCardFlow))
Expand Down Expand Up @@ -149,7 +149,7 @@ let make = (
cardRef,
icon,
cardError,
_,
setCardError,
maxCardLength,
) = switch cardProps {
| Some(cardProps) => cardProps
Expand All @@ -165,7 +165,7 @@ let make = (
expiryRef,
_,
expiryError,
_,
setExpiryError,
) = switch expiryProps {
| Some(expiryProps) => expiryProps
| None => defaultExpiryProps
Expand All @@ -181,7 +181,7 @@ let make = (
cvcRef,
_,
cvcError,
_,
setCvcError,
) = switch cvcProps {
| Some(cvcProps) => cvcProps
| None => defaultCvcProps
Expand Down Expand Up @@ -276,9 +276,17 @@ let make = (
~isSavedCardFlow,
~isAllStoredCardsHaveName,
~setRequiredFieldsBody,
~list,
)

let submitCallback = DynamicFieldsUtils.useSubmitCallback()
let submitCallback = DynamicFieldsUtils.useSubmitCallback(
~cardNumber,
~setCardError,
~cardExpiry,
~setExpiryError,
~cvcNumber,
~setCvcError,
)
useSubmitPaymentData(submitCallback)

let bottomElement = <InfoElement />
Expand Down Expand Up @@ -326,7 +334,7 @@ let make = (
key={`outside-billing-${index->Int.toString}`}
className="flex flex-col w-full place-content-between"
style={ReactDOMStyle.make(
~marginTop=index !== 0 || paymentMethod === "card" ? themeObj.spacingGridColumn : "",
~marginTop=index !== 0 ? themeObj.spacingGridColumn : "",
~gridColumnGap=themeObj.spacingGridRow,
(),
)}>
Expand Down
11 changes: 2 additions & 9 deletions src/Payment.res
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,6 @@ let make = (~paymentMode, ~integrateError, ~logger) => {
checkCardExpiry(getCardElementValue(iframeId, "card-expiry"))
| _ => true
}
let cardNetwork = {
if cardBrand != "" {
[("card_network", cardNumber->CardUtils.getCardBrand->JSON.Encode.string)]
} else {
[]
}
}
if validFormat {
let body = switch paymentMode->getPaymentMode {
| Card =>
Expand All @@ -246,7 +239,7 @@ let make = (~paymentMode, ~integrateError, ~logger) => {
~year,
~cardHolderName="",
~cvcNumber,
~cardBrand=cardNetwork,
~cardBrand,
(),
)
| CardNumberElement =>
Expand All @@ -258,7 +251,7 @@ let make = (~paymentMode, ~integrateError, ~logger) => {
~year,
~cardHolderName="",
~cvcNumber=localCvcNumber,
~cardBrand=cardNetwork,
~cardBrand,
(),
)
| _ => []
Expand Down
Loading

0 comments on commit 3f5f370

Please sign in to comment.