Skip to content

Commit 62bce3b

Browse files
committed
Merge branch 'main' of github.com:juspay/hyperswitch into fix-refactor-verifyurl-in-redirection-handler
* 'main' of github.com:juspay/hyperswitch: (444 commits) ci: add tests that make use of locker (juspay#6735) chore(version): 2024.12.26.1 fix(router): populate `profile_id` in for the HeaderAuth of v1 (juspay#6936) docs(openapi): update /relay request example (juspay#6942) chore(version): 2024.12.26.0 fix(payments_list): handle same payment/attempt ids for different merchants (juspay#6917) refactor(core): remove merchant return url from `router_data` (juspay#6895) feat(router): add endpoint for listing connector features (juspay#6612) fix(wasm): remove chasenet from jpmorgan wasm as ChaseNet doesn’t exist in PMT (juspay#6927) fix(cors): expose all headers set by application in `access-control-expose-headers` header value (juspay#6877) chore(version): 2024.12.24.0 feat(cypress): valdiate `error_code` and `error_message` and make it visible in `reports` (juspay#6913) fix(wasm): remove extra space from wasm for payment_method_type of JPMorgan (juspay#6923) fix(wasm): fix feature dependencies in `connector_configs` crate for WASM builds (juspay#6832) feat(router): add /retrieve api for relay (juspay#6918) feat(core): implemented platform merchant account (juspay#6882) feat(payments_v2): add payment method list endpoint (juspay#6805) fix(connector): [Cybersource] fix the required fields for wallet mandate payments (juspay#6911) chore(version): 2024.12.23.0 feat(connector): [JPMORGAN] add Payment flows for cards (juspay#6668) ...
2 parents d9ff1d9 + 295d3dd commit 62bce3b

File tree

1,272 files changed

+136149
-56213
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,272 files changed

+136149
-56213
lines changed

.clippy.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
allow-dbg-in-tests = true

.github/CODEOWNERS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ crates/test_utils/tests/connectors/ @juspay/hyperswitch-connector
4545
crates/test_utils/tests/sample_auth.toml @juspay/hyperswitch-connector
4646
crates/connector_configs/ @juspay/hyperswitch-connector
4747
crates/hyperswitch_connectors/ @juspay/hyperswitch-connector
48+
crates/api_models/src/connector_enums.rs @juspay/hyperswitch-connector
49+
crates/common_enums/src/connector_enums.rs @juspay/hyperswitch-connector
50+
crates/router/src/configs/defaults/payment_connector_required_fields.rs @juspay/hyperswitch-connector
51+
crates/hyperswitch_interfaces/src/configs.rs @juspay/hyperswitch-connector
4852

4953
crates/router/src/compatibility/ @juspay/hyperswitch-compatibility
5054

@@ -56,6 +60,7 @@ crates/euclid @juspay/hyperswitch-routing
5660
crates/euclid_macros @juspay/hyperswitch-routing
5761
crates/euclid_wasm @juspay/hyperswitch-routing
5862
crates/kgraph_utils @juspay/hyperswitch-routing
63+
crates/pm_auth @juspay/hyperswitch-routing
5964
crates/router/src/routes/routing.rs @juspay/hyperswitch-routing
6065
crates/router/src/core/routing @juspay/hyperswitch-routing
6166
crates/router/src/core/routing.rs @juspay/hyperswitch-routing

.github/data/cards_info.csv

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
card_iin,card_issuer,card_network,card_type,card_subtype,card_issuing_country,bank_code_id,bank_code,country_code,date_created,last_updated,last_updated_provider
2+
111122,,Visa,DEBIT,,,,,,2017-06-18 10:00:39,,
3+
400000,INTL HDQTRS-CENTER OWNED,Visa,CREDIT,,UNITEDSTATES,,,840,2015-08-04 08:50:42,2022-06-30 16:54:07,Visa
4+
401200,VISA PRODUCTION SUPPORT CLIENT BID 1,Visa,DEBIT,CLASSIC,UNITEDSTATES,,,840,2015-07-27 12:04:10,2022-07-06 10:24:32,Visa
5+
411111,JP Morgan,Visa,CREDIT,,INDIA,131,JP_JPM,,2015-07-22 23:36:35,2021-02-23 07:38:19,
6+
420000,JP Morgan,Visa,CREDIT,,UNITEDSTATES,131,JP_JPM,,2016-05-12 18:37:38,2021-02-23 07:56:53,
7+
424242,STRIPE PAYMENTS UK LIMITED,Visa,CREDIT,,UNITEDKINGDOM,,,826,2015-07-22 16:41:32,2022-12-12 13:02:19,Visa
8+
434994,INTESA SANPAOLO S.P.A.,Visa,CREDIT,CLASSIC,ITALY,,,380,2015-12-30 17:01:46,2022-12-12 13:03:12,Visa
9+
444409,SELECT SEVEN FEDERAL CREDIT UNION,Visa,DEBIT,CLASSIC,UNITEDSTATES,,,840,2016-05-12 18:41:09,2022-07-06 10:26:20,Visa
10+
486871,AMERICA FIRST FEDERAL CREDIT UNION,Visa,CREDIT,BUSINESS,UNITEDSTATES,,,840,2016-05-12 18:47:21,2022-07-06 10:35:26,Visa
11+
491761,BANKPOLSKAKASAOPIEKIS.A.(BANKPEKAOSA),Visa,CREDIT,BUSINESS,POLAND,,,,2015-09-07 12:58:50,,
12+
510510,BANKOFHAWAII,Mastercard,CREDIT,,UNITEDSTATES,,,,2015-07-30 05:18:28,,
13+
520474,MASTERCARD INTERNATIONAL,Visa,DEBIT,,UNITEDSTATES,,,840,2016-05-12 18:51:16,2022-12-12 15:17:33,Visa

.github/workflows/CI-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ jobs:
325325

326326
- name: Run cargo clippy with v2 features enabled
327327
shell: bash
328-
run: just clippy_v2 -- -D warnings -Aunused -Aclippy::todo -Aclippy::diverging_sub_expression
328+
run: just clippy_v2
329329

330330
- name: Run cargo check enabling only the release and v2 features
331331
shell: bash

.github/workflows/cypress-tests-runner.yml

Lines changed: 72 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,77 @@ concurrency:
1313
env:
1414
CARGO_INCREMENTAL: 0
1515
CARGO_NET_RETRY: 10
16-
CONNECTORS: stripe
16+
PAYMENTS_CONNECTORS: "cybersource stripe"
17+
PAYOUTS_CONNECTORS: "adyenplatform wise"
1718
RUST_BACKTRACE: short
1819
RUSTUP_MAX_RETRIES: 10
1920
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')}}
2021
DEBUG: cypress:cli
2122
RUST_MIN_STACK: 10485760
2223

2324
jobs:
25+
formatter:
26+
name: Run formatter on Cypress tests and address lints
27+
if: ${{ github.event_name == 'pull_request' }}
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Generate a token
31+
if: ${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
32+
id: generate_token
33+
uses: actions/create-github-app-token@v1
34+
with:
35+
app-id: ${{ secrets.HYPERSWITCH_BOT_APP_ID }}
36+
private-key: ${{ secrets.HYPERSWITCH_BOT_APP_PRIVATE_KEY }}
37+
38+
- name: Checkout repository with token
39+
if: ${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
40+
uses: actions/checkout@v4
41+
with:
42+
fetch-depth: 0
43+
ref: ${{ github.event.pull_request.head.ref }}
44+
token: ${{ steps.generate_token.outputs.token }}
45+
46+
- name: Checkout repository for fork
47+
if: ${{ github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }}
48+
uses: actions/checkout@v4
49+
50+
- name: Install Node.js
51+
uses: actions/setup-node@v4
52+
with:
53+
node-version: '20'
54+
55+
- name: Install Cypress and dependencies
56+
run: |
57+
npm ci --prefix ./cypress-tests
58+
59+
- name: Check formatting for forked pull requests
60+
if: ${{ github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }}
61+
shell: bash
62+
run: |
63+
npm run format:check --prefix cypress-tests
64+
npm run lint --prefix cypress-tests
65+
66+
- name: Check formatting
67+
if: ${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
68+
shell: bash
69+
run: |
70+
npm run format --prefix cypress-tests
71+
npm run lint --prefix cypress-tests -- --fix
72+
73+
if ! git diff --exit-code --quiet -- cypress-tests; then
74+
echo "::notice::Cypress formatting and lint check failed"
75+
76+
git config --local user.name 'hyperswitch-bot[bot]'
77+
git config --local user.email '148525504+hyperswitch-bot[bot]@users.noreply.github.com'
78+
79+
git add cypress-tests
80+
git commit --message 'chore(cypress): run formatter and address lints'
81+
git push
82+
fi
83+
2484
runner:
2585
name: Run Cypress tests
26-
runs-on: hyperswitch-runners
86+
runs-on: ubuntu-latest
2787

2888
services:
2989
redis:
@@ -68,7 +128,7 @@ jobs:
68128
CONNECTOR_AUTH_PASSPHRASE: ${{ secrets.CONNECTOR_AUTH_PASSPHRASE }}
69129
CONNECTOR_CREDS_S3_BUCKET_URI: ${{ secrets.CONNECTOR_CREDS_S3_BUCKET_URI}}
70130
DESTINATION_FILE_NAME: "creds.json.gpg"
71-
S3_SOURCE_FILE_NAME: "f64157fe-a8f7-43a8-a268-b17e9a8c305f.json.gpg"
131+
S3_SOURCE_FILE_NAME: "aa328308-b34e-41b7-a590-4fe45cfe7991.json.gpg"
72132
shell: bash
73133
run: |
74134
mkdir -p ".github/secrets" ".github/test"
@@ -151,9 +211,14 @@ jobs:
151211
DATABASE_URL: postgres://db_user:db_pass@localhost:5432/hyperswitch_db
152212
run: just migrate run --locked-schema
153213

214+
- name: Insert card info into the database
215+
if: ${{ env.RUN_TESTS == 'true' }}
216+
run: |
217+
PGPASSWORD=db_pass psql --host=localhost --port=5432 --username=db_user --dbname=hyperswitch_db --command "\copy cards_info FROM '.github/data/cards_info.csv' DELIMITER ',' CSV HEADER;"
218+
154219
- name: Build project
155220
if: ${{ env.RUN_TESTS == 'true' }}
156-
run: cargo build --package router --bin router --jobs 6
221+
run: cargo build --package router --bin router --jobs 3
157222

158223
- name: Setup Local Server
159224
if: ${{ env.RUN_TESTS == 'true' }}
@@ -181,29 +246,10 @@ jobs:
181246
if: ${{ env.RUN_TESTS == 'true' }}
182247
env:
183248
CYPRESS_BASEURL: "http://localhost:8080"
249+
ROUTER__SERVER__WORKERS: 4
184250
shell: bash -leuo pipefail {0}
185251
run: |
186-
cd cypress-tests
187-
188-
RED='\033[0;31m'
189-
RESET='\033[0m'
190-
191-
failed_connectors=()
192-
193-
for connector in $(echo "${CONNECTORS}" | tr "," "\n"); do
194-
echo "${connector}"
195-
for service in "payments" "payouts"; do
196-
if ! ROUTER__SERVER__WORKERS=4 CYPRESS_CONNECTOR="${connector}" npm run cypress:"${service}"; then
197-
failed_connectors+=("${connector}-${service}")
198-
fi
199-
done
200-
done
201-
202-
if [ ${#failed_connectors[@]} -gt 0 ]; then
203-
echo -e "${RED}One or more connectors failed to run:${RESET}"
204-
printf '%s\n' "${failed_connectors[@]}"
205-
exit 1
206-
fi
252+
scripts/execute_cypress.sh
207253
208254
kill "${{ env.PID }}"
209255
@@ -213,6 +259,5 @@ jobs:
213259
with:
214260
name: cypress-test-results
215261
path: |
216-
cypress-tests/cypress/reports/*.json
217-
cypress-tests/cypress/reports/*.html
262+
cypress-tests/cypress/reports/
218263
retention-days: 1

.github/workflows/postman-collection-runner.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ env:
1717
CONNECTORS: stripe
1818
RUST_BACKTRACE: short
1919
RUSTUP_MAX_RETRIES: 10
20-
RUST_MIN_STACK: 8388608
20+
RUST_MIN_STACK: 10485760
2121

2222
jobs:
2323
runner:
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: CI wasm-check
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
wasm-ci:
15+
name: Check wasm build
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Install Rust
22+
uses: dtolnay/rust-toolchain@master
23+
with:
24+
toolchain: stable 2 weeks ago
25+
26+
- name: Install wasm-pack
27+
uses: taiki-e/install-action@v2
28+
with:
29+
tool: wasm-pack
30+
checksum: true
31+
32+
- name: wasm build
33+
shell: bash
34+
run: make euclid-wasm

.gitignore

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ target/
187187

188188
### VisualStudioCode ###
189189
.vscode/*
190-
!.vscode/settings.json
190+
.vscode/settings.json
191191
!.vscode/tasks.json
192192
!.vscode/launch.json
193193
!.vscode/extensions.json
@@ -263,4 +263,9 @@ result*
263263
node_modules/
264264

265265
# cypress credentials
266-
creds.json
266+
creds.json
267+
268+
/.direnv
269+
270+
# Nix services data
271+
/data

.typos.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
[default]
22
check-filename = true
3+
extend-ignore-identifiers-re = [
4+
"UE_[0-9]{3,4}", # Unified error codes
5+
]
36

47
[default.extend-identifiers]
58
ABD = "ABD" # Aberdeenshire, UK ISO 3166-2 code
@@ -16,6 +19,7 @@ HypoNoeLbFurNiederosterreichUWien = "HypoNoeLbFurNiederosterreichUWien"
1619
hypo_noe_lb_fur_niederosterreich_u_wien = "hypo_noe_lb_fur_niederosterreich_u_wien"
1720
IOT = "IOT" # British Indian Ocean Territory country code
1821
klick = "klick" # Swedish word for clicks
22+
FPR = "FPR" # Fraud Prevention Rules
1923
LSO = "LSO" # Lesotho country code
2024
NAM = "NAM" # Namibia country code
2125
ND = "ND" # North Dakota state code
@@ -38,8 +42,7 @@ ws2ipdef = "ws2ipdef" # WinSock Extension
3842
ws2tcpip = "ws2tcpip" # WinSock Extension
3943
ZAR = "ZAR" # South African Rand currency code
4044
JOD = "JOD" # Jordan currency code
41-
UE_000 = "UE_000" #default unified error code
42-
45+
Payed = "Payed" # Paid status for digital virgo
4346

4447
[default.extend-words]
4548
aci = "aci" # Name of a connector

0 commit comments

Comments
 (0)