Skip to content

Commit

Permalink
Merge branch 'main' of github.com:juspay/hyperswitch into env_split
Browse files Browse the repository at this point in the history
* 'main' of github.com:juspay/hyperswitch:
  ci: use git commands for pushing commits and tags in nightly release workflows (#3314)
  refactor(connector): [bluesnap] add connector_txn_id fallback for webhook (#3315)
  feat(core): add new payments webhook events (#3212)
  chore: nits and small code improvements found during investigation of PR#3168 (#3259)
  refactor: removed basilisk feature (#3281)
  fix(euclid_wasm): Update braintree config prod (#3288)
  feat(payment_link): add status page for payment link (#3213)
  chore(version): 2024.01.10.0
  chore(postman): update Postman collection files
  • Loading branch information
pixincreate committed Jan 10, 2024
2 parents 83371a2 + 171d94f commit eeb0c28
Show file tree
Hide file tree
Showing 38 changed files with 46,071 additions and 47,471 deletions.
87 changes: 19 additions & 68 deletions .github/workflows/release-nightly-version-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@ name: Create a nightly tag
on:
workflow_call:
secrets:
app_id:
description: App ID for the GitHub app
required: true
app_private_key:
description: Private key for the GitHub app
token:
description: GitHub token for authenticating with GitHub
required: true
outputs:
tag:
Expand All @@ -31,23 +28,17 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Generate GitHub app token
id: generate_app_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.app_id }}
private-key: ${{ secrets.app_private_key }}

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

- name: Check if the workflow is run on an allowed branch
shell: bash
run: |
if [[ "${{github.ref}}" != "refs/heads/${ALLOWED_BRANCH_NAME}" ]]; then
echo "::error::This workflow is expected to be run from the '${ALLOWED_BRANCH_NAME}' branch. Current branch: '${{github.ref}}'"
if [[ "${{ github.ref }}" != "refs/heads/${ALLOWED_BRANCH_NAME}" ]]; then
echo "::error::This workflow is expected to be run from the '${ALLOWED_BRANCH_NAME}' branch. Current branch: '${{ github.ref }}'"
exit 1
fi
Expand Down Expand Up @@ -139,62 +130,22 @@ jobs:
}' CHANGELOG.md
rm release-notes.md
# We make use of GitHub API calls to commit and tag the changelog instead of the simpler
# `git commit`, `git tag` and `git push` commands to have signed commits and tags
- name: Commit generated changelog and create tag
- 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: Commit, tag and push generated changelog
shell: bash
env:
GH_TOKEN: ${{ steps.generate_app_token.outputs.token }}
run: |
HEAD_COMMIT="$(git rev-parse 'HEAD^{commit}')"
# Create a tree based on the HEAD commit of the current branch and updated changelog file
TREE_SHA="$(
gh api \
--method POST \
--header 'Accept: application/vnd.github+json' \
--header 'X-GitHub-Api-Version: 2022-11-28' \
'/repos/{owner}/{repo}/git/trees' \
--raw-field base_tree="${HEAD_COMMIT}" \
--raw-field 'tree[][path]=CHANGELOG.md' \
--raw-field 'tree[][mode]=100644' \
--raw-field 'tree[][type]=blob' \
--field 'tree[][content][email protected]' \
--jq '.sha'
)"
# Create a commit to point to the above created tree
NEW_COMMIT_SHA="$(
gh api \
--method POST \
--header 'Accept: application/vnd.github+json' \
--header 'X-GitHub-Api-Version: 2022-11-28' \
'/repos/{owner}/{repo}/git/commits' \
--raw-field "message=chore(version): ${NEXT_TAG}" \
--raw-field "parents[]=${HEAD_COMMIT}" \
--raw-field "tree=${TREE_SHA}" \
--jq '.sha'
)"
# Update the current branch to point to the above created commit
# We disable forced update so that the workflow will fail if the branch has been updated since the workflow started
# (for example, new commits were pushed to the branch after the workflow execution started).
gh api \
--method PATCH \
--header 'Accept: application/vnd.github+json' \
--header 'X-GitHub-Api-Version: 2022-11-28' \
"/repos/{owner}/{repo}/git/refs/heads/${ALLOWED_BRANCH_NAME}" \
--raw-field "sha=${NEW_COMMIT_SHA}" \
--field 'force=false'
# Create a lightweight tag to point to the above created commit
gh api \
--method POST \
--header 'Accept: application/vnd.github+json' \
--header 'X-GitHub-Api-Version: 2022-11-28' \
'/repos/{owner}/{repo}/git/refs' \
--raw-field "ref=refs/tags/${NEXT_TAG}" \
--raw-field "sha=${NEW_COMMIT_SHA}"
git add CHANGELOG.md
git commit --message "chore(version): ${NEXT_TAG}"
git tag "${NEXT_TAG}" HEAD
git push origin "${ALLOWED_BRANCH_NAME}"
git push origin "${NEXT_TAG}"
- name: Set job outputs
shell: bash
Expand Down
84 changes: 16 additions & 68 deletions .github/workflows/release-nightly-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,17 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Generate GitHub app token
id: generate_app_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
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.AUTO_RELEASE_PAT }}

- name: Check if the workflow is run on an allowed branch
shell: bash
run: |
if [[ "${{github.ref}}" != "refs/heads/${ALLOWED_BRANCH_NAME}" ]]; then
echo "::error::This workflow is expected to be run from the '${ALLOWED_BRANCH_NAME}' branch. Current branch: '${{github.ref}}'"
if [[ "${{ github.ref }}" != "refs/heads/${ALLOWED_BRANCH_NAME}" ]]; then
echo "::error::This workflow is expected to be run from the '${ALLOWED_BRANCH_NAME}' branch. Current branch: '${{ github.ref }}'"
exit 1
fi
Expand Down Expand Up @@ -80,72 +74,26 @@ jobs:
echo "Postman collection files have no modifications"
fi
- name: Commit updated Postman collections if modified
- name: Set git configuration
shell: bash
env:
GH_TOKEN: ${{ steps.generate_app_token.outputs.token }}
if: ${{ env.POSTMAN_COLLECTION_FILES_UPDATED == 'true' }}
run: |
# Obtain current HEAD commit SHA and use that as base tree SHA for creating a new tree
HEAD_COMMIT="$(git rev-parse 'HEAD^{commit}')"
UPDATED_TREE_SHA="${HEAD_COMMIT}"
# Obtain the flags to be passed to the GitHub CLI.
# Each line contains the flags to be used corresponding to the file.
lines="$(
git ls-files \
--format '--raw-field tree[][path]=%(path) --raw-field tree[][mode]=%(objectmode) --raw-field tree[][type]=%(objecttype) --field tree[][content]=@%(path)' \
postman/collection-json
)"
# Create a tree based on the HEAD commit of the current branch, using the contents of the updated Postman collections directory
while IFS= read -r line; do
# Split each line by space to obtain the flags passed to the GitHub CLI as an array
IFS=' ' read -ra flags <<< "${line}"
# Create a tree by updating each collection JSON file.
# The SHA of the created tree is used as the base tree SHA for updating the next collection file.
UPDATED_TREE_SHA="$(
gh api \
--method POST \
--header 'Accept: application/vnd.github+json' \
--header 'X-GitHub-Api-Version: 2022-11-28' \
'/repos/{owner}/{repo}/git/trees' \
--raw-field base_tree="${UPDATED_TREE_SHA}" \
"${flags[@]}" \
--jq '.sha'
)"
done <<< "${lines}"
# Create a commit to point to the tree with all updated collections
NEW_COMMIT_SHA="$(
gh api \
--method POST \
--header 'Accept: application/vnd.github+json' \
--header 'X-GitHub-Api-Version: 2022-11-28' \
'/repos/{owner}/{repo}/git/commits' \
--raw-field "message=chore(postman): update Postman collection files" \
--raw-field "parents[]=${HEAD_COMMIT}" \
--raw-field "tree=${UPDATED_TREE_SHA}" \
--jq '.sha'
)"
# Update the current branch to point to the above created commit.
# We disable forced update so that the workflow will fail if the branch has been updated since the workflow started
# (for example, new commits were pushed to the branch after the workflow execution started).
gh api \
--method PATCH \
--header 'Accept: application/vnd.github+json' \
--header 'X-GitHub-Api-Version: 2022-11-28' \
"/repos/{owner}/{repo}/git/refs/heads/${ALLOWED_BRANCH_NAME}" \
--raw-field "sha=${NEW_COMMIT_SHA}" \
--field 'force=false'
git config --local user.name 'github-actions'
git config --local user.email '41898282+github-actions[bot]@users.noreply.github.com'
- name: Commit and push updated Postman collections if modified
shell: bash
if: ${{ env.POSTMAN_COLLECTION_FILES_UPDATED == 'true' }}
run: |
git add postman
git commit --message 'chore(postman): update Postman collection files'
git push origin "${ALLOWED_BRANCH_NAME}"
create-nightly-tag:
name: Create a nightly tag
uses: ./.github/workflows/release-nightly-version-reusable.yml
needs:
- update-postman-collections
secrets:
app_id: ${{ secrets.HYPERSWITCH_BOT_APP_ID }}
app_private_key: ${{ secrets.HYPERSWITCH_BOT_APP_PRIVATE_KEY }}
token: ${{ secrets.AUTO_RELEASE_PAT }}
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,34 @@ All notable changes to HyperSwitch will be documented here.

- - -

## 2024.01.10.0

### Features

- **Connector:** [VOLT] Add support for Payments Webhooks ([#3155](https://github.com/juspay/hyperswitch/pull/3155)) ([`eba7896`](https://github.com/juspay/hyperswitch/commit/eba789640b72cdfbc17d0994d16ce111a1788fe5))
- **pm_list:** Add required fields for Ideal ([#3183](https://github.com/juspay/hyperswitch/pull/3183)) ([`1c3c5f6`](https://github.com/juspay/hyperswitch/commit/1c3c5f6b0cff9a0037175ba92c002cdf4249108d))

### Bug Fixes

- **connector:**
- [BOA/CYB] Fix Metadata Error ([#3283](https://github.com/juspay/hyperswitch/pull/3283)) ([`71044a1`](https://github.com/juspay/hyperswitch/commit/71044a14ed87ac0cd7d2bb2009f0e59c79bd344c))
- [BOA, Cybersource] capture error_code ([#3239](https://github.com/juspay/hyperswitch/pull/3239)) ([`ecf51b5`](https://github.com/juspay/hyperswitch/commit/ecf51b5e3a30f055634edfafcd36f64cef535a53))
- **outgoingwebhookevents:** Throw an error when outgoing webhook events env var not found ([#3291](https://github.com/juspay/hyperswitch/pull/3291)) ([`ee044a0`](https://github.com/juspay/hyperswitch/commit/ee044a0be811a53842c69f64c27d9995d84b7040))
- **users:** Added merchant name is list merchants ([#3289](https://github.com/juspay/hyperswitch/pull/3289)) ([`8a354f4`](https://github.com/juspay/hyperswitch/commit/8a354f42295a3167d0e846c9522bc091ebdca3f4))
- **wasm:** Fix failing `wasm-pack build` for `euclid_wasm` ([#3284](https://github.com/juspay/hyperswitch/pull/3284)) ([`5eb6711`](https://github.com/juspay/hyperswitch/commit/5eb67114646674fe227f073e417f26beb97e9a43))

### Refactors

- Pass customer object to `make_pm_data` ([#3246](https://github.com/juspay/hyperswitch/pull/3246)) ([`36c32c3`](https://github.com/juspay/hyperswitch/commit/36c32c377ae788c96b578303eae5d029e3044b7c))

### Miscellaneous Tasks

- **postman:** Update Postman collection files ([`8fc68ad`](https://github.com/juspay/hyperswitch/commit/8fc68adc7fb6a23d4a2970a05f5739db6010a53d))

**Full Changelog:** [`2024.01.08.0...2024.01.10.0`](https://github.com/juspay/hyperswitch/compare/2024.01.08.0...2024.01.10.0)

- - -

## 2024.01.08.0

### Features
Expand Down
8 changes: 1 addition & 7 deletions config/config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,6 @@ connectors_with_delayed_session_response = "trustpay,payme" # List of connectors
connectors_with_webhook_source_verification_call = "paypal" # List of connectors which has additional source verification api-call

[jwekey] # 4 priv/pub key pair
locker_key_identifier1 = "" # key identifier for key rotation , should be same as basilisk
locker_key_identifier2 = "" # key identifier for key rotation , should be same as basilisk
locker_encryption_key1 = "" # public key 1 in pem format, corresponding private key in basilisk
locker_encryption_key2 = "" # public key 2 in pem format, corresponding private key in basilisk
locker_decryption_key1 = "" # private key 1 in pem format, corresponding public key in basilisk
locker_decryption_key2 = "" # private key 2 in pem format, corresponding public key in basilisk
vault_encryption_key = "" # public key in pem format, corresponding private key in basilisk-hs
rust_locker_encryption_key = "" # public key in pem format, corresponding private key in rust locker
vault_private_key = "" # private key in pem format, corresponding public key in basilisk-hs
Expand Down Expand Up @@ -472,7 +466,7 @@ apple_pay_merchant_cert = "APPLE_PAY_MERCHNAT_CERTIFICATE" #Merchant Cer
apple_pay_merchant_cert_key = "APPLE_PAY_MERCHNAT_CERTIFICATE_KEY" #Private key generate by RSA:2048 algorithm

[payment_link]
sdk_url = "http://localhost:9090/dist/HyperLoader.js"
sdk_url = "http://localhost:9090/0.16.7/v0/HyperLoader.js"

[payment_method_auth]
redis_expiry = 900
Expand Down
8 changes: 1 addition & 7 deletions config/development.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,6 @@ fallback_api_key = "YOUR API KEY HERE"
redis_lock_timeout = 26000

[jwekey]
locker_key_identifier1 = ""
locker_key_identifier2 = ""
locker_encryption_key1 = ""
locker_encryption_key2 = ""
locker_decryption_key1 = ""
locker_decryption_key2 = ""
vault_encryption_key = ""
rust_locker_encryption_key = ""
vault_private_key = ""
Expand Down Expand Up @@ -494,7 +488,7 @@ apple_pay_merchant_cert = "APPLE_PAY_MERCHNAT_CERTIFICATE"
apple_pay_merchant_cert_key = "APPLE_PAY_MERCHNAT_CERTIFICATE_KEY"

[payment_link]
sdk_url = "http://localhost:9090/dist/HyperLoader.js"
sdk_url = "http://localhost:9050/HyperLoader.js"

[payment_method_auth]
redis_expiry = 900
Expand Down
6 changes: 0 additions & 6 deletions config/docker_compose.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,6 @@ mock_locker = true
basilisk_host = ""

[jwekey]
locker_key_identifier1 = ""
locker_key_identifier2 = ""
locker_encryption_key1 = ""
locker_encryption_key2 = ""
locker_decryption_key1 = ""
locker_decryption_key2 = ""
vault_encryption_key = ""
rust_locker_encryption_key = ""
vault_private_key = ""
Expand Down
25 changes: 24 additions & 1 deletion crates/api_models/src/payments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3358,6 +3358,13 @@ pub struct PaymentLinkInitiateRequest {
pub payment_id: String,
}

#[derive(Debug, serde::Serialize)]
#[serde(untagged)]
pub enum PaymentLinkData {
PaymentLinkDetails(PaymentLinkDetails),
PaymentLinkStatusDetails(PaymentLinkStatusDetails),
}

#[derive(Debug, serde::Serialize)]
pub struct PaymentLinkDetails {
pub amount: String,
Expand All @@ -3376,6 +3383,21 @@ pub struct PaymentLinkDetails {
pub merchant_description: Option<String>,
}

#[derive(Debug, serde::Serialize)]
pub struct PaymentLinkStatusDetails {
pub amount: String,
pub currency: api_enums::Currency,
pub payment_id: String,
pub merchant_logo: String,
pub merchant_name: String,
#[serde(with = "common_utils::custom_serde::iso8601")]
pub created: PrimitiveDateTime,
pub intent_status: api_enums::IntentStatus,
pub payment_link_status: PaymentLinkStatus,
pub error_code: Option<String>,
pub error_message: Option<String>,
}

#[derive(Clone, Debug, serde::Deserialize, ToSchema, serde::Serialize)]
#[serde(deny_unknown_fields)]

Expand Down Expand Up @@ -3451,7 +3473,8 @@ pub struct OrderDetailsWithStringAmount {
pub product_img_link: Option<String>,
}

#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ToSchema)]
#[derive(PartialEq, Debug, Clone, serde::Serialize, serde::Deserialize, ToSchema)]
#[serde(rename_all = "snake_case")]
pub enum PaymentLinkStatus {
Active,
Expired,
Expand Down
Loading

0 comments on commit eeb0c28

Please sign in to comment.