Skip to content

Commit

Permalink
Merge branch 'main' of github.com:juspay/hyperswitch-web into fix/log…
Browse files Browse the repository at this point in the history
…ging_endpoint_sandbox
  • Loading branch information
PritishBudhiraja committed Jul 24, 2024
2 parents bf37f8f + 20f3de3 commit 0c7886d
Show file tree
Hide file tree
Showing 6 changed files with 117 additions and 109 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [0.77.2](https://github.com/juspay/hyperswitch-web/compare/v0.77.1...v0.77.2) (2024-07-24)


### Bug Fixes

* customer acceptance issue for bank debits ([#516](https://github.com/juspay/hyperswitch-web/issues/516)) ([e797149](https://github.com/juspay/hyperswitch-web/commit/e797149d2737232c1fd20c39a95413208a685a91))

## [0.77.1](https://github.com/juspay/hyperswitch-web/compare/v0.77.0...v0.77.1) (2024-07-23)

# [0.77.0](https://github.com/juspay/hyperswitch-web/compare/v0.76.2...v0.77.0) (2024-07-18)
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.77.1",
"version": "0.77.2",
"main": "index.js",
"private": true,
"dependencies": {
Expand Down
1 change: 0 additions & 1 deletion src/Payments/ACHBankDebit.res
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ let make = (~paymentType: CardThemeType.mode) => {
~city=city.value,
~postalCode=postalCode.value,
~state=state.value,
~paymentType=paymentMethodListValue.payment_type,
)
intent(
~bodyArr=body,
Expand Down
204 changes: 103 additions & 101 deletions src/Utilities/PaymentBody.res
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,15 @@ let confirmPayloadForSDKButton = (sdkHandleConfirmPayment: PaymentType.sdkHandle
),
]->Utils.getJsonFromArrayOfJson

let bankDebitsCommonBody = paymentMethodType => {
[
("payment_method", "bank_debit"->JSON.Encode.string),
("setup_future_usage", "off_session"->JSON.Encode.string),
("payment_method_type", paymentMethodType->JSON.Encode.string),
("customer_acceptance", customerAcceptanceBody),
]
}

let achBankDebitBody = (
~email,
~bank: ACHTypes.data,
Expand All @@ -178,12 +187,8 @@ let achBankDebitBody = (
~city,
~postalCode,
~state,
~paymentType,
) =>
[
("payment_method", "bank_debit"->JSON.Encode.string),
("setup_future_usage", "off_session"->JSON.Encode.string),
("payment_method_type", "ach"->JSON.Encode.string),
bankDebitsCommonBody("ach")->Array.concat([
(
"payment_method_data",
[
Expand Down Expand Up @@ -213,7 +218,7 @@ let achBankDebitBody = (
),
]->Utils.getJsonFromArrayOfJson,
),
]->Array.concat(mandateBody(paymentType->PaymentMethodsRecord.paymentTypeToStringMapper))
])

let sepaBankDebitBody = (
~fullName,
Expand All @@ -225,37 +230,36 @@ let sepaBankDebitBody = (
~city,
~postalCode,
~state,
) => [
("payment_method", "bank_debit"->JSON.Encode.string),
("payment_method_type", "sepa"->JSON.Encode.string),
(
"payment_method_data",
[
(
"bank_debit",
[
(
"sepa_bank_debit",
[
billingDetailsTuple(
~fullName,
~email,
~line1,
~line2,
~city,
~state,
~postalCode,
~country,
),
("iban", data.iban->JSON.Encode.string),
("bank_account_holder_name", data.accountHolderName->JSON.Encode.string),
]->Utils.getJsonFromArrayOfJson,
),
]->Utils.getJsonFromArrayOfJson,
),
]->Utils.getJsonFromArrayOfJson,
),
]
) =>
bankDebitsCommonBody("sepa")->Array.concat([
(
"payment_method_data",
[
(
"bank_debit",
[
(
"sepa_bank_debit",
[
billingDetailsTuple(
~fullName,
~email,
~line1,
~line2,
~city,
~state,
~postalCode,
~country,
),
("iban", data.iban->JSON.Encode.string),
("bank_account_holder_name", data.accountHolderName->JSON.Encode.string),
]->Utils.getJsonFromArrayOfJson,
),
]->Utils.getJsonFromArrayOfJson,
),
]->Utils.getJsonFromArrayOfJson,
),
])

let bacsBankDebitBody = (
~email,
Expand All @@ -268,38 +272,37 @@ let bacsBankDebitBody = (
~state,
~country,
~bankAccountHolderName,
) => [
("payment_method", "bank_debit"->JSON.Encode.string),
("payment_method_type", "bacs"->JSON.Encode.string),
(
"payment_method_data",
[
(
"bank_debit",
[
(
"bacs_bank_debit",
[
billingDetailsTuple(
~fullName=bankAccountHolderName,
~email,
~line1,
~line2,
~city,
~state,
~postalCode=zip,
~country,
),
("bank_account_holder_name", bankAccountHolderName->JSON.Encode.string),
("sort_code", sortCode->JSON.Encode.string),
("account_number", accNum->JSON.Encode.string),
]->Utils.getJsonFromArrayOfJson,
),
]->Utils.getJsonFromArrayOfJson,
),
]->Utils.getJsonFromArrayOfJson,
),
]
) =>
bankDebitsCommonBody("bacs")->Array.concat([
(
"payment_method_data",
[
(
"bank_debit",
[
(
"bacs_bank_debit",
[
billingDetailsTuple(
~fullName=bankAccountHolderName,
~email,
~line1,
~line2,
~city,
~state,
~postalCode=zip,
~country,
),
("bank_account_holder_name", bankAccountHolderName->JSON.Encode.string),
("sort_code", sortCode->JSON.Encode.string),
("account_number", accNum->JSON.Encode.string),
]->Utils.getJsonFromArrayOfJson,
),
]->Utils.getJsonFromArrayOfJson,
),
]->Utils.getJsonFromArrayOfJson,
),
])

let becsBankDebitBody = (
~fullName,
Expand All @@ -311,38 +314,37 @@ let becsBankDebitBody = (
~city,
~postalCode,
~state,
) => [
("payment_method", "bank_debit"->JSON.Encode.string),
("payment_method_type", "becs"->JSON.Encode.string),
(
"payment_method_data",
[
(
"bank_debit",
[
(
"becs_bank_debit",
[
billingDetailsTuple(
~fullName,
~email,
~line1,
~line2,
~city,
~state,
~postalCode,
~country,
),
("bsb_number", data.sortCode->JSON.Encode.string),
("account_number", data.accountNumber->JSON.Encode.string),
("bank_account_holder_name", data.accountHolderName->JSON.Encode.string),
]->Utils.getJsonFromArrayOfJson,
),
]->Utils.getJsonFromArrayOfJson,
),
]->Utils.getJsonFromArrayOfJson,
),
]
) =>
bankDebitsCommonBody("becs")->Array.concat([
(
"payment_method_data",
[
(
"bank_debit",
[
(
"becs_bank_debit",
[
billingDetailsTuple(
~fullName,
~email,
~line1,
~line2,
~city,
~state,
~postalCode,
~country,
),
("bsb_number", data.sortCode->JSON.Encode.string),
("account_number", data.accountNumber->JSON.Encode.string),
("bank_account_holder_name", data.accountHolderName->JSON.Encode.string),
]->Utils.getJsonFromArrayOfJson,
),
]->Utils.getJsonFromArrayOfJson,
),
]->Utils.getJsonFromArrayOfJson,
),
])

let klarnaRedirectionBody = (~fullName, ~email, ~country, ~connectors) => [
("payment_method", "pay_later"->JSON.Encode.string),
Expand Down
8 changes: 4 additions & 4 deletions src/orca-log-catcher/OrcaLogger.res
Original file line number Diff line number Diff line change
Expand Up @@ -693,8 +693,8 @@ let make = (
merchantId: merchantId.contents,
browserName: arrayOfNameAndVersion->Array.get(0)->Option.getOr("Others"),
browserVersion: arrayOfNameAndVersion->Array.get(1)->Option.getOr("0"),
platform: Window.platform,
userAgent: Window.userAgent,
platform: Window.Navigator.platform,
userAgent: Window.Navigator.userAgent,
appId: "",
eventName: PAYMENT_METHOD_CHANGED,
latency: "",
Expand All @@ -721,8 +721,8 @@ let make = (
merchantId: merchantId.contents,
browserName: arrayOfNameAndVersion->Array.get(0)->Option.getOr("Others"),
browserVersion: arrayOfNameAndVersion->Array.get(1)->Option.getOr("0"),
platform: Window.platform,
userAgent: Window.userAgent,
platform: Window.Navigator.platform,
userAgent: Window.Navigator.userAgent,
appId: "",
eventName: PAYMENT_DATA_FILLED,
latency: "",
Expand Down

0 comments on commit 0c7886d

Please sign in to comment.