Skip to content

Commit

Permalink
Merge branch 'main' into feat-worldline-use-connector-request-referen…
Browse files Browse the repository at this point in the history
…ce-id
  • Loading branch information
PanGan21 authored Oct 10, 2023
2 parents 2af4687 + 7acf101 commit 8c588eb
Show file tree
Hide file tree
Showing 81 changed files with 2,064 additions and 693 deletions.
100 changes: 100 additions & 0 deletions .github/workflows/create-hotfix-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: Create tag on hotfix branch

on:
workflow_dispatch:

jobs:
create_tag:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.AUTO_RELEASE_PAT }}

- name: Install git-cliff
uses: baptiste0928/[email protected]
with:
crate: git-cliff
version: 1.2.0

- name: Check if the input is valid hotfix branch
shell: bash
run: |
if [[ ${{github.ref}} =~ ^refs/heads/hotfix-[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "::notice::${{github.ref}} is a valid branch."
else
echo "::error::${{github.ref}} is not a valid branch."
exit 1
fi
- name: Check if the latest commit is tag
shell: bash
run: |
if [[ -z "$(git tag --points-at HEAD)" ]]; then
echo "::notice::The latest commit is not a tag "
else
echo "::error::The latest commit on the branch is already a tag"
exit 1
fi
- name: Determine current and next tag
shell: bash
run: |
function get_next_tag() {
local previous_tag="${1}"
local previous_hotfix_number
local next_tag
previous_hotfix_number="$(echo "${previous_tag}" | awk -F. '{ print $4 }')"
if [[ -z "${previous_hotfix_number}" ]]; then
# Previous tag was not a hotfix tag
next_tag="${previous_tag}+hotfix.1"
else
# Previous tag was a hotfix tag, increment hotfix number
local hotfix_number=$((previous_hotfix_number + 1))
next_tag="${previous_tag/%${previous_hotfix_number}/${hotfix_number}}"
fi
echo "${next_tag}"
}
PREVIOUS_TAG="$(git tag --merged | sort --version-sort | tail --lines 1)"
NEXT_TAG="$(get_next_tag "${PREVIOUS_TAG}")"
echo "PREVIOUS_TAG=${PREVIOUS_TAG}" >> $GITHUB_ENV
echo "NEXT_TAG=${NEXT_TAG}" >> $GITHUB_ENV
- name: Generate changelog
shell: bash
run: |
# Generate changelog content and store it in `release-notes.md`
git-cliff --config '.github/git-cliff-changelog.toml' --strip header --tag "${NEXT_TAG}" "${PREVIOUS_TAG}^.." \
| sed "/## ${PREVIOUS_TAG#v}\$/,\$d" \
| sed '$s/$/\n- - -/' > release-notes.md
# Append release notes after the specified pattern in CHANGELOG.md
sed --in-place '0,/^- - -/!b; /^- - -/{
a
r release-notes.md
}' CHANGELOG.md
rm release-notes.md
- name: Set Git Configuration
shell: bash
run: |
git config --local user.name 'github-actions'
git config --local user.email '41898282+github-actions[bot]@users.noreply.github.com'
- name: Push created commit and tag
shell: bash
run: |
# Stage, commit and tag the changelog
git add CHANGELOG.md
git commit --message "chore(version): ${NEXT_TAG}"
git tag --message "$(git show --no-patch --format=%s HEAD)" "${NEXT_TAG}" HEAD
git push
git push --tags
38 changes: 38 additions & 0 deletions .github/workflows/hotfix-branch-creation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Create hotfix branch

on:
workflow_dispatch:

jobs:
create_branch:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.AUTO_RELEASE_PAT }}

- name: Check if the input is valid tag
shell: bash
run: |
if [[ ${{github.ref}} =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "::notice::${{github.ref}} is a valid tag."
else
echo "::error::${{github.ref}} is not a valid tag."
exit 1
fi
- name: Create hotfix branch
shell: bash
run: |
HOTFIX_BRANCH="hotfix-${GITHUB_REF#refs/tags/v}"
if git switch --create "$HOTFIX_BRANCH"; then
git push origin "$HOTFIX_BRANCH"
echo "::notice::Created hotfix branch: $HOTFIX_BRANCH"
else
echo "::error::Failed to create hotfix branch"
exit 1
fi
2 changes: 1 addition & 1 deletion .github/workflows/release-new-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Release a new version

on:
schedule:
- cron: "30 14 * * 1-5" # Run workflow at 8 PM IST every Monday-Friday
- cron: "30 14 * * 0-4" # Run workflow at 8 PM IST every Sunday-Thursday

workflow_dispatch:

Expand Down
27 changes: 24 additions & 3 deletions .github/workflows/validate-openapi-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,21 @@ jobs:
name: Validate generated OpenAPI spec file
runs-on: ubuntu-latest
steps:
- name: Checkout PR
if: ${{ github.event_name == 'pull_request' }}
- name: Checkout PR from fork
if: ${{ (github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name) }}
uses: actions/checkout@v3
with:
# Checkout pull request branch instead of merge commit
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}

- name: Checkout PR with token
if: ${{ (github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name) }}
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
token: ${{ secrets.AUTO_FILE_UPDATE_PAT }}

- name: Checkout merge group HEAD commit
if: ${{ github.event_name == 'merge_group' }}
uses: actions/checkout@v3
Expand All @@ -47,7 +54,21 @@ jobs:
shell: bash
run: swagger-cli validate ./openapi/openapi_spec.json

- name: Commit the JSON file if it is not up-to-date
# PR originated from same repository
if: ${{ (github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name) }}
shell: bash
run: |
if ! git diff --quiet --exit-code -- openapi/openapi_spec.json ; then
git config --local user.name 'github-actions[bot]'
git config --local user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add openapi/openapi_spec.json
git commit --message 'docs(openapi): re-generate OpenAPI specification'
git push
fi
- name: Fail check if the JSON file is not up-to-date
if: ${{ (github.event_name == 'merge_group') || ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name)) }}
shell: bash
run: |
if ! git diff --quiet --exit-code -- openapi/openapi_spec.json ; then
Expand Down
90 changes: 90 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,96 @@ All notable changes to HyperSwitch will be documented here.

- - -

## 1.55.0 (2023-10-10)

### Features

- **connector:**
- [Multisafepay] Use connector_request_reference_id as reference to the connector ([#2503](https://github.com/juspay/hyperswitch/pull/2503)) ([`c34f1bf`](https://github.com/juspay/hyperswitch/commit/c34f1bf36ffb3a3533dd51ac87e7f66ab0dcce79))
- [GlobalPayments] Introduce connector_request_reference_id for GlobalPayments ([#2519](https://github.com/juspay/hyperswitch/pull/2519)) ([`116139b`](https://github.com/juspay/hyperswitch/commit/116139ba7ae6878b7018068b0cb8303a8e8d1f7a))
- [Airwallex] Use connector_request_reference_id as merchant reference id #2291 ([#2516](https://github.com/juspay/hyperswitch/pull/2516)) ([`6e89e41`](https://github.com/juspay/hyperswitch/commit/6e89e4103da4ecf6d7f06f7a9ec7da64eb493a6e))
- **trace:** Add optional sampling behaviour for routes ([#2511](https://github.com/juspay/hyperswitch/pull/2511)) ([`ec51e48`](https://github.com/juspay/hyperswitch/commit/ec51e48402da63e1250328485095b8665d7eca65))
- Gracefully shutdown drainer if redis goes down ([#2391](https://github.com/juspay/hyperswitch/pull/2391)) ([`2870af1`](https://github.com/juspay/hyperswitch/commit/2870af1286e897be0d40c014bc5742eafc6795db))
- Kv for reverse lookup ([#2445](https://github.com/juspay/hyperswitch/pull/2445)) ([`13aaf96`](https://github.com/juspay/hyperswitch/commit/13aaf96db0f62dc7a706ba2ba230912ee7ef7a68))
- Add x-hs-latency header for application overhead measurement ([#2486](https://github.com/juspay/hyperswitch/pull/2486)) ([`cf0db35`](https://github.com/juspay/hyperswitch/commit/cf0db35923d39caca9bf267b7d87a3f215884b66))

### Bug Fixes

- **connector:**
- [Airwallex] convert expiry year to four digit ([#2527](https://github.com/juspay/hyperswitch/pull/2527)) ([`4b0fa12`](https://github.com/juspay/hyperswitch/commit/4b0fa1295ca8f4e611b65fbf2458c38b89303d3b))
- [noon] add missing response status ([#2528](https://github.com/juspay/hyperswitch/pull/2528)) ([`808ee45`](https://github.com/juspay/hyperswitch/commit/808ee45556f90b1c1360a3edbffe9ba3603439d4))

### Refactors

- **payment_methods:** Added mca_id in bank details ([#2495](https://github.com/juspay/hyperswitch/pull/2495)) ([`ac3c500`](https://github.com/juspay/hyperswitch/commit/ac3c5008f80172a575f2fb08b7a5e78016ce7595))
- **test_utils:** Refactor `test_utils` crate and add `folder` support with updated documentation ([#2487](https://github.com/juspay/hyperswitch/pull/2487)) ([`6b52ac3`](https://github.com/juspay/hyperswitch/commit/6b52ac3d398d5a180c1dc67c5b53702ad01a0773))

### Miscellaneous Tasks

- [GOCARDLESS] env changes for becs and sepa mandates ([#2535](https://github.com/juspay/hyperswitch/pull/2535)) ([`4f5a383`](https://github.com/juspay/hyperswitch/commit/4f5a383bab567a1b46b2d6990c0c23ed60f1201b))

**Full Changelog:** [`v1.54.0...v1.55.0`](https://github.com/juspay/hyperswitch/compare/v1.54.0...v1.55.0)

- - -


## 1.54.0 (2023-10-09)

### Features

- **connector:**
- [Fiserv] update connector_response_reference_id in transformers ([#2489](https://github.com/juspay/hyperswitch/pull/2489)) ([`4eb7003`](https://github.com/juspay/hyperswitch/commit/4eb70034336e5ff42c9eea912d940ea04cae9326))
- [Nuvei] Use "connector_request_reference_id" for as "attempt_id" to improve consistency in transmitting payment information ([#2493](https://github.com/juspay/hyperswitch/pull/2493)) ([`17393f5`](https://github.com/juspay/hyperswitch/commit/17393f5be3e9027fedf9466c6401754f3c4d6b99))
- **kv:** Add kv wrapper for executing kv tasks ([#2384](https://github.com/juspay/hyperswitch/pull/2384)) ([`8b50997`](https://github.com/juspay/hyperswitch/commit/8b50997e56307507be101c562aa70d0a9b429137))
- **process_tracker:** Make long standing payments failed ([#2380](https://github.com/juspay/hyperswitch/pull/2380)) ([`73dfc31`](https://github.com/juspay/hyperswitch/commit/73dfc31f9d16d2cf71de8433fb630bea941a7020))

### Bug Fixes

- Add release feature to drianer ([#2507](https://github.com/juspay/hyperswitch/pull/2507)) ([`224b83c`](https://github.com/juspay/hyperswitch/commit/224b83c51d53fb1ca9ae11ff2f60b7b6cc807fc8))

### Refactors

- Disable color in reports in json format ([#2509](https://github.com/juspay/hyperswitch/pull/2509)) ([`aa176c7`](https://github.com/juspay/hyperswitch/commit/aa176c7c5d79f68c8bd97a3248fd4d40e937a3ce))

### Miscellaneous Tasks

- Address Rust 1.73 clippy lints ([#2474](https://github.com/juspay/hyperswitch/pull/2474)) ([`e02838e`](https://github.com/juspay/hyperswitch/commit/e02838eb5d3da97ef573926ded4a318ed24b6f1c))

**Full Changelog:** [`v1.53.0...v1.54.0`](https://github.com/juspay/hyperswitch/compare/v1.53.0...v1.54.0)

- - -


## 1.53.0 (2023-10-09)

### Features

- **connector:**
- [Braintree] implement dispute webhook ([#2031](https://github.com/juspay/hyperswitch/pull/2031)) ([`eeccd10`](https://github.com/juspay/hyperswitch/commit/eeccd106ae569bd60011ed71495d7978998161f8))
- [Paypal] Implement 3DS for Cards ([#2443](https://github.com/juspay/hyperswitch/pull/2443)) ([`d95a64d`](https://github.com/juspay/hyperswitch/commit/d95a64d6c9b870bdc38aa091cf9bf660b1ea404e))
- [Cybersource] Use connector_response_reference_id as reference to merchant ([#2470](https://github.com/juspay/hyperswitch/pull/2470)) ([`a2dfc48`](https://github.com/juspay/hyperswitch/commit/a2dfc48318363db051f311ee7f911de0db0eb868))
- [Coinbase] Add order id as the reference id ([#2469](https://github.com/juspay/hyperswitch/pull/2469)) ([`9c2fff5`](https://github.com/juspay/hyperswitch/commit/9c2fff5ab44cdd4f285b6d1437f37869b517963e))
- [Multisafepay] Use transaction_id as reference to transaction ([#2451](https://github.com/juspay/hyperswitch/pull/2451)) ([`ba2efac`](https://github.com/juspay/hyperswitch/commit/ba2efac4fa2af22f81b0841350a334bc36e91022))

### Bug Fixes

- Add startup config log to drainer ([#2482](https://github.com/juspay/hyperswitch/pull/2482)) ([`5038234`](https://github.com/juspay/hyperswitch/commit/503823408b782968fb59f6ff5d7df417b9aa7dbe))
- Fetch data directly from DB in OLAP functions ([#2475](https://github.com/juspay/hyperswitch/pull/2475)) ([`12b5341`](https://github.com/juspay/hyperswitch/commit/12b534197276ccc4aa9575e6b518bcc50b597bee))

### Refactors

- **connector:** [trustpay] refactor trustpay and handled variants errors ([#2484](https://github.com/juspay/hyperswitch/pull/2484)) ([`3f1e7c2`](https://github.com/juspay/hyperswitch/commit/3f1e7c2152a839a6fe69f60b906277ca831e7611))
- **merchant_account:** Make `organization_id` as mandatory ([#2458](https://github.com/juspay/hyperswitch/pull/2458)) ([`53b4816`](https://github.com/juspay/hyperswitch/commit/53b4816d27fe7794cb482887ed17ddb4386bd2f7))

### Miscellaneous Tasks

- Env changes for gocardless mandate ([#2485](https://github.com/juspay/hyperswitch/pull/2485)) ([`65ca5f1`](https://github.com/juspay/hyperswitch/commit/65ca5f12da54715e5db785d122e2ec9714147c68))

**Full Changelog:** [`v1.52.0...v1.53.0`](https://github.com/juspay/hyperswitch/compare/v1.52.0...v1.53.0)

- - -


## 1.52.0 (2023-10-06)

### Features
Expand Down
2 changes: 2 additions & 0 deletions Cargo.lock

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

15 changes: 11 additions & 4 deletions config/config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ port = 5432 # DB Port
dbname = "hyperswitch_db" # Name of Database
pool_size = 5 # Number of connections to keep open
connection_timeout = 10 # Timeout for database connection in seconds
queue_strategy = "Fifo" # Add the queue strategy used by the database bb8 client

# Replica SQL data store credentials
[replica_database]
Expand All @@ -38,6 +39,7 @@ port = 5432 # DB Port
dbname = "hyperswitch_db" # Name of Database
pool_size = 5 # Number of connections to keep open
connection_timeout = 10 # Timeout for database connection in seconds
queue_strategy = "Fifo" # Add the queue strategy used by the database bb8 client

# Redis credentials
[redis]
Expand Down Expand Up @@ -93,6 +95,7 @@ sampling_rate = 0.1 # decimal rate between 0.0
otel_exporter_otlp_endpoint = "http://localhost:4317" # endpoint to send metrics and traces to, can include port number
otel_exporter_otlp_timeout = 5000 # timeout (in milliseconds) for sending metrics and traces
use_xray_generator = false # Set this to true for AWS X-ray compatible traces
route_to_trace = [ "*/confirm" ]

# This section provides some secret values.
[secrets]
Expand Down Expand Up @@ -318,9 +321,11 @@ square = {long_lived_token = false, payment_method = "card"}
braintree = { long_lived_token = false, payment_method = "card" }
gocardless = {long_lived_token = true, payment_method = "bank_debit"}

[temp_locker_disable_config]
trustpay = {payment_method = "card,bank_redirect,wallet"}
stripe = {payment_method = "card,bank_redirect,pay_later,wallet,bank_debit"}
[temp_locker_enable_config]
stripe = {payment_method = "bank_transfer"}
nuvei = {payment_method = "card"}
shift4 = {payment_method = "card"}
bluesnap = {payment_method = "card"}

[dummy_connector]
enabled = true # Whether dummy connector is enabled or not
Expand All @@ -347,6 +352,8 @@ card.credit = {connector_list = "stripe,adyen"} # Mandate supported payment
wallet.paypal = {connector_list = "adyen"} # Mandate supported payment method type and connector for wallets
pay_later.klarna = {connector_list = "adyen"} # Mandate supported payment method type and connector for pay_later
bank_debit.ach = { connector_list = "gocardless"} # Mandate supported payment method type and connector for bank_debit
bank_debit.becs = { connector_list = "gocardless"} # Mandate supported payment method type and connector for bank_debit
bank_debit.sepa = { connector_list = "gocardless"} # Mandate supported payment method type and connector for bank_debit

# Required fields info used while listing the payment_method_data
[required_fields.pay_later] # payment_method = "pay_later"
Expand Down Expand Up @@ -422,4 +429,4 @@ supported_connectors = "braintree"
apple_pay_ppc = "APPLE_PAY_PAYMENT_PROCESSING_CERTIFICATE" #Payment Processing Certificate provided by Apple Pay (https://developer.apple.com/) Certificates, Identifiers & Profiles > Apple Pay Payment Processing Certificate
apple_pay_ppc_key = "APPLE_PAY_PAYMENT_PROCESSING_CERTIFICATE_KEY" #Private key generate by Elliptic-curve prime256v1 curve
apple_pay_merchant_cert = "APPLE_PAY_MERCHNAT_CERTIFICATE" #Merchant Certificate provided by Apple Pay (https://developer.apple.com/) Certificates, Identifiers & Profiles > Apple Pay Merchant Identity Certificate
apple_pay_merchant_cert_key = "APPLE_PAY_MERCHNAT_CERTIFICATE_KEY" #Private key generate by RSA:2048 algorithm
apple_pay_merchant_cert_key = "APPLE_PAY_MERCHNAT_CERTIFICATE_KEY" #Private key generate by RSA:2048 algorithm
12 changes: 8 additions & 4 deletions config/development.toml
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,11 @@ braintree = { long_lived_token = false, payment_method = "card" }
payme = {long_lived_token = false, payment_method = "card"}
gocardless = {long_lived_token = true, payment_method = "bank_debit"}

[temp_locker_disable_config]
trustpay = {payment_method = "card,bank_redirect,wallet"}
stripe = {payment_method = "card,bank_redirect,pay_later,wallet,bank_debit"}
[temp_locker_enable_config]
stripe = {payment_method = "bank_transfer"}
nuvei = {payment_method = "card"}
shift4 = {payment_method = "card"}
bluesnap = {payment_method = "card"}

[connector_customer]
connector_list = "gocardless,stax,stripe"
Expand Down Expand Up @@ -419,6 +421,8 @@ wallet.paypal = { connector_list = "adyen" }
card.credit = { connector_list = "stripe,adyen,authorizedotnet,globalpay,worldpay,multisafepay,nmi,nexinets,noon" }
card.debit = { connector_list = "stripe,adyen,authorizedotnet,globalpay,worldpay,multisafepay,nmi,nexinets,noon" }
bank_debit.ach = { connector_list = "gocardless"}
bank_debit.becs = { connector_list = "gocardless"}
bank_debit.sepa = { connector_list = "gocardless"}

[connector_request_reference_id_config]
merchant_ids_send_payment_id_as_connector_request_id = []
Expand All @@ -437,4 +441,4 @@ apple_pay_merchant_cert_key = "APPLE_PAY_MERCHNAT_CERTIFICATE_KEY"

[lock_settings]
redis_lock_expiry_seconds = 180 # 3 * 60 seconds
delay_between_retries_in_milliseconds = 500
delay_between_retries_in_milliseconds = 500
Loading

0 comments on commit 8c588eb

Please sign in to comment.