Skip to content

Commit

Permalink
Merge branch 'main' of github.com:juspay/hyperswitch into fix-refacto…
Browse files Browse the repository at this point in the history
…r-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)
  ...
  • Loading branch information
pixincreate committed Dec 26, 2024
2 parents d9ff1d9 + 295d3dd commit 26fa50d
Show file tree
Hide file tree
Showing 1,271 changed files with 136,007 additions and 56,145 deletions.
1 change: 1 addition & 0 deletions .clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
allow-dbg-in-tests = true
5 changes: 5 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -56,6 +60,7 @@ crates/euclid @juspay/hyperswitch-routing
crates/euclid_macros @juspay/hyperswitch-routing
crates/euclid_wasm @juspay/hyperswitch-routing
crates/kgraph_utils @juspay/hyperswitch-routing
crates/pm_auth @juspay/hyperswitch-routing
crates/router/src/routes/routing.rs @juspay/hyperswitch-routing
crates/router/src/core/routing @juspay/hyperswitch-routing
crates/router/src/core/routing.rs @juspay/hyperswitch-routing
Expand Down
13 changes: 13 additions & 0 deletions .github/data/cards_info.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
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
111122,,Visa,DEBIT,,,,,,2017-06-18 10:00:39,,
400000,INTL HDQTRS-CENTER OWNED,Visa,CREDIT,,UNITEDSTATES,,,840,2015-08-04 08:50:42,2022-06-30 16:54:07,Visa
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
411111,JP Morgan,Visa,CREDIT,,INDIA,131,JP_JPM,,2015-07-22 23:36:35,2021-02-23 07:38:19,
420000,JP Morgan,Visa,CREDIT,,UNITEDSTATES,131,JP_JPM,,2016-05-12 18:37:38,2021-02-23 07:56:53,
424242,STRIPE PAYMENTS UK LIMITED,Visa,CREDIT,,UNITEDKINGDOM,,,826,2015-07-22 16:41:32,2022-12-12 13:02:19,Visa
434994,INTESA SANPAOLO S.P.A.,Visa,CREDIT,CLASSIC,ITALY,,,380,2015-12-30 17:01:46,2022-12-12 13:03:12,Visa
444409,SELECT SEVEN FEDERAL CREDIT UNION,Visa,DEBIT,CLASSIC,UNITEDSTATES,,,840,2016-05-12 18:41:09,2022-07-06 10:26:20,Visa
486871,AMERICA FIRST FEDERAL CREDIT UNION,Visa,CREDIT,BUSINESS,UNITEDSTATES,,,840,2016-05-12 18:47:21,2022-07-06 10:35:26,Visa
491761,BANKPOLSKAKASAOPIEKIS.A.(BANKPEKAOSA),Visa,CREDIT,BUSINESS,POLAND,,,,2015-09-07 12:58:50,,
510510,BANKOFHAWAII,Mastercard,CREDIT,,UNITEDSTATES,,,,2015-07-30 05:18:28,,
520474,MASTERCARD INTERNATIONAL,Visa,DEBIT,,UNITEDSTATES,,,840,2016-05-12 18:51:16,2022-12-12 15:17:33,Visa
2 changes: 1 addition & 1 deletion .github/workflows/CI-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
99 changes: 72 additions & 27 deletions .github/workflows/cypress-tests-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,77 @@ concurrency:
env:
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
CONNECTORS: stripe
PAYMENTS_CONNECTORS: "cybersource stripe"
PAYOUTS_CONNECTORS: "adyenplatform 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')}}
DEBUG: cypress:cli
RUST_MIN_STACK: 10485760

jobs:
formatter:
name: Run formatter on Cypress tests and address lints
if: ${{ github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
steps:
- name: Generate a token
if: ${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
id: generate_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.HYPERSWITCH_BOT_APP_ID }}
private-key: ${{ secrets.HYPERSWITCH_BOT_APP_PRIVATE_KEY }}

- name: Checkout repository with token
if: ${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ steps.generate_token.outputs.token }}

- name: Checkout repository for fork
if: ${{ github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }}
uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install Cypress and dependencies
run: |
npm ci --prefix ./cypress-tests
- name: Check formatting for forked pull requests
if: ${{ github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }}
shell: bash
run: |
npm run format:check --prefix cypress-tests
npm run lint --prefix cypress-tests
- name: Check formatting
if: ${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
shell: bash
run: |
npm run format --prefix cypress-tests
npm run lint --prefix cypress-tests -- --fix
if ! git diff --exit-code --quiet -- cypress-tests; then
echo "::notice::Cypress formatting and lint check failed"
git config --local user.name 'hyperswitch-bot[bot]'
git config --local user.email '148525504+hyperswitch-bot[bot]@users.noreply.github.com'
git add cypress-tests
git commit --message 'chore(cypress): run formatter and address lints'
git push
fi
runner:
name: Run Cypress tests
runs-on: hyperswitch-runners
runs-on: ubuntu-latest

services:
redis:
Expand Down Expand Up @@ -68,7 +128,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: "aa328308-b34e-41b7-a590-4fe45cfe7991.json.gpg"
shell: bash
run: |
mkdir -p ".github/secrets" ".github/test"
Expand Down Expand Up @@ -151,9 +211,14 @@ jobs:
DATABASE_URL: postgres://db_user:db_pass@localhost:5432/hyperswitch_db
run: just migrate run --locked-schema

- name: Insert card info into the database
if: ${{ env.RUN_TESTS == 'true' }}
run: |
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;"
- name: Build project
if: ${{ env.RUN_TESTS == 'true' }}
run: cargo build --package router --bin router --jobs 6
run: cargo build --package router --bin router --jobs 3

- name: Setup Local Server
if: ${{ env.RUN_TESTS == 'true' }}
Expand Down Expand Up @@ -181,29 +246,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
kill "${{ env.PID }}"
Expand All @@ -213,6 +259,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
2 changes: 1 addition & 1 deletion .github/workflows/postman-collection-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ env:
CONNECTORS: stripe
RUST_BACKTRACE: short
RUSTUP_MAX_RETRIES: 10
RUST_MIN_STACK: 8388608
RUST_MIN_STACK: 10485760

jobs:
runner:
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/wasm-bulild-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI wasm-check

on:
push:
branches:
- main
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
wasm-ci:
name: Check wasm build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable 2 weeks ago

- name: Install wasm-pack
uses: taiki-e/install-action@v2
with:
tool: wasm-pack
checksum: true

- name: wasm build
shell: bash
run: make euclid-wasm
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ target/

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
Expand Down Expand Up @@ -263,4 +263,9 @@ result*
node_modules/

# cypress credentials
creds.json
creds.json

/.direnv

# Nix services data
/data
7 changes: 5 additions & 2 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -16,6 +19,7 @@ HypoNoeLbFurNiederosterreichUWien = "HypoNoeLbFurNiederosterreichUWien"
hypo_noe_lb_fur_niederosterreich_u_wien = "hypo_noe_lb_fur_niederosterreich_u_wien"
IOT = "IOT" # British Indian Ocean Territory country code
klick = "klick" # Swedish word for clicks
FPR = "FPR" # Fraud Prevention Rules
LSO = "LSO" # Lesotho country code
NAM = "NAM" # Namibia country code
ND = "ND" # North Dakota state code
Expand All @@ -38,8 +42,7 @@ 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

Payed = "Payed" # Paid status for digital virgo

[default.extend-words]
aci = "aci" # Name of a connector
Expand Down
Loading

0 comments on commit 26fa50d

Please sign in to comment.