diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 3f7911188413..dc4010d0fd0c 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -45,6 +45,10 @@ crates/test_utils/tests/connectors/ @juspay/hyperswitch-connector
crates/test_utils/tests/sample_auth.toml @juspay/hyperswitch-connector
crates/connector_configs/ @juspay/hyperswitch-connector
crates/hyperswitch_connectors/ @juspay/hyperswitch-connector
+crates/api_models/src/connector_enums.rs @juspay/hyperswitch-connector
+crates/common_enums/src/connector_enums.rs @juspay/hyperswitch-connector
+crates/router/src/configs/defaults/payment_connector_required_fields.rs @juspay/hyperswitch-connector
+crates/hyperswitch_interfaces/src/configs.rs @juspay/hyperswitch-connector
crates/router/src/compatibility/ @juspay/hyperswitch-compatibility
diff --git a/.github/workflows/CI-pr.yml b/.github/workflows/CI-pr.yml
index 220c4f2577c2..369da734da5a 100644
--- a/.github/workflows/CI-pr.yml
+++ b/.github/workflows/CI-pr.yml
@@ -325,7 +325,7 @@ jobs:
- name: Run cargo clippy with v2 features enabled
shell: bash
- run: just clippy_v2 -- -D warnings -Aunused -Aclippy::todo -Aclippy::diverging_sub_expression
+ run: just clippy_v2
- name: Run cargo check enabling only the release and v2 features
shell: bash
diff --git a/.github/workflows/cypress-tests-runner.yml b/.github/workflows/cypress-tests-runner.yml
index a878a9db8e46..055aacdcf4f2 100644
--- a/.github/workflows/cypress-tests-runner.yml
+++ b/.github/workflows/cypress-tests-runner.yml
@@ -13,7 +13,8 @@ concurrency:
env:
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
- CONNECTORS: stripe
+ PAYMENTS_CONNECTORS: "stripe"
+ PAYOUTS_CONNECTORS: "wise"
RUST_BACKTRACE: short
RUSTUP_MAX_RETRIES: 10
RUN_TESTS: ${{ ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name)) || (github.event_name == 'merge_group')}}
@@ -68,7 +69,7 @@ jobs:
CONNECTOR_AUTH_PASSPHRASE: ${{ secrets.CONNECTOR_AUTH_PASSPHRASE }}
CONNECTOR_CREDS_S3_BUCKET_URI: ${{ secrets.CONNECTOR_CREDS_S3_BUCKET_URI}}
DESTINATION_FILE_NAME: "creds.json.gpg"
- S3_SOURCE_FILE_NAME: "f64157fe-a8f7-43a8-a268-b17e9a8c305f.json.gpg"
+ S3_SOURCE_FILE_NAME: "5a3f7679-445e-4621-86c5-39bd8d26b7c5.json.gpg"
shell: bash
run: |
mkdir -p ".github/secrets" ".github/test"
@@ -158,7 +159,7 @@ jobs:
- name: Build project
if: ${{ env.RUN_TESTS == 'true' }}
- run: cargo build --package router --bin router --jobs 4
+ run: cargo build --package router --bin router --jobs 3
- name: Setup Local Server
if: ${{ env.RUN_TESTS == 'true' }}
@@ -186,29 +187,10 @@ jobs:
if: ${{ env.RUN_TESTS == 'true' }}
env:
CYPRESS_BASEURL: "http://localhost:8080"
+ ROUTER__SERVER__WORKERS: 4
shell: bash -leuo pipefail {0}
run: |
- cd cypress-tests
-
- RED='\033[0;31m'
- RESET='\033[0m'
-
- failed_connectors=()
-
- for connector in $(echo "${CONNECTORS}" | tr "," "\n"); do
- echo "${connector}"
- for service in "payments" "payouts"; do
- if ! ROUTER__SERVER__WORKERS=4 CYPRESS_CONNECTOR="${connector}" npm run cypress:"${service}"; then
- failed_connectors+=("${connector}-${service}")
- fi
- done
- done
-
- if [ ${#failed_connectors[@]} -gt 0 ]; then
- echo -e "${RED}One or more connectors failed to run:${RESET}"
- printf '%s\n' "${failed_connectors[@]}"
- exit 1
- fi
+ scripts/execute_cypress.sh --parallel 3
kill "${{ env.PID }}"
@@ -218,6 +200,5 @@ jobs:
with:
name: cypress-test-results
path: |
- cypress-tests/cypress/reports/*.json
- cypress-tests/cypress/reports/*.html
+ cypress-tests/cypress/reports/
retention-days: 1
diff --git a/.gitignore b/.gitignore
index 1aa3faf2c1d1..1209263db3c8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -263,4 +263,9 @@ result*
node_modules/
# cypress credentials
-creds.json
\ No newline at end of file
+creds.json
+
+/.direnv
+
+# Nix services data
+/data
\ No newline at end of file
diff --git a/.typos.toml b/.typos.toml
index 79c86a39c6b5..d2ffb8a5b105 100644
--- a/.typos.toml
+++ b/.typos.toml
@@ -1,5 +1,8 @@
[default]
check-filename = true
+extend-ignore-identifiers-re = [
+ "UE_[0-9]{3,4}", # Unified error codes
+]
[default.extend-identifiers]
ABD = "ABD" # Aberdeenshire, UK ISO 3166-2 code
@@ -38,7 +41,6 @@ ws2ipdef = "ws2ipdef" # WinSock Extension
ws2tcpip = "ws2tcpip" # WinSock Extension
ZAR = "ZAR" # South African Rand currency code
JOD = "JOD" # Jordan currency code
-UE_000 = "UE_000" #default unified error code
[default.extend-words]
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ee37761719f2..8d5eb5d0517b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,244 @@ All notable changes to HyperSwitch will be documented here.
- - -
+## 2024.11.06.0
+
+### Features
+
+- **config:** Update vector config ([#6365](https://github.com/juspay/hyperswitch/pull/6365)) ([`2919db8`](https://github.com/juspay/hyperswitch/commit/2919db874bd84372663228f2531ba18338e039c0))
+- **connector:**
+ - [ELAVON] Template PR ([#6309](https://github.com/juspay/hyperswitch/pull/6309)) ([`b481e5c`](https://github.com/juspay/hyperswitch/commit/b481e5cb8ffe417591a2fb917f37ba72667f2fcd))
+ - [Paypal] implement vaulting for paypal wallet and cards while purchasing ([#5323](https://github.com/juspay/hyperswitch/pull/5323)) ([`22ba2db`](https://github.com/juspay/hyperswitch/commit/22ba2dbb2870471315d688147b3b53c432ce15dc))
+ - [JP MORGAN] Added Template code for cards integration ([#6467](https://github.com/juspay/hyperswitch/pull/6467)) ([`b048e39`](https://github.com/juspay/hyperswitch/commit/b048e39b5c4213752da7765834915cca6bf776f6))
+- **db:** Implement `MerchantAccountInteraface` for `Mockdb` ([#6283](https://github.com/juspay/hyperswitch/pull/6283)) ([`5f493a5`](https://github.com/juspay/hyperswitch/commit/5f493a5166aa0a0a29f9aed538cad03def657c22))
+- **nix:** Add support for running external services through services-flake ([#6377](https://github.com/juspay/hyperswitch/pull/6377)) ([`95f2e0b`](https://github.com/juspay/hyperswitch/commit/95f2e0b8c51bfe116241fc486069e10e578a5ff8))
+- **users:** Add `force_two_factor_auth` environment variable ([#6466](https://github.com/juspay/hyperswitch/pull/6466)) ([`6b66ccc`](https://github.com/juspay/hyperswitch/commit/6b66cccd02c2589bb2dad38b46f4da7e1455ca0b))
+
+### Bug Fixes
+
+- **connector:**
+ - Expiration Year Incorrectly Populated as YYYY Format in Paybox Mandates ([#6474](https://github.com/juspay/hyperswitch/pull/6474)) ([`e457ccd`](https://github.com/juspay/hyperswitch/commit/e457ccd91e60d5168e0a3283dfa325097f455076))
+ - [Cybersource] remove newline in billing address with space ([#6478](https://github.com/juspay/hyperswitch/pull/6478)) ([`7f1d345`](https://github.com/juspay/hyperswitch/commit/7f1d34571f72f63b8bb52aff995ad093e3b6d856))
+- **refunds:** Remove to schema from refund aggregate response and exclude it from open api documentation ([#6405](https://github.com/juspay/hyperswitch/pull/6405)) ([`449c9cf`](https://github.com/juspay/hyperswitch/commit/449c9cfe557b3540e4ad25e48e012b531eb232fd))
+- Replace deprecated backticks with $(...) for command substitution ([#6337](https://github.com/juspay/hyperswitch/pull/6337)) ([`1c92f58`](https://github.com/juspay/hyperswitch/commit/1c92f5843009db42778f94bc9fd915b411a93f76))
+- Lazy connection pools for dynamic routing service ([#6437](https://github.com/juspay/hyperswitch/pull/6437)) ([`71d9933`](https://github.com/juspay/hyperswitch/commit/71d99332204ddfbb3cf305c7d3bc8840d508bf47))
+
+**Full Changelog:** [`2024.11.05.0...2024.11.06.0`](https://github.com/juspay/hyperswitch/compare/2024.11.05.0...2024.11.06.0)
+
+- - -
+
+## 2024.11.05.0
+
+### Features
+
+- Add macro to generate ToEncryptable trait ([#6313](https://github.com/juspay/hyperswitch/pull/6313)) ([`19cf0f7`](https://github.com/juspay/hyperswitch/commit/19cf0f7437a8d16ee4da254d2a3e2659879be68c))
+
+### Bug Fixes
+
+- **analytics:** Add dynamic limit by clause in failure reasons metric query ([#6462](https://github.com/juspay/hyperswitch/pull/6462)) ([`8825378`](https://github.com/juspay/hyperswitch/commit/88253780d708bc1c005a87c186c4b0b14325c8a0))
+
+### Refactors
+
+- **connector:** [AIRWALLEX, MULTISAFEPAY, RAZORPAY, SHIFT4, WORLDPAY, ZSL] Move connectors from `router` to `hyperswitch_connectors` crate ([#6369](https://github.com/juspay/hyperswitch/pull/6369)) ([`72ee434`](https://github.com/juspay/hyperswitch/commit/72ee434003eef744d516343a2f803264f226d92a))
+
+**Full Changelog:** [`2024.11.04.0...2024.11.05.0`](https://github.com/juspay/hyperswitch/compare/2024.11.04.0...2024.11.05.0)
+
+- - -
+
+## 2024.11.04.0
+
+### Features
+
+- **analytics:** Add `customer_id` as filter for payment intents ([#6344](https://github.com/juspay/hyperswitch/pull/6344)) ([`d697def`](https://github.com/juspay/hyperswitch/commit/d697def0b7cad3743db9fd70d09a45921dcbea61))
+- **authz:** Make info APIs support `ParentGroup` ([#6440](https://github.com/juspay/hyperswitch/pull/6440)) ([`7dcffcc`](https://github.com/juspay/hyperswitch/commit/7dcffccf3f16de5e40f61a302beb318035c3e88b))
+- **connector:** [Paybox] Add mandates Flow for Paybox ([#6378](https://github.com/juspay/hyperswitch/pull/6378)) ([`37513e0`](https://github.com/juspay/hyperswitch/commit/37513e0f1e78f99da0accf0fee263c10ca4e03c6))
+- **cypress-test:** Include worldpay's request / response structure for test suite ([#6420](https://github.com/juspay/hyperswitch/pull/6420)) ([`8372389`](https://github.com/juspay/hyperswitch/commit/8372389671c4aefeb625365d198390df5d8f35a5))
+- **router:** Add payments get-intent API for v2 ([#6396](https://github.com/juspay/hyperswitch/pull/6396)) ([`c514608`](https://github.com/juspay/hyperswitch/commit/c514608594ebbe9894de47747b0d9fb573ab2503))
+
+### Refactors
+
+- **connector:** Add amount conversion framework to rapyd ([#6414](https://github.com/juspay/hyperswitch/pull/6414)) ([`33bc83f`](https://github.com/juspay/hyperswitch/commit/33bc83fce47c579457f1b9be0a91bb4fa13585ff))
+- **connnector:** Structure connector enums in separate files for improved team ownership ([#6459](https://github.com/juspay/hyperswitch/pull/6459)) ([`bb246e2`](https://github.com/juspay/hyperswitch/commit/bb246e27b72e9e4168c89b94e8d07d63a544b586))
+
+### Documentation
+
+- **README:** Updated the icon and repositioned the hero image ([#6445](https://github.com/juspay/hyperswitch/pull/6445)) ([`35bf5a9`](https://github.com/juspay/hyperswitch/commit/35bf5a91d9a5b2d5e476c995e679b445242218e0))
+
+### Miscellaneous Tasks
+
+- **users:** Change entity_type column of roles to non-optional ([#6435](https://github.com/juspay/hyperswitch/pull/6435)) ([`62067e4`](https://github.com/juspay/hyperswitch/commit/62067e406a01d3a17ef94a04b0ef0304ebd05a70))
+
+**Full Changelog:** [`2024.10.30.0...2024.11.04.0`](https://github.com/juspay/hyperswitch/compare/2024.10.30.0...2024.11.04.0)
+
+- - -
+
+## 2024.10.30.0
+
+### Refactors
+
+- **connector:** Add amount conversion framework to payu ([#6199](https://github.com/juspay/hyperswitch/pull/6199)) ([`11ce389`](https://github.com/juspay/hyperswitch/commit/11ce389000bf53c7f740d069f7ad2262bf5b70d6))
+
+### Documentation
+
+- Added desc. for wallets other than AP, GP ([#6452](https://github.com/juspay/hyperswitch/pull/6452)) ([`55a81eb`](https://github.com/juspay/hyperswitch/commit/55a81eb4692979036d0bfd43e445d3e1db6601e7))
+
+**Full Changelog:** [`2024.10.29.0...2024.10.30.0`](https://github.com/juspay/hyperswitch/compare/2024.10.29.0...2024.10.30.0)
+
+- - -
+
+## 2024.10.29.0
+
+### Bug Fixes
+
+- **multitenancy:** Consistently use tenant nomenclature everywhere ([#6389](https://github.com/juspay/hyperswitch/pull/6389)) ([`aecd5ee`](https://github.com/juspay/hyperswitch/commit/aecd5eea3d2dce3ccdd4784f60d076b641104b67))
+
+**Full Changelog:** [`2024.10.28.2...2024.10.29.0`](https://github.com/juspay/hyperswitch/compare/2024.10.28.2...2024.10.29.0)
+
+- - -
+
+## 2024.10.28.2
+
+### Bug Fixes
+
+- **connector:**
+ - [Novalnet] Remove webhook placeholder connector config ([#6451](https://github.com/juspay/hyperswitch/pull/6451)) ([`e33340e`](https://github.com/juspay/hyperswitch/commit/e33340e70b59e9e4f18e92fc27d8c90b3df5768b))
+ - [Adyen] Add MYR currency config ([#6442](https://github.com/juspay/hyperswitch/pull/6442)) ([`925e424`](https://github.com/juspay/hyperswitch/commit/925e4240e4ad6da1d243769b184842c0d8251a7d))
+
+**Full Changelog:** [`2024.10.28.1...2024.10.28.2`](https://github.com/juspay/hyperswitch/compare/2024.10.28.1...2024.10.28.2)
+
+- - -
+
+## 2024.10.28.1
+
+### Bug Fixes
+
+- **core:** Fix setup mandate payments to store connector mandate details ([#6446](https://github.com/juspay/hyperswitch/pull/6446)) ([`cee84cd`](https://github.com/juspay/hyperswitch/commit/cee84cdcfd6c323e8db80163f462d8e286aae600))
+
+**Full Changelog:** [`2024.10.28.0...2024.10.28.1`](https://github.com/juspay/hyperswitch/compare/2024.10.28.0...2024.10.28.1)
+
+- - -
+
+## 2024.10.28.0
+
+### Features
+
+- **connector:**
+ - [Rapyd] Use connector_response_reference_id ([#6302](https://github.com/juspay/hyperswitch/pull/6302)) ([`a845d46`](https://github.com/juspay/hyperswitch/commit/a845d46899d87ba7f3ca4386719c1934ce3da90e))
+ - [Rapyd] Use connector_request_reference_id ([#6296](https://github.com/juspay/hyperswitch/pull/6296)) ([`4105d98`](https://github.com/juspay/hyperswitch/commit/4105d98d7aca885f9c622d5b56c6dbacb85a688b))
+ - [Novalnet] Integrate Applepay wallet token flow ([#6409](https://github.com/juspay/hyperswitch/pull/6409)) ([`1d24b04`](https://github.com/juspay/hyperswitch/commit/1d24b04596e6d2f7c44b93501d56fc4fb950bd3b))
+ - [PayU] Use connector_request_reference_id ([#6360](https://github.com/juspay/hyperswitch/pull/6360)) ([`acd1530`](https://github.com/juspay/hyperswitch/commit/acd153042062dd14d5e6e266fdc73d82b78213fe))
+ - [Fiuu] Add support for cards recurring payments ([#6361](https://github.com/juspay/hyperswitch/pull/6361)) ([`4647a2f`](https://github.com/juspay/hyperswitch/commit/4647a2f6aece6b9479395fa3622b51b50d3091ee))
+- **euclid:** Add dynamic routing in core flows ([#6333](https://github.com/juspay/hyperswitch/pull/6333)) ([`ce732db`](https://github.com/juspay/hyperswitch/commit/ce732db9b2f98924a2b1d44ea5eb1000b6cbb498))
+- **router:** Move organization_id to request header from request body for v2 ([#6277](https://github.com/juspay/hyperswitch/pull/6277)) ([`aaac9aa`](https://github.com/juspay/hyperswitch/commit/aaac9aa97d1b00d50bec4e02efb0658956463398))
+- **sample_data:** Generate random disputes for sample data ([#6341](https://github.com/juspay/hyperswitch/pull/6341)) ([`e36ea18`](https://github.com/juspay/hyperswitch/commit/e36ea184ae6d1363fb1af55c790162df9f8b451c))
+- Add amount, currency and email to paze session response ([#6412](https://github.com/juspay/hyperswitch/pull/6412)) ([`a3ea62f`](https://github.com/juspay/hyperswitch/commit/a3ea62f88524a360b666cacfbc1cf239f6be8797))
+
+### Bug Fixes
+
+- **analytics:** Fix refund status filter on dashboard ([#6431](https://github.com/juspay/hyperswitch/pull/6431)) ([`d58f706`](https://github.com/juspay/hyperswitch/commit/d58f706dc3fdd5ea277eeef6de9c224fe6097b46))
+- **router:** Update request body for migrate-batch api ([#6429](https://github.com/juspay/hyperswitch/pull/6429)) ([`5307579`](https://github.com/juspay/hyperswitch/commit/53075792b372a7ca574b94058c7d72033c014bc8))
+
+### Refactors
+
+- **connector:**
+ - Add amount conversion framework to tsys ([#6282](https://github.com/juspay/hyperswitch/pull/6282)) ([`90765be`](https://github.com/juspay/hyperswitch/commit/90765bece1b12b208192e7ae4d54f4c70a301cea))
+ - [Paypal] Add support for passing shipping_cost in Payment request ([#6423](https://github.com/juspay/hyperswitch/pull/6423)) ([`b0d5c96`](https://github.com/juspay/hyperswitch/commit/b0d5c96b9918549663125681259a598698ec705c))
+ - Added amount conversion framework for klarna and change type of amount to MinorUnit for OrderDetailsWithAmount ([#4979](https://github.com/juspay/hyperswitch/pull/4979)) ([`2807622`](https://github.com/juspay/hyperswitch/commit/2807622ba671f77892a0fde42febbcffcb6c2238))
+
+**Full Changelog:** [`2024.10.25.0...2024.10.28.0`](https://github.com/juspay/hyperswitch/compare/2024.10.25.0...2024.10.28.0)
+
+- - -
+
+## 2024.10.25.0
+
+### Features
+
+- **authz:** Create a permission generator ([#6394](https://github.com/juspay/hyperswitch/pull/6394)) ([`4a0afb8`](https://github.com/juspay/hyperswitch/commit/4a0afb8213cce47cabe9e3f5d22ad1dccb02c20f))
+- **connector:**
+ - [Airwallex] Use connector_response_reference_id as reference to merchant ([#2747](https://github.com/juspay/hyperswitch/pull/2747)) ([`4b569c9`](https://github.com/juspay/hyperswitch/commit/4b569c9d5eb9b6403175c958b887d7ace4d9cbbb))
+ - [Novalnet] Integrate wallets Paypal and Googlepay ([#6370](https://github.com/juspay/hyperswitch/pull/6370)) ([`673b869`](https://github.com/juspay/hyperswitch/commit/673b8691e092e145ba211050db4f5c7e021a0ce2))
+- **payments_v2:** Add payment_confirm_intent api endpoint ([#6263](https://github.com/juspay/hyperswitch/pull/6263)) ([`c7c1e1a`](https://github.com/juspay/hyperswitch/commit/c7c1e1adabceeb0a03659bf8feb9aa06d85960ea))
+
+### Bug Fixes
+
+- **core:** Populate billing_address for payment with pm_id ([#6411](https://github.com/juspay/hyperswitch/pull/6411)) ([`8e58b56`](https://github.com/juspay/hyperswitch/commit/8e58b56b43ad2f823c51943c34aa8837297c70d6))
+- **payment_methods:** Fix merchant payment method list to retain a mca based on connector_name and mca_id ([#6408](https://github.com/juspay/hyperswitch/pull/6408)) ([`842c4a2`](https://github.com/juspay/hyperswitch/commit/842c4a2f47d4cc7b850a16abbe5431fe575f7a86))
+- **payments:** Filter total count by card-network value ([#6397](https://github.com/juspay/hyperswitch/pull/6397)) ([`ca325e9`](https://github.com/juspay/hyperswitch/commit/ca325e969b24fbbb5aa7edcdf86d5b3022291db1))
+
+### Refactors
+
+- **connector:**
+ - Add amount conversion framework to Shift4 ([#6250](https://github.com/juspay/hyperswitch/pull/6250)) ([`fbe3951`](https://github.com/juspay/hyperswitch/commit/fbe395198aea7252e9c4e3fad97956a548d07002))
+ - Add amount conversion framework to Wellsfargo ([#6298](https://github.com/juspay/hyperswitch/pull/6298)) ([`c3b0f7c`](https://github.com/juspay/hyperswitch/commit/c3b0f7c1d6ad95034535048aa50ff6abe9ed6aa0))
+
+### Documentation
+
+- **cypress:** Refactor cypress documentation for more clarity ([#6415](https://github.com/juspay/hyperswitch/pull/6415)) ([`26e0c32`](https://github.com/juspay/hyperswitch/commit/26e0c32f4da5689a1c01fbb456ac008a0b831710))
+- **openapi:** Improve `rust_locker_open_api_spec` ([#6322](https://github.com/juspay/hyperswitch/pull/6322)) ([`a31d164`](https://github.com/juspay/hyperswitch/commit/a31d1641fb9e1c9efd652c6f191f6b29c75dc69b))
+
+### Miscellaneous Tasks
+
+- Add samsung pay payment method support for cybersource ([#6424](https://github.com/juspay/hyperswitch/pull/6424)) ([`ecaf700`](https://github.com/juspay/hyperswitch/commit/ecaf70099671950287e9a6b7d30ffd02c0c5f51e))
+- Address Rust 1.82.0 clippy lints ([#6401](https://github.com/juspay/hyperswitch/pull/6401)) ([`8708a5c`](https://github.com/juspay/hyperswitch/commit/8708a5cb8f7d64a382b2fe061c725d4854ba9e92))
+
+**Full Changelog:** [`2024.10.24.0...2024.10.25.0`](https://github.com/juspay/hyperswitch/compare/2024.10.24.0...2024.10.25.0)
+
+- - -
+
+## 2024.10.24.0
+
+### Features
+
+- **analytics:** Remove additional filters from PaymentIntentFilters ([#6403](https://github.com/juspay/hyperswitch/pull/6403)) ([`4ef48c3`](https://github.com/juspay/hyperswitch/commit/4ef48c39b3ed7c1fcda9c850da766a0bdb701335))
+- **router:** Add api_models and openapi changes for refunds create api v2 ([#6385](https://github.com/juspay/hyperswitch/pull/6385)) ([`5a10e58`](https://github.com/juspay/hyperswitch/commit/5a10e5867a0f3097a40c8a6868454ff06630ed2c))
+
+### Bug Fixes
+
+- **connector_config:** Include the `payment_processing_details_at` `Hyperswitch` option only if apple pay token decryption flow is supported for the connector ([#6386](https://github.com/juspay/hyperswitch/pull/6386)) ([`af0aeee`](https://github.com/juspay/hyperswitch/commit/af0aeeea53014d8fe5c955cbad3fe8b371c44889))
+- **deployment-config:** Remove invalid currencies from worldpay filters ([#6400](https://github.com/juspay/hyperswitch/pull/6400)) ([`aee11c5`](https://github.com/juspay/hyperswitch/commit/aee11c560e427195a0d321dff19c0d33ec60ba64))
+
+### Refactors
+
+- **connector:** Move connectors Forte, Nexinets, Payeezy, Payu and Zen from Router to Hyperswitch Connector Trait ([#6261](https://github.com/juspay/hyperswitch/pull/6261)) ([`829a20c`](https://github.com/juspay/hyperswitch/commit/829a20cc933267551e49565d06eb08e03e5f13bb))
+
+**Full Changelog:** [`2024.10.23.0...2024.10.24.0`](https://github.com/juspay/hyperswitch/compare/2024.10.23.0...2024.10.24.0)
+
+- - -
+
+## 2024.10.23.0
+
+### Features
+
+- **cypress:** Execute cypress tests in parallel ([#6225](https://github.com/juspay/hyperswitch/pull/6225)) ([`f247978`](https://github.com/juspay/hyperswitch/commit/f24797834553794f341bd4f3be3afe5fcba693ed))
+
+### Refactors
+
+- **connector:** [WorldPay] propagate refusal codes as error code and messages ([#6392](https://github.com/juspay/hyperswitch/pull/6392)) ([`3d1a3cd`](https://github.com/juspay/hyperswitch/commit/3d1a3cdc8f942a3dca2e6a200bf9200366bd62f1))
+- **permissions:** Remove permissions field from permission info API response ([#6376](https://github.com/juspay/hyperswitch/pull/6376)) ([`e5710fa`](https://github.com/juspay/hyperswitch/commit/e5710fa084ed5b0a4969a63b14a7f8e3433a3c64))
+
+**Full Changelog:** [`2024.10.22.0...2024.10.23.0`](https://github.com/juspay/hyperswitch/compare/2024.10.22.0...2024.10.23.0)
+
+- - -
+
+## 2024.10.22.0
+
+### Features
+
+- **connector:** Add 3DS flow for Worldpay ([#6374](https://github.com/juspay/hyperswitch/pull/6374)) ([`b93c849`](https://github.com/juspay/hyperswitch/commit/b93c849623c46ad00fe8dfe5bed85a43c700b3c8))
+
+### Bug Fixes
+
+- **mandates:** Allow connector_mandate_detail updation in case of 'Authorized' Payments ([#6379](https://github.com/juspay/hyperswitch/pull/6379)) ([`d09a805`](https://github.com/juspay/hyperswitch/commit/d09a805c0ab4e1224a94ef64b0d75a77355bc3f3))
+
+### Refactors
+
+- **connector:** [WorldPay] migrate from modular to standard payment APIs ([#6317](https://github.com/juspay/hyperswitch/pull/6317)) ([`58296ff`](https://github.com/juspay/hyperswitch/commit/58296ffae6ff6f2f2c8f7b23dd28e92b374b9be3))
+- **router:** Introduce ApiKeyId id type ([#6324](https://github.com/juspay/hyperswitch/pull/6324)) ([`b3ce373`](https://github.com/juspay/hyperswitch/commit/b3ce373f8ecdce362296c9a4b3c3e3543e1baa6f))
+
+**Full Changelog:** [`2024.10.21.0...2024.10.22.0`](https://github.com/juspay/hyperswitch/compare/2024.10.21.0...2024.10.22.0)
+
+- - -
+
## 2024.10.21.0
### Features
diff --git a/Cargo.lock b/Cargo.lock
index 26ad619ee0ba..d232fcbf024c 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -353,6 +353,7 @@ dependencies = [
"bigdecimal",
"common_enums",
"common_utils",
+ "currency_conversion",
"diesel_models",
"error-stack",
"futures 0.3.30",
@@ -363,6 +364,7 @@ dependencies = [
"opensearch",
"reqwest 0.11.27",
"router_env",
+ "rust_decimal",
"serde",
"serde_json",
"sqlx",
@@ -3126,8 +3128,10 @@ dependencies = [
"dyn-clone",
"error-stack",
"hex",
+ "http-body-util",
"hyper 0.14.30",
"hyper-proxy",
+ "hyper-util",
"hyperswitch_interfaces",
"masking",
"once_cell",
@@ -3959,9 +3963,9 @@ dependencies = [
[[package]]
name = "hyper-util"
-version = "0.1.7"
+version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cde7055719c54e36e95e8719f95883f22072a48ede39db7fc17a4e1d5281e9b9"
+checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b"
dependencies = [
"bytes 1.7.1",
"futures-channel",
@@ -3972,7 +3976,6 @@ dependencies = [
"pin-project-lite",
"socket2",
"tokio 1.40.0",
- "tower",
"tower-service",
"tracing",
]
@@ -3997,6 +4000,7 @@ dependencies = [
"hyperswitch_interfaces",
"image",
"masking",
+ "mime",
"once_cell",
"qrcode",
"rand",
@@ -4007,9 +4011,11 @@ dependencies = [
"serde",
"serde_json",
"serde_urlencoded",
+ "serde_with",
"strum 0.26.3",
"time",
"url",
+ "urlencoding",
"uuid",
]
@@ -6438,6 +6444,7 @@ dependencies = [
"unicode-segmentation",
"unidecode",
"url",
+ "urlencoding",
"utoipa",
"uuid",
"validator",
diff --git a/INSTALL_dependencies.sh b/INSTALL_dependencies.sh
index 3ec36ccc66e0..e1d666b97a30 100755
--- a/INSTALL_dependencies.sh
+++ b/INSTALL_dependencies.sh
@@ -37,7 +37,7 @@ set -o nounset
# utilities
# convert semver to comparable integer
-if [[ `id -u` -ne 0 ]]; then
+if [[ "$(id -u)" -ne 0 ]]; then
print_info "requires sudo"
SUDO=sudo
else
@@ -45,10 +45,10 @@ else
fi
ver () {
- printf "%03d%03d%03d%03d" `echo "$1" | tr '.' ' '`;
+ printf "%03d%03d%03d%03d" "$(echo "$1" | tr '.' ' ')";
}
-PROGNAME=`basename $0`
+PROGNAME="$(basename $0)"
print_info () {
echo -e "$PROGNAME: $*"
}
@@ -125,10 +125,10 @@ if command -v cargo > /dev/null; then
need_cmd rustc
- RUST_VERSION=`rustc -V | cut -d " " -f 2`
+ RUST_VERSION="$(rustc -V | cut -d " " -f 2)"
- _HAVE_VERSION=`ver ${RUST_VERSION}`
- _NEED_VERSION=`ver ${RUST_MSRV}`
+ _HAVE_VERSION="$(ver ${RUST_VERSION})"
+ _NEED_VERSION="$(ver ${RUST_MSRV})"
print_info "Found rust version \"${RUST_VERSION}\". MSRV is \"${RUST_MSRV}\""
@@ -166,7 +166,7 @@ install_dep () {
$INSTALL_CMD $*
}
-if [[ ! -x "`command -v psql`" ]] || [[ ! -x "`command -v redis-server`" ]] ; then
+if [[ ! -x "$(command -v psql)" ]] || [[ ! -x "$(command -v redis-server)" ]] ; then
print_info "Missing dependencies. Trying to install"
# java has an apt which seems to mess up when we look for apt
diff --git a/README.md b/README.md
index ccdd6e19b6d2..10fdb6afc760 100644
--- a/README.md
+++ b/README.md
@@ -22,7 +22,7 @@ The single API to access payment ecosystems across 130+ countries
-
+
@@ -44,7 +44,6 @@ The single API to access payment ecosystems across 130+ countries
-
Hyperswitch is a community-led, open payments switch designed to empower digital businesses by providing fast, reliable, and affordable access to the best payments infrastructure.
@@ -58,7 +57,8 @@ Here are the components of Hyperswitch that deliver the whole solution:
Jump in and contribute to these repositories to help improve and expand Hyperswitch!
-
+
+
⚡️ Quick Setup
diff --git a/add_connector.md b/add_connector.md
index eda368db9c83..4d6e885b7edf 100644
--- a/add_connector.md
+++ b/add_connector.md
@@ -311,7 +311,7 @@ impl TryFrom>
let payments_response_data = types::PaymentsResponseData::TransactionResponse {
resource_id: types::ResponseId::ConnectorTransactionId(item.response.id.clone()),
redirection_data,
- mandate_reference: None,
+ mandate_reference: Box::new(None),
connector_metadata: None,
network_txn_id: None,
connector_response_reference_id: Some(
diff --git a/api-reference-v2/api-reference/payments/payments--confirm-intent.mdx b/api-reference-v2/api-reference/payments/payments--confirm-intent.mdx
new file mode 100644
index 000000000000..58624c2771b9
--- /dev/null
+++ b/api-reference-v2/api-reference/payments/payments--confirm-intent.mdx
@@ -0,0 +1,3 @@
+---
+openapi: post /v2/payments/{id}/confirm-intent
+---
\ No newline at end of file
diff --git a/api-reference-v2/api-reference/payments/payments--get-intent.mdx b/api-reference-v2/api-reference/payments/payments--get-intent.mdx
new file mode 100644
index 000000000000..cd1321be217e
--- /dev/null
+++ b/api-reference-v2/api-reference/payments/payments--get-intent.mdx
@@ -0,0 +1,3 @@
+---
+openapi: get /v2/payments/{id}/get-intent
+---
\ No newline at end of file
diff --git a/api-reference-v2/api-reference/refunds/refunds--create.mdx b/api-reference-v2/api-reference/refunds/refunds--create.mdx
new file mode 100644
index 000000000000..fa52f18c2867
--- /dev/null
+++ b/api-reference-v2/api-reference/refunds/refunds--create.mdx
@@ -0,0 +1,3 @@
+---
+openapi: post /v2/refunds
+---
\ No newline at end of file
diff --git a/api-reference-v2/mint.json b/api-reference-v2/mint.json
index 4d990aa5d40f..17dd6dfb7ffa 100644
--- a/api-reference-v2/mint.json
+++ b/api-reference-v2/mint.json
@@ -38,7 +38,9 @@
"group": "Payments",
"pages": [
"api-reference/payments/payments--create-intent",
- "api-reference/payments/payments--session-token"
+ "api-reference/payments/payments--get-intent",
+ "api-reference/payments/payments--session-token",
+ "api-reference/payments/payments--confirm-intent"
]
},
{
@@ -107,6 +109,12 @@
"api-reference/customers/customers--delete",
"api-reference/customers/customers--list"
]
+ },
+ {
+ "group": "Refunds",
+ "pages": [
+ "api-reference/refunds/refunds--create"
+ ]
}
],
"footerSocials": {
diff --git a/api-reference-v2/openapi_spec.json b/api-reference-v2/openapi_spec.json
index 41bda6be8543..4c1559fe099b 100644
--- a/api-reference-v2/openapi_spec.json
+++ b/api-reference-v2/openapi_spec.json
@@ -453,6 +453,20 @@
"summary": "Merchant Account - Create",
"description": "Create a new account for a *merchant* and the *merchant* could be a seller or retailer or client who likes to receive and send payments.\n\nBefore creating the merchant account, it is mandatory to create an organization.",
"operationId": "Create a Merchant Account",
+ "parameters": [
+ {
+ "name": "X-Organization-Id",
+ "in": "header",
+ "description": "Organization ID for which the merchant account has to be created.",
+ "required": true,
+ "schema": {
+ "type": "string"
+ },
+ "example": {
+ "X-Organization-Id": "org_abcdefghijklmnop"
+ }
+ }
+ ],
"requestBody": {
"content": {
"application/json": {
@@ -466,8 +480,7 @@
"primary_contact_person": "John Doe",
"primary_email": "example@company.com"
},
- "merchant_name": "Cloth Store",
- "organization_id": "org_abcdefghijklmnop"
+ "merchant_name": "Cloth Store"
}
},
"Create a merchant account with metadata": {
@@ -476,14 +489,12 @@
"metadata": {
"key_1": "John Doe",
"key_2": "Trends"
- },
- "organization_id": "org_abcdefghijklmnop"
+ }
}
},
"Create a merchant account with minimal fields": {
"value": {
- "merchant_name": "Cloth Store",
- "organization_id": "org_abcdefghijklmnop"
+ "merchant_name": "Cloth Store"
}
}
}
@@ -663,7 +674,7 @@
]
}
},
- "/v2/payments/{payment_id}/create_external_sdk_tokens": {
+ "/v2/payments/{payment_id}/create-external-sdk-tokens": {
"post": {
"tags": [
"Payments"
@@ -1832,7 +1843,170 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/PaymentsCreateIntentResponse"
+ "$ref": "#/components/schemas/PaymentsIntentResponse"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Missing Mandatory fields"
+ }
+ },
+ "security": [
+ {
+ "api_key": []
+ }
+ ]
+ }
+ },
+ "/v2/payments/{id}/get-intent": {
+ "get": {
+ "tags": [
+ "Payments"
+ ],
+ "summary": "Payments - Get Intent",
+ "description": "**Get a payment intent object when id is passed in path**\n\nYou will require the 'API - Key' from the Hyperswitch dashboard to make the call.",
+ "operationId": "Get the Payment Intent details",
+ "parameters": [
+ {
+ "name": "id",
+ "in": "path",
+ "description": "The unique identifier for the Payment Intent",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Payment Intent",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/PaymentsIntentResponse"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Payment Intent not found"
+ }
+ },
+ "security": [
+ {
+ "api_key": []
+ }
+ ]
+ }
+ },
+ "/v2/payments/{id}/confirm-intent": {
+ "post": {
+ "tags": [
+ "Payments"
+ ],
+ "summary": "Payments - Confirm Intent",
+ "description": "**Confirms a payment intent object with the payment method data**\n\n.",
+ "operationId": "Confirm Payment Intent",
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/PaymentsConfirmIntentRequest"
+ },
+ "examples": {
+ "Confirm the payment intent with card details": {
+ "value": {
+ "payment_method_data": {
+ "card": {
+ "card_cvc": "123",
+ "card_exp_month": "10",
+ "card_exp_year": "25",
+ "card_holder_name": "joseph Doe",
+ "card_number": "4242424242424242"
+ }
+ },
+ "payment_method_type": "card"
+ }
+ }
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "200": {
+ "description": "Payment created",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/PaymentsConfirmIntentResponse"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Missing Mandatory fields"
+ }
+ },
+ "security": [
+ {
+ "publisable_key": []
+ }
+ ]
+ }
+ },
+ "/v2/refunds": {
+ "post": {
+ "tags": [
+ "Refunds"
+ ],
+ "summary": "Refunds - Create",
+ "description": "Creates a refund against an already processed payment. In case of some processors, you can even opt to refund only a partial amount multiple times until the original charge amount has been refunded",
+ "operationId": "Create a Refund",
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/RefundsCreateRequest"
+ },
+ "examples": {
+ "Create an instant refund to refund partial amount": {
+ "value": {
+ "amount": 654,
+ "merchant_reference_id": "ref_123",
+ "payment_id": "{{payment_id}}",
+ "refund_type": "instant"
+ }
+ },
+ "Create an instant refund to refund the whole amount": {
+ "value": {
+ "merchant_reference_id": "ref_123",
+ "payment_id": "{{payment_id}}",
+ "refund_type": "instant"
+ }
+ },
+ "Create an instant refund with reason": {
+ "value": {
+ "amount": 6540,
+ "merchant_reference_id": "ref_123",
+ "payment_id": "{{payment_id}}",
+ "reason": "Customer returned product",
+ "refund_type": "instant"
+ }
+ }
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "200": {
+ "description": "Refund created",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/RefundResponse"
}
}
}
@@ -2406,6 +2580,65 @@
}
}
},
+ "AmountDetailsResponse": {
+ "type": "object",
+ "required": [
+ "order_amount",
+ "currency",
+ "skip_external_tax_calculation",
+ "skip_surcharge_calculation"
+ ],
+ "properties": {
+ "order_amount": {
+ "type": "integer",
+ "format": "int64",
+ "description": "The payment amount. Amount for the payment in the lowest denomination of the currency, (i.e) in cents for USD denomination, in yen for JPY denomination etc. E.g., Pass 100 to charge $1.00 and 1 for 1¥ since ¥ is a zero-decimal currency. Read more about [the Decimal and Non-Decimal Currencies](https://github.com/juspay/hyperswitch/wiki/Decimal-and-Non%E2%80%90Decimal-Currencies)",
+ "example": 6540,
+ "minimum": 0
+ },
+ "currency": {
+ "$ref": "#/components/schemas/Currency"
+ },
+ "shipping_cost": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/MinorUnit"
+ }
+ ],
+ "nullable": true
+ },
+ "order_tax_amount": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/MinorUnit"
+ }
+ ],
+ "nullable": true
+ },
+ "skip_external_tax_calculation": {
+ "$ref": "#/components/schemas/TaxCalculationOverride"
+ },
+ "skip_surcharge_calculation": {
+ "$ref": "#/components/schemas/SurchargeCalculationOverride"
+ },
+ "surcharge_amount": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/MinorUnit"
+ }
+ ],
+ "nullable": true
+ },
+ "tax_on_surcharge": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/MinorUnit"
+ }
+ ],
+ "nullable": true
+ }
+ }
+ },
"AmountFilter": {
"type": "object",
"properties": {
@@ -5419,76 +5652,158 @@
"greater_than_equal"
]
},
- "Connector": {
- "type": "string",
- "description": "A connector is an integration to fulfill payments",
- "enum": [
- "adyenplatform",
- "phonypay",
- "fauxpay",
- "pretendpay",
- "stripe_test",
- "adyen_test",
- "checkout_test",
- "paypal_test",
- "aci",
- "adyen",
- "airwallex",
- "authorizedotnet",
- "bambora",
- "bamboraapac",
- "bankofamerica",
- "billwerk",
- "bitpay",
- "bluesnap",
- "boku",
- "braintree",
- "cashtocode",
- "checkout",
- "coinbase",
- "cryptopay",
- "cybersource",
- "datatrans",
- "deutschebank",
- "dlocal",
- "ebanx",
- "fiserv",
- "fiservemea",
- "fiuu",
- "forte",
- "globalpay",
- "globepay",
- "gocardless",
- "gpayments",
- "helcim",
- "iatapay",
- "itaubank",
- "klarna",
- "mifinity",
- "mollie",
- "multisafepay",
- "netcetera",
- "nexinets",
- "nexixpay",
- "nmi",
- "noon",
- "novalnet",
- "nuvei",
- "opennode",
- "paybox",
- "payme",
- "payone",
- "paypal",
- "payu",
- "placetopay",
- "powertranz",
- "prophetpay",
- "rapyd",
- "razorpay",
- "shift4",
- "square",
- "stax",
- "stripe",
+ "ConfirmIntentAmountDetailsResponse": {
+ "type": "object",
+ "required": [
+ "currency",
+ "skip_external_tax_calculation",
+ "skip_surcharge_calculation",
+ "net_amount",
+ "amount_capturable"
+ ],
+ "properties": {
+ "order_amount": {
+ "type": "integer",
+ "format": "int64",
+ "description": "The payment amount. Amount for the payment in the lowest denomination of the currency, (i.e) in cents for USD denomination, in yen for JPY denomination etc. E.g., Pass 100 to charge $1.00 and 1 for 1¥ since ¥ is a zero-decimal currency. Read more about [the Decimal and Non-Decimal Currencies](https://github.com/juspay/hyperswitch/wiki/Decimal-and-Non%E2%80%90Decimal-Currencies)",
+ "example": 6540,
+ "minimum": 0
+ },
+ "currency": {
+ "$ref": "#/components/schemas/Currency"
+ },
+ "shipping_cost": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/MinorUnit"
+ }
+ ],
+ "nullable": true
+ },
+ "order_tax_amount": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/MinorUnit"
+ }
+ ],
+ "nullable": true
+ },
+ "skip_external_tax_calculation": {
+ "$ref": "#/components/schemas/TaxCalculationOverride"
+ },
+ "skip_surcharge_calculation": {
+ "$ref": "#/components/schemas/SurchargeCalculationOverride"
+ },
+ "surcharge_amount": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/MinorUnit"
+ }
+ ],
+ "nullable": true
+ },
+ "tax_on_surcharge": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/MinorUnit"
+ }
+ ],
+ "nullable": true
+ },
+ "net_amount": {
+ "$ref": "#/components/schemas/MinorUnit"
+ },
+ "amount_to_capture": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/MinorUnit"
+ }
+ ],
+ "nullable": true
+ },
+ "amount_capturable": {
+ "$ref": "#/components/schemas/MinorUnit"
+ },
+ "amount_captured": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/MinorUnit"
+ }
+ ],
+ "nullable": true
+ }
+ }
+ },
+ "Connector": {
+ "type": "string",
+ "description": "A connector is an integration to fulfill payments",
+ "enum": [
+ "adyenplatform",
+ "phonypay",
+ "fauxpay",
+ "pretendpay",
+ "stripe_test",
+ "adyen_test",
+ "checkout_test",
+ "paypal_test",
+ "aci",
+ "adyen",
+ "airwallex",
+ "authorizedotnet",
+ "bambora",
+ "bamboraapac",
+ "bankofamerica",
+ "billwerk",
+ "bitpay",
+ "bluesnap",
+ "boku",
+ "braintree",
+ "cashtocode",
+ "checkout",
+ "coinbase",
+ "cryptopay",
+ "cybersource",
+ "datatrans",
+ "deutschebank",
+ "dlocal",
+ "ebanx",
+ "fiserv",
+ "fiservemea",
+ "fiuu",
+ "forte",
+ "globalpay",
+ "globepay",
+ "gocardless",
+ "gpayments",
+ "helcim",
+ "iatapay",
+ "itaubank",
+ "klarna",
+ "mifinity",
+ "mollie",
+ "multisafepay",
+ "netcetera",
+ "nexinets",
+ "nexixpay",
+ "nmi",
+ "noon",
+ "novalnet",
+ "nuvei",
+ "opennode",
+ "paybox",
+ "payme",
+ "payone",
+ "paypal",
+ "payu",
+ "placetopay",
+ "powertranz",
+ "prophetpay",
+ "rapyd",
+ "razorpay",
+ "shift4",
+ "square",
+ "stax",
+ "stripe",
"taxjar",
"threedsecureio",
"trustpay",
@@ -7035,6 +7350,34 @@
}
}
},
+ "ErrorDetails": {
+ "type": "object",
+ "description": "Error details for the payment",
+ "required": [
+ "code",
+ "message"
+ ],
+ "properties": {
+ "code": {
+ "type": "string",
+ "description": "The error code"
+ },
+ "message": {
+ "type": "string",
+ "description": "The error message"
+ },
+ "unified_code": {
+ "type": "string",
+ "description": "The unified error code across all connectors.\nThis can be relied upon for taking decisions based on the error.",
+ "nullable": true
+ },
+ "unified_message": {
+ "type": "string",
+ "description": "The unified error message across all connectors.\nIf there is a translation available, this will have the translated message",
+ "nullable": true
+ }
+ }
+ },
"EventClass": {
"type": "string",
"enum": [
@@ -9094,8 +9437,7 @@
"MerchantAccountCreate": {
"type": "object",
"required": [
- "merchant_name",
- "organization_id"
+ "merchant_name"
],
"properties": {
"merchant_name": {
@@ -9116,13 +9458,6 @@
"type": "object",
"description": "Metadata is useful for storing additional, unstructured information about the merchant account.",
"nullable": true
- },
- "organization_id": {
- "type": "string",
- "description": "The id of the organization to which the merchant belongs to. Please use the organization endpoint to create an organization",
- "example": "org_q98uSGAYbjEwqs0mJwnz",
- "maxLength": 64,
- "minLength": 1
}
},
"additionalProperties": false
@@ -10683,9 +11018,7 @@
"minimum": 0
},
"amount": {
- "type": "integer",
- "format": "int64",
- "description": "the amount per quantity of product"
+ "$ref": "#/components/schemas/MinorUnit"
},
"requires_shipping": {
"type": "boolean",
@@ -12943,222 +13276,128 @@
}
}
},
- "PaymentsConfirmRequest": {
+ "PaymentsConfirmIntentRequest": {
"type": "object",
+ "description": "Request for Payment Intent Confirm",
+ "required": [
+ "payment_method_data",
+ "payment_method_type",
+ "payment_method_subtype"
+ ],
"properties": {
- "amount": {
- "type": "integer",
- "format": "int64",
- "description": "The payment amount. Amount for the payment in the lowest denomination of the currency, (i.e) in cents for USD denomination, in yen for JPY denomination etc. E.g., Pass 100 to charge $1.00 and 1 for 1¥ since ¥ is a zero-decimal currency. Read more about [the Decimal and Non-Decimal Currencies](https://github.com/juspay/hyperswitch/wiki/Decimal-and-Non%E2%80%90Decimal-Currencies)",
- "example": 6540,
- "nullable": true,
- "minimum": 0
- },
- "currency": {
- "allOf": [
- {
- "$ref": "#/components/schemas/Currency"
- }
- ],
- "nullable": true
- },
- "amount_to_capture": {
- "type": "integer",
- "format": "int64",
- "description": "The Amount to be captured / debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc., If not provided, the default amount_to_capture will be the payment amount. Also, it must be less than or equal to the original payment account.",
- "example": 6540,
- "nullable": true
- },
- "shipping_cost": {
- "type": "integer",
- "format": "int64",
- "description": "The shipping cost for the payment. This is required for tax calculation in some regions.",
- "example": 6540,
+ "return_url": {
+ "type": "string",
+ "description": "The URL to which you want the user to be redirected after the completion of the payment operation\nIf this url is not passed, the url configured in the business profile will be used",
+ "example": "https://hyperswitch.io",
"nullable": true
},
- "payment_id": {
- "type": "string",
- "description": "Unique identifier for the payment. This ensures idempotency for multiple payments\nthat have been done by a single merchant. The value for this field can be specified in the request, it will be auto generated otherwise and returned in the API response.",
- "example": "pay_mbabizu24mvu3mela5njyhpit4",
- "nullable": true,
- "maxLength": 30,
- "minLength": 30
+ "payment_method_data": {
+ "$ref": "#/components/schemas/PaymentMethodDataRequest"
},
- "routing": {
- "allOf": [
- {
- "$ref": "#/components/schemas/StraightThroughAlgorithm"
- }
- ],
- "nullable": true
+ "payment_method_type": {
+ "$ref": "#/components/schemas/PaymentMethod"
},
- "connector": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Connector"
- },
- "description": "This allows to manually select a connector with which the payment can go through.",
- "example": [
- "stripe",
- "adyen"
- ],
- "nullable": true
+ "payment_method_subtype": {
+ "$ref": "#/components/schemas/PaymentMethodType"
},
- "capture_method": {
+ "shipping": {
"allOf": [
{
- "$ref": "#/components/schemas/CaptureMethod"
+ "$ref": "#/components/schemas/Address"
}
],
"nullable": true
},
- "authentication_type": {
+ "customer_acceptance": {
"allOf": [
{
- "$ref": "#/components/schemas/AuthenticationType"
+ "$ref": "#/components/schemas/CustomerAcceptance"
}
],
- "default": "three_ds",
"nullable": true
},
- "billing": {
+ "browser_info": {
"allOf": [
{
- "$ref": "#/components/schemas/Address"
+ "$ref": "#/components/schemas/BrowserInformation"
}
],
"nullable": true
- },
- "confirm": {
- "type": "boolean",
- "description": "Whether to confirm the payment (if applicable). It can be used to completely process a payment by attaching a payment method, setting `confirm=true` and `capture_method = automatic` in the *Payments/Create API* request itself.",
- "default": false,
- "example": true,
- "nullable": true
- },
- "customer": {
- "allOf": [
- {
- "$ref": "#/components/schemas/CustomerDetails"
- }
- ],
- "nullable": true
- },
- "customer_id": {
+ }
+ }
+ },
+ "PaymentsConfirmIntentResponse": {
+ "type": "object",
+ "description": "Response for Payment Intent Confirm",
+ "required": [
+ "id",
+ "status",
+ "amount",
+ "connector",
+ "client_secret",
+ "created",
+ "payment_method_type",
+ "payment_method_subtype",
+ "merchant_connector_id"
+ ],
+ "properties": {
+ "id": {
"type": "string",
- "description": "The identifier for the customer",
- "example": "cus_y3oqhf46pyzuxjbcn2giaqnb44",
- "nullable": true,
+ "description": "Unique identifier for the payment. This ensures idempotency for multiple payments\nthat have been done by a single merchant.",
+ "example": "12345_pay_01926c58bc6e77c09e809964e72af8c8",
"maxLength": 64,
- "minLength": 1
+ "minLength": 32
},
- "off_session": {
- "type": "boolean",
- "description": "Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. When making a recurring payment by passing a mandate_id, this parameter is mandatory",
- "example": true,
- "nullable": true
+ "status": {
+ "$ref": "#/components/schemas/IntentStatus"
},
- "description": {
+ "amount": {
+ "$ref": "#/components/schemas/ConfirmIntentAmountDetailsResponse"
+ },
+ "connector": {
"type": "string",
- "description": "A description for the payment",
- "example": "It's my first payment request",
- "nullable": true
+ "description": "The connector used for the payment",
+ "example": "stripe"
},
- "return_url": {
+ "client_secret": {
"type": "string",
- "description": "The URL to which you want the user to be redirected after the completion of the payment operation",
- "example": "https://hyperswitch.io",
- "nullable": true
+ "description": "It's a token used for client side verification."
},
- "setup_future_usage": {
- "allOf": [
- {
- "$ref": "#/components/schemas/FutureUsage"
- }
- ],
- "nullable": true
+ "created": {
+ "type": "string",
+ "format": "date-time",
+ "description": "Time when the payment was created",
+ "example": "2022-09-10T10:11:12Z"
},
"payment_method_data": {
"allOf": [
{
- "$ref": "#/components/schemas/PaymentMethodDataRequest"
- }
- ],
- "nullable": true
- },
- "payment_method": {
- "allOf": [
- {
- "$ref": "#/components/schemas/PaymentMethod"
+ "$ref": "#/components/schemas/PaymentMethodDataResponseWithBilling"
}
],
"nullable": true
},
- "payment_token": {
- "type": "string",
- "description": "As Hyperswitch tokenises the sensitive details about the payments method, it provides the payment_token as a reference to a stored payment method, ensuring that the sensitive details are not exposed in any manner.",
- "example": "187282ab-40ef-47a9-9206-5099ba31e432",
- "nullable": true
- },
- "shipping": {
- "allOf": [
- {
- "$ref": "#/components/schemas/Address"
- }
- ],
- "nullable": true
+ "payment_method_type": {
+ "$ref": "#/components/schemas/PaymentMethod"
},
- "statement_descriptor_name": {
- "type": "string",
- "description": "For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.",
- "example": "Hyperswitch Router",
- "nullable": true,
- "maxLength": 255
+ "payment_method_subtype": {
+ "$ref": "#/components/schemas/PaymentMethodType"
},
- "statement_descriptor_suffix": {
+ "connector_transaction_id": {
"type": "string",
- "description": "Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.",
- "example": "Payment for shoes purchase",
- "nullable": true,
- "maxLength": 255
- },
- "order_details": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OrderDetailsWithAmount"
- },
- "description": "Use this object to capture the details about the different products for which the payment is being made. The sum of amount across different products here should be equal to the overall payment amount",
- "example": "[{\n \"product_name\": \"Apple iPhone 16\",\n \"quantity\": 1,\n \"amount\" : 69000\n \"product_img_link\" : \"https://dummy-img-link.com\"\n }]",
+ "description": "A unique identifier for a payment provided by the connector",
+ "example": "993672945374576J",
"nullable": true
},
- "client_secret": {
+ "connector_reference_id": {
"type": "string",
- "description": "It's a token used for client side verification.",
- "example": "pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo",
- "nullable": true
- },
- "mandate_data": {
- "allOf": [
- {
- "$ref": "#/components/schemas/MandateData"
- }
- ],
- "nullable": true
- },
- "customer_acceptance": {
- "allOf": [
- {
- "$ref": "#/components/schemas/CustomerAcceptance"
- }
- ],
+ "description": "reference(Identifier) to the payment at connector side",
+ "example": "993672945374576J",
"nullable": true
},
- "mandate_id": {
+ "merchant_connector_id": {
"type": "string",
- "description": "A unique identifier to link the payment to a mandate. To do Recurring payments after a mandate has been created, pass the mandate_id instead of payment_method_data",
- "example": "mandate_iwer89rnjef349dni3",
- "nullable": true,
- "maxLength": 255
+ "description": "Identifier of the connector ( merchant connector account ) which was chosen to make the payment"
},
"browser_info": {
"allOf": [
@@ -13168,138 +13407,13 @@
],
"nullable": true
},
- "payment_experience": {
- "allOf": [
- {
- "$ref": "#/components/schemas/PaymentExperience"
- }
- ],
- "nullable": true
- },
- "payment_method_type": {
- "allOf": [
- {
- "$ref": "#/components/schemas/PaymentMethodType"
- }
- ],
- "nullable": true
- },
- "merchant_connector_details": {
- "allOf": [
- {
- "$ref": "#/components/schemas/MerchantConnectorDetailsWrap"
- }
- ],
- "nullable": true
- },
- "allowed_payment_method_types": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/PaymentMethodType"
- },
- "description": "Use this parameter to restrict the Payment Method Types to show for a given PaymentIntent",
- "nullable": true
- },
- "retry_action": {
- "allOf": [
- {
- "$ref": "#/components/schemas/RetryAction"
- }
- ],
- "nullable": true
- },
- "metadata": {
- "type": "object",
- "description": "You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.",
- "nullable": true
- },
- "connector_metadata": {
- "allOf": [
- {
- "$ref": "#/components/schemas/ConnectorMetadata"
- }
- ],
- "nullable": true
- },
- "payment_link": {
- "type": "boolean",
- "description": "Whether to generate the payment link for this payment or not (if applicable)",
- "default": false,
- "example": true,
- "nullable": true
- },
- "payment_link_config": {
- "allOf": [
- {
- "$ref": "#/components/schemas/PaymentCreatePaymentLinkConfig"
- }
- ],
- "nullable": true
- },
- "payment_link_config_id": {
- "type": "string",
- "description": "Custom payment link config id set at business profile, send only if business_specific_configs is configured",
- "nullable": true
- },
- "payment_type": {
- "allOf": [
- {
- "$ref": "#/components/schemas/PaymentType"
- }
- ],
- "nullable": true
- },
- "request_incremental_authorization": {
- "type": "boolean",
- "description": "Request an incremental authorization, i.e., increase the authorized amount on a confirmed payment before you capture it.",
- "nullable": true
- },
- "session_expiry": {
- "type": "integer",
- "format": "int32",
- "description": "Will be used to expire client secret after certain amount of time to be supplied in seconds\n(900) for 15 mins",
- "example": 900,
- "nullable": true,
- "minimum": 0
- },
- "frm_metadata": {
- "type": "object",
- "description": "Additional data related to some frm(Fraud Risk Management) connectors",
- "nullable": true
- },
- "request_external_three_ds_authentication": {
- "type": "boolean",
- "description": "Whether to perform external authentication (if applicable)",
- "example": true,
- "nullable": true
- },
- "recurring_details": {
- "allOf": [
- {
- "$ref": "#/components/schemas/RecurringDetails"
- }
- ],
- "nullable": true
- },
- "charges": {
+ "error": {
"allOf": [
{
- "$ref": "#/components/schemas/PaymentChargeRequest"
+ "$ref": "#/components/schemas/ErrorDetails"
}
],
"nullable": true
- },
- "merchant_order_reference_id": {
- "type": "string",
- "description": "Merchant's identifier for the payment/invoice. This will be sent to the connector\nif the connector provides support to accept multiple reference ids.\nIn case the connector supports only one reference id, Hyperswitch's Payment ID will be sent as reference.",
- "example": "Custom_Order_id_123",
- "nullable": true,
- "maxLength": 255
- },
- "skip_external_tax_calculation": {
- "type": "boolean",
- "description": "Whether to calculate tax for this payment intent",
- "nullable": true
}
}
},
@@ -13495,339 +13609,259 @@
},
"additionalProperties": false
},
- "PaymentsCreateIntentResponse": {
+ "PaymentsCreateResponseOpenApi": {
"type": "object",
"required": [
- "id",
- "amount_details",
- "client_secret",
- "capture_method",
- "authentication_type",
- "customer_present",
- "setup_future_usage",
- "apply_mit_exemption",
- "payment_link_enabled",
- "request_incremental_authorization",
- "expires_on",
- "request_external_three_ds_authentication"
+ "payment_id",
+ "merchant_id",
+ "status",
+ "amount",
+ "net_amount",
+ "amount_capturable",
+ "currency",
+ "payment_method",
+ "attempt_count"
],
"properties": {
- "id": {
- "type": "string",
- "description": "Global Payment Id for the payment"
- },
- "amount_details": {
- "$ref": "#/components/schemas/AmountDetails"
- },
- "client_secret": {
- "type": "string",
- "description": "It's a token used for client side verification.",
- "example": "pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo"
- },
- "merchant_reference_id": {
+ "payment_id": {
"type": "string",
"description": "Unique identifier for the payment. This ensures idempotency for multiple payments\nthat have been done by a single merchant.",
"example": "pay_mbabizu24mvu3mela5njyhpit4",
- "nullable": true,
"maxLength": 30,
"minLength": 30
},
- "routing_algorithm_id": {
+ "merchant_id": {
"type": "string",
- "description": "The routing algorithm id to be used for the payment",
- "nullable": true
- },
- "capture_method": {
- "$ref": "#/components/schemas/CaptureMethod"
+ "description": "This is an identifier for the merchant account. This is inferred from the API key\nprovided during the request",
+ "example": "merchant_1668273825",
+ "maxLength": 255
},
- "authentication_type": {
+ "status": {
"allOf": [
{
- "$ref": "#/components/schemas/AuthenticationType"
+ "$ref": "#/components/schemas/IntentStatus"
}
],
- "default": "no_three_ds"
+ "default": "requires_confirmation"
},
- "billing": {
- "allOf": [
- {
- "$ref": "#/components/schemas/Address"
- }
- ],
+ "amount": {
+ "type": "integer",
+ "format": "int64",
+ "description": "The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,",
+ "example": 6540
+ },
+ "net_amount": {
+ "type": "integer",
+ "format": "int64",
+ "description": "The payment net amount. net_amount = amount + surcharge_details.surcharge_amount + surcharge_details.tax_amount + shipping_cost + order_tax_amount,\nIf no surcharge_details, shipping_cost, order_tax_amount, net_amount = amount",
+ "example": 6540
+ },
+ "shipping_cost": {
+ "type": "integer",
+ "format": "int64",
+ "description": "The shipping cost for the payment.",
+ "example": 6540,
"nullable": true
},
- "shipping": {
- "allOf": [
- {
- "$ref": "#/components/schemas/Address"
- }
- ],
+ "amount_capturable": {
+ "type": "integer",
+ "format": "int64",
+ "description": "The maximum amount that could be captured from the payment",
+ "example": 6540,
+ "minimum": 100
+ },
+ "amount_received": {
+ "type": "integer",
+ "format": "int64",
+ "description": "The amount which is already captured from the payment, this helps in the cases where merchants can't capture all capturable amount at once.",
+ "example": 6540,
+ "nullable": true
+ },
+ "connector": {
+ "type": "string",
+ "description": "The connector used for the payment",
+ "example": "stripe",
+ "nullable": true
+ },
+ "client_secret": {
+ "type": "string",
+ "description": "It's a token used for client side verification.",
+ "example": "pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo",
+ "nullable": true
+ },
+ "created": {
+ "type": "string",
+ "format": "date-time",
+ "description": "Time when the payment was created",
+ "example": "2022-09-10T10:11:12Z",
"nullable": true
},
+ "currency": {
+ "$ref": "#/components/schemas/Currency"
+ },
"customer_id": {
"type": "string",
- "description": "The identifier for the customer",
+ "description": "The identifier for the customer object. If not provided the customer ID will be autogenerated.\nThis field will be deprecated soon. Please refer to `customer.id`",
+ "deprecated": true,
"example": "cus_y3oqhf46pyzuxjbcn2giaqnb44",
"nullable": true,
"maxLength": 64,
"minLength": 1
},
- "customer_present": {
- "$ref": "#/components/schemas/PresenceOfCustomerDuringPayment"
- },
"description": {
"type": "string",
- "description": "A description for the payment",
+ "description": "A description of the payment",
"example": "It's my first payment request",
"nullable": true
},
- "return_url": {
- "type": "string",
- "description": "The URL to which you want the user to be redirected after the completion of the payment operation",
- "example": "https://hyperswitch.io",
+ "refunds": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/RefundResponse"
+ },
+ "description": "List of refunds that happened on this intent, as same payment intent can have multiple refund requests depending on the nature of order",
"nullable": true
},
- "setup_future_usage": {
- "$ref": "#/components/schemas/FutureUsage"
- },
- "apply_mit_exemption": {
- "$ref": "#/components/schemas/MitExemptionRequest"
- },
- "statement_descriptor": {
- "type": "string",
- "description": "For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.",
- "example": "Hyperswitch Router",
- "nullable": true,
- "maxLength": 22
- },
- "order_details": {
+ "disputes": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OrderDetailsWithAmount"
+ "$ref": "#/components/schemas/DisputeResponsePaymentsRetrieve"
},
- "description": "Use this object to capture the details about the different products for which the payment is being made. The sum of amount across different products here should be equal to the overall payment amount",
- "example": "[{\n \"product_name\": \"Apple iPhone 16\",\n \"quantity\": 1,\n \"amount\" : 69000\n \"product_img_link\" : \"https://dummy-img-link.com\"\n }]",
+ "description": "List of disputes that happened on this intent",
"nullable": true
},
- "allowed_payment_method_types": {
+ "attempts": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/PaymentMethodType"
+ "$ref": "#/components/schemas/PaymentAttemptResponse"
},
- "description": "Use this parameter to restrict the Payment Method Types to show for a given PaymentIntent",
+ "description": "List of attempts that happened on this intent",
"nullable": true
},
- "metadata": {
- "type": "object",
- "description": "Metadata is useful for storing additional, unstructured information on an object.",
+ "captures": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/CaptureResponse"
+ },
+ "description": "List of captures done on latest attempt",
"nullable": true
},
- "connector_metadata": {
+ "mandate_id": {
+ "type": "string",
+ "description": "A unique identifier to link the payment to a mandate, can be used instead of payment_method_data, in case of setting up recurring payments",
+ "example": "mandate_iwer89rnjef349dni3",
+ "nullable": true,
+ "maxLength": 255
+ },
+ "mandate_data": {
"allOf": [
{
- "$ref": "#/components/schemas/ConnectorMetadata"
+ "$ref": "#/components/schemas/MandateData"
}
],
"nullable": true
},
- "feature_metadata": {
+ "setup_future_usage": {
"allOf": [
{
- "$ref": "#/components/schemas/FeatureMetadata"
+ "$ref": "#/components/schemas/FutureUsage"
}
],
"nullable": true
},
- "payment_link_enabled": {
- "$ref": "#/components/schemas/EnablePaymentLinkRequest"
+ "off_session": {
+ "type": "boolean",
+ "description": "Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.",
+ "example": true,
+ "nullable": true
},
- "payment_link_config": {
+ "capture_method": {
"allOf": [
{
- "$ref": "#/components/schemas/PaymentLinkConfigRequest"
+ "$ref": "#/components/schemas/CaptureMethod"
}
],
"nullable": true
},
- "request_incremental_authorization": {
- "$ref": "#/components/schemas/RequestIncrementalAuthorization"
- },
- "expires_on": {
- "type": "string",
- "format": "date-time",
- "description": "Will be used to expire client secret after certain amount of time to be supplied in seconds"
+ "payment_method": {
+ "$ref": "#/components/schemas/PaymentMethod"
},
- "frm_metadata": {
- "type": "object",
- "description": "Additional data related to some frm(Fraud Risk Management) connectors",
+ "payment_method_data": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/PaymentMethodDataResponseWithBilling"
+ }
+ ],
"nullable": true
},
- "request_external_three_ds_authentication": {
- "$ref": "#/components/schemas/External3dsAuthenticationRequest"
- }
- },
- "additionalProperties": false
- },
- "PaymentsCreateRequest": {
- "type": "object",
- "required": [
- "amount",
- "currency"
- ],
- "properties": {
- "amount": {
- "type": "integer",
- "format": "int64",
- "description": "The payment amount. Amount for the payment in the lowest denomination of the currency, (i.e) in cents for USD denomination, in yen for JPY denomination etc. E.g., Pass 100 to charge $1.00 and 1 for 1¥ since ¥ is a zero-decimal currency. Read more about [the Decimal and Non-Decimal Currencies](https://github.com/juspay/hyperswitch/wiki/Decimal-and-Non%E2%80%90Decimal-Currencies)",
- "minimum": 0
- },
- "currency": {
- "$ref": "#/components/schemas/Currency"
- },
- "amount_to_capture": {
- "type": "integer",
- "format": "int64",
- "description": "The Amount to be captured / debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc., If not provided, the default amount_to_capture will be the payment amount. Also, it must be less than or equal to the original payment account.",
- "example": 6540,
+ "payment_token": {
+ "type": "string",
+ "description": "Provide a reference to a stored payment method",
+ "example": "187282ab-40ef-47a9-9206-5099ba31e432",
"nullable": true
},
- "shipping_cost": {
- "type": "integer",
- "format": "int64",
- "description": "The shipping cost for the payment. This is required for tax calculation in some regions.",
- "example": 6540,
+ "shipping": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Address"
+ }
+ ],
"nullable": true
},
- "payment_id": {
- "type": "string",
- "description": "Unique identifier for the payment. This ensures idempotency for multiple payments\nthat have been done by a single merchant. The value for this field can be specified in the request, it will be auto generated otherwise and returned in the API response.",
- "example": "pay_mbabizu24mvu3mela5njyhpit4",
- "nullable": true,
- "maxLength": 30,
- "minLength": 30
- },
- "routing": {
+ "billing": {
"allOf": [
{
- "$ref": "#/components/schemas/StraightThroughAlgorithm"
+ "$ref": "#/components/schemas/Address"
}
],
"nullable": true
},
- "connector": {
+ "order_details": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/Connector"
+ "$ref": "#/components/schemas/OrderDetailsWithAmount"
},
- "description": "This allows to manually select a connector with which the payment can go through.",
- "example": [
- "stripe",
- "adyen"
- ],
- "nullable": true
- },
- "capture_method": {
- "allOf": [
- {
- "$ref": "#/components/schemas/CaptureMethod"
- }
- ],
- "nullable": true
- },
- "authentication_type": {
- "allOf": [
- {
- "$ref": "#/components/schemas/AuthenticationType"
- }
- ],
- "default": "three_ds",
- "nullable": true
- },
- "billing": {
- "allOf": [
- {
- "$ref": "#/components/schemas/Address"
- }
- ],
- "nullable": true
- },
- "confirm": {
- "type": "boolean",
- "description": "Whether to confirm the payment (if applicable). It can be used to completely process a payment by attaching a payment method, setting `confirm=true` and `capture_method = automatic` in the *Payments/Create API* request itself.",
- "default": false,
- "example": true,
- "nullable": true
- },
- "customer": {
- "allOf": [
- {
- "$ref": "#/components/schemas/CustomerDetails"
- }
- ],
+ "description": "Information about the product , quantity and amount for connectors. (e.g. Klarna)",
+ "example": "[{\n \"product_name\": \"gillete creme\",\n \"quantity\": 15,\n \"amount\" : 900\n }]",
"nullable": true
},
- "customer_id": {
+ "email": {
"type": "string",
- "description": "The identifier for the customer",
- "example": "cus_y3oqhf46pyzuxjbcn2giaqnb44",
+ "description": "description: The customer's email address\nThis field will be deprecated soon. Please refer to `customer.email` object",
+ "deprecated": true,
+ "example": "johntest@test.com",
"nullable": true,
- "maxLength": 64,
- "minLength": 1
+ "maxLength": 255
},
- "off_session": {
- "type": "boolean",
- "description": "Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. When making a recurring payment by passing a mandate_id, this parameter is mandatory",
- "example": true,
- "nullable": true
+ "name": {
+ "type": "string",
+ "description": "description: The customer's name\nThis field will be deprecated soon. Please refer to `customer.name` object",
+ "deprecated": true,
+ "example": "John Test",
+ "nullable": true,
+ "maxLength": 255
},
- "description": {
+ "phone": {
"type": "string",
- "description": "A description for the payment",
- "example": "It's my first payment request",
- "nullable": true
+ "description": "The customer's phone number\nThis field will be deprecated soon. Please refer to `customer.phone` object",
+ "deprecated": true,
+ "example": "9123456789",
+ "nullable": true,
+ "maxLength": 255
},
"return_url": {
"type": "string",
- "description": "The URL to which you want the user to be redirected after the completion of the payment operation",
+ "description": "The URL to redirect after the completion of the operation",
"example": "https://hyperswitch.io",
"nullable": true
},
- "setup_future_usage": {
- "allOf": [
- {
- "$ref": "#/components/schemas/FutureUsage"
- }
- ],
- "nullable": true
- },
- "payment_method_data": {
- "allOf": [
- {
- "$ref": "#/components/schemas/PaymentMethodDataRequest"
- }
- ],
- "nullable": true
- },
- "payment_method": {
- "allOf": [
- {
- "$ref": "#/components/schemas/PaymentMethod"
- }
- ],
- "nullable": true
- },
- "payment_token": {
- "type": "string",
- "description": "As Hyperswitch tokenises the sensitive details about the payments method, it provides the payment_token as a reference to a stored payment method, ensuring that the sensitive details are not exposed in any manner.",
- "example": "187282ab-40ef-47a9-9206-5099ba31e432",
- "nullable": true
- },
- "shipping": {
+ "authentication_type": {
"allOf": [
{
- "$ref": "#/components/schemas/Address"
+ "$ref": "#/components/schemas/AuthenticationType"
}
],
+ "default": "three_ds",
"nullable": true
},
"statement_descriptor_name": {
@@ -13839,49 +13873,34 @@
},
"statement_descriptor_suffix": {
"type": "string",
- "description": "Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.",
+ "description": "Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 255 characters for the concatenated descriptor.",
"example": "Payment for shoes purchase",
"nullable": true,
"maxLength": 255
},
- "order_details": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OrderDetailsWithAmount"
- },
- "description": "Use this object to capture the details about the different products for which the payment is being made. The sum of amount across different products here should be equal to the overall payment amount",
- "example": "[{\n \"product_name\": \"Apple iPhone 16\",\n \"quantity\": 1,\n \"amount\" : 69000\n \"product_img_link\" : \"https://dummy-img-link.com\"\n }]",
- "nullable": true
- },
- "mandate_data": {
+ "next_action": {
"allOf": [
{
- "$ref": "#/components/schemas/MandateData"
+ "$ref": "#/components/schemas/NextActionData"
}
],
"nullable": true
},
- "customer_acceptance": {
- "allOf": [
- {
- "$ref": "#/components/schemas/CustomerAcceptance"
- }
- ],
+ "cancellation_reason": {
+ "type": "string",
+ "description": "If the payment was cancelled the reason will be provided here",
"nullable": true
},
- "mandate_id": {
+ "error_code": {
"type": "string",
- "description": "A unique identifier to link the payment to a mandate. To do Recurring payments after a mandate has been created, pass the mandate_id instead of payment_method_data",
- "example": "mandate_iwer89rnjef349dni3",
- "nullable": true,
- "maxLength": 255
+ "description": "If there was an error while calling the connectors the code is received here",
+ "example": "E0001",
+ "nullable": true
},
- "browser_info": {
- "allOf": [
- {
- "$ref": "#/components/schemas/BrowserInformation"
- }
- ],
+ "error_message": {
+ "type": "string",
+ "description": "If there was an error while calling the connector the error message is received here",
+ "example": "Failed while verifying the card",
"nullable": true
},
"payment_experience": {
@@ -13900,6 +13919,12 @@
],
"nullable": true
},
+ "connector_label": {
+ "type": "string",
+ "description": "The connector used for this payment along with the country and business details",
+ "example": "stripe_US_food",
+ "nullable": true
+ },
"business_country": {
"allOf": [
{
@@ -13910,16 +13935,12 @@
},
"business_label": {
"type": "string",
- "description": "Business label of the merchant for this payment.\nTo be deprecated soon. Pass the profile_id instead",
- "example": "food",
+ "description": "The business label of merchant for this payment",
"nullable": true
},
- "merchant_connector_details": {
- "allOf": [
- {
- "$ref": "#/components/schemas/MerchantConnectorDetailsWrap"
- }
- ],
+ "business_sub_label": {
+ "type": "string",
+ "description": "The business_sub_label for this payment",
"nullable": true
},
"allowed_payment_method_types": {
@@ -13927,1969 +13948,712 @@
"items": {
"$ref": "#/components/schemas/PaymentMethodType"
},
- "description": "Use this parameter to restrict the Payment Method Types to show for a given PaymentIntent",
- "nullable": true
- },
- "metadata": {
- "type": "object",
- "description": "You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.",
+ "description": "Allowed Payment Method Types for a given PaymentIntent",
"nullable": true
},
- "connector_metadata": {
+ "ephemeral_key": {
"allOf": [
{
- "$ref": "#/components/schemas/ConnectorMetadata"
+ "$ref": "#/components/schemas/EphemeralKeyCreateResponse"
}
],
"nullable": true
},
- "payment_link": {
+ "manual_retry_allowed": {
"type": "boolean",
- "description": "Whether to generate the payment link for this payment or not (if applicable)",
- "default": false,
- "example": true,
+ "description": "If true the payment can be retried with same or different payment method which means the confirm call can be made again.",
"nullable": true
},
- "payment_link_config": {
+ "connector_transaction_id": {
+ "type": "string",
+ "description": "A unique identifier for a payment provided by the connector",
+ "example": "993672945374576J",
+ "nullable": true
+ },
+ "frm_message": {
"allOf": [
{
- "$ref": "#/components/schemas/PaymentCreatePaymentLinkConfig"
+ "$ref": "#/components/schemas/FrmMessage"
}
],
"nullable": true
},
- "payment_link_config_id": {
- "type": "string",
- "description": "Custom payment link config id set at business profile, send only if business_specific_configs is configured",
- "nullable": true
- },
- "profile_id": {
- "type": "string",
- "description": "The business profile to be used for this payment, if not passed the default business profile associated with the merchant account will be used. It is mandatory in case multiple business profiles have been set up.",
+ "metadata": {
+ "type": "object",
+ "description": "You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.",
"nullable": true
},
- "surcharge_details": {
+ "connector_metadata": {
"allOf": [
{
- "$ref": "#/components/schemas/RequestSurchargeDetails"
+ "$ref": "#/components/schemas/ConnectorMetadata"
}
],
"nullable": true
},
- "payment_type": {
+ "feature_metadata": {
"allOf": [
{
- "$ref": "#/components/schemas/PaymentType"
+ "$ref": "#/components/schemas/FeatureMetadata"
}
],
"nullable": true
},
- "request_incremental_authorization": {
- "type": "boolean",
- "description": "Request an incremental authorization, i.e., increase the authorized amount on a confirmed payment before you capture it.",
- "nullable": true
- },
- "session_expiry": {
- "type": "integer",
- "format": "int32",
- "description": "Will be used to expire client secret after certain amount of time to be supplied in seconds\n(900) for 15 mins",
- "example": 900,
- "nullable": true,
- "minimum": 0
- },
- "frm_metadata": {
- "type": "object",
- "description": "Additional data related to some frm(Fraud Risk Management) connectors",
- "nullable": true
- },
- "request_external_three_ds_authentication": {
- "type": "boolean",
- "description": "Whether to perform external authentication (if applicable)",
- "example": true,
+ "reference_id": {
+ "type": "string",
+ "description": "reference(Identifier) to the payment at connector side",
+ "example": "993672945374576J",
"nullable": true
},
- "recurring_details": {
+ "payment_link": {
"allOf": [
{
- "$ref": "#/components/schemas/RecurringDetails"
+ "$ref": "#/components/schemas/PaymentLinkResponse"
}
],
"nullable": true
},
- "charges": {
+ "profile_id": {
+ "type": "string",
+ "description": "The business profile that is associated with this payment",
+ "nullable": true
+ },
+ "surcharge_details": {
"allOf": [
{
- "$ref": "#/components/schemas/PaymentChargeRequest"
+ "$ref": "#/components/schemas/RequestSurchargeDetails"
}
],
"nullable": true
},
- "merchant_order_reference_id": {
+ "attempt_count": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Total number of attempts associated with this payment"
+ },
+ "merchant_decision": {
"type": "string",
- "description": "Merchant's identifier for the payment/invoice. This will be sent to the connector\nif the connector provides support to accept multiple reference ids.\nIn case the connector supports only one reference id, Hyperswitch's Payment ID will be sent as reference.",
- "example": "Custom_Order_id_123",
- "nullable": true,
- "maxLength": 255
+ "description": "Denotes the action(approve or reject) taken by merchant in case of manual review. Manual review can occur when the transaction is marked as risky by the frm_processor, payment processor or when there is underpayment/over payment incase of crypto payment",
+ "nullable": true
},
- "skip_external_tax_calculation": {
- "type": "boolean",
- "description": "Whether to calculate tax for this payment intent",
- "nullable": true
- }
- }
- },
- "PaymentsCreateResponseOpenApi": {
- "type": "object",
- "required": [
- "payment_id",
- "merchant_id",
- "status",
- "amount",
- "net_amount",
- "amount_capturable",
- "currency",
- "payment_method",
- "attempt_count"
- ],
- "properties": {
- "payment_id": {
- "type": "string",
- "description": "Unique identifier for the payment. This ensures idempotency for multiple payments\nthat have been done by a single merchant.",
- "example": "pay_mbabizu24mvu3mela5njyhpit4",
- "maxLength": 30,
- "minLength": 30
- },
- "merchant_id": {
- "type": "string",
- "description": "This is an identifier for the merchant account. This is inferred from the API key\nprovided during the request",
- "example": "merchant_1668273825",
- "maxLength": 255
- },
- "status": {
- "allOf": [
- {
- "$ref": "#/components/schemas/IntentStatus"
- }
- ],
- "default": "requires_confirmation"
- },
- "amount": {
- "type": "integer",
- "format": "int64",
- "description": "The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,",
- "example": 6540
- },
- "net_amount": {
- "type": "integer",
- "format": "int64",
- "description": "The payment net amount. net_amount = amount + surcharge_details.surcharge_amount + surcharge_details.tax_amount + shipping_cost + order_tax_amount,\nIf no surcharge_details, shipping_cost, order_tax_amount, net_amount = amount",
- "example": 6540
- },
- "shipping_cost": {
- "type": "integer",
- "format": "int64",
- "description": "The shipping cost for the payment.",
- "example": 6540,
- "nullable": true
- },
- "amount_capturable": {
- "type": "integer",
- "format": "int64",
- "description": "The maximum amount that could be captured from the payment",
- "example": 6540,
- "minimum": 100
- },
- "amount_received": {
- "type": "integer",
- "format": "int64",
- "description": "The amount which is already captured from the payment, this helps in the cases where merchants can't capture all capturable amount at once.",
- "example": 6540,
- "nullable": true
- },
- "connector": {
- "type": "string",
- "description": "The connector used for the payment",
- "example": "stripe",
- "nullable": true
- },
- "client_secret": {
- "type": "string",
- "description": "It's a token used for client side verification.",
- "example": "pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo",
- "nullable": true
- },
- "created": {
- "type": "string",
- "format": "date-time",
- "description": "Time when the payment was created",
- "example": "2022-09-10T10:11:12Z",
- "nullable": true
- },
- "currency": {
- "$ref": "#/components/schemas/Currency"
- },
- "customer_id": {
- "type": "string",
- "description": "The identifier for the customer object. If not provided the customer ID will be autogenerated.\nThis field will be deprecated soon. Please refer to `customer.id`",
- "deprecated": true,
- "example": "cus_y3oqhf46pyzuxjbcn2giaqnb44",
- "nullable": true,
- "maxLength": 64,
- "minLength": 1
- },
- "description": {
- "type": "string",
- "description": "A description of the payment",
- "example": "It's my first payment request",
- "nullable": true
- },
- "refunds": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/RefundResponse"
- },
- "description": "List of refunds that happened on this intent, as same payment intent can have multiple refund requests depending on the nature of order",
- "nullable": true
- },
- "disputes": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/DisputeResponsePaymentsRetrieve"
- },
- "description": "List of disputes that happened on this intent",
- "nullable": true
- },
- "attempts": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/PaymentAttemptResponse"
- },
- "description": "List of attempts that happened on this intent",
- "nullable": true
- },
- "captures": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/CaptureResponse"
- },
- "description": "List of captures done on latest attempt",
- "nullable": true
- },
- "mandate_id": {
- "type": "string",
- "description": "A unique identifier to link the payment to a mandate, can be used instead of payment_method_data, in case of setting up recurring payments",
- "example": "mandate_iwer89rnjef349dni3",
- "nullable": true,
- "maxLength": 255
- },
- "mandate_data": {
- "allOf": [
- {
- "$ref": "#/components/schemas/MandateData"
- }
- ],
- "nullable": true
- },
- "setup_future_usage": {
- "allOf": [
- {
- "$ref": "#/components/schemas/FutureUsage"
- }
- ],
- "nullable": true
- },
- "off_session": {
- "type": "boolean",
- "description": "Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.",
- "example": true,
- "nullable": true
- },
- "capture_method": {
- "allOf": [
- {
- "$ref": "#/components/schemas/CaptureMethod"
- }
- ],
- "nullable": true
- },
- "payment_method": {
- "$ref": "#/components/schemas/PaymentMethod"
- },
- "payment_method_data": {
- "allOf": [
- {
- "$ref": "#/components/schemas/PaymentMethodDataResponseWithBilling"
- }
- ],
- "nullable": true
- },
- "payment_token": {
- "type": "string",
- "description": "Provide a reference to a stored payment method",
- "example": "187282ab-40ef-47a9-9206-5099ba31e432",
- "nullable": true
- },
- "shipping": {
- "allOf": [
- {
- "$ref": "#/components/schemas/Address"
- }
- ],
- "nullable": true
- },
- "billing": {
- "allOf": [
- {
- "$ref": "#/components/schemas/Address"
- }
- ],
- "nullable": true
- },
- "order_details": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OrderDetailsWithAmount"
- },
- "description": "Information about the product , quantity and amount for connectors. (e.g. Klarna)",
- "example": "[{\n \"product_name\": \"gillete creme\",\n \"quantity\": 15,\n \"amount\" : 900\n }]",
- "nullable": true
- },
- "email": {
- "type": "string",
- "description": "description: The customer's email address\nThis field will be deprecated soon. Please refer to `customer.email` object",
- "deprecated": true,
- "example": "johntest@test.com",
- "nullable": true,
- "maxLength": 255
- },
- "name": {
- "type": "string",
- "description": "description: The customer's name\nThis field will be deprecated soon. Please refer to `customer.name` object",
- "deprecated": true,
- "example": "John Test",
- "nullable": true,
- "maxLength": 255
- },
- "phone": {
- "type": "string",
- "description": "The customer's phone number\nThis field will be deprecated soon. Please refer to `customer.phone` object",
- "deprecated": true,
- "example": "9123456789",
- "nullable": true,
- "maxLength": 255
- },
- "return_url": {
- "type": "string",
- "description": "The URL to redirect after the completion of the operation",
- "example": "https://hyperswitch.io",
- "nullable": true
- },
- "authentication_type": {
- "allOf": [
- {
- "$ref": "#/components/schemas/AuthenticationType"
- }
- ],
- "default": "three_ds",
- "nullable": true
- },
- "statement_descriptor_name": {
- "type": "string",
- "description": "For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.",
- "example": "Hyperswitch Router",
- "nullable": true,
- "maxLength": 255
- },
- "statement_descriptor_suffix": {
- "type": "string",
- "description": "Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 255 characters for the concatenated descriptor.",
- "example": "Payment for shoes purchase",
- "nullable": true,
- "maxLength": 255
- },
- "next_action": {
- "allOf": [
- {
- "$ref": "#/components/schemas/NextActionData"
- }
- ],
- "nullable": true
- },
- "cancellation_reason": {
- "type": "string",
- "description": "If the payment was cancelled the reason will be provided here",
- "nullable": true
- },
- "error_code": {
- "type": "string",
- "description": "If there was an error while calling the connectors the code is received here",
- "example": "E0001",
- "nullable": true
- },
- "error_message": {
- "type": "string",
- "description": "If there was an error while calling the connector the error message is received here",
- "example": "Failed while verifying the card",
- "nullable": true
- },
- "payment_experience": {
- "allOf": [
- {
- "$ref": "#/components/schemas/PaymentExperience"
- }
- ],
- "nullable": true
- },
- "payment_method_type": {
- "allOf": [
- {
- "$ref": "#/components/schemas/PaymentMethodType"
- }
- ],
- "nullable": true
- },
- "connector_label": {
- "type": "string",
- "description": "The connector used for this payment along with the country and business details",
- "example": "stripe_US_food",
- "nullable": true
- },
- "business_country": {
- "allOf": [
- {
- "$ref": "#/components/schemas/CountryAlpha2"
- }
- ],
- "nullable": true
- },
- "business_label": {
- "type": "string",
- "description": "The business label of merchant for this payment",
- "nullable": true
- },
- "business_sub_label": {
- "type": "string",
- "description": "The business_sub_label for this payment",
- "nullable": true
- },
- "allowed_payment_method_types": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/PaymentMethodType"
- },
- "description": "Allowed Payment Method Types for a given PaymentIntent",
- "nullable": true
- },
- "ephemeral_key": {
- "allOf": [
- {
- "$ref": "#/components/schemas/EphemeralKeyCreateResponse"
- }
- ],
- "nullable": true
- },
- "manual_retry_allowed": {
- "type": "boolean",
- "description": "If true the payment can be retried with same or different payment method which means the confirm call can be made again.",
- "nullable": true
- },
- "connector_transaction_id": {
- "type": "string",
- "description": "A unique identifier for a payment provided by the connector",
- "example": "993672945374576J",
- "nullable": true
- },
- "frm_message": {
- "allOf": [
- {
- "$ref": "#/components/schemas/FrmMessage"
- }
- ],
- "nullable": true
- },
- "metadata": {
- "type": "object",
- "description": "You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.",
- "nullable": true
- },
- "connector_metadata": {
- "allOf": [
- {
- "$ref": "#/components/schemas/ConnectorMetadata"
- }
- ],
- "nullable": true
- },
- "feature_metadata": {
- "allOf": [
- {
- "$ref": "#/components/schemas/FeatureMetadata"
- }
- ],
- "nullable": true
- },
- "reference_id": {
- "type": "string",
- "description": "reference(Identifier) to the payment at connector side",
- "example": "993672945374576J",
- "nullable": true
- },
- "payment_link": {
- "allOf": [
- {
- "$ref": "#/components/schemas/PaymentLinkResponse"
- }
- ],
- "nullable": true
- },
- "profile_id": {
- "type": "string",
- "description": "The business profile that is associated with this payment",
- "nullable": true
- },
- "surcharge_details": {
- "allOf": [
- {
- "$ref": "#/components/schemas/RequestSurchargeDetails"
- }
- ],
- "nullable": true
- },
- "attempt_count": {
- "type": "integer",
- "format": "int32",
- "description": "Total number of attempts associated with this payment"
- },
- "merchant_decision": {
- "type": "string",
- "description": "Denotes the action(approve or reject) taken by merchant in case of manual review. Manual review can occur when the transaction is marked as risky by the frm_processor, payment processor or when there is underpayment/over payment incase of crypto payment",
- "nullable": true
- },
- "merchant_connector_id": {
- "type": "string",
- "description": "Identifier of the connector ( merchant connector account ) which was chosen to make the payment",
- "nullable": true
- },
- "incremental_authorization_allowed": {
- "type": "boolean",
- "description": "If true, incremental authorization can be performed on this payment, in case the funds authorized initially fall short.",
- "nullable": true
- },
- "authorization_count": {
- "type": "integer",
- "format": "int32",
- "description": "Total number of authorizations happened in an incremental_authorization payment",
- "nullable": true
- },
- "incremental_authorizations": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/IncrementalAuthorizationResponse"
- },
- "description": "List of incremental authorizations happened to the payment",
- "nullable": true
- },
- "external_authentication_details": {
- "allOf": [
- {
- "$ref": "#/components/schemas/ExternalAuthenticationDetailsResponse"
- }
- ],
- "nullable": true
- },
- "external_3ds_authentication_attempted": {
- "type": "boolean",
- "description": "Flag indicating if external 3ds authentication is made or not",
- "nullable": true
- },
- "expires_on": {
- "type": "string",
- "format": "date-time",
- "description": "Date Time for expiry of the payment",
- "example": "2022-09-10T10:11:12Z",
- "nullable": true
- },
- "fingerprint": {
- "type": "string",
- "description": "Payment Fingerprint, to identify a particular card.\nIt is a 20 character long alphanumeric code.",
- "nullable": true
- },
- "browser_info": {
- "allOf": [
- {
- "$ref": "#/components/schemas/BrowserInformation"
- }
- ],
- "nullable": true
- },
- "payment_method_id": {
- "type": "string",
- "description": "Identifier for Payment Method used for the payment",
- "nullable": true
- },
- "payment_method_status": {
- "allOf": [
- {
- "$ref": "#/components/schemas/PaymentMethodStatus"
- }
- ],
- "nullable": true
- },
- "updated": {
- "type": "string",
- "format": "date-time",
- "description": "Date time at which payment was updated",
- "example": "2022-09-10T10:11:12Z",
- "nullable": true
- },
- "charges": {
- "allOf": [
- {
- "$ref": "#/components/schemas/PaymentChargeResponse"
- }
- ],
- "nullable": true
- },
- "frm_metadata": {
- "type": "object",
- "description": "You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. FRM Metadata is useful for storing additional, structured information on an object related to FRM.",
- "nullable": true
- },
- "merchant_order_reference_id": {
- "type": "string",
- "description": "Merchant's identifier for the payment/invoice. This will be sent to the connector\nif the connector provides support to accept multiple reference ids.\nIn case the connector supports only one reference id, Hyperswitch's Payment ID will be sent as reference.",
- "example": "Custom_Order_id_123",
- "nullable": true,
- "maxLength": 255
- },
- "order_tax_amount": {
- "allOf": [
- {
- "$ref": "#/components/schemas/MinorUnit"
- }
- ],
- "nullable": true
- },
- "connector_mandate_id": {
- "type": "string",
- "description": "Connector Identifier for the payment method",
- "nullable": true
- }
- }
- },
- "PaymentsDynamicTaxCalculationRequest": {
- "type": "object",
- "required": [
- "shipping",
- "client_secret",
- "payment_method_type"
- ],
- "properties": {
- "shipping": {
- "$ref": "#/components/schemas/Address"
- },
- "client_secret": {
- "type": "string",
- "description": "Client Secret"
- },
- "payment_method_type": {
- "$ref": "#/components/schemas/PaymentMethodType"
- },
- "session_id": {
- "type": "string",
- "description": "Session Id",
- "nullable": true
- }
- }
- },
- "PaymentsDynamicTaxCalculationResponse": {
- "type": "object",
- "required": [
- "payment_id",
- "net_amount",
- "display_amount"
- ],
- "properties": {
- "payment_id": {
- "type": "string",
- "description": "The identifier for the payment"
- },
- "net_amount": {
- "$ref": "#/components/schemas/MinorUnit"
- },
- "order_tax_amount": {
- "allOf": [
- {
- "$ref": "#/components/schemas/MinorUnit"
- }
- ],
- "nullable": true
- },
- "shipping_cost": {
- "allOf": [
- {
- "$ref": "#/components/schemas/MinorUnit"
- }
- ],
- "nullable": true
- },
- "display_amount": {
- "$ref": "#/components/schemas/DisplayAmountOnSdk"
- }
- }
- },
- "PaymentsExternalAuthenticationRequest": {
- "type": "object",
- "required": [
- "client_secret",
- "device_channel",
- "threeds_method_comp_ind"
- ],
- "properties": {
- "client_secret": {
- "type": "string",
- "description": "Client Secret"
- },
- "sdk_information": {
- "allOf": [
- {
- "$ref": "#/components/schemas/SdkInformation"
- }
- ],
- "nullable": true
- },
- "device_channel": {
- "$ref": "#/components/schemas/DeviceChannel"
- },
- "threeds_method_comp_ind": {
- "$ref": "#/components/schemas/ThreeDsCompletionIndicator"
- }
- }
- },
- "PaymentsExternalAuthenticationResponse": {
- "type": "object",
- "required": [
- "trans_status",
- "three_ds_requestor_url"
- ],
- "properties": {
- "trans_status": {
- "$ref": "#/components/schemas/TransactionStatus"
- },
- "acs_url": {
- "type": "string",
- "description": "Access Server URL to be used for challenge submission",
- "nullable": true
- },
- "challenge_request": {
- "type": "string",
- "description": "Challenge request which should be sent to acs_url",
- "nullable": true
- },
- "acs_reference_number": {
- "type": "string",
- "description": "Unique identifier assigned by the EMVCo(Europay, Mastercard and Visa)",
- "nullable": true
- },
- "acs_trans_id": {
- "type": "string",
- "description": "Unique identifier assigned by the ACS to identify a single transaction",
- "nullable": true
- },
- "three_dsserver_trans_id": {
- "type": "string",
- "description": "Unique identifier assigned by the 3DS Server to identify a single transaction",
- "nullable": true
- },
- "acs_signed_content": {
- "type": "string",
- "description": "Contains the JWS object created by the ACS for the ARes(Authentication Response) message",
- "nullable": true
- },
- "three_ds_requestor_url": {
- "type": "string",
- "description": "Three DS Requestor URL"
- }
- }
- },
- "PaymentsIncrementalAuthorizationRequest": {
- "type": "object",
- "required": [
- "amount"
- ],
- "properties": {
- "amount": {
- "type": "integer",
- "format": "int64",
- "description": "The total amount including previously authorized amount and additional amount",
- "example": 6540
- },
- "reason": {
- "type": "string",
- "description": "Reason for incremental authorization",
- "nullable": true
- }
- }
- },
- "PaymentsRequest": {
- "type": "object",
- "properties": {
- "amount": {
- "type": "integer",
- "format": "int64",
- "description": "The payment amount. Amount for the payment in the lowest denomination of the currency, (i.e) in cents for USD denomination, in yen for JPY denomination etc. E.g., Pass 100 to charge $1.00 and 1 for 1¥ since ¥ is a zero-decimal currency. Read more about [the Decimal and Non-Decimal Currencies](https://github.com/juspay/hyperswitch/wiki/Decimal-and-Non%E2%80%90Decimal-Currencies)",
- "example": 6540,
- "nullable": true,
- "minimum": 0
- },
- "currency": {
- "allOf": [
- {
- "$ref": "#/components/schemas/Currency"
- }
- ],
- "nullable": true
- },
- "amount_to_capture": {
- "type": "integer",
- "format": "int64",
- "description": "The Amount to be captured / debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc., If not provided, the default amount_to_capture will be the payment amount. Also, it must be less than or equal to the original payment account.",
- "example": 6540,
- "nullable": true
- },
- "shipping_cost": {
- "type": "integer",
- "format": "int64",
- "description": "The shipping cost for the payment. This is required for tax calculation in some regions.",
- "example": 6540,
- "nullable": true
- },
- "payment_id": {
- "type": "string",
- "description": "Unique identifier for the payment. This ensures idempotency for multiple payments\nthat have been done by a single merchant. The value for this field can be specified in the request, it will be auto generated otherwise and returned in the API response.",
- "example": "pay_mbabizu24mvu3mela5njyhpit4",
- "nullable": true,
- "maxLength": 30,
- "minLength": 30
- },
- "merchant_id": {
- "type": "string",
- "description": "This is an identifier for the merchant account. This is inferred from the API key\nprovided during the request",
- "example": "merchant_1668273825",
- "nullable": true,
- "maxLength": 255
- },
- "routing": {
- "allOf": [
- {
- "$ref": "#/components/schemas/StraightThroughAlgorithm"
- }
- ],
- "nullable": true
- },
- "connector": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Connector"
- },
- "description": "This allows to manually select a connector with which the payment can go through.",
- "example": [
- "stripe",
- "adyen"
- ],
- "nullable": true
- },
- "capture_method": {
- "allOf": [
- {
- "$ref": "#/components/schemas/CaptureMethod"
- }
- ],
- "nullable": true
- },
- "authentication_type": {
- "allOf": [
- {
- "$ref": "#/components/schemas/AuthenticationType"
- }
- ],
- "default": "three_ds",
- "nullable": true
- },
- "billing": {
- "allOf": [
- {
- "$ref": "#/components/schemas/Address"
- }
- ],
- "nullable": true
- },
- "capture_on": {
- "type": "string",
- "format": "date-time",
- "description": "A timestamp (ISO 8601 code) that determines when the payment should be captured.\nProviding this field will automatically set `capture` to true",
- "example": "2022-09-10T10:11:12Z",
- "nullable": true
- },
- "confirm": {
- "type": "boolean",
- "description": "Whether to confirm the payment (if applicable). It can be used to completely process a payment by attaching a payment method, setting `confirm=true` and `capture_method = automatic` in the *Payments/Create API* request itself.",
- "default": false,
- "example": true,
- "nullable": true
- },
- "customer": {
- "allOf": [
- {
- "$ref": "#/components/schemas/CustomerDetails"
- }
- ],
- "nullable": true
- },
- "customer_id": {
- "type": "string",
- "description": "The identifier for the customer",
- "example": "cus_y3oqhf46pyzuxjbcn2giaqnb44",
- "nullable": true,
- "maxLength": 64,
- "minLength": 1
- },
- "email": {
- "type": "string",
- "description": "The customer's email address.\nThis field will be deprecated soon, use the customer object instead",
- "deprecated": true,
- "example": "johntest@test.com",
- "nullable": true,
- "maxLength": 255
- },
- "name": {
- "type": "string",
- "description": "The customer's name.\nThis field will be deprecated soon, use the customer object instead.",
- "deprecated": true,
- "example": "John Test",
- "nullable": true,
- "maxLength": 255
- },
- "phone": {
- "type": "string",
- "description": "The customer's phone number\nThis field will be deprecated soon, use the customer object instead",
- "deprecated": true,
- "example": "9123456789",
- "nullable": true,
- "maxLength": 255
- },
- "phone_country_code": {
- "type": "string",
- "description": "The country code for the customer phone number\nThis field will be deprecated soon, use the customer object instead",
- "deprecated": true,
- "example": "+1",
- "nullable": true,
- "maxLength": 255
- },
- "off_session": {
- "type": "boolean",
- "description": "Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. When making a recurring payment by passing a mandate_id, this parameter is mandatory",
- "example": true,
- "nullable": true
- },
- "description": {
- "type": "string",
- "description": "A description for the payment",
- "example": "It's my first payment request",
- "nullable": true
- },
- "return_url": {
- "type": "string",
- "description": "The URL to which you want the user to be redirected after the completion of the payment operation",
- "example": "https://hyperswitch.io",
- "nullable": true
- },
- "setup_future_usage": {
- "allOf": [
- {
- "$ref": "#/components/schemas/FutureUsage"
- }
- ],
- "nullable": true
- },
- "payment_method_data": {
- "allOf": [
- {
- "$ref": "#/components/schemas/PaymentMethodDataRequest"
- }
- ],
- "nullable": true
- },
- "payment_method": {
- "allOf": [
- {
- "$ref": "#/components/schemas/PaymentMethod"
- }
- ],
- "nullable": true
- },
- "payment_token": {
- "type": "string",
- "description": "As Hyperswitch tokenises the sensitive details about the payments method, it provides the payment_token as a reference to a stored payment method, ensuring that the sensitive details are not exposed in any manner.",
- "example": "187282ab-40ef-47a9-9206-5099ba31e432",
- "nullable": true
- },
- "card_cvc": {
- "type": "string",
- "description": "This is used along with the payment_token field while collecting during saved card payments. This field will be deprecated soon, use the payment_method_data.card_token object instead",
- "deprecated": true,
- "nullable": true
- },
- "shipping": {
- "allOf": [
- {
- "$ref": "#/components/schemas/Address"
- }
- ],
- "nullable": true
- },
- "statement_descriptor_name": {
- "type": "string",
- "description": "For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.",
- "example": "Hyperswitch Router",
- "nullable": true,
- "maxLength": 255
- },
- "statement_descriptor_suffix": {
- "type": "string",
- "description": "Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.",
- "example": "Payment for shoes purchase",
- "nullable": true,
- "maxLength": 255
- },
- "order_details": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OrderDetailsWithAmount"
- },
- "description": "Use this object to capture the details about the different products for which the payment is being made. The sum of amount across different products here should be equal to the overall payment amount",
- "example": "[{\n \"product_name\": \"Apple iPhone 16\",\n \"quantity\": 1,\n \"amount\" : 69000\n \"product_img_link\" : \"https://dummy-img-link.com\"\n }]",
- "nullable": true
- },
- "client_secret": {
- "type": "string",
- "description": "It's a token used for client side verification.",
- "example": "pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo",
- "nullable": true
- },
- "mandate_data": {
- "allOf": [
- {
- "$ref": "#/components/schemas/MandateData"
- }
- ],
- "nullable": true
- },
- "customer_acceptance": {
- "allOf": [
- {
- "$ref": "#/components/schemas/CustomerAcceptance"
- }
- ],
- "nullable": true
- },
- "mandate_id": {
- "type": "string",
- "description": "A unique identifier to link the payment to a mandate. To do Recurring payments after a mandate has been created, pass the mandate_id instead of payment_method_data",
- "example": "mandate_iwer89rnjef349dni3",
- "nullable": true,
- "maxLength": 255
- },
- "browser_info": {
- "allOf": [
- {
- "$ref": "#/components/schemas/BrowserInformation"
- }
- ],
- "nullable": true
- },
- "payment_experience": {
- "allOf": [
- {
- "$ref": "#/components/schemas/PaymentExperience"
- }
- ],
- "nullable": true
- },
- "payment_method_type": {
- "allOf": [
- {
- "$ref": "#/components/schemas/PaymentMethodType"
- }
- ],
- "nullable": true
- },
- "business_country": {
- "allOf": [
- {
- "$ref": "#/components/schemas/CountryAlpha2"
- }
- ],
- "nullable": true
- },
- "business_label": {
- "type": "string",
- "description": "Business label of the merchant for this payment.\nTo be deprecated soon. Pass the profile_id instead",
- "example": "food",
- "nullable": true
- },
- "merchant_connector_details": {
- "allOf": [
- {
- "$ref": "#/components/schemas/MerchantConnectorDetailsWrap"
- }
- ],
- "nullable": true
- },
- "allowed_payment_method_types": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/PaymentMethodType"
- },
- "description": "Use this parameter to restrict the Payment Method Types to show for a given PaymentIntent",
- "nullable": true
- },
- "business_sub_label": {
- "type": "string",
- "description": "Business sub label for the payment",
- "nullable": true
- },
- "retry_action": {
- "allOf": [
- {
- "$ref": "#/components/schemas/RetryAction"
- }
- ],
- "nullable": true
- },
- "metadata": {
- "type": "object",
- "description": "You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.",
- "nullable": true
- },
- "connector_metadata": {
- "allOf": [
- {
- "$ref": "#/components/schemas/ConnectorMetadata"
- }
- ],
- "nullable": true
- },
- "feature_metadata": {
- "allOf": [
- {
- "$ref": "#/components/schemas/FeatureMetadata"
- }
- ],
- "nullable": true
- },
- "payment_link": {
- "type": "boolean",
- "description": "Whether to generate the payment link for this payment or not (if applicable)",
- "default": false,
- "example": true,
- "nullable": true
- },
- "payment_link_config": {
- "allOf": [
- {
- "$ref": "#/components/schemas/PaymentCreatePaymentLinkConfig"
- }
- ],
- "nullable": true
- },
- "payment_link_config_id": {
- "type": "string",
- "description": "Custom payment link config id set at business profile, send only if business_specific_configs is configured",
- "nullable": true
- },
- "profile_id": {
+ "merchant_connector_id": {
"type": "string",
- "description": "The business profile to be used for this payment, if not passed the default business profile associated with the merchant account will be used. It is mandatory in case multiple business profiles have been set up.",
- "nullable": true
- },
- "surcharge_details": {
- "allOf": [
- {
- "$ref": "#/components/schemas/RequestSurchargeDetails"
- }
- ],
- "nullable": true
- },
- "payment_type": {
- "allOf": [
- {
- "$ref": "#/components/schemas/PaymentType"
- }
- ],
+ "description": "Identifier of the connector ( merchant connector account ) which was chosen to make the payment",
"nullable": true
},
- "request_incremental_authorization": {
+ "incremental_authorization_allowed": {
"type": "boolean",
- "description": "Request an incremental authorization, i.e., increase the authorized amount on a confirmed payment before you capture it.",
+ "description": "If true, incremental authorization can be performed on this payment, in case the funds authorized initially fall short.",
"nullable": true
},
- "session_expiry": {
+ "authorization_count": {
"type": "integer",
"format": "int32",
- "description": "Will be used to expire client secret after certain amount of time to be supplied in seconds\n(900) for 15 mins",
- "example": 900,
- "nullable": true,
- "minimum": 0
- },
- "frm_metadata": {
- "type": "object",
- "description": "Additional data related to some frm(Fraud Risk Management) connectors",
- "nullable": true
- },
- "request_external_three_ds_authentication": {
- "type": "boolean",
- "description": "Whether to perform external authentication (if applicable)",
- "example": true,
- "nullable": true
- },
- "recurring_details": {
- "allOf": [
- {
- "$ref": "#/components/schemas/RecurringDetails"
- }
- ],
- "nullable": true
- },
- "charges": {
- "allOf": [
- {
- "$ref": "#/components/schemas/PaymentChargeRequest"
- }
- ],
- "nullable": true
- },
- "merchant_order_reference_id": {
- "type": "string",
- "description": "Merchant's identifier for the payment/invoice. This will be sent to the connector\nif the connector provides support to accept multiple reference ids.\nIn case the connector supports only one reference id, Hyperswitch's Payment ID will be sent as reference.",
- "example": "Custom_Order_id_123",
- "nullable": true,
- "maxLength": 255
- },
- "skip_external_tax_calculation": {
- "type": "boolean",
- "description": "Whether to calculate tax for this payment intent",
- "nullable": true
- }
- },
- "additionalProperties": false
- },
- "PaymentsResponse": {
- "type": "object",
- "required": [
- "payment_id",
- "merchant_id",
- "status",
- "amount",
- "net_amount",
- "amount_capturable",
- "currency",
- "payment_method",
- "attempt_count"
- ],
- "properties": {
- "payment_id": {
- "type": "string",
- "description": "Unique identifier for the payment. This ensures idempotency for multiple payments\nthat have been done by a single merchant.",
- "example": "pay_mbabizu24mvu3mela5njyhpit4",
- "maxLength": 30,
- "minLength": 30
- },
- "merchant_id": {
- "type": "string",
- "description": "This is an identifier for the merchant account. This is inferred from the API key\nprovided during the request",
- "example": "merchant_1668273825",
- "maxLength": 255
- },
- "status": {
- "allOf": [
- {
- "$ref": "#/components/schemas/IntentStatus"
- }
- ],
- "default": "requires_confirmation"
- },
- "amount": {
- "type": "integer",
- "format": "int64",
- "description": "The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,",
- "example": 6540
- },
- "net_amount": {
- "type": "integer",
- "format": "int64",
- "description": "The payment net amount. net_amount = amount + surcharge_details.surcharge_amount + surcharge_details.tax_amount + shipping_cost + order_tax_amount,\nIf no surcharge_details, shipping_cost, order_tax_amount, net_amount = amount",
- "example": 6540
- },
- "shipping_cost": {
- "type": "integer",
- "format": "int64",
- "description": "The shipping cost for the payment.",
- "example": 6540,
- "nullable": true
- },
- "amount_capturable": {
- "type": "integer",
- "format": "int64",
- "description": "The maximum amount that could be captured from the payment",
- "example": 6540,
- "minimum": 100
- },
- "amount_received": {
- "type": "integer",
- "format": "int64",
- "description": "The amount which is already captured from the payment, this helps in the cases where merchants can't capture all capturable amount at once.",
- "example": 6540,
- "nullable": true
- },
- "connector": {
- "type": "string",
- "description": "The connector used for the payment",
- "example": "stripe",
- "nullable": true
- },
- "client_secret": {
- "type": "string",
- "description": "It's a token used for client side verification.",
- "example": "pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo",
- "nullable": true
- },
- "created": {
- "type": "string",
- "format": "date-time",
- "description": "Time when the payment was created",
- "example": "2022-09-10T10:11:12Z",
- "nullable": true
- },
- "currency": {
- "$ref": "#/components/schemas/Currency"
- },
- "customer_id": {
- "type": "string",
- "description": "The identifier for the customer object. If not provided the customer ID will be autogenerated.\nThis field will be deprecated soon. Please refer to `customer.id`",
- "deprecated": true,
- "example": "cus_y3oqhf46pyzuxjbcn2giaqnb44",
- "nullable": true,
- "maxLength": 64,
- "minLength": 1
- },
- "customer": {
- "allOf": [
- {
- "$ref": "#/components/schemas/CustomerDetailsResponse"
- }
- ],
- "nullable": true
- },
- "description": {
- "type": "string",
- "description": "A description of the payment",
- "example": "It's my first payment request",
- "nullable": true
- },
- "refunds": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/RefundResponse"
- },
- "description": "List of refunds that happened on this intent, as same payment intent can have multiple refund requests depending on the nature of order",
- "nullable": true
- },
- "disputes": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/DisputeResponsePaymentsRetrieve"
- },
- "description": "List of disputes that happened on this intent",
- "nullable": true
- },
- "attempts": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/PaymentAttemptResponse"
- },
- "description": "List of attempts that happened on this intent",
+ "description": "Total number of authorizations happened in an incremental_authorization payment",
"nullable": true
},
- "captures": {
+ "incremental_authorizations": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/CaptureResponse"
+ "$ref": "#/components/schemas/IncrementalAuthorizationResponse"
},
- "description": "List of captures done on latest attempt",
- "nullable": true
- },
- "mandate_id": {
- "type": "string",
- "description": "A unique identifier to link the payment to a mandate, can be used instead of payment_method_data, in case of setting up recurring payments",
- "example": "mandate_iwer89rnjef349dni3",
- "nullable": true,
- "maxLength": 255
- },
- "mandate_data": {
- "allOf": [
- {
- "$ref": "#/components/schemas/MandateData"
- }
- ],
+ "description": "List of incremental authorizations happened to the payment",
"nullable": true
},
- "setup_future_usage": {
+ "external_authentication_details": {
"allOf": [
{
- "$ref": "#/components/schemas/FutureUsage"
+ "$ref": "#/components/schemas/ExternalAuthenticationDetailsResponse"
}
],
"nullable": true
},
- "off_session": {
+ "external_3ds_authentication_attempted": {
"type": "boolean",
- "description": "Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.",
- "example": true,
+ "description": "Flag indicating if external 3ds authentication is made or not",
"nullable": true
},
- "capture_on": {
+ "expires_on": {
"type": "string",
"format": "date-time",
- "description": "A timestamp (ISO 8601 code) that determines when the payment should be captured.\nProviding this field will automatically set `capture` to true",
+ "description": "Date Time for expiry of the payment",
"example": "2022-09-10T10:11:12Z",
"nullable": true
},
- "capture_method": {
- "allOf": [
- {
- "$ref": "#/components/schemas/CaptureMethod"
- }
- ],
+ "fingerprint": {
+ "type": "string",
+ "description": "Payment Fingerprint, to identify a particular card.\nIt is a 20 character long alphanumeric code.",
"nullable": true
},
- "payment_method": {
- "$ref": "#/components/schemas/PaymentMethod"
- },
- "payment_method_data": {
+ "browser_info": {
"allOf": [
{
- "$ref": "#/components/schemas/PaymentMethodDataResponseWithBilling"
+ "$ref": "#/components/schemas/BrowserInformation"
}
],
"nullable": true
},
- "payment_token": {
+ "payment_method_id": {
"type": "string",
- "description": "Provide a reference to a stored payment method",
- "example": "187282ab-40ef-47a9-9206-5099ba31e432",
- "nullable": true
- },
- "shipping": {
- "allOf": [
- {
- "$ref": "#/components/schemas/Address"
- }
- ],
+ "description": "Identifier for Payment Method used for the payment",
"nullable": true
},
- "billing": {
+ "payment_method_status": {
"allOf": [
{
- "$ref": "#/components/schemas/Address"
+ "$ref": "#/components/schemas/PaymentMethodStatus"
}
],
"nullable": true
},
- "order_details": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/OrderDetailsWithAmount"
- },
- "description": "Information about the product , quantity and amount for connectors. (e.g. Klarna)",
- "example": "[{\n \"product_name\": \"gillete creme\",\n \"quantity\": 15,\n \"amount\" : 900\n }]",
- "nullable": true
- },
- "email": {
- "type": "string",
- "description": "description: The customer's email address\nThis field will be deprecated soon. Please refer to `customer.email` object",
- "deprecated": true,
- "example": "johntest@test.com",
- "nullable": true,
- "maxLength": 255
- },
- "name": {
- "type": "string",
- "description": "description: The customer's name\nThis field will be deprecated soon. Please refer to `customer.name` object",
- "deprecated": true,
- "example": "John Test",
- "nullable": true,
- "maxLength": 255
- },
- "phone": {
- "type": "string",
- "description": "The customer's phone number\nThis field will be deprecated soon. Please refer to `customer.phone` object",
- "deprecated": true,
- "example": "9123456789",
- "nullable": true,
- "maxLength": 255
- },
- "return_url": {
+ "updated": {
"type": "string",
- "description": "The URL to redirect after the completion of the operation",
- "example": "https://hyperswitch.io",
+ "format": "date-time",
+ "description": "Date time at which payment was updated",
+ "example": "2022-09-10T10:11:12Z",
"nullable": true
},
- "authentication_type": {
+ "charges": {
"allOf": [
{
- "$ref": "#/components/schemas/AuthenticationType"
+ "$ref": "#/components/schemas/PaymentChargeResponse"
}
],
- "default": "three_ds",
"nullable": true
},
- "statement_descriptor_name": {
- "type": "string",
- "description": "For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.",
- "example": "Hyperswitch Router",
- "nullable": true,
- "maxLength": 255
+ "frm_metadata": {
+ "type": "object",
+ "description": "You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. FRM Metadata is useful for storing additional, structured information on an object related to FRM.",
+ "nullable": true
},
- "statement_descriptor_suffix": {
+ "merchant_order_reference_id": {
"type": "string",
- "description": "Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 255 characters for the concatenated descriptor.",
- "example": "Payment for shoes purchase",
+ "description": "Merchant's identifier for the payment/invoice. This will be sent to the connector\nif the connector provides support to accept multiple reference ids.\nIn case the connector supports only one reference id, Hyperswitch's Payment ID will be sent as reference.",
+ "example": "Custom_Order_id_123",
"nullable": true,
"maxLength": 255
},
- "next_action": {
+ "order_tax_amount": {
"allOf": [
{
- "$ref": "#/components/schemas/NextActionData"
+ "$ref": "#/components/schemas/MinorUnit"
}
],
"nullable": true
},
- "cancellation_reason": {
- "type": "string",
- "description": "If the payment was cancelled the reason will be provided here",
- "nullable": true
- },
- "error_code": {
- "type": "string",
- "description": "If there was an error while calling the connectors the code is received here",
- "example": "E0001",
- "nullable": true
- },
- "error_message": {
- "type": "string",
- "description": "If there was an error while calling the connector the error message is received here",
- "example": "Failed while verifying the card",
- "nullable": true
- },
- "unified_code": {
+ "connector_mandate_id": {
"type": "string",
- "description": "error code unified across the connectors is received here if there was an error while calling connector",
+ "description": "Connector Identifier for the payment method",
"nullable": true
+ }
+ }
+ },
+ "PaymentsDynamicTaxCalculationRequest": {
+ "type": "object",
+ "required": [
+ "shipping",
+ "client_secret",
+ "payment_method_type"
+ ],
+ "properties": {
+ "shipping": {
+ "$ref": "#/components/schemas/Address"
},
- "unified_message": {
+ "client_secret": {
"type": "string",
- "description": "error message unified across the connectors is received here if there was an error while calling connector",
- "nullable": true
- },
- "payment_experience": {
- "allOf": [
- {
- "$ref": "#/components/schemas/PaymentExperience"
- }
- ],
- "nullable": true
+ "description": "Client Secret"
},
"payment_method_type": {
- "allOf": [
- {
- "$ref": "#/components/schemas/PaymentMethodType"
- }
- ],
- "nullable": true
- },
- "connector_label": {
- "type": "string",
- "description": "The connector used for this payment along with the country and business details",
- "example": "stripe_US_food",
- "nullable": true
- },
- "business_country": {
- "allOf": [
- {
- "$ref": "#/components/schemas/CountryAlpha2"
- }
- ],
- "nullable": true
- },
- "business_label": {
- "type": "string",
- "description": "The business label of merchant for this payment",
- "nullable": true
- },
- "business_sub_label": {
- "type": "string",
- "description": "The business_sub_label for this payment",
- "nullable": true
- },
- "allowed_payment_method_types": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/PaymentMethodType"
- },
- "description": "Allowed Payment Method Types for a given PaymentIntent",
- "nullable": true
- },
- "ephemeral_key": {
- "allOf": [
- {
- "$ref": "#/components/schemas/EphemeralKeyCreateResponse"
- }
- ],
- "nullable": true
- },
- "manual_retry_allowed": {
- "type": "boolean",
- "description": "If true the payment can be retried with same or different payment method which means the confirm call can be made again.",
- "nullable": true
+ "$ref": "#/components/schemas/PaymentMethodType"
},
- "connector_transaction_id": {
+ "session_id": {
"type": "string",
- "description": "A unique identifier for a payment provided by the connector",
- "example": "993672945374576J",
- "nullable": true
- },
- "frm_message": {
- "allOf": [
- {
- "$ref": "#/components/schemas/FrmMessage"
- }
- ],
+ "description": "Session Id",
"nullable": true
+ }
+ }
+ },
+ "PaymentsDynamicTaxCalculationResponse": {
+ "type": "object",
+ "required": [
+ "payment_id",
+ "net_amount",
+ "display_amount"
+ ],
+ "properties": {
+ "payment_id": {
+ "type": "string",
+ "description": "The identifier for the payment"
},
- "metadata": {
- "type": "object",
- "description": "You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.",
- "nullable": true
+ "net_amount": {
+ "$ref": "#/components/schemas/MinorUnit"
},
- "connector_metadata": {
+ "order_tax_amount": {
"allOf": [
{
- "$ref": "#/components/schemas/ConnectorMetadata"
+ "$ref": "#/components/schemas/MinorUnit"
}
],
"nullable": true
},
- "feature_metadata": {
+ "shipping_cost": {
"allOf": [
{
- "$ref": "#/components/schemas/FeatureMetadata"
+ "$ref": "#/components/schemas/MinorUnit"
}
],
"nullable": true
},
- "reference_id": {
+ "display_amount": {
+ "$ref": "#/components/schemas/DisplayAmountOnSdk"
+ }
+ }
+ },
+ "PaymentsExternalAuthenticationRequest": {
+ "type": "object",
+ "required": [
+ "client_secret",
+ "device_channel",
+ "threeds_method_comp_ind"
+ ],
+ "properties": {
+ "client_secret": {
"type": "string",
- "description": "reference(Identifier) to the payment at connector side",
- "example": "993672945374576J",
- "nullable": true
+ "description": "Client Secret"
},
- "payment_link": {
+ "sdk_information": {
"allOf": [
{
- "$ref": "#/components/schemas/PaymentLinkResponse"
+ "$ref": "#/components/schemas/SdkInformation"
}
],
"nullable": true
},
- "profile_id": {
+ "device_channel": {
+ "$ref": "#/components/schemas/DeviceChannel"
+ },
+ "threeds_method_comp_ind": {
+ "$ref": "#/components/schemas/ThreeDsCompletionIndicator"
+ }
+ }
+ },
+ "PaymentsExternalAuthenticationResponse": {
+ "type": "object",
+ "required": [
+ "trans_status",
+ "three_ds_requestor_url"
+ ],
+ "properties": {
+ "trans_status": {
+ "$ref": "#/components/schemas/TransactionStatus"
+ },
+ "acs_url": {
"type": "string",
- "description": "The business profile that is associated with this payment",
+ "description": "Access Server URL to be used for challenge submission",
"nullable": true
},
- "surcharge_details": {
- "allOf": [
- {
- "$ref": "#/components/schemas/RequestSurchargeDetails"
- }
- ],
+ "challenge_request": {
+ "type": "string",
+ "description": "Challenge request which should be sent to acs_url",
"nullable": true
},
- "attempt_count": {
- "type": "integer",
- "format": "int32",
- "description": "Total number of attempts associated with this payment"
+ "acs_reference_number": {
+ "type": "string",
+ "description": "Unique identifier assigned by the EMVCo(Europay, Mastercard and Visa)",
+ "nullable": true
},
- "merchant_decision": {
+ "acs_trans_id": {
"type": "string",
- "description": "Denotes the action(approve or reject) taken by merchant in case of manual review. Manual review can occur when the transaction is marked as risky by the frm_processor, payment processor or when there is underpayment/over payment incase of crypto payment",
+ "description": "Unique identifier assigned by the ACS to identify a single transaction",
"nullable": true
},
- "merchant_connector_id": {
+ "three_dsserver_trans_id": {
"type": "string",
- "description": "Identifier of the connector ( merchant connector account ) which was chosen to make the payment",
+ "description": "Unique identifier assigned by the 3DS Server to identify a single transaction",
"nullable": true
},
- "incremental_authorization_allowed": {
- "type": "boolean",
- "description": "If true, incremental authorization can be performed on this payment, in case the funds authorized initially fall short.",
+ "acs_signed_content": {
+ "type": "string",
+ "description": "Contains the JWS object created by the ACS for the ARes(Authentication Response) message",
"nullable": true
},
- "authorization_count": {
+ "three_ds_requestor_url": {
+ "type": "string",
+ "description": "Three DS Requestor URL"
+ }
+ }
+ },
+ "PaymentsIncrementalAuthorizationRequest": {
+ "type": "object",
+ "required": [
+ "amount"
+ ],
+ "properties": {
+ "amount": {
"type": "integer",
- "format": "int32",
- "description": "Total number of authorizations happened in an incremental_authorization payment",
- "nullable": true
+ "format": "int64",
+ "description": "The total amount including previously authorized amount and additional amount",
+ "example": 6540
},
- "incremental_authorizations": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/IncrementalAuthorizationResponse"
- },
- "description": "List of incremental authorizations happened to the payment",
+ "reason": {
+ "type": "string",
+ "description": "Reason for incremental authorization",
"nullable": true
+ }
+ }
+ },
+ "PaymentsIntentResponse": {
+ "type": "object",
+ "required": [
+ "id",
+ "amount_details",
+ "client_secret",
+ "capture_method",
+ "authentication_type",
+ "customer_present",
+ "setup_future_usage",
+ "apply_mit_exemption",
+ "payment_link_enabled",
+ "request_incremental_authorization",
+ "expires_on",
+ "request_external_three_ds_authentication"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Global Payment Id for the payment"
},
- "external_authentication_details": {
- "allOf": [
- {
- "$ref": "#/components/schemas/ExternalAuthenticationDetailsResponse"
- }
- ],
- "nullable": true
+ "amount_details": {
+ "$ref": "#/components/schemas/AmountDetailsResponse"
},
- "external_3ds_authentication_attempted": {
- "type": "boolean",
- "description": "Flag indicating if external 3ds authentication is made or not",
- "nullable": true
+ "client_secret": {
+ "type": "string",
+ "description": "It's a token used for client side verification.",
+ "example": "pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo"
},
- "expires_on": {
+ "merchant_reference_id": {
"type": "string",
- "format": "date-time",
- "description": "Date Time for expiry of the payment",
- "example": "2022-09-10T10:11:12Z",
- "nullable": true
+ "description": "Unique identifier for the payment. This ensures idempotency for multiple payments\nthat have been done by a single merchant.",
+ "example": "pay_mbabizu24mvu3mela5njyhpit4",
+ "nullable": true,
+ "maxLength": 30,
+ "minLength": 30
},
- "fingerprint": {
+ "routing_algorithm_id": {
"type": "string",
- "description": "Payment Fingerprint, to identify a particular card.\nIt is a 20 character long alphanumeric code.",
+ "description": "The routing algorithm id to be used for the payment",
"nullable": true
},
- "browser_info": {
+ "capture_method": {
+ "$ref": "#/components/schemas/CaptureMethod"
+ },
+ "authentication_type": {
"allOf": [
{
- "$ref": "#/components/schemas/BrowserInformation"
+ "$ref": "#/components/schemas/AuthenticationType"
}
],
- "nullable": true
+ "default": "no_three_ds"
},
- "payment_method_id": {
- "type": "string",
- "description": "Identifier for Payment Method used for the payment",
+ "billing": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Address"
+ }
+ ],
"nullable": true
},
- "payment_method_status": {
+ "shipping": {
"allOf": [
{
- "$ref": "#/components/schemas/PaymentMethodStatus"
+ "$ref": "#/components/schemas/Address"
}
],
"nullable": true
},
- "updated": {
+ "customer_id": {
"type": "string",
- "format": "date-time",
- "description": "Date time at which payment was updated",
- "example": "2022-09-10T10:11:12Z",
+ "description": "The identifier for the customer",
+ "example": "cus_y3oqhf46pyzuxjbcn2giaqnb44",
+ "nullable": true,
+ "maxLength": 64,
+ "minLength": 1
+ },
+ "customer_present": {
+ "$ref": "#/components/schemas/PresenceOfCustomerDuringPayment"
+ },
+ "description": {
+ "type": "string",
+ "description": "A description for the payment",
+ "example": "It's my first payment request",
+ "nullable": true
+ },
+ "return_url": {
+ "type": "string",
+ "description": "The URL to which you want the user to be redirected after the completion of the payment operation",
+ "example": "https://hyperswitch.io",
+ "nullable": true
+ },
+ "setup_future_usage": {
+ "$ref": "#/components/schemas/FutureUsage"
+ },
+ "apply_mit_exemption": {
+ "$ref": "#/components/schemas/MitExemptionRequest"
+ },
+ "statement_descriptor": {
+ "type": "string",
+ "description": "For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.",
+ "example": "Hyperswitch Router",
+ "nullable": true,
+ "maxLength": 22
+ },
+ "order_details": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OrderDetailsWithAmount"
+ },
+ "description": "Use this object to capture the details about the different products for which the payment is being made. The sum of amount across different products here should be equal to the overall payment amount",
+ "example": "[{\n \"product_name\": \"Apple iPhone 16\",\n \"quantity\": 1,\n \"amount\" : 69000\n \"product_img_link\" : \"https://dummy-img-link.com\"\n }]",
+ "nullable": true
+ },
+ "allowed_payment_method_types": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/PaymentMethodType"
+ },
+ "description": "Use this parameter to restrict the Payment Method Types to show for a given PaymentIntent",
+ "nullable": true
+ },
+ "metadata": {
+ "type": "object",
+ "description": "Metadata is useful for storing additional, unstructured information on an object.",
"nullable": true
},
- "charges": {
+ "connector_metadata": {
"allOf": [
{
- "$ref": "#/components/schemas/PaymentChargeResponse"
+ "$ref": "#/components/schemas/ConnectorMetadata"
}
],
"nullable": true
},
- "frm_metadata": {
- "type": "object",
- "description": "You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. FRM Metadata is useful for storing additional, structured information on an object related to FRM.",
+ "feature_metadata": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/FeatureMetadata"
+ }
+ ],
"nullable": true
},
- "merchant_order_reference_id": {
- "type": "string",
- "description": "Merchant's identifier for the payment/invoice. This will be sent to the connector\nif the connector provides support to accept multiple reference ids.\nIn case the connector supports only one reference id, Hyperswitch's Payment ID will be sent as reference.",
- "example": "Custom_Order_id_123",
- "nullable": true,
- "maxLength": 255
+ "payment_link_enabled": {
+ "$ref": "#/components/schemas/EnablePaymentLinkRequest"
},
- "order_tax_amount": {
+ "payment_link_config": {
"allOf": [
{
- "$ref": "#/components/schemas/MinorUnit"
+ "$ref": "#/components/schemas/PaymentLinkConfigRequest"
}
],
"nullable": true
},
- "connector_mandate_id": {
+ "request_incremental_authorization": {
+ "$ref": "#/components/schemas/RequestIncrementalAuthorization"
+ },
+ "expires_on": {
"type": "string",
- "description": "Connector Identifier for the payment method",
+ "format": "date-time",
+ "description": "Will be used to expire client secret after certain amount of time to be supplied in seconds"
+ },
+ "frm_metadata": {
+ "type": "object",
+ "description": "Additional data related to some frm(Fraud Risk Management) connectors",
"nullable": true
+ },
+ "request_external_three_ds_authentication": {
+ "$ref": "#/components/schemas/External3dsAuthenticationRequest"
}
- }
+ },
+ "additionalProperties": false
},
- "PaymentsRetrieveRequest": {
+ "PaymentsResponse": {
"type": "object",
"required": [
- "resource_id",
- "force_sync"
+ "payment_id",
+ "merchant_id",
+ "status",
+ "amount",
+ "net_amount",
+ "amount_capturable",
+ "currency",
+ "payment_method",
+ "attempt_count"
],
"properties": {
- "resource_id": {
+ "payment_id": {
"type": "string",
- "description": "The type of ID (ex: payment intent id, payment attempt id or connector txn id)"
+ "description": "Unique identifier for the payment. This ensures idempotency for multiple payments\nthat have been done by a single merchant.",
+ "example": "pay_mbabizu24mvu3mela5njyhpit4",
+ "maxLength": 30,
+ "minLength": 30
},
"merchant_id": {
"type": "string",
- "description": "The identifier for the Merchant Account.",
+ "description": "This is an identifier for the merchant account. This is inferred from the API key\nprovided during the request",
+ "example": "merchant_1668273825",
+ "maxLength": 255
+ },
+ "status": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/IntentStatus"
+ }
+ ],
+ "default": "requires_confirmation"
+ },
+ "amount": {
+ "type": "integer",
+ "format": "int64",
+ "description": "The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,",
+ "example": 6540
+ },
+ "net_amount": {
+ "type": "integer",
+ "format": "int64",
+ "description": "The payment net amount. net_amount = amount + surcharge_details.surcharge_amount + surcharge_details.tax_amount + shipping_cost + order_tax_amount,\nIf no surcharge_details, shipping_cost, order_tax_amount, net_amount = amount",
+ "example": 6540
+ },
+ "shipping_cost": {
+ "type": "integer",
+ "format": "int64",
+ "description": "The shipping cost for the payment.",
+ "example": 6540,
"nullable": true
},
- "force_sync": {
- "type": "boolean",
- "description": "Decider to enable or disable the connector call for retrieve request"
+ "amount_capturable": {
+ "type": "integer",
+ "format": "int64",
+ "description": "The maximum amount that could be captured from the payment",
+ "example": 6540,
+ "minimum": 100
},
- "param": {
- "type": "string",
- "description": "The parameters passed to a retrieve request",
+ "amount_received": {
+ "type": "integer",
+ "format": "int64",
+ "description": "The amount which is already captured from the payment, this helps in the cases where merchants can't capture all capturable amount at once.",
+ "example": 6540,
"nullable": true
},
"connector": {
"type": "string",
- "description": "The name of the connector",
+ "description": "The connector used for the payment",
+ "example": "stripe",
"nullable": true
},
- "merchant_connector_details": {
+ "client_secret": {
+ "type": "string",
+ "description": "It's a token used for client side verification.",
+ "example": "pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo",
+ "nullable": true
+ },
+ "created": {
+ "type": "string",
+ "format": "date-time",
+ "description": "Time when the payment was created",
+ "example": "2022-09-10T10:11:12Z",
+ "nullable": true
+ },
+ "currency": {
+ "$ref": "#/components/schemas/Currency"
+ },
+ "customer_id": {
+ "type": "string",
+ "description": "The identifier for the customer object. If not provided the customer ID will be autogenerated.\nThis field will be deprecated soon. Please refer to `customer.id`",
+ "deprecated": true,
+ "example": "cus_y3oqhf46pyzuxjbcn2giaqnb44",
+ "nullable": true,
+ "maxLength": 64,
+ "minLength": 1
+ },
+ "customer": {
"allOf": [
{
- "$ref": "#/components/schemas/MerchantConnectorDetailsWrap"
+ "$ref": "#/components/schemas/CustomerDetailsResponse"
}
],
"nullable": true
},
- "client_secret": {
+ "description": {
"type": "string",
- "description": "This is a token which expires after 15 minutes, used from the client to authenticate and create sessions from the SDK",
+ "description": "A description of the payment",
+ "example": "It's my first payment request",
"nullable": true
},
- "expand_captures": {
- "type": "boolean",
- "description": "If enabled provides list of captures linked to latest attempt",
+ "refunds": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/RefundResponse"
+ },
+ "description": "List of refunds that happened on this intent, as same payment intent can have multiple refund requests depending on the nature of order",
"nullable": true
},
- "expand_attempts": {
- "type": "boolean",
- "description": "If enabled provides list of attempts linked to payment intent",
+ "disputes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/DisputeResponsePaymentsRetrieve"
+ },
+ "description": "List of disputes that happened on this intent",
"nullable": true
- }
- }
- },
- "PaymentsSessionRequest": {
- "type": "object"
- },
- "PaymentsSessionResponse": {
- "type": "object",
- "required": [
- "payment_id",
- "client_secret",
- "session_token"
- ],
- "properties": {
- "payment_id": {
- "type": "string",
- "description": "The identifier for the payment"
},
- "client_secret": {
- "type": "string",
- "description": "This is a token which expires after 15 minutes, used from the client to authenticate and create sessions from the SDK"
+ "attempts": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/PaymentAttemptResponse"
+ },
+ "description": "List of attempts that happened on this intent",
+ "nullable": true
},
- "session_token": {
+ "captures": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/SessionToken"
+ "$ref": "#/components/schemas/CaptureResponse"
},
- "description": "The list of session token object"
- }
- }
- },
- "PaymentsUpdateRequest": {
- "type": "object",
- "properties": {
- "amount": {
- "type": "integer",
- "format": "int64",
- "description": "The payment amount. Amount for the payment in the lowest denomination of the currency, (i.e) in cents for USD denomination, in yen for JPY denomination etc. E.g., Pass 100 to charge $1.00 and 1 for 1¥ since ¥ is a zero-decimal currency. Read more about [the Decimal and Non-Decimal Currencies](https://github.com/juspay/hyperswitch/wiki/Decimal-and-Non%E2%80%90Decimal-Currencies)",
- "example": 6540,
+ "description": "List of captures done on latest attempt",
+ "nullable": true
+ },
+ "mandate_id": {
+ "type": "string",
+ "description": "A unique identifier to link the payment to a mandate, can be used instead of payment_method_data, in case of setting up recurring payments",
+ "example": "mandate_iwer89rnjef349dni3",
"nullable": true,
- "minimum": 0
+ "maxLength": 255
},
- "currency": {
+ "mandate_data": {
"allOf": [
{
- "$ref": "#/components/schemas/Currency"
+ "$ref": "#/components/schemas/MandateData"
}
],
"nullable": true
},
- "amount_to_capture": {
- "type": "integer",
- "format": "int64",
- "description": "The Amount to be captured / debited from the users payment method. It shall be in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc., If not provided, the default amount_to_capture will be the payment amount. Also, it must be less than or equal to the original payment account.",
- "example": 6540,
- "nullable": true
- },
- "shipping_cost": {
- "type": "integer",
- "format": "int64",
- "description": "The shipping cost for the payment. This is required for tax calculation in some regions.",
- "example": 6540,
- "nullable": true
- },
- "payment_id": {
- "type": "string",
- "description": "Unique identifier for the payment. This ensures idempotency for multiple payments\nthat have been done by a single merchant. The value for this field can be specified in the request, it will be auto generated otherwise and returned in the API response.",
- "example": "pay_mbabizu24mvu3mela5njyhpit4",
- "nullable": true,
- "maxLength": 30,
- "minLength": 30
- },
- "routing": {
+ "setup_future_usage": {
"allOf": [
{
- "$ref": "#/components/schemas/StraightThroughAlgorithm"
+ "$ref": "#/components/schemas/FutureUsage"
}
],
"nullable": true
},
- "connector": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Connector"
- },
- "description": "This allows to manually select a connector with which the payment can go through.",
- "example": [
- "stripe",
- "adyen"
- ],
+ "off_session": {
+ "type": "boolean",
+ "description": "Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.",
+ "example": true,
+ "nullable": true
+ },
+ "capture_on": {
+ "type": "string",
+ "format": "date-time",
+ "description": "A timestamp (ISO 8601 code) that determines when the payment should be captured.\nProviding this field will automatically set `capture` to true",
+ "example": "2022-09-10T10:11:12Z",
"nullable": true
},
"capture_method": {
@@ -15900,16 +14664,24 @@
],
"nullable": true
},
- "authentication_type": {
+ "payment_method": {
+ "$ref": "#/components/schemas/PaymentMethod"
+ },
+ "payment_method_data": {
"allOf": [
{
- "$ref": "#/components/schemas/AuthenticationType"
+ "$ref": "#/components/schemas/PaymentMethodDataResponseWithBilling"
}
],
- "default": "three_ds",
"nullable": true
},
- "billing": {
+ "payment_token": {
+ "type": "string",
+ "description": "Provide a reference to a stored payment method",
+ "example": "187282ab-40ef-47a9-9206-5099ba31e432",
+ "nullable": true
+ },
+ "shipping": {
"allOf": [
{
"$ref": "#/components/schemas/Address"
@@ -15917,275 +14689,439 @@
],
"nullable": true
},
- "confirm": {
- "type": "boolean",
- "description": "Whether to confirm the payment (if applicable). It can be used to completely process a payment by attaching a payment method, setting `confirm=true` and `capture_method = automatic` in the *Payments/Create API* request itself.",
- "default": false,
- "example": true,
- "nullable": true
- },
- "customer": {
+ "billing": {
"allOf": [
{
- "$ref": "#/components/schemas/CustomerDetails"
+ "$ref": "#/components/schemas/Address"
}
],
"nullable": true
},
- "customer_id": {
+ "order_details": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/OrderDetailsWithAmount"
+ },
+ "description": "Information about the product , quantity and amount for connectors. (e.g. Klarna)",
+ "example": "[{\n \"product_name\": \"gillete creme\",\n \"quantity\": 15,\n \"amount\" : 900\n }]",
+ "nullable": true
+ },
+ "email": {
"type": "string",
- "description": "The identifier for the customer",
- "example": "cus_y3oqhf46pyzuxjbcn2giaqnb44",
+ "description": "description: The customer's email address\nThis field will be deprecated soon. Please refer to `customer.email` object",
+ "deprecated": true,
+ "example": "johntest@test.com",
"nullable": true,
- "maxLength": 64,
- "minLength": 1
+ "maxLength": 255
},
- "off_session": {
- "type": "boolean",
- "description": "Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. When making a recurring payment by passing a mandate_id, this parameter is mandatory",
- "example": true,
- "nullable": true
+ "name": {
+ "type": "string",
+ "description": "description: The customer's name\nThis field will be deprecated soon. Please refer to `customer.name` object",
+ "deprecated": true,
+ "example": "John Test",
+ "nullable": true,
+ "maxLength": 255
},
- "description": {
+ "phone": {
"type": "string",
- "description": "A description for the payment",
- "example": "It's my first payment request",
- "nullable": true
+ "description": "The customer's phone number\nThis field will be deprecated soon. Please refer to `customer.phone` object",
+ "deprecated": true,
+ "example": "9123456789",
+ "nullable": true,
+ "maxLength": 255
},
"return_url": {
"type": "string",
- "description": "The URL to which you want the user to be redirected after the completion of the payment operation",
+ "description": "The URL to redirect after the completion of the operation",
"example": "https://hyperswitch.io",
"nullable": true
},
- "setup_future_usage": {
+ "authentication_type": {
"allOf": [
{
- "$ref": "#/components/schemas/FutureUsage"
+ "$ref": "#/components/schemas/AuthenticationType"
}
],
+ "default": "three_ds",
"nullable": true
},
- "payment_method_data": {
+ "statement_descriptor_name": {
+ "type": "string",
+ "description": "For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.",
+ "example": "Hyperswitch Router",
+ "nullable": true,
+ "maxLength": 255
+ },
+ "statement_descriptor_suffix": {
+ "type": "string",
+ "description": "Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 255 characters for the concatenated descriptor.",
+ "example": "Payment for shoes purchase",
+ "nullable": true,
+ "maxLength": 255
+ },
+ "next_action": {
"allOf": [
{
- "$ref": "#/components/schemas/PaymentMethodDataRequest"
+ "$ref": "#/components/schemas/NextActionData"
}
],
"nullable": true
},
- "payment_method": {
+ "cancellation_reason": {
+ "type": "string",
+ "description": "If the payment was cancelled the reason will be provided here",
+ "nullable": true
+ },
+ "error_code": {
+ "type": "string",
+ "description": "If there was an error while calling the connectors the code is received here",
+ "example": "E0001",
+ "nullable": true
+ },
+ "error_message": {
+ "type": "string",
+ "description": "If there was an error while calling the connector the error message is received here",
+ "example": "Failed while verifying the card",
+ "nullable": true
+ },
+ "unified_code": {
+ "type": "string",
+ "description": "error code unified across the connectors is received here if there was an error while calling connector",
+ "nullable": true
+ },
+ "unified_message": {
+ "type": "string",
+ "description": "error message unified across the connectors is received here if there was an error while calling connector",
+ "nullable": true
+ },
+ "payment_experience": {
"allOf": [
{
- "$ref": "#/components/schemas/PaymentMethod"
+ "$ref": "#/components/schemas/PaymentExperience"
}
],
"nullable": true
},
- "payment_token": {
+ "payment_method_type": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/PaymentMethodType"
+ }
+ ],
+ "nullable": true
+ },
+ "connector_label": {
"type": "string",
- "description": "As Hyperswitch tokenises the sensitive details about the payments method, it provides the payment_token as a reference to a stored payment method, ensuring that the sensitive details are not exposed in any manner.",
- "example": "187282ab-40ef-47a9-9206-5099ba31e432",
+ "description": "The connector used for this payment along with the country and business details",
+ "example": "stripe_US_food",
"nullable": true
},
- "shipping": {
+ "business_country": {
"allOf": [
{
- "$ref": "#/components/schemas/Address"
+ "$ref": "#/components/schemas/CountryAlpha2"
}
],
"nullable": true
},
- "statement_descriptor_name": {
+ "business_label": {
"type": "string",
- "description": "For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.",
- "example": "Hyperswitch Router",
- "nullable": true,
- "maxLength": 255
+ "description": "The business label of merchant for this payment",
+ "nullable": true
},
- "statement_descriptor_suffix": {
+ "business_sub_label": {
"type": "string",
- "description": "Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.",
- "example": "Payment for shoes purchase",
- "nullable": true,
- "maxLength": 255
+ "description": "The business_sub_label for this payment",
+ "nullable": true
},
- "order_details": {
+ "allowed_payment_method_types": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/OrderDetailsWithAmount"
+ "$ref": "#/components/schemas/PaymentMethodType"
},
- "description": "Use this object to capture the details about the different products for which the payment is being made. The sum of amount across different products here should be equal to the overall payment amount",
- "example": "[{\n \"product_name\": \"Apple iPhone 16\",\n \"quantity\": 1,\n \"amount\" : 69000\n \"product_img_link\" : \"https://dummy-img-link.com\"\n }]",
+ "description": "Allowed Payment Method Types for a given PaymentIntent",
"nullable": true
},
- "mandate_data": {
+ "ephemeral_key": {
"allOf": [
{
- "$ref": "#/components/schemas/MandateData"
+ "$ref": "#/components/schemas/EphemeralKeyCreateResponse"
}
],
"nullable": true
},
- "customer_acceptance": {
+ "manual_retry_allowed": {
+ "type": "boolean",
+ "description": "If true the payment can be retried with same or different payment method which means the confirm call can be made again.",
+ "nullable": true
+ },
+ "connector_transaction_id": {
+ "type": "string",
+ "description": "A unique identifier for a payment provided by the connector",
+ "example": "993672945374576J",
+ "nullable": true
+ },
+ "frm_message": {
"allOf": [
{
- "$ref": "#/components/schemas/CustomerAcceptance"
+ "$ref": "#/components/schemas/FrmMessage"
}
],
"nullable": true
},
- "browser_info": {
+ "metadata": {
+ "type": "object",
+ "description": "You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.",
+ "nullable": true
+ },
+ "connector_metadata": {
"allOf": [
{
- "$ref": "#/components/schemas/BrowserInformation"
+ "$ref": "#/components/schemas/ConnectorMetadata"
}
],
"nullable": true
},
- "payment_experience": {
+ "feature_metadata": {
"allOf": [
{
- "$ref": "#/components/schemas/PaymentExperience"
+ "$ref": "#/components/schemas/FeatureMetadata"
}
],
"nullable": true
},
- "payment_method_type": {
+ "reference_id": {
+ "type": "string",
+ "description": "reference(Identifier) to the payment at connector side",
+ "example": "993672945374576J",
+ "nullable": true
+ },
+ "payment_link": {
"allOf": [
{
- "$ref": "#/components/schemas/PaymentMethodType"
+ "$ref": "#/components/schemas/PaymentLinkResponse"
}
],
"nullable": true
},
- "merchant_connector_details": {
+ "profile_id": {
+ "type": "string",
+ "description": "The business profile that is associated with this payment",
+ "nullable": true
+ },
+ "surcharge_details": {
"allOf": [
{
- "$ref": "#/components/schemas/MerchantConnectorDetailsWrap"
+ "$ref": "#/components/schemas/RequestSurchargeDetails"
}
],
"nullable": true
},
- "allowed_payment_method_types": {
+ "attempt_count": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Total number of attempts associated with this payment"
+ },
+ "merchant_decision": {
+ "type": "string",
+ "description": "Denotes the action(approve or reject) taken by merchant in case of manual review. Manual review can occur when the transaction is marked as risky by the frm_processor, payment processor or when there is underpayment/over payment incase of crypto payment",
+ "nullable": true
+ },
+ "merchant_connector_id": {
+ "type": "string",
+ "description": "Identifier of the connector ( merchant connector account ) which was chosen to make the payment",
+ "nullable": true
+ },
+ "incremental_authorization_allowed": {
+ "type": "boolean",
+ "description": "If true, incremental authorization can be performed on this payment, in case the funds authorized initially fall short.",
+ "nullable": true
+ },
+ "authorization_count": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Total number of authorizations happened in an incremental_authorization payment",
+ "nullable": true
+ },
+ "incremental_authorizations": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/PaymentMethodType"
+ "$ref": "#/components/schemas/IncrementalAuthorizationResponse"
},
- "description": "Use this parameter to restrict the Payment Method Types to show for a given PaymentIntent",
+ "description": "List of incremental authorizations happened to the payment",
"nullable": true
},
- "retry_action": {
+ "external_authentication_details": {
"allOf": [
{
- "$ref": "#/components/schemas/RetryAction"
+ "$ref": "#/components/schemas/ExternalAuthenticationDetailsResponse"
}
],
"nullable": true
},
- "metadata": {
- "type": "object",
- "description": "You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.",
+ "external_3ds_authentication_attempted": {
+ "type": "boolean",
+ "description": "Flag indicating if external 3ds authentication is made or not",
+ "nullable": true
+ },
+ "expires_on": {
+ "type": "string",
+ "format": "date-time",
+ "description": "Date Time for expiry of the payment",
+ "example": "2022-09-10T10:11:12Z",
+ "nullable": true
+ },
+ "fingerprint": {
+ "type": "string",
+ "description": "Payment Fingerprint, to identify a particular card.\nIt is a 20 character long alphanumeric code.",
"nullable": true
},
- "connector_metadata": {
+ "browser_info": {
"allOf": [
{
- "$ref": "#/components/schemas/ConnectorMetadata"
+ "$ref": "#/components/schemas/BrowserInformation"
}
],
"nullable": true
},
- "payment_link": {
- "type": "boolean",
- "description": "Whether to generate the payment link for this payment or not (if applicable)",
- "default": false,
- "example": true,
+ "payment_method_id": {
+ "type": "string",
+ "description": "Identifier for Payment Method used for the payment",
"nullable": true
},
- "payment_link_config": {
+ "payment_method_status": {
"allOf": [
{
- "$ref": "#/components/schemas/PaymentCreatePaymentLinkConfig"
+ "$ref": "#/components/schemas/PaymentMethodStatus"
}
],
"nullable": true
},
- "payment_link_config_id": {
+ "updated": {
"type": "string",
- "description": "Custom payment link config id set at business profile, send only if business_specific_configs is configured",
+ "format": "date-time",
+ "description": "Date time at which payment was updated",
+ "example": "2022-09-10T10:11:12Z",
"nullable": true
},
- "surcharge_details": {
+ "charges": {
"allOf": [
{
- "$ref": "#/components/schemas/RequestSurchargeDetails"
+ "$ref": "#/components/schemas/PaymentChargeResponse"
}
],
"nullable": true
},
- "payment_type": {
+ "frm_metadata": {
+ "type": "object",
+ "description": "You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. FRM Metadata is useful for storing additional, structured information on an object related to FRM.",
+ "nullable": true
+ },
+ "merchant_order_reference_id": {
+ "type": "string",
+ "description": "Merchant's identifier for the payment/invoice. This will be sent to the connector\nif the connector provides support to accept multiple reference ids.\nIn case the connector supports only one reference id, Hyperswitch's Payment ID will be sent as reference.",
+ "example": "Custom_Order_id_123",
+ "nullable": true,
+ "maxLength": 255
+ },
+ "order_tax_amount": {
"allOf": [
{
- "$ref": "#/components/schemas/PaymentType"
+ "$ref": "#/components/schemas/MinorUnit"
}
],
"nullable": true
},
- "request_incremental_authorization": {
- "type": "boolean",
- "description": "Request an incremental authorization, i.e., increase the authorized amount on a confirmed payment before you capture it.",
+ "connector_mandate_id": {
+ "type": "string",
+ "description": "Connector Identifier for the payment method",
"nullable": true
+ }
+ }
+ },
+ "PaymentsRetrieveRequest": {
+ "type": "object",
+ "required": [
+ "resource_id",
+ "force_sync"
+ ],
+ "properties": {
+ "resource_id": {
+ "type": "string",
+ "description": "The type of ID (ex: payment intent id, payment attempt id or connector txn id)"
},
- "session_expiry": {
- "type": "integer",
- "format": "int32",
- "description": "Will be used to expire client secret after certain amount of time to be supplied in seconds\n(900) for 15 mins",
- "example": 900,
- "nullable": true,
- "minimum": 0
- },
- "frm_metadata": {
- "type": "object",
- "description": "Additional data related to some frm(Fraud Risk Management) connectors",
+ "merchant_id": {
+ "type": "string",
+ "description": "The identifier for the Merchant Account.",
"nullable": true
},
- "request_external_three_ds_authentication": {
+ "force_sync": {
"type": "boolean",
- "description": "Whether to perform external authentication (if applicable)",
- "example": true,
+ "description": "Decider to enable or disable the connector call for retrieve request"
+ },
+ "param": {
+ "type": "string",
+ "description": "The parameters passed to a retrieve request",
"nullable": true
},
- "recurring_details": {
- "allOf": [
- {
- "$ref": "#/components/schemas/RecurringDetails"
- }
- ],
+ "connector": {
+ "type": "string",
+ "description": "The name of the connector",
"nullable": true
},
- "charges": {
+ "merchant_connector_details": {
"allOf": [
{
- "$ref": "#/components/schemas/PaymentChargeRequest"
+ "$ref": "#/components/schemas/MerchantConnectorDetailsWrap"
}
],
"nullable": true
},
- "merchant_order_reference_id": {
+ "client_secret": {
"type": "string",
- "description": "Merchant's identifier for the payment/invoice. This will be sent to the connector\nif the connector provides support to accept multiple reference ids.\nIn case the connector supports only one reference id, Hyperswitch's Payment ID will be sent as reference.",
- "example": "Custom_Order_id_123",
- "nullable": true,
- "maxLength": 255
+ "description": "This is a token which expires after 15 minutes, used from the client to authenticate and create sessions from the SDK",
+ "nullable": true
},
- "skip_external_tax_calculation": {
+ "expand_captures": {
+ "type": "boolean",
+ "description": "If enabled provides list of captures linked to latest attempt",
+ "nullable": true
+ },
+ "expand_attempts": {
"type": "boolean",
- "description": "Whether to calculate tax for this payment intent",
+ "description": "If enabled provides list of attempts linked to payment intent",
"nullable": true
}
}
},
+ "PaymentsSessionRequest": {
+ "type": "object"
+ },
+ "PaymentsSessionResponse": {
+ "type": "object",
+ "required": [
+ "payment_id",
+ "client_secret",
+ "session_token"
+ ],
+ "properties": {
+ "payment_id": {
+ "type": "string",
+ "description": "The identifier for the payment"
+ },
+ "client_secret": {
+ "type": "string",
+ "description": "This is a token which expires after 15 minutes, used from the client to authenticate and create sessions from the SDK"
+ },
+ "session_token": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/SessionToken"
+ },
+ "description": "The list of session token object"
+ }
+ }
+ },
"PayoutActionRequest": {
"type": "object"
},
@@ -17305,7 +16241,9 @@
"required": [
"client_id",
"client_name",
- "client_profile_id"
+ "client_profile_id",
+ "transaction_currency_code",
+ "transaction_amount"
],
"properties": {
"client_id": {
@@ -17319,6 +16257,21 @@
"client_profile_id": {
"type": "string",
"description": "Paze Client Profile ID"
+ },
+ "transaction_currency_code": {
+ "$ref": "#/components/schemas/Currency"
+ },
+ "transaction_amount": {
+ "type": "string",
+ "description": "The transaction amount",
+ "example": "38.02"
+ },
+ "email_address": {
+ "type": "string",
+ "description": "Email Address",
+ "example": "johntest@test.com",
+ "nullable": true,
+ "maxLength": 255
}
}
},
@@ -18092,19 +17045,18 @@
}
}
},
- "RefundAggregateResponse": {
+ "RefundErrorDetails": {
"type": "object",
"required": [
- "status_with_count"
+ "code",
+ "message"
],
"properties": {
- "status_with_count": {
- "type": "object",
- "description": "The list of refund status with their count",
- "additionalProperties": {
- "type": "integer",
- "format": "int64"
- }
+ "code": {
+ "type": "string"
+ },
+ "message": {
+ "type": "string"
}
}
},
@@ -18298,89 +17250,89 @@
"RefundResponse": {
"type": "object",
"required": [
- "refund_id",
+ "id",
"payment_id",
"amount",
"currency",
"status",
- "connector"
+ "created_at",
+ "updated_at",
+ "connector",
+ "profile_id",
+ "merchant_connector_id"
],
"properties": {
- "refund_id": {
+ "id": {
"type": "string",
- "description": "Unique Identifier for the refund"
+ "description": "Global Refund Id for the refund"
},
"payment_id": {
"type": "string",
"description": "The payment id against which refund is initiated"
},
+ "merchant_reference_id": {
+ "type": "string",
+ "description": "Unique Identifier for the Refund. This is to ensure idempotency for multiple partial refunds initiated against the same payment.",
+ "example": "ref_mbabizu24mvu3mela5njyhpit4",
+ "nullable": true,
+ "maxLength": 30,
+ "minLength": 30
+ },
"amount": {
"type": "integer",
"format": "int64",
- "description": "The refund amount, which should be less than or equal to the total payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc",
+ "description": "The refund amount",
"example": 6540,
"minimum": 100
},
"currency": {
- "type": "string",
- "description": "The three-letter ISO currency code"
+ "$ref": "#/components/schemas/Currency"
},
"status": {
"$ref": "#/components/schemas/RefundStatus"
},
"reason": {
"type": "string",
- "description": "An arbitrary string attached to the object. Often useful for displaying to users and your customer support executive",
+ "description": "An arbitrary string attached to the object",
"nullable": true
},
"metadata": {
"type": "object",
- "description": "You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object",
- "nullable": true
- },
- "error_message": {
- "type": "string",
- "description": "The error message",
+ "description": "Metadata is useful for storing additional, unstructured information on an object",
"nullable": true
},
- "error_code": {
- "type": "string",
- "description": "The code for the error",
+ "error_details": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/RefundErrorDetails"
+ }
+ ],
"nullable": true
},
"created_at": {
"type": "string",
"format": "date-time",
- "description": "The timestamp at which refund is created",
- "nullable": true
+ "description": "The timestamp at which refund is created"
},
"updated_at": {
"type": "string",
"format": "date-time",
- "description": "The timestamp at which refund is updated",
- "nullable": true
+ "description": "The timestamp at which refund is updated"
},
"connector": {
- "type": "string",
- "description": "The connector used for the refund and the corresponding payment",
- "example": "stripe"
+ "$ref": "#/components/schemas/Connector"
},
"profile_id": {
"type": "string",
- "description": "The id of business profile for this refund",
- "nullable": true
+ "description": "The id of business profile for this refund"
},
"merchant_connector_id": {
"type": "string",
- "description": "The merchant_connector_id of the processor through which this payment went through",
- "nullable": true
+ "description": "The merchant_connector_id of the processor through which this payment went through"
},
- "charges": {
- "allOf": [
- {
- "$ref": "#/components/schemas/ChargeRefunds"
- }
- ],
+ "connector_refund_reference_id": {
+ "type": "string",
+ "description": "The reference id of the connector for the refund",
"nullable": true
}
}
@@ -18421,6 +17373,59 @@
},
"additionalProperties": false
},
+ "RefundsCreateRequest": {
+ "type": "object",
+ "required": [
+ "payment_id"
+ ],
+ "properties": {
+ "payment_id": {
+ "type": "string",
+ "description": "The payment id against which refund is initiated",
+ "example": "pay_mbabizu24mvu3mela5njyhpit4",
+ "maxLength": 30,
+ "minLength": 30
+ },
+ "merchant_reference_id": {
+ "type": "string",
+ "description": "Unique Identifier for the Refund. This is to ensure idempotency for multiple partial refunds initiated against the same payment.",
+ "example": "ref_mbabizu24mvu3mela5njyhpit4",
+ "nullable": true,
+ "maxLength": 30,
+ "minLength": 30
+ },
+ "amount": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Total amount for which the refund is to be initiated. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc., If not provided, this will default to the amount_captured of the payment",
+ "example": 6540,
+ "nullable": true,
+ "minimum": 100
+ },
+ "reason": {
+ "type": "string",
+ "description": "Reason for the refund. Often useful for displaying to users and your customer support executive.",
+ "example": "Customer returned the product",
+ "nullable": true,
+ "maxLength": 255
+ },
+ "refund_type": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/RefundType"
+ }
+ ],
+ "default": "Instant",
+ "nullable": true
+ },
+ "metadata": {
+ "type": "object",
+ "description": "Metadata is useful for storing additional, unstructured information on an object.",
+ "nullable": true
+ }
+ },
+ "additionalProperties": false
+ },
"RequestIncrementalAuthorization": {
"type": "string",
"enum": [
@@ -21000,7 +20005,8 @@
}
}
}
- ]
+ ],
+ "description": "Hyperswitch supports SDK integration with Apple Pay and Google Pay wallets. For other wallets, we integrate with their respective connectors, redirecting the customer to the connector for wallet payments. As a result, we don’t receive any payment method data in the confirm call for payments made through other wallets."
},
"WeChatPay": {
"type": "object"
diff --git a/api-reference-v2/rust_locker_open_api_spec.yml b/api-reference-v2/rust_locker_open_api_spec.yml
index 729886d9cd0d..17a19fec44da 100644
--- a/api-reference-v2/rust_locker_open_api_spec.yml
+++ b/api-reference-v2/rust_locker_open_api_spec.yml
@@ -2,16 +2,16 @@ openapi: "3.0.2"
info:
title: Tartarus - OpenAPI 3.0
description: |-
- This the the open API 3.0 specification for the card locker.
+ This is the OpenAPI 3.0 specification for the card locker.
This is used by the [hyperswitch](https://github.com/juspay/hyperswitch) for storing card information securely.
version: "1.0"
tags:
- name: Key Custodian
description: API used to initialize the locker after deployment.
- name: Data
- description: CRUD APIs to for working with data to be stored in the locker
+ description: CRUD APIs for working with data to be stored in the locker
- name: Cards
- description: CRUD APIs to for working with cards data to be stored in the locker (deprecated)
+ description: CRUD APIs for working with cards data to be stored in the locker (deprecated)
paths:
/custodian/key1:
post:
@@ -39,7 +39,7 @@ paths:
tags:
- Key Custodian
summary: Provide Key 2
- description: Provide the first key to unlock the locker
+ description: Provide the second key to unlock the locker
operationId: setKey2
requestBody:
description: Provide key 2 to unlock the locker
diff --git a/api-reference/openapi_spec.json b/api-reference/openapi_spec.json
index 9374acb024d1..f86664d459f5 100644
--- a/api-reference/openapi_spec.json
+++ b/api-reference/openapi_spec.json
@@ -3952,12 +3952,12 @@
}
},
{
- "name": "status",
+ "name": "enable",
"in": "query",
- "description": "Boolean value for mentioning the expected state of dynamic routing",
+ "description": "Feature to enable for success based routing",
"required": true,
"schema": {
- "type": "boolean"
+ "$ref": "#/components/schemas/SuccessBasedRoutingFeatures"
}
}
],
@@ -3998,87 +3998,6 @@
]
}
},
- "/account/:account_id/business_profile/:profile_id/dynamic_routing/success_based/config/:algorithm_id": {
- "patch": {
- "tags": [
- "Routing"
- ],
- "summary": "Routing - Update config for success based dynamic routing",
- "description": "Update config for success based dynamic routing",
- "operationId": "Update configs for success based dynamic routing algorithm",
- "parameters": [
- {
- "name": "account_id",
- "in": "path",
- "description": "Merchant id",
- "required": true,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "profile_id",
- "in": "path",
- "description": "The unique identifier for a profile",
- "required": true,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "algorithm_id",
- "in": "path",
- "description": "The unique identifier for routing algorithm",
- "required": true,
- "schema": {
- "type": "string"
- }
- }
- ],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/SuccessBasedRoutingConfig"
- }
- }
- },
- "required": true
- },
- "responses": {
- "200": {
- "description": "Routing Algorithm updated",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/RoutingDictionaryRecord"
- }
- }
- }
- },
- "400": {
- "description": "Request body is malformed"
- },
- "403": {
- "description": "Forbidden"
- },
- "404": {
- "description": "Resource missing"
- },
- "422": {
- "description": "Unprocessable request"
- },
- "500": {
- "description": "Internal server error"
- }
- },
- "security": [
- {
- "admin_api_key": []
- }
- ]
- }
- },
"/blocklist": {
"delete": {
"tags": [
@@ -9458,23 +9377,6 @@
"ZWL"
]
},
- "CurrentBlockThreshold": {
- "type": "object",
- "properties": {
- "duration_in_mins": {
- "type": "integer",
- "format": "int64",
- "nullable": true,
- "minimum": 0
- },
- "max_total_count": {
- "type": "integer",
- "format": "int64",
- "nullable": true,
- "minimum": 0
- }
- }
- },
"CustomerAcceptance": {
"type": "object",
"description": "This \"CustomerAcceptance\" object is passed during Payments-Confirm request, it enlists the type, time, and mode of acceptance properties related to an acceptance done by the customer. The customer_acceptance sub object is usually passed by the SDK or client.",
@@ -14317,9 +14219,7 @@
"minimum": 0
},
"amount": {
- "type": "integer",
- "format": "int64",
- "description": "the amount per quantity of product"
+ "$ref": "#/components/schemas/MinorUnit"
},
"requires_shipping": {
"type": "boolean",
@@ -21086,7 +20986,9 @@
"required": [
"client_id",
"client_name",
- "client_profile_id"
+ "client_profile_id",
+ "transaction_currency_code",
+ "transaction_amount"
],
"properties": {
"client_id": {
@@ -21100,6 +21002,21 @@
"client_profile_id": {
"type": "string",
"description": "Paze Client Profile ID"
+ },
+ "transaction_currency_code": {
+ "$ref": "#/components/schemas/Currency"
+ },
+ "transaction_amount": {
+ "type": "string",
+ "description": "The transaction amount",
+ "example": "38.02"
+ },
+ "email_address": {
+ "type": "string",
+ "description": "Email Address",
+ "example": "johntest@test.com",
+ "nullable": true,
+ "maxLength": 255
}
}
},
@@ -21907,22 +21824,6 @@
}
}
},
- "RefundAggregateResponse": {
- "type": "object",
- "required": [
- "status_with_count"
- ],
- "properties": {
- "status_with_count": {
- "type": "object",
- "description": "The list of refund status with their count",
- "additionalProperties": {
- "type": "integer",
- "format": "int64"
- }
- }
- }
- },
"RefundListRequest": {
"allOf": [
{
@@ -23624,80 +23525,14 @@
"destination"
]
},
- "SuccessBasedRoutingConfig": {
- "type": "object",
- "properties": {
- "params": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/SuccessBasedRoutingConfigParams"
- },
- "nullable": true
- },
- "config": {
- "allOf": [
- {
- "$ref": "#/components/schemas/SuccessBasedRoutingConfigBody"
- }
- ],
- "nullable": true
- }
- }
- },
- "SuccessBasedRoutingConfigBody": {
- "type": "object",
- "properties": {
- "min_aggregates_size": {
- "type": "integer",
- "format": "int32",
- "nullable": true,
- "minimum": 0
- },
- "default_success_rate": {
- "type": "number",
- "format": "double",
- "nullable": true
- },
- "max_aggregates_size": {
- "type": "integer",
- "format": "int32",
- "nullable": true,
- "minimum": 0
- },
- "current_block_threshold": {
- "allOf": [
- {
- "$ref": "#/components/schemas/CurrentBlockThreshold"
- }
- ],
- "nullable": true
- }
- }
- },
- "SuccessBasedRoutingConfigParams": {
+ "SuccessBasedRoutingFeatures": {
"type": "string",
"enum": [
- "PaymentMethod",
- "PaymentMethodType",
- "Currency",
- "AuthenticationType"
+ "metrics",
+ "dynamic_connector_selection",
+ "none"
]
},
- "SuccessBasedRoutingUpdateConfigQuery": {
- "type": "object",
- "required": [
- "algorithm_id",
- "profile_id"
- ],
- "properties": {
- "algorithm_id": {
- "type": "string"
- },
- "profile_id": {
- "type": "string"
- }
- }
- },
"SurchargeDetailsResponse": {
"type": "object",
"required": [
@@ -23961,11 +23796,11 @@
"ToggleSuccessBasedRoutingQuery": {
"type": "object",
"required": [
- "status"
+ "enable"
],
"properties": {
- "status": {
- "type": "boolean"
+ "enable": {
+ "$ref": "#/components/schemas/SuccessBasedRoutingFeatures"
}
}
},
@@ -24880,7 +24715,8 @@
}
}
}
- ]
+ ],
+ "description": "Hyperswitch supports SDK integration with Apple Pay and Google Pay wallets. For other wallets, we integrate with their respective connectors, redirecting the customer to the connector for wallet payments. As a result, we don’t receive any payment method data in the confirm call for payments made through other wallets."
},
"WeChatPay": {
"type": "object"
diff --git a/api-reference/rust_locker_open_api_spec.yml b/api-reference/rust_locker_open_api_spec.yml
index 729886d9cd0d..17a19fec44da 100644
--- a/api-reference/rust_locker_open_api_spec.yml
+++ b/api-reference/rust_locker_open_api_spec.yml
@@ -2,16 +2,16 @@ openapi: "3.0.2"
info:
title: Tartarus - OpenAPI 3.0
description: |-
- This the the open API 3.0 specification for the card locker.
+ This is the OpenAPI 3.0 specification for the card locker.
This is used by the [hyperswitch](https://github.com/juspay/hyperswitch) for storing card information securely.
version: "1.0"
tags:
- name: Key Custodian
description: API used to initialize the locker after deployment.
- name: Data
- description: CRUD APIs to for working with data to be stored in the locker
+ description: CRUD APIs for working with data to be stored in the locker
- name: Cards
- description: CRUD APIs to for working with cards data to be stored in the locker (deprecated)
+ description: CRUD APIs for working with cards data to be stored in the locker (deprecated)
paths:
/custodian/key1:
post:
@@ -39,7 +39,7 @@ paths:
tags:
- Key Custodian
summary: Provide Key 2
- description: Provide the first key to unlock the locker
+ description: Provide the second key to unlock the locker
operationId: setKey2
requestBody:
description: Provide key 2 to unlock the locker
diff --git a/aws/hyperswitch_aws_setup.sh b/aws/hyperswitch_aws_setup.sh
index dd71b698e93e..e3af286a58da 100644
--- a/aws/hyperswitch_aws_setup.sh
+++ b/aws/hyperswitch_aws_setup.sh
@@ -38,12 +38,11 @@ echo "Creating Security Group for Application..."
export EC2_SG="application-sg"
-echo `(aws ec2 create-security-group \
+echo "$(aws ec2 create-security-group \
--region $REGION \
--group-name $EC2_SG \
--description "Security Group for Hyperswitch EC2 instance" \
---tag-specifications "ResourceType=security-group,Tags=[{Key=ManagedBy,Value=hyperswitch}]" \
-)`
+--tag-specifications "ResourceType=security-group,Tags=[{Key=ManagedBy,Value=hyperswitch}]")"
export APP_SG_ID=$(aws ec2 describe-security-groups --group-names $EC2_SG --region $REGION --output text --query 'SecurityGroups[0].GroupId')
@@ -51,24 +50,23 @@ echo "Security Group for Application CREATED.\n"
echo "Creating Security Group ingress for port 80..."
-echo `aws ec2 authorize-security-group-ingress \
+echo "$(aws ec2 authorize-security-group-ingress \
--group-id $APP_SG_ID \
--protocol tcp \
--port 80 \
--cidr 0.0.0.0/0 \
---region $REGION`
+--region $REGION)"
echo "Security Group ingress for port 80 CREATED.\n"
-
echo "Creating Security Group ingress for port 22..."
-echo `aws ec2 authorize-security-group-ingress \
+echo "$(aws ec2 authorize-security-group-ingress \
--group-id $APP_SG_ID \
--protocol tcp \
--port 22 \
--cidr 0.0.0.0/0 \
---region $REGION`
+--region $REGION)"
echo "Security Group ingress for port 22 CREATED.\n"
@@ -78,11 +76,11 @@ echo "Security Group ingress for port 22 CREATED.\n"
echo "Creating Security Group for Elasticache..."
export REDIS_GROUP_NAME=redis-sg
-echo `aws ec2 create-security-group \
+echo "$(aws ec2 create-security-group \
--group-name $REDIS_GROUP_NAME \
--description "SG attached to elasticache" \
--tag-specifications "ResourceType=security-group,Tags=[{Key=ManagedBy,Value=hyperswitch}]" \
---region $REGION`
+--region $REGION)"
echo "Security Group for Elasticache CREATED.\n"
@@ -91,12 +89,12 @@ echo "Creating Inbound rules for Redis..."
export REDIS_SG_ID=$(aws ec2 describe-security-groups --group-names $REDIS_GROUP_NAME --region $REGION --output text --query 'SecurityGroups[0].GroupId')
# CREATE INBOUND RULES
-echo `aws ec2 authorize-security-group-ingress \
+echo "$(aws ec2 authorize-security-group-ingress \
--group-id $REDIS_SG_ID \
--protocol tcp \
--port 6379 \
--source-group $EC2_SG \
---region $REGION`
+--region $REGION)"
echo "Inbound rules for Redis CREATED.\n"
@@ -105,11 +103,11 @@ echo "Inbound rules for Redis CREATED.\n"
echo "Creating Security Group for RDS..."
export RDS_GROUP_NAME=rds-sg
-echo `aws ec2 create-security-group \
+echo "$(aws ec2 create-security-group \
--group-name $RDS_GROUP_NAME \
--description "SG attached to RDS" \
--tag-specifications "ResourceType=security-group,Tags=[{Key=ManagedBy,Value=hyperswitch}]" \
---region $REGION`
+--region $REGION)"
echo "Security Group for RDS CREATED.\n"
@@ -118,21 +116,21 @@ echo "Creating Inbound rules for RDS..."
export RDS_SG_ID=$(aws ec2 describe-security-groups --group-names $RDS_GROUP_NAME --region $REGION --output text --query 'SecurityGroups[0].GroupId')
# CREATE INBOUND RULES
-echo `aws ec2 authorize-security-group-ingress \
+echo "$(aws ec2 authorize-security-group-ingress \
--group-id $RDS_SG_ID \
--protocol tcp \
--port 5432 \
--source-group $EC2_SG \
---region $REGION`
+--region $REGION)"
echo "Inbound rules for RDS CREATED.\n"
-echo `aws ec2 authorize-security-group-ingress \
+echo "$(aws ec2 authorize-security-group-ingress \
--group-id $RDS_SG_ID \
--protocol tcp \
--port 5432 \
--cidr 0.0.0.0/0 \
- --region $REGION`
+ --region $REGION)"
echo "Inbound rules for RDS (from any IP) CREATED.\n"
@@ -140,7 +138,7 @@ echo "Creating Elasticache with Redis engine..."
export CACHE_CLUSTER_ID=hyperswitch-cluster
-echo `aws elasticache create-cache-cluster \
+echo "$(aws elasticache create-cache-cluster \
--cache-cluster-id $CACHE_CLUSTER_ID \
--cache-node-type cache.t3.medium \
--engine redis \
@@ -148,14 +146,14 @@ echo `aws elasticache create-cache-cluster \
--security-group-ids $REDIS_SG_ID \
--engine-version 7.0 \
--tags "Key=ManagedBy,Value=hyperswitch" \
---region $REGION`
+--region $REGION)"
echo "Elasticache with Redis engine CREATED.\n"
echo "Creating RDS with PSQL..."
export DB_INSTANCE_ID=hyperswitch-db
-echo `aws rds create-db-instance \
+echo "$(aws rds create-db-instance \
--db-instance-identifier $DB_INSTANCE_ID\
--db-instance-class db.t3.micro \
--engine postgres \
@@ -166,7 +164,7 @@ echo `aws rds create-db-instance \
--region $REGION \
--db-name hyperswitch_db \
--tags "Key=ManagedBy,Value=hyperswitch" \
- --vpc-security-group-ids $RDS_SG_ID`
+ --vpc-security-group-ids $RDS_SG_ID)"
echo "RDS with PSQL CREATED.\n"
@@ -308,17 +306,17 @@ echo "EC2 instance launched.\n"
echo "Add Tags to EC2 instance..."
-echo `aws ec2 create-tags \
+echo "$(aws ec2 create-tags \
--resources $HYPERSWITCH_INSTANCE_ID \
--tags "Key=Name,Value=hyperswitch-router" \
---region $REGION`
+--region $REGION)"
echo "Tag added to EC2 instance.\n"
-echo `aws ec2 create-tags \
+echo "$(aws ec2 create-tags \
--resources $HYPERSWITCH_INSTANCE_ID \
--tags "Key=ManagedBy,Value=hyperswitch" \
---region $REGION`
+--region $REGION)"
echo "ManagedBy tag added to EC2 instance.\n"
diff --git a/aws/hyperswitch_cleanup_setup.sh b/aws/hyperswitch_cleanup_setup.sh
index 383f23d5bd00..df75623746c9 100644
--- a/aws/hyperswitch_cleanup_setup.sh
+++ b/aws/hyperswitch_cleanup_setup.sh
@@ -45,7 +45,7 @@ for cluster_arn in $ALL_ELASTIC_CACHE; do
if [[ $? -eq 0 ]]; then
echo -n "Delete $cluster_id (Y/n)? "
if yes_or_no; then
- echo `aws elasticache delete-cache-cluster --region $REGION --cache-cluster-id $cluster_id`
+ echo "$(aws elasticache delete-cache-cluster --region $REGION --cache-cluster-id $cluster_id)"
fi
fi
done
@@ -59,7 +59,7 @@ echo -n "Deleting ( $ALL_KEY_PAIRS ) key pairs? (Y/n)?"
if yes_or_no; then
for KEY_ID in $ALL_KEY_PAIRS; do
- echo `aws ec2 delete-key-pair --key-pair-id $KEY_ID --region $REGION`
+ echo "$(aws ec2 delete-key-pair --key-pair-id $KEY_ID --region $REGION)"
done
fi
@@ -78,7 +78,7 @@ echo -n "Terminating ( $ALL_INSTANCES ) instances? (Y/n)?"
if yes_or_no; then
for INSTANCE_ID in $ALL_INSTANCES; do
- echo `aws ec2 terminate-instances --instance-ids $INSTANCE_ID --region $REGION`
+ echo "$(aws ec2 terminate-instances --instance-ids $INSTANCE_ID --region $REGION)"
done
fi
@@ -105,15 +105,15 @@ for resource_id in $ALL_DB_RESOURCES; do
echo -n "Create a snapshot before deleting ( $DB_INSTANCE_ID ) the database (Y/n)? "
if yes_or_no; then
- echo `aws rds delete-db-instance \
+ echo "$(aws rds delete-db-instance \
--db-instance-identifier $DB_INSTANCE_ID \
--region $REGION \
- --final-db-snapshot-identifier hyperswitch-db-snapshot-`date +%s``
+ --final-db-snapshot-identifier hyperswitch-db-snapshot-$(date +%s))"
else
- echo `aws rds delete-db-instance \
+ echo "$(aws rds delete-db-instance \
--region $REGION \
--db-instance-identifier $DB_INSTANCE_ID \
- --skip-final-snapshot`
+ --skip-final-snapshot)"
fi
fi
fi
diff --git a/config/config.example.toml b/config/config.example.toml
index d6ac28548af9..ef7dcc560850 100644
--- a/config/config.example.toml
+++ b/config/config.example.toml
@@ -206,6 +206,7 @@ digitalvirgo.base_url = "https://dcb-integration-service-sandbox-external.stagin
dlocal.base_url = "https://sandbox.dlocal.com/"
dummyconnector.base_url = "http://localhost:8080/dummy-connector"
ebanx.base_url = "https://sandbox.ebanxpay.com/"
+elavon.base_url = "https://api.demo.convergepay.com"
fiserv.base_url = "https://cert.api.fiservapps.com/"
fiservemea.base_url = "https://prod.emea.api.fiservapps.com/sandbox"
fiuu.base_url = "https://sandbox.merchant.razer.com/"
@@ -219,6 +220,7 @@ gpayments.base_url = "https://{{merchant_endpoint_prefix}}-test.api.as1.gpayment
helcim.base_url = "https://api.helcim.com/"
iatapay.base_url = "https://sandbox.iata-pay.iata.org/api/v1"
itaubank.base_url = "https://sandbox.devportal.itau.com.br/"
+jpmorgan.base_url = "https://api-mock.payments.jpmorgan.com/api/v2"
klarna.base_url = "https://api{{klarna_region}}.playground.klarna.com/"
mifinity.base_url = "https://demo.mifinity.com/"
mollie.base_url = "https://api.mollie.com/v2/"
@@ -395,6 +397,7 @@ password_validity_in_days = 90 # Number of days after which password shoul
two_factor_auth_expiry_in_secs = 300 # Number of seconds after which 2FA should be done again if doing update/change from inside
totp_issuer_name = "Hyperswitch" # Name of the issuer for TOTP
base_url = "" # Base url used for user specific redirects and emails
+force_two_factor_auth = false # Whether to force two factor authentication for all users
#tokenization configuration which describe token lifetime and payment method for specific connector
[tokenization]
@@ -741,7 +744,7 @@ enabled = false
global_tenant = { schema = "public", redis_key_prefix = "", clickhouse_database = "default"}
[multitenancy.tenants]
-public = { name = "hyperswitch", base_url = "http://localhost:8080", schema = "public", redis_key_prefix = "", clickhouse_database = "default" } # schema -> Postgres db schema, redis_key_prefix -> redis key distinguisher, base_url -> url of the tenant
+public = { base_url = "http://localhost:8080", schema = "public", redis_key_prefix = "", clickhouse_database = "default" } # schema -> Postgres db schema, redis_key_prefix -> redis key distinguisher, base_url -> url of the tenant
[user_auth_methods]
encryption_key = "" # Encryption key used for encrypting data in user_authentication_methods table
diff --git a/config/deployments/env_specific.toml b/config/deployments/env_specific.toml
index fd25b18fd8cd..fa0c0484a773 100644
--- a/config/deployments/env_specific.toml
+++ b/config/deployments/env_specific.toml
@@ -305,7 +305,7 @@ enabled = false
global_tenant = { schema = "public", redis_key_prefix = "", clickhouse_database = "default"}
[multitenancy.tenants]
-public = { name = "hyperswitch", base_url = "http://localhost:8080", schema = "public", redis_key_prefix = "", clickhouse_database = "default" }
+public = { base_url = "http://localhost:8080", schema = "public", redis_key_prefix = "", clickhouse_database = "default" }
[user_auth_methods]
encryption_key = "user_auth_table_encryption_key" # Encryption key used for encrypting data in user_authentication_methods table
diff --git a/config/deployments/integration_test.toml b/config/deployments/integration_test.toml
index dafc6048154e..ebc1e36d1591 100644
--- a/config/deployments/integration_test.toml
+++ b/config/deployments/integration_test.toml
@@ -48,6 +48,7 @@ digitalvirgo.base_url = "https://dcb-integration-service-sandbox-external.stagin
dlocal.base_url = "https://sandbox.dlocal.com/"
dummyconnector.base_url = "http://localhost:8080/dummy-connector"
ebanx.base_url = "https://sandbox.ebanxpay.com/"
+elavon.base_url = "https://api.demo.convergepay.com"
fiserv.base_url = "https://cert.api.fiservapps.com/"
fiservemea.base_url = "https://prod.emea.api.fiservapps.com/sandbox"
fiuu.base_url = "https://sandbox.merchant.razer.com/"
@@ -61,6 +62,7 @@ gpayments.base_url = "https://{{merchant_endpoint_prefix}}-test.api.as1.gpayment
helcim.base_url = "https://api.helcim.com/"
iatapay.base_url = "https://sandbox.iata-pay.iata.org/api/v1"
itaubank.base_url = "https://sandbox.devportal.itau.com.br/"
+jpmorgan.base_url = "https://api-mock.payments.jpmorgan.com/api/v2"
klarna.base_url = "https://api{{klarna_region}}.playground.klarna.com/"
mifinity.base_url = "https://demo.mifinity.com/"
mollie.base_url = "https://api.mollie.com/v2/"
@@ -138,6 +140,7 @@ password_validity_in_days = 90
two_factor_auth_expiry_in_secs = 300
totp_issuer_name = "Hyperswitch Integ"
base_url = "https://integ.hyperswitch.io"
+force_two_factor_auth = false
[frm]
enabled = true
@@ -196,7 +199,7 @@ alfamart = { country = "ID", currency = "IDR" }
ali_pay = { country = "AU,JP,HK,SG,MY,TH,ES,GB,SE,NO,AT,NL,DE,CY,CH,BE,FR,DK,FI,RO,MT,SI,GR,PT,IE,IT,CA,US", currency = "USD,EUR,GBP,JPY,AUD,SGD,CHF,SEK,NOK,NZD,THB,HKD,CAD" }
ali_pay_hk = { country = "HK", currency = "HKD" }
alma = { country = "FR", currency = "EUR" }
-apple_pay = { country = "AU,NZ,CN,JP,HK,SG,MY,BH,AE,KW,BR,ES,GB,SE,NO,AT,NL,DE,HU,CY,LU,CH,BE,FR,DK,FI,RO,HR,LI,UA,MT,SI,GR,PT,IE,CZ,EE,LT,LV,IT,PL,IS,CA,US", currency = "AUD,CHF,CAD,EUR,GBP,HKD,SGD,USD" }
+apple_pay = { country = "AU,NZ,CN,JP,HK,SG,MY,BH,AE,KW,BR,ES,GB,SE,NO,AT,NL,DE,HU,CY,LU,CH,BE,FR,DK,FI,RO,HR,LI,UA,MT,SI,GR,PT,IE,CZ,EE,LT,LV,IT,PL,IS,CA,US", currency = "AUD,CHF,CAD,EUR,GBP,HKD,SGD,USD,MYR" }
atome = { country = "MY,SG", currency = "MYR,SGD" }
bacs = { country = "GB", currency = "GBP" }
bancontact_card = { country = "BE", currency = "EUR" }
@@ -341,6 +344,9 @@ red_pagos = { country = "UY", currency = "UYU" }
[pm_filters.zsl]
local_bank_transfer = { country = "CN", currency = "CNY" }
+[pm_filters.fiuu]
+duit_now = { country ="MY", currency = "MYR" }
+
[payout_method_filters.adyenplatform]
sepa = { country = "ES,SK,AT,NL,DE,BE,FR,FI,PT,IE,EE,LT,LV,IT,CZ,DE,HU,NO,PL,SE,GB,CH" , currency = "EUR,CZK,DKK,HUF,NOK,PLN,SEK,GBP,CHF" }
@@ -391,4 +397,4 @@ connector_list = ""
card_networks = "Visa, AmericanExpress, Mastercard"
[network_tokenization_supported_connectors]
-connector_list = "cybersource"
\ No newline at end of file
+connector_list = "cybersource"
diff --git a/config/deployments/production.toml b/config/deployments/production.toml
index caf8c0305683..ef1ee42b9e67 100644
--- a/config/deployments/production.toml
+++ b/config/deployments/production.toml
@@ -52,6 +52,7 @@ digitalvirgo.base_url = "https://dcb-integration-service-sandbox-external.stagin
dlocal.base_url = "https://sandbox.dlocal.com/"
dummyconnector.base_url = "http://localhost:8080/dummy-connector"
ebanx.base_url = "https://sandbox.ebanxpay.com/"
+elavon.base_url = "https://api.convergepay.com"
fiserv.base_url = "https://cert.api.fiservapps.com/"
fiservemea.base_url = "https://prod.emea.api.fiservapps.com"
fiuu.base_url = "https://pay.merchant.razer.com/"
@@ -65,6 +66,7 @@ gpayments.base_url = "https://{{merchant_endpoint_prefix}}-test.api.as1.gpayment
helcim.base_url = "https://api.helcim.com/"
iatapay.base_url = "https://iata-pay.iata.org/api/v1"
itaubank.base_url = "https://secure.api.itau/"
+jpmorgan.base_url = "https://api-ms.payments.jpmorgan.com/api/v2"
klarna.base_url = "https://api{{klarna_region}}.klarna.com/"
mifinity.base_url = "https://secure.mifinity.com/"
mollie.base_url = "https://api.mollie.com/v2/"
@@ -145,6 +147,7 @@ password_validity_in_days = 90
two_factor_auth_expiry_in_secs = 300
totp_issuer_name = "Hyperswitch Production"
base_url = "https://live.hyperswitch.io"
+force_two_factor_auth = false
[frm]
enabled = false
@@ -209,7 +212,7 @@ alfamart = { country = "ID", currency = "IDR" }
ali_pay = { country = "AU,JP,HK,SG,MY,TH,ES,GB,SE,NO,AT,NL,DE,CY,CH,BE,FR,DK,FI,RO,MT,SI,GR,PT,IE,IT,CA,US", currency = "USD,EUR,GBP,JPY,AUD,SGD,CHF,SEK,NOK,NZD,THB,HKD,CAD" }
ali_pay_hk = { country = "HK", currency = "HKD" }
alma = { country = "FR", currency = "EUR" }
-apple_pay = { country = "AE,AM,AR,AT,AU,AZ,BE,BG,BH,BR,BY,CA,CH,CN,CO,CR,CY,CZ,DE,DK,EE,ES,FI,FO,FR,GB,GE,GG,GL,GR,HK,HR,HU,IE,IL,IM,IS,IT,JE,JO,JP,KW,KZ,LI,LT,LU,LV,MC,MD,ME,MO,MT,MX,MY,NL,NO,NZ,PE,PL,PS,PT,QA,RO,RS,SA,SE,SG,SI,SK,SM,TW,UA,GB,UM,US", currency = "AUD,CHF,CAD,EUR,GBP,HKD,SGD,USD" }
+apple_pay = { country = "AE,AM,AR,AT,AU,AZ,BE,BG,BH,BR,BY,CA,CH,CN,CO,CR,CY,CZ,DE,DK,EE,ES,FI,FO,FR,GB,GE,GG,GL,GR,HK,HR,HU,IE,IL,IM,IS,IT,JE,JO,JP,KW,KZ,LI,LT,LU,LV,MC,MD,ME,MO,MT,MX,MY,NL,NO,NZ,PE,PL,PS,PT,QA,RO,RS,SA,SE,SG,SI,SK,SM,TW,UA,GB,UM,US", currency = "AUD,CHF,CAD,EUR,GBP,HKD,SGD,USD,MYR" }
atome = { country = "MY,SG", currency = "MYR,SGD" }
bacs = { country = "GB", currency = "GBP" }
bancontact_card = { country = "BE", currency = "EUR" }
@@ -354,6 +357,10 @@ red_pagos = { country = "UY", currency = "UYU" }
[pm_filters.zsl]
local_bank_transfer = { country = "CN", currency = "CNY" }
+
+[pm_filters.fiuu]
+duit_now = { country ="MY", currency = "MYR" }
+
[payout_method_filters.adyenplatform]
sepa = { country = "ES,SK,AT,NL,DE,BE,FR,FI,PT,IE,EE,LT,LV,IT,CZ,DE,HU,NO,PL,SE,GB,CH" , currency = "EUR,CZK,DKK,HUF,NOK,PLN,SEK,GBP,CHF" }
@@ -404,4 +411,4 @@ connector_list = ""
card_networks = "Visa, AmericanExpress, Mastercard"
[network_tokenization_supported_connectors]
-connector_list = "cybersource"
\ No newline at end of file
+connector_list = "cybersource"
diff --git a/config/deployments/sandbox.toml b/config/deployments/sandbox.toml
index 6cc1193ab558..a09dba1a9a66 100644
--- a/config/deployments/sandbox.toml
+++ b/config/deployments/sandbox.toml
@@ -52,6 +52,7 @@ digitalvirgo.base_url = "https://dcb-integration-service-sandbox-external.stagin
dlocal.base_url = "https://sandbox.dlocal.com/"
dummyconnector.base_url = "http://localhost:8080/dummy-connector"
ebanx.base_url = "https://sandbox.ebanxpay.com/"
+elavon.base_url = "https://api.demo.convergepay.com"
fiserv.base_url = "https://cert.api.fiservapps.com/"
fiservemea.base_url = "https://prod.emea.api.fiservapps.com/sandbox"
fiuu.base_url = "https://sandbox.merchant.razer.com/"
@@ -65,6 +66,7 @@ gpayments.base_url = "https://{{merchant_endpoint_prefix}}-test.api.as1.gpayment
helcim.base_url = "https://api.helcim.com/"
iatapay.base_url = "https://sandbox.iata-pay.iata.org/api/v1"
itaubank.base_url = "https://sandbox.devportal.itau.com.br/"
+jpmorgan.base_url = "https://api-mock.payments.jpmorgan.com/api/v2"
klarna.base_url = "https://api{{klarna_region}}.playground.klarna.com/"
mifinity.base_url = "https://demo.mifinity.com/"
mollie.base_url = "https://api.mollie.com/v2/"
@@ -145,6 +147,7 @@ password_validity_in_days = 90
two_factor_auth_expiry_in_secs = 300
totp_issuer_name = "Hyperswitch Sandbox"
base_url = "https://app.hyperswitch.io"
+force_two_factor_auth = false
[frm]
enabled = true
@@ -212,7 +215,7 @@ alfamart = { country = "ID", currency = "IDR" }
ali_pay = { country = "AU,JP,HK,SG,MY,TH,ES,GB,SE,NO,AT,NL,DE,CY,CH,BE,FR,DK,FI,RO,MT,SI,GR,PT,IE,IT,CA,US", currency = "USD,EUR,GBP,JPY,AUD,SGD,CHF,SEK,NOK,NZD,THB,HKD,CAD" }
ali_pay_hk = { country = "HK", currency = "HKD" }
alma = { country = "FR", currency = "EUR" }
-apple_pay = { country = "AU,NZ,CN,JP,HK,SG,MY,BH,AE,KW,BR,ES,GB,SE,NO,AT,NL,DE,HU,CY,LU,CH,BE,FR,DK,FI,RO,HR,LI,UA,MT,SI,GR,PT,IE,CZ,EE,LT,LV,IT,PL,IS,CA,US", currency = "AUD,CHF,CAD,EUR,GBP,HKD,SGD,USD" }
+apple_pay = { country = "AU,NZ,CN,JP,HK,SG,MY,BH,AE,KW,BR,ES,GB,SE,NO,AT,NL,DE,HU,CY,LU,CH,BE,FR,DK,FI,RO,HR,LI,UA,MT,SI,GR,PT,IE,CZ,EE,LT,LV,IT,PL,IS,CA,US", currency = "AUD,CHF,CAD,EUR,GBP,HKD,SGD,USD,MYR" }
atome = { country = "MY,SG", currency = "MYR,SGD" }
bacs = { country = "GB", currency = "GBP" }
bancontact_card = { country = "BE", currency = "EUR" }
@@ -340,10 +343,10 @@ upi_collect = {country = "IN", currency = "INR"}
open_banking_pis = {currency = "EUR,GBP"}
[pm_filters.worldpay]
-debit = { country = "AF,DZ,AW,AU,AZ,BS,BH,BD,BB,BZ,BM,BT,BO,BA,BW,BR,BN,BG,BI,KH,CA,CV,KY,CL,CO,KM,CD,CR,CZ,DK,DJ,ST,DO,EC,EG,SV,ER,ET,FK,FJ,GM,GE,GH,GI,GT,GN,GY,HT,HN,HK,HU,IS,IN,ID,IR,IQ,IE,IL,IT,JM,JP,JO,KZ,KE,KW,LA,LB,LS,LR,LY,LT,MO,MK,MG,MW,MY,MV,MR,MU,MX,MD,MN,MA,MZ,MM,NA,NZ,NI,NG,KP,NO,AR,PK,PG,PY,PE,UY,PH,PL,GB,QA,OM,RO,RU,RW,WS,SAR,RSD,SCR,SLL,SG,ST,SBD,SOS,ZA,KR,LK,SH,SD,SR,SZ,SE,CH,SY,TW,TJ,TZ,TH,TT,TN,TR,TMT,AED,UG,UA,US,UZ,VU,VE,VN,YER,CNY,ZM,ZW", currency = "AFN,DZD,ANG,AWG,AUD,AZN,BSD,BHD,BDT,BBD,BZD,BMD,BTN,BOB,BAM,BWP,BRL,BND,BGN,BIF,KHR,CAD,CVE,KYD,XOF,XAF,XPF,CLP,COP,KMF,CDF,CRC,EUR,CZK,DKK,DJF,DOP,XCD,EGP,SVC,ERN,ETB,EUR,FKP,FJD,GMD,GEL,GHS,GIP,GTQ,GNF,GYD,HTG,HNL,HKD,HUF,ISK,INR,IDR,IRR,IQD,ILS,JMD,JPY,JOD,KZT,KES,KWD,LAK,LBP,LSL,LRD,LYD,MOP,MKD,MGA,MWK,MYR,MVR,MRU,MUR,MXN,MDL,MNT,MAD,MZN,MMK,NAD,NPR,NZD,NIO,NGN,KPW,NOK,ARS,PKR,PAB,PGK,PYG,PEN,UYU,PHP,PLN,GBP,QAR,OMR,RON,RUB,RWF,WST,SAR,RSD,SCR,SLL,SGD,STN,SBD,SOS,ZAR,KRW,LKR,SHP,SDG,SRD,SZL,SEK,CHF,SYP,TWD,TJS,TZS,THB,TOP,TTD,TND,TRY,TMT,AED,UGX,UAH,USD,UZS,VUV,VND,YER,CNY,ZMW,ZWL" }
-credit = { country = "AF,DZ,AW,AU,AZ,BS,BH,BD,BB,BZ,BM,BT,BO,BA,BW,BR,BN,BG,BI,KH,CA,CV,KY,CL,CO,KM,CD,CR,CZ,DK,DJ,ST,DO,EC,EG,SV,ER,ET,FK,FJ,GM,GE,GH,GI,GT,GN,GY,HT,HN,HK,HU,IS,IN,ID,IR,IQ,IE,IL,IT,JM,JP,JO,KZ,KE,KW,LA,LB,LS,LR,LY,LT,MO,MK,MG,MW,MY,MV,MR,MU,MX,MD,MN,MA,MZ,MM,NA,NZ,NI,NG,KP,NO,AR,PK,PG,PY,PE,UY,PH,PL,GB,QA,OM,RO,RU,RW,WS,SAR,RSD,SCR,SLL,SG,ST,SBD,SOS,ZA,KR,LK,SH,SD,SR,SZ,SE,CH,SY,TW,TJ,TZ,TH,TT,TN,TR,TMT,AED,UG,UA,US,UZ,VU,VE,VN,YER,CNY,ZM,ZW", currency = "AFN,DZD,ANG,AWG,AUD,AZN,BSD,BHD,BDT,BBD,BZD,BMD,BTN,BOB,BAM,BWP,BRL,BND,BGN,BIF,KHR,CAD,CVE,KYD,XOF,XAF,XPF,CLP,COP,KMF,CDF,CRC,EUR,CZK,DKK,DJF,DOP,XCD,EGP,SVC,ERN,ETB,EUR,FKP,FJD,GMD,GEL,GHS,GIP,GTQ,GNF,GYD,HTG,HNL,HKD,HUF,ISK,INR,IDR,IRR,IQD,ILS,JMD,JPY,JOD,KZT,KES,KWD,LAK,LBP,LSL,LRD,LYD,MOP,MKD,MGA,MWK,MYR,MVR,MRU,MUR,MXN,MDL,MNT,MAD,MZN,MMK,NAD,NPR,NZD,NIO,NGN,KPW,NOK,ARS,PKR,PAB,PGK,PYG,PEN,UYU,PHP,PLN,GBP,QAR,OMR,RON,RUB,RWF,WST,SAR,RSD,SCR,SLL,SGD,STN,SBD,SOS,ZAR,KRW,LKR,SHP,SDG,SRD,SZL,SEK,CHF,SYP,TWD,TJS,TZS,THB,TOP,TTD,TND,TRY,TMT,AED,UGX,UAH,USD,UZS,VUV,VND,YER,CNY,ZMW,ZWL" }
-apple_pay.country = "AU,CN,HK,JP,MO,MY,NZ,SG,TW,AM,AT,AZ,BY,BE,BG,HR,CY,CZ,DK,EE,FO,FI,FR,GE,DE,GR,GL,GG,HU,IS,IE,IM,IT,KZ,JE,LV,LI,LT,LU,MT,MD,MC,ME,NL,NO,PL,PT,RO,SM,RS,SK,SI,ES,SE,CH,UA,GB,AR,CO,CR,BR,MX,PE,BH,IL,JO,KW,PS,QA,SA,AE,CA,UM,US"
-google_pay.country = "AL,DZ,AS,AO,AG,AR,AU,AT,AZ,BH,BY,BE,BR,BG,CA,CL,CO,HR,CZ,DK,DO,EG,EE,FI,FR,DE,GR,HK,HU,IN,ID,IE,IL,IT,JP,JO,KZ,KE,KW,LV,LB,LT,LU,MY,MX,NL,NZ,NO,OM,PK,PA,PE,PH,PL,PT,QA,RO,RU,SA,SG,SK,ZA,ES,LK,SE,CH,TW,TH,TR,UA,AE,GB,US,UY,VN"
+debit = { country = "AF,DZ,AW,AU,AZ,BS,BH,BD,BB,BZ,BM,BT,BO,BA,BW,BR,BN,BG,BI,KH,CA,CV,KY,CL,CO,KM,CD,CR,CZ,DK,DJ,ST,DO,EC,EG,SV,ER,ET,FK,FJ,GM,GE,GH,GI,GT,GN,GY,HT,HN,HK,HU,IS,IN,ID,IR,IQ,IE,IL,IT,JM,JP,JO,KZ,KE,KW,LA,LB,LS,LR,LY,LT,MO,MK,MG,MW,MY,MV,MR,MU,MX,MD,MN,MA,MZ,MM,NA,NZ,NI,NG,KP,NO,AR,PK,PG,PY,PE,UY,PH,PL,GB,QA,OM,RO,RU,RW,WS,SG,ST,ZA,KR,LK,SH,SD,SR,SZ,SE,CH,SY,TW,TJ,TZ,TH,TT,TN,TR,UG,UA,US,UZ,VU,VE,VN,ZM,ZW", currency = "AFN,DZD,ANG,AWG,AUD,AZN,BSD,BHD,BDT,BBD,BZD,BMD,BTN,BOB,BAM,BWP,BRL,BND,BGN,BIF,KHR,CAD,CVE,KYD,XOF,XAF,XPF,CLP,COP,KMF,CDF,CRC,EUR,CZK,DKK,DJF,DOP,XCD,EGP,SVC,ERN,ETB,EUR,FKP,FJD,GMD,GEL,GHS,GIP,GTQ,GNF,GYD,HTG,HNL,HKD,HUF,ISK,INR,IDR,IRR,IQD,ILS,JMD,JPY,JOD,KZT,KES,KWD,LAK,LBP,LSL,LRD,LYD,MOP,MKD,MGA,MWK,MYR,MVR,MRU,MUR,MXN,MDL,MNT,MAD,MZN,MMK,NAD,NPR,NZD,NIO,NGN,KPW,NOK,ARS,PKR,PAB,PGK,PYG,PEN,UYU,PHP,PLN,GBP,QAR,OMR,RON,RUB,RWF,WST,SAR,RSD,SCR,SLL,SGD,STN,SBD,SOS,ZAR,KRW,LKR,SHP,SDG,SRD,SZL,SEK,CHF,SYP,TWD,TJS,TZS,THB,TOP,TTD,TND,TRY,TMT,AED,UGX,UAH,USD,UZS,VUV,VND,YER,CNY,ZMW,ZWL" }
+credit = { country = "AF,DZ,AW,AU,AZ,BS,BH,BD,BB,BZ,BM,BT,BO,BA,BW,BR,BN,BG,BI,KH,CA,CV,KY,CL,CO,KM,CD,CR,CZ,DK,DJ,ST,DO,EC,EG,SV,ER,ET,FK,FJ,GM,GE,GH,GI,GT,GN,GY,HT,HN,HK,HU,IS,IN,ID,IR,IQ,IE,IL,IT,JM,JP,JO,KZ,KE,KW,LA,LB,LS,LR,LY,LT,MO,MK,MG,MW,MY,MV,MR,MU,MX,MD,MN,MA,MZ,MM,NA,NZ,NI,NG,KP,NO,AR,PK,PG,PY,PE,UY,PH,PL,GB,QA,OM,RO,RU,RW,WS,SG,ST,ZA,KR,LK,SH,SD,SR,SZ,SE,CH,SY,TW,TJ,TZ,TH,TT,TN,TR,UG,UA,US,UZ,VU,VE,VN,ZM,ZW", currency = "AFN,DZD,ANG,AWG,AUD,AZN,BSD,BHD,BDT,BBD,BZD,BMD,BTN,BOB,BAM,BWP,BRL,BND,BGN,BIF,KHR,CAD,CVE,KYD,XOF,XAF,XPF,CLP,COP,KMF,CDF,CRC,EUR,CZK,DKK,DJF,DOP,XCD,EGP,SVC,ERN,ETB,EUR,FKP,FJD,GMD,GEL,GHS,GIP,GTQ,GNF,GYD,HTG,HNL,HKD,HUF,ISK,INR,IDR,IRR,IQD,ILS,JMD,JPY,JOD,KZT,KES,KWD,LAK,LBP,LSL,LRD,LYD,MOP,MKD,MGA,MWK,MYR,MVR,MRU,MUR,MXN,MDL,MNT,MAD,MZN,MMK,NAD,NPR,NZD,NIO,NGN,KPW,NOK,ARS,PKR,PAB,PGK,PYG,PEN,UYU,PHP,PLN,GBP,QAR,OMR,RON,RUB,RWF,WST,SAR,RSD,SCR,SLL,SGD,STN,SBD,SOS,ZAR,KRW,LKR,SHP,SDG,SRD,SZL,SEK,CHF,SYP,TWD,TJS,TZS,THB,TOP,TTD,TND,TRY,TMT,AED,UGX,UAH,USD,UZS,VUV,VND,YER,CNY,ZMW,ZWL" }
+google_pay = { country = "AL,DZ,AS,AO,AG,AR,AU,AT,AZ,BH,BY,BE,BR,BG,CA,CL,CO,HR,CZ,DK,DO,EG,EE,FI,FR,DE,GR,HK,HU,IN,ID,IE,IL,IT,JP,JO,KZ,KE,KW,LV,LB,LT,LU,MY,MX,NL,NZ,NO,OM,PK,PA,PE,PH,PL,PT,QA,RO,RU,SA,SG,SK,ZA,ES,LK,SE,CH,TW,TH,TR,UA,AE,GB,US,UY,VN" }
+apple_pay = { country = "AU,CN,HK,JP,MO,MY,NZ,SG,TW,AM,AT,AZ,BY,BE,BG,HR,CY,CZ,DK,EE,FO,FI,FR,GE,DE,GR,GL,GG,HU,IS,IE,IM,IT,KZ,JE,LV,LI,LT,LU,MT,MD,MC,ME,NL,NO,PL,PT,RO,SM,RS,SK,SI,ES,SE,CH,UA,GB,AR,CO,CR,BR,MX,PE,BH,IL,JO,KW,PS,QA,SA,AE,CA,UM,US" }
[pm_filters.zen]
boleto = { country = "BR", currency = "BRL" }
@@ -358,6 +361,10 @@ red_pagos = { country = "UY", currency = "UYU" }
[pm_filters.zsl]
local_bank_transfer = { country = "CN", currency = "CNY" }
+
+[pm_filters.fiuu]
+duit_now = { country ="MY", currency = "MYR" }
+
[payout_method_filters.adyenplatform]
sepa = { country = "ES,SK,AT,NL,DE,BE,FR,FI,PT,IE,EE,LT,LV,IT,CZ,DE,HU,NO,PL,SE,GB,CH" , currency = "EUR,CZK,DKK,HUF,NOK,PLN,SEK,GBP,CHF" }
diff --git a/config/development.toml b/config/development.toml
index 8e5d9582e2f7..46d6378f0832 100644
--- a/config/development.toml
+++ b/config/development.toml
@@ -118,6 +118,7 @@ cards = [
"dlocal",
"dummyconnector",
"ebanx",
+ "elavon",
"fiserv",
"fiservemea",
"fiuu",
@@ -129,6 +130,7 @@ cards = [
"helcim",
"iatapay",
"itaubank",
+ "jpmorgan",
"mollie",
"multisafepay",
"netcetera",
@@ -216,6 +218,7 @@ digitalvirgo.base_url = "https://dcb-integration-service-sandbox-external.stagin
dlocal.base_url = "https://sandbox.dlocal.com/"
dummyconnector.base_url = "http://localhost:8080/dummy-connector"
ebanx.base_url = "https://sandbox.ebanxpay.com/"
+elavon.base_url = "https://api.demo.convergepay.com"
fiserv.base_url = "https://cert.api.fiservapps.com/"
fiservemea.base_url = "https://prod.emea.api.fiservapps.com/sandbox"
fiuu.base_url = "https://sandbox.merchant.razer.com/"
@@ -229,6 +232,7 @@ gpayments.base_url = "https://{{merchant_endpoint_prefix}}-test.api.as1.gpayment
helcim.base_url = "https://api.helcim.com/"
iatapay.base_url = "https://sandbox.iata-pay.iata.org/api/v1"
itaubank.base_url = "https://sandbox.devportal.itau.com.br/"
+jpmorgan.base_url = "https://api-mock.payments.jpmorgan.com/api/v2"
klarna.base_url = "https://api{{klarna_region}}.playground.klarna.com/"
mifinity.base_url = "https://demo.mifinity.com/"
mollie.base_url = "https://api.mollie.com/v2/"
@@ -316,6 +320,7 @@ password_validity_in_days = 90
two_factor_auth_expiry_in_secs = 300
totp_issuer_name = "Hyperswitch Dev"
base_url = "http://localhost:8080"
+force_two_factor_auth = false
[bank_config.eps]
stripe = { banks = "arzte_und_apotheker_bank,austrian_anadi_bank_ag,bank_austria,bankhaus_carl_spangler,bankhaus_schelhammer_und_schattera_ag,bawag_psk_ag,bks_bank_ag,brull_kallmus_bank_ag,btv_vier_lander_bank,capital_bank_grawe_gruppe_ag,dolomitenbank,easybank_ag,erste_bank_und_sparkassen,hypo_alpeadriabank_international_ag,hypo_noe_lb_fur_niederosterreich_u_wien,hypo_oberosterreich_salzburg_steiermark,hypo_tirol_bank_ag,hypo_vorarlberg_bank_ag,hypo_bank_burgenland_aktiengesellschaft,marchfelder_bank,oberbank_ag,raiffeisen_bankengruppe_osterreich,schoellerbank_ag,sparda_bank_wien,volksbank_gruppe,volkskreditbank_ag,vr_bank_braunau" }
@@ -383,7 +388,7 @@ open_banking_pis = {currency = "EUR,GBP"}
[pm_filters.adyen]
google_pay = { country = "AU,NZ,JP,HK,SG,MY,TH,VN,BH,AE,KW,BR,ES,GB,SE,NO,SK,AT,NL,DE,HU,CY,LU,CH,BE,FR,DK,RO,HR,LI,MT,SI,GR,PT,IE,CZ,EE,LT,LV,IT,PL,TR,IS,CA,US", currency = "AED,ALL,AMD,ANG,AOA,ARS,AUD,AWG,AZN,BAM,BBD,BDT,BGN,BHD,BMD,BND,BOB,BRL,BSD,BWP,BYN,BZD,CAD,CHF,CLP,CNY,COP,CRC,CUP,CVE,CZK,DJF,DKK,DOP,DZD,EGP,ETB,EUR,FJD,FKP,GBP,GEL,GHS,GIP,GMD,GNF,GTQ,GYD,HKD,HNL,HTG,HUF,IDR,ILS,INR,IQD,JMD,JOD,JPY,KES,KGS,KHR,KMF,KRW,KWD,KYD,KZT,LAK,LBP,LKR,LYD,MAD,MDL,MKD,MMK,MNT,MOP,MRU,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SEK,SGD,SHP,SLE,SOS,SRD,STN,SVC,SZL,THB,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW" }
-apple_pay = { country = "AU,NZ,CN,JP,HK,SG,MY,BH,AE,KW,BR,ES,GB,SE,NO,AT,NL,DE,HU,CY,LU,CH,BE,FR,DK,FI,RO,HR,LI,UA,MT,SI,GR,PT,IE,CZ,EE,LT,LV,IT,PL,IS,CA,US", currency = "AUD,CHF,CAD,EUR,GBP,HKD,SGD,USD" }
+apple_pay = { country = "AU,NZ,CN,JP,HK,SG,MY,BH,AE,KW,BR,ES,GB,SE,NO,AT,NL,DE,HU,CY,LU,CH,BE,FR,DK,FI,RO,HR,LI,UA,MT,SI,GR,PT,IE,CZ,EE,LT,LV,IT,PL,IS,CA,US", currency = "AUD,CHF,CAD,EUR,GBP,HKD,SGD,USD,MYR" }
paypal = { country = "AU,NZ,CN,JP,HK,MY,TH,KR,PH,ID,AE,KW,BR,ES,GB,SE,NO,SK,AT,NL,DE,HU,CY,LU,CH,BE,FR,DK,FI,RO,HR,UA,MT,SI,GI,PT,IE,CZ,EE,LT,LV,IT,PL,IS,CA,US", currency = "AUD,BRL,CAD,CZK,DKK,EUR,HKD,HUF,INR,JPY,MYR,MXN,NZD,NOK,PHP,PLN,RUB,GBP,SGD,SEK,CHF,THB,USD" }
mobile_pay = { country = "DK,FI", currency = "DKK,SEK,NOK,EUR" }
ali_pay = { country = "AU,JP,HK,SG,MY,TH,ES,GB,SE,NO,AT,NL,DE,CY,CH,BE,FR,DK,FI,RO,MT,SI,GR,PT,IE,IT,CA,US", currency = "USD,EUR,GBP,JPY,AUD,SGD,CHF,SEK,NOK,NZD,THB,HKD,CAD" }
@@ -531,6 +536,9 @@ region = ""
credit = { currency = "USD" }
debit = { currency = "USD" }
+[pm_filters.fiuu]
+duit_now = { country ="MY", currency = "MYR" }
+
[tokenization]
stripe = { long_lived_token = false, payment_method = "wallet", payment_method_type = { type = "disable_only", list = "google_pay" } }
checkout = { long_lived_token = false, payment_method = "wallet", apple_pay_pre_decrypt_flow = "network_tokenization" }
@@ -590,8 +598,8 @@ pay_later.klarna = { connector_list = "adyen" }
wallet.google_pay = { connector_list = "stripe,adyen,cybersource,bankofamerica" }
wallet.apple_pay = { connector_list = "stripe,adyen,cybersource,noon,bankofamerica" }
wallet.paypal = { connector_list = "adyen" }
-card.credit = { connector_list = "stripe,adyen,authorizedotnet,cybersource,globalpay,worldpay,multisafepay,nmi,nexinets,noon,bankofamerica,braintree" }
-card.debit = { connector_list = "stripe,adyen,authorizedotnet,cybersource,globalpay,worldpay,multisafepay,nmi,nexinets,noon,bankofamerica,braintree" }
+card.credit = { connector_list = "stripe,adyen,authorizedotnet,cybersource,globalpay,worldpay,multisafepay,nmi,nexinets,noon,bankofamerica,braintree,fiuu" }
+card.debit = { connector_list = "stripe,adyen,authorizedotnet,cybersource,globalpay,worldpay,multisafepay,nmi,nexinets,noon,bankofamerica,braintree,fiuu" }
bank_debit.ach = { connector_list = "gocardless,adyen" }
bank_debit.becs = { connector_list = "gocardless" }
bank_debit.bacs = { connector_list = "adyen" }
@@ -747,7 +755,7 @@ enabled = false
global_tenant = { schema = "public", redis_key_prefix = "", clickhouse_database = "default"}
[multitenancy.tenants]
-public = { name = "hyperswitch", base_url = "http://localhost:8080", schema = "public", redis_key_prefix = "", clickhouse_database = "default"}
+public = { base_url = "http://localhost:8080", schema = "public", redis_key_prefix = "", clickhouse_database = "default"}
[user_auth_methods]
encryption_key = "A8EF32E029BC3342E54BF2E172A4D7AA43E8EF9D2C3A624A9F04E2EF79DC698F"
diff --git a/config/docker_compose.toml b/config/docker_compose.toml
index dde0902af912..5a2e7249fda4 100644
--- a/config/docker_compose.toml
+++ b/config/docker_compose.toml
@@ -56,6 +56,7 @@ password_validity_in_days = 90
two_factor_auth_expiry_in_secs = 300
totp_issuer_name = "Hyperswitch"
base_url = "http://localhost:8080"
+force_two_factor_auth = false
[locker]
host = ""
@@ -135,6 +136,7 @@ digitalvirgo.base_url = "https://dcb-integration-service-sandbox-external.stagin
dlocal.base_url = "https://sandbox.dlocal.com/"
dummyconnector.base_url = "http://localhost:8080/dummy-connector"
ebanx.base_url = "https://sandbox.ebanxpay.com/"
+elavon.base_url = "https://api.demo.convergepay.com"
fiserv.base_url = "https://cert.api.fiservapps.com/"
fiservemea.base_url = "https://prod.emea.api.fiservapps.com/sandbox"
fiuu.base_url = "https://sandbox.merchant.razer.com/"
@@ -148,6 +150,7 @@ gpayments.base_url = "https://{{merchant_endpoint_prefix}}-test.api.as1.gpayment
helcim.base_url = "https://api.helcim.com/"
iatapay.base_url = "https://sandbox.iata-pay.iata.org/api/v1"
itaubank.base_url = "https://sandbox.devportal.itau.com.br/"
+jpmorgan.base_url = "https://api-mock.payments.jpmorgan.com/api/v2"
klarna.base_url = "https://api{{klarna_region}}.playground.klarna.com/"
mifinity.base_url = "https://demo.mifinity.com/"
mollie.base_url = "https://api.mollie.com/v2/"
@@ -231,6 +234,7 @@ cards = [
"dlocal",
"dummyconnector",
"ebanx",
+ "elavon",
"fiserv",
"fiservemea",
"fiuu",
@@ -242,6 +246,7 @@ cards = [
"helcim",
"iatapay",
"itaubank",
+ "jpmorgan",
"mollie",
"multisafepay",
"netcetera",
@@ -348,34 +353,68 @@ discord_invite_url = "https://discord.gg/wJZ7DVW8mm"
payout_eligibility = true
[pm_filters.adyen]
-online_banking_fpx = { country = "MY", currency = "MYR" }
-online_banking_thailand = { country = "TH", currency = "THB" }
-touch_n_go = { country = "MY", currency = "MYR" }
+ach = { country = "US", currency = "USD" }
+affirm = { country = "US", currency = "USD" }
+afterpay_clearpay = { country = "US,CA,GB,AU,NZ", currency = "GBP,AUD,NZD,CAD,USD" }
+alfamart = { country = "ID", currency = "IDR" }
+ali_pay = { country = "AU,JP,HK,SG,MY,TH,ES,GB,SE,NO,AT,NL,DE,CY,CH,BE,FR,DK,FI,RO,MT,SI,GR,PT,IE,IT,CA,US", currency = "USD,EUR,GBP,JPY,AUD,SGD,CHF,SEK,NOK,NZD,THB,HKD,CAD" }
+ali_pay_hk = { country = "HK", currency = "HKD" }
+alma = { country = "FR", currency = "EUR" }
+apple_pay = { country = "AU,NZ,CN,JP,HK,SG,MY,BH,AE,KW,BR,ES,GB,SE,NO,AT,NL,DE,HU,CY,LU,CH,BE,FR,DK,FI,RO,HR,LI,UA,MT,SI,GR,PT,IE,CZ,EE,LT,LV,IT,PL,IS,CA,US", currency = "AUD,CHF,CAD,EUR,GBP,HKD,SGD,USD,MYR" }
atome = { country = "MY,SG", currency = "MYR,SGD" }
-swish = { country = "SE", currency = "SEK" }
-permata_bank_transfer = { country = "ID", currency = "IDR" }
+bacs = { country = "GB", currency = "GBP" }
+bancontact_card = { country = "BE", currency = "EUR" }
bca_bank_transfer = { country = "ID", currency = "IDR" }
+bizum = { country = "ES", currency = "EUR" }
+blik = { country = "PL", currency = "PLN" }
bni_va = { country = "ID", currency = "IDR" }
+boleto = { country = "BR", currency = "BRL" }
bri_va = { country = "ID", currency = "IDR" }
cimb_va = { country = "ID", currency = "IDR" }
+dana = { country = "ID", currency = "IDR" }
danamon_va = { country = "ID", currency = "IDR" }
-mandiri_va = { country = "ID", currency = "IDR" }
-alfamart = { country = "ID", currency = "IDR" }
+eps = { country = "AT", currency = "EUR" }
+family_mart = { country = "JP", currency = "JPY" }
+gcash = { country = "PH", currency = "PHP" }
+giropay = { country = "DE", currency = "EUR" }
+go_pay = { country = "ID", currency = "IDR" }
+google_pay = { country = "AU,NZ,JP,HK,SG,MY,TH,VN,BH,AE,KW,BR,ES,GB,SE,NO,SK,AT,NL,DE,HU,CY,LU,CH,BE,FR,DK,RO,HR,LI,MT,SI,GR,PT,IE,CZ,EE,LT,LV,IT,PL,TR,IS,CA,US", currency = "AED,ALL,AMD,ANG,AOA,ARS,AUD,AWG,AZN,BAM,BBD,BDT,BGN,BHD,BMD,BND,BOB,BRL,BSD,BWP,BYN,BZD,CAD,CHF,CLP,CNY,COP,CRC,CUP,CVE,CZK,DJF,DKK,DOP,DZD,EGP,ETB,EUR,FJD,FKP,GBP,GEL,GHS,GIP,GMD,GNF,GTQ,GYD,HKD,HNL,HTG,HUF,IDR,ILS,INR,IQD,JMD,JOD,JPY,KES,KGS,KHR,KMF,KRW,KWD,KYD,KZT,LAK,LBP,LKR,LYD,MAD,MDL,MKD,MMK,MNT,MOP,MRU,MUR,MVR,MWK,MXN,MYR,MZN,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SEK,SGD,SHP,SLE,SOS,SRD,STN,SVC,SZL,THB,TND,TOP,TRY,TTD,TWD,TZS,UAH,UGX,USD,UYU,UZS,VES,VND,VUV,WST,XAF,XCD,XOF,XPF,YER,ZAR,ZMW" }
+ideal = { country = "NL", currency = "EUR" }
indomaret = { country = "ID", currency = "IDR" }
+kakao_pay = { country = "KR", currency = "KRW" }
+klarna = { country = "AU,AT,BE,CA,CZ,DK,FI,FR,DE,GR,IE,IT,NO,PL,PT,RO,ES,SE,CH,NL,GB,US", currency = "AUD,EUR,CAD,CZK,DKK,NOK,PLN,RON,SEK,CHF,GBP,USD"}
+lawson = { country = "JP", currency = "JPY" }
+mandiri_va = { country = "ID", currency = "IDR" }
+mb_way = { country = "PT", currency = "EUR" }
+mini_stop = { country = "JP", currency = "JPY" }
+mobile_pay = { country = "DK,FI", currency = "DKK,SEK,NOK,EUR" }
+momo = { country = "VN", currency = "VND" }
+momo_atm = { country = "VN", currency = "VND" }
+online_banking_czech_republic = { country = "CZ", currency = "EUR,CZK" }
+online_banking_finland = { country = "FI", currency = "EUR" }
+online_banking_fpx = { country = "MY", currency = "MYR" }
+online_banking_poland = { country = "PL", currency = "PLN" }
+online_banking_slovakia = { country = "SK", currency = "EUR,CZK" }
+online_banking_thailand = { country = "TH", currency = "THB" }
open_banking_uk = { country = "GB", currency = "GBP" }
oxxo = { country = "MX", currency = "MXN" }
+pay_bright = { country = "CA", currency = "CAD" }
+pay_easy = { country = "JP", currency = "JPY" }
pay_safe_card = { country = "AT,AU,BE,BR,BE,CA,HR,CY,CZ,DK,FI,FR,GE,DE,GI,HU,IS,IE,KW,LV,IE,LI,LT,LU,MT,MX,MD,ME,NL,NZ,NO,PY,PE,PL,PT,RO,SA,RS,SK,SI,ES,SE,CH,TR,AE,GB,US,UY", currency = "EUR,AUD,BRL,CAD,CZK,DKK,GEL,GIP,HUF,KWD,CHF,MXN,MDL,NZD,NOK,PYG,PEN,PLN,RON,SAR,RSD,SEK,TRY,AED,GBP,USD,UYU" }
-seven_eleven = { country = "JP", currency = "JPY" }
-lawson = { country = "JP", currency = "JPY" }
-mini_stop = { country = "JP", currency = "JPY" }
-family_mart = { country = "JP", currency = "JPY" }
+permata_bank_transfer = { country = "ID", currency = "IDR" }
seicomart = { country = "JP", currency = "JPY" }
-pay_easy = { country = "JP", currency = "JPY" }
-boleto = { country = "BR", currency = "BRL" }
-ideal = { country = "NL", currency = "EUR" }
-klarna = { country = "AU,AT,BE,CA,CZ,DK,FI,FR,DE,GR,IE,IT,NO,PL,PT,RO,ES,SE,CH,NL,GB,US", currency = "AUD,EUR,CAD,CZK,DKK,NOK,PLN,RON,SEK,CHF,GBP,USD" }
+sepa = { country = "ES,SK,AT,NL,DE,BE,FR,FI,PT,IE,EE,LT,LV,IT", currency = "EUR" }
+seven_eleven = { country = "JP", currency = "JPY" }
+sofort = { country = "AT,BE,DE,ES,CH,NL", currency = "CHF,EUR"}
paypal = { country = "AU,NZ,CN,JP,HK,MY,TH,KR,PH,ID,AE,KW,BR,ES,GB,SE,NO,SK,AT,NL,DE,HU,CY,LU,CH,BE,FR,DK,FI,RO,HR,UA,MT,SI,GI,PT,IE,CZ,EE,LT,LV,IT,PL,IS,CA,US", currency = "AUD,BRL,CAD,CZK,DKK,EUR,HKD,HUF,INR,JPY,MYR,MXN,NZD,NOK,PHP,PLN,RUB,GBP,SGD,SEK,CHF,THB,USD" }
-sofort = { country = "AT,BE,DE,ES,CH,NL", currency = "CHF,EUR" }
+
+swish = { country = "SE", currency = "SEK" }
+touch_n_go = { country = "MY", currency = "MYR" }
+trustly = { country = "ES,GB,SE,NO,AT,NL,DE,DK,FI,EE,LT,LV", currency = "CZK,DKK,EUR,GBP,NOK,SEK" }
+twint = { country = "CH", currency = "CHF" }
+vipps = { country = "NO", currency = "NOK" }
+walley = { country = "SE,NO,DK,FI", currency = "DKK,EUR,NOK,SEK" }
+we_chat_pay = { country = "AU,NZ,CN,JP,HK,SG,ES,GB,SE,NO,AT,NL,DE,CY,CH,BE,FR,DK,LI,MT,SI,GR,PT,IT,CA,US", currency = "AUD,CAD,CNY,EUR,GBP,HKD,JPY,NZD,SGD,USD,CNY" }
[pm_filters.volt]
@@ -575,7 +614,7 @@ enabled = false
global_tenant = { schema = "public", redis_key_prefix = "", clickhouse_database = "default" }
[multitenancy.tenants]
-public = { name = "hyperswitch", base_url = "http://localhost:8080", schema = "public", redis_key_prefix = "", clickhouse_database = "default" }
+public = { base_url = "http://localhost:8080", schema = "public", redis_key_prefix = "", clickhouse_database = "default" }
[user_auth_methods]
encryption_key = "A8EF32E029BC3342E54BF2E172A4D7AA43E8EF9D2C3A624A9F04E2EF79DC698F"
diff --git a/config/vector.yaml b/config/vector.yaml
index 3f0709ae03cf..4b801935ae5b 100644
--- a/config/vector.yaml
+++ b/config/vector.yaml
@@ -1,5 +1,16 @@
acknowledgements:
enabled: true
+enrichment_tables:
+ sdk_map:
+ type: file
+ file:
+ path: /etc/vector/config/sdk_map.csv
+ encoding:
+ type: csv
+ schema:
+ publishable_key: string
+ merchant_id: string
+
api:
enabled: true
@@ -87,6 +98,21 @@ transforms:
key_field: "{{ .payment_id }}{{ .merchant_id }}"
threshold: 1000
window_secs: 60
+
+ amend_sdk_logs:
+ type: remap
+ inputs:
+ - sdk_transformed
+ source: |
+ .before_transform = now()
+
+ merchant_id = .merchant_id
+ row = get_enrichment_table_record!("sdk_map", { "publishable_key" : merchant_id }, case_sensitive: true)
+ .merchant_id = row.merchant_id
+
+ .after_transform = now()
+
+
sinks:
opensearch_events_1:
@@ -110,6 +136,9 @@ sinks:
- offset
- partition
- topic
+ - clickhouse_database
+ - last_synced
+ - sign_flag
bulk:
index: "vector-{{ .topic }}"
@@ -134,6 +163,9 @@ sinks:
- offset
- partition
- topic
+ - clickhouse_database
+ - last_synced
+ - sign_flag
bulk:
# Add a date suffixed index for better grouping
index: "vector-{{ .topic }}-%Y-%m-%d"
@@ -224,7 +256,7 @@ sinks:
- "path"
- "source_type"
inputs:
- - "sdk_transformed"
+ - "amend_sdk_logs"
bootstrap_servers: kafka0:29092
topic: hyper-sdk-logs
key_field: ".merchant_id"
diff --git a/connector-template/transformers.rs b/connector-template/transformers.rs
index 1454be66c8b0..b508596cbc08 100644
--- a/connector-template/transformers.rs
+++ b/connector-template/transformers.rs
@@ -132,8 +132,8 @@ impl TryFrom for AnalyticsError {
@@ -32,6 +34,12 @@ impl ErrorSwitch for AnalyticsError {
Self::AccessForbiddenError => {
ApiErrorResponse::Unauthorized(ApiError::new("IR", 0, "Access Forbidden", None))
}
+ Self::ForexFetchFailed => ApiErrorResponse::InternalServerError(ApiError::new(
+ "HE",
+ 0,
+ "Failed to fetch currency exchange rate",
+ None,
+ )),
}
}
}
diff --git a/crates/analytics/src/payment_intents/accumulator.rs b/crates/analytics/src/payment_intents/accumulator.rs
index cbb8335cea01..ef3cd3129c48 100644
--- a/crates/analytics/src/payment_intents/accumulator.rs
+++ b/crates/analytics/src/payment_intents/accumulator.rs
@@ -86,7 +86,7 @@ impl PaymentIntentMetricAccumulator for CountAccumulator {
}
impl PaymentIntentMetricAccumulator for SmartRetriedAmountAccumulator {
- type MetricOutput = (Option, Option);
+ type MetricOutput = (Option, Option, Option, Option);
#[inline]
fn add_metrics_bucket(&mut self, metrics: &PaymentIntentMetricRow) {
self.amount = match (
@@ -117,7 +117,7 @@ impl PaymentIntentMetricAccumulator for SmartRetriedAmountAccumulator {
.amount_without_retries
.and_then(|i| u64::try_from(i).ok())
.or(Some(0));
- (with_retries, without_retries)
+ (with_retries, without_retries, Some(0), Some(0))
}
}
@@ -185,7 +185,14 @@ impl PaymentIntentMetricAccumulator for PaymentsSuccessRateAccumulator {
}
impl PaymentIntentMetricAccumulator for ProcessedAmountAccumulator {
- type MetricOutput = (Option, Option, Option, Option);
+ type MetricOutput = (
+ Option,
+ Option,
+ Option,
+ Option,
+ Option,
+ Option,
+ );
#[inline]
fn add_metrics_bucket(&mut self, metrics: &PaymentIntentMetricRow) {
self.total_with_retries = match (
@@ -235,6 +242,8 @@ impl PaymentIntentMetricAccumulator for ProcessedAmountAccumulator {
count_with_retries,
total_without_retries,
count_without_retries,
+ Some(0),
+ Some(0),
)
}
}
@@ -301,13 +310,19 @@ impl PaymentIntentMetricsAccumulator {
payments_success_rate,
payments_success_rate_without_smart_retries,
) = self.payments_success_rate.collect();
- let (smart_retried_amount, smart_retried_amount_without_smart_retries) =
- self.smart_retried_amount.collect();
+ let (
+ smart_retried_amount,
+ smart_retried_amount_without_smart_retries,
+ smart_retried_amount_in_usd,
+ smart_retried_amount_without_smart_retries_in_usd,
+ ) = self.smart_retried_amount.collect();
let (
payment_processed_amount,
payment_processed_count,
payment_processed_amount_without_smart_retries,
payment_processed_count_without_smart_retries,
+ payment_processed_amount_in_usd,
+ payment_processed_amount_without_smart_retries_in_usd,
) = self.payment_processed_amount.collect();
let (
payments_success_rate_distribution_without_smart_retries,
@@ -317,7 +332,9 @@ impl PaymentIntentMetricsAccumulator {
successful_smart_retries: self.successful_smart_retries.collect(),
total_smart_retries: self.total_smart_retries.collect(),
smart_retried_amount,
+ smart_retried_amount_in_usd,
smart_retried_amount_without_smart_retries,
+ smart_retried_amount_without_smart_retries_in_usd,
payment_intent_count: self.payment_intent_count.collect(),
successful_payments,
successful_payments_without_smart_retries,
@@ -330,6 +347,8 @@ impl PaymentIntentMetricsAccumulator {
payment_processed_count_without_smart_retries,
payments_success_rate_distribution_without_smart_retries,
payments_failure_rate_distribution_without_smart_retries,
+ payment_processed_amount_in_usd,
+ payment_processed_amount_without_smart_retries_in_usd,
}
}
}
diff --git a/crates/analytics/src/payment_intents/core.rs b/crates/analytics/src/payment_intents/core.rs
index e04c3b7bd9eb..7ea8e9007f7b 100644
--- a/crates/analytics/src/payment_intents/core.rs
+++ b/crates/analytics/src/payment_intents/core.rs
@@ -10,8 +10,10 @@ use api_models::analytics::{
PaymentIntentFiltersResponse, PaymentIntentsAnalyticsMetadata, PaymentIntentsMetricsResponse,
SankeyResponse,
};
-use common_enums::IntentStatus;
+use bigdecimal::ToPrimitive;
+use common_enums::{Currency, IntentStatus};
use common_utils::{errors::CustomResult, types::TimeRange};
+use currency_conversion::{conversion::convert, types::ExchangeRates};
use error_stack::ResultExt;
use router_env::{
instrument, logger,
@@ -120,6 +122,7 @@ pub async fn get_sankey(
#[instrument(skip_all)]
pub async fn get_metrics(
pool: &AnalyticsProvider,
+ ex_rates: &ExchangeRates,
auth: &AuthInfo,
req: GetPaymentIntentMetricRequest,
) -> AnalyticsResult> {
@@ -205,7 +208,8 @@ pub async fn get_metrics(
| PaymentIntentMetrics::SessionizedPaymentsSuccessRate => metrics_builder
.payments_success_rate
.add_metrics_bucket(&value),
- PaymentIntentMetrics::SessionizedPaymentProcessedAmount => metrics_builder
+ PaymentIntentMetrics::SessionizedPaymentProcessedAmount
+ | PaymentIntentMetrics::PaymentProcessedAmount => metrics_builder
.payment_processed_amount
.add_metrics_bucket(&value),
PaymentIntentMetrics::SessionizedPaymentsDistribution => metrics_builder
@@ -226,16 +230,20 @@ pub async fn get_metrics(
let mut success = 0;
let mut success_without_smart_retries = 0;
let mut total_smart_retried_amount = 0;
+ let mut total_smart_retried_amount_in_usd = 0;
let mut total_smart_retried_amount_without_smart_retries = 0;
+ let mut total_smart_retried_amount_without_smart_retries_in_usd = 0;
let mut total = 0;
let mut total_payment_processed_amount = 0;
+ let mut total_payment_processed_amount_in_usd = 0;
let mut total_payment_processed_count = 0;
let mut total_payment_processed_amount_without_smart_retries = 0;
+ let mut total_payment_processed_amount_without_smart_retries_in_usd = 0;
let mut total_payment_processed_count_without_smart_retries = 0;
let query_data: Vec = metrics_accumulator
.into_iter()
.map(|(id, val)| {
- let collected_values = val.collect();
+ let mut collected_values = val.collect();
if let Some(success_count) = collected_values.successful_payments {
success += success_count;
}
@@ -247,20 +255,95 @@ pub async fn get_metrics(
total += total_count;
}
if let Some(retried_amount) = collected_values.smart_retried_amount {
+ let amount_in_usd = id
+ .currency
+ .and_then(|currency| {
+ i64::try_from(retried_amount)
+ .inspect_err(|e| logger::error!("Amount conversion error: {:?}", e))
+ .ok()
+ .and_then(|amount_i64| {
+ convert(ex_rates, currency, Currency::USD, amount_i64)
+ .inspect_err(|e| {
+ logger::error!("Currency conversion error: {:?}", e)
+ })
+ .ok()
+ })
+ })
+ .map(|amount| (amount * rust_decimal::Decimal::new(100, 0)).to_u64())
+ .unwrap_or_default();
+ collected_values.smart_retried_amount_in_usd = amount_in_usd;
total_smart_retried_amount += retried_amount;
+ total_smart_retried_amount_in_usd += amount_in_usd.unwrap_or(0);
}
if let Some(retried_amount) =
collected_values.smart_retried_amount_without_smart_retries
{
+ let amount_in_usd = id
+ .currency
+ .and_then(|currency| {
+ i64::try_from(retried_amount)
+ .inspect_err(|e| logger::error!("Amount conversion error: {:?}", e))
+ .ok()
+ .and_then(|amount_i64| {
+ convert(ex_rates, currency, Currency::USD, amount_i64)
+ .inspect_err(|e| {
+ logger::error!("Currency conversion error: {:?}", e)
+ })
+ .ok()
+ })
+ })
+ .map(|amount| (amount * rust_decimal::Decimal::new(100, 0)).to_u64())
+ .unwrap_or_default();
+ collected_values.smart_retried_amount_without_smart_retries_in_usd = amount_in_usd;
total_smart_retried_amount_without_smart_retries += retried_amount;
+ total_smart_retried_amount_without_smart_retries_in_usd +=
+ amount_in_usd.unwrap_or(0);
}
if let Some(amount) = collected_values.payment_processed_amount {
+ let amount_in_usd = id
+ .currency
+ .and_then(|currency| {
+ i64::try_from(amount)
+ .inspect_err(|e| logger::error!("Amount conversion error: {:?}", e))
+ .ok()
+ .and_then(|amount_i64| {
+ convert(ex_rates, currency, Currency::USD, amount_i64)
+ .inspect_err(|e| {
+ logger::error!("Currency conversion error: {:?}", e)
+ })
+ .ok()
+ })
+ })
+ .map(|amount| (amount * rust_decimal::Decimal::new(100, 0)).to_u64())
+ .unwrap_or_default();
+ collected_values.payment_processed_amount_in_usd = amount_in_usd;
+ total_payment_processed_amount_in_usd += amount_in_usd.unwrap_or(0);
total_payment_processed_amount += amount;
}
if let Some(count) = collected_values.payment_processed_count {
total_payment_processed_count += count;
}
if let Some(amount) = collected_values.payment_processed_amount_without_smart_retries {
+ let amount_in_usd = id
+ .currency
+ .and_then(|currency| {
+ i64::try_from(amount)
+ .inspect_err(|e| logger::error!("Amount conversion error: {:?}", e))
+ .ok()
+ .and_then(|amount_i64| {
+ convert(ex_rates, currency, Currency::USD, amount_i64)
+ .inspect_err(|e| {
+ logger::error!("Currency conversion error: {:?}", e)
+ })
+ .ok()
+ })
+ })
+ .map(|amount| (amount * rust_decimal::Decimal::new(100, 0)).to_u64())
+ .unwrap_or_default();
+ collected_values.payment_processed_amount_without_smart_retries_in_usd =
+ amount_in_usd;
+ total_payment_processed_amount_without_smart_retries_in_usd +=
+ amount_in_usd.unwrap_or(0);
total_payment_processed_amount_without_smart_retries += amount;
}
if let Some(count) = collected_values.payment_processed_count_without_smart_retries {
@@ -293,6 +376,14 @@ pub async fn get_metrics(
total_payment_processed_amount_without_smart_retries: Some(
total_payment_processed_amount_without_smart_retries,
),
+ total_smart_retried_amount_in_usd: Some(total_smart_retried_amount_in_usd),
+ total_smart_retried_amount_without_smart_retries_in_usd: Some(
+ total_smart_retried_amount_without_smart_retries_in_usd,
+ ),
+ total_payment_processed_amount_in_usd: Some(total_payment_processed_amount_in_usd),
+ total_payment_processed_amount_without_smart_retries_in_usd: Some(
+ total_payment_processed_amount_without_smart_retries_in_usd,
+ ),
total_payment_processed_count: Some(total_payment_processed_count),
total_payment_processed_count_without_smart_retries: Some(
total_payment_processed_count_without_smart_retries,
@@ -371,15 +462,6 @@ pub async fn get_filters(
PaymentIntentDimensions::PaymentIntentStatus => fil.status.map(|i| i.as_ref().to_string()),
PaymentIntentDimensions::Currency => fil.currency.map(|i| i.as_ref().to_string()),
PaymentIntentDimensions::ProfileId => fil.profile_id,
- PaymentIntentDimensions::Connector => fil.connector,
- PaymentIntentDimensions::AuthType => fil.authentication_type.map(|i| i.as_ref().to_string()),
- PaymentIntentDimensions::PaymentMethod => fil.payment_method,
- PaymentIntentDimensions::PaymentMethodType => fil.payment_method_type,
- PaymentIntentDimensions::CardNetwork => fil.card_network,
- PaymentIntentDimensions::MerchantId => fil.merchant_id,
- PaymentIntentDimensions::CardLast4 => fil.card_last_4,
- PaymentIntentDimensions::CardIssuer => fil.card_issuer,
- PaymentIntentDimensions::ErrorReason => fil.error_reason,
})
.collect::>();
res.query_data.push(PaymentIntentFilterValue {
diff --git a/crates/analytics/src/payment_intents/filters.rs b/crates/analytics/src/payment_intents/filters.rs
index 25d43e76f037..d03d6c2a15f9 100644
--- a/crates/analytics/src/payment_intents/filters.rs
+++ b/crates/analytics/src/payment_intents/filters.rs
@@ -1,6 +1,6 @@
use api_models::analytics::{payment_intents::PaymentIntentDimensions, Granularity, TimeRange};
use common_utils::errors::ReportSwitchExt;
-use diesel_models::enums::{AuthenticationType, Currency, IntentStatus};
+use diesel_models::enums::{Currency, IntentStatus};
use error_stack::ResultExt;
use time::PrimitiveDateTime;
@@ -54,13 +54,5 @@ pub struct PaymentIntentFilterRow {
pub status: Option>,
pub currency: Option>,
pub profile_id: Option,
- pub connector: Option,
- pub authentication_type: Option>,
- pub payment_method: Option,
- pub payment_method_type: Option,
- pub card_network: Option,
- pub merchant_id: Option,
- pub card_last_4: Option,
- pub card_issuer: Option,
- pub error_reason: Option,
+ pub customer_id: Option,
}
diff --git a/crates/analytics/src/payment_intents/metrics.rs b/crates/analytics/src/payment_intents/metrics.rs
index 8ee9d24b5a0f..9aa7d3e97719 100644
--- a/crates/analytics/src/payment_intents/metrics.rs
+++ b/crates/analytics/src/payment_intents/metrics.rs
@@ -17,6 +17,7 @@ use crate::{
};
mod payment_intent_count;
+mod payment_processed_amount;
mod payments_success_rate;
mod sessionized_metrics;
mod smart_retried_amount;
@@ -24,6 +25,7 @@ mod successful_smart_retries;
mod total_smart_retries;
use payment_intent_count::PaymentIntentCount;
+use payment_processed_amount::PaymentProcessedAmount;
use payments_success_rate::PaymentsSuccessRate;
use smart_retried_amount::SmartRetriedAmount;
use successful_smart_retries::SuccessfulSmartRetries;
@@ -34,15 +36,6 @@ pub struct PaymentIntentMetricRow {
pub status: Option>,
pub currency: Option>,
pub profile_id: Option,
- pub connector: Option,
- pub authentication_type: Option>,
- pub payment_method: Option,
- pub payment_method_type: Option,
- pub card_network: Option,
- pub merchant_id: Option,
- pub card_last_4: Option,
- pub card_issuer: Option,
- pub error_reason: Option,
pub first_attempt: Option,
pub total: Option,
pub count: Option,
@@ -116,6 +109,11 @@ where
.load_metrics(dimensions, auth, filters, granularity, time_range, pool)
.await
}
+ Self::PaymentProcessedAmount => {
+ PaymentProcessedAmount
+ .load_metrics(dimensions, auth, filters, granularity, time_range, pool)
+ .await
+ }
Self::SessionizedSuccessfulSmartRetries => {
sessionized_metrics::SuccessfulSmartRetries
.load_metrics(dimensions, auth, filters, granularity, time_range, pool)
diff --git a/crates/analytics/src/payment_intents/metrics/payment_intent_count.rs b/crates/analytics/src/payment_intents/metrics/payment_intent_count.rs
index b301a9b9b23b..4632cbe9f370 100644
--- a/crates/analytics/src/payment_intents/metrics/payment_intent_count.rs
+++ b/crates/analytics/src/payment_intents/metrics/payment_intent_count.rs
@@ -101,15 +101,6 @@ where
i.status.as_ref().map(|i| i.0),
i.currency.as_ref().map(|i| i.0),
i.profile_id.clone(),
- i.connector.clone(),
- i.authentication_type.as_ref().map(|i| i.0),
- i.payment_method.clone(),
- i.payment_method_type.clone(),
- i.card_network.clone(),
- i.merchant_id.clone(),
- i.card_last_4.clone(),
- i.card_issuer.clone(),
- i.error_reason.clone(),
TimeRange {
start_time: match (granularity, i.start_bucket) {
(Some(g), Some(st)) => g.clip_to_start(st)?,
diff --git a/crates/analytics/src/payment_intents/metrics/payment_processed_amount.rs b/crates/analytics/src/payment_intents/metrics/payment_processed_amount.rs
new file mode 100644
index 000000000000..51b574f4ad38
--- /dev/null
+++ b/crates/analytics/src/payment_intents/metrics/payment_processed_amount.rs
@@ -0,0 +1,161 @@
+use std::collections::HashSet;
+
+use api_models::analytics::{
+ payment_intents::{
+ PaymentIntentDimensions, PaymentIntentFilters, PaymentIntentMetricsBucketIdentifier,
+ },
+ Granularity, TimeRange,
+};
+use common_utils::errors::ReportSwitchExt;
+use diesel_models::enums as storage_enums;
+use error_stack::ResultExt;
+use time::PrimitiveDateTime;
+
+use super::PaymentIntentMetricRow;
+use crate::{
+ enums::AuthInfo,
+ query::{Aggregate, GroupByClause, QueryBuilder, QueryFilter, SeriesBucket, ToSql, Window},
+ types::{AnalyticsCollection, AnalyticsDataSource, MetricsError, MetricsResult},
+};
+
+#[derive(Default)]
+pub(super) struct PaymentProcessedAmount;
+
+#[async_trait::async_trait]
+impl super::PaymentIntentMetric for PaymentProcessedAmount
+where
+ T: AnalyticsDataSource + super::PaymentIntentMetricAnalytics,
+ PrimitiveDateTime: ToSql,
+ AnalyticsCollection: ToSql,
+ Granularity: GroupByClause,
+ Aggregate<&'static str>: ToSql,
+ Window<&'static str>: ToSql,
+{
+ async fn load_metrics(
+ &self,
+ dimensions: &[PaymentIntentDimensions],
+ auth: &AuthInfo,
+ filters: &PaymentIntentFilters,
+ granularity: &Option,
+ time_range: &TimeRange,
+ pool: &T,
+ ) -> MetricsResult>
+ {
+ let mut query_builder: QueryBuilder =
+ QueryBuilder::new(AnalyticsCollection::PaymentIntent);
+
+ let mut dimensions = dimensions.to_vec();
+
+ dimensions.push(PaymentIntentDimensions::PaymentIntentStatus);
+
+ for dim in dimensions.iter() {
+ query_builder.add_select_column(dim).switch()?;
+ }
+
+ query_builder
+ .add_select_column(Aggregate::Count {
+ field: None,
+ alias: Some("count"),
+ })
+ .switch()?;
+
+ query_builder
+ .add_select_column("attempt_count == 1 as first_attempt")
+ .switch()?;
+
+ query_builder.add_select_column("currency").switch()?;
+
+ query_builder
+ .add_select_column(Aggregate::Sum {
+ field: "amount",
+ alias: Some("total"),
+ })
+ .switch()?;
+
+ query_builder
+ .add_select_column(Aggregate::Min {
+ field: "created_at",
+ alias: Some("start_bucket"),
+ })
+ .switch()?;
+
+ query_builder
+ .add_select_column(Aggregate::Max {
+ field: "created_at",
+ alias: Some("end_bucket"),
+ })
+ .switch()?;
+
+ filters.set_filter_clause(&mut query_builder).switch()?;
+
+ auth.set_filter_clause(&mut query_builder).switch()?;
+
+ time_range
+ .set_filter_clause(&mut query_builder)
+ .attach_printable("Error filtering time range")
+ .switch()?;
+
+ for dim in dimensions.iter() {
+ query_builder
+ .add_group_by_clause(dim)
+ .attach_printable("Error grouping by dimensions")
+ .switch()?;
+ }
+
+ query_builder
+ .add_group_by_clause("attempt_count")
+ .attach_printable("Error grouping by attempt_count")
+ .switch()?;
+
+ query_builder
+ .add_group_by_clause("currency")
+ .attach_printable("Error grouping by currency")
+ .switch()?;
+
+ if let Some(granularity) = granularity.as_ref() {
+ granularity
+ .set_group_by_clause(&mut query_builder)
+ .attach_printable("Error adding granularity")
+ .switch()?;
+ }
+
+ query_builder
+ .add_filter_clause(
+ PaymentIntentDimensions::PaymentIntentStatus,
+ storage_enums::IntentStatus::Succeeded,
+ )
+ .switch()?;
+
+ query_builder
+ .execute_query::(pool)
+ .await
+ .change_context(MetricsError::QueryBuildingError)?
+ .change_context(MetricsError::QueryExecutionFailure)?
+ .into_iter()
+ .map(|i| {
+ Ok((
+ PaymentIntentMetricsBucketIdentifier::new(
+ None,
+ i.currency.as_ref().map(|i| i.0),
+ i.profile_id.clone(),
+ TimeRange {
+ start_time: match (granularity, i.start_bucket) {
+ (Some(g), Some(st)) => g.clip_to_start(st)?,
+ _ => time_range.start_time,
+ },
+ end_time: granularity.as_ref().map_or_else(
+ || Ok(time_range.end_time),
+ |g| i.end_bucket.map(|et| g.clip_to_end(et)).transpose(),
+ )?,
+ },
+ ),
+ i,
+ ))
+ })
+ .collect::,
+ crate::query::PostProcessingError,
+ >>()
+ .change_context(MetricsError::PostProcessingFailure)
+ }
+}
diff --git a/crates/analytics/src/payment_intents/metrics/payments_success_rate.rs b/crates/analytics/src/payment_intents/metrics/payments_success_rate.rs
index 07b1bfcf69fe..14e168b3523d 100644
--- a/crates/analytics/src/payment_intents/metrics/payments_success_rate.rs
+++ b/crates/analytics/src/payment_intents/metrics/payments_success_rate.rs
@@ -114,15 +114,6 @@ where
None,
i.currency.as_ref().map(|i| i.0),
i.profile_id.clone(),
- i.connector.clone(),
- i.authentication_type.as_ref().map(|i| i.0),
- i.payment_method.clone(),
- i.payment_method_type.clone(),
- i.card_network.clone(),
- i.merchant_id.clone(),
- i.card_last_4.clone(),
- i.card_issuer.clone(),
- i.error_reason.clone(),
TimeRange {
start_time: match (granularity, i.start_bucket) {
(Some(g), Some(st)) => g.clip_to_start(st)?,
diff --git a/crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_intent_count.rs b/crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_intent_count.rs
index 7475a75bb532..644bf35a7236 100644
--- a/crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_intent_count.rs
+++ b/crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_intent_count.rs
@@ -101,15 +101,6 @@ where
i.status.as_ref().map(|i| i.0),
i.currency.as_ref().map(|i| i.0),
i.profile_id.clone(),
- i.connector.clone(),
- i.authentication_type.as_ref().map(|i| i.0),
- i.payment_method.clone(),
- i.payment_method_type.clone(),
- i.card_network.clone(),
- i.merchant_id.clone(),
- i.card_last_4.clone(),
- i.card_issuer.clone(),
- i.error_reason.clone(),
TimeRange {
start_time: match (granularity, i.start_bucket) {
(Some(g), Some(st)) => g.clip_to_start(st)?,
diff --git a/crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_processed_amount.rs b/crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_processed_amount.rs
index 506965375f5b..01d580534834 100644
--- a/crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_processed_amount.rs
+++ b/crates/analytics/src/payment_intents/metrics/sessionized_metrics/payment_processed_amount.rs
@@ -61,7 +61,7 @@ where
query_builder
.add_select_column("attempt_count == 1 as first_attempt")
.switch()?;
-
+ query_builder.add_select_column("currency").switch()?;
query_builder
.add_select_column(Aggregate::Sum {
field: "amount",
@@ -101,7 +101,10 @@ where
.add_group_by_clause("attempt_count")
.attach_printable("Error grouping by attempt_count")
.switch()?;
-
+ query_builder
+ .add_group_by_clause("currency")
+ .attach_printable("Error grouping by currency")
+ .switch()?;
if let Some(granularity) = granularity.as_ref() {
granularity
.set_group_by_clause(&mut query_builder)
@@ -128,15 +131,6 @@ where
None,
i.currency.as_ref().map(|i| i.0),
i.profile_id.clone(),
- i.connector.clone(),
- i.authentication_type.as_ref().map(|i| i.0),
- i.payment_method.clone(),
- i.payment_method_type.clone(),
- i.card_network.clone(),
- i.merchant_id.clone(),
- i.card_last_4.clone(),
- i.card_issuer.clone(),
- i.error_reason.clone(),
TimeRange {
start_time: match (granularity, i.start_bucket) {
(Some(g), Some(st)) => g.clip_to_start(st)?,
diff --git a/crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_distribution.rs b/crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_distribution.rs
index 0b55c101a7c9..eed6bf85a2c4 100644
--- a/crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_distribution.rs
+++ b/crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_distribution.rs
@@ -113,15 +113,6 @@ where
None,
i.currency.as_ref().map(|i| i.0),
i.profile_id.clone(),
- i.connector.clone(),
- i.authentication_type.as_ref().map(|i| i.0),
- i.payment_method.clone(),
- i.payment_method_type.clone(),
- i.card_network.clone(),
- i.merchant_id.clone(),
- i.card_last_4.clone(),
- i.card_issuer.clone(),
- i.error_reason.clone(),
TimeRange {
start_time: match (granularity, i.start_bucket) {
(Some(g), Some(st)) => g.clip_to_start(st)?,
diff --git a/crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_success_rate.rs b/crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_success_rate.rs
index 8c340d0b2d6e..bd1f8bbbcd95 100644
--- a/crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_success_rate.rs
+++ b/crates/analytics/src/payment_intents/metrics/sessionized_metrics/payments_success_rate.rs
@@ -114,15 +114,6 @@ where
None,
i.currency.as_ref().map(|i| i.0),
i.profile_id.clone(),
- i.connector.clone(),
- i.authentication_type.as_ref().map(|i| i.0),
- i.payment_method.clone(),
- i.payment_method_type.clone(),
- i.card_network.clone(),
- i.merchant_id.clone(),
- i.card_last_4.clone(),
- i.card_issuer.clone(),
- i.error_reason.clone(),
TimeRange {
start_time: match (granularity, i.start_bucket) {
(Some(g), Some(st)) => g.clip_to_start(st)?,
diff --git a/crates/analytics/src/payment_intents/metrics/sessionized_metrics/smart_retried_amount.rs b/crates/analytics/src/payment_intents/metrics/sessionized_metrics/smart_retried_amount.rs
index 8105a4c82a4a..cf7af6e11e7e 100644
--- a/crates/analytics/src/payment_intents/metrics/sessionized_metrics/smart_retried_amount.rs
+++ b/crates/analytics/src/payment_intents/metrics/sessionized_metrics/smart_retried_amount.rs
@@ -63,6 +63,7 @@ where
.add_select_column("attempt_count == 1 as first_attempt")
.switch()?;
+ query_builder.add_select_column("currency").switch()?;
query_builder
.add_select_column(Aggregate::Min {
field: "created_at",
@@ -102,7 +103,10 @@ where
.add_group_by_clause("first_attempt")
.attach_printable("Error grouping by first_attempt")
.switch()?;
-
+ query_builder
+ .add_group_by_clause("currency")
+ .attach_printable("Error grouping by first_attempt")
+ .switch()?;
if let Some(granularity) = granularity.as_ref() {
granularity
.set_group_by_clause(&mut query_builder)
@@ -122,15 +126,6 @@ where
i.status.as_ref().map(|i| i.0),
i.currency.as_ref().map(|i| i.0),
i.profile_id.clone(),
- i.connector.clone(),
- i.authentication_type.as_ref().map(|i| i.0),
- i.payment_method.clone(),
- i.payment_method_type.clone(),
- i.card_network.clone(),
- i.merchant_id.clone(),
- i.card_last_4.clone(),
- i.card_issuer.clone(),
- i.error_reason.clone(),
TimeRange {
start_time: match (granularity, i.start_bucket) {
(Some(g), Some(st)) => g.clip_to_start(st)?,
diff --git a/crates/analytics/src/payment_intents/metrics/sessionized_metrics/successful_smart_retries.rs b/crates/analytics/src/payment_intents/metrics/sessionized_metrics/successful_smart_retries.rs
index 0b28cb5366d6..bf97e4c41eff 100644
--- a/crates/analytics/src/payment_intents/metrics/sessionized_metrics/successful_smart_retries.rs
+++ b/crates/analytics/src/payment_intents/metrics/sessionized_metrics/successful_smart_retries.rs
@@ -111,15 +111,6 @@ where
i.status.as_ref().map(|i| i.0),
i.currency.as_ref().map(|i| i.0),
i.profile_id.clone(),
- i.connector.clone(),
- i.authentication_type.as_ref().map(|i| i.0),
- i.payment_method.clone(),
- i.payment_method_type.clone(),
- i.card_network.clone(),
- i.merchant_id.clone(),
- i.card_last_4.clone(),
- i.card_issuer.clone(),
- i.error_reason.clone(),
TimeRange {
start_time: match (granularity, i.start_bucket) {
(Some(g), Some(st)) => g.clip_to_start(st)?,
diff --git a/crates/analytics/src/payment_intents/metrics/sessionized_metrics/total_smart_retries.rs b/crates/analytics/src/payment_intents/metrics/sessionized_metrics/total_smart_retries.rs
index 20ef8be62770..cea5b2fa4656 100644
--- a/crates/analytics/src/payment_intents/metrics/sessionized_metrics/total_smart_retries.rs
+++ b/crates/analytics/src/payment_intents/metrics/sessionized_metrics/total_smart_retries.rs
@@ -106,15 +106,6 @@ where
i.status.as_ref().map(|i| i.0),
i.currency.as_ref().map(|i| i.0),
i.profile_id.clone(),
- i.connector.clone(),
- i.authentication_type.as_ref().map(|i| i.0),
- i.payment_method.clone(),
- i.payment_method_type.clone(),
- i.card_network.clone(),
- i.merchant_id.clone(),
- i.card_last_4.clone(),
- i.card_issuer.clone(),
- i.error_reason.clone(),
TimeRange {
start_time: match (granularity, i.start_bucket) {
(Some(g), Some(st)) => g.clip_to_start(st)?,
diff --git a/crates/analytics/src/payment_intents/metrics/smart_retried_amount.rs b/crates/analytics/src/payment_intents/metrics/smart_retried_amount.rs
index 8468911f7bbb..9497dc89f42c 100644
--- a/crates/analytics/src/payment_intents/metrics/smart_retried_amount.rs
+++ b/crates/analytics/src/payment_intents/metrics/smart_retried_amount.rs
@@ -62,7 +62,7 @@ where
query_builder
.add_select_column("attempt_count == 1 as first_attempt")
.switch()?;
-
+ query_builder.add_select_column("currency").switch()?;
query_builder
.add_select_column(Aggregate::Min {
field: "created_at",
@@ -102,7 +102,10 @@ where
.add_group_by_clause("first_attempt")
.attach_printable("Error grouping by first_attempt")
.switch()?;
-
+ query_builder
+ .add_group_by_clause("currency")
+ .attach_printable("Error grouping by currency")
+ .switch()?;
if let Some(granularity) = granularity.as_ref() {
granularity
.set_group_by_clause(&mut query_builder)
@@ -122,15 +125,6 @@ where
i.status.as_ref().map(|i| i.0),
i.currency.as_ref().map(|i| i.0),
i.profile_id.clone(),
- i.connector.clone(),
- i.authentication_type.as_ref().map(|i| i.0),
- i.payment_method.clone(),
- i.payment_method_type.clone(),
- i.card_network.clone(),
- i.merchant_id.clone(),
- i.card_last_4.clone(),
- i.card_issuer.clone(),
- i.error_reason.clone(),
TimeRange {
start_time: match (granularity, i.start_bucket) {
(Some(g), Some(st)) => g.clip_to_start(st)?,
diff --git a/crates/analytics/src/payment_intents/metrics/successful_smart_retries.rs b/crates/analytics/src/payment_intents/metrics/successful_smart_retries.rs
index a19bdec518c4..4fe5f3a26f51 100644
--- a/crates/analytics/src/payment_intents/metrics/successful_smart_retries.rs
+++ b/crates/analytics/src/payment_intents/metrics/successful_smart_retries.rs
@@ -111,15 +111,6 @@ where
i.status.as_ref().map(|i| i.0),
i.currency.as_ref().map(|i| i.0),
i.profile_id.clone(),
- i.connector.clone(),
- i.authentication_type.as_ref().map(|i| i.0),
- i.payment_method.clone(),
- i.payment_method_type.clone(),
- i.card_network.clone(),
- i.merchant_id.clone(),
- i.card_last_4.clone(),
- i.card_issuer.clone(),
- i.error_reason.clone(),
TimeRange {
start_time: match (granularity, i.start_bucket) {
(Some(g), Some(st)) => g.clip_to_start(st)?,
diff --git a/crates/analytics/src/payment_intents/metrics/total_smart_retries.rs b/crates/analytics/src/payment_intents/metrics/total_smart_retries.rs
index f5539abd9f50..e98efa9f6abc 100644
--- a/crates/analytics/src/payment_intents/metrics/total_smart_retries.rs
+++ b/crates/analytics/src/payment_intents/metrics/total_smart_retries.rs
@@ -106,15 +106,6 @@ where
i.status.as_ref().map(|i| i.0),
i.currency.as_ref().map(|i| i.0),
i.profile_id.clone(),
- i.connector.clone(),
- i.authentication_type.as_ref().map(|i| i.0),
- i.payment_method.clone(),
- i.payment_method_type.clone(),
- i.card_network.clone(),
- i.merchant_id.clone(),
- i.card_last_4.clone(),
- i.card_issuer.clone(),
- i.error_reason.clone(),
TimeRange {
start_time: match (granularity, i.start_bucket) {
(Some(g), Some(st)) => g.clip_to_start(st)?,
diff --git a/crates/analytics/src/payment_intents/types.rs b/crates/analytics/src/payment_intents/types.rs
index 1a9a2f2ed658..bb5141297c56 100644
--- a/crates/analytics/src/payment_intents/types.rs
+++ b/crates/analytics/src/payment_intents/types.rs
@@ -30,62 +30,10 @@ where
.add_filter_in_range_clause(PaymentIntentDimensions::ProfileId, &self.profile_id)
.attach_printable("Error adding profile id filter")?;
}
- if !self.connector.is_empty() {
+ if !self.customer_id.is_empty() {
builder
- .add_filter_in_range_clause(PaymentIntentDimensions::Connector, &self.connector)
- .attach_printable("Error adding connector filter")?;
- }
- if !self.auth_type.is_empty() {
- builder
- .add_filter_in_range_clause(PaymentIntentDimensions::AuthType, &self.auth_type)
- .attach_printable("Error adding auth type filter")?;
- }
- if !self.payment_method.is_empty() {
- builder
- .add_filter_in_range_clause(
- PaymentIntentDimensions::PaymentMethod,
- &self.payment_method,
- )
- .attach_printable("Error adding payment method filter")?;
- }
- if !self.payment_method_type.is_empty() {
- builder
- .add_filter_in_range_clause(
- PaymentIntentDimensions::PaymentMethodType,
- &self.payment_method_type,
- )
- .attach_printable("Error adding payment method type filter")?;
- }
- if !self.card_network.is_empty() {
- builder
- .add_filter_in_range_clause(
- PaymentIntentDimensions::CardNetwork,
- &self.card_network,
- )
- .attach_printable("Error adding card network filter")?;
- }
- if !self.merchant_id.is_empty() {
- builder
- .add_filter_in_range_clause(PaymentIntentDimensions::MerchantId, &self.merchant_id)
- .attach_printable("Error adding merchant id filter")?;
- }
- if !self.card_last_4.is_empty() {
- builder
- .add_filter_in_range_clause(PaymentIntentDimensions::CardLast4, &self.card_last_4)
- .attach_printable("Error adding card last 4 filter")?;
- }
- if !self.card_issuer.is_empty() {
- builder
- .add_filter_in_range_clause(PaymentIntentDimensions::CardIssuer, &self.card_issuer)
- .attach_printable("Error adding card issuer filter")?;
- }
- if !self.error_reason.is_empty() {
- builder
- .add_filter_in_range_clause(
- PaymentIntentDimensions::ErrorReason,
- &self.error_reason,
- )
- .attach_printable("Error adding error reason filter")?;
+ .add_filter_in_range_clause("customer_id", &self.customer_id)
+ .attach_printable("Error adding customer id filter")?;
}
Ok(())
}
diff --git a/crates/analytics/src/payments/accumulator.rs b/crates/analytics/src/payments/accumulator.rs
index 4388b2071fee..651eeb0bcfe7 100644
--- a/crates/analytics/src/payments/accumulator.rs
+++ b/crates/analytics/src/payments/accumulator.rs
@@ -272,7 +272,14 @@ impl PaymentMetricAccumulator for CountAccumulator {
}
impl PaymentMetricAccumulator for ProcessedAmountAccumulator {
- type MetricOutput = (Option, Option, Option, Option);
+ type MetricOutput = (
+ Option,
+ Option,
+ Option,
+ Option,
+ Option,
+ Option,
+ );
#[inline]
fn add_metrics_bucket(&mut self, metrics: &PaymentMetricRow) {
self.total_with_retries = match (
@@ -322,6 +329,8 @@ impl PaymentMetricAccumulator for ProcessedAmountAccumulator {
count_with_retries,
total_without_retries,
count_without_retries,
+ Some(0),
+ Some(0),
)
}
}
@@ -378,6 +387,8 @@ impl PaymentMetricsAccumulator {
payment_processed_count,
payment_processed_amount_without_smart_retries,
payment_processed_count_without_smart_retries,
+ payment_processed_amount_usd,
+ payment_processed_amount_without_smart_retries_usd,
) = self.processed_amount.collect();
let (
payments_success_rate_distribution,
@@ -406,6 +417,8 @@ impl PaymentMetricsAccumulator {
payments_failure_rate_distribution_without_smart_retries,
failure_reason_count,
failure_reason_count_without_smart_retries,
+ payment_processed_amount_usd,
+ payment_processed_amount_without_smart_retries_usd,
}
}
}
diff --git a/crates/analytics/src/payments/core.rs b/crates/analytics/src/payments/core.rs
index 59ae549b2839..bcd009270dc1 100644
--- a/crates/analytics/src/payments/core.rs
+++ b/crates/analytics/src/payments/core.rs
@@ -9,7 +9,10 @@ use api_models::analytics::{
FilterValue, GetPaymentFiltersRequest, GetPaymentMetricRequest, PaymentFiltersResponse,
PaymentsAnalyticsMetadata, PaymentsMetricsResponse,
};
+use bigdecimal::ToPrimitive;
+use common_enums::Currency;
use common_utils::errors::CustomResult;
+use currency_conversion::{conversion::convert, types::ExchangeRates};
use error_stack::ResultExt;
use router_env::{
instrument, logger,
@@ -46,6 +49,7 @@ pub enum TaskType {
#[instrument(skip_all)]
pub async fn get_metrics(
pool: &AnalyticsProvider,
+ ex_rates: &ExchangeRates,
auth: &AuthInfo,
req: GetPaymentMetricRequest,
) -> AnalyticsResult> {
@@ -224,18 +228,57 @@ pub async fn get_metrics(
let mut total_payment_processed_count_without_smart_retries = 0;
let mut total_failure_reasons_count = 0;
let mut total_failure_reasons_count_without_smart_retries = 0;
+ let mut total_payment_processed_amount_usd = 0;
+ let mut total_payment_processed_amount_without_smart_retries_usd = 0;
let query_data: Vec = metrics_accumulator
.into_iter()
.map(|(id, val)| {
- let collected_values = val.collect();
+ let mut collected_values = val.collect();
if let Some(amount) = collected_values.payment_processed_amount {
+ let amount_in_usd = id
+ .currency
+ .and_then(|currency| {
+ i64::try_from(amount)
+ .inspect_err(|e| logger::error!("Amount conversion error: {:?}", e))
+ .ok()
+ .and_then(|amount_i64| {
+ convert(ex_rates, currency, Currency::USD, amount_i64)
+ .inspect_err(|e| {
+ logger::error!("Currency conversion error: {:?}", e)
+ })
+ .ok()
+ })
+ })
+ .map(|amount| (amount * rust_decimal::Decimal::new(100, 0)).to_u64())
+ .unwrap_or_default();
+ collected_values.payment_processed_amount_usd = amount_in_usd;
total_payment_processed_amount += amount;
+ total_payment_processed_amount_usd += amount_in_usd.unwrap_or(0);
}
if let Some(count) = collected_values.payment_processed_count {
total_payment_processed_count += count;
}
if let Some(amount) = collected_values.payment_processed_amount_without_smart_retries {
+ let amount_in_usd = id
+ .currency
+ .and_then(|currency| {
+ i64::try_from(amount)
+ .inspect_err(|e| logger::error!("Amount conversion error: {:?}", e))
+ .ok()
+ .and_then(|amount_i64| {
+ convert(ex_rates, currency, Currency::USD, amount_i64)
+ .inspect_err(|e| {
+ logger::error!("Currency conversion error: {:?}", e)
+ })
+ .ok()
+ })
+ })
+ .map(|amount| (amount * rust_decimal::Decimal::new(100, 0)).to_u64())
+ .unwrap_or_default();
+ collected_values.payment_processed_amount_without_smart_retries_usd = amount_in_usd;
total_payment_processed_amount_without_smart_retries += amount;
+ total_payment_processed_amount_without_smart_retries_usd +=
+ amount_in_usd.unwrap_or(0);
}
if let Some(count) = collected_values.payment_processed_count_without_smart_retries {
total_payment_processed_count_without_smart_retries += count;
@@ -252,14 +295,17 @@ pub async fn get_metrics(
}
})
.collect();
-
Ok(PaymentsMetricsResponse {
query_data,
meta_data: [PaymentsAnalyticsMetadata {
total_payment_processed_amount: Some(total_payment_processed_amount),
+ total_payment_processed_amount_usd: Some(total_payment_processed_amount_usd),
total_payment_processed_amount_without_smart_retries: Some(
total_payment_processed_amount_without_smart_retries,
),
+ total_payment_processed_amount_without_smart_retries_usd: Some(
+ total_payment_processed_amount_without_smart_retries_usd,
+ ),
total_payment_processed_count: Some(total_payment_processed_count),
total_payment_processed_count_without_smart_retries: Some(
total_payment_processed_count_without_smart_retries,
diff --git a/crates/analytics/src/payments/metrics/payment_processed_amount.rs b/crates/analytics/src/payments/metrics/payment_processed_amount.rs
index b8b3868803c6..fa54c1730416 100644
--- a/crates/analytics/src/payments/metrics/payment_processed_amount.rs
+++ b/crates/analytics/src/payments/metrics/payment_processed_amount.rs
@@ -50,6 +50,7 @@ where
alias: Some("total"),
})
.switch()?;
+ query_builder.add_select_column("currency").switch()?;
query_builder
.add_select_column(Aggregate::Min {
field: "created_at",
@@ -79,6 +80,11 @@ where
.switch()?;
}
+ query_builder
+ .add_group_by_clause("currency")
+ .attach_printable("Error grouping by currency")
+ .switch()?;
+
if let Some(granularity) = granularity.as_ref() {
granularity
.set_group_by_clause(&mut query_builder)
diff --git a/crates/analytics/src/payments/metrics/sessionized_metrics/failure_reasons.rs b/crates/analytics/src/payments/metrics/sessionized_metrics/failure_reasons.rs
index 70ae64e01156..bcbce0502d2d 100644
--- a/crates/analytics/src/payments/metrics/sessionized_metrics/failure_reasons.rs
+++ b/crates/analytics/src/payments/metrics/sessionized_metrics/failure_reasons.rs
@@ -148,17 +148,20 @@ where
.attach_printable("Error adding order by clause")
.switch()?;
- for dim in dimensions.iter() {
- if dim != &PaymentDimensions::ErrorReason {
- outer_query_builder
- .add_order_by_clause(dim, Order::Ascending)
- .attach_printable("Error adding order by clause")
- .switch()?;
- }
+ let filtered_dimensions: Vec<&PaymentDimensions> = dimensions
+ .iter()
+ .filter(|&&dim| dim != PaymentDimensions::ErrorReason)
+ .collect();
+
+ for dim in &filtered_dimensions {
+ outer_query_builder
+ .add_order_by_clause(*dim, Order::Ascending)
+ .attach_printable("Error adding order by clause")
+ .switch()?;
}
outer_query_builder
- .set_limit_by(5, &[PaymentDimensions::Connector])
+ .set_limit_by(5, &filtered_dimensions)
.attach_printable("Error adding limit clause")
.switch()?;
diff --git a/crates/analytics/src/payments/metrics/sessionized_metrics/payment_processed_amount.rs b/crates/analytics/src/payments/metrics/sessionized_metrics/payment_processed_amount.rs
index 9bc554eaae71..a315b2fc4c82 100644
--- a/crates/analytics/src/payments/metrics/sessionized_metrics/payment_processed_amount.rs
+++ b/crates/analytics/src/payments/metrics/sessionized_metrics/payment_processed_amount.rs
@@ -57,6 +57,8 @@ where
query_builder.add_select_column("first_attempt").switch()?;
+ query_builder.add_select_column("currency").switch()?;
+
query_builder
.add_select_column(Aggregate::Sum {
field: "amount",
@@ -95,6 +97,12 @@ where
.add_group_by_clause("first_attempt")
.attach_printable("Error grouping by first_attempt")
.switch()?;
+
+ query_builder
+ .add_group_by_clause("currency")
+ .attach_printable("Error grouping by currency")
+ .switch()?;
+
if let Some(granularity) = granularity.as_ref() {
granularity
.set_group_by_clause(&mut query_builder)
diff --git a/crates/analytics/src/query.rs b/crates/analytics/src/query.rs
index 7ce338f7db30..d746594e36ee 100644
--- a/crates/analytics/src/query.rs
+++ b/crates/analytics/src/query.rs
@@ -451,6 +451,12 @@ impl ToSql for &common_utils::id_type::PaymentId {
}
}
+impl ToSql for common_utils::id_type::CustomerId {
+ fn to_sql(&self, _table_engine: &TableEngine) -> error_stack::Result {
+ Ok(self.get_string_repr().to_owned())
+ }
+}
+
/// Implement `ToSql` on arrays of types that impl `ToString`.
macro_rules! impl_to_sql_for_to_string {
($($type:ty),+) => {
diff --git a/crates/analytics/src/sqlx.rs b/crates/analytics/src/sqlx.rs
index ae72bbeffea4..7c90e37c55fb 100644
--- a/crates/analytics/src/sqlx.rs
+++ b/crates/analytics/src/sqlx.rs
@@ -604,45 +604,6 @@ impl<'a> FromRow<'a, PgRow> for super::payment_intents::metrics::PaymentIntentMe
ColumnNotFound(_) => Ok(Default::default()),
e => Err(e),
})?;
- let connector: Option = row.try_get("connector").or_else(|e| match e {
- ColumnNotFound(_) => Ok(Default::default()),
- e => Err(e),
- })?;
- let authentication_type: Option> =
- row.try_get("authentication_type").or_else(|e| match e {
- ColumnNotFound(_) => Ok(Default::default()),
- e => Err(e),
- })?;
- let payment_method: Option =
- row.try_get("payment_method").or_else(|e| match e {
- ColumnNotFound(_) => Ok(Default::default()),
- e => Err(e),
- })?;
- let payment_method_type: Option =
- row.try_get("payment_method_type").or_else(|e| match e {
- ColumnNotFound(_) => Ok(Default::default()),
- e => Err(e),
- })?;
- let card_network: Option = row.try_get("card_network").or_else(|e| match e {
- ColumnNotFound(_) => Ok(Default::default()),
- e => Err(e),
- })?;
- let merchant_id: Option = row.try_get("merchant_id").or_else(|e| match e {
- ColumnNotFound(_) => Ok(Default::default()),
- e => Err(e),
- })?;
- let card_last_4: Option = row.try_get("card_last_4").or_else(|e| match e {
- ColumnNotFound(_) => Ok(Default::default()),
- e => Err(e),
- })?;
- let card_issuer: Option = row.try_get("card_issuer").or_else(|e| match e {
- ColumnNotFound(_) => Ok(Default::default()),
- e => Err(e),
- })?;
- let error_reason: Option = row.try_get("error_reason").or_else(|e| match e {
- ColumnNotFound(_) => Ok(Default::default()),
- e => Err(e),
- })?;
let total: Option = row.try_get("total").or_else(|e| match e {
ColumnNotFound(_) => Ok(Default::default()),
e => Err(e),
@@ -666,15 +627,6 @@ impl<'a> FromRow<'a, PgRow> for super::payment_intents::metrics::PaymentIntentMe
status,
currency,
profile_id,
- connector,
- authentication_type,
- payment_method,
- payment_method_type,
- card_network,
- merchant_id,
- card_last_4,
- card_issuer,
- error_reason,
first_attempt,
total,
count,
@@ -700,42 +652,7 @@ impl<'a> FromRow<'a, PgRow> for super::payment_intents::filters::PaymentIntentFi
ColumnNotFound(_) => Ok(Default::default()),
e => Err(e),
})?;
- let connector: Option = row.try_get("connector").or_else(|e| match e {
- ColumnNotFound(_) => Ok(Default::default()),
- e => Err(e),
- })?;
- let authentication_type: Option> =
- row.try_get("authentication_type").or_else(|e| match e {
- ColumnNotFound(_) => Ok(Default::default()),
- e => Err(e),
- })?;
- let payment_method: Option =
- row.try_get("payment_method").or_else(|e| match e {
- ColumnNotFound(_) => Ok(Default::default()),
- e => Err(e),
- })?;
- let payment_method_type: Option =
- row.try_get("payment_method_type").or_else(|e| match e {
- ColumnNotFound(_) => Ok(Default::default()),
- e => Err(e),
- })?;
- let card_network: Option = row.try_get("card_network").or_else(|e| match e {
- ColumnNotFound(_) => Ok(Default::default()),
- e => Err(e),
- })?;
- let merchant_id: Option = row.try_get("merchant_id").or_else(|e| match e {
- ColumnNotFound(_) => Ok(Default::default()),
- e => Err(e),
- })?;
- let card_last_4: Option = row.try_get("card_last_4").or_else(|e| match e {
- ColumnNotFound(_) => Ok(Default::default()),
- e => Err(e),
- })?;
- let card_issuer: Option = row.try_get("card_issuer").or_else(|e| match e {
- ColumnNotFound(_) => Ok(Default::default()),
- e => Err(e),
- })?;
- let error_reason: Option = row.try_get("error_reason").or_else(|e| match e {
+ let customer_id: Option = row.try_get("customer_id").or_else(|e| match e {
ColumnNotFound(_) => Ok(Default::default()),
e => Err(e),
})?;
@@ -743,15 +660,7 @@ impl<'a> FromRow<'a, PgRow> for super::payment_intents::filters::PaymentIntentFi
status,
currency,
profile_id,
- connector,
- authentication_type,
- payment_method,
- payment_method_type,
- card_network,
- merchant_id,
- card_last_4,
- card_issuer,
- error_reason,
+ customer_id,
})
}
}
diff --git a/crates/analytics/src/utils.rs b/crates/analytics/src/utils.rs
index fc21bf098192..435e95451fe4 100644
--- a/crates/analytics/src/utils.rs
+++ b/crates/analytics/src/utils.rs
@@ -35,12 +35,6 @@ pub fn get_payment_intent_dimensions() -> Vec {
PaymentIntentDimensions::PaymentIntentStatus,
PaymentIntentDimensions::Currency,
PaymentIntentDimensions::ProfileId,
- PaymentIntentDimensions::Connector,
- PaymentIntentDimensions::AuthType,
- PaymentIntentDimensions::PaymentMethod,
- PaymentIntentDimensions::PaymentMethodType,
- PaymentIntentDimensions::CardNetwork,
- PaymentIntentDimensions::MerchantId,
]
.into_iter()
.map(Into::into)
diff --git a/crates/api_models/src/admin.rs b/crates/api_models/src/admin.rs
index 8f24bdf65bc5..c9da386a11de 100644
--- a/crates/api_models/src/admin.rs
+++ b/crates/api_models/src/admin.rs
@@ -178,7 +178,8 @@ impl MerchantAccountCreate {
#[cfg(feature = "v2")]
#[derive(Clone, Debug, Deserialize, ToSchema, Serialize)]
#[serde(deny_unknown_fields)]
-pub struct MerchantAccountCreate {
+#[schema(as = MerchantAccountCreate)]
+pub struct MerchantAccountCreateWithoutOrgId {
/// Name of the Merchant Account, This will be used as a prefix to generate the id
#[schema(value_type= String, max_length = 64, example = "NewAge Retailer")]
pub merchant_name: Secret,
@@ -189,9 +190,17 @@ pub struct MerchantAccountCreate {
/// Metadata is useful for storing additional, unstructured information about the merchant account.
#[schema(value_type = Option, example = r#"{ "city": "NY", "unit": "245" }"#)]
pub metadata: Option,
+}
- /// The id of the organization to which the merchant belongs to. Please use the organization endpoint to create an organization
- #[schema(value_type = String, max_length = 64, min_length = 1, example = "org_q98uSGAYbjEwqs0mJwnz")]
+// In v2 the struct used in the API is MerchantAccountCreateWithoutOrgId
+// The following struct is only used internally, so we can reuse the common
+// part of `create_merchant_account` without duplicating its code for v2
+#[cfg(feature = "v2")]
+#[derive(Clone, Debug, Serialize)]
+pub struct MerchantAccountCreate {
+ pub merchant_name: Secret,
+ pub merchant_details: Option,
+ pub metadata: Option,
pub organization_id: id_type::OrganizationId,
}
diff --git a/crates/api_models/src/analytics.rs b/crates/api_models/src/analytics.rs
index b95404080b03..8d63bc3096ca 100644
--- a/crates/api_models/src/analytics.rs
+++ b/crates/api_models/src/analytics.rs
@@ -203,7 +203,9 @@ pub struct AnalyticsMetadata {
#[derive(Debug, serde::Serialize)]
pub struct PaymentsAnalyticsMetadata {
pub total_payment_processed_amount: Option,
+ pub total_payment_processed_amount_usd: Option,
pub total_payment_processed_amount_without_smart_retries: Option,
+ pub total_payment_processed_amount_without_smart_retries_usd: Option,
pub total_payment_processed_count: Option,
pub total_payment_processed_count_without_smart_retries: Option,
pub total_failure_reasons_count: Option,
@@ -218,6 +220,10 @@ pub struct PaymentIntentsAnalyticsMetadata {
pub total_smart_retried_amount_without_smart_retries: Option,
pub total_payment_processed_amount: Option,
pub total_payment_processed_amount_without_smart_retries: Option,
+ pub total_smart_retried_amount_in_usd: Option,
+ pub total_smart_retried_amount_without_smart_retries_in_usd: Option,
+ pub total_payment_processed_amount_in_usd: Option,
+ pub total_payment_processed_amount_without_smart_retries_in_usd: Option,
pub total_payment_processed_count: Option,
pub total_payment_processed_count_without_smart_retries: Option,
}
diff --git a/crates/api_models/src/analytics/payment_intents.rs b/crates/api_models/src/analytics/payment_intents.rs
index 41f11c19ef8d..3ac3c09d35f6 100644
--- a/crates/api_models/src/analytics/payment_intents.rs
+++ b/crates/api_models/src/analytics/payment_intents.rs
@@ -6,9 +6,7 @@ use std::{
use common_utils::id_type;
use super::{NameDescription, TimeRange};
-use crate::enums::{
- AuthenticationType, Connector, Currency, IntentStatus, PaymentMethod, PaymentMethodType,
-};
+use crate::enums::{Currency, IntentStatus};
#[derive(Clone, Debug, Default, serde::Deserialize, serde::Serialize)]
pub struct PaymentIntentFilters {
@@ -19,23 +17,7 @@ pub struct PaymentIntentFilters {
#[serde(default)]
pub profile_id: Vec,
#[serde(default)]
- pub connector: Vec,
- #[serde(default)]
- pub auth_type: Vec,
- #[serde(default)]
- pub payment_method: Vec,
- #[serde(default)]
- pub payment_method_type: Vec,
- #[serde(default)]
- pub card_network: Vec,
- #[serde(default)]
- pub merchant_id: Vec,
- #[serde(default)]
- pub card_last_4: Vec,
- #[serde(default)]
- pub card_issuer: Vec,
- #[serde(default)]
- pub error_reason: Vec,
+ pub customer_id: Vec,
}
#[derive(
@@ -60,15 +42,6 @@ pub enum PaymentIntentDimensions {
PaymentIntentStatus,
Currency,
ProfileId,
- Connector,
- AuthType,
- PaymentMethod,
- PaymentMethodType,
- CardNetwork,
- MerchantId,
- CardLast4,
- CardIssuer,
- ErrorReason,
}
#[derive(
@@ -91,6 +64,7 @@ pub enum PaymentIntentMetrics {
SmartRetriedAmount,
PaymentIntentCount,
PaymentsSuccessRate,
+ PaymentProcessedAmount,
SessionizedSuccessfulSmartRetries,
SessionizedTotalSmartRetries,
SessionizedSmartRetriedAmount,
@@ -138,15 +112,6 @@ pub struct PaymentIntentMetricsBucketIdentifier {
pub status: Option,
pub currency: Option,
pub profile_id: Option,
- pub connector: Option,
- pub auth_type: Option,
- pub payment_method: Option,
- pub payment_method_type: Option,
- pub card_network: Option,
- pub merchant_id: Option,
- pub card_last_4: Option,
- pub card_issuer: Option,
- pub error_reason: Option,
#[serde(rename = "time_range")]
pub time_bucket: TimeRange,
#[serde(rename = "time_bucket")]
@@ -160,30 +125,12 @@ impl PaymentIntentMetricsBucketIdentifier {
status: Option,
currency: Option,
profile_id: Option,
- connector: Option,
- auth_type: Option,
- payment_method: Option,
- payment_method_type: Option,
- card_network: Option,
- merchant_id: Option,
- card_last_4: Option,
- card_issuer: Option,
- error_reason: Option,
normalized_time_range: TimeRange,
) -> Self {
Self {
status,
currency,
profile_id,
- connector,
- auth_type,
- payment_method,
- payment_method_type,
- card_network,
- merchant_id,
- card_last_4,
- card_issuer,
- error_reason,
time_bucket: normalized_time_range,
start_time: normalized_time_range.start_time,
}
@@ -195,15 +142,6 @@ impl Hash for PaymentIntentMetricsBucketIdentifier {
self.status.map(|i| i.to_string()).hash(state);
self.currency.hash(state);
self.profile_id.hash(state);
- self.connector.hash(state);
- self.auth_type.map(|i| i.to_string()).hash(state);
- self.payment_method.hash(state);
- self.payment_method_type.hash(state);
- self.card_network.hash(state);
- self.merchant_id.hash(state);
- self.card_last_4.hash(state);
- self.card_issuer.hash(state);
- self.error_reason.hash(state);
self.time_bucket.hash(state);
}
}
@@ -223,7 +161,9 @@ pub struct PaymentIntentMetricsBucketValue {
pub successful_smart_retries: Option,
pub total_smart_retries: Option,
pub smart_retried_amount: Option,
+ pub smart_retried_amount_in_usd: Option,
pub smart_retried_amount_without_smart_retries: Option,
+ pub smart_retried_amount_without_smart_retries_in_usd: Option,
pub payment_intent_count: Option,
pub successful_payments: Option,
pub successful_payments_without_smart_retries: Option,
@@ -231,8 +171,10 @@ pub struct PaymentIntentMetricsBucketValue {
pub payments_success_rate: Option,
pub payments_success_rate_without_smart_retries: Option,
pub payment_processed_amount: Option,
+ pub payment_processed_amount_in_usd: Option,
pub payment_processed_count: Option,
pub payment_processed_amount_without_smart_retries: Option,
+ pub payment_processed_amount_without_smart_retries_in_usd: Option,
pub payment_processed_count_without_smart_retries: Option,
pub payments_success_rate_distribution_without_smart_retries: Option,
pub payments_failure_rate_distribution_without_smart_retries: Option,
diff --git a/crates/api_models/src/analytics/payments.rs b/crates/api_models/src/analytics/payments.rs
index 1120ab092d75..1faba79eb378 100644
--- a/crates/api_models/src/analytics/payments.rs
+++ b/crates/api_models/src/analytics/payments.rs
@@ -271,8 +271,10 @@ pub struct PaymentMetricsBucketValue {
pub payment_count: Option,
pub payment_success_count: Option,
pub payment_processed_amount: Option,
+ pub payment_processed_amount_usd: Option,
pub payment_processed_count: Option,
pub payment_processed_amount_without_smart_retries: Option,
+ pub payment_processed_amount_without_smart_retries_usd: Option,
pub payment_processed_count_without_smart_retries: Option,
pub avg_ticket_size: Option,
pub payment_error_message: Option>,
diff --git a/crates/api_models/src/analytics/refunds.rs b/crates/api_models/src/analytics/refunds.rs
index 8acb51e764c0..ef17387d1ea4 100644
--- a/crates/api_models/src/analytics/refunds.rs
+++ b/crates/api_models/src/analytics/refunds.rs
@@ -5,7 +5,7 @@ use std::{
use common_utils::id_type;
-use crate::{enums::Currency, refunds::RefundStatus};
+use crate::enums::{Currency, RefundStatus};
#[derive(
Clone,
diff --git a/crates/api_models/src/api_keys.rs b/crates/api_models/src/api_keys.rs
index 65cc6b9a25a7..d25cd989b0f0 100644
--- a/crates/api_models/src/api_keys.rs
+++ b/crates/api_models/src/api_keys.rs
@@ -29,8 +29,8 @@ pub struct CreateApiKeyRequest {
#[derive(Debug, Serialize, ToSchema)]
pub struct CreateApiKeyResponse {
/// The identifier for the API Key.
- #[schema(max_length = 64, example = "5hEEqkgJUyuxgSKGArHA4mWSnX")]
- pub key_id: String,
+ #[schema(max_length = 64, example = "5hEEqkgJUyuxgSKGArHA4mWSnX", value_type = String)]
+ pub key_id: common_utils::id_type::ApiKeyId,
/// The identifier for the Merchant Account.
#[schema(max_length = 64, example = "y3oqhf46pyzuxjbcn2giaqnb44", value_type = String)]
@@ -72,8 +72,8 @@ pub struct CreateApiKeyResponse {
#[derive(Debug, Serialize, ToSchema)]
pub struct RetrieveApiKeyResponse {
/// The identifier for the API Key.
- #[schema(max_length = 64, example = "5hEEqkgJUyuxgSKGArHA4mWSnX")]
- pub key_id: String,
+ #[schema(max_length = 64, example = "5hEEqkgJUyuxgSKGArHA4mWSnX", value_type = String)]
+ pub key_id: common_utils::id_type::ApiKeyId,
/// The identifier for the Merchant Account.
#[schema(max_length = 64, example = "y3oqhf46pyzuxjbcn2giaqnb44", value_type = String)]
@@ -131,7 +131,8 @@ pub struct UpdateApiKeyRequest {
pub expiration: Option,
#[serde(skip_deserializing)]
- pub key_id: String,
+ #[schema(value_type = String)]
+ pub key_id: common_utils::id_type::ApiKeyId,
#[serde(skip_deserializing)]
#[schema(value_type = String)]
@@ -146,8 +147,8 @@ pub struct RevokeApiKeyResponse {
pub merchant_id: common_utils::id_type::MerchantId,
/// The identifier for the API Key.
- #[schema(max_length = 64, example = "5hEEqkgJUyuxgSKGArHA4mWSnX")]
- pub key_id: String,
+ #[schema(max_length = 64, example = "5hEEqkgJUyuxgSKGArHA4mWSnX", value_type = String)]
+ pub key_id: common_utils::id_type::ApiKeyId,
/// Indicates whether the API key was revoked or not.
#[schema(example = "true")]
pub revoked: bool,
diff --git a/crates/api_models/src/connector_enums.rs b/crates/api_models/src/connector_enums.rs
new file mode 100644
index 000000000000..68fd73cd0de0
--- /dev/null
+++ b/crates/api_models/src/connector_enums.rs
@@ -0,0 +1,299 @@
+pub use common_enums::enums::{PaymentMethod, PayoutType};
+#[cfg(feature = "dummy_connector")]
+use common_utils::errors;
+use utoipa::ToSchema;
+
+/// A connector is an integration to fulfill payments
+#[derive(
+ Clone,
+ Copy,
+ Debug,
+ Eq,
+ PartialEq,
+ ToSchema,
+ serde::Deserialize,
+ serde::Serialize,
+ strum::VariantNames,
+ strum::EnumIter,
+ strum::Display,
+ strum::EnumString,
+ Hash,
+)]
+#[serde(rename_all = "snake_case")]
+#[strum(serialize_all = "snake_case")]
+pub enum Connector {
+ Adyenplatform,
+ #[cfg(feature = "dummy_connector")]
+ #[serde(rename = "phonypay")]
+ #[strum(serialize = "phonypay")]
+ DummyConnector1,
+ #[cfg(feature = "dummy_connector")]
+ #[serde(rename = "fauxpay")]
+ #[strum(serialize = "fauxpay")]
+ DummyConnector2,
+ #[cfg(feature = "dummy_connector")]
+ #[serde(rename = "pretendpay")]
+ #[strum(serialize = "pretendpay")]
+ DummyConnector3,
+ #[cfg(feature = "dummy_connector")]
+ #[serde(rename = "stripe_test")]
+ #[strum(serialize = "stripe_test")]
+ DummyConnector4,
+ #[cfg(feature = "dummy_connector")]
+ #[serde(rename = "adyen_test")]
+ #[strum(serialize = "adyen_test")]
+ DummyConnector5,
+ #[cfg(feature = "dummy_connector")]
+ #[serde(rename = "checkout_test")]
+ #[strum(serialize = "checkout_test")]
+ DummyConnector6,
+ #[cfg(feature = "dummy_connector")]
+ #[serde(rename = "paypal_test")]
+ #[strum(serialize = "paypal_test")]
+ DummyConnector7,
+ Aci,
+ Adyen,
+ Airwallex,
+ Authorizedotnet,
+ Bambora,
+ Bamboraapac,
+ Bankofamerica,
+ Billwerk,
+ Bitpay,
+ Bluesnap,
+ Boku,
+ Braintree,
+ Cashtocode,
+ Checkout,
+ Coinbase,
+ Cryptopay,
+ Cybersource,
+ Datatrans,
+ Deutschebank,
+ // Digitalvirgo, template code for future usage
+ Dlocal,
+ Ebanx,
+ Fiserv,
+ Fiservemea,
+ Fiuu,
+ Forte,
+ Globalpay,
+ Globepay,
+ Gocardless,
+ Gpayments,
+ Helcim,
+ Iatapay,
+ Itaubank,
+ //Jpmorgan,
+ Klarna,
+ Mifinity,
+ Mollie,
+ Multisafepay,
+ Netcetera,
+ Nexinets,
+ Nexixpay,
+ Nmi,
+ Noon,
+ Novalnet,
+ Nuvei,
+ // Opayo, added as template code for future usage
+ Opennode,
+ Paybox,
+ // Payeezy, As psync and rsync are not supported by this connector, it is added as template code for future usage
+ Payme,
+ Payone,
+ Paypal,
+ Payu,
+ Placetopay,
+ Powertranz,
+ Prophetpay,
+ Rapyd,
+ Razorpay,
+ Shift4,
+ Square,
+ Stax,
+ Stripe,
+ Taxjar,
+ Threedsecureio,
+ //Thunes,
+ Trustpay,
+ Tsys,
+ Volt,
+ Wellsfargo,
+ // Wellsfargopayout,
+ Wise,
+ Worldline,
+ Worldpay,
+ Signifyd,
+ Plaid,
+ Riskified,
+ Zen,
+ Zsl,
+}
+
+impl Connector {
+ #[cfg(feature = "payouts")]
+ pub fn supports_instant_payout(&self, payout_method: Option) -> bool {
+ matches!(
+ (self, payout_method),
+ (Self::Paypal, Some(PayoutType::Wallet))
+ | (_, Some(PayoutType::Card))
+ | (Self::Adyenplatform, _)
+ )
+ }
+ #[cfg(feature = "payouts")]
+ pub fn supports_create_recipient(&self, payout_method: Option) -> bool {
+ matches!((self, payout_method), (_, Some(PayoutType::Bank)))
+ }
+ #[cfg(feature = "payouts")]
+ pub fn supports_payout_eligibility(&self, payout_method: Option) -> bool {
+ matches!((self, payout_method), (_, Some(PayoutType::Card)))
+ }
+ #[cfg(feature = "payouts")]
+ pub fn is_payout_quote_call_required(&self) -> bool {
+ matches!(self, Self::Wise)
+ }
+ #[cfg(feature = "payouts")]
+ pub fn supports_access_token_for_payout(&self, payout_method: Option) -> bool {
+ matches!((self, payout_method), (Self::Paypal, _))
+ }
+ #[cfg(feature = "payouts")]
+ pub fn supports_vendor_disburse_account_create_for_payout(&self) -> bool {
+ matches!(self, Self::Stripe)
+ }
+ pub fn supports_access_token(&self, payment_method: PaymentMethod) -> bool {
+ matches!(
+ (self, payment_method),
+ (Self::Airwallex, _)
+ | (Self::Deutschebank, _)
+ | (Self::Globalpay, _)
+ | (Self::Paypal, _)
+ | (Self::Payu, _)
+ | (Self::Trustpay, PaymentMethod::BankRedirect)
+ | (Self::Iatapay, _)
+ | (Self::Volt, _)
+ | (Self::Itaubank, _)
+ )
+ }
+ pub fn supports_file_storage_module(&self) -> bool {
+ matches!(self, Self::Stripe | Self::Checkout)
+ }
+ pub fn requires_defend_dispute(&self) -> bool {
+ matches!(self, Self::Checkout)
+ }
+ pub fn is_separate_authentication_supported(&self) -> bool {
+ match self {
+ #[cfg(feature = "dummy_connector")]
+ Self::DummyConnector1
+ | Self::DummyConnector2
+ | Self::DummyConnector3
+ | Self::DummyConnector4
+ | Self::DummyConnector5
+ | Self::DummyConnector6
+ | Self::DummyConnector7 => false,
+ Self::Aci
+ // Add Separate authentication support for connectors
+ | Self::Adyen
+ | Self::Adyenplatform
+ | Self::Airwallex
+ | Self::Authorizedotnet
+ | Self::Bambora
+ | Self::Bamboraapac
+ | Self::Bankofamerica
+ | Self::Billwerk
+ | Self::Bitpay
+ | Self::Bluesnap
+ | Self::Boku
+ | Self::Braintree
+ | Self::Cashtocode
+ | Self::Coinbase
+ | Self::Cryptopay
+ | Self::Deutschebank
+ | Self::Dlocal
+ | Self::Ebanx
+ | Self::Fiserv
+ | Self::Fiservemea
+ | Self::Fiuu
+ | Self::Forte
+ | Self::Globalpay
+ | Self::Globepay
+ | Self::Gocardless
+ | Self::Gpayments
+ | Self::Helcim
+ | Self::Iatapay
+ | Self::Itaubank
+ //| Self::Jpmorgan
+ | Self::Klarna
+ | Self::Mifinity
+ | Self::Mollie
+ | Self::Multisafepay
+ | Self::Nexinets
+ | Self::Nexixpay
+ | Self::Novalnet
+ | Self::Nuvei
+ | Self::Opennode
+ | Self::Paybox
+ | Self::Payme
+ | Self::Payone
+ | Self::Paypal
+ | Self::Payu
+ | Self::Placetopay
+ | Self::Powertranz
+ | Self::Prophetpay
+ | Self::Rapyd
+ | Self::Shift4
+ | Self::Square
+ | Self::Stax
+ | Self::Taxjar
+ // | Self::Thunes
+ | Self::Trustpay
+ | Self::Tsys
+ | Self::Volt
+ | Self::Wellsfargo
+ // | Self::Wellsfargopayout
+ | Self::Wise
+ | Self::Worldline
+ | Self::Worldpay
+ | Self::Zen
+ | Self::Zsl
+ | Self::Signifyd
+ | Self::Plaid
+ | Self::Razorpay
+ | Self::Riskified
+ | Self::Threedsecureio
+ | Self::Datatrans
+ | Self::Netcetera
+ | Self::Noon
+ | Self::Stripe => false,
+ Self::Checkout | Self::Nmi | Self::Cybersource => true,
+ }
+ }
+ pub fn is_pre_processing_required_before_authorize(&self) -> bool {
+ matches!(self, Self::Airwallex)
+ }
+ #[cfg(feature = "dummy_connector")]
+ pub fn validate_dummy_connector_enabled(
+ &self,
+ is_dummy_connector_enabled: bool,
+ ) -> errors::CustomResult<(), errors::ValidationError> {
+ if !is_dummy_connector_enabled
+ && matches!(
+ self,
+ Self::DummyConnector1
+ | Self::DummyConnector2
+ | Self::DummyConnector3
+ | Self::DummyConnector4
+ | Self::DummyConnector5
+ | Self::DummyConnector6
+ | Self::DummyConnector7
+ )
+ {
+ Err(errors::ValidationError::InvalidValue {
+ message: "Invalid connector name".to_string(),
+ }
+ .into())
+ } else {
+ Ok(())
+ }
+ }
+}
diff --git a/crates/api_models/src/connector_onboarding.rs b/crates/api_models/src/connector_onboarding.rs
index 2dca57d5953f..e86f4a6f2fa9 100644
--- a/crates/api_models/src/connector_onboarding.rs
+++ b/crates/api_models/src/connector_onboarding.rs
@@ -42,7 +42,7 @@ pub enum PayPalOnboardingStatus {
MorePermissionsNeeded,
EmailNotVerified,
Success(PayPalOnboardingDone),
- ConnectorIntegrated(admin::MerchantConnectorResponse),
+ ConnectorIntegrated(Box),
}
#[derive(serde::Serialize, Debug, Clone)]
diff --git a/crates/api_models/src/customers.rs b/crates/api_models/src/customers.rs
index eb196a720746..4f6411a42cd9 100644
--- a/crates/api_models/src/customers.rs
+++ b/crates/api_models/src/customers.rs
@@ -1,12 +1,5 @@
-use common_utils::{
- crypto, custom_serde,
- encryption::Encryption,
- id_type,
- pii::{self, EmailStrategy},
- types::{keymanager::ToEncryptable, Description},
-};
-use masking::{ExposeInterface, Secret, SwitchStrategy};
-use rustc_hash::FxHashMap;
+use common_utils::{crypto, custom_serde, id_type, pii, types::Description};
+use masking::Secret;
use serde::{Deserialize, Serialize};
use utoipa::ToSchema;
@@ -129,85 +122,6 @@ impl CustomerRequest {
}
}
-pub struct CustomerRequestWithEmail {
- pub name: Option>,
- pub email: Option,
- pub phone: Option>,
-}
-
-pub struct CustomerRequestWithEncryption {
- pub name: Option,
- pub phone: Option,
- pub email: Option,
-}
-
-pub struct EncryptableCustomer {
- pub name: crypto::OptionalEncryptableName,
- pub phone: crypto::OptionalEncryptablePhone,
- pub email: crypto::OptionalEncryptableEmail,
-}
-
-impl ToEncryptable, Encryption>
- for CustomerRequestWithEncryption
-{
- fn to_encryptable(self) -> FxHashMap {
- let mut map = FxHashMap::with_capacity_and_hasher(3, Default::default());
- self.name.map(|x| map.insert("name".to_string(), x));
- self.phone.map(|x| map.insert("phone".to_string(), x));
- self.email.map(|x| map.insert("email".to_string(), x));
- map
- }
-
- fn from_encryptable(
- mut hashmap: FxHashMap>>,
- ) -> common_utils::errors::CustomResult
- {
- Ok(EncryptableCustomer {
- name: hashmap.remove("name"),
- phone: hashmap.remove("phone"),
- email: hashmap.remove("email").map(|email| {
- let encryptable: crypto::Encryptable> =
- crypto::Encryptable::new(
- email.clone().into_inner().switch_strategy(),
- email.into_encrypted(),
- );
- encryptable
- }),
- })
- }
-}
-
-impl ToEncryptable, Secret>
- for CustomerRequestWithEmail
-{
- fn to_encryptable(self) -> FxHashMap> {
- let mut map = FxHashMap::with_capacity_and_hasher(3, Default::default());
- self.name.map(|x| map.insert("name".to_string(), x));
- self.phone.map(|x| map.insert("phone".to_string(), x));
- self.email
- .map(|x| map.insert("email".to_string(), x.expose().switch_strategy()));
- map
- }
-
- fn from_encryptable(
- mut hashmap: FxHashMap>>,
- ) -> common_utils::errors::CustomResult
- {
- Ok(EncryptableCustomer {
- name: hashmap.remove("name"),
- email: hashmap.remove("email").map(|email| {
- let encryptable: crypto::Encryptable> =
- crypto::Encryptable::new(
- email.clone().into_inner().switch_strategy(),
- email.into_encrypted(),
- );
- encryptable
- }),
- phone: hashmap.remove("phone"),
- })
- }
-}
-
#[cfg(all(any(feature = "v1", feature = "v2"), not(feature = "customer_v2")))]
#[derive(Debug, Clone, Serialize, ToSchema)]
pub struct CustomerResponse {
diff --git a/crates/api_models/src/enums.rs b/crates/api_models/src/enums.rs
index 48939e430595..e2b2b7fde46f 100644
--- a/crates/api_models/src/enums.rs
+++ b/crates/api_models/src/enums.rs
@@ -1,10 +1,10 @@
use std::str::FromStr;
pub use common_enums::*;
-#[cfg(feature = "dummy_connector")]
-use common_utils::errors;
use utoipa::ToSchema;
+pub use super::connector_enums::Connector;
+
#[derive(
Clone,
Copy,
@@ -27,300 +27,6 @@ pub enum RoutingAlgorithm {
Custom,
}
-/// A connector is an integration to fulfill payments
-#[derive(
- Clone,
- Copy,
- Debug,
- Eq,
- PartialEq,
- ToSchema,
- serde::Deserialize,
- serde::Serialize,
- strum::VariantNames,
- strum::EnumIter,
- strum::Display,
- strum::EnumString,
- Hash,
-)]
-#[serde(rename_all = "snake_case")]
-#[strum(serialize_all = "snake_case")]
-pub enum Connector {
- Adyenplatform,
- #[cfg(feature = "dummy_connector")]
- #[serde(rename = "phonypay")]
- #[strum(serialize = "phonypay")]
- DummyConnector1,
- #[cfg(feature = "dummy_connector")]
- #[serde(rename = "fauxpay")]
- #[strum(serialize = "fauxpay")]
- DummyConnector2,
- #[cfg(feature = "dummy_connector")]
- #[serde(rename = "pretendpay")]
- #[strum(serialize = "pretendpay")]
- DummyConnector3,
- #[cfg(feature = "dummy_connector")]
- #[serde(rename = "stripe_test")]
- #[strum(serialize = "stripe_test")]
- DummyConnector4,
- #[cfg(feature = "dummy_connector")]
- #[serde(rename = "adyen_test")]
- #[strum(serialize = "adyen_test")]
- DummyConnector5,
- #[cfg(feature = "dummy_connector")]
- #[serde(rename = "checkout_test")]
- #[strum(serialize = "checkout_test")]
- DummyConnector6,
- #[cfg(feature = "dummy_connector")]
- #[serde(rename = "paypal_test")]
- #[strum(serialize = "paypal_test")]
- DummyConnector7,
- Aci,
- Adyen,
- Airwallex,
- Authorizedotnet,
- Bambora,
- Bamboraapac,
- Bankofamerica,
- Billwerk,
- Bitpay,
- Bluesnap,
- Boku,
- Braintree,
- Cashtocode,
- Checkout,
- Coinbase,
- Cryptopay,
- Cybersource,
- Datatrans,
- Deutschebank,
- // Digitalvirgo, template code for future usage
- Dlocal,
- Ebanx,
- Fiserv,
- Fiservemea,
- Fiuu,
- Forte,
- Globalpay,
- Globepay,
- Gocardless,
- Gpayments,
- Helcim,
- Iatapay,
- Itaubank,
- Klarna,
- Mifinity,
- Mollie,
- Multisafepay,
- Netcetera,
- Nexinets,
- Nexixpay,
- Nmi,
- Noon,
- Novalnet,
- Nuvei,
- // Opayo, added as template code for future usage
- Opennode,
- Paybox,
- // Payeezy, As psync and rsync are not supported by this connector, it is added as template code for future usage
- Payme,
- Payone,
- Paypal,
- Payu,
- Placetopay,
- Powertranz,
- Prophetpay,
- Rapyd,
- Razorpay,
- Shift4,
- Square,
- Stax,
- Stripe,
- Taxjar,
- Threedsecureio,
- //Thunes,
- Trustpay,
- Tsys,
- Volt,
- Wellsfargo,
- // Wellsfargopayout,
- Wise,
- Worldline,
- Worldpay,
- Signifyd,
- Plaid,
- Riskified,
- Zen,
- Zsl,
-}
-
-impl Connector {
- #[cfg(feature = "payouts")]
- pub fn supports_instant_payout(&self, payout_method: Option) -> bool {
- matches!(
- (self, payout_method),
- (Self::Paypal, Some(PayoutType::Wallet))
- | (_, Some(PayoutType::Card))
- | (Self::Adyenplatform, _)
- )
- }
- #[cfg(feature = "payouts")]
- pub fn supports_create_recipient(&self, payout_method: Option) -> bool {
- matches!((self, payout_method), (_, Some(PayoutType::Bank)))
- }
- #[cfg(feature = "payouts")]
- pub fn supports_payout_eligibility(&self, payout_method: Option) -> bool {
- matches!((self, payout_method), (_, Some(PayoutType::Card)))
- }
- #[cfg(feature = "payouts")]
- pub fn is_payout_quote_call_required(&self) -> bool {
- matches!(self, Self::Wise)
- }
- #[cfg(feature = "payouts")]
- pub fn supports_access_token_for_payout(&self, payout_method: Option) -> bool {
- matches!((self, payout_method), (Self::Paypal, _))
- }
- #[cfg(feature = "payouts")]
- pub fn supports_vendor_disburse_account_create_for_payout(&self) -> bool {
- matches!(self, Self::Stripe)
- }
- pub fn supports_access_token(&self, payment_method: PaymentMethod) -> bool {
- matches!(
- (self, payment_method),
- (Self::Airwallex, _)
- | (Self::Deutschebank, _)
- | (Self::Globalpay, _)
- | (Self::Paypal, _)
- | (Self::Payu, _)
- | (Self::Trustpay, PaymentMethod::BankRedirect)
- | (Self::Iatapay, _)
- | (Self::Volt, _)
- | (Self::Itaubank, _)
- )
- }
- pub fn supports_file_storage_module(&self) -> bool {
- matches!(self, Self::Stripe | Self::Checkout)
- }
- pub fn requires_defend_dispute(&self) -> bool {
- matches!(self, Self::Checkout)
- }
- pub fn is_separate_authentication_supported(&self) -> bool {
- match self {
- #[cfg(feature = "dummy_connector")]
- Self::DummyConnector1
- | Self::DummyConnector2
- | Self::DummyConnector3
- | Self::DummyConnector4
- | Self::DummyConnector5
- | Self::DummyConnector6
- | Self::DummyConnector7 => false,
- Self::Aci
- // Add Separate authentication support for connectors
- // | Self::Fiuu
- | Self::Adyen
- | Self::Adyenplatform
- | Self::Airwallex
- | Self::Authorizedotnet
- | Self::Bambora
- | Self::Bamboraapac
- | Self::Bankofamerica
- | Self::Billwerk
- | Self::Bitpay
- | Self::Bluesnap
- | Self::Boku
- | Self::Braintree
- | Self::Cashtocode
- | Self::Coinbase
- | Self::Cryptopay
- | Self::Deutschebank
- | Self::Dlocal
- | Self::Ebanx
- | Self::Fiserv
- | Self::Fiservemea
- | Self::Fiuu
- | Self::Forte
- | Self::Globalpay
- | Self::Globepay
- | Self::Gocardless
- | Self::Gpayments
- | Self::Helcim
- | Self::Iatapay
- | Self::Itaubank
- | Self::Klarna
- | Self::Mifinity
- | Self::Mollie
- | Self::Multisafepay
- | Self::Nexinets
- | Self::Nexixpay
- | Self::Novalnet
- | Self::Nuvei
- | Self::Opennode
- | Self::Paybox
- | Self::Payme
- | Self::Payone
- | Self::Paypal
- | Self::Payu
- | Self::Placetopay
- | Self::Powertranz
- | Self::Prophetpay
- | Self::Rapyd
- | Self::Shift4
- | Self::Square
- | Self::Stax
- | Self::Taxjar
- //| Self::Thunes
- | Self::Trustpay
- | Self::Tsys
- | Self::Volt
- | Self::Wellsfargo
- // | Self::Wellsfargopayout
- | Self::Wise
- | Self::Worldline
- | Self::Worldpay
- | Self::Zen
- | Self::Zsl
- | Self::Signifyd
- | Self::Plaid
- | Self::Razorpay
- | Self::Riskified
- | Self::Threedsecureio
- | Self::Datatrans
- | Self::Netcetera
- | Self::Noon
- | Self::Stripe => false,
- Self::Checkout | Self::Nmi | Self::Cybersource => true,
- }
- }
- pub fn is_pre_processing_required_before_authorize(&self) -> bool {
- matches!(self, Self::Airwallex)
- }
- #[cfg(feature = "dummy_connector")]
- pub fn validate_dummy_connector_enabled(
- &self,
- is_dummy_connector_enabled: bool,
- ) -> errors::CustomResult<(), errors::ValidationError> {
- if !is_dummy_connector_enabled
- && matches!(
- self,
- Self::DummyConnector1
- | Self::DummyConnector2
- | Self::DummyConnector3
- | Self::DummyConnector4
- | Self::DummyConnector5
- | Self::DummyConnector6
- | Self::DummyConnector7
- )
- {
- Err(errors::ValidationError::InvalidValue {
- message: "Invalid connector name".to_string(),
- }
- .into())
- } else {
- Ok(())
- }
- }
-}
-
#[cfg(feature = "payouts")]
#[derive(
Clone,
diff --git a/crates/api_models/src/events/payment.rs b/crates/api_models/src/events/payment.rs
index 7bbff94d453e..b9dc1476fdb8 100644
--- a/crates/api_models/src/events/payment.rs
+++ b/crates/api_models/src/events/payment.rs
@@ -1,9 +1,10 @@
use common_utils::events::{ApiEventMetric, ApiEventsType};
#[cfg(feature = "v2")]
-use super::PaymentsCreateIntentRequest;
-#[cfg(feature = "v2")]
-use super::PaymentsCreateIntentResponse;
+use super::{
+ PaymentsConfirmIntentResponse, PaymentsCreateIntentRequest, PaymentsGetIntentRequest,
+ PaymentsIntentResponse,
+};
#[cfg(all(
any(feature = "v2", feature = "v1"),
not(feature = "payment_methods_v2")
@@ -20,7 +21,7 @@ use crate::{
PaymentMethodResponse, PaymentMethodUpdate,
},
payments::{
- ExtendedCardInfoResponse, PaymentIdType, PaymentListConstraints,
+ self, ExtendedCardInfoResponse, PaymentIdType, PaymentListConstraints,
PaymentListFilterConstraints, PaymentListFilters, PaymentListFiltersV2,
PaymentListResponse, PaymentListResponseV2, PaymentsAggregateResponse,
PaymentsApproveRequest, PaymentsCancelRequest, PaymentsCaptureRequest,
@@ -29,8 +30,8 @@ use crate::{
PaymentsExternalAuthenticationResponse, PaymentsIncrementalAuthorizationRequest,
PaymentsManualUpdateRequest, PaymentsManualUpdateResponse,
PaymentsPostSessionTokensRequest, PaymentsPostSessionTokensResponse, PaymentsRejectRequest,
- PaymentsRequest, PaymentsResponse, PaymentsRetrieveRequest, PaymentsSessionResponse,
- PaymentsStartRequest, RedirectionResponse,
+ PaymentsResponse, PaymentsRetrieveRequest, PaymentsSessionResponse, PaymentsStartRequest,
+ RedirectionResponse,
},
};
@@ -131,7 +132,7 @@ impl ApiEventMetric for PaymentsRejectRequest {
}
#[cfg(feature = "v1")]
-impl ApiEventMetric for PaymentsRequest {
+impl ApiEventMetric for payments::PaymentsRequest {
fn get_api_event_type(&self) -> Option {
match self.payment_id {
Some(PaymentIdType::PaymentIntentId(ref id)) => Some(ApiEventsType::Payment {
@@ -150,7 +151,25 @@ impl ApiEventMetric for PaymentsCreateIntentRequest {
}
#[cfg(feature = "v2")]
-impl ApiEventMetric for PaymentsCreateIntentResponse {
+impl ApiEventMetric for PaymentsGetIntentRequest {
+ fn get_api_event_type(&self) -> Option {
+ Some(ApiEventsType::Payment {
+ payment_id: self.id.clone(),
+ })
+ }
+}
+
+#[cfg(feature = "v2")]
+impl ApiEventMetric for PaymentsIntentResponse {
+ fn get_api_event_type(&self) -> Option {
+ Some(ApiEventsType::Payment {
+ payment_id: self.id.clone(),
+ })
+ }
+}
+
+#[cfg(feature = "v2")]
+impl ApiEventMetric for PaymentsConfirmIntentResponse {
fn get_api_event_type(&self) -> Option {
Some(ApiEventsType::Payment {
payment_id: self.id.clone(),
diff --git a/crates/api_models/src/events/refund.rs b/crates/api_models/src/events/refund.rs
index d180753735f3..e87ae1544714 100644
--- a/crates/api_models/src/events/refund.rs
+++ b/crates/api_models/src/events/refund.rs
@@ -6,6 +6,7 @@ use crate::refunds::{
RefundUpdateRequest, RefundsRetrieveRequest,
};
+#[cfg(feature = "v1")]
impl ApiEventMetric for RefundRequest {
fn get_api_event_type(&self) -> Option {
let payment_id = self.payment_id.clone();
@@ -18,6 +19,7 @@ impl ApiEventMetric for RefundRequest {
}
}
+#[cfg(feature = "v1")]
impl ApiEventMetric for RefundResponse {
fn get_api_event_type(&self) -> Option {
Some(ApiEventsType::Refund {
@@ -27,6 +29,17 @@ impl ApiEventMetric for RefundResponse {
}
}
+#[cfg(feature = "v2")]
+impl ApiEventMetric for RefundResponse {
+ fn get_api_event_type(&self) -> Option {
+ Some(ApiEventsType::Refund {
+ payment_id: self.payment_id.clone(),
+ refund_id: self.id.clone(),
+ })
+ }
+}
+
+#[cfg(feature = "v1")]
impl ApiEventMetric for RefundsRetrieveRequest {
fn get_api_event_type(&self) -> Option {
Some(ApiEventsType::Refund {
@@ -36,6 +49,7 @@ impl ApiEventMetric for RefundsRetrieveRequest {
}
}
+#[cfg(feature = "v1")]
impl ApiEventMetric for RefundUpdateRequest {
fn get_api_event_type(&self) -> Option {
Some(ApiEventsType::Refund {
@@ -45,6 +59,7 @@ impl ApiEventMetric for RefundUpdateRequest {
}
}
+#[cfg(feature = "v1")]
impl ApiEventMetric for RefundManualUpdateRequest {
fn get_api_event_type(&self) -> Option {
Some(ApiEventsType::Refund {
diff --git a/crates/api_models/src/events/user_role.rs b/crates/api_models/src/events/user_role.rs
index a2c76ecc3944..e0df36a3349c 100644
--- a/crates/api_models/src/events/user_role.rs
+++ b/crates/api_models/src/events/user_role.rs
@@ -2,8 +2,9 @@ use common_utils::events::{ApiEventMetric, ApiEventsType};
use crate::user_role::{
role::{
- CreateRoleRequest, GetRoleRequest, ListRolesAtEntityLevelRequest, ListRolesRequest,
- RoleInfoResponseNew, RoleInfoWithGroupsResponse, UpdateRoleRequest,
+ CreateRoleRequest, GetRoleRequest, GroupsAndResources, ListRolesAtEntityLevelRequest,
+ ListRolesRequest, RoleInfoResponseNew, RoleInfoWithGroupsResponse, RoleInfoWithParents,
+ UpdateRoleRequest,
},
AuthorizationInfoResponse, DeleteUserRoleRequest, ListUsersInEntityRequest,
UpdateUserRoleRequest,
@@ -22,6 +23,8 @@ common_utils::impl_api_event_type!(
RoleInfoResponseNew,
RoleInfoWithGroupsResponse,
ListUsersInEntityRequest,
- ListRolesRequest
+ ListRolesRequest,
+ GroupsAndResources,
+ RoleInfoWithParents
)
);
diff --git a/crates/api_models/src/lib.rs b/crates/api_models/src/lib.rs
index daa329a76317..a28332e7fea0 100644
--- a/crates/api_models/src/lib.rs
+++ b/crates/api_models/src/lib.rs
@@ -5,6 +5,7 @@ pub mod apple_pay_certificates_migration;
pub mod blocklist;
pub mod cards_info;
pub mod conditional_configs;
+pub mod connector_enums;
pub mod connector_onboarding;
pub mod consts;
pub mod currency;
diff --git a/crates/api_models/src/payment_methods.rs b/crates/api_models/src/payment_methods.rs
index 84106a87d9b6..47460e73b713 100644
--- a/crates/api_models/src/payment_methods.rs
+++ b/crates/api_models/src/payment_methods.rs
@@ -6,6 +6,8 @@ use cards::CardNumber;
use common_utils::{
consts::SURCHARGE_PERCENTAGE_PRECISION_LENGTH,
crypto::OptionalEncryptableName,
+ errors,
+ ext_traits::OptionExt,
id_type, link_utils, pii,
types::{MinorUnit, Percentage, Surcharge},
};
@@ -1217,12 +1219,14 @@ pub struct ResponsePaymentMethodIntermediate {
pub card_networks: Option>,
pub payment_method: api_enums::PaymentMethod,
pub connector: String,
+ pub merchant_connector_id: String,
}
impl ResponsePaymentMethodIntermediate {
pub fn new(
pm_type: RequestPaymentMethodTypes,
connector: String,
+ merchant_connector_id: String,
pm: api_enums::PaymentMethod,
) -> Self {
Self {
@@ -1231,6 +1235,7 @@ impl ResponsePaymentMethodIntermediate {
card_networks: pm_type.card_networks,
payment_method: pm,
connector,
+ merchant_connector_id,
}
}
}
@@ -2062,16 +2067,16 @@ pub struct PaymentMethodRecord {
pub email: Option,
pub phone: Option>,
pub phone_country_code: Option,
- pub merchant_id: id_type::MerchantId,
+ pub merchant_id: Option,
pub payment_method: Option,
pub payment_method_type: Option,
pub nick_name: masking::Secret,
- pub payment_instrument_id: masking::Secret,
+ pub payment_instrument_id: Option>,
pub card_number_masked: masking::Secret,
pub card_expiry_month: masking::Secret,
pub card_expiry_year: masking::Secret,
pub card_scheme: Option,
- pub original_transaction_id: String,
+ pub original_transaction_id: Option,
pub billing_address_zip: masking::Secret,
pub billing_address_state: masking::Secret,
pub billing_address_first_name: masking::Secret,
@@ -2082,7 +2087,7 @@ pub struct PaymentMethodRecord {
pub billing_address_line2: Option>,
pub billing_address_line3: Option>,
pub raw_card_number: Option>,
- pub merchant_connector_id: id_type::MerchantConnectorAccountId,
+ pub merchant_connector_id: Option,
pub original_transaction_amount: Option,
pub original_transaction_currency: Option,
pub line_number: Option,
@@ -2168,31 +2173,54 @@ impl From for PaymentMethodMigrationResponse
}
}
-impl From for PaymentMethodMigrate {
- fn from(record: PaymentMethodRecord) -> Self {
- let mut mandate_reference = HashMap::new();
- mandate_reference.insert(
- record.merchant_connector_id,
- PaymentsMandateReferenceRecord {
- connector_mandate_id: record.payment_instrument_id.peek().to_string(),
- payment_method_type: record.payment_method_type,
- original_payment_authorized_amount: record.original_transaction_amount,
- original_payment_authorized_currency: record.original_transaction_currency,
- },
- );
- Self {
- merchant_id: record.merchant_id,
+impl
+ TryFrom<(
+ PaymentMethodRecord,
+ id_type::MerchantId,
+ Option,
+ )> for PaymentMethodMigrate
+{
+ type Error = error_stack::Report