Skip to content

Commit

Permalink
Merge branch 'main' into coinbase_currency_conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
DhairyaMajmudar authored Oct 20, 2023
2 parents f66d411 + 31431e4 commit cce8d93
Show file tree
Hide file tree
Showing 137 changed files with 5,416 additions and 1,074 deletions.
10 changes: 6 additions & 4 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
* @juspay/hyperswitch-maintainers @jarnura @ashokkjag
* @juspay/hyperswitch-maintainers

docs/ @juspay/hyperswitch-maintainers
openapi/ @juspay/hyperswitch-maintainers
postman/ @juspay/hyperswitch-maintainers
scripts/ @juspay/hyperswitch-maintainers
*.md @juspay/hyperswitch-maintainers
*.sh @juspay/hyperswitch-maintainers
LICENSE @juspay/hyperswitch-maintainers
NOTICE @juspay/hyperswitch-maintainers
.github/ @juspay/hyperswitch-maintainers
.gitignore @juspay/hyperswitch-maintainers
Makefile @juspay/hyperswitch-maintainers

.github/ @juspay/hyperswitch-devops

config/ @juspay/hyperswitch-framework
crates/ @juspay/hyperswitch-framework
crates/router/src/types/ @juspay/hyperswitch-framework
Expand All @@ -20,6 +19,9 @@ crates/router/src/db/ @juspay/hyperswitch-framework
crates/router/src/routes/ @juspay/hyperswitch-framework
migrations/ @juspay/hyperswitch-framework
openapi/ @juspay/hyperswitch-framework
postman/ @juspay/hyperswitch-framework
Cargo.toml @juspay/hyperswitch-framework
Cargo.lock @juspay/hyperswitch-framework

connector-template/ @juspay/hyperswitch-connector
crates/router/src/connector/ @juspay/hyperswitch-connector
Expand Down
167 changes: 167 additions & 0 deletions .github/workflows/hotfix-pr-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
name: Hotfix-PR-Check

on:
pull_request:
types:
- opened
- edited
- synchronize
branches:
- "hotfix-*"

jobs:
hotfix_pr_check:
name: Verify Hotfix PR
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Get hotfix pull request body
shell: bash
run: |
echo '${{ github.event.pull_request.body }}' > hotfix_pr_body.txt
- name: Get a list of all original PR numbers
shell: bash
run: |
# Extract a list of lines with the format 'juspay/hyperswitch/pull/1200' or '#1200' using 'sed'.
# If empty, then error out and exit.
# else, use 'grep' to extract out 'juspay/hyperswitch/pull/1200' or '#1200' patterns from each line.
# Use 'sed' to remove the part of the matched strings that precedes the last "/" character (in cases like, juspay/hyperswitch/pull/1200 - 1200)
# and sed again to remove any "#" characters from the extracted numeric part (in cases like #1200 - 1200), ultimately getting PR/issue number.
# Finally, remove (if any) duplicates from the list
SED_OUTPUT=$(sed -E '/\/juspay\/hyperswitch\/pull\/[0-9]+|#[0-9]+/!d' hotfix_pr_body.txt)
if [ -z "$SED_OUTPUT" ]; then
echo "::error::No original PRs found"
exit 1
else
PR_NUMBERS=($(echo "$SED_OUTPUT" | grep -oE 'juspay/hyperswitch/pull/[0-9]+|#([0-9]+)' | sed 's/.*\///' | sed 's/#//' | sort -u))
echo "PR_NUMBERS=${PR_NUMBERS[@]}" >> $GITHUB_ENV
echo "Original PR's found: ("${PR_NUMBERS[*]/#/#}")"
fi
- name: Verify Original PRs
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
PR_NUMBERS="${PR_NUMBERS[*]}"
all_checks_failed=1
PR_AUTHORS=()
PR_TITLES=()
PR_BASE_REFS=()
PR_STATES=()
for pr_number in ${PR_NUMBERS}; do
is_pull_request="$(gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" "/repos/juspay/hyperswitch/issues/${pr_number}" | jq '.pull_request')"
if [[ "$is_pull_request" == null ]]; then
continue
else
pr_info=$(gh pr view "${pr_number}" --json number,title,baseRefName,state,author)
pr_author=$(echo "${pr_info}" | jq -r '.author.login')
pr_title=$(echo "${pr_info}" | jq -r '.title')
pr_base_ref=$(echo "${pr_info}" | jq -r '.baseRefName')
pr_state=$(echo "${pr_info}" | jq -r '.state')
if [[ "${pr_author}" == "${{ github.event.pull_request.user.login }}" && \
"${pr_title}" == "${{ github.event.pull_request.title }}" && \
"${pr_base_ref}" == "main" && \
"${pr_state}" == "MERGED" ]]; then
all_checks_failed=0
break
fi
PR_AUTHORS+=("$pr_author")
PR_TITLES+=("$pr_title")
PR_BASE_REFS+=("$pr_base_ref")
PR_STATES+=("$pr_state")
fi
done
if [[ $all_checks_failed -eq 1 ]]; then
# Set a flag to track if a author match is found
author_match_found=0
for ((i = 0; i < ${#PR_AUTHORS[@]}; i++)); do
if [[ "${{github.event.pull_request.user.login}}" == "${PR_AUTHORS[i]}" ]]; then
# If a match is found, set the flag to 1 and break out of the loop
author_match_found=1
break
fi
done
if [[ $author_match_found -eq 0 ]]; then
echo "::error::Hotfix PR author does not match any of the Original PR authors. Hotfix PR author: '${{ github.event.pull_request.user.login }}'"
fi
# Set a flag to track if a title match is found
title_match_found=0
for ((i = 0; i < ${#PR_TITLES[@]}; i++)); do
if [[ "${{github.event.pull_request.title}}" == "${PR_TITLES[i]}" ]]; then
# If a match is found, set the flag to 1 and break out of the loop
title_match_found=1
break
fi
done
if [[ $title_match_found -eq 0 ]]; then
echo "::error::Hotfix PR title does not match any of the Original PR titles. Hotfix PR title: '${{ github.event.pull_request.title }}'"
fi
# Set a flag to track if any of the original PRs point to the 'main'
original_pr_points_to_main=0
for ((i = 0; i < ${#PR_BASE_REFS[@]}; i++)); do
if [[ "${PR_BASE_REFS[i]}" == "main" ]]; then
# If a match is found, set the flag to 1 and break out of the loop
original_pr_points_to_main=1
break
fi
done
if [[ $original_pr_points_to_main -eq 0 ]]; then
echo "::error::None of the Original PR's baseRef is 'main'"
fi
# Set a flag to track if any of the original PR's state is 'MERGED'
original_pr_merged=0
for ((i = 0; i < ${#PR_STATES[@]}; i++)); do
if [[ "${PR_STATES[i]}" == "MERGED" ]]; then
# If a match is found, set the flag to 1 and break out of the loop
original_pr_merged=1
break
fi
done
if [[ $original_pr_merged -eq 0 ]]; then
echo "::error::None of the Original PR is merged"
fi
# Print all Original PR's (number), (pr_title), (pr_author), (pr_base_ref) and (pr_state)
i=0
echo "Original PR info:"
for pr_number in ${PR_NUMBERS}; do
echo "#${pr_number} - pr_title: '${PR_TITLES[i]}' - pr_author: '${PR_AUTHORS[i]}' - pr_base_ref: '${PR_BASE_REFS[i]}' - pr_state: '${PR_STATES[i]}'"
i+=1
done
exit 1
else
echo "::notice::Hotfix PR satisfies all the required conditions"
fi
107 changes: 107 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,113 @@ All notable changes to HyperSwitch will be documented here.

- - -

## 1.63.0 (2023-10-20)

### Features

- Add support for updating surcharge_applicable field intent ([#2647](https://github.com/juspay/hyperswitch/pull/2647)) ([`949937e`](https://github.com/juspay/hyperswitch/commit/949937e3644346f8b2b952944efb884f270645a8))

### Bug Fixes

- Kms decryption of redis_temp_locker_encryption_key ([#2650](https://github.com/juspay/hyperswitch/pull/2650)) ([`5a6601f`](https://github.com/juspay/hyperswitch/commit/5a6601fad4d11cd7d2f1322a6453504494d20c6f))

### Refactors

- **router:** [Nexi nets] Remove Default Case Handling ([#2639](https://github.com/juspay/hyperswitch/pull/2639)) ([`4b64c56`](https://github.com/juspay/hyperswitch/commit/4b64c563558d7c0a02b248c23921ed47ff294980))

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

- - -


## 1.62.0 (2023-10-19)

### Features

- **connector:**
- [Worldpay] Use connector_request_reference_id as reference to the connector ([#2553](https://github.com/juspay/hyperswitch/pull/2553)) ([`9ea5830`](https://github.com/juspay/hyperswitch/commit/9ea5830befe333270f8f424753e1b46a439e79bb))
- [ProphetPay] Template generation ([#2610](https://github.com/juspay/hyperswitch/pull/2610)) ([`7e6207e`](https://github.com/juspay/hyperswitch/commit/7e6207e6ca98fe2af9a61e272735e9d2292d6a92))
- [Bambora] Use connector_response_reference_id as reference to the connector ([#2635](https://github.com/juspay/hyperswitch/pull/2635)) ([`a9b5dc9`](https://github.com/juspay/hyperswitch/commit/a9b5dc9ab767eb54a95bcebc4fd5a7b00dbf65f6))
- [Klarna] Add order id as the reference id to merchant ([#2614](https://github.com/juspay/hyperswitch/pull/2614)) ([`b7d5573`](https://github.com/juspay/hyperswitch/commit/b7d557367a3a5aca478ffd2087af8077bc4e7e2b))

### Bug Fixes

- Payment_method_data and description null during payment confirm ([#2618](https://github.com/juspay/hyperswitch/pull/2618)) ([`6765a1c`](https://github.com/juspay/hyperswitch/commit/6765a1c695493499d1907c56d05bdcd80a2fea93))

### Refactors

- **connector:**
- [Dlocal] Currency Unit Conversion ([#2615](https://github.com/juspay/hyperswitch/pull/2615)) ([`1f2fe51`](https://github.com/juspay/hyperswitch/commit/1f2fe5170ae318a8b1613f6f02538a36f30f0b3d))
- [Iatapay] remove default case handling ([#2587](https://github.com/juspay/hyperswitch/pull/2587)) ([`6494e8a`](https://github.com/juspay/hyperswitch/commit/6494e8a6e4a195ecc9ca5b2f6ac0a636f06b03f7))
- [noon] remove cancellation_reason ([#2627](https://github.com/juspay/hyperswitch/pull/2627)) ([`41b7742`](https://github.com/juspay/hyperswitch/commit/41b7742b5498bfa9ef32b9408ab2d9a7a43b01dc))
- [Forte] Remove Default Case Handling ([#2625](https://github.com/juspay/hyperswitch/pull/2625)) ([`418715b`](https://github.com/juspay/hyperswitch/commit/418715b816337bcaeee1aceeb911e6d329add2ad))
- [Dlocal] remove default case handling ([#2624](https://github.com/juspay/hyperswitch/pull/2624)) ([`1584313`](https://github.com/juspay/hyperswitch/commit/158431391d560be4a79160ccea7bf5feaa4b52db))
- Remove code related to temp locker ([#2640](https://github.com/juspay/hyperswitch/pull/2640)) ([`cc0b422`](https://github.com/juspay/hyperswitch/commit/cc0b42263257b6cf6c7f94350442a74d3c02750b))
- Add surcharge_applicable to payment_intent and remove surcharge_metadata from payment_attempt ([#2642](https://github.com/juspay/hyperswitch/pull/2642)) ([`e5fbaae`](https://github.com/juspay/hyperswitch/commit/e5fbaae0d4278681e5f589aa46c867e7904c4646))

### Testing

- **postman:** Update postman collection files ([`2593dd1`](https://github.com/juspay/hyperswitch/commit/2593dd17c30d7f327b54f3c386a9fd42ae8146ca))

### Miscellaneous Tasks

- **deps:** Bump rustix from 0.37.24 to 0.37.25 ([#2637](https://github.com/juspay/hyperswitch/pull/2637)) ([`67d0062`](https://github.com/juspay/hyperswitch/commit/67d006272158372a4b9ec65cbbe7b2ae8f35eb69))

### Build System / Dependencies

- **deps:** Use `async-bb8-diesel` from `crates.io` instead of git repository ([#2619](https://github.com/juspay/hyperswitch/pull/2619)) ([`14c0821`](https://github.com/juspay/hyperswitch/commit/14c0821b8085279072db3484a3b1bcdde0f7893b))

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

- - -


## 1.61.0 (2023-10-18)

### Features

- **Connector:** [Paypal] add support for dispute webhooks for paypal connector ([#2353](https://github.com/juspay/hyperswitch/pull/2353)) ([`6cf8f05`](https://github.com/juspay/hyperswitch/commit/6cf8f0582cfa4f6a58c67a868cb67846970b3835))
- **apple_pay:** Add support for decrypted apple pay token for checkout ([#2628](https://github.com/juspay/hyperswitch/pull/2628)) ([`794dbc6`](https://github.com/juspay/hyperswitch/commit/794dbc6a766d12ff3cdf0b782abb4c48b8fa77d0))
- **connector:**
- [Aci] Update connector_response_reference_id with merchant reference ([#2551](https://github.com/juspay/hyperswitch/pull/2551)) ([`9e450b8`](https://github.com/juspay/hyperswitch/commit/9e450b81ca8bc4b1ddbbe2c1d732dbc58c61934e))
- [Bambora] use connector_request_reference_id ([#2518](https://github.com/juspay/hyperswitch/pull/2518)) ([`73e9391`](https://github.com/juspay/hyperswitch/commit/73e93910cd3bd668d721b15edb86240adc18f46b))
- [Tsys] Use connector_request_reference_id as reference to the connector ([#2631](https://github.com/juspay/hyperswitch/pull/2631)) ([`b145463`](https://github.com/juspay/hyperswitch/commit/b1454634259144d896716e5cef37d9b8491f55b9))
- **core:** Replace temp locker with redis ([#2594](https://github.com/juspay/hyperswitch/pull/2594)) ([`2edbd61`](https://github.com/juspay/hyperswitch/commit/2edbd6123512a6f2f4d51d5c2d1ed8b6ee502813))
- **events:** Add events for incoming API requests ([#2621](https://github.com/juspay/hyperswitch/pull/2621)) ([`7a76d6c`](https://github.com/juspay/hyperswitch/commit/7a76d6c01a0c6087c6429e58cc9dd6b4ea7fc0aa))
- **merchant_account:** Add merchant account list endpoint ([#2560](https://github.com/juspay/hyperswitch/pull/2560)) ([`a1472c6`](https://github.com/juspay/hyperswitch/commit/a1472c6b78afa819cbe026a7db1e0c2b9016715e))
- Update surcharge_amount and tax_amount in update_trackers of payment_confirm ([#2603](https://github.com/juspay/hyperswitch/pull/2603)) ([`2f9a355`](https://github.com/juspay/hyperswitch/commit/2f9a3557f63150bcd27e27c6510a799669706718))

### Bug Fixes

- **connector:**
- [Authorizedotnet]fix error deserialization incase of authentication failure ([#2600](https://github.com/juspay/hyperswitch/pull/2600)) ([`4859b7d`](https://github.com/juspay/hyperswitch/commit/4859b7da73125c2da72f4754863ff4485bebce29))
- [Paypal]fix error deserelization for source verification call ([#2611](https://github.com/juspay/hyperswitch/pull/2611)) ([`da77d13`](https://github.com/juspay/hyperswitch/commit/da77d1393b8f6ab658dd7f3c202dd6c7d15c0ebd))
- **payments:** Fix payment update enum being inserted into kv ([#2612](https://github.com/juspay/hyperswitch/pull/2612)) ([`9aa1c75`](https://github.com/juspay/hyperswitch/commit/9aa1c75eca24caa14af5f4801173cd59f76d7e57))

### Refactors

- **events:** Allow box dyn for event handler ([#2629](https://github.com/juspay/hyperswitch/pull/2629)) ([`01410bb`](https://github.com/juspay/hyperswitch/commit/01410bb9f233637e98f27ebe509e859c7dad2cf4))
- **payment_connector:** Allow connector label to be updated ([#2622](https://github.com/juspay/hyperswitch/pull/2622)) ([`c86ac9b`](https://github.com/juspay/hyperswitch/commit/c86ac9b1fe5388666463aa16c899427a2bf442fb))
- **router:** Remove unnecessary function from Refunds Validate Flow ([#2609](https://github.com/juspay/hyperswitch/pull/2609)) ([`3399328`](https://github.com/juspay/hyperswitch/commit/3399328ae7f525fb72e0751182cf32d0b2470594))
- Refactor connector auth type failure to 4xx ([#2616](https://github.com/juspay/hyperswitch/pull/2616)) ([`1dad745`](https://github.com/juspay/hyperswitch/commit/1dad7455c4ae8d26d52c44d90f5b8d815d85d205))

### Testing

- **postman:** Update postman collection files ([`d899025`](https://github.com/juspay/hyperswitch/commit/d89902507486b8b97011fb63ed0343f727255ca2))

### Documentation

- **postman:** Rewrite postman documentation to help devs develop tests for their features ([#2613](https://github.com/juspay/hyperswitch/pull/2613)) ([`1548ee6`](https://github.com/juspay/hyperswitch/commit/1548ee62b661200fcb9d439d16c072a66dbfa718))

### Miscellaneous Tasks

- **scripts:** Add connector script changes ([#2620](https://github.com/juspay/hyperswitch/pull/2620)) ([`373a10b`](https://github.com/juspay/hyperswitch/commit/373a10beffc7cddef6ff76f5c8fff91ca3618581))

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

- - -


## 1.60.0 (2023-10-17)

### Features
Expand Down
9 changes: 5 additions & 4 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions config/config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ host = "" # Locker host
mock_locker = true # Emulate a locker locally using Postgres
basilisk_host = "" # Basilisk host
locker_signing_key_id = "1" # Key_id to sign basilisk hs locker
redis_temp_locker_encryption_key = "000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f" # encryption key for redis temp locker

[delayed_session_response]
connectors_with_delayed_session_response = "trustpay,payme" # List of connectors which has delayed session response
Expand Down Expand Up @@ -199,6 +200,7 @@ payme.base_url = "https://sandbox.payme.io/"
paypal.base_url = "https://api-m.sandbox.paypal.com/"
payu.base_url = "https://secure.snd.payu.com/"
powertranz.base_url = "https://staging.ptranz.com/api/"
prophetpay.base_url = "https://ccm-thirdparty.cps.golf/"
rapyd.base_url = "https://sandboxapi.rapyd.net"
shift4.base_url = "https://api.shift4.com/"
square.base_url = "https://connect.squareupsandbox.com/"
Expand Down
3 changes: 3 additions & 0 deletions config/development.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ applepay_endpoint = "DOMAIN SPECIFIC ENDPOINT"
host = ""
mock_locker = true
basilisk_host = ""
redis_temp_locker_encryption_key = "000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f"

[jwekey]
locker_key_identifier1 = ""
Expand Down Expand Up @@ -101,6 +102,7 @@ cards = [
"paypal",
"payu",
"powertranz",
"prophetpay",
"shift4",
"square",
"stax",
Expand Down Expand Up @@ -171,6 +173,7 @@ payme.base_url = "https://sandbox.payme.io/"
paypal.base_url = "https://api-m.sandbox.paypal.com/"
payu.base_url = "https://secure.snd.payu.com/"
powertranz.base_url = "https://staging.ptranz.com/api/"
prophetpay.base_url = "https://ccm-thirdparty.cps.golf/"
rapyd.base_url = "https://sandboxapi.rapyd.net"
shift4.base_url = "https://api.shift4.com/"
square.base_url = "https://connect.squareupsandbox.com/"
Expand Down
Loading

0 comments on commit cce8d93

Please sign in to comment.