prompt stringlengths 24 63.1k | response stringlengths 180 101k | metadata stringlengths 143 152 |
|---|---|---|
refactor(core): filter default routing config response based on connector type
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
We are filtering the response for payment and payout processors.
So this works as follows:
If Payment's route is hit only PaymentProcessors will be listed and nothing else like PayoutConnectors etc.
Payment :
```
curl --location 'http://localhost:8080/routing/default/profile' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMWMyMTJhODgtOGFmYy00YjJjLWIwYWQtODY3MmQ2NTI3MzdlIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQxMDAzMjgwIiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0MTE3NjE1Miwib3JnX2lkIjoib3JnX1c4MkFMNTZ6VVE1dXFHcEEyYzFkIiwicHJvZmlsZV9pZCI6InByb19NcUlMcDAwdUFJeW5JZDdtUTNUTyIsInRlbmFudF9pZCI6InB1YmxpYyJ9.RoPyIG-JGrH6QmM6Gqd9gh03hOqy6MuC9Our9EHYGNk' \
--header 'Cookie: login_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMWMyMTJhODgtOGFmYy00YjJjLWIwYWQtODY3MmQ2NTI3MzdlIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQxMDAzMjgwIiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0MTE3NjE1Miwib3JnX2lkIjoib3JnX1c4MkFMNTZ6VVE1dXFHcEEyYzFkIiwicHJvZmlsZV9pZCI6InByb19NcUlMcDAwdUFJeW5JZDdtUTNUTyIsInRlbmFudF9pZCI6InB1YmxpYyJ9.RoPyIG-JGrH6QmM6Gqd9gh03hOqy6MuC9Our9EHYGNk'
```
If Payout's route is hit, only Payout's connector will be shown and nothing else.
Payout :
```
curl --location 'http://localhost:8080/routing/payout/default/profile' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMWMyMTJhODgtOGFmYy00YjJjLWIwYWQtODY3MmQ2NTI3MzdlIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQxMDAzMjgwIiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0MTE3NjE1Miwib3JnX2lkIjoib3JnX1c4MkFMNTZ6VVE1dXFHcEEyYzFkIiwicHJvZmlsZV9pZCI6InByb19NcUlMcDAwdUFJeW5JZDdtUTNUTyIsInRlbmFudF9pZCI6InB1YmxpYyJ9.RoPyIG-JGrH6QmM6Gqd9gh03hOqy6MuC9Our9EHYGNk' \
--header 'Cookie: login_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMWMyMTJhODgtOGFmYy00YjJjLWIwYWQtODY3MmQ2NTI3MzdlIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQxMDAzMjgwIiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0MTE3NjE1Miwib3JnX2lkIjoib3JnX1c4MkFMNTZ6VVE1dXFHcEEyYzFkIiwicHJvZmlsZV9pZCI6InByb19NcUlMcDAwdUFJeW5JZDdtUTNUTyIsInRlbmFudF9pZCI6InB1YmxpYyJ9.RoPyIG-JGrH6QmM6Gqd9gh03hOqy6MuC9Our9EHYGNk'
```

<img width="1333" alt="Screenshot 2025-03-04 at 1 02 15 PM" src="https://github.com/user-attachments/assets/a587b7c3-ee87-4caf-8b29-dcb281a1e6f4" />
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Tested after creating JWT locally and adding 1 payment and 1 payout connector.
Payment :
```
curl --location 'http://localhost:8080/routing/default/profile' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMWMyMTJhODgtOGFmYy00YjJjLWIwYWQtODY3MmQ2NTI3MzdlIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQxMDAzMjgwIiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0MTE3NjE1Miwib3JnX2lkIjoib3JnX1c4MkFMNTZ6VVE1dXFHcEEyYzFkIiwicHJvZmlsZV9pZCI6InByb19NcUlMcDAwdUFJeW5JZDdtUTNUTyIsInRlbmFudF9pZCI6InB1YmxpYyJ9.RoPyIG-JGrH6QmM6Gqd9gh03hOqy6MuC9Our9EHYGNk' \
--header 'Cookie: login_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMWMyMTJhODgtOGFmYy00YjJjLWIwYWQtODY3MmQ2NTI3MzdlIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQxMDAzMjgwIiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0MTE3NjE1Miwib3JnX2lkIjoib3JnX1c4MkFMNTZ6VVE1dXFHcEEyYzFkIiwicHJvZmlsZV9pZCI6InByb19NcUlMcDAwdUFJeW5JZDdtUTNUTyIsInRlbmFudF9pZCI6InB1YmxpYyJ9.RoPyIG-JGrH6QmM6Gqd9gh03hOqy6MuC9Our9EHYGNk'
```
Payout :
```
curl --location 'http://localhost:8080/routing/payout/default/profile' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMWMyMTJhODgtOGFmYy00YjJjLWIwYWQtODY3MmQ2NTI3MzdlIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQxMDAzMjgwIiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0MTE3NjE1Miwib3JnX2lkIjoib3JnX1c4MkFMNTZ6VVE1dXFHcEEyYzFkIiwicHJvZmlsZV9pZCI6InByb19NcUlMcDAwdUFJeW5JZDdtUTNUTyIsInRlbmFudF9pZCI6InB1YmxpYyJ9.RoPyIG-JGrH6QmM6Gqd9gh03hOqy6MuC9Our9EHYGNk' \
--header 'Cookie: login_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMWMyMTJhODgtOGFmYy00YjJjLWIwYWQtODY3MmQ2NTI3MzdlIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQxMDAzMjgwIiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0MTE3NjE1Miwib3JnX2lkIjoib3JnX1c4MkFMNTZ6VVE1dXFHcEEyYzFkIiwicHJvZmlsZV9pZCI6InByb19NcUlMcDAwdUFJeW5JZDdtUTNUTyIsInRlbmFudF9pZCI6InB1YmxpYyJ9.RoPyIG-JGrH6QmM6Gqd9gh03hOqy6MuC9Our9EHYGNk'
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
| <think>
PR Context:
- Title: refactor(core): Revert "filter default routing config response based on connector type"
- Merged: 2025-03-18T15:06:40Z
- Files changed: 1 files
- Commits: 1 commits
Implementation approach:
Reverts juspay/hyperswitch#7199
## Description
<!-- Describe your changes in detail -->
We are reverting the filtering of response for payment and payout processors.
So this works as follows:
If Payment's route is hit all the PaymentProcessors will be listed like PayoutConnectors etc.
###
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** refactor(core): Revert "filter default routing config response based on connector type" (#7556)
Files to modify:
**crates/router/src/core/routing.rs**
Modify existing code | {"issue_number": 7199, "pr_number": 7556, "commits_count": 1, "files_changed": 1, "response_length": 995, "file_count": 3, "needs_breakdown": false} |
chore(openapi): reformat and fix typos
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
## Description
<!-- Describe your changes in detail -->
(If you're reviewing, it's better to follow changes in each commit, except for the first one. For the first commit, check [diff without whitespace changes](https://github.com/juspay/orca/commit/892fce6309a0c7e166cb90ce122a9152e09544d4?w=1).)
This PR includes the following changes:
- Re-formats the OpenAPI spec YAML file to use 2 spaces instead of 4 for indentation.
- I just ran the [Prettier VS Code Extension](https://github.com/prettier/prettier-vscode) on the file.
- View the diff for the commit without whitespace changes [here](https://github.com/juspay/orca/commit/892fce6309a0c7e166cb90ce122a9152e09544d4?w=1).
- Updates the base URLs in the description to be clickable links.
- Replaces some occurrences of `jarnura` and `Arun Raj` with placeholders.
- Fixes typos in the OpenAPI spec file (~50 of them)
- Re-generates the Postman collection from the OpenAPI spec file.
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless its an obvious bug or documentation fix
that will have little conversation).
-->
This PR paves the way for including a "quick start" section in the OpenAPI spec and the Postman collection, which will be made in a separate PR.
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
N/A
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt`
- [ ] I addressed lints thrown by `cargo clippy`
- [x] I reviewed submitted code
- [ ] I added unit tests for my changes where possible
- [ ] I added a [CHANGELOG](/CHANGELOG.md) entry if applicable
| <think>
PR Context:
- Title: docs(openapi): introduce a `QuickStart` tag
- Merged: 2023-01-03T12:32:42Z
- Files changed: 2 files
- Commits: 5 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
This PR builds on top of changes made in #263 and includes a `QuickStart` tag and folder in the OpenAPI spec and Postman collection, respectively. This targets the branch for #263 (for better diffs) and hence, it's preferable that #263 is merged first. (If you're reviewing, it
</think>
To implement this, you'll need to modify:
(No detailed commit information available) | {"issue_number": 263, "pr_number": 264, "commits_count": 0, "files_changed": 2, "response_length": 773, "file_count": 0, "needs_breakdown": false} |
[FEATURE] allow payout_id to be configurable
### Feature Description
`payout_id` is an unique identifier for payout resource which is auto generated during payout creation. This field needs to be configurable during payout creation by accepting in the API.
Along with this, a `merchant_order_reference_id` needs to be added which is an unique identifier for the consumer of the API.
### Possible Implementation
Below changes are needed in payout flow across different components -
- Add `payout_id` to API models
- Add `PayoutId` domain type
- Add `merchant_order_reference_id` to API and diesel models
- Add DB queries for fetching orders using `merchant_order_reference_id`
- Add `merchant_order_reference_id` as a filter for OLAP APIs
- Use uuidv4 for payout ID creation for Wise
### Have you spent some time checking if this feature request has been raised before?
- [x] I checked and didn't find a similar issue
### Have you read the Contributing Guidelines?
- [x] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md)
### Are you willing to submit a PR?
None | <think>
PR Context:
- Title: feat(payouts): add domain type for PayoutId
- Merged: 2025-07-01T14:45:02Z
- Files changed: 30 files
- Commits: 16 commits
Implementation approach:
feat(payouts): allow payout_id to be configurable in API request
feat(payouts): add merchant_order_reference_id for referencing payouts
## Description
This pull request introduces two main features for payouts:
1. **Configurable `payout_id` in API Requests**:
* The `payout_id` field i
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat(payouts): add domain type for PayoutId (#8395)
Co-authored-by: hyperswitch-bot[bot] <148525504+
Files to modify:
**crates/api_models/src/events/payouts.rs**
Modify existing code
**crates/api_models/src/payouts.rs**
Modify existing code
**crates/api_models/src/webhooks.rs**
Modify existing code
**crates/common_utils/src/events.rs**
Modify existing code
**crates/common_utils/src/id_type.rs**
Add:
- mod: private::payout
**crates/common_utils/src/id_type/payout.rs**
Modify existing code
**crates/common_utils/src/link_utils.rs**
Modify existing code
**crates/diesel_models/src/events.rs**
Modify existing code
**crates/diesel_models/src/generic_link.rs**
Modify existing code
**crates/diesel_models/src/payout_attempt.rs**
Modify existing code
**crates/diesel_models/src/payouts.rs**
Modify existing code
**crates/diesel_models/src/query/generic_link.rs**
Modify existing code
**crates/diesel_models/src/query/payout_attempt.rs**
Add:
- function: pub::find_by_merchant_id_merchant_order_reference_id
**crates/diesel_models/src/query/payouts.rs**
Modify existing code
**crates/diesel_models/src/schema.rs**
Modify existing code
**crates/diesel_models/src/schema_v2.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/adyenplatform/transformers/payouts.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/nomupay/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/stripe/transformers/connect.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/wise/transformers.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/errors/api_error_response.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payouts.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payouts/payout_attempt.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payouts/payouts.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_request_types.rs**
Modify existing code
**crates/router/src/compatibility/stripe/errors.rs**
Modify existing code
**crates/router/src/compatibility/stripe/webhooks.rs**
Modify existing code
**crates/router/src/core/payments/routing.rs**
Modify existing code
**crates/router/src/core/payout_link.rs**
Modify existing code
**crates/router/src/core/payouts.rs**
Modify existing code
**crates/router/src/core/payouts/helpers.rs**
Modify existing code
**crates/router/src/core/payouts/retry.rs**
Modify existing code
**crates/router/src/core/payouts/transformers.rs**
Modify existing code
**crates/router/src/core/payouts/validator.rs**
Modify existing code
**crates/router/src/core/utils.rs**
Remove:
- function: pub::get_or_generate_uuid
- function: pub::validate_uuid
**crates/router/src/core/webhooks/incoming.rs**
Modify existing code
**crates/router/src/db/kafka_store.rs**
Add:
- function: private::find_payout_attempt_by_merchant_id_merchant_order_reference_id
**crates/router/src/events/outgoing_webhook_logs.rs**
Modify existing code
**crates/router/src/routes/payout_link.rs**
Modify existing code
**crates/router/src/routes/payouts.rs**
Modify existing code
**crates/router/src/services/kafka/payout.rs**
Modify existing code
**crates/router/src/utils.rs**
Remove:
- function: pub::generate_uuid
**crates/router/src/workflows/outgoing_webhook_retry.rs**
Modify existing code
**crates/router/tests/connectors/utils.rs**
Modify existing code
**crates/storage_impl/src/lib.rs**
Modify existing code
**crates/storage_impl/src/mock_db/payout_attempt.rs**
Add:
- function: private::find_payout_attempt_by_merchant_id_merchant_order_reference_id
**crates/storage_impl/src/mock_db/payouts.rs**
Modify existing code
**crates/storage_impl/src/payouts/payout_attempt.rs**
Add:
- function: private::find_payout_attempt_by_merchant_id_merchant_order_reference_id
- function: private::find_payout_attempt_by_merchant_id_merchant_order_reference_id
**crates/storage_impl/src/payouts/payouts.rs**
Modify existing code
**crates/storage_impl/src/redis/kv_store.rs**
Modify existing code | {"issue_number": 8392, "pr_number": 8395, "commits_count": 1, "files_changed": 30, "response_length": 5301, "file_count": 56, "needs_breakdown": true} |
chore(codeowners): add codeowners data for PR reviews
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
## Description
Adding a CODEOWNERS file for facilitating PR reviews for teams
### Additional Changes
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!-- Provide links to the files with corresponding changes -->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless its an obvious bug or documentation fix
that will have little conversation).
-->
This leads to better ownership boundaries & increased efficiency for reviewers
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Doesn't need to be tested
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed submitted code
- [ ] I added unit tests for my changes where possible
- [ ] I added a [CHANGELOG](/CHANGELOG.md) entry if applicable
| <think>
PR Context:
- Title: refactor: explicitly specify top redirections for secure payment and payout links
- Merged: 2024-11-11T08:07:30Z
- Files changed: 2 files
- Commits: 2 commits
Implementation approach:
## Description
Described in https://github.com/juspay/hyperswitch-web/issues/773
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the fi
</think>
To implement this, you'll need to modify:
(No detailed commit information available) | {"issue_number": 1, "pr_number": 6494, "commits_count": 0, "files_changed": 2, "response_length": 811, "file_count": 0, "needs_breakdown": false} |
Payment Intent and MCA changes for split payments
- Add split_txns_enabled field in PaymentIntent
- Add split_enabled field to MCA payment_method
- Code changes to modify split_enabled for a payment method when creating or updating an MCA (similar to recurring_enabled)
- PML changes to filter payment methods based on split_enabled in MCA and split_txns_enabled in Intent | <think>
PR Context:
- Title: feat(router): Payment Intent and MCA changes for split payments
- Merged: 2025-09-01T13:47:28Z
- Files changed: 20 files
- Commits: 5 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
- Add split_txns_enabled field to business_profile DB, create+update API calls
- Add split_txns_enabled field in PaymentIntent
- PML changes to filter payment methods based on split_enabled in MCA and split_txns_enabled in Intent
### Addi
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat(router): Payment Intent and MCA changes for split payments (#9049)
Files to modify:
**crates/api_models/src/admin.rs**
Modify existing code
**crates/api_models/src/payments.rs**
Modify existing code
**crates/common_enums/src/enums.rs**
Add:
- enum: pub::SplitTxnsEnabled
**crates/diesel_models/src/business_profile.rs**
Modify existing code
**crates/diesel_models/src/payment_intent.rs**
Modify existing code
**crates/diesel_models/src/schema_v2.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/business_profile.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payments.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payments/payment_intent.rs**
Modify existing code
**crates/openapi/src/openapi_v2.rs**
Modify existing code
**crates/router/src/core/admin.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
**crates/router/src/services/kafka/payment_intent.rs**
Modify existing code
**crates/router/src/services/kafka/payment_intent_event.rs**
Modify existing code
**crates/router/src/types/api/admin.rs**
Modify existing code | {"issue_number": 9047, "pr_number": 9049, "commits_count": 1, "files_changed": 20, "response_length": 1976, "file_count": 17, "needs_breakdown": true} |
feat(users): add support to check 2FA status
Add support to check whether the 2FA has been done recently or not. ( For now it will check for last five minutes)
Use case: The api will help to check for when was last TOTP done, if user has recently done sign in and trying to do some operation that asks for TOTP again from inside dashboard, we can ignore TOTP based on the result this api gives. | <think>
PR Context:
- Title: feat(users): add endpoint to check 2fa status
- Merged: 2024-05-29T13:45:12Z
- Files changed: 7 files
- Commits: 6 commits
Implementation approach:
## Description
The api checks whether the 2FA has been done recently or not.
It just checks the status in Redis and gives the response.
### Additional Changes
- [x] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat(users): add endpoint to check 2fa status (#4810)
Files to modify:
**crates/api_models/src/events/user.rs**
Modify existing code
**crates/api_models/src/user.rs**
Add:
- struct: pub::TwoFactorAuthStatusResponse
**crates/router/src/core/user.rs**
Add:
- function: pub::check_two_factor_auth_status
**crates/router/src/routes/app.rs**
Modify existing code
**crates/router/src/routes/lock_utils.rs**
Modify existing code
**crates/router/src/routes/user.rs**
Add:
- function: pub::check_two_factor_auth_status
**crates/router_env/src/logger/types.rs**
Modify existing code | {"issue_number": 4809, "pr_number": 4810, "commits_count": 1, "files_changed": 7, "response_length": 1384, "file_count": 9, "needs_breakdown": false} |
[FEATURE] Recon APIs
### Feature Description
Add recon related APIs in HyperSwitch for managing recon module for the consumers. Recon dashboard is a separate application hosted at https://sandbox.hyperswitch.io/recon-dashboard/
Recon module in HyperSwitch should be able to perform below tasks
- Toggle recon module for a given merchant
- Generate tokens for Recon dashboard login
- Let admins modify the state of recon related stuff for a given merchant
- Verify the generated token
### Possible Implementation
Below endpoints are exposed for performing the required tasks
- `/recon/update_merchant` - admin API call for updating any recon related field for a given merchant.
- `/recon/token` - request a token for an user which is used for logging into Recon's dashboard.
- `/recon/request` - let's user send a mail to HS team for enabling recon for their merchant's account.
- `/recon/verify_token` - validate a generated token.
### Have you spent some time checking if this feature request has been raised before?
- [X] I checked and didn't find a similar issue
### Have you read the Contributing Guidelines?
- [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md)
### Are you willing to submit a PR?
Yes, I am willing to submit a PR! | <think>
PR Context:
- Title: feat(recon): add recon APIs
- Merged: 2024-01-16T11:22:00Z
- Files changed: 22 files
- Commits: 7 commits
Implementation approach:
## Description
This PR adds recon APIs for activating recon as a feature on HyperSwitch dashboard and generating tokens for Recon dashboard.
Issue - #3359
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies appl
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat(recon): add recon APIs (#3345)
Co-authored-by: Kashif <mohammed.kashif@juspay.in>
Co-authored-b
Files to modify:
**crates/api_models/src/events.rs**
Add:
- mod: pub::recon
**crates/api_models/src/events/recon.rs**
Add:
- function: private::get_api_event_type
- function: private::get_api_event_type
- function: private::get_api_event_type
- impl: impl ApiEventMetric for ReconUpdateMerchantRequest
- impl: impl ApiEventMetric for ReconTokenResponse
- impl: impl ApiEventMetric for ReconStatusResponse
**crates/api_models/src/events/user.rs**
Add:
- function: private::get_api_event_type
- impl: impl ApiEventMetric for VerifyTokenResponse
**crates/api_models/src/lib.rs**
Add:
- mod: pub::recon
**crates/api_models/src/recon.rs**
Add:
- struct: pub::ReconUpdateMerchantRequest
- struct: pub::ReconTokenResponse
- struct: pub::ReconStatusResponse
**crates/api_models/src/user.rs**
Add:
- struct: pub::VerifyTokenResponse
**crates/common_utils/src/events.rs**
Modify existing code
**crates/router/src/core/user.rs**
Add:
- function: pub::verify_token
**crates/router/src/lib.rs**
Modify existing code
**crates/router/src/routes.rs**
Add:
- mod: pub::recon
**crates/router/src/routes/app.rs**
Add:
- function: pub::server
- struct: pub::Recon
- impl: impl Recon
**crates/router/src/routes/lock_utils.rs**
Modify existing code
**crates/router/src/routes/recon.rs**
Add:
- function: pub::update_merchant
- function: pub::request_for_recon
- function: pub::get_recon_token
- function: pub::send_recon_request
- function: pub::recon_merchant_account_update
- function: pub::generate_recon_token
- function: pub::get_recon_auth_token
**crates/router/src/routes/user.rs**
Add:
- function: pub::verify_recon_token
**crates/router/src/services.rs**
Add:
- mod: pub::recon
**crates/router/src/services/authentication.rs**
Add:
- function: pub::get_recon_admin_api_key
- function: private::authenticate_and_fetch
- function: private::get_merchant_id
- function: private::authenticate_and_fetch
- struct: pub::ReconAdmin
- struct: pub::ReconJWT
- struct: pub::ReconUser
- impl: impl AuthenticateAndFetch<(), A> for ReconAdmin
- impl: impl AuthInfo for ReconUser
- impl: impl AuthenticateAndFetch<ReconUser, AppState> for ReconJWT
**crates/router/src/services/email/types.rs**
Add:
- function: private::get_email_data
- function: private::get_email_data
- struct: private::ReconActivation
- struct: pub::ProFeatureRequest
- impl: impl EmailData for ReconActivation
- impl: impl EmailData for ProFeatureRequest
**crates/router/src/services/recon.rs**
Add:
- function: pub::new_token
- struct: pub::ReconToken
- impl: impl ReconToken
**crates/router_env/src/logger/types.rs**
Modify existing code | {"issue_number": 3359, "pr_number": 3345, "commits_count": 1, "files_changed": 22, "response_length": 3691, "file_count": 21, "needs_breakdown": true} |
refactor(users): Deprecate non-profile level user APIs
- Currently there are few APIs in Backend which are not at profile level. For example - Switch merchant.
- We have to remove those APIs.
- If there is any v2 counter part for those APIs, v1 APIs should be modified so that they will work the same way as v1. | <think>
PR Context:
- Title: refactor(users): Deprecate unused user APIs and stabilize v1 APIs
- Merged: 2024-10-04T11:53:51Z
- Files changed: 18 files
- Commits: 5 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
Deletions
- `/user/switch_merchant`
- `/user/switch/list`
- `/user/merchants/list`
- `/user/merchant_select/list`
Modifications
- `/user/user` will work same as `/user/user/v2`
- `/user/user/list` will work same as `/user
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** refactor(users): Deprecate unused user APIs and stabilize v1 APIs (#6114)
Files to modify:
**crates/api_models/src/events/user.rs**
Remove:
- function: private::get_api_event_type
- impl: impl ApiEventMetric for DashboardEntryResponse
**crates/api_models/src/events/user_role.rs**
Modify existing code
**crates/api_models/src/user.rs**
Remove:
- struct: pub::DashboardEntryResponse
- struct: pub::ListUsersResponse
- struct: pub::UserDetails
- struct: pub::GetUserRoleDetailsResponse
- struct: pub::UserMerchantAccount
**crates/api_models/src/user_role.rs**
Remove:
- struct: pub::ModuleInfo
- struct: pub::MerchantSelectRequest
- struct: pub::AcceptInvitationRequest
- enum: pub::PermissionModule
**crates/api_models/src/user_role/role.rs**
Remove:
- struct: pub::ListRolesResponse
- struct: pub::RoleInfoWithPermissionsResponse
**crates/router/src/core/user.rs**
Remove:
- function: pub::switch_merchant_id
- function: pub::list_merchants_for_user
- function: pub::get_user_details_in_merchant_account
- function: pub::list_users_for_merchant_account
**crates/router/src/core/user_role.rs**
Remove:
- function: pub::accept_invitation
- function: pub::merchant_select_token_only_flow
**crates/router/src/core/user_role/role.rs**
Remove:
- function: pub::list_invitable_roles_with_groups
**crates/router/src/db/kafka_store.rs**
Remove:
- function: private::find_user_role_by_user_id
- function: private::find_user_role_by_user_id_merchant_id
- function: private::list_user_roles_by_user_id_and_version
- function: private::list_user_roles_by_merchant_id
**crates/router/src/db/user_role.rs**
Remove:
- function: private::find_user_role_by_user_id
- function: private::find_user_role_by_user_id_merchant_id
- function: private::list_user_roles_by_user_id_and_version
- function: private::list_user_roles_by_merchant_id
- function: private::find_user_role_by_user_id
- function: private::find_user_role_by_user_id_merchant_id
- function: private::list_user_roles_by_user_id_and_version
- function: private::list_user_roles_by_merchant_id
**crates/router/src/routes/app.rs**
Modify existing code
**crates/router/src/routes/lock_utils.rs**
Modify existing code
**crates/router/src/routes/user.rs**
Remove:
- function: pub::switch_merchant_id
- function: pub::list_merchants_for_user
- function: pub::get_user_role_details
- function: pub::list_users_for_merchant_account
**crates/router/src/routes/user_role.rs**
Remove:
- function: pub::list_all_roles
- function: pub::accept_invitation
- function: pub::merchant_select
**crates/router/src/services/authorization/info.rs**
Remove:
- function: pub::get_module_authorization_info
- function: pub::get_module_description
- function: pub::new
- struct: pub::ModuleInfo
- enum: pub::PermissionModule
- impl: impl PermissionModule
- impl: impl ModuleInfo
**crates/router/src/types/domain/user.rs**
Remove:
- function: private::from
- function: private::from
- impl: impl From<info::ModuleInfo> for user_role_api::ModuleInfo
- impl: impl From<info::PermissionModule> for user_role_api::PermissionModule
**crates/router/src/utils/user.rs**
Remove:
- function: pub::generate_jwt_auth_token_without_profile
- function: pub::generate_jwt_auth_token_with_attributes_without_profile
**crates/router_env/src/logger/types.rs**
Modify existing code | {"issue_number": 6112, "pr_number": 6114, "commits_count": 1, "files_changed": 18, "response_length": 4341, "file_count": 20, "needs_breakdown": true} |
[FEATURE]: [Multisafepay] Use `connector_response_reference_id` as reference to merchant
### :memo: Feature Description
- Reference id are used to map transactions in the connector’s dashboard.
- Hyperswitch manages several reference ids, such as `payment_id`, `attempt_id`, and `connector_transaction_id` for a single transaction.
- However, merchants may encounter uncertainty when determining which ID to utilize in the connector dashboard to identify the payment.
### :hammer: Possible Implementation
- When we receive a response from the connector for the payment, we deserialize it and populate the `response` field in RouterData.
- For the `TransactionResponse` type, we must fill the `connector_response_reference_id` with a corresponding reference id for the merchant to identify the transaction.
- One might need to have exposure to api docs of the connector for which it is being implemented to decide what to fill in connector_response_reference_id.
- You can check this PR for further reference https://github.com/juspay/hyperswitch/pull/1735
🔖 Note: All the changes needed should be contained within `hyperswitch/crates/router/src/connector/`
### :package: Have you spent some time checking if this feature request has been raised before?
- [X] I checked and didn't find a similar issue
### :package: Have you read the Contributing Guidelines?
- [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md)
### :sparkles: Are you willing to submit a PR?
| <think>
PR Context:
- Title: feat(connector): [Multisafepay] Use transaction_id as reference to transaction
- Merged: 2023-10-07T18:03:37Z
- Files changed: 1 files
- Commits: 12 commits
Implementation approach:
## Description
Updated the `connector_response_reference_id` value from the response.
closes #2336
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Pro
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat(connector): [Multisafepay] Use transaction_id as reference to transaction (#2451)
Files to modify:
**crates/router/src/connector/multisafepay/transformers.rs**
Modify existing code | {"issue_number": 2336, "pr_number": 2451, "commits_count": 1, "files_changed": 1, "response_length": 1001, "file_count": 3, "needs_breakdown": false} |
fix(core): Update pm details in Psync response
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Currently, in Psync response, payment_method_data is being none. Updated the Psync response with pm data.
For network token pm data will be none, since we are not storing additional pm data in attempt.
For other payment methods, it will continue to function as it did previously.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
payment curl -
```{
"amount": 6540,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 6540,
"customer_id": "StripeCustomer",
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+1",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://duck.com/",
"payment_method": "card",
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"card_cvc": "123"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "sundari"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "sundari"
}
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"routing": {
"type": "single",
"data": "stripe"
}
}
```
test cases - make a successful payment, pm data should be displayed in the response
PaymentsCreate -
<img width="702" alt="Screenshot 2024-09-24 at 1 54 01 PM" src="https://github.com/user-attachments/assets/cb4635ef-95c9-4127-aa67-25f1b372efd3">
PSync -
<img width="710" alt="Screenshot 2024-09-24 at 1 54 16 PM" src="https://github.com/user-attachments/assets/1fb845e8-da1a-4257-af73-0cdce5171d56">
Save Card flow -
<img width="763" alt="Screenshot 2024-09-24 at 1 54 30 PM" src="https://github.com/user-attachments/assets/2c2dde1c-f841-47b5-9d76-a4fcd48d5204">
payment create - wallet - googlepay
<img width="994" alt="Screenshot 2024-09-24 at 5 26 55 PM" src="https://github.com/user-attachments/assets/5bb6671b-3758-4d06-8d01-1a344efff518">
sync response - wallet
<img width="896" alt="Screenshot 2024-09-24 at 5 28 48 PM" src="https://github.com/user-attachments/assets/643f82c8-3915-4e7b-b807-ec63ec12435d">
confirm - network token
<img width="752" alt="Screenshot 2024-09-24 at 5 31 01 PM" src="https://github.com/user-attachments/assets/156d2f2c-4728-445e-b046-58ae7790c1dc">
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
| <think>
PR Context:
- Title: fix(core): Update pm details in Psync response
- Merged: 2024-09-24T12:36:15Z
- Files changed: 1 files
- Commits: 1 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
pr on oss main - [#6003](https://github.com/juspay/hyperswitch/pull/6003)
Currently, in Psync response, payment_method_data is being none. Updated the Psync response with pm data.
For network token pm data will be none, since we are not stor
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** fix(core): Update pm details in Psync response (#6011)
Files to modify:
**crates/router/src/core/payments/transformers.rs**
Modify existing code | {"issue_number": 6003, "pr_number": 6011, "commits_count": 1, "files_changed": 1, "response_length": 927, "file_count": 3, "needs_breakdown": false} |
Add Worldline for card payments | <think>
PR Context:
- Title: feature(connector): add support for worldline connector
- Merged: 2023-01-16T12:53:44Z
- Files changed: 15 files
- Commits: 12 commits
Implementation approach:
## Description
Adding support for [worldline](https://epayments-api.developer-ingenico.com/?paymentPlatform=GLOBALCOLLECT) payment gateway
Payment Method: card
Supported payment flows
[Authorize](https://epayments-api.developer-ingenico.com/s2sapi/v1/en_US/java/payments/create.html?paymentPlatform=ALL#payments-create)
[PSync
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feature(connector): add support for worldline connector (#374)
Files to modify:
**crates/api_models/src/enums.rs**
Modify existing code
**crates/router/src/configs/settings.rs**
Modify existing code
**crates/router/src/connector.rs**
Add:
- mod: pub::worldline
**crates/router/src/connector/worldline.rs**
Add:
- function: pub::generate_authorization_token
- function: pub::get_current_date_time
- function: private::id
- function: private::base_url
- function: private::build_error_response
- function: private::get_headers
- function: private::get_content_type
- function: private::get_url
- function: private::build_request
- function: private::handle_response
- function: private::get_error_response
- function: private::get_headers
- function: private::get_url
- function: private::build_request
- function: private::get_error_response
- function: private::handle_response
- function: private::get_headers
- function: private::get_content_type
- function: private::get_url
- function: private::get_request_body
- function: private::build_request
- function: private::handle_response
- function: private::get_error_response
- function: private::get_headers
- function: private::get_content_type
- function: private::get_url
- function: private::get_request_body
- function: private::build_request
- function: private::handle_response
- function: private::get_error_response
- function: private::get_headers
- function: private::get_url
- function: private::build_request
- function: private::handle_response
- function: private::get_error_response
- function: private::get_webhook_object_reference_id
- function: private::get_webhook_event_type
- function: private::get_webhook_resource_object
- struct: pub::Worldline
- impl: impl Worldline
- impl: impl ConnectorCommon for Worldline
- impl: impl api::Payment for Worldline
- impl: impl api::PreVerify for Worldline
- impl: impl ConnectorIntegration<api::Verify, types::VerifyRequestData, types::PaymentsResponseData> for Worldline
- impl: impl api::PaymentVoid for Worldline
- impl: impl ConnectorIntegration<api::Void, types::PaymentsCancelData, types::PaymentsResponseData> for Worldline
- impl: impl api::PaymentSync for Worldline
- impl: impl ConnectorIntegration<api::PSync, types::PaymentsSyncData, types::PaymentsResponseData> for Worldline
- impl: impl api::PaymentCapture for Worldline
- impl: impl ConnectorIntegration<api::Capture, types::PaymentsCaptureData, types::PaymentsResponseData> for Worldline
- impl: impl api::PaymentSession for Worldline
- impl: impl ConnectorIntegration<api::Session, types::PaymentsSessionData, types::PaymentsResponseData> for Worldline
- impl: impl api::PaymentAuthorize for Worldline
- impl: impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::PaymentsResponseData> for Worldline
- impl: impl api::Refund for Worldline
- impl: impl api::RefundExecute for Worldline
- impl: impl api::RefundSync for Worldline
- impl: impl ConnectorIntegration<api::Execute, types::RefundsData, types::RefundsResponseData> for Worldline
- impl: impl ConnectorIntegration<api::RSync, types::RefundsData, types::RefundsResponseData> for Worldline
- impl: impl api::IncomingWebhook for Worldline
- impl: impl services::ConnectorRedirectResponse for Worldline
- mod: private::transformers
**crates/router/src/connector/worldline/transformers.rs**
Add:
- function: private::try_from
- function: private::make_card_request
- function: private::get_card_product_id
- function: private::get_address
- function: private::build_customer_info
- function: private::from
- function: private::from
- function: private::try_from
- function: private::from
- function: private::try_from
- function: private::try_from
- function: private::try_from
- function: private::from
- function: private::try_from
- function: private::try_from
- function: private::from
- function: private::product_id
- struct: pub::Card
- struct: pub::CardPaymentMethod
- struct: pub::AmountOfMoney
- struct: pub::Order
- struct: pub::BillingAddress
- struct: pub::ContactDetails
- struct: pub::Customer
- struct: pub::Name
- struct: pub::Shipping
- struct: pub::PaymentsRequest
- struct: pub::AuthType
- struct: pub::Payment
- struct: pub::PaymentResponse
- struct: pub::WorldlineRefundRequest
- struct: pub::RefundResponse
- struct: pub::Error
- struct: pub::ErrorResponse
- enum: pub::PaymentStatus
- enum: pub::RefundStatus
- enum: pub::CardProduct
- impl: impl TryFrom<&types::PaymentsAuthorizeRouterData> for PaymentsRequest
- impl: impl From<api_models::AddressDetails> for BillingAddress
- impl: impl From<api_models::AddressDetails> for Shipping
- impl: impl TryFrom<&types::ConnectorAuthType> for AuthType
- impl: impl From<PaymentStatus> for enums::AttemptStatus
- impl: impl TryFrom<types::ResponseRouterData<F, Payment, T, types::PaymentsResponseData>> for types::RouterData<F, T, types::PaymentsResponseData>
- impl: impl TryFrom<types::ResponseRouterData<F, PaymentResponse, T, types::PaymentsResponseData>> for types::RouterData<F, T, types::PaymentsResponseData>
- impl: impl TryFrom<&types::RefundsRouterData<F>> for WorldlineRefundRequest
- impl: impl From<RefundStatus> for enums::RefundStatus
- impl: impl TryFrom<types::RefundsResponseRouterData<api::Execute, RefundResponse>> for types::RefundsRouterData<api::Execute>
- impl: impl TryFrom<types::RefundsResponseRouterData<api::RSync, RefundResponse>> for types::RefundsRouterData<api::RSync>
- impl: impl From<&PaymentResponse> for enums::AttemptStatus
- impl: impl CardProduct
**crates/router/src/core/errors.rs**
Modify existing code
**crates/router/src/lib.rs**
Modify existing code
**crates/router/src/types/api.rs**
Modify existing code
**crates/router/tests/connectors/connector_auth.rs**
Modify existing code
**crates/router/tests/connectors/main.rs**
Add:
- mod: private::worldline
**crates/router/tests/connectors/worldline.rs**
Add:
- function: private::get_data
- function: private::get_auth_token
- function: private::get_name
- function: private::get_payment_info
- function: private::get_payment_authorize_data
- function: private::should_requires_manual_authorization
- function: private::should_auto_authorize_and_request_capture
- function: private::should_fail_payment_for_invalid_cvc
- function: private::should_sync_manual_auth_payment
- function: private::should_sync_auto_auth_payment
- function: private::should_fail_capture_payment
- function: private::should_cancel_unauthorized_payment
- function: private::should_cancel_uncaptured_payment
- function: private::should_fail_cancel_with_invalid_payment_id
- function: private::should_fail_refund_with_invalid_payment_status
- struct: private::WorldlineTest
- impl: impl ConnectorActions for WorldlineTest
- impl: impl utils::Connector for WorldlineTest
- impl: impl WorldlineTest | {"issue_number": 233, "pr_number": 374, "commits_count": 1, "files_changed": 15, "response_length": 8149, "file_count": 13, "needs_breakdown": true} |
Eliminate Lack of Diagnostics Information because of macro panicking
Proc macro should not panic. When proc macro panics, it will be the only error message returned by the rust compiler. Instead, in case of errors, proc macro should emit compile_error!() to communicate error to the user. This will allow other errors to be displayed.
https://github.com/juspay/orca/blob/01cafe753bc4ea0cf33ec604dcbe0017abfebcad/crates/router_derive/src/macros/operation.rs#L92 | <think>
PR Context:
- Title: fix(router_derive): use compile_error instead of panic
- Merged: 2023-01-11T10:20:01Z
- Files changed: 3 files
- Commits: 7 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
Use compile_error in proc macros instead of panic.
### Additional Changes
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** router_derive: fix: Use compile_error instead of panic (#332)
Files to modify:
**crates/router_derive/src/lib.rs**
Modify existing code
**crates/router_derive/src/macros/helpers.rs**
Add:
- function: pub::syn_error
**crates/router_derive/src/macros/operation.rs**
Modify existing code | {"issue_number": 115, "pr_number": 332, "commits_count": 1, "files_changed": 3, "response_length": 1085, "file_count": 5, "needs_breakdown": false} |
docs:correction of content in the api-ref | <think>
PR Context:
- Title: docs(api-reference): fix the content of the tip
- Merged: 2025-02-27T13:47:08Z
- Files changed: 1 files
- Commits: 1 commits
Implementation approach:
Corrected the tip content.
## Description
<!-- Describe your changes in detail -->
Corrected the content of the tip.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment vari
</think>
To implement this, you'll need to modify:
(No detailed commit information available) | {"issue_number": 7391, "pr_number": 7387, "commits_count": 0, "files_changed": 1, "response_length": 777, "file_count": 0, "needs_breakdown": false} |
docs(CONTRIBUTING): update contributing guidelines based on Tokio
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [x] Documentation
## Description
Updates [`CONTRIBUTING.md`](https://github.com/juspay/orca/blob/5593a97c91e347a36b21bf78cf1f91d3ae5a946d/contrib/CONTRIBUTING.md) based on [Tokio's contributing guidelines](https://github.com/tokio-rs/tokio/blob/304b5152a71cb14140160324c54ce42a90eaa406/CONTRIBUTING.md)
### Additional Changes
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!-- Provide links to the files with corresponding changes -->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless its an obvious bug or documentation fix
that will have little conversation).
-->
I felt that the current contributing guidelines could have been improved.
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
This change does not warrant testing.
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt`
- [ ] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed submitted code
- [ ] I added unit tests for my changes where possible
- [ ] I added a [CHANGELOG](/CHANGELOG.md) entry if applicable
---
The following pieces of information are yet to be added:
- Information about tests
- Versioning policy, if any
- Release process
- Links to Slack/Discord
I'll create a separate issue for the same.
| <think>
PR Context:
- Title: ci(workflows): skip CI checks for ignored files
- Merged: 2022-11-23T13:35:25Z
- Files changed: 2 files
- Commits: 2 commits
Implementation approach:
## Description
This PR allows skipping CI checks for [ignored files](https://github.com/juspay/orca/blob/5593a97c91e347a36b21bf78cf1f91d3ae5a946d/.github/workflows/CI.yml#L20-L30).
This adds a workflow file with the same workflow and job names to simply return true for all checks. Even though this feels like a workaround, this
</think>
To implement this, you'll need to modify:
(No detailed commit information available) | {"issue_number": 9, "pr_number": 10, "commits_count": 0, "files_changed": 2, "response_length": 777, "file_count": 0, "needs_breakdown": false} |
[FEATURE]: Save Payment Method on Payments Confirm (V2)
Add functionality to save a payment method after a successful payment | <think>
PR Context:
- Title: feat(router): Save payment method on payments confirm (V2)
- Merged: 2025-06-06T15:55:49Z
- Files changed: 26 files
- Commits: 30 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
- Added a field `payment_token` to customer PML response
- During `/confirm-intent`, in case of card, an inactive payment method method is created before `call_conector_service`
- After the payment has completed, depending on its status the
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat(router): Save payment method on payments confirm (V2) (#8090)
Co-authored-by: hyperswitch-bot[b
Files to modify:
**crates/api_models/src/events/payment.rs**
Modify existing code
**crates/api_models/src/payment_methods.rs**
Add:
- struct: pub::PaymentMethodListResponseForSession
**crates/api_models/src/payments.rs**
Modify existing code
**crates/diesel_models/src/payment_attempt.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payment_method_data.rs**
Add:
- function: private::from
- function: private::from
- impl: impl From<(
payment_methods::CardDetail,
Secret<String>,
Option<Secret<String>>,
)> for Card
- impl: impl From<Card> for payment_methods::CardDetail
**crates/hyperswitch_domain_models/src/payments.rs**
Add:
- function: pub::update_payment_method_data
- function: pub::update_payment_method_and_pm_id
**crates/hyperswitch_domain_models/src/payments/payment_attempt.rs**
Modify existing code
**crates/openapi/src/openapi_v2.rs**
Modify existing code
**crates/openapi/src/routes/payment_method.rs**
Modify existing code
**crates/router/src/core/payment_methods.rs**
Add:
- function: private::get_pm_list_token_data
**crates/router/src/core/payment_methods/cards.rs**
Modify existing code
**crates/router/src/core/payment_methods/transformers.rs**
Remove:
- impl: impl transformers::ForeignTryFrom<domain::PaymentMethod> for api::CustomerPaymentMethod
Add:
- function: private::foreign_try_from
- impl: impl transformers::ForeignTryFrom<(domain::PaymentMethod, String)> for api::CustomerPaymentMethodResponseItem
- impl: impl transformers::ForeignTryFrom<domain::PaymentMethod> for PaymentMethodResponseItem
**crates/router/src/core/payment_methods/utils.rs**
Add:
- function: pub::retrieve_payment_token_data
- function: pub::delete_payment_token_data
**crates/router/src/core/payment_methods/vault.rs**
Add:
- function: pub::retrieve_payment_method_from_vault_using_payment_token
- function: pub::delete_payment_token
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/core/payments/helpers.rs**
Modify existing code
**crates/router/src/core/payments/operations.rs**
Add:
- function: private::create_or_fetch_payment_method
**crates/router/src/core/payments/operations/payment_confirm_intent.rs**
Add:
- function: private::create_or_fetch_payment_method
**crates/router/src/core/payments/operations/payment_response.rs**
Modify existing code
**crates/router/src/core/payments/operations/proxy_payments_intent.rs**
Modify existing code
**crates/router/src/core/payments/payment_methods.rs**
Modify existing code
**crates/router/src/routes/payment_methods.rs**
Add:
- function: pub::return_key_for_token
**crates/router/src/types/api/payment_methods.rs**
Modify existing code
**crates/router/src/types/storage/payment_method.rs**
Add:
- function: pub::is_permanent_card
- enum: pub::PaymentTokenData
**crates/router/src/workflows/revenue_recovery.rs**
Modify existing code | {"issue_number": 8089, "pr_number": 8090, "commits_count": 1, "files_changed": 26, "response_length": 3921, "file_count": 27, "needs_breakdown": true} |
feat: populate payment method details in payments response
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Described in #5652
### Additional Changes
- [x] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
Helps in identification of payment method details which were used for the payment. This is returned in payment retrieve and payment webhooks.
## How did you test it?
<details>
<summary>1. Complete and retrieve a gift card payment</summary>
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_JCI3dRg06RjMyOrBDO81euxfOykGXlA9zgW4Cf2iXGy2xwexsY6GOSH5sI41GugN' \
--data-raw '{
"amount": 1100,
"currency": "EUR",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 1100,
"customer_id": "StripeCustomer",
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://duck.com",
"payment_method": "gift_card",
"payment_method_type": "givex",
"payment_method_data": {
"gift_card": {
"givex": {
"number": "6364530000000000",
"cvc": "122222"
}
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "PiX"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "PiX"
}
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}'
</details>
<details>
<summary>2. Retrieve and verify in webhooks response as well</summary>
curl --location 'http://localhost:8080/payments/pay_oRcnlCyFw1WVMQkg4fZq?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_p9yMRqUZKavXldvbcW8w0GfzR1ynBE2ORUu4FPY3rU82G8OFBx2XOq6ty71UrBIN'
Response
{
"payment_id": "pay_oRcnlCyFw1WVMQkg4fZq",
"merchant_id": "postman_merchant_GHAction_011d2d37-e13d-4b83-a896-816c4d097d18",
"status": "succeeded",
"amount": 1100,
"net_amount": 1100,
"amount_capturable": 0,
"amount_received": 1100,
"connector": "adyen",
"client_secret": "pay_oRcnlCyFw1WVMQkg4fZq_secret_NEFqOOcfDZyWNd5BXExn",
"created": "2024-08-26T06:08:24.376Z",
"currency": "EUR",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "gift_card",
"payment_method_data": {
"gift_card": {
"givex": {
"last4": "0000"
}
},
"billing": null
},
"payment_token": null,
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "PiX",
"last_name": null
},
"phone": null,
"email": null
},
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "PiX",
"last_name": null
},
"phone": null,
"email": null
},
"order_details": null,
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://duck.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "givex",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": false,
"connector_transaction_id": "F7S9XBDCFJK94875",
"frm_message": null,
"metadata": {
"udf1": "value1",
"login_date": "2019-09-10T10:11:12Z",
"new_customer": "true"
},
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pay_oRcnlCyFw1WVMQkg4fZq_1",
"payment_link": null,
"profile_id": "pro_gsiLSYq37GwBEhz0ev26",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_xR9f8EBOdN45KgAkTCLx",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-08-26T06:23:24.376Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2024-08-26T06:08:25.813Z",
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": null
}


</details>
<details>
<summary>3. Bank Debit - ACH</summary>
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_JCI3dRg06RjMyOrBDO81euxfOykGXlA9zgW4Cf2iXGy2xwexsY6GOSH5sI41GugN' \
--data-raw '{
"amount": 10000,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "StripeCustomer",
"email": "abcdef123@gmail.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"authentication_type": "three_ds",
"return_url": "https://duck.com",
"setup_future_usage": "on_session",
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "127.0.0.1",
"user_agent": "amet irure esse"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US"
}
},
"browser_info": {
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "127.0.0.1"
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "John",
"last_name": "Doe"
}
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"payment_method": "bank_debit",
"payment_method_type": "ach",
"payment_method_data": {
"bank_debit": {
"ach_bank_debit": {
"account_number": "40308669",
"routing_number": "121000358",
"sort_code": "560036",
"shopper_email": "example@gmail.com",
"card_holder_name": "joseph Doe",
"bank_account_holder_name": "David Archer",
"billing_details": {
"houseNumberOrName": "50",
"street": "Test Street",
"city": "Amsterdam",
"stateOrProvince": "NY",
"postalCode": "12010",
"country": "US",
"name": "A. Klaassen",
"email": "example@gmail.com"
},
"reference": "daslvcgbaieh"
}
}
}
}'
</details>
<details>
<summary>4. Retrieve txn details</summary>
curl --location 'http://localhost:8080/payments/pay_yyhXMuPPvXTjFYbFM4sS?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_p9yMRqUZKavXldvbcW8w0GfzR1ynBE2ORUu4FPY3rU82G8OFBx2XOq6ty71UrBIN'
Response
{
"payment_id": "pay_yyhXMuPPvXTjFYbFM4sS",
"merchant_id": "postman_merchant_GHAction_011d2d37-e13d-4b83-a896-816c4d097d18",
"status": "succeeded",
"amount": 10000,
"net_amount": 10000,
"amount_capturable": 0,
"amount_received": 10000,
"connector": "adyen",
"client_secret": "pay_yyhXMuPPvXTjFYbFM4sS_secret_8dripBlpBRYSlLwBD3qi",
"created": "2024-08-26T06:10:37.599Z",
"currency": "USD",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "abcdef123@gmail.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "on_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "bank_debit",
"payment_method_data": {
"bank_debit": {
"ach": {
"account_number": "****8669",
"routing_number": "121***358",
"bank_account_holder_name": null,
"bank_name": null,
"bank_type": null,
"bank_holder_type": null
}
},
"billing": null
},
"payment_token": null,
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "John",
"last_name": "Doe"
},
"phone": null,
"email": null
},
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": null,
"last_name": null
},
"phone": null,
"email": null
},
"order_details": null,
"email": "abcdef123@gmail.com",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://duck.com/",
"authentication_type": "three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "ach",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": false,
"connector_transaction_id": "L53M262VC5XBZX65",
"frm_message": null,
"metadata": {
"udf1": "value1",
"login_date": "2019-09-10T10:11:12Z",
"new_customer": "true"
},
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pay_yyhXMuPPvXTjFYbFM4sS_1",
"payment_link": null,
"profile_id": "pro_gsiLSYq37GwBEhz0ev26",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_xR9f8EBOdN45KgAkTCLx",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-08-26T06:25:37.599Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_method_id": "pm_iBk2oopRt92TdFdZdLCH",
"payment_method_status": "active",
"updated": "2024-08-26T06:10:40.328Z",
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": null
}


</details>
<details>
<summary>5. Bank Debit - Bacs</summary>
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_JCI3dRg06RjMyOrBDO81euxfOykGXlA9zgW4Cf2iXGy2xwexsY6GOSH5sI41GugN' \
--data-raw '{
"amount": 10000,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "StripeCustomer",
"email": "abcdef123@gmail.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"authentication_type": "three_ds",
"return_url": "https://duck.com",
"setup_future_usage": "on_session",
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "127.0.0.1",
"user_agent": "amet irure esse"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US"
}
},
"browser_info": {
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "127.0.0.1"
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "John",
"last_name": "Doe"
}
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"payment_method": "bank_debit",
"payment_method_type": "ach",
"payment_method_data": {
"bank_debit": {
"ach_bank_debit": {
"account_number": "40308669",
"routing_number": "121000358",
"sort_code": "560036",
"shopper_email": "example@gmail.com",
"card_holder_name": "joseph Doe",
"bank_account_holder_name": "David Archer",
"billing_details": {
"houseNumberOrName": "50",
"street": "Test Street",
"city": "Amsterdam",
"stateOrProvince": "NY",
"postalCode": "12010",
"country": "US",
"name": "A. Klaassen",
"email": "example@gmail.com"
},
"reference": "daslvcgbaieh"
}
}
}
}'
</details>
<details>
<summary>6. Retrieve txn details</summary>
curl --location 'http://localhost:8080/payments/pay_alnXBCvp6f9jl6ZqWo1e?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_p9yMRqUZKavXldvbcW8w0GfzR1ynBE2ORUu4FPY3rU82G8OFBx2XOq6ty71UrBIN'
Response
{
"payment_id": "pay_alnXBCvp6f9jl6ZqWo1e",
"merchant_id": "postman_merchant_GHAction_011d2d37-e13d-4b83-a896-816c4d097d18",
"status": "processing",
"amount": 100,
"net_amount": 100,
"amount_capturable": 0,
"amount_received": null,
"connector": "adyen",
"client_secret": "pay_alnXBCvp6f9jl6ZqWo1e_secret_dwQNXM4uPcs7PNeyxPnN",
"created": "2024-08-26T06:11:42.510Z",
"currency": "GBP",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "abcdef123@gmail.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "on_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "bank_debit",
"payment_method_data": {
"bank_debit": {
"bacs": {
"account_number": "****8669",
"sort_code": "56**36",
"bank_account_holder_name": null
}
},
"billing": null
},
"payment_token": null,
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "John",
"last_name": "Doe"
},
"phone": null,
"email": null
},
"billing": {
"address": {
"city": "San Fransico",
"country": "GB",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": null,
"last_name": null
},
"phone": null,
"email": null
},
"order_details": null,
"email": "abcdef123@gmail.com",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://duck.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "bacs",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": false,
"connector_transaction_id": "FWJ6KDDCFJK94875",
"frm_message": null,
"metadata": {
"udf1": "value1",
"login_date": "2019-09-10T10:11:12Z",
"new_customer": "true"
},
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pay_alnXBCvp6f9jl6ZqWo1e_1",
"payment_link": null,
"profile_id": "pro_gsiLSYq37GwBEhz0ev26",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_xR9f8EBOdN45KgAkTCLx",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-08-26T06:26:42.510Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_method_id": "pm_FWrcMK5kATtjyw9i0hqP",
"payment_method_status": "inactive",
"updated": "2024-08-26T06:11:48.748Z",
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": null
}

</details>
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
| <think>
PR Context:
- Title: feat: populate payment method details in payments response
- Merged: 2024-09-04T15:26:16Z
- Files changed: 10 files
- Commits: 1 commits
Implementation approach:
(cherry picked from commit c84af20ec1d9c5aba3ab0e290760a40328b9bf8e)
## Description
Reverts the changes in merge commit of PR #5661 for creating a hotfix
(https://github.com/juspay/hyperswitch/pull/5785)
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifi
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat: populate payment method details in payments response (#5790)
Co-authored-by: Sampras Lopes <Sa
Files to modify:
**crates/api_models/src/payments.rs**
Remove:
- mod: pub::additional_info
**crates/api_models/src/payments/additional_info.rs**
Remove:
- struct: pub::AchBankDebitAdditionalData
- struct: pub::BacsBankDebitAdditionalData
- struct: pub::BecsBankDebitAdditionalData
- struct: pub::SepaBankDebitAdditionalData
- struct: pub::BankRedirectAdditionalData
- struct: pub::BancontactBankRedirectAdditionalData
- struct: pub::BlikBankRedirectAdditionalData
- struct: pub::GiropayBankRedirectAdditionalData
- struct: pub::PixBankTransferAdditionalData
- struct: pub::LocalBankTransferAdditionalData
- struct: pub::GivexGiftCardAdditionalData
- struct: pub::CardTokenAdditionalData
- struct: pub::UpiCollectAdditionalData
- enum: pub::BankDebitAdditionalData
- enum: pub::BankRedirectDetails
- enum: pub::BankTransferAdditionalData
- enum: pub::GiftCardAdditionalData
- enum: pub::UpiAdditionalData
**crates/hyperswitch_domain_models/src/payment_method_data.rs**
Remove:
- function: private::from
- function: private::from
- function: private::from
- function: private::from
- function: private::from
- function: private::from
- function: private::from
- function: private::from
- function: private::from
- function: private::from
- function: private::from
- function: private::from
- function: private::from
- function: private::from
- impl: impl From<CardRedirectData> for api_models::payments::CardRedirectData
- impl: impl From<CryptoData> for api_models::payments::CryptoData
- impl: impl From<UpiData> for api_models::payments::additional_info::UpiAdditionalData
- impl: impl From<Box<BoletoVoucherData>> for Box<api_models::payments::BoletoVoucherData>
- impl: impl From<Box<AlfamartVoucherData>> for Box<api_models::payments::AlfamartVoucherData>
- impl: impl From<Box<IndomaretVoucherData>> for Box<api_models::payments::IndomaretVoucherData>
- impl: impl From<Box<JCSVoucherData>> for Box<api_models::payments::JCSVoucherData>
- impl: impl From<VoucherData> for api_models::payments::VoucherData
- impl: impl From<GiftCardData> for payment_additional_types::GiftCardAdditionalData
- impl: impl From<CardToken> for payment_additional_types::CardTokenAdditionalData
- impl: impl From<BankDebitData> for api_models::payments::additional_info::BankDebitAdditionalData
- impl: impl From<BankTransferData> for api_models::payments::additional_info::BankTransferAdditionalData
- impl: impl From<RealTimePaymentData> for api_models::payments::RealTimePaymentData
- impl: impl From<OpenBankingData> for api_models::payments::OpenBankingData
**crates/masking/src/lib.rs**
Remove:
- mod: pub::masked_string
**crates/masking/src/masked_string.rs**
Remove:
- function: private::apply_mask
- function: private::from
- function: private::from
- function: private::from
- function: private::from
- struct: pub::MaskedSortCode
- struct: pub::MaskedRoutingNumber
- struct: pub::MaskedBankAccount
- struct: pub::MaskedIban
- impl: impl SerializableSecret for MaskedSortCode
- impl: impl From<String> for MaskedSortCode
- impl: impl SerializableSecret for MaskedRoutingNumber
- impl: impl From<String> for MaskedRoutingNumber
- impl: impl SerializableSecret for MaskedBankAccount
- impl: impl From<String> for MaskedBankAccount
- impl: impl SerializableSecret for MaskedIban
- impl: impl From<String> for MaskedIban
**crates/openapi/src/openapi.rs**
Modify existing code
**crates/openapi/src/openapi_v2.rs**
Modify existing code
**crates/router/src/core/payments/helpers.rs**
Modify existing code | {"issue_number": 5661, "pr_number": 5790, "commits_count": 1, "files_changed": 10, "response_length": 4669, "file_count": 10, "needs_breakdown": true} |
[Analytics/Payouts] - add kafka events and clickhouse schema for payout analytics
add kafka events and clickhouse schema for payout analytics | <think>
PR Context:
- Title: feat(payout-events): add kafka events for payout analytics
- Merged: 2024-04-04T07:39:29Z
- Files changed: 9 files
- Commits: 15 commits
Implementation approach:
## Description
add kafka events and clickhouse schema for payout analytics
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat(payout-events): add kafka events for payout analytics (#4211)
Co-authored-by: hyperswitch-bot[b
Files to modify:
**crates/router/src/db/kafka_store.rs**
Modify existing code
**crates/router/src/events.rs**
Modify existing code
**crates/router/src/services/kafka.rs**
Add:
- function: pub::log_payout
- function: pub::log_payout_delete
- mod: private::payout
**crates/router/src/services/kafka/payout.rs**
Add:
- function: pub::from_storage
- function: private::key
- function: private::creation_timestamp
- function: private::event_type
- struct: pub::KafkaPayout
- impl: impl KafkaPayout<'a>
- impl: impl super::KafkaMessage for KafkaPayout<'a> | {"issue_number": 4210, "pr_number": 4211, "commits_count": 1, "files_changed": 9, "response_length": 1495, "file_count": 6, "needs_breakdown": false} |
fix(diesel_models, api_models): mask `poc_email` and `data_value` for DashboardMetadata
## Current behaviour
- `poc_email` isn't masked for `DashboardMetadata` which leads to it being logged both at API and diesel query level.
Example:
<img width="1114" alt="Image" src="https://github.com/user-attachments/assets/8aa98114-b492-40bf-bddf-68323f86ffc0" />
## Proposed Changes
- (api_models): change the `poc_email` type to `Secret<String>`
- Add some `pii::Email` validation to check for input validity
- (diesel_models): change `data_value` to `Secret<serde_json::Value>` | <think>
PR Context:
- Title: fix(dashboard_metadata): mask `poc_email` and `data_value` for DashboardMetadata
- Merged: 2025-02-06T15:16:20Z
- Files changed: 5 files
- Commits: 8 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
- (api_models): change the `poc_email` type to `Secret<String>`
- Add some `pii::Email` validation to check for input validity
- (diesel_models): change `data_value` to `Secret<serde_json::Value>`
## Fixes #7128
### Additional Change
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** fix(dashboard_metadata): mask `poc_email` and `data_value` for DashboardMetadata (#7130)
Files to modify:
**crates/api_models/src/user/dashboard_metadata.rs**
Modify existing code
**crates/diesel_models/src/user/dashboard_metadata.rs**
Modify existing code
**crates/router/src/core/user/dashboard_metadata.rs**
Modify existing code
**crates/router/src/services/email/types.rs**
Modify existing code
**crates/router/src/utils/user/dashboard_metadata.rs**
Modify existing code | {"issue_number": 7128, "pr_number": 7130, "commits_count": 1, "files_changed": 5, "response_length": 1303, "file_count": 7, "needs_breakdown": false} |
feat(roles): New roles for profile level
Create new roles for profile level roles.
- profile_admin
- profile_view_only
- profile_operator
- profile_developer
- profile_iam | <think>
PR Context:
- Title: feat(users): New profile level roles
- Merged: 2024-09-10T12:49:59Z
- Files changed: 9 files
- Commits: 7 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
- Make merchant account create profile level.
- Create new roles for profile users.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configura
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat(users): New profile level roles (#5843)
Co-authored-by: hyperswitch-bot[bot] <148525504+hypersw
Files to modify:
**crates/router/src/analytics.rs**
Modify existing code
**crates/router/src/consts/user_role.rs**
Modify existing code
**crates/router/src/core/admin.rs**
Modify existing code
**crates/router/src/routes/admin.rs**
Modify existing code
**crates/router/src/routes/payment_methods.rs**
Modify existing code
**crates/router/src/routes/routing.rs**
Modify existing code
**crates/router/src/routes/user.rs**
Modify existing code
**crates/router/src/routes/user_role.rs**
Modify existing code
**crates/router/src/services/authorization/roles/predefined_roles.rs**
Modify existing code | {"issue_number": 5842, "pr_number": 5843, "commits_count": 1, "files_changed": 9, "response_length": 1492, "file_count": 11, "needs_breakdown": false} |
feat(connector): [Adyen] Add pix support for adyen
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] New feature
## Description
<!-- Describe your changes in detail -->
Add support for `Pix` bank transfer through adyen
Api contract for `Pix`:
```
"payment_method": "bank_transfer",
"payment_method_type": "pix",
"payment_method_data": {
"bank_transfer": {
"pix": {}
}
}
```
Pix sends `QrCode` data along with `Qr url`, QrCode data is converted into image data source is sent in next action.
Response that SDK can use :
```
"next_action": {
"type": "qr_code_information",
"image_data_url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQgAAAEICAAAAACGnTUjAAADfUlEQVR4nO3QS25dOQwA0c7+F90foGpCgKCeE3cGqQN4QEq6fqgff/+V/xQChUAhUAgUAoVAIVAIFAKFQCFQCBQChUAhUAgUAoVAIVAIFAKFQCFQCBQChUAhUAgUAoVAIXCG+PHv31f4Xd87y708n3td5xffbwqBQqAQKAQKgUKgEHgOcd3Tdn/uneV+8p7nc7683i8ECoFCoBAoBAqBQuDjEM7TPHee5vmc9bp3nua586YQKAQKgUKgECgECoFvD+G88d4033nP/Zynee68KQQKgUKgECgECoFC4H8PMffOcj95z/M5T/PceVMIFAKFQCFQCBQChcDHIS7zvvPF+5PvPZ/z5fV+IVAIFAKFQCFQCBQCzyE+5Xd9/6vnT/l+UwgUAoVAIVAIFAKFwBniZ/nD/T/bLPfyfO5/tUKgECgECoFCoBAoBM4Q1w+Z584b72ne99z9nC/el+/mfioECoFCoBAoBAqBQuAMcfEfye/Nva7zje8mvzPPt/2mECgECoFCoBAoBAqBj0P4Dya/4/mcde3l+dx/l0KgECgECoFCoBAoBM4Q/qCN773nrGsvz907b7Z72/5SCBQChUAhUAgUAoXAcwjvOV+8r/nuOpf3vnou720KgUKgECgECoFCoBB4DqHtvvc832bNvbPcy3P3c5b7TxUChUAhUAgUAoVAIXCG2PgD5vvXvfMr3+l6P+9fCoFCoBAoBAqBQqAQ+HIIzR80v+f5tb/myXN5b9tfCoFCoBAoBAqBQqAQOEPMD2t7N+/Pe567d5Z7zfOL7+c795tCoBAoBAqBQqAQKATOED/LH3T9H+9ttve+m+fuNc+nQqAQKAQKgUKgECgEzhDzg6/8ru+dX/lOvnf/Or8qBAqBQqAQKAQKgULgOcR1T9v91/01T/PcefJ8UwgUAoVAIVAIFAKFwMchnKd5fs36dH/xnXw/91MhUAgUAoVAIVAIFALfHkLu5bl758nzzeu77Z4KgUKgECgECoFCoBD4bSEuvp/v5v51vhQChUAhUAgUAoVAIfBxiMvr/Xlvzpp752k7d38pBAqBQqAQKAQKgULgOcSn/K7vr1lzP+eN9zTvz/OpECgECoFCoBAoBAqBM8SfohAoBAqBQqAQKAQKgUKgECgECoFCoBAoBAqBQqAQKAQKgUKgECgECoFCoBAoBAqBQqAQKAQKgX8A/Ak4Wyhn58sAAAAASUVORK5CYII=",
"qr_code_url": "https://test.adyen.com/hpp/generateQRCodeImage.shtml?url=TestQRCodeEMVToken"
},
```
### Additional Changes
- [x] This PR modifies the API contract
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless its an obvious bug or documentation fix
that will have little conversation).
-->
Add support for new bank transfers
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
<img width="1255" alt="Screen Shot 2023-07-13 at 2 28 41 PM" src="https://github.com/juspay/hyperswitch/assets/59434228/2ba2d584-ff19-4f7e-91cb-47596efd3a91">
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed submitted code
| <think>
PR Context:
- Title: revert: feat(connector): [Adyen] Add pix support for adyen
- Merged: 2023-07-26T15:53:33Z
- Files changed: 10 files
- Commits: 1 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
This reverts commit 33a1368e8a0961610d652f5a6834ba37b995582a. (PR #1703)
Revert pix
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What probl
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** revert: feat(connector): [Adyen] Add pix support for adyen (#1795)
Files to modify:
**crates/api_models/src/payments.rs**
Modify existing code
**crates/common_enums/src/enums.rs**
Modify existing code
**crates/common_enums/src/transformers.rs**
Modify existing code
**crates/router/src/compatibility/stripe/payment_intents/types.rs**
Modify existing code
**crates/router/src/compatibility/stripe/setup_intents/types.rs**
Modify existing code
**crates/router/src/connector/adyen/transformers.rs**
Remove:
- function: private::try_from
- function: private::try_from
- struct: pub::AdyenNextActionResponse
- impl: impl TryFrom<(
&types::PaymentsAuthorizeRouterData,
&api_models::payments::BankTransferData,
)> for AdyenPaymentRequest<'a>
Add:
- struct: pub::RedirectionResponse
- struct: pub::MobilePayData
- struct: pub::WalleyData
- struct: pub::PayBrightData
- struct: pub::BankRedirectionPMData
- struct: pub::AdyenPaypal
- struct: pub::AliPayData
- struct: pub::AliPayHkData
- struct: pub::DanaWalletData
- struct: pub::TwintWalletData
- struct: pub::VippsWalletData
- struct: pub::AtomeData
- struct: pub::AdyenPayLaterData
**crates/router/src/connector/stripe/transformers.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
**crates/router/src/types/transformers.rs**
Modify existing code | {"issue_number": 1703, "pr_number": 1795, "commits_count": 1, "files_changed": 10, "response_length": 2250, "file_count": 11, "needs_breakdown": false} |
[BUG - Cypress] Cookie not passed in user APIs
we need to pass cookies in user apis | <think>
PR Context:
- Title: fix(cypress): backup and restore sessions when using user apis
- Merged: 2025-01-08T11:43:26Z
- Files changed: 5 files
- Commits: 4 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
this pr fixes the issue where cookies are not being set when hitting user apis.
- we need to set cookies. but cypress does not directly support that
- `cy.setCookie()` method does not persist outside of the `it()` block
- in order to m
</think>
To implement this, you'll need to modify:
(No detailed commit information available) | {"issue_number": 6977, "pr_number": 6978, "commits_count": 0, "files_changed": 5, "response_length": 792, "file_count": 0, "needs_breakdown": false} |
fix(list): remove enabled payment methods from list customer payment …
…method
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
## Description
Removes the enabled payment method field from list_customer_payment_method. This is an extension to the PR raised by @Narayanbhat166
<!-- Describe your changes in detail -->
### Additional Changes
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless its an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed submitted code
- [ ] I added unit tests for my changes where possible
- [ ] I added a [CHANGELOG](/CHANGELOG.md) entry if applicable
| <think>
PR Context:
- Title: feat(list): global filter mapping for payment methods via card network
- Merged: 2023-03-01T11:31:41Z
- Files changed: 4 files
- Commits: 4 commits
Implementation approach:
## Description
In an earlier PR #689, we added a global filter mapping for `<connector>.<payment_method_type>`, but according to the new requirements, the various card networks will also have the similar filters. This PR addes support for `<connector>.<card_network>` in the configuration. @bernard-eugine is compiling the list for th
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat(list): global filter mapping for payment methods via card network (#694)
Files to modify:
**crates/router/src/configs/settings.rs**
Remove:
- struct: pub::PaymentMethodFilters
Add:
- struct: pub::PaymentMethodFilters
- enum: pub::PaymentMethodFilterKey
**crates/router/src/core/payment_methods/cards.rs**
Modify existing code | {"issue_number": 689, "pr_number": 694, "commits_count": 1, "files_changed": 4, "response_length": 1154, "file_count": 4, "needs_breakdown": false} |
chore(masking): add peek_mut to PeekInterface
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Enhancement
## Description
<!-- Describe your changes in detail -->
Add `peek_mut` function to PeekInterface to get mutable reference for the inner data.
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
To get the mutable reference for inner data in StrongSecret.
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
** THIS CANNOT BE TESTED IN ENVIRONMENTS **
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code | <think>
PR Context:
- Title: Feat(connector): [JP MORGAN] Added Template code for cards integration
- Merged: 2024-11-05T15:51:59Z
- Files changed: 25 files
- Commits: 2 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
Template code added for new connector JP Morgan
https://developer.payments.jpmorgan.com/docs/commerce/online-payments/capabilities/online-payments/payment-methods/cards
### Additional Changes
- [ ] This PR modifies the API contract
-
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** Feat(connector): [JP MORGAN] Added Template code for cards integration (#6467)
Co-authored-by: Sayak
Files to modify:
**crates/api_models/src/connector_enums.rs**
Modify existing code
**crates/common_enums/src/connector_enums.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors.rs**
Add:
- mod: pub::jpmorgan
**crates/hyperswitch_connectors/src/connectors/jpmorgan.rs**
Add:
- function: pub::new
- function: private::build_headers
- function: private::id
- function: private::get_currency_unit
- function: private::common_get_content_type
- function: private::base_url
- function: private::get_auth_header
- function: private::build_error_response
- function: private::get_headers
- function: private::get_content_type
- function: private::get_url
- function: private::get_request_body
- function: private::build_request
- function: private::handle_response
- function: private::get_error_response
- function: private::get_headers
- function: private::get_content_type
- function: private::get_url
- function: private::build_request
- function: private::handle_response
- function: private::get_error_response
- function: private::get_headers
- function: private::get_content_type
- function: private::get_url
- function: private::get_request_body
- function: private::build_request
- function: private::handle_response
- function: private::get_error_response
- function: private::get_headers
- function: private::get_content_type
- function: private::get_url
- function: private::get_request_body
- function: private::build_request
- function: private::handle_response
- function: private::get_error_response
- function: private::get_headers
- function: private::get_content_type
- function: private::get_url
- function: private::build_request
- function: private::handle_response
- function: private::get_error_response
- function: private::get_webhook_object_reference_id
- function: private::get_webhook_event_type
- function: private::get_webhook_resource_object
- struct: pub::Jpmorgan
- impl: impl Jpmorgan
- impl: impl api::Payment for Jpmorgan
- impl: impl api::PaymentSession for Jpmorgan
- impl: impl api::ConnectorAccessToken for Jpmorgan
- impl: impl api::MandateSetup for Jpmorgan
- impl: impl api::PaymentAuthorize for Jpmorgan
- impl: impl api::PaymentSync for Jpmorgan
- impl: impl api::PaymentCapture for Jpmorgan
- impl: impl api::PaymentVoid for Jpmorgan
- impl: impl api::Refund for Jpmorgan
- impl: impl api::RefundExecute for Jpmorgan
- impl: impl api::RefundSync for Jpmorgan
- impl: impl api::PaymentToken for Jpmorgan
- impl: impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData> for Jpmorgan
- impl: impl ConnectorCommonExt<Flow, Request, Response> for Jpmorgan
- impl: impl ConnectorCommon for Jpmorgan
- impl: impl ConnectorValidation for Jpmorgan
- impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Jpmorgan
- impl: impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for Jpmorgan
- impl: impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Jpmorgan
- impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Jpmorgan
- impl: impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Jpmorgan
- impl: impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for Jpmorgan
- impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Jpmorgan
- impl: impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Jpmorgan
- impl: impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Jpmorgan
- impl: impl webhooks::IncomingWebhook for Jpmorgan
- mod: pub::transformers
**crates/hyperswitch_connectors/src/connectors/jpmorgan/transformers.rs**
Add:
- function: private::from
- function: private::try_from
- function: private::try_from
- function: private::from
- function: private::try_from
- function: private::try_from
- function: private::from
- function: private::try_from
- function: private::try_from
- struct: pub::JpmorganRouterData
- struct: pub::JpmorganPaymentsRequest
- struct: pub::JpmorganCard
- struct: pub::JpmorganAuthType
- struct: pub::JpmorganPaymentsResponse
- struct: pub::JpmorganRefundRequest
- struct: pub::RefundResponse
- struct: pub::JpmorganErrorResponse
- enum: pub::JpmorganPaymentStatus
- enum: pub::RefundStatus
- impl: impl From<(StringMinorUnit, T)> for JpmorganRouterData<T>
- impl: impl TryFrom<&JpmorganRouterData<&PaymentsAuthorizeRouterData>> for JpmorganPaymentsRequest
- impl: impl TryFrom<&ConnectorAuthType> for JpmorganAuthType
- impl: impl From<JpmorganPaymentStatus> for common_enums::AttemptStatus
- impl: impl TryFrom<ResponseRouterData<F, JpmorganPaymentsResponse, T, PaymentsResponseData>> for RouterData<F, T, PaymentsResponseData>
- impl: impl TryFrom<&JpmorganRouterData<&RefundsRouterData<F>>> for JpmorganRefundRequest
- impl: impl From<RefundStatus> for enums::RefundStatus
- impl: impl TryFrom<RefundsResponseRouterData<Execute, RefundResponse>> for RefundsRouterData<Execute>
- impl: impl TryFrom<RefundsResponseRouterData<RSync, RefundResponse>> for RefundsRouterData<RSync>
**crates/hyperswitch_connectors/src/default_implementations.rs**
Modify existing code
**crates/hyperswitch_connectors/src/default_implementations_v2.rs**
Modify existing code
**crates/hyperswitch_interfaces/src/configs.rs**
Modify existing code
**crates/router/src/connector.rs**
Modify existing code
**crates/router/src/core/payments/connector_integration_v2_impls.rs**
Modify existing code
**crates/router/src/core/payments/flows.rs**
Modify existing code
**crates/router/src/types/api.rs**
Modify existing code
**crates/router/src/types/transformers.rs**
Modify existing code
**crates/router/tests/connectors/jpmorgan.rs**
Add:
- function: private::new
- function: private::get_data
- function: private::get_auth_token
- function: private::get_name
- function: private::get_default_payment_info
- function: private::payment_method_details
- function: private::should_only_authorize_payment
- function: private::should_capture_authorized_payment
- function: private::should_partially_capture_authorized_payment
- function: private::should_sync_authorized_payment
- function: private::should_void_authorized_payment
- function: private::should_refund_manually_captured_payment
- function: private::should_partially_refund_manually_captured_payment
- function: private::should_sync_manually_captured_refund
- function: private::should_make_payment
- function: private::should_sync_auto_captured_payment
- function: private::should_refund_auto_captured_payment
- function: private::should_partially_refund_succeeded_payment
- function: private::should_refund_succeeded_payment_multiple_times
- function: private::should_sync_refund
- function: private::should_fail_payment_for_incorrect_cvc
- function: private::should_fail_payment_for_invalid_exp_month
- function: private::should_fail_payment_for_incorrect_expiry_year
- function: private::should_fail_void_payment_for_auto_capture
- function: private::should_fail_capture_for_invalid_payment
- function: private::should_fail_for_refund_amount_higher_than_payment_amount
- struct: private::JpmorganTest
- impl: impl JpmorganTest
- impl: impl ConnectorActions for JpmorganTest
- impl: impl utils::Connector for JpmorganTest
**crates/router/tests/connectors/main.rs**
Add:
- mod: private::jpmorgan
**crates/test_utils/src/connector_auth.rs**
Modify existing code | {"issue_number": 7281, "pr_number": 6467, "commits_count": 1, "files_changed": 25, "response_length": 8958, "file_count": 18, "needs_breakdown": true} |
bug(events): api events with event_type `user` aren't parsed correctly in clickhouse
The api events with events type user aren't parsed correctly in the user table,
this happens due to there being duplicate keys in the json representation which is treated as invalid json by clickhouse
```json
{
"key_a": "abc",
"key_b": "def",
"key_b": "ghi"
}
```
This is treated as invalid json and the entire event is dropped by clickhouse,
in this case we have
```rs
pub enum ApiEventsType {
.........
User {
merchant_id: String, // This merchant_id field ends up being duplicate and causes invalid json
user_id: String,
},
......
}
```
for now we can remove the merchant_id from this enum variant to solve this issue
| <think>
PR Context:
- Title: fix(events): Correct parsing of API events with user event_type for Clickhouse
- Merged: 2024-06-19T11:15:06Z
- Files changed: 3 files
- Commits: 2 commits
Implementation approach:
## Description
fix(events): Correct parsing of API events with user event_type for ClickHouse (#4987)
- Removed redundant `merchant_id` to handle user events correctly in ClickHouse.
- Updated Docker Compose to display times in IST timezone for ClickHouse.
### Additional Changes
- [ ] Th
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** fix(events): Correct parsing of API events with user event_type for Clickhouse (#5022)
Files to modify:
**crates/api_models/src/events/user.rs**
Modify existing code
**crates/common_utils/src/events.rs**
Modify existing code | {"issue_number": 4987, "pr_number": 5022, "commits_count": 1, "files_changed": 3, "response_length": 1042, "file_count": 4, "needs_breakdown": false} |
feat(users): Force users to reset password on first login for non-email flow
Currently in non-email flow, users who are invited are not forced to change their password.
This is being forced in email flow, this should also be present in non-email flow as well. | <think>
PR Context:
- Title: fix(users): Add force rotate password on first login for non-email flow
- Merged: 2024-11-07T10:37:29Z
- Files changed: 1 files
- Commits: 3 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
Currently in non-email flow, users who are invited are not forced to change their password. This PR will add that.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** fix(users): Add force rotate password on first login for non-email flow (#6483)
Files to modify:
**crates/router/src/types/domain/user.rs**
Add:
- function: private::deref
- struct: pub::NewUserPassword
- impl: impl Deref for NewUserPassword | {"issue_number": 6482, "pr_number": 6483, "commits_count": 1, "files_changed": 1, "response_length": 1061, "file_count": 3, "needs_breakdown": false} |
feat(mandates): recurring payment support for bank redirect and bank debit payment method for stripe
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [X] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
* Added support for bank debit recurring payment.
* Stored payment method data for bank debit in the mandate table's metadata column.
* Made changes in structure of stripes `PaymentIntentRequest` fields to support the new requirement
I have merged https://github.com/juspay/hyperswitch/pull/1231 to this branch since the changes were interdependent.
So merging this branch would automatically add features of https://github.com/juspay/hyperswitch/pull/1231
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless its an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed submitted code
- [ ] I added unit tests for my changes where possible
- [ ] I added a [CHANGELOG](/CHANGELOG.md) entry if applicable
| <think>
PR Context:
- Title: fix(connector): stripe mandate failure and other ui tests failures
- Merged: 2023-07-19T14:57:33Z
- Files changed: 7 files
- Commits: 17 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
1. Fix existing failures in UI tests of existing connectors
2. Stripe requires us to send a field called `payment_method_types[]` with all payment payment_intents. This is a list of all supported payment_method_types for that payment intent.
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** fix(connector): stripe mandate failure and other ui tests failures (#1742)
Signed-off-by: chikke sru
Files to modify:
**crates/router/src/connector/stripe/transformers.rs**
Modify existing code
**crates/router/tests/connectors/authorizedotnet_ui.rs**
Modify existing code
**crates/router/tests/connectors/mollie_ui.rs**
Modify existing code
**crates/router/tests/connectors/selenium.rs**
Add:
- function: private::retry_click
**crates/router/tests/connectors/worldline_ui.rs**
Modify existing code | {"issue_number": 1119, "pr_number": 1742, "commits_count": 1, "files_changed": 7, "response_length": 1317, "file_count": 7, "needs_breakdown": false} |
feat(router): add support for co-badged cards
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
In this PR, we ensure that the `card_network`, passed in payment create request is only consumed by hyperswitch when it is a co-badged card. This Pr also extend support for cobadged card in Stripe, Cybersource, Bank of America and Adyen.
Co-badged card through these connectors cannot be tested in sandbox because of the unavailability of test cards
> Note: Co-badged support couldn't be extended to `Cartes Bancaires` becuase of the unavailability of appropriate regex to identify `Cartes Bancaires` cards.
> This PR effects card payment flows of all connectors
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
1. Create a payment with a single network card. This card_network will not be stored in customer table. Check this through the list customer call.
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_b75nmOwRvw5gNyjZAWXdUumMZcMxhZ7l1qjFTsXVeSy5vu4XaRWsyRNHYAKytUv0' \
--data-raw '{
"amount": 6540,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 6540,
"email": "example@example.com",
"customer_id":"tester1t23",
"setup_future_usage": "on_session",
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "13.232.74.226",
"user_agent": "amet irure esse"
}
},
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4111111145551142",
"card_exp_month": "03",
"card_exp_year": "30",
"card_holder_name": "joseph Doe",
"card_cvc": "737"
,"card_network":"Visa"
}
}
,"billing": {
"address": {
"line1": "1467",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "AU",
"first_name": "joseph",
"last_name": "Doe"
},
"email": "example@example.com"
}
}'
```
Response
```
{
"payment_id": "pay_NwW4LYz9iEZkMeuSKXft",
"merchant_id": "postman_merchant_GHAction_8eb204cb-aa8d-483d-b27b-3ef6fc47ab31",
"status": "succeeded",
"amount": 6540,
"net_amount": 6540,
"amount_capturable": 0,
"amount_received": 6540,
"connector": "cybersource",
"client_secret": "pay_NwW4LYz9iEZkMeuSKXft_secret_IreftgKvq0jnG4MldOQc",
"created": "2024-09-05T09:47:49.673Z",
"currency": "USD",
"customer_id": "tester1t23",
"customer": {
"id": "tester1t23",
"name": null,
"email": "example@example.com",
"phone": null,
"phone_country_code": null
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "on_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "1142",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "411111",
"card_extended_bin": null,
"card_exp_month": "03",
"card_exp_year": "30",
"card_holder_name": null,
"payment_checks": {
"avs_response": {
"code": "Y",
"codeRaw": "Y"
},
"card_verification": null
},
"authentication_data": null
},
"billing": null
},
"payment_token": "token_527Zf3zNRip0gxt9QeVf",
"shipping": null,
"billing": {
"address": {
"city": "San Fransico",
"country": "AU",
"line1": "1467",
"line2": null,
"line3": null,
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": null,
"email": "example@example.com"
},
"order_details": null,
"email": "example@example.com",
"name": null,
"phone": null,
"return_url": null,
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "tester1t23",
"created_at": 1725529669,
"expires": 1725533269,
"secret": "epk_760f4ce026c24e519cce4d38c35e888a"
},
"manual_retry_allowed": false,
"connector_transaction_id": "7255296708566381703954",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pay_NwW4LYz9iEZkMeuSKXft_1",
"payment_link": null,
"profile_id": "pro_CSLvpqjADa20jwma38FN",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_NTHtXpk2TQGyNnDOBThk",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-09-05T10:02:49.673Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2024-09-05T09:47:51.480Z",
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": null
}
```
List customers
```
curl --location 'http://localhost:8080/customers/tester1t23/payment_methods' \
--header 'Accept: application/json' \
--header 'api-key: dev_b75nmOwRvw5gNyjZAWXdUumMZcMxhZ7l1qjFTsXVeSy5vu4XaRWsyRNHYAKytUv0'
```
Response
```
{
"customer_payment_methods": [
{
"payment_token": "token_lrX87aNGoBlxpWc2T7zO",
"payment_method_id": "pm_ErZgUBSEjuBeubhuv5bY",
"customer_id": "tester1t23",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_issuer": null,
"payment_method_issuer_code": null,
"recurring_enabled": false,
"installment_payment_enabled": false,
"payment_experience": [
"redirect_to_url"
],
"card": {
"scheme": null,
"issuer_country": null,
"last4_digits": "1142",
"expiry_month": "03",
"expiry_year": "30",
"card_token": null,
"card_holder_name": "joseph Doe",
"card_fingerprint": null,
"nick_name": null,
"card_network": null,
"card_isin": "411111",
"card_issuer": null,
"card_type": null,
"saved_to_locker": true
},
"metadata": null,
"created": "2024-09-05T09:47:51.496Z",
"bank": null,
"surcharge_details": null,
"requires_cvv": true,
"last_used_at": "2024-09-05T09:47:51.496Z",
"default_payment_method_set": false,
"billing": {
"address": {
"city": "San Fransico",
"country": "AU",
"line1": "1467",
"line2": null,
"line3": null,
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": null,
"email": "example@example.com"
}
},
{
"payment_token": "token_Cd9No4xgXqf1XaGdRntl",
"payment_method_id": "pm_fJS1pbXWg2n1HpPjZb1V",
"customer_id": "tester1t23",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_issuer": null,
"payment_method_issuer_code": null,
"recurring_enabled": false,
"installment_payment_enabled": false,
"payment_experience": [
"redirect_to_url"
],
"card": {
"scheme": null,
"issuer_country": null,
"last4_digits": "1142",
"expiry_month": "03",
"expiry_year": "30",
"card_token": null,
"card_holder_name": "joseph Doe",
"card_fingerprint": null,
"nick_name": null,
"card_network": null,
"card_isin": "411111",
"card_issuer": null,
"card_type": null,
"saved_to_locker": true
},
"metadata": null,
"created": "2024-09-05T09:29:57.100Z",
"bank": null,
"surcharge_details": null,
"requires_cvv": true,
"last_used_at": "2024-09-05T09:29:57.100Z",
"default_payment_method_set": true,
"billing": {
"address": {
"city": "San Fransico",
"country": "AU",
"line1": "1467",
"line2": null,
"line3": null,
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": null,
"email": "example@example.com"
}
}
],
"is_guest_customer": null
}
```
> Sanity tests
1. Create a card payment via Stripe
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_kw9cNGnNr6x4TwQqhs13738lsUF5GiLlyVNdlXSRMQ5jWePKrYKphAmylPhXPZZN' \
--data '{
"amount": 6540,
"currency": "EUR",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "tester1t278",
"description": "Its my first payment request",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "03",
"card_exp_year": "30",
"card_holder_name": "joseph Doe",
"card_cvc": "737",
"card_network": "Visa"
}
},
"browser_info": {
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "13.232.74.226"
}
}'
```
Response
```
{
"payment_id": "pay_MhVtzF07XzMjskgO3K48",
"merchant_id": "postman_merchant_GHAction_e1ea4982-6916-4568-8ba2-384271dce76f",
"status": "succeeded",
"amount": 6540,
"net_amount": 6540,
"amount_capturable": 0,
"amount_received": 6540,
"connector": "stripe",
"client_secret": "pay_MhVtzF07XzMjskgO3K48_secret_UyeCOxCP3n9DH5tsOhTa",
"created": "2024-09-24T07:11:09.728Z",
"currency": "EUR",
"customer_id": "tester1t278",
"customer": {
"id": "tester1t278",
"name": null,
"email": null,
"phone": null,
"phone_country_code": null
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "4242",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "424242",
"card_extended_bin": null,
"card_exp_month": "03",
"card_exp_year": "30",
"card_holder_name": null,
"payment_checks": {
"cvc_check": "pass",
"address_line1_check": null,
"address_postal_code_check": null
},
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": null,
"order_details": null,
"email": null,
"name": null,
"phone": null,
"return_url": null,
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "tester1t278",
"created_at": 1727161869,
"expires": 1727165469,
"secret": "epk_738bc10d95474451ada73d2a5c1c6c7f"
},
"manual_retry_allowed": false,
"connector_transaction_id": "pi_3Q2StuCuXDMKrYZe1SjHqUZn",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pi_3Q2StuCuXDMKrYZe1SjHqUZn",
"payment_link": null,
"profile_id": "pro_G2Ec0gzFg9qqxUKCmDf5",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_855y6Cc5rBXQ5aMtxIwb",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-09-24T07:26:09.728Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "13.232.74.226",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_method_id": null,
"payment_method_status": null,
"updated": "2024-09-24T07:11:11.133Z",
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null
}
```
2. Create a card payment via BOA
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_UpqwpvVQKVexKlxgQViaz76X9IMbZdlCrtdHlAhvZNerAs3rlR0Z9ypPeJjfOE5z' \
--data-raw '{
"amount": 6540,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"email": "example@example.com",
"description": "Its my first payment request",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "03",
"card_exp_year": "30",
"card_holder_name": "joseph Doe",
"card_cvc": "737",
"card_network": "Visa"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"city": "San Fransico",
"state": "TX",
"zip": "04386040",
"country": "US",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"country_code": "+91",
"number": "9123456789"
},
"email": "example@example.com"
},
"browser_info": {
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "13.232.74.226"
}
}'
```
Response
```
{
"payment_id": "pay_qjtc1OK58qMBiAZ9TVgT",
"merchant_id": "postman_merchant_GHAction_0bc38971-7710-4f1b-b478-7af7603f2fde",
"status": "succeeded",
"amount": 6540,
"net_amount": 6540,
"amount_capturable": 0,
"amount_received": 6540,
"connector": "bankofamerica",
"client_secret": "pay_qjtc1OK58qMBiAZ9TVgT_secret_QExbdNijWr2IU3H4ip7a",
"created": "2024-09-24T07:18:36.433Z",
"currency": "USD",
"customer_id": null,
"customer": {
"id": null,
"name": null,
"email": "example@example.com",
"phone": null,
"phone_country_code": null
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "4242",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "424242",
"card_extended_bin": null,
"card_exp_month": "03",
"card_exp_year": "30",
"card_holder_name": null,
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": "token_ATckrh5PTQr8pnY5ephU",
"shipping": null,
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": null,
"zip": "04386040",
"state": "TX",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "9123456789",
"country_code": "+91"
},
"email": "example@example.com"
},
"order_details": null,
"email": null,
"name": null,
"phone": null,
"return_url": null,
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": false,
"connector_transaction_id": "7271623167496705304951",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pay_qjtc1OK58qMBiAZ9TVgT_1",
"payment_link": null,
"profile_id": "pro_S0tI3wji4noW5VCziqxj",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_8BPZCSHHcLHJQ4rgb17v",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-09-24T07:33:36.433Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "13.232.74.226",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_method_id": null,
"payment_method_status": null,
"updated": "2024-09-24T07:18:37.240Z",
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null
}
```
3. Create a card payment via Adyen
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_EV9b5ALgWJP4pu37mCOxGxBh0KR07GZWcsSptgIJxPICqfxf9lUj4BAb0dPBRThJ' \
--data-raw '{
"amount": 6540,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"email": "example@example.com",
"description": "Its my first payment request",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "03",
"card_exp_year": "30",
"card_holder_name": "joseph Doe",
"card_cvc": "737",
"card_network": "Visa"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"city": "San Fransico",
"state": "TX",
"zip": "04386040",
"country": "US",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"country_code": "+91",
"number": "9123456789"
},
"email": "example@example.com"
},
"browser_info": {
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "13.232.74.226"
}
}'
```
Response
```
{
"payment_id": "pay_VPuEN2cRkXQIywayzT6j",
"merchant_id": "postman_merchant_GHAction_ce2f6edb-2547-466b-bfdb-7fe8e3e09ad1",
"status": "succeeded",
"amount": 6540,
"net_amount": 6540,
"amount_capturable": 0,
"amount_received": 6540,
"connector": "adyen",
"client_secret": "pay_VPuEN2cRkXQIywayzT6j_secret_AcbxDVG8GNuHlRp9RwWA",
"created": "2024-09-24T07:22:48.464Z",
"currency": "USD",
"customer_id": null,
"customer": {
"id": null,
"name": null,
"email": "example@example.com",
"phone": null,
"phone_country_code": null
},
"description": "Its my first payment request",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "1142",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "411111",
"card_extended_bin": null,
"card_exp_month": "03",
"card_exp_year": "30",
"card_holder_name": null,
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": null,
"zip": "04386040",
"state": "TX",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "9123456789",
"country_code": "+91"
},
"email": "example@example.com"
},
"order_details": null,
"email": null,
"name": null,
"phone": null,
"return_url": null,
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": false,
"connector_transaction_id": "SM4M3FCLZTL4C5V5",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pay_VPuEN2cRkXQIywayzT6j_1",
"payment_link": null,
"profile_id": "pro_kctkBFJh9KZEqgIZidFD",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_jmtGEEW3ksUooINYCTW2",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-09-24T07:37:48.464Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "13.232.74.226",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_method_id": null,
"payment_method_status": null,
"updated": "2024-09-24T07:22:49.231Z",
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null
}
```
4. Create a card payment via Cybersource
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_JWGsvskiOzPI1Xy5hT2CqMsraqhrfSAYE6j0DNdU2XZYubGM9FIyFQjc4REod0Xp' \
--data-raw '{
"amount": 6540,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"email": "example@example.com",
"description": "Its my first payment request",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4111111145551142",
"card_exp_month": "03",
"card_exp_year": "30",
"card_holder_name": "joseph Doe",
"card_cvc": "737",
"card_network": "Visa"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"city": "San Fransico",
"state": "TX",
"zip": "04386040",
"country": "US",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"country_code": "+91",
"number": "9123456789"
},
"email": "example@example.com"
},
"browser_info": {
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "13.232.74.226"
}
}'
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
| <think>
PR Context:
- Title: feat(router): revert support for co-badged cards
- Merged: 2024-09-27T12:33:10Z
- Files changed: 12 files
- Commits: 1 commits
Implementation approach:
Reverts juspay/hyperswitch#5801
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat(router): revert support for co-badged cards (#6142)
Files to modify:
**crates/api_models/src/payments.rs**
Modify existing code
**crates/cards/src/validate.rs**
Remove:
- function: pub::is_cobadged_card
**crates/router/src/connector/adyen/transformers.rs**
Remove:
- function: private::get_adyen_card_network
**crates/router/src/connector/bankofamerica/transformers.rs**
Remove:
- function: private::get_boa_card_type
**crates/router/src/connector/cybersource/transformers.rs**
Modify existing code
**crates/router/src/connector/stripe/transformers.rs**
Remove:
- function: private::get_stripe_card_network
- enum: pub::StripeCardNetwork
**crates/router/src/core/payments/helpers.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_confirm.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_create.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_update.rs**
Modify existing code | {"issue_number": 5801, "pr_number": 6142, "commits_count": 1, "files_changed": 12, "response_length": 1333, "file_count": 12, "needs_breakdown": false} |
feat(router): Add support for network token migration
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Add support for network token migration.
### Additional Changes
- [x] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
test migration api.
req -
```
curl --location 'http://localhost:8080/payment_methods/migrate' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: api-key' \
--data '{
"merchant_id": "merchant_id",
"card": {
"card_number": "card_number",
"card_exp_month": "12",
"card_exp_year": "21",
"card_holder_name": "joseph Doe"
},
"customer_id": "customer_id",
"network_transaction_id": "nt-transaction-id",
"payment_method": "card",
"network_token": {
"network_token_data": {
"network_token_number": "network_token_number",
"network_token_exp_month": "12",
"network_token_exp_year": "21"
},
"network_token_requestor_ref_id": "test-ref-id"
}
}'
```
expected response -
```
{
"payment_method_response": {
"merchant_id": "merchant_1731400520",
"customer_id": "cust-1731400905",
"payment_method_id": "pm_LSk7YuLskFS8aBdWNvzk",
"payment_method": "card",
"payment_method_type": null,
"card": {
"scheme": null,
"issuer_country": null,
"last4_digits": "0000",
"expiry_month": "12",
"expiry_year": "21",
"card_token": null,
"card_holder_name": "joseph Doe",
"card_fingerprint": null,
"nick_name": null,
"card_network": null,
"card_isin": "420000",
"card_issuer": null,
"card_type": null,
"saved_to_locker": true
},
"recurring_enabled": false,
"installment_payment_enabled": false,
"payment_experience": [
"redirect_to_url"
],
"metadata": null,
"created": "2024-11-12T09:00:50.948Z",
"last_used_at": "2024-11-12T09:00:50.949Z",
"client_secret": "pm_LSk7YuLskFS8aBdWNvzk_secret_6B5AfKanyCDhy5hjeUce"
},
"card_migrated": true,
"network_token_migrated": true,
"connector_mandate_details_migrated": null,
"network_transaction_id_migrated": true
}
```
<img width="1148" alt="Screenshot 2024-11-12 at 2 31 12 PM" src="https://github.com/user-attachments/assets/e3661f77-075e-4768-bac1-c2b23e0c12ce">
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
| <think>
PR Context:
- Title: fix(router): validate each field for migration request body
- Merged: 2024-12-06T11:44:36Z
- Files changed: 1 files
- Commits: 15 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
#6300 has inconsistent response due to no validations for each field in migration api request body.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies applic
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** fix(router): validate each field for migration request body (#6525)
Co-authored-by: hyperswitch-bot[
Files to modify:
**crates/router/src/core/payment_methods/cards.rs**
Modify existing code | {"issue_number": 6300, "pr_number": 6525, "commits_count": 1, "files_changed": 1, "response_length": 987, "file_count": 3, "needs_breakdown": false} |
doc: documentation for payment method routes
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Enhancement
## Description
<!-- Describe your changes in detail -->
Written documentation for Payment Method routes
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless its an obvious bug or documentation fix
that will have little conversation).
-->
N/A
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Manual
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed submitted code
| <think>
PR Context:
- Title: build(deps): use utoipa crate upstream URL as git dependency
- Merged: 2023-01-16T09:12:32Z
- Files changed: 5 files
- Commits: 4 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
This PR updates the repository URL for the `utoipa` crate to use the upstream repository URL instead of my fork.
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you do
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** build(deps): use utoipa crate upstream URL as git dependency (#378)
Files to modify:
**crates/api_models/src/admin.rs**
Modify existing code | {"issue_number": 436, "pr_number": 378, "commits_count": 1, "files_changed": 5, "response_length": 937, "file_count": 3, "needs_breakdown": false} |
[REFACTOR] : [Stax] Error Message For Connector Implementation
### :memo: Feature Description
- In terms of errors, we are currently throwing a 'not supported' message, which shouldn't be the case as we are yet to decide on the implementation.
### :hammer: Possible Implementation
- In order to manage payment methods that are not implemented by Hyperswitch or yet to be implemented, the connector transformers file should make use of the NotImplemented ConnectorError enum variant.
- By doing so, we will throw same error message for all the Connector Implementation
- You can check this PR for further reference https://github.com/juspay/hyperswitch/pull/2831
:bookmark: Note: All the changes needed should be contained within `hyperswitch/crates/router/src/connector/`
### :package: Have you spent some time checking if this feature request has been raised before?
- [X] I checked and didn't find a similar issue
### :package: Have you read the Contributing Guidelines?
- [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md)
### :sparkles: Are you willing to submit a PR?
| <think>
PR Context:
- Title: refactor(connector): [Stax] change error message from NotSupported to NotImplemented
- Merged: 2023-11-29T18:27:28Z
- Files changed: 1 files
- Commits: 2 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding ch
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** refactor(connector): [Stax] change error message from NotSupported to NotImplemented (#2879)
Files to modify:
**crates/router/src/connector/stax/transformers.rs**
Modify existing code | {"issue_number": 2862, "pr_number": 2879, "commits_count": 1, "files_changed": 1, "response_length": 1004, "file_count": 3, "needs_breakdown": false} |
[FEATURE] statement_descriptor_suffix and statement_descriptor_name not being sent to Adyen. Please implement.
### Feature Description
It is important to be able to have custom statements (and also it is available feature on Stripe), so it should be on Adyen as well.
### Possible Implementation
It should propagate to `shopperStatement` in the Adyen't API
### Have you spent some time checking if this feature request has been raised before?
- [X] I checked and didn't find a similar issue
### Have you read the Contributing Guidelines?
- [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md)
### Are you willing to submit a PR?
None | <think>
PR Context:
- Title: refactor(connector): [adyen] add more fields in the payments request
- Merged: 2024-03-11T10:13:22Z
- Files changed: 3 files
- Commits: 6 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
- Add shopper statement and metadata in payments request
- Add additional fields and validations over fields like `IP address`, `billing_address`, `Email` and Shopper details
### Additional Changes
- [ ] This PR modifies the API contr
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** refactor(connector): [adyen] add more fields in the payments request (#4010)
Files to modify:
**crates/router/src/connector/adyen/transformers.rs**
Remove:
- impl: impl TryFrom<(&api::PayLaterData, Option<api_enums::CountryAlpha2>)> for value
Add:
- function: private::build_shopper_reference
- function: pub::check_required_field
- impl: impl TryFrom<(
&api::PayLaterData,
&Option<api_enums::CountryAlpha2>,
&Option<Email>,
&Option<String>,
&Option<ShopperName>,
&Option<Secret<String>>,
&Option<Address>,
&Option<Address>,
)> for (
pay_later_data,
country_code,
shopper_email,
shopper_reference,
shopper_name,
telephone_number,
billing_address,
delivery_address,
)
**Commit 2:** refactor(connector): [adyen] add more fields in the payments request (#4010)
Files to modify:
**crates/router/src/connector/adyen/transformers.rs**
Remove:
- impl: impl TryFrom<(&api::PayLaterData, Option<api_enums::CountryAlpha2>)> for value
Add:
- function: private::build_shopper_reference
- function: pub::check_required_field
- impl: impl TryFrom<(
&api::PayLaterData,
&Option<api_enums::CountryAlpha2>,
&Option<Email>,
&Option<String>,
&Option<ShopperName>,
&Option<Secret<String>>,
&Option<Address>,
&Option<Address>,
)> for (
pay_later_data,
country_code,
shopper_email,
shopper_reference,
shopper_name,
telephone_number,
billing_address,
delivery_address,
) | {"issue_number": 3914, "pr_number": 4010, "commits_count": 2, "files_changed": 3, "response_length": 2537, "file_count": 5, "needs_breakdown": false} |
feat(connector): Add recovery support for stripebilling
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Context: In case of some billing connectors we dont get the enough data in the webhook itself to support creation of payment intent and payment attempt in our system. So previously we derived a flow named "AdditionalRevenuerecoveryDetails" in this PR:#7402 which name is now changed to "BillingConnectorPaymentSync". This flow is used to fetch payment details of the invoices from the billing connectors using an API call to that billing connector. In this pr we are calling the flow and getting the details which are needed to create payment intent and attempt in our system.
1. Creates a connector integration in stripe billing that supports the API call.
2. Call the flow in recovery_incoming.rs file and using that details further we are creating the payment intent and attempt and verifying them.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
3. `crates/router/src/configs`
4. `loadtest/config`
-->
## Motivation and Context
## Testing
1. Go to stripe create a new webhook endpoint with a dummy url to get webhook secret key.
2. create a payment processor stripe
```
curl --location 'http://localhost:8080/v2/connector-accounts' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'x-merchant-id: cloth_seller_mQRYaJduFokPeZ54W6bN' \
--header 'x-profile-id: pro_me6dnNKlhwuq32xhfjCA' \
--header 'Authorization: admin-api-key=test_admin' \
--header 'api-key: test_admin' \
--data '{
"connector_type": "payment_processor",
"connector_name": "stripe",
"connector_account_details": {
"auth_type": "HeaderKey",
"api_key": "api-key
},
"payment_methods_enabled": [
{
"payment_method_type": "card_redirect",
"payment_method_subtypes": [
{
"payment_method_subtype": "card_redirect",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method_type": "card",
"payment_method_subtypes": [
{
"payment_method_subtype": "credit",
"payment_experience": null,
"card_networks": [
"Visa",
"Mastercard"
],
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "debit",
"payment_experience": null,
"card_networks": [
"Visa",
"Mastercard"
],
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method_type": "wallet",
"payment_method_subtypes": [
{
"payment_method_subtype": "google_pay",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "apple_pay",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "we_chat_pay",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "ali_pay",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "paypal",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "mb_way",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method_type": "pay_later",
"payment_method_subtypes": [
{
"payment_method_subtype": "klarna",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "affirm",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "afterpay_clearpay",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "walley",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method_type": "bank_redirect",
"payment_method_subtypes": [
{
"payment_method_subtype": "giropay",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "ideal",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "eps",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "bancontact_card",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "przelewy24",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "sofort",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "blik",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "trustly",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "online_banking_finland",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "online_banking_poland",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method_type": "bank_transfer",
"payment_method_subtypes": [
{
"payment_method_subtype": "ach",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "sepa",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "bacs",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method_type": "bank_debit",
"payment_method_subtypes": [
{
"payment_method_subtype": "ach",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "sepa",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "bacs",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "becs",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
}
],
"metadata": {
"status_url": "https://2753-2401-4900-1cb8-2ff9-24dd-1ccf-ed12-b464.in.ngrok.io/webhooks/merchant_1678699058/globalpay",
"account_name": "transaction_processing",
"pricing_type": "fixed_price",
"acquirer_bin": "438309",
"acquirer_merchant_id": "00002000000"
},
"frm_configs": null,
"connector_webhook_details": {
"merchant_secret": ""
},
"profile_id": "pro_me6dnNKlhwuq32xhfjCA"
}'
```
change the profile id and other feilds while creating you own one
3. copy the mca id of stripe and paste it in the billing mca curl in feature metadata
```
curl --location 'http://localhost:8080/v2/connector-accounts' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'x-merchant-id: cloth_seller_mQRYaJduFokPeZ54W6bN' \
--header 'x-profile-id: pro_me6dnNKlhwuq32xhfjCA' \
--header 'Authorization: admin-api-key=test_admin' \
--header 'api-key: test_admin' \
--data '{
"connector_type": "billing_processor",
"connector_name": "stripebilling",
"connector_account_details": {
"auth_type": "HeaderKey",
"api_key": "{your api key}"
},
"payment_methods_enabled": [
{
"payment_method_type": "card",
"payment_method_subtypes": [
{
"payment_method_subtype": "credit",
"payment_experience": null,
"card_networks": [
"Visa",
"Mastercard"
],
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "debit",
"payment_experience": null,
"card_networks": [
"Visa",
"Mastercard"
],
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
}
],
"metadata": {
"status_url": "https://2753-2401-4900-1cb8-2ff9-24dd-1ccf-ed12-b464.in.ngrok.io/webhooks/merchant_1678699058/globalpay",
"account_name": "transaction_processing",
"pricing_type": "fixed_price",
"acquirer_bin": "438309",
"acquirer_merchant_id": "00002000000"
},
"frm_configs": null,
"feature_metadata" : {
"revenue_recovery":{
"max_retry_count" : 16,
"billing_connector_retry_threshold": 2,
"billing_account_reference": {
"{your stripe mca id here}": "stripebilling"
}
}
},
"connector_webhook_details": {
"merchant_secret": "{webhook secret you have copied here}"
},
"profile_id": "pro_me6dnNKlhwuq32xhfjCA"
}'
```
4. copy the mca id, profile id and merchant id to construct the endpoint of the webhook.
5. install ngrok and run the service it will give you a https url for your local host port.
6. copy the https url of ngrok
7. construct the webhook endpoint : url/v2/webhooks/merchant_id/profile_id/billing_mca_id
8. paste this endpoint in the place of dummy url you have used to create endpoint in stripe dashboard
9. now create a test subscription use this card "4000 0000 0000 0341" while creating a test subscription and the billing day should start from the next day. If you are creating a test subscription today billing date should start from tommorow.
10. now move the clock past one month.
11. no observe the payment intent table and payment attempt table in db and verify those details with ones we are getting.
Images of the logs:
<img width="1728" alt="Screenshot 2025-03-11 at 5 52 53 PM" src="https://github.com/user-attachments/assets/0a97b656-2417-4812-b9cd-a808183411ea" />
<img width="1728" alt="Screenshot 2025-03-11 at 5 53 10 PM" src="https://github.com/user-attachments/assets/5a9872f1-45a3-4bf5-978c-6e477df36c9f" />
<img width="1728" alt="Screenshot 2025-03-11 at 5 53 21 PM" src="https://github.com/user-attachments/assets/5cbac559-09d8-4939-b2a6-04bc8f50a1bc" />
<img width="1728" alt="Screenshot 2025-03-11 at 5 54 32 PM" src="https://github.com/user-attachments/assets/3eb3fb41-afd4-4a05-8c8b-715310a79d7d" />
<img width="1710" alt="Screenshot 2025-03-10 at 4 52 08 PM" src="https://github.com/user-attachments/assets/05477fdc-656b-42cd-ba27-880d5748cc19" />
<img width="1190" alt="Screenshot 2025-03-10 at 4 52 20 PM" src="https://github.com/user-attachments/assets/d9900f24-2b8f-45c5-b6c5-bd5dcd62357d" />
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
| <think>
PR Context:
- Title: feat(recovery-events): add revenue recovery topic and vector config to push these events to s3
- Merged: 2025-07-25T12:00:14Z
- Files changed: 22 files
- Commits: 30 commits
Implementation approach:
## Description
This new Kafka Event consume the revenue recovery related events which will be constructed from both `RecoveryPaymentIntent` and `RecoveryPaymentAttempt` in revenue recovery flow. The events form Kafka will be picked up by vector and this be eventually batched and pushed to s3 based o
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat(recovery-events): add revenue recovery topic and vector config to push these events to s3 (#828
Files to modify:
**crates/api_models/src/payments.rs**
Add:
- function: pub::get_billing_connector_card_info
- impl: impl BillingConnectorPaymentMethodDetails
**crates/diesel_models/src/types.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/stripebilling/transformers.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/lib.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payments.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payments/payment_attempt.rs**
Add:
- function: private::from
- impl: impl From<ErrorDetails> for api_models::payments::RecordAttemptErrorDetails
**crates/hyperswitch_domain_models/src/revenue_recovery.rs**
Modify existing code
**crates/openapi/src/openapi_v2.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
**crates/router/src/core/revenue_recovery/types.rs**
Modify existing code
**crates/router/src/core/webhooks/recovery_incoming.rs**
Add:
- function: pub::new
- function: pub::publish_revenue_recovery_event_to_kafka
- impl: impl RecoveryPaymentTuple
**crates/router/src/events.rs**
Modify existing code
**crates/router/src/services/kafka.rs**
Add:
- mod: pub::revenue_recovery
**crates/router/src/services/kafka/revenue_recovery.rs**
Add:
- function: private::key
- function: private::event_type
- struct: pub::RevenueRecovery
- impl: impl super::KafkaMessage for RevenueRecovery<'_>
**crates/storage_impl/src/errors.rs**
Modify existing code | {"issue_number": 7461, "pr_number": 8285, "commits_count": 1, "files_changed": 22, "response_length": 2621, "file_count": 18, "needs_breakdown": true} |
refactor(users): Force 2FA in prod env
Currently 2FA is not forced on prod, users have ability to skip it.
For the PCI compliance, we have to force users to setup and use 2FA. | <think>
PR Context:
- Title: refactor(users): Force 2FA in production environment
- Merged: 2024-11-19T13:18:51Z
- Files changed: 1 files
- Commits: 2 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
This PR forces users to use 2FA in production.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [x] This PR modifies application configuration/environment variables
<!--
Pr
</think>
To implement this, you'll need to modify:
(No detailed commit information available) | {"issue_number": 6592, "pr_number": 6596, "commits_count": 0, "files_changed": 1, "response_length": 782, "file_count": 0, "needs_breakdown": false} |
feat(auth): Support profile level authentication
- After the dashboard is changed to profile level, there will be 3 types of APIs based on the level
1. Merchant Level only
- API Keys
- Merchant Account
- Business profile
2. Profile Level only
- Connectors
- Routing
- Operations (Payment, refund, disputes except list and filter)
- etc...
1. Profile + Merchant
- Operations list and filter
- etc...
### Merchant Level APIs
- No changes here.
### Profile Level only
- These should start accepting an optional profile_id in the function parameter, which will be passed from auth layer.
- There are some APIs which are currently at pseudo profile level like payments create and refunds create.
- Currently these kind APIs take profile_id in the payload or query param.
- From now on, these should not accept these in the request and take those values from the auth layer.
- To support the current API calls, these will fallback to body if profile_id in header is not present.
### Profile + Merchant Level
- These APIs should operate both in merchant level and profile level.
- These APIs accept a vec of profile_ids in the function parameter.
- There should be different routes for these APIs and probably the core function will remain same.
- The route function will be different for each route but calls the same core function.
- If the profile_id vec is not empty, then the API will send the data for those specific profile_ids else for the whole merchant.
## Breaking changes
- Current APIs will be changed in a way that the current calls will work without any changes. So there shouldn't be any breaking changes.
## Auth
- Auth layer will now give either
1. org_id, merchant_id and profile_id
2. org_id, merchant_id and Vec<profile_id>
- There are currently two types of JWT Auths.
1. JWTAuth
2. JWTMerchantFromRoute
- Both of these will have a new implementation which will send the data as mentioned in the first point.
- Both of these have profile_id as optional type for backwards compatibility.
- Once we have a stable version where profile_id is always present in the JWT, then we can have following JWT Auths for more checks.
1. JWTAuth
2. JWTMerchantFromRoute
3. JWTProfileFromRoute
4. JWTMerchantAndProfileFromRoute
- These will always have profile_id in the payload.
- Routes can choose to pass or not to pass the profile data to the core function. | <think>
PR Context:
- Title: refactor(auth): Pass `profile_id` from the auth to core functions
- Merged: 2024-08-05T11:37:32Z
- Files changed: 5 files
- Commits: 2 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
Use the profile_id from the authentication data and pass it to core functions.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/e
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** refactor(auth): Pass `profile_id` from the auth to core functions (#5520)
Files to modify:
**crates/router/src/routes/disputes.rs**
Modify existing code
**crates/router/src/routes/payments.rs**
Modify existing code
**crates/router/src/routes/payouts.rs**
Modify existing code
**crates/router/src/routes/refunds.rs**
Modify existing code
**crates/router/src/services/authentication.rs**
Add:
- function: private::get_merchant_id
- function: private::authenticate_and_fetch
- impl: impl AuthInfo for AuthenticationDataWithMultipleProfiles
- impl: impl AuthenticateAndFetch<AuthenticationData, A> for JWTAuthMerchantFromRoute | {"issue_number": 5491, "pr_number": 5520, "commits_count": 1, "files_changed": 5, "response_length": 1452, "file_count": 7, "needs_breakdown": false} |
feat(analytics): Analytics Request Validator and config driven forex feature
## Current behaviour
- Forex api calls are occuring on every analytics api call
- There is no analytics request validator.
## Proposed Changes
- Enable/Disable forex functionality based on a config flag.
- `request_validator()` to validate requests on various grounds and throw contextual and comprehensive `4xx` errors.
- `request_validator()` should also be able to discern whether metrics passed in a request, require `forex_api` call. | <think>
PR Context:
- Title: feat(analytics): Analytics Request Validator and config driven forex feature
- Merged: 2024-12-17T10:50:36Z
- Files changed: 16 files
- Commits: 16 commits
Implementation approach:
## Fixes #6731
## Description
<!-- Describe your changes in detail -->
### Config driven forex functionality
- Created a `forex_enabled` flag in config settings under analytics config.
- Instead of passing `ExchangeRates` data structure now we are passing `Option<ExchangeRates>`
- In amount
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat(analytics): Analytics Request Validator and config driven forex feature (#6733)
Co-authored-by:
Files to modify:
**crates/analytics/src/lib.rs**
Modify existing code
**crates/analytics/src/payment_intents/core.rs**
Modify existing code
**crates/analytics/src/payments/core.rs**
Modify existing code
**crates/analytics/src/refunds/core.rs**
Modify existing code
**crates/api_models/src/analytics.rs**
Add:
- function: pub::requires_forex_functionality
- struct: pub::AnalyticsRequest
- trait: pub::ForexMetric
- impl: impl AnalyticsRequest
**crates/api_models/src/analytics/disputes.rs**
Add:
- function: private::is_forex_metric
- impl: impl ForexMetric for DisputeMetrics
**crates/api_models/src/analytics/payment_intents.rs**
Add:
- function: private::is_forex_metric
- impl: impl ForexMetric for PaymentIntentMetrics
**crates/api_models/src/analytics/payments.rs**
Add:
- function: private::is_forex_metric
- impl: impl ForexMetric for PaymentMetrics
**crates/api_models/src/analytics/refunds.rs**
Add:
- function: private::is_forex_metric
- impl: impl ForexMetric for RefundMetrics
**crates/router/src/analytics.rs**
Modify existing code
**crates/router/src/analytics_validator.rs**
Add:
- function: pub::request_validator
**crates/router/src/lib.rs**
Add:
- mod: pub::analytics_validator | {"issue_number": 6731, "pr_number": 6733, "commits_count": 1, "files_changed": 16, "response_length": 2201, "file_count": 14, "needs_breakdown": false} |
[FEATURE] add domain type for client secret
### Feature Description
Create domain type for client secret
### Possible Implementation
Make type `ClietSecret(String)` and use it wherever applicable
### Have you spent some time to check if this feature request has been raised before?
- [X] I checked and didn't find similar issue
### Have you read the Contributing Guidelines?
- [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md)
### Are you willing to submit a PR?
No, but I'm happy to collaborate on a PR with someone else | <think>
PR Context:
- Title: feat(api_models): add client_secret type to payments
- Merged: 2024-02-15T06:49:24Z
- Files changed: 1 files
- Commits: 6 commits
Implementation approach:
## Description
Implement `ClientSecret` type for payments.
Closes #1357
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
## Motivation and Context
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat(api_models): add client_secret type to payments (#3557)
Co-authored-by: Sanchith Hegde <2221750
Files to modify:
**crates/api_models/src/payments.rs**
Add:
- function: private::deserialize
- function: private::expecting
- function: private::visit_str
- function: private::serialize
- function: private::test_serialize_client_secret
- function: private::test_deserialize_client_secret
- struct: pub::ClientSecret
- struct: private::ClientSecretVisitor
- impl: impl Deserialize<'de> for ClientSecret
- impl: impl Visitor<'de> for ClientSecretVisitor
- impl: impl Serialize for ClientSecret
- mod: private::client_secret_tests | {"issue_number": 1357, "pr_number": 3557, "commits_count": 1, "files_changed": 1, "response_length": 1465, "file_count": 3, "needs_breakdown": false} |
Add tenant_id as a field for data pipeline
1. Add `Tenant_id` as a field for all logs
2. Add `Tenant_id` action for Kafka messages as well , headers to be a combination of ( tenant_id, merchant_id, payment_id )
3. Make logical databases and physical tables in clickhouse for different tenants | <think>
PR Context:
- Title: fix(multitenancy): remove tenant id from redis stream key of kafkaStore
- Merged: 2024-06-10T13:57:26Z
- Files changed: 1 files
- Commits: 1 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
As part of multitenancy feature, we added tenant prefix in the redisinterface directly. so this specific handling of tenant id in append_stream function is not required anymore
### Additional Changes
- [ ] This PR modifies the API contra
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** fix(multitenancy): remove tenant id from redis stream key of kafkaStore (#4916)
Files to modify:
**crates/router/src/db/kafka_store.rs**
Modify existing code | {"issue_number": 4475, "pr_number": 4916, "commits_count": 1, "files_changed": 1, "response_length": 965, "file_count": 3, "needs_breakdown": false} |
[FEATURE] Use newtype pattern for email addresses
### Feature Description
This issue covers one of the problems mentioned in #119, about using [the newtype pattern](https://rust-unofficial.github.io/patterns/patterns/behavioural/newtype.html) for email addresses. The requirement is that email addresses must be validated once during construction/deserialization and should never be validated again. This would also eliminate the validation being performed at the time of masking email addresses (specifically line 97 in the snippet):
https://github.com/juspay/hyperswitch/blob/d107b44fd356f172ef7c9535567d266a6301e43d/crates/common_utils/src/pii.rs#L87-L109
Please also include unit tests in your PR.
_For external contributors, clarify any questions you may have, and let us know that you're interested in picking this up. We'll assign this issue to you to reduce duplication of effort on the same task._
### Possible Implementation
You can use a newtype like so:
```rust
use masking::Secret;
struct Email(Secret<String>);
let email = Email::from_str("..."); // You can use the `FromStr` trait for this purpose
```
For validating emails, the existing regex validation should suffice. Also, implement `Serialize`, `Deserialize` and `masking::Strategy` for `Email`.
### Have you spent some time to check if this feature request has been raised before?
- [X] I checked and didn't find similar issue
### Have you read the Contributing Guidelines?
- [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md)
### Are you willing to submit a PR?
None | <think>
PR Context:
- Title: refactor: use newtype pattern for email addresses
- Merged: 2023-05-04T14:24:44Z
- Files changed: 30 files
- Commits: 26 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
- This fixes #608
- Added testcases
### Additional Changes
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths whe
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** refactor: use newtype pattern for email addresses (#819)
Co-authored-by: Sanchith Hegde <22217505+Sa
Files to modify:
**crates/api_models/src/admin.rs**
Modify existing code
**crates/api_models/src/customers.rs**
Modify existing code
**crates/api_models/src/payments.rs**
Modify existing code
**crates/common_utils/src/pii.rs**
Remove:
- struct: pub::Email
- impl: impl Strategy<T> for validate_email(val_str)
Add:
- function: private::from_sql
- function: private::to_sql
- function: private::from_str
- struct: pub::EmailStrategy
- struct: pub::Email
- impl: impl FromSql<sql_types::Text, DB> for Email
- impl: impl ToSql<sql_types::Text, DB> for Email
- impl: impl FromStr for Email
**crates/router/src/compatibility/stripe/customers/types.rs**
Modify existing code
**crates/router/src/compatibility/stripe/payment_intents/types.rs**
Modify existing code
**crates/router/src/compatibility/stripe/setup_intents/types.rs**
Modify existing code
**crates/router/src/connector/adyen/transformers.rs**
Modify existing code
**crates/router/src/connector/cybersource/transformers.rs**
Modify existing code
**crates/router/src/connector/dlocal/transformers.rs**
Modify existing code
**crates/router/src/connector/multisafepay/transformers.rs**
Modify existing code
**crates/router/src/connector/nuvei/transformers.rs**
Modify existing code
**crates/router/src/connector/shift4/transformers.rs**
Modify existing code
**crates/router/src/connector/stripe/transformers.rs**
Modify existing code
**crates/router/src/connector/trustpay/transformers.rs**
Modify existing code
**crates/router/src/connector/utils.rs**
Modify existing code
**crates/router/src/connector/worldline/transformers.rs**
Modify existing code
**crates/router/src/connector/zen/transformers.rs**
Modify existing code
**crates/router/src/core/customers.rs**
Modify existing code
**crates/router/src/core/payment_methods/transformers.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_session.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_start.rs**
Modify existing code
**crates/router/src/types.rs**
Modify existing code
**crates/router/src/types/api/customers.rs**
Remove:
- function: private::validate
- trait: pub::CustomerRequestExt
- impl: impl CustomerRequestExt for CustomerRequest
**crates/router/tests/connectors/cybersource.rs**
Modify existing code
**crates/router/tests/connectors/zen.rs**
Modify existing code
**crates/storage_models/src/customers.rs**
Modify existing code | {"issue_number": 608, "pr_number": 819, "commits_count": 1, "files_changed": 30, "response_length": 3491, "file_count": 30, "needs_breakdown": true} |
fix(authz): Proper descriptions for parents
Currently descriptions for parent groups in invite page of control center are not entity specific. That means, customers in description will be visible for profile level users when it shouldn't. | <think>
PR Context:
- Title: feat(authz): Make info APIs support `ParentGroup`
- Merged: 2024-10-30T10:42:37Z
- Files changed: 13 files
- Commits: 8 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
Make new APIs to replace
- `/user/role/{{role_id}}` -> `/user/role/{{role_id}}/v2`
- `/user/role` -> `/user/role/v2`
- `/user/module/list` -> `/user/parent/list`
The new APIs will have proper description and parent info which has entity
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat(authz): Make info APIs support `ParentGroup` (#6440)
Co-authored-by: hyperswitch-bot[bot] <1485
Files to modify:
**crates/api_models/src/events/user_role.rs**
Modify existing code
**crates/api_models/src/user_role/role.rs**
Add:
- struct: pub::RoleInfoWithParents
- struct: pub::ParentGroupInfo
- struct: pub::GroupsAndResources
**crates/common_enums/src/enums.rs**
Modify existing code
**crates/router/src/core/user_role.rs**
Add:
- function: pub::get_parent_group_info
**crates/router/src/core/user_role/role.rs**
Add:
- function: pub::get_groups_and_resources_for_role_from_token
- function: pub::get_parent_info_for_role
**crates/router/src/routes/app.rs**
Modify existing code
**crates/router/src/routes/lock_utils.rs**
Modify existing code
**crates/router/src/routes/user_role.rs**
Add:
- function: pub::get_groups_and_resources_for_role_from_token
- function: pub::get_parent_info_for_role
- function: pub::get_parent_group_info
**crates/router/src/services/authorization/info.rs**
Remove:
- function: pub::get_parent_name
**crates/router/src/services/authorization/permission_groups.rs**
Add:
- function: private::get_descriptions_for_groups
**crates/router/src/services/authorization/permissions.rs**
Add:
- function: pub::get_resource_name
- function: pub::get_scope_name
**crates/router/src/services/authorization/roles/predefined_roles.rs**
Modify existing code
**crates/router_env/src/logger/types.rs**
Modify existing code | {"issue_number": 6439, "pr_number": 6440, "commits_count": 1, "files_changed": 13, "response_length": 2316, "file_count": 15, "needs_breakdown": false} |
[BUG] connector_request_reference_id not updated in payment_tokenization confirm_intent flow
### Bug Description
In the payment tokenization confirm intent flow, the field `connector_request_reference_id` is not being updated in payment_attempt. Because of this missing update, flows such as PaymentsCancel and PaymentsCapture break, resulting in a 500 Internal Server Error with the message "connector_request_reference_id not found in payment_attempt".
### Expected Behavior
The expected behavior is that during confirm intent `connector_request_reference_id` field should be updated in payment attepmt, so that subsequent cancel and capture operations can function correctly without failing.
### Actual Behavior
Because of this missing update, flows such as PaymentsCancel and PaymentsCapture break, resulting in a 500 Internal Server Error with the message "connector_request_reference_id not found in payment_attempt".
<img width="1721" height="428" alt="Image" src="https://github.com/user-attachments/assets/f2eea707-d3bc-4213-9f78-495cb0249f6f" />
### Steps To Reproduce
Provide an unambiguous set of steps to reproduce this bug. Include code or configuration to reproduce, if relevant.
1. Create a Payment Intent
```
{
"amount_details": {
"order_amount": 10000,
"currency": "USD"
},
"capture_method":"manual",
"authentication_type": "no_three_ds",
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "joseph",
"last_name": "Doe"
},
"email": "example@example.com"
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "joseph",
"last_name": "Doe"
},
"email": "example@example.com"
}
}
```
2. Confirm the Payment Intent with customer_acceptance
```
{
"payment_method_data": {
"card": {
"card_cvc": "123",
"card_exp_month": "10",
"card_exp_year": "25",
"card_number": "4111111111111111",
"card_holder_name": "joseph Doe"
}
},
"payment_method_type": "card",
"payment_method_subtype": "credit",
"browser_info": {
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36",
"accept_header": "text\\/html,application\\/xhtml+xml,application\\/xml;q=0.9,image\\/webp,image\\/apng,*\\/*;q=0.8",
"language": "en-GB",
"color_depth": 24,
"screen_height": 1440,
"screen_width": 2560,
"time_zone": -330,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "0.0.0.0"
},
"customer_acceptance": {
"acceptance_type": "online",
"accepted_at": "2022-09-10T10:11:12Z",
"online": {
"ip_address": "123.32.25.123",
"user_agent": "Mozilla/5.0 (Linux; Android 12; SM-S906N Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.119 Mobile Safari/537.36"
}
}
}
```
3. Attempt to Void
After the confirm step, call /v2/payments/{payment_id}/cancel.
<img width="1728" height="431" alt="Image" src="https://github.com/user-attachments/assets/723db89c-2f25-4e29-8e40-bac011d23500" />
Observed Behavior:
The void request fails with a 500 Internal Server Error because the field connector_request_reference_id is not updated in payment_attempt during the confirm intent step.
### Context For The Bug
_No response_
### Environment
Are you using hyperswitch hosted version? Yes/No
If yes, please provide the value of the `x-request-id` response header to help us debug your issue.
If not (or if building/running locally), please provide the following details:
1. Operating System or Linux distribution:
2. Rust version (output of `rustc --version`): ``
3. App version (output of `cargo r --features vergen -- --version`): ``
### Have you spent some time checking if this bug has been raised before?
- [x] I checked and didn't find a similar issue
### Have you read the Contributing Guidelines?
- [x] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md)
### Are you willing to submit a PR?
Yes, I am willing to submit a PR! | <think>
PR Context:
- Title: fix(payment): add connector_request_reference_id to PaymentAttemptUpdate in ConfirmIntentTokenized flow
- Merged: 2025-10-01T13:42:36Z
- Files changed: 2 files
- Commits: 1 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
In the payment tokenization confirm intent flow, the field `connector_request_reference_id` was not being updated in payment_attempt.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** fix(payment): add connector_request_reference_id to PaymentAttemptUpdate in ConfirmIntentTokenized f
Files to modify:
**crates/hyperswitch_domain_models/src/payments/payment_attempt.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_confirm_intent.rs**
Modify existing code | {"issue_number": 9596, "pr_number": 9597, "commits_count": 1, "files_changed": 2, "response_length": 1144, "file_count": 4, "needs_breakdown": false} |
make `ApplepayPaymentMethod` in payment_method_data column of `payment_attempt` table as json
make `ApplepayPaymentMethod` in payment_method_data column of `payment_attempt` table as json because retrieve payment fails for the old payments for which the `payment_method_data` in the `payment_attempt` table was stored as `{"wallet": {}}`. But after this change there would be some data for the apple pay (`{"wallet": {"apple_pay": {"type": "debit", "network": "Visa", "display_name": "Visa 1234"}}}`) or `{"wallet": null}` | <think>
PR Context:
- Title: fix(payment_methods): make ApplepayPaymentMethod in payment_method_data column of payment_attempt table as json
- Merged: 2024-03-20T13:42:02Z
- Files changed: 2 files
- Commits: 1 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
make ApplepayPaymentMethod in payment_method_data column of payment_attempt table as json because retrieve payment fails for the old payments for which the payment_method_data in the payment_attempt table was stored as {"wallet": {}}
### Ad
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** fix(payment_methods): make `ApplepayPaymentMethod` in payment_method_data column of `payment_attempt
Files to modify:
**crates/api_models/src/payments.rs**
Remove:
- enum: pub::Wallets
**crates/router/src/core/payments/helpers.rs**
Modify existing code | {"issue_number": 4153, "pr_number": 4154, "commits_count": 1, "files_changed": 2, "response_length": 1107, "file_count": 4, "needs_breakdown": false} |
feat(payments_v2): implement create and confirm intent flow
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
This PR introduces a new endpoint that handles payments create intent v2 and confirm intent v2 steps. Note that the API contract is not finalized and is possibly subject to change.
Additionally, the endpoint can also call the setup intent flow, if the order amount is zero. This is done so as to allow the payment methods v2 endpoints to create multiple-use tokens for a specified customer's payment method.
### Additional Changes
- [x] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
This PR introduces a new endpoint for payments v2, that can handle create intent and confirm intent steps.
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
The endpoint introduced in this PR would allow the creation of multiple-use tokens by the payments methods v2 endpoints.
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
1. Using the v2 endpoints, create an organization, merchant account, profile, API key and merchant connector account.
2. Call the setup intent endpoint:
- Since the request body is a union of the payment create intent v2 and payment confirm intent v2 request bodies, the required fields for this endpoint are `amount_details`, `payment_method_data`, `payment_method_type` and `payment_method_subtype`.
The request and response are included below:
```shell
$ curl --location 'http://localhost:8080/v2/payments' \
--header 'x-profile-id: pro_9UhMqBMEOooRIvJFFdeW' \
--header 'Content-Type: application/json' \
--header 'api-key: <API key>' \
--data '{
"amount_details": {
"order_amount": 0,
"currency": "USD"
},
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "01",
"card_exp_year": "25",
"card_holder_name": "John Doe",
"card_cvc": "100"
}
},
"payment_method_type": "card",
"payment_method_subtype": "credit"
}'
{
"id": "12345_pay_0194aedd2b087ec1a960242f3ad8f2c1",
"status": "succeeded",
"amount": {
"order_amount": 0,
"currency": "USD",
"shipping_cost": null,
"order_tax_amount": null,
"external_tax_calculation": "skip",
"surcharge_calculation": "skip",
"surcharge_amount": null,
"tax_on_surcharge": null,
"net_amount": 0,
"amount_to_capture": null,
"amount_capturable": 0,
"amount_captured": 0
},
"customer_id": null,
"connector": "stripe",
"client_secret": "12345_pay_0194aedd2b087ec1a960242f3ad8f2c1_secret_0194aedd2b127f6190e5090a1527ad3e",
"created": "2025-01-28T21:41:57.650Z",
"payment_method_data": {
"billing": null
},
"payment_method_type": "card",
"payment_method_subtype": "credit",
"next_action": null,
"connector_transaction_id": "seti_1QmMXiD5R7gDAGffKPUlM0HT",
"connector_reference_id": null,
"connector_token_details": {
"token": "pm_1QmMXiD5R7gDAGffCf03AULQ"
},
"merchant_connector_id": "mca_oC8RE28uRRcVKDjgwfzG",
"browser_info": null,
"error": null
}
```
- Note that the `order_amount` is zero in the above request. Also, note that the `connector_token_details.token` field is populated in the response, and the `connector_transaction_id` being `seti_*` indicates that Stripe's setup intent flow was called.
- Additional fields may be passed in the request, such as `customer_id`, etc. which would be reflected in the response and database entries.
- Passing in a non-zero value for the `order_amount` causes it to follow the regular create intent + confirm intent flow:
```shell
$ curl --location 'http://localhost:8080/v2/payments' \
--header 'x-profile-id: pro_9UhMqBMEOooRIvJFFdeW' \
--header 'Content-Type: application/json' \
--header 'api-key: <API key>' \
--data '{
"amount_details": {
"order_amount": 6540,
"currency": "USD"
},
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "01",
"card_exp_year": "25",
"card_holder_name": "John Doe",
"card_cvc": "100"
}
},
"payment_method_type": "card",
"payment_method_subtype": "credit"
}'
{
"id": "12345_pay_0194aedff4c57e008edc28cbd3881dee",
"status": "succeeded",
"amount": {
"order_amount": 6540,
"currency": "USD",
"shipping_cost": null,
"order_tax_amount": null,
"external_tax_calculation": "skip",
"surcharge_calculation": "skip",
"surcharge_amount": null,
"tax_on_surcharge": null,
"net_amount": 6540,
"amount_to_capture": null,
"amount_capturable": 0,
"amount_captured": 6540
},
"customer_id": null,
"connector": "stripe",
"client_secret": "12345_pay_0194aedff4c57e008edc28cbd3881dee_secret_0194aedff4cc719381629d4aacf19adb",
"created": "2025-01-28T21:45:00.364Z",
"payment_method_data": {
"billing": null
},
"payment_method_type": "card",
"payment_method_subtype": "credit",
"next_action": null,
"connector_transaction_id": "pi_3QmMaeD5R7gDAGff0GRZPicn",
"connector_reference_id": null,
"connector_token_details": {
"token": "pm_1QmMaeD5R7gDAGffZenIs1fg"
},
"merchant_connector_id": "mca_oC8RE28uRRcVKDjgwfzG",
"browser_info": null,
"error": null
}
```
In this case, the `connector_transaction_id` is `pi_*`, indicating that Stripe's authorize flow was called.
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
| <think>
PR Context:
- Title: feat(router): [V2] Return connector customer reference IDs in `CustomerResponse`
- Merged: 2025-03-21T13:58:53Z
- Files changed: 8 files
- Commits: 8 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
Add a field `connector_customer` to `CustomerResponse` that contains a map between `MerchantConnectorAccountId` and connector customer id
### Additional Changes
- [x] This PR modifies the API contract
- [ ] This PR modifies the database
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat(router): [V2] Return connector customer reference IDs in `CustomerResponse` (#7319)
Co-authored
Files to modify:
**crates/api_models/src/customers.rs**
Modify existing code
**crates/common_types/src/customers.rs**
Add:
- function: private::deref
- function: private::deref_mut
- struct: pub::ConnectorCustomerMap
- impl: impl std::ops::Deref for ConnectorCustomerMap
- impl: impl std::ops::DerefMut for ConnectorCustomerMap
**crates/common_types/src/lib.rs**
Add:
- mod: pub::customers
**crates/diesel_models/src/customers.rs**
Remove:
- function: private::deref
- function: private::deref_mut
- struct: pub::ConnectorCustomerMap
- impl: impl std::ops::Deref for ConnectorCustomerMap
- impl: impl std::ops::DerefMut for ConnectorCustomerMap
**crates/hyperswitch_domain_models/src/customer.rs**
Modify existing code
**crates/router/src/types/api/customers.rs**
Modify existing code | {"issue_number": 7106, "pr_number": 7319, "commits_count": 1, "files_changed": 8, "response_length": 1761, "file_count": 8, "needs_breakdown": false} |
fix(router): connecconnector name not saved in payment_attempt & connector_response tables
## Type of Change
- [x] Bugfix
## Description
The connector name was not being saved in
1. Payment Attempt table in both error and success cases.
2. Connector Response table in error cases.
Fixed this by including `connector` as a field in both tables' DBUpdate enum variants.
## Motivation and Context
Regardless of whether the payment succeeds or fails, the connector info must be saved to the DB.
## How did you test it?
<img width="96" alt="image" src="https://user-images.githubusercontent.com/47862918/207528871-ac4af223-6443-4045-ab1c-e671ebdaff58.png">
The rows where the connector is missing is from before this fix. The connector is successfully saved as `stripe` after this fix.
## Checklist
- [x] I formatted the code `cargo +nightly fmt`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed submitted code
| <think>
PR Context:
- Title: feat(payout_link): secure payout links using server side validations and client side headers
- Merged: 2024-07-17T13:18:28Z
- Files changed: 23 files
- Commits: 23 commits
Implementation approach:
## Description
This PR includes below changes -
- adding `allowed_domains` field in payout link config
- this is added at both business profile level and individual payout txns
- business profile config is used as a fallback in case `allowed_domains` are not passed in payout link's create request
- this is a required field in product
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat(payout_link): secure payout links using server side validations and client side headers (#5219)
Files to modify:
**crates/api_models/src/admin.rs**
Add:
- function: pub::validate
- impl: impl BusinessGenericLinkConfig
**crates/common_utils/src/consts.rs**
Modify existing code
**crates/common_utils/src/link_utils.rs**
Add:
- function: pub::validate_strict_domain
- function: pub::validate_wildcard_domain
- function: private::test_validate_strict_domain_regex
- function: private::test_validate_wildcard_domain_regex
- function: private::test_validate_strict_domain
- function: private::test_validate_wildcard_domain
- mod: private::domain_tests
**crates/hyperswitch_domain_models/src/api.rs**
Add:
- struct: pub::GenericLinks
**crates/hyperswitch_domain_models/src/errors/api_error_response.rs**
Modify existing code
**crates/router/src/compatibility/stripe/errors.rs**
Modify existing code
**crates/router/src/compatibility/wrap.rs**
Modify existing code
**crates/router/src/core/admin.rs**
Modify existing code
**crates/router/src/core/payment_methods.rs**
Modify existing code
**crates/router/src/core/payout_link.rs**
Modify existing code
**crates/router/src/core/payouts.rs**
Add:
- function: private::create_payout_link
- function: pub::create_payout_link_db_entry
**crates/router/src/core/payouts/validator.rs**
Remove:
- function: pub::create_payout_link
**crates/router/src/routes/payout_link.rs**
Modify existing code
**crates/router/src/services/api.rs**
Modify existing code
**crates/router/src/services/api/generic_link_response.rs**
Modify existing code
**crates/router/src/types/api/admin.rs**
Modify existing code | {"issue_number": 143, "pr_number": 5219, "commits_count": 1, "files_changed": 23, "response_length": 2564, "file_count": 18, "needs_breakdown": true} |
[FEAT] Multiple credential support for a connector in Cypress
## Requirement
Execute cypress tests for a connector having **multiple credentials** which can be used for different scenarios (one api key for `cards`, another for `bank redirects` and etc.,).
## Implementation
### Introduce new format for `creds.json`
`creds.json` should include both the formats. if a connector requires us passing **multiple credentials**, then that connector api key object **should** include multiple `connector_account_details` object all named under a generic name `connector_<number>` where `number` is an `integer`.
Refer example given below for more clarity:
```json
// connector having multiple credentials
<connector_name_1>: {
"connector_1": {
"connector_account_details": {
"auth_type": "KeyType",
"api_key": "",
"api_secret": "",
"key1": "",
"key2": ""
},
"metadata": {}
},
"connector_2": {
"connector_account_details": {
"auth_type": "KeyType",
"api_key": "",
"api_secret": "",
"key1": "",
"key2": ""
},
"metadata": {}
},
},
// connector with a single credential
<connector_name_2>: {
"connector_account_details": {
"auth_type": "KeyType",
"api_key": "",
"api_secret": "",
"key1": "",
"key2": ""
}
}
```
### Introduce new `object` (`Configs`) for `connector.js`
Within `connector.js`, introduce new object called as `Configs` alongside to `Request` and `Response` where user can define `flags` to achieve granular control over what test is being run.
An example implementation given below for reference:
```js
getCustomExchange({
Configs: {
TRIGGER_SKIP: true, // skips redirection flow from running. takes in a boolean
DELAY: {
STATUS: true, // flag to turn delay feature on or off. takes in a boolean
TIMEOUT: 5000, // timeout in milliseconds
},
CONNECTOR_CREDENTIAL: connector_1 / connector_2 // flag to route tests to a specific profile
// etc.,
},
Requst: {},
Response: {}
}),
```
### Modify `getValueByKey` function in `Utils.js`
Validate if `connector_account_details` dot exist within `<connector>` object in creds.
If it does not, start a loop and see if `connector_account_details` exist within every object. If true, return the `connector_account_details` while setting an object as a Cypress environment flag (`MULTIPLE_CONNECTORS`) with status `true` and length. If any validation fails, directly return the object (`data[key]`).
An example implementation given below for reference:
```js
if (data && typeof data === "object" && key in data) {
// Connector object has multiple keys
if (typeof data[key].connector_account_details === "undefined") {
const keys = Object.keys(data[key]);
for (let i = 0; i < keys.length; i++) {
const currentItem = data[key][keys[i]];
if (currentItem.hasOwnProperty("connector_account_details")) {
Cypress.env("MULTIPLE_CONNECTORS", {
status: true,
count: keys.length,
});
return currentItem;
}
}
}
return data[key];
} else {
return null;
}
```
### Add a new test to MCA create call
If `MULTIPLE_CONNECTORS.status` is `TRUE`. Check `MULTIPLE_CONNECTORS.count` and create `profile` and `mca` beneath that `profile` based on the number of `count`.
An example of possible implementation given below for reference:
```js
if (Cypress.env("MULTIPLE_CONNECTORS")?.status) {
for (let i = 0; i < Cypress.env("MULTIPLE_CONNECTORS").count; i++) {
cy.createBusinessProfileTest(
createBusinessProfileBody,
globalState,
"profile" + i // new optional fields
);
cy.createConnectorCallTest(
"payment_processor",
createConnectorBody,
payment_methods_enabled,
globalState,
"profile" + i, // new optional fields
"merchantConnector" + i // new optional fields
);
}
}
```
Store these created `profile_id`s and `mca`s in `globalState` for future usage.
Pass `CONNECTOR_CREDENTIAL` value as `connector_1` or `connector_2` in `<connector>.js`
In `commands.js`, `execute` these configs before a `request` has been made.
`execute` here means to make these configs work.
Preferably, make this execution of configs a function and pass the values accordingly along with trace to find from where the function has been called.
## Limitations
- Cypress cannot call itself unless a wrapper around Cypress is written (`Rustpress`?)
- This stops us from running the entire test suite against every credentials
- One possible work around for this is to have multiple keys (`cybersource_1`, `cybersource_2`) but this will result in a lot of confusion
- Current implementation **requires** the user to mandatorily pass a `CONNECTOR_CREDENTIAL` config to pass a different `profileId`
- Hence, the tests will only run once but, specific tests like `incremental auth` will be forced to run against different credential
- `00025-IncrementalAuth.cy.js` can be stopped from execution based on `MULTIPLE_CONNECTORS` environment variable as it is set during run time and the file is read asynchronously when the execution starts (to address this, we will have to make a function call to see if it is set during run time and it is, then skip) | <think>
PR Context:
- Title: ci: update cypress creds
- Merged: 2024-12-03T17:19:14Z
- Files changed: 1 files
- Commits: 2 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
Updates creds. closes #6645
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to th
</think>
To implement this, you'll need to modify:
(No detailed commit information available) | {"issue_number": 6645, "pr_number": 6726, "commits_count": 0, "files_changed": 1, "response_length": 754, "file_count": 0, "needs_breakdown": false} |
chore(codeowners): add codeowners data for PR reviews
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
## Description
Adding a CODEOWNERS file for facilitating PR reviews for teams
### Additional Changes
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!-- Provide links to the files with corresponding changes -->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless its an obvious bug or documentation fix
that will have little conversation).
-->
This leads to better ownership boundaries & increased efficiency for reviewers
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Doesn't need to be tested
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed submitted code
- [ ] I added unit tests for my changes where possible
- [ ] I added a [CHANGELOG](/CHANGELOG.md) entry if applicable
| <think>
PR Context:
- Title: feat(core): Add click to pay support in hyperswitch
- Merged: 2024-12-16T14:25:44Z
- Files changed: 30 files
- Commits: 30 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
Add click to pay and unified authentication service integration in core
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
check payments sanity
#1 : Create Business profile with `"is_click_to_pay_enabled": true`
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat(core): Add click to pay support in hyperswitch (#6769)
Co-authored-by: sai-harsha-vardhan <hars
Files to modify:
**crates/api_models/src/connector_enums.rs**
Modify existing code
**crates/common_enums/src/enums.rs**
Modify existing code
**crates/connector_configs/src/connector.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors.rs**
Add:
- mod: pub::ctp_mastercard
**crates/hyperswitch_connectors/src/connectors/ctp_mastercard.rs**
Add:
- function: private::build_headers
- function: private::id
- function: private::base_url
- function: private::get_webhook_object_reference_id
- function: private::get_webhook_event_type
- function: private::get_webhook_resource_object
- struct: pub::CtpMastercard
- impl: impl api::Payment for CtpMastercard
- impl: impl api::PaymentSession for CtpMastercard
- impl: impl api::ConnectorAccessToken for CtpMastercard
- impl: impl api::MandateSetup for CtpMastercard
- impl: impl api::PaymentAuthorize for CtpMastercard
- impl: impl api::PaymentSync for CtpMastercard
- impl: impl api::PaymentCapture for CtpMastercard
- impl: impl api::PaymentVoid for CtpMastercard
- impl: impl api::Refund for CtpMastercard
- impl: impl api::RefundExecute for CtpMastercard
- impl: impl api::RefundSync for CtpMastercard
- impl: impl api::PaymentToken for CtpMastercard
- impl: impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData> for CtpMastercard
- impl: impl ConnectorCommonExt<Flow, Request, Response> for CtpMastercard
- impl: impl ConnectorCommon for CtpMastercard
- impl: impl ConnectorValidation for CtpMastercard
- impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for CtpMastercard
- impl: impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for CtpMastercard
- impl: impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for CtpMastercard
- impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for CtpMastercard
- impl: impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for CtpMastercard
- impl: impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for CtpMastercard
- impl: impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for CtpMastercard
- impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for CtpMastercard
- impl: impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for CtpMastercard
- impl: impl webhooks::IncomingWebhook for CtpMastercard
**crates/hyperswitch_connectors/src/connectors/unified_authentication_service.rs**
Remove:
- function: private::get_auth_header
- function: private::get_headers
- function: private::get_content_type
- impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for unified_authentication_service::UnifiedAuthenticationServicePaymentsRequest::try_from(
req: &PaymentsAuthorizeRouterData,
.url(&types::PaymentsAuthorizeType::get_url(
.headers(types::PaymentsAuthorizeType::get_headers(
.set_body(types::PaymentsAuthorizeType::get_request_body(
data: &PaymentsAuthorizeRouterData,
) -> CustomResult<PaymentsAuthorizeRouterData, errors::ConnectorError> {
let response: unified_authentication_service::UnifiedAuthenticationServicePaymentsResponse =
.parse_struct("UnifiedAuthenticationService PaymentsAuthorizeResponse")
impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData>
for UnifiedAuthenticationService
req: &PaymentsSyncRouterData,
_req: &PaymentsSyncRouterData,
_connectors: &Connectors,
) -> CustomResult<String, errors::ConnectorError> {
Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into())
}
fn build_request(
&self,
req: &PaymentsSyncRouterData,
connectors: &Connectors,
) -> CustomResult<Option<Request>, errors::ConnectorError> {
Ok(Some(
RequestBuilder::new()
.method(Method::Get)
.url(&types::PaymentsSyncType::get_url(self, req, connectors)?)
.attach_default_headers()
.headers(types::PaymentsSyncType::get_headers(self, req, connectors)?)
.build(),
))
}
fn handle_response(
&self,
data: &PaymentsSyncRouterData,
event_builder: Option<&mut ConnectorEvent>,
res: Response,
) -> CustomResult<PaymentsSyncRouterData, errors::ConnectorError> {
let response: unified_authentication_service::UnifiedAuthenticationServicePaymentsResponse =
res.response
.parse_struct("unified_authentication_service PaymentsSyncResponse")
.change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
event_builder.map(|i| i.set_response_body(&response));
router_env::logger::info!(connector_response=?response);
RouterData::try_from(ResponseRouterData {
response,
data: data.clone(),
http_code: res.status_code,
})
}
fn get_error_response(
&self,
res: Response,
event_builder: Option<&mut ConnectorEvent>,
) -> CustomResult<ErrorResponse, errors::ConnectorError>
- impl: impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for UnifiedAuthenticationService
Add:
- impl: impl api::UnifiedAuthenticationService for UnifiedAuthenticationService
- impl: impl api::UasPreAuthentication for UnifiedAuthenticationService
- impl: impl api::UasPostAuthentication for UnifiedAuthenticationService
**crates/hyperswitch_connectors/src/connectors/unified_authentication_service/transformers.rs**
Remove:
- function: private::from
- function: private::from
- struct: pub::UnifiedAuthenticationServicePaymentsRequest
- struct: pub::UnifiedAuthenticationServicePaymentsResponse
- enum: pub::UnifiedAuthenticationServicePaymentStatus
- impl: impl From<(StringMinorUnit, T)> for UnifiedAuthenticationServiceRouterData<T>
- impl: impl From<UnifiedAuthenticationServicePaymentStatus> for common_enums::AttemptStatus
Add:
- struct: pub::UnifiedAuthenticationServicePreAuthenticateRequest
- struct: pub::PaymentDetails
- struct: pub::TransactionDetails
- struct: pub::ThreeDSData
- struct: pub::Acquirer
- struct: pub::BrowserInfo
- struct: pub::AuthenticationInfo
- struct: pub::CtpServiceDetails
- struct: pub::ServiceSessionIds
- struct: pub::MerchantDetails
- struct: pub::Address
- enum: pub::AuthType
**crates/hyperswitch_connectors/src/constants.rs**
Modify existing code
**crates/hyperswitch_connectors/src/default_implementations.rs**
Modify existing code
**crates/hyperswitch_connectors/src/default_implementations_v2.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payment_method_data.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_flow_types.rs**
Add:
- mod: pub::unified_authentication_service
**crates/hyperswitch_domain_models/src/router_flow_types/unified_authentication_service.rs**
Add:
- struct: pub::PreAuthenticate
- struct: pub::PostAuthenticate
**crates/hyperswitch_domain_models/src/router_request_types/unified_authentication_service.rs**
Remove:
- struct: pub::UasPostAuthenticationRequestData
Add:
- struct: pub::UasPostAuthenticationRequestData
**crates/hyperswitch_domain_models/src/types.rs**
Modify existing code
**crates/hyperswitch_interfaces/src/api.rs**
Add:
- trait: pub::UnifiedAuthenticationService
- trait: pub::UasPreAuthentication
- trait: pub::UasPostAuthentication
- trait: pub::UnifiedAuthenticationServiceV2
- trait: pub::UasPreAuthenticationV2
- trait: pub::UasPostAuthenticationV2
**crates/hyperswitch_interfaces/src/configs.rs**
Add:
- function: pub::validate
- struct: pub::NoParams
- impl: impl NoParams
**crates/hyperswitch_interfaces/src/types.rs**
Modify existing code
**crates/router/src/connector.rs**
Modify existing code
**crates/router/src/connector/adyen/transformers.rs**
Remove:
- function: private::get_optional_shopper_email
Add:
- function: private::try_from
- function: private::try_from
- impl: impl TryFrom<(&domain::NetworkTokenData, Option<Secret<String>>)> for AdyenPaymentMethod<'_>
- impl: impl TryFrom<(
&AdyenRouterData<&types::PaymentsAuthorizeRouterData>,
&domain::NetworkTokenData,
)> for AdyenPaymentRequest<'_>
**crates/router/src/core/admin.rs**
Modify existing code
**crates/router/src/core/payment_methods.rs**
Modify existing code
**crates/router/src/core/payment_methods/network_tokenization.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/core/payments/connector_integration_v2_impls.rs**
Remove:
- impl: impl api::UasPreAuthenticationV2 for $connector
- impl: impl api::UasPostAuthenticationV2 for $connector
Add:
- impl: impl UasPreAuthenticationV2 for $connector
- impl: impl UasPostAuthenticationV2 for $connector
**crates/router/src/core/payments/flows.rs**
Remove:
- impl: impl api::UnifiedAuthenticationService for connector::DummyConnector<T>
**crates/router/src/core/payments/helpers.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_complete_authorize.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_confirm.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_create.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_update.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
**crates/router/src/core/unified_authentication_service.rs**
Modify existing code
**crates/router/src/core/unified_authentication_service/transformers.rs**
Modify existing code
**crates/router/src/core/unified_authentication_service/types.rs**
Modify existing code
**crates/router/src/types/api.rs**
Remove:
- mod: pub::unified_authentication_service
- mod: pub::unified_authentication_service_v2
**crates/router/src/types/api/authentication.rs**
Modify existing code
**crates/router/src/types/api/unified_authentication_service.rs**
Remove:
- struct: pub::PreAuthenticate
- struct: pub::PostAuthenticate
- trait: pub::UnifiedAuthenticationService
- trait: pub::UasPreAuthentication
- trait: pub::UasPostAuthentication
**crates/router/src/types/api/unified_authentication_service_v2.rs**
Remove:
- trait: pub::UnifiedAuthenticationServiceV2
- trait: pub::UasPreAuthenticationV2
- trait: pub::UasPostAuthenticationV2
**crates/router/src/types/transformers.rs**
Modify existing code | {"issue_number": 1, "pr_number": 6769, "commits_count": 1, "files_changed": 30, "response_length": 11983, "file_count": 42, "needs_breakdown": true} |
[REFACTOR] : [Multisafepay] Error Message For Connector Implementation
### :memo: Feature Description
- In terms of errors, we are currently throwing a 'not supported' message, which shouldn't be the case as we are yet to decide on the implementation.
### :hammer: Possible Implementation
- In order to manage payment methods that are not implemented by Hyperswitch or yet to be implemented, the connector transformers file should make use of the NotImplemented ConnectorError enum variant.
- By doing so, we will throw same error message for all the Connector Implementation
- You can check this PR for further reference https://github.com/juspay/hyperswitch/pull/2831
:bookmark: Note: All the changes needed should be contained within `hyperswitch/crates/router/src/connector/`
### :package: Have you spent some time checking if this feature request has been raised before?
- [X] I checked and didn't find a similar issue
### :package: Have you read the Contributing Guidelines?
- [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md)
### :sparkles: Are you willing to submit a PR?
| <think>
PR Context:
- Title: refactor(connector): [Multisafe Pay] change error message from not supported to not implemented
- Merged: 2023-11-30T19:06:32Z
- Files changed: 1 files
- Commits: 3 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding ch
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** refactor(connector): [Multisafe Pay] change error message from not supported to not implemented (#28
Files to modify:
**crates/router/src/connector/multisafepay/transformers.rs**
Modify existing code | {"issue_number": 2842, "pr_number": 2851, "commits_count": 1, "files_changed": 1, "response_length": 1031, "file_count": 3, "needs_breakdown": false} |
[FEATURE]: [Dlocal] Use `connector_response_reference_id` as reference to merchant
### :memo: Feature Description
- Reference id are used to map transactions in the connector’s dashboard.
- Hyperswitch manages several reference ids, such as `payment_id`, `attempt_id`, and `connector_transaction_id` for a single transaction.
- However, merchants may encounter uncertainty when determining which ID to utilize in the connector dashboard to identify the payment.
### :hammer: Possible Implementation
- When we receive a response from the connector for the payment, we deserialize it and populate the `response` field in RouterData.
- For the `TransactionResponse` type, we must fill the `connector_response_reference_id` with a corresponding reference id for the merchant to identify the transaction.
- One might need to have exposure to api docs of the connector for which it is being implemented to decide what to fill in connector_response_reference_id.
- You can check this PR for further reference https://github.com/juspay/hyperswitch/pull/1735
🔖 Note: All the changes needed should be contained within `hyperswitch/crates/router/src/connector/`
### :package: Have you spent some time checking if this feature request has been raised before?
- [X] I checked and didn't find a similar issue
### :package: Have you read the Contributing Guidelines?
- [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md)
### :sparkles: Are you willing to submit a PR?
| <think>
PR Context:
- Title: feat(connector): [Dlocal] Use connector_response_reference_id as reference to merchant
- Merged: 2023-10-15T09:15:45Z
- Files changed: 1 files
- Commits: 9 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
I have populated the 'id' which is provided as a payment-specific ID in their response to then be populated as 'connector_reference_id'. As per the docs they don't require a payment reference ID in their payment requests. So populated t
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat(connector): [Dlocal] Use connector_response_reference_id as reference to merchant (#2446)
Files to modify:
**crates/router/src/connector/dlocal/transformers.rs**
Modify existing code | {"issue_number": 2328, "pr_number": 2446, "commits_count": 1, "files_changed": 1, "response_length": 1010, "file_count": 3, "needs_breakdown": false} |
Vault connector changes
Need to implement Vault Retrieve for VGS | <think>
PR Context:
- Title: feat(connector): Add VGS connector impls
- Merged: 2025-08-25T09:52:19Z
- Files changed: 14 files
- Commits: 13 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
- Added Connector changes for VGS
- Implemented `ExternalVaultInsertFlow` and `ExternalVaultRetrieveFlow` for VGS
- This allows Payment methods to be vaulted in VGS when `is_external_vault_enabled` is set to true in profile
- Updated VGS UR
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat(connector): Add VGS connector impls (#7942)
Files to modify:
**crates/hyperswitch_connectors/src/connectors/vgs.rs**
Remove:
- function: pub::new
- function: private::get_headers
- function: private::get_content_type
- function: private::get_url
- function: private::get_request_body
- function: private::build_request
- function: private::handle_response
- function: private::get_error_response
- function: private::get_headers
- function: private::get_content_type
- function: private::build_request
- function: private::handle_response
- function: private::get_error_response
- function: private::get_content_type
- function: private::get_url
- function: private::get_headers
- function: private::get_content_type
- function: private::get_request_body
- function: private::build_request
- function: private::handle_response
- function: private::get_error_response
- function: private::get_content_type
- struct: pub::Vgs
- impl: impl Vgs
- impl: impl ConnectorValidation for Vgs
- impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Vgs
- impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Vgs
- impl: impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Vgs
- impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Vgs
- impl: impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Vgs
Add:
- struct: pub::Vgs
- impl: impl api::ExternalVaultInsert for Vgs
- impl: impl api::ExternalVault for Vgs
- impl: impl api::ExternalVaultRetrieve for Vgs
- impl: impl ConnectorValidation for Vgs
- impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Vgs
- impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Vgs
- impl: impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Vgs
- impl: impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for Vgs
- impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Vgs
- impl: impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Vgs
- impl: impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Vgs
- impl: impl ConnectorIntegration<ExternalVaultInsertFlow, VaultRequestData, VaultResponseData> for vgs::VgsInsertRequest::try_from(req)
**crates/hyperswitch_connectors/src/connectors/vgs/transformers.rs**
Remove:
- function: private::try_from
- struct: pub::VgsPaymentsRequest
Add:
- struct: pub::VgsTokenRequestItem
**crates/hyperswitch_connectors/src/default_implementations.rs**
Modify existing code
**crates/router/src/core/payment_methods.rs**
Modify existing code
**crates/router/src/types/api/connector_mapping.rs**
Modify existing code
**crates/router/src/types/api/feature_matrix.rs**
Modify existing code
**crates/router/tests/connectors/vgs.rs**
Modify existing code | {"issue_number": 9023, "pr_number": 7942, "commits_count": 1, "files_changed": 14, "response_length": 3938, "file_count": 9, "needs_breakdown": false} |
fix: revert mget use authorization
In the hosted environment, where we have multiple redis clusters `mget` is not working as expected and throwing the following error: `Unknown Error: CROSSSLOT Keys in request don't hash to the same slot`.
Temporary fix is to revert the PR which is using `mget` | <think>
PR Context:
- Title: fix(users): revert using mget in authorization
- Merged: 2024-03-07T08:22:10Z
- Files changed: 1 files
- Commits: 1 commits
Implementation approach:
## Description
`mget` is not working in the hosted version. So, this PR will revert the #3945 which uses `mget``.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** fix(users): revert using mget in authorization (#3999)
Files to modify:
**crates/router/src/services/authentication/blacklist.rs**
Modify existing code | {"issue_number": 4000, "pr_number": 3999, "commits_count": 1, "files_changed": 1, "response_length": 934, "file_count": 3, "needs_breakdown": false} |
[BUG] payout routing for Sepa transactions result in a 4xx error
### Bug Description
Creating payout transactions for SEPA are resulting in a 4xx error with below message.
```
{
"error": {
"type": "invalid_request",
"message": "No eligible connector was found for the current payment method configuration",
"code": "IR_39"
}
}
```
### Expected Behavior
Payout transactions for SEPA should be routed through eligible connectors.
### Actual Behavior
Payout routing fails to get an eligible connector for SEPA bank transfers.
### Steps To Reproduce
1. Create Wise connector
2. Try creating a SEPA payout
3. It should throw below error response
```
{
"error": {
"type": "invalid_request",
"message": "No eligible connector was found for the current payment method configuration",
"code": "IR_39"
}
}
```
### Context For The Bug
This is happening due to a mismatch in what is configured for available payment methods during MCA creation - which stores `sepa` as payment method type in DB - vs what is used during payout routing - which uses `sepa_bank_transfer` for SEPA transactions.
MCA creation on dashboard uses a wasm build which contains the info for enabling the right payment method types for payouts. It is configured to use `sepa` instead of `sepa_bank_transfer` (which is being used in the payout flow).
There was an activity to rename `Sepa` to `SepaBankTransfer` recently. More details [here](https://github.com/juspay/hyperswitch/pull/7575).
### Have you spent some time checking if this bug has been raised before?
- [x] I checked and didn't find a similar issue
### Have you read the Contributing Guidelines?
- [x] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md)
### Are you willing to submit a PR?
Yes, I am willing to submit a PR! | <think>
PR Context:
- Title: chore(wasm): update sepa to sepa_bank_transfer for payout MCAs
- Merged: 2025-09-25T07:49:03Z
- Files changed: 3 files
- Commits: 1 commits
Implementation approach:
## Description
This PR updates the payout MCA creation to use `sepa_bank_transfer` instead of `sepa`.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Prov
</think>
To implement this, you'll need to modify:
(No detailed commit information available) | {"issue_number": 8168, "pr_number": 9536, "commits_count": 0, "files_changed": 3, "response_length": 792, "file_count": 0, "needs_breakdown": false} |
feat(connector): [Square] Use connector_request_reference_id as reference to connector.
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Using connector_request_reference_id as reference to the connector. This PR closes https://github.com/juspay/hyperswitch/issues/2318.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Make any Payment for connector Square and see that you are getting "reference_id" field in the logs of payment request.
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
- [ ] I added a [CHANGELOG](/CHANGELOG.md) entry if applicable
| <think>
PR Context:
- Title: feat(connector): [RISKIFIED] Add support for riskified frm connector
- Merged: 2023-12-12T13:23:22Z
- Files changed: 30 files
- Commits: 30 commits
Implementation approach:
## Description
Add support for Riskified FRM Connector.
This PR resolves the problem mentioned in issue [#2453](https://github.com/juspay/hyperswitch-cloud/issues/2453).
## Test Cases
1.Create a Merchant Account with frm enabled
2.Create an API key
3.Create a Stripe MCA
4.Create a Riskified
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat(connector): [RISKIFIED] Add support for riskified frm connector (#2533)
Co-authored-by: github-
Files to modify:
**crates/api_models/src/enums.rs**
Modify existing code
**crates/api_models/src/payments.rs**
Add:
- enum: pub::ProductType
**crates/common_enums/src/enums.rs**
Modify existing code
**crates/router/src/configs/settings.rs**
Modify existing code
**crates/router/src/connector.rs**
Add:
- mod: pub::riskified
**crates/router/src/connector/riskified.rs**
Add:
- function: pub::generate_authorization_signature
- function: private::build_headers
- function: private::id
- function: private::common_get_content_type
- function: private::base_url
- function: private::build_error_response
- function: private::get_headers
- function: private::get_content_type
- function: private::get_url
- function: private::get_request_body
- function: private::build_request
- function: private::handle_response
- function: private::get_error_response
- function: private::get_headers
- function: private::get_content_type
- function: private::get_url
- function: private::get_request_body
- function: private::build_request
- function: private::handle_response
- function: private::get_error_response
- function: private::get_headers
- function: private::get_content_type
- function: private::get_url
- function: private::get_request_body
- function: private::build_request
- function: private::handle_response
- function: private::get_error_response
- function: private::get_webhook_object_reference_id
- function: private::get_webhook_event_type
- function: private::get_webhook_resource_object
- struct: pub::Riskified
- impl: impl Riskified
- impl: impl ConnectorCommonExt<Flow, Request, Response> for Riskified
- impl: impl ConnectorCommon for Riskified
- impl: impl ConnectorIntegration<
frm_api::Checkout,
frm_types::FraudCheckCheckoutData,
frm_types::FraudCheckResponseData,
> for Riskified
- impl: impl api::Payment for Riskified
- impl: impl api::PaymentAuthorize for Riskified
- impl: impl api::PaymentSync for Riskified
- impl: impl api::PaymentVoid for Riskified
- impl: impl api::PaymentCapture for Riskified
- impl: impl api::MandateSetup for Riskified
- impl: impl api::ConnectorAccessToken for Riskified
- impl: impl api::PaymentToken for Riskified
- impl: impl api::Refund for Riskified
- impl: impl api::RefundExecute for Riskified
- impl: impl api::RefundSync for Riskified
- impl: impl ConnectorValidation for Riskified
- impl: impl ConnectorIntegration<
frm_api::Sale,
frm_types::FraudCheckSaleData,
frm_types::FraudCheckResponseData,
> for Riskified
- impl: impl ConnectorIntegration<
frm_api::Transaction,
frm_types::FraudCheckTransactionData,
frm_types::FraudCheckResponseData,
> for Riskified
- impl: impl ConnectorIntegration<
frm_api::Fulfillment,
frm_types::FraudCheckFulfillmentData,
frm_types::FraudCheckResponseData,
> for Riskified
- impl: impl ConnectorIntegration<
frm_api::RecordReturn,
frm_types::FraudCheckRecordReturnData,
frm_types::FraudCheckResponseData,
> for Riskified
- impl: impl ConnectorIntegration<
api::PaymentMethodToken,
types::PaymentMethodTokenizationData,
types::PaymentsResponseData,
> for Riskified
- impl: impl ConnectorIntegration<api::AccessTokenAuth, types::AccessTokenRequestData, types::AccessToken> for Riskified
- impl: impl ConnectorIntegration<
api::SetupMandate,
types::SetupMandateRequestData,
types::PaymentsResponseData,
> for Riskified
- impl: impl api::PaymentSession for Riskified
- impl: impl ConnectorIntegration<api::Session, types::PaymentsSessionData, types::PaymentsResponseData> for Riskified
- impl: impl ConnectorIntegration<api::Capture, types::PaymentsCaptureData, types::PaymentsResponseData> for Riskified
- impl: impl ConnectorIntegration<api::PSync, types::PaymentsSyncData, types::PaymentsResponseData> for Riskified
- impl: impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::PaymentsResponseData> for Riskified
- impl: impl ConnectorIntegration<api::Void, types::PaymentsCancelData, types::PaymentsResponseData> for Riskified
- impl: impl ConnectorIntegration<api::Execute, types::RefundsData, types::RefundsResponseData> for Riskified
- impl: impl ConnectorIntegration<api::RSync, types::RefundsData, types::RefundsResponseData> for Riskified
- impl: impl api::FraudCheck for Riskified
- impl: impl frm_api::FraudCheckSale for Riskified
- impl: impl frm_api::FraudCheckCheckout for Riskified
- impl: impl frm_api::FraudCheckTransaction for Riskified
- impl: impl frm_api::FraudCheckFulfillment for Riskified
- impl: impl frm_api::FraudCheckRecordReturn for Riskified
- impl: impl api::IncomingWebhook for Riskified
- mod: pub::transformers
**crates/router/src/connector/riskified/transformers.rs**
Add:
- mod: pub::api
- mod: pub::auth
**crates/router/src/connector/riskified/transformers/api.rs**
Add:
- function: private::try_from
- function: private::try_from
- function: private::from
- function: private::try_from
- function: private::try_from
- function: private::try_from
- function: private::try_from
- function: private::try_from
- function: private::try_from
- function: private::get_fulfillment_status
- struct: pub::RiskifiedPaymentsCheckoutRequest
- struct: pub::CheckoutRequest
- struct: pub::PaymentDetails
- struct: pub::ShippingLines
- struct: pub::DiscountCodes
- struct: pub::ClientDetails
- struct: pub::RiskifiedCustomer
- struct: pub::OrderAddress
- struct: pub::LineItem
- struct: pub::RiskifiedMetadata
- struct: pub::RiskifiedPaymentsResponse
- struct: pub::OrderResponse
- struct: pub::RiskifiedFulfilmentResponse
- struct: pub::OrderFulfilmentResponse
- struct: pub::TransactionFailedRequest
- struct: pub::FailedTransactionData
- struct: pub::DeclinedPaymentDetails
- struct: pub::AuthorizationError
- struct: pub::RiskifiedFailedTransactionResponse
- struct: pub::TransactionSuccessRequest
- struct: pub::SuccessfulTransactionData
- struct: pub::TransactionDecisionData
- struct: pub::TransactionPaymentDetails
- struct: pub::RiskifiedFullfillmentRequest
- struct: pub::OrderFullfillment
- struct: pub::FulfilmentData
- struct: pub::ErrorResponse
- struct: pub::ErrorData
- enum: pub::CustomerAccountType
- enum: pub::Source
- enum: pub::FulfilmentStatus
- enum: pub::PaymentStatus
- enum: pub::RiskifiedTransactionResponse
- enum: pub::TransactionStatus
- enum: pub::FulfillmentRequestStatus
- impl: impl TryFrom<&frm_types::FrmCheckoutRouterData> for RiskifiedPaymentsCheckoutRequest
- impl: impl TryFrom<ResponseRouterData<F, RiskifiedPaymentsResponse, T, frm_types::FraudCheckResponseData>> for types::RouterData<F, T, frm_types::FraudCheckResponseData>
- impl: impl From<PaymentStatus> for storage_enums::FraudCheckStatus
- impl: impl TryFrom<&frm_types::FrmTransactionRouterData> for TransactionFailedRequest
- impl: impl TryFrom<
ResponseRouterData<
F,
RiskifiedFailedTransactionResponse,
T,
frm_types::FraudCheckResponseData,
>,
> for types::RouterData<F, T, frm_types::FraudCheckResponseData>
- impl: impl TryFrom<&frm_types::FrmTransactionRouterData> for TransactionSuccessRequest
- impl: impl TryFrom<&frm_types::FrmFulfillmentRouterData> for RiskifiedFullfillmentRequest
- impl: impl TryFrom<
ResponseRouterData<
Fulfillment,
RiskifiedFulfilmentResponse,
frm_types::FraudCheckFulfillmentData,
frm_types::FraudCheckResponseData,
>,
> for types::RouterData<
Fulfillment,
frm_types::FraudCheckFulfillmentData,
frm_types::FraudCheckResponseData,
>
- impl: impl TryFrom<&api_models::payments::Address> for OrderAddress
**crates/router/src/connector/riskified/transformers/auth.rs**
Add:
- function: private::try_from
- struct: pub::RiskifiedAuthType
- impl: impl TryFrom<&types::ConnectorAuthType> for RiskifiedAuthType
**crates/router/src/connector/signifyd.rs**
Modify existing code
**crates/router/src/connector/signifyd/transformers/api.rs**
Modify existing code
**crates/router/src/connector/utils.rs**
Add:
- function: private::get_billing_address_with_phone_number
- function: private::get_shipping_address_with_phone_number
- function: private::get_browser_info
- function: private::get_browser_info
- function: private::is_payment_successful
- trait: pub::AccessPaymentAttemptInfo
- trait: pub::PaymentsAttemptData
- trait: pub::FrmTransactionRouterDataRequest
- impl: impl AccessPaymentAttemptInfo for PaymentAttempt
- impl: impl PaymentsAttemptData for PaymentAttempt
- impl: impl FrmTransactionRouterDataRequest for fraud_check::FrmTransactionRouterData
**crates/router/src/core/admin.rs**
Modify existing code
**crates/router/src/core/fraud_check.rs**
Modify existing code
**crates/router/src/core/fraud_check/flows/checkout_flow.rs**
Modify existing code
**crates/router/src/core/fraud_check/flows/fulfillment_flow.rs**
Modify existing code
**crates/router/src/core/fraud_check/flows/record_return.rs**
Modify existing code
**crates/router/src/core/fraud_check/flows/sale_flow.rs**
Modify existing code
**crates/router/src/core/fraud_check/flows/transaction_flow.rs**
Modify existing code
**crates/router/src/core/fraud_check/operation/fraud_check_post.rs**
Modify existing code
**crates/router/src/core/fraud_check/operation/fraud_check_pre.rs**
Modify existing code
**crates/router/src/core/fraud_check/types.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/core/payments/flows.rs**
Modify existing code
**crates/router/src/core/payments/helpers.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_approve.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_cancel.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_capture.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_complete_authorize.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_confirm.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_create.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_method_validate.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_reject.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_session.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_start.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_status.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_update.rs**
Modify existing code
**crates/router/src/core/payments/operations/payments_incremental_authorization.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
**crates/router/src/core/utils.rs**
Modify existing code
**crates/router/src/core/webhooks/utils.rs**
Modify existing code
**crates/router/src/openapi.rs**
Modify existing code
**crates/router/src/types.rs**
Modify existing code
**crates/router/src/types/api.rs**
Modify existing code
**crates/router/src/types/api/fraud_check.rs**
Modify existing code
**crates/router/src/types/api/verify_connector.rs**
Modify existing code
**crates/router/src/types/fraud_check.rs**
Modify existing code
**crates/router/src/types/transformers.rs**
Modify existing code
**crates/router/tests/connectors/aci.rs**
Modify existing code
**crates/router/tests/connectors/payme.rs**
Modify existing code
**crates/router/tests/connectors/utils.rs**
Modify existing code
**crates/router/tests/connectors/zen.rs**
Modify existing code | {"issue_number": 2453, "pr_number": 2533, "commits_count": 1, "files_changed": 30, "response_length": 13334, "file_count": 54, "needs_breakdown": true} |
[REFACTOR] provide an identifier for the api key in the expiry reminder email
### Issue Description:
Currently, our system sends out reminder emails to merchants when their API key is about to expire. However, since merchants can create multiple API keys, the email lacks clarity on which specific API key is expiring.
### Proposed Solution:
Refactor the api key expiry reminder workflow to include the name and prefix of the expiring API key in email. This will help merchants easily identify which API key requires attention without confusion.
### Details:
Update the email template to include the following information:
API Key Name along with Prefix in below format -
`API_KEY_NAME [PREFIX]`
### Reference:
Check `ApiKeyExpiryTrackingData` type in https://github.com/juspay/hyperswitch/blob/2c95dcd19778726f476b219271dc42da182088af/crates/diesel_models/src/api_keys.rs
| <think>
PR Context:
- Title: refactor(api_keys): provide identifier for api key in the expiry reminder email
- Merged: 2024-03-04T14:19:34Z
- Files changed: 5 files
- Commits: 4 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
Refactored the api key expiry reminder workflow to include the name and prefix of the expiring API key in the email
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** refactor(api_keys): provide identifier for api key in the expiry reminder email (#3888)
Co-authored-
Files to modify:
**crates/diesel_models/src/api_keys.rs**
Modify existing code
**crates/router/src/core/api_keys.rs**
Modify existing code
**crates/router/src/services/email/types.rs**
Modify existing code
**crates/router/src/workflows/api_key_expiry.rs**
Modify existing code | {"issue_number": 3801, "pr_number": 3888, "commits_count": 1, "files_changed": 5, "response_length": 1202, "file_count": 6, "needs_breakdown": false} |
[FEATURE]: Add `Payment Method - Delete` endpoint to payment methods session for V2
Required for Payment Methods Service | <think>
PR Context:
- Title: feat(router): Add payment_methods_session_delete_payment_method endpoint [V2]
- Merged: 2025-03-27T12:05:05Z
- Files changed: 11 files
- Commits: 12 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
This endpoint allows deleting saved payment methods for a customer
### Additional Changes
- [x] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat(router): Add payment_methods_session_delete_payment_method endpoint [V2] (#7409)
Co-authored-by
Files to modify:
**crates/api_models/src/payment_methods.rs**
Add:
- struct: pub::PaymentMethodSessionDeleteSavedPaymentMethod
**crates/openapi/src/openapi_v2.rs**
Modify existing code
**crates/openapi/src/routes/payment_method.rs**
Add:
- function: pub::payment_method_session_delete_saved_payment_method
**crates/router/src/core/payment_methods.rs**
Add:
- function: pub::payment_methods_session_delete_payment_method
**crates/router/src/routes/app.rs**
Modify existing code
**crates/router/src/routes/lock_utils.rs**
Modify existing code
**crates/router/src/routes/payment_methods.rs**
Add:
- function: pub::payment_method_session_delete_saved_payment_method
**crates/router_env/src/logger/types.rs**
Modify existing code | {"issue_number": 7407, "pr_number": 7409, "commits_count": 1, "files_changed": 11, "response_length": 1678, "file_count": 10, "needs_breakdown": false} |
Adding new logo in API ref and Readme | <think>
PR Context:
- Title: docs: add new logos for README and API reference
- Merged: 2024-12-10T11:57:39Z
- Files changed: 6 files
- Commits: 15 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding ch
</think>
To implement this, you'll need to modify:
(No detailed commit information available) | {"issue_number": 6782, "pr_number": 6783, "commits_count": 0, "files_changed": 6, "response_length": 779, "file_count": 0, "needs_breakdown": false} |
[FEATURE] Extend storage of additional payment method details to wallets
### Feature Description
Wallet integrations like ApplePay and GooglePay makes use of a tokenized network token which is collected on client's device and sent to underlying PSPs for completing the txns. The intermediary parties do not have any access to the raw payment method data details. However, these wallets also has some metadata for identification and display purposes. These details are to be stored and propagated in payments response.
### Possible Implementation
HyperSwitch supports loads of wallet integrations today. As a first cut, add additional payment method details to below wallets
- ApplePay
- GooglePay
### Have you spent some time checking if this feature request has been raised before?
- [X] I checked and didn't find a similar issue
### Have you read the Contributing Guidelines?
- [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md)
### Are you willing to submit a PR?
Yes, I am willing to submit a PR! | <think>
PR Context:
- Title: feat(payments): store and propagate additional wallet pm details in payments response
- Merged: 2024-09-19T13:50:57Z
- Files changed: 7 files
- Commits: 6 commits
Implementation approach:
## Description
Described in #5868
### Additional Changes
- [x] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat(payments): store and propagate additional wallet pm details in payments response (#5869)
Co-aut
Files to modify:
**crates/api_models/src/payments.rs**
Modify existing code
**crates/api_models/src/payments/additional_info.rs**
Add:
- struct: pub::WalletAdditionalDataForCard
**crates/openapi/src/openapi.rs**
Modify existing code
**crates/openapi/src/openapi_v2.rs**
Modify existing code
**crates/router/src/core/payments/helpers.rs**
Modify existing code | {"issue_number": 5868, "pr_number": 5869, "commits_count": 1, "files_changed": 7, "response_length": 1297, "file_count": 7, "needs_breakdown": false} |
[REFACTOR] Update KafkaStore to hold variables for tenant ID
Update the [`KafkaStore`](https://github.com/juspay/hyperswitch/blob/c20ecb855aa3c4b3ce1798dcc19910fb38345b46/crates/router/src/db/kafka_store.rs#L75-L79) to hold a variable for tenant-ID.
This can be achieved by simply adding a new field in the `KafkaStore` struct.
Update the KafkaStore constructor method to accept a Tenant-ID.
Tenant-ID can be a new type field backed by a string;
```rust
pub struct TenantID(String);
```
For now the KafkaStore can be initialized with a fixed tenantID `"default"` | <think>
PR Context:
- Title: refactor(db): Add TenantId field to the KafkaStore struct
- Merged: 2024-05-08T13:19:57Z
- Files changed: 3 files
- Commits: 7 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
- Add TenantId field to the KafkaStore struct
- Add the tenant_id parameter to the constructor of Kafkastore
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] T
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** refactor(db): Add TenantId field to the KafkaStore struct (#4512)
Files to modify:
**crates/router/src/db.rs**
Remove:
- mod: private::kafka_store
Add:
- mod: pub::kafka_store
**crates/router/src/db/kafka_store.rs**
Add:
- struct: pub::TenantID
**crates/router/src/routes/app.rs**
Modify existing code | {"issue_number": 4496, "pr_number": 4512, "commits_count": 1, "files_changed": 3, "response_length": 1115, "file_count": 5, "needs_breakdown": false} |
bug(users): Mark users as verified if user comes from SSO
- Currently we are not marking users as verified if they use SSO to login.
- But if there is only SSO to login, then they won't be able to verify their email unless they come from the accept invite email.
- Instead, we will mark users coming from SSO as verified. | <think>
PR Context:
- Title: fix(users): Mark user as verified if user logins from SSO
- Merged: 2024-11-29T10:52:38Z
- Files changed: 1 files
- Commits: 1 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
Currently we are not marking users as verified if the user comes from SSO and there is no other way to verify if SSO is the only login method that is available.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This P
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** fix(users): Mark user as verified if user logins from SSO (#6694)
Files to modify:
**crates/router/src/core/user.rs**
Modify existing code | {"issue_number": 6693, "pr_number": 6694, "commits_count": 1, "files_changed": 1, "response_length": 932, "file_count": 3, "needs_breakdown": false} |
[FEATURE] Allow rotating and revoking API keys
### Feature Description
As of now, the `merchant_account` table has an `api_key` field which restricts a merchant account to only have one API key. Furthermore, there are no mechanisms in place to revoke and regenerate API keys. To improve the convenience of rotating and revoking API keys, it'd be better to allow multiple API keys to be associated with a merchant account. Furthermore, API keys are stored in plaintext as of now. It'd be great if they could be hashed as well, when this request is addressed.
### Possible Implementation
A possible approach to address this is to add an `api_keys` table with `name`, `merchant_id`, `hashed_key` fields (including any additional fields as necessary). And for the API interface, this could include endpoints to create, retrieve, update and revoke an API key, and an endpoint to list all API keys associated with the current merchant account.
### Have you spent some time to check if this feature request has been raised before?
- [X] I checked and didn't find similar issue
### Have you read the Contributing Guidelines?
- [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md)
### Are you willing to submit a PR?
Yes I am willing to submit a PR! | <think>
PR Context:
- Title: feat(router): implement API endpoints for managing API keys
- Merged: 2023-02-10T09:06:18Z
- Files changed: 30 files
- Commits: 21 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
This PR implements the endpoints to create, retrieve, update, revoke and list API keys.
- As of now, the `last_used` field is included in the storage model, but I don't expect it to be actively used until API keys are cached in Redis or in-memory.
- The endpoints use admi
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat(router): implement API endpoints for managing API keys (#511)
Files to modify:
**crates/api_models/src/api_keys.rs**
Add:
- function: private::from
- function: private::from
- function: pub::serialize
- function: pub::deserialize
- function: private::expecting
- function: private::visit_str
- function: private::schema
- function: private::test_serialization
- function: private::test_deserialization
- function: private::test_null
- struct: pub::CreateApiKeyRequest
- struct: pub::CreateApiKeyResponse
- struct: pub::RetrieveApiKeyResponse
- struct: pub::UpdateApiKeyRequest
- struct: pub::RevokeApiKeyResponse
- struct: pub::ListApiKeyConstraints
- struct: private::NeverVisitor
- enum: pub::ApiKeyExpiration
- impl: impl From<ApiKeyExpiration> for Option<PrimitiveDateTime>
- impl: impl From<Option<PrimitiveDateTime>> for ApiKeyExpiration
- impl: impl serde::de::Visitor<'de> for NeverVisitor
- impl: impl ToSchema<'a> for ApiKeyExpiration
- mod: private::never
- mod: private::api_key_expiration_tests
**crates/api_models/src/lib.rs**
Add:
- mod: pub::api_keys
**crates/common_utils/src/crypto.rs**
Add:
- function: pub::generate_cryptographically_secure_random_string
- function: pub::generate_cryptographically_secure_random_bytes
**crates/router/src/compatibility/stripe/errors.rs**
Modify existing code
**crates/router/src/consts.rs**
Modify existing code
**crates/router/src/core.rs**
Add:
- mod: pub::api_keys
**crates/router/src/core/admin.rs**
Modify existing code
**crates/router/src/core/api_keys.rs**
Add:
- function: pub::new
- function: pub::new_hash_key
- function: pub::new_key_id
- function: pub::prefix
- function: pub::peek
- function: pub::keyed_hash
- function: pub::verify_hash
- function: pub::create_api_key
- function: pub::retrieve_api_key
- function: pub::update_api_key
- function: pub::revoke_api_key
- function: pub::list_api_keys
- function: private::from
- function: private::test_hashing_and_verification
- struct: pub::PlaintextApiKey
- struct: pub::HashedApiKey
- impl: impl PlaintextApiKey
- impl: impl From<HashedApiKey> for storage::HashedApiKey
- mod: private::tests
**crates/router/src/core/errors.rs**
Add:
- enum: pub::ApiKeyError
**crates/router/src/core/errors/api_error_response.rs**
Modify existing code
**crates/router/src/db.rs**
Add:
- mod: pub::api_keys
**crates/router/src/db/api_keys.rs**
Add:
- function: private::insert_api_key
- function: private::update_api_key
- function: private::revoke_api_key
- function: private::find_api_key_optional
- function: private::list_api_keys_by_merchant_id
- function: private::insert_api_key
- function: private::update_api_key
- function: private::revoke_api_key
- function: private::find_api_key_optional
- function: private::list_api_keys_by_merchant_id
- trait: pub::ApiKeyInterface
- impl: impl ApiKeyInterface for Store
- impl: impl ApiKeyInterface for MockDb
**crates/router/src/lib.rs**
Modify existing code
**crates/router/src/openapi.rs**
Modify existing code
**crates/router/src/routes.rs**
Add:
- mod: pub::api_keys
**crates/router/src/routes/api_keys.rs**
Add:
- function: pub::api_key_create
- function: pub::api_key_retrieve
- function: pub::api_key_update
- function: pub::api_key_revoke
- function: pub::api_key_list
- function: private::get_merchant_id_header
**crates/router/src/routes/app.rs**
Add:
- function: pub::server
- struct: pub::ApiKeys
- impl: impl ApiKeys
**crates/router/src/types/api.rs**
Add:
- mod: pub::api_keys
**crates/router/src/types/api/api_keys.rs**
Modify existing code
**crates/router/src/types/storage.rs**
Add:
- mod: pub::api_keys
**crates/router/src/types/storage/api_keys.rs**
Modify existing code
**crates/router/src/types/transformers.rs**
Add:
- function: private::from
- function: private::from
- function: private::from
- impl: impl From<
F<(
storage_models::api_keys::ApiKey,
crate::core::api_keys::PlaintextApiKey,
)>,
> for F<api_models::api_keys::CreateApiKeyResponse>
- impl: impl From<F<storage_models::api_keys::ApiKey>> for F<api_models::api_keys::RetrieveApiKeyResponse>
- impl: impl From<F<api_models::api_keys::UpdateApiKeyRequest>> for F<storage_models::api_keys::ApiKeyUpdate>
**crates/router_env/src/env.rs**
Add:
- function: pub::prefix_for_env
**crates/router_env/src/logger/types.rs**
Modify existing code
**crates/storage_models/src/api_keys.rs**
Add:
- function: private::from
- function: private::from
- function: private::to_sql
- function: private::from_sql
- function: private::build
- struct: pub::ApiKey
- struct: pub::ApiKeyNew
- struct: pub::ApiKeyUpdateInternal
- struct: pub::HashedApiKey
- enum: pub::ApiKeyUpdate
- impl: impl From<ApiKeyUpdate> for ApiKeyUpdateInternal
- impl: impl From<String> for HashedApiKey
- impl: impl ToSql<Text, DB> for super::HashedApiKey
- impl: impl FromSql<Text, DB> for super::HashedApiKey
- impl: impl Queryable<Text, DB> for super::HashedApiKey
- mod: private::diesel_impl
**crates/storage_models/src/lib.rs**
Add:
- mod: pub::api_keys
**crates/storage_models/src/query.rs**
Add:
- mod: pub::api_keys
**crates/storage_models/src/query/api_keys.rs**
Add:
- function: pub::insert
- function: pub::update_by_key_id
- function: pub::revoke_by_key_id
- function: pub::find_optional_by_key_id
- function: pub::find_by_merchant_id
- impl: impl ApiKeyNew
- impl: impl ApiKey
**crates/storage_models/src/schema.rs**
Modify existing code | {"issue_number": 501, "pr_number": 511, "commits_count": 1, "files_changed": 30, "response_length": 6696, "file_count": 31, "needs_breakdown": true} |
feat(invite): Send email to user if user already exist | <think>
PR Context:
- Title: feat(pm_list): add required fields for google pay
- Merged: 2024-01-31T09:45:43Z
- Files changed: 1 files
- Commits: 9 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
Resolves [#3706](https://github.com/juspay/hyperswitch-cloud/issues/3706)
### Test Cases
Must be tested for each of this connectors
1. Adyen
```
None
```
2.Bluesnap
```
None
```
3.Noon
```
None
```
4.Nuvei
```
None
```
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat(pm_list): add required fields for google pay (#3196)
Co-authored-by: Prasunna Soppa <70575890+p
Files to modify:
**crates/router/src/configs/defaults.rs**
Modify existing code | {"issue_number": 3706, "pr_number": 3196, "commits_count": 1, "files_changed": 1, "response_length": 966, "file_count": 3, "needs_breakdown": false} |
refactor: change create and update role apis to respond with role info | <think>
PR Context:
- Title: refactor(roles): Add more checks in create, update role APIs and change the response type
- Merged: 2024-02-29T14:11:09Z
- Files changed: 4 files
- Commits: 5 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
This PR modifies create and update role APIs. The APIs will now respond with the role created/updated respectively.
This PR also changes the names of predefined roles to snake case.
### Additional Changes
- [x] This PR modifies the API
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** refactor(roles): Add more checks in create, update role APIs and change the response type (#3896)
Files to modify:
**crates/api_models/src/events/user_role.rs**
Modify existing code
**crates/router/src/core/user_role/role.rs**
Modify existing code
**crates/router/src/services/authorization/roles/predefined_roles.rs**
Modify existing code
**crates/router/src/utils/user_role.rs**
Add:
- function: pub::validate_role_groups | {"issue_number": 3895, "pr_number": 3896, "commits_count": 1, "files_changed": 4, "response_length": 1262, "file_count": 6, "needs_breakdown": false} |
feat(single_use): add extra fields in `Mandate` table and `MandateData` [Blocked on #61]
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
## Description
This PR adds single use mandate support and a 2 new fields to the mandate table (i.e. singe_use_amount, single_use_currency)
<!-- Describe your changes in detail -->
### Additional Changes
- [x] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
The change includes the following files.
- migrations/2022-12-05-090521_single_use_mandate_fields/up.sql
- migrations/2022-12-05-090521_single_use_mandate_fields/down.sql
## Motivation and Context
Here, the intension is adding a new Validation feature in PaymentsCore, for that reason following are the steps that the change is broken down to.
1. Create new types for the change #45
2. Introduce the Flow and Connector Integration #47
3. Add Stripe POC #50
4. Introduce the new operation and all the related components in the payments core #53 + #61
5. Changing the `MandateData` type
6. Move the mandate related behaviour to domain
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless its an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed submitted code
- [ ] I added unit tests for my changes where possible
- [ ] I added a [CHANGELOG](/CHANGELOG.md) entry if applicable
| <think>
PR Context:
- Title: feat: add test_mode for quickly testing payout links
- Merged: 2024-08-27T08:31:54Z
- Files changed: 11 files
- Commits: 8 commits
Implementation approach:
## Description
Described in #5668
### Additional Changes
- [x] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat: add test_mode for quickly testing payout links (#5669)
Co-authored-by: hyperswitch-bot[bot] <1
Files to modify:
**crates/api_models/src/admin.rs**
Modify existing code
**crates/api_models/src/payouts.rs**
Modify existing code
**crates/common_utils/src/link_utils.rs**
Modify existing code
**crates/diesel_models/src/business_profile.rs**
Modify existing code
**crates/router/src/core/payout_link.rs**
Modify existing code
**crates/router/src/core/payouts.rs**
Modify existing code
**crates/router/src/core/payouts/validator.rs**
Modify existing code
**crates/router/src/types/transformers.rs**
Modify existing code | {"issue_number": 66, "pr_number": 5669, "commits_count": 1, "files_changed": 11, "response_length": 1431, "file_count": 10, "needs_breakdown": false} |
[FEATURE] Validate card numbers when accepting payment method information
### Feature Description
As of now, we just pass the card information to the payment processor without performing any form of validation on the provided card number. It'd be great if the card number could have been validated on our end whenever a payment is being created or payment method is being created, instead of invalid card numbers being caught by the payment processor.
It'd be preferable if the card number validation logic is included in a new crate called `cards` which would contain this validation of card numbers and card brand identification logic (taken up on #379). This must check that the card number provided is of correct length, and also handle whitespaces being included in the card number input. Please also include unit tests in your PR.
_For external contributors, clarify any questions you may have, and let us know that you're interested in picking this up. We'll assign this issue to you to reduce duplication of effort on the same task._
### Possible Implementation
For validating card numbers, you can use the [Luhn Algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm). I'm thinking of an API like so (refer to [the newtype pattern](https://rust-unofficial.github.io/patterns/patterns/behavioural/newtype.html)):
```rust
use masking::StrongSecret;
struct CardNumber(StrongSecret<String>);
let card_number = CardNumber::from_str("..."); // You can use the `FromStr` trait for this purpose
```
This would ensure that a `CardNumber` once constructed is always valid and no further validation is necessary. You can also implement `Serialize` and `Deserialize` traits on `CardNumber`.
### Have you spent some time to check if this feature request has been raised before?
- [X] I checked and didn't find similar issue
### Have you read the Contributing Guidelines?
- [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md)
### Are you willing to submit a PR?
None | <think>
PR Context:
- Title: feat(cards): add credit card number validation
- Merged: 2023-05-09T15:06:39Z
- Files changed: 30 files
- Commits: 6 commits
Implementation approach:
Fixes #606
## Description
<!-- Describe your changes in detail -->
The PR adds a new crate called `cards`. Which currently just has a single module named validate which exposes the `CardNumber` struct as well as a `CCValError`.
The validation of a correct CC number is done via the Luhn Algorithm implemented in the `luhn` crat
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat(cards): add credit card number validation (#889)
Co-authored-by: Sanchith Hegde <sanchith.hegde
Files to modify:
**connector-template/test.rs**
Remove:
- function: private::should_fail_payment_for_empty_card_number
**connector-template/transformers.rs**
Modify existing code
**crates/api_models/src/payment_methods.rs**
Modify existing code
**crates/api_models/src/payments.rs**
Modify existing code
**crates/cards/src/lib.rs**
Add:
- mod: pub::validate
**crates/cards/src/validate.rs**
Add:
- function: private::from
- function: private::from_str
- function: private::try_from
- function: private::deref
- function: private::deserialize
- function: private::fmt
- function: private::valid_card_number
- function: private::invalid_card_number
- function: private::card_number_no_whitespace
- function: private::test_valid_card_number_masking
- function: private::test_invalid_card_number_masking
- function: private::test_valid_card_number_strong_secret_masking
- function: private::test_valid_card_number_deserialization
- function: private::test_invalid_card_number_deserialization
- struct: pub::CCValError
- struct: pub::CardNumber
- struct: pub::CardNumberStrategy
- impl: impl From<core::convert::Infallible> for CCValError
- impl: impl FromStr for CardNumber
- impl: impl TryFrom<String> for CardNumber
- impl: impl Deref for CardNumber
- impl: impl Deserialize<'de> for CardNumber
- impl: impl Strategy<T> for CardNumberStrategy
- mod: private::tests
**crates/common_utils/src/pii.rs**
Remove:
- function: private::fmt
- function: private::test_valid_card_number_masking
- function: private::test_invalid_card_number_masking
- struct: pub::CardNumber
- impl: impl Strategy<T> for CardNumber
**crates/router/src/compatibility/stripe/payment_intents/types.rs**
Modify existing code
**crates/router/src/compatibility/stripe/setup_intents/types.rs**
Modify existing code
**crates/router/src/connector/aci/transformers.rs**
Modify existing code
**crates/router/src/connector/adyen/transformers.rs**
Modify existing code
**crates/router/src/connector/airwallex/transformers.rs**
Modify existing code
**crates/router/src/connector/authorizedotnet/transformers.rs**
Modify existing code
**crates/router/src/connector/bambora/transformers.rs**
Modify existing code
**crates/router/src/connector/bluesnap/transformers.rs**
Modify existing code
**crates/router/src/connector/braintree/transformers.rs**
Modify existing code
**crates/router/src/connector/checkout/transformers.rs**
Modify existing code
**crates/router/src/connector/cybersource/transformers.rs**
Modify existing code
**crates/router/src/connector/dlocal/transformers.rs**
Modify existing code
**crates/router/src/connector/dummyconnector/transformers.rs**
Modify existing code
**crates/router/src/connector/fiserv/transformers.rs**
Modify existing code
**crates/router/src/connector/forte/transformers.rs**
Modify existing code
**crates/router/src/connector/globalpay/requests.rs**
Modify existing code
**crates/router/src/connector/multisafepay/transformers.rs**
Modify existing code
**crates/router/src/connector/nexinets/transformers.rs**
Modify existing code
**crates/router/src/connector/nuvei/transformers.rs**
Modify existing code
**crates/router/src/connector/payeezy/transformers.rs**
Modify existing code
**crates/router/src/connector/paypal/transformers.rs**
Modify existing code
**crates/router/src/connector/payu/transformers.rs**
Modify existing code
**crates/router/src/connector/rapyd/transformers.rs**
Modify existing code
**crates/router/src/connector/shift4/transformers.rs**
Modify existing code
**crates/router/src/connector/stripe/transformers.rs**
Modify existing code
**crates/router/src/connector/trustpay/transformers.rs**
Modify existing code
**crates/router/src/connector/utils.rs**
Modify existing code
**crates/router/src/connector/worldline/transformers.rs**
Modify existing code
**crates/router/src/connector/worldpay/requests.rs**
Modify existing code
**crates/router/src/connector/zen/transformers.rs**
Modify existing code
**crates/router/src/core/payment_methods/cards.rs**
Modify existing code
**crates/router/src/core/payment_methods/transformers.rs**
Modify existing code
**crates/router/src/core/payment_methods/vault.rs**
Modify existing code
**crates/router/src/lib.rs**
Modify existing code
**crates/router/src/routes/dummy_connector/types.rs**
Modify existing code
**crates/router/src/routes/dummy_connector/utils.rs**
Modify existing code
**crates/router/src/services/api.rs**
Modify existing code
**crates/router/src/types/api/payments.rs**
Modify existing code
**crates/router/tests/connectors/aci.rs**
Modify existing code
**crates/router/tests/connectors/adyen.rs**
Remove:
- function: private::should_fail_payment_for_empty_card_number
**crates/router/tests/connectors/airwallex.rs**
Remove:
- function: private::should_fail_payment_for_empty_card_number
**crates/router/tests/connectors/authorizedotnet.rs**
Modify existing code
**crates/router/tests/connectors/bambora.rs**
Remove:
- function: private::should_fail_payment_for_empty_card_number
**crates/router/tests/connectors/bluesnap.rs**
Remove:
- function: private::should_fail_payment_for_empty_card_number
**crates/router/tests/connectors/checkout.rs**
Remove:
- function: private::should_fail_payment_for_empty_card_number
**crates/router/tests/connectors/coinbase.rs**
Remove:
- function: private::should_fail_payment_for_empty_card_number
**crates/router/tests/connectors/cybersource.rs**
Remove:
- function: private::should_fail_payment_for_no_card_number
**crates/router/tests/connectors/dlocal.rs**
Modify existing code
**crates/router/tests/connectors/dummyconnector.rs**
Remove:
- function: private::should_fail_payment_for_empty_card_number
**crates/router/tests/connectors/fiserv.rs**
Remove:
- function: private::should_fail_payment_for_empty_card_number
**crates/router/tests/connectors/forte.rs**
Remove:
- function: private::should_fail_payment_for_empty_card_number
**crates/router/tests/connectors/globalpay.rs**
Modify existing code
**crates/router/tests/connectors/main.rs**
Modify existing code
**crates/router/tests/connectors/multisafepay.rs**
Remove:
- function: private::should_fail_payment_for_empty_card_number
**crates/router/tests/connectors/nexinets.rs**
Remove:
- function: private::should_fail_payment_for_empty_card_number
**crates/router/tests/connectors/nuvei.rs**
Remove:
- function: private::should_fail_payment_for_empty_card_number
**crates/router/tests/connectors/opennode.rs**
Remove:
- function: private::should_fail_payment_for_empty_card_number
**crates/router/tests/connectors/payeezy.rs**
Remove:
- function: private::should_fail_payment_for_empty_card_number
**crates/router/tests/connectors/paypal.rs**
Remove:
- function: private::should_fail_payment_for_empty_card_number
**crates/router/tests/connectors/rapyd.rs**
Modify existing code
**crates/router/tests/connectors/shift4.rs**
Remove:
- function: private::should_fail_payment_for_empty_card_number
**crates/router/tests/connectors/stripe.rs**
Remove:
- function: private::should_fail_payment_for_no_card_number
**crates/router/tests/connectors/trustpay.rs**
Remove:
- function: private::should_fail_payment_for_empty_card_number
**crates/router/tests/connectors/utils.rs**
Modify existing code
**crates/router/tests/connectors/worldline.rs**
Modify existing code
**crates/router/tests/connectors/zen.rs**
Remove:
- function: private::should_fail_payment_for_empty_card_number
**crates/router/tests/payments.rs**
Modify existing code
**crates/router/tests/payments2.rs**
Modify existing code | {"issue_number": 606, "pr_number": 889, "commits_count": 1, "files_changed": 30, "response_length": 8780, "file_count": 77, "needs_breakdown": true} |
[BUG]: [Adyen] Webhook Psync response Handler
### Bug Description
Currently the Psync response handler for webhook tightly coupled to payments response which is creating a lot of bugs in status and transaction id updates
- Update Psync response handler to consume the incoming webhook response
- Handle Webhook Status Mapping
### Expected Behavior
Decouple the Webhook Response from Payments response and handle all the status and reference ids separately
### Actual Behavior
Currently the Psync response handler for webhook tightly coupled to payments response which is creating a lot of bugs in status and transaction id updates
- Update Psync response handler to consume the incoming webhook response
- Handle Webhook Status Mapping
### Steps To Reproduce
Provide an unambiguous set of steps to reproduce this bug. Include code or configuration to reproduce, if relevant.
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
### Context For The Bug
_No response_
### Environment
Are you using hyperswitch hosted version? Yes/No
If yes, please provide the value of the `x-request-id` response header to help us debug your issue.
If not (or if building/running locally), please provide the following details:
1. Operating System or Linux distribution:
2. Rust version (output of `rustc --version`): ``
3. App version (output of `cargo r --features vergen -- --version`): ``
### Have you spent some time checking if this bug has been raised before?
- [X] I checked and didn't find a similar issue
### Have you read the Contributing Guidelines?
- [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md)
### Are you willing to submit a PR?
Yes, I am willing to submit a PR! | <think>
PR Context:
- Title: fix(connector): [adyen] handle Webhook reference and object
- Merged: 2024-03-06T14:43:23Z
- Files changed: 2 files
- Commits: 5 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
- Update Psync response handler to consume the incoming webhook response
- Handle Webhook Status Mapping
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** fix(connector): [adyen] handle Webhook reference and object (#3976)
Files to modify:
**crates/router/src/connector/adyen.rs**
Add:
- function: private::get_5xx_error_response
- function: private::get_5xx_error_response
- function: private::get_5xx_error_response
- function: private::get_5xx_error_response
- function: private::get_5xx_error_response
- function: private::get_5xx_error_response
- function: private::get_5xx_error_response
- function: private::get_5xx_error_response
- function: private::get_5xx_error_response
- function: private::get_5xx_error_response
- function: private::get_5xx_error_response
**crates/router/src/connector/adyen/transformers.rs**
Add:
- function: private::foreign_try_from
- impl: impl ForeignTryFrom<(bool, AdyenWebhookStatus)> for storage_enums::AttemptStatus | {"issue_number": 3977, "pr_number": 3976, "commits_count": 1, "files_changed": 2, "response_length": 1651, "file_count": 4, "needs_breakdown": false} |
[FEATURE]: [Cybersource] Add 3DS flow for cards
### Feature Description
Add 3DS flow for cards
### Possible Implementation
Add 3DS flow for cards
### Have you spent some time checking if this feature request has been raised before?
- [X] I checked and didn't find a similar issue
### Have you read the Contributing Guidelines?
- [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md)
### Are you willing to submit a PR?
Yes, I am willing to submit a PR! | <think>
PR Context:
- Title: feat(connector): [cybersource] Implement 3DS flow for cards
- Merged: 2024-01-11T15:20:46Z
- Files changed: 13 files
- Commits: 29 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
Implement 3DS flow for cards
```
Legend:
UB: User Browser
M: Merchant
HS: Hyperswitch
CS: Cybersource
```

### Addi
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat(connector): [cybersource] Implement 3DS flow for cards (#3290)
Co-authored-by: DEEPANSHU BANSAL
Files to modify:
**crates/router/src/connector/cybersource.rs**
Add:
- function: private::get_headers
- function: private::get_content_type
- function: private::get_url
- function: private::get_request_body
- function: private::build_request
- function: private::handle_response
- function: private::get_error_response
- function: private::get_error_response
- function: private::get_headers
- function: private::get_content_type
- function: private::get_url
- function: private::get_request_body
- function: private::build_request
- impl: impl api::PaymentsPreProcessing for Cybersource
- impl: impl api::PaymentsCompleteAuthorize for Cybersource
- impl: impl ConnectorIntegration<
api::PreProcessing,
types::PaymentsPreProcessingData,
types::PaymentsResponseData,
> for Cybersource
**crates/router/src/connector/cybersource/transformers.rs**
Remove:
- enum: pub::CybersourceCommerceIndicator
Add:
- function: private::from
- function: private::from
- struct: pub::CybersourceConsumerAuthInformation
- impl: impl From<&CybersourceRouterData<&types::PaymentsCompleteAuthorizeRouterData>> for ClientReferenceInformation
- impl: impl From<(
&CybersourceRouterData<&types::PaymentsCompleteAuthorizeRouterData>,
Option<PaymentSolution>,
&CybersourceConsumerAuthValidateResponse,
)> for ProcessingInformation
**crates/router/src/connector/utils.rs**
Add:
- function: private::get_complete_authorize_url
- function: private::get_complete_authorize_url
**crates/router/src/core/payments.rs**
Add:
- function: pub::is_operation_complete_authorize
**crates/router/src/core/payments/flows.rs**
Modify existing code
**crates/router/src/core/payments/flows/authorize_flow.rs**
Modify existing code
**crates/router/src/core/payments/flows/complete_authorize_flow.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
**crates/router/src/services/api.rs**
Modify existing code
**crates/router/src/types.rs**
Modify existing code | {"issue_number": 3296, "pr_number": 3290, "commits_count": 1, "files_changed": 13, "response_length": 3043, "file_count": 12, "needs_breakdown": false} |
feat(core): Added integrity framework for Authorize and Sync flow with connector as Stripe
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] New feature
## Description
<!-- Describe your changes in detail -->
With this PR, we are implementing connector integrity checks for the authorize and sync flow. After receiving a response from the connector, we will validate on our end whether the data sent to the connector matches the data received from their end.
If the validation fails we will mark the transaction as processing <a non terminal state> so that if the connector fixes the response in sync, the status will move to respective terminal state.
At api level the response will be 5xx with connector_transaction_id <if present> in response for merchant to reference in case if integrity failures for both sync and authorize.
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Since its a blackbox scenario, we cannot test until and unless there is a error data from connectors end!
Local testing scenario
#### Scenario[1] Where Connector send wrong currency in both authorize and sync flow
##### Payments Create
```shell
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_ng5enE9FcquL9C0eYO1Jr0E6U8V8vbriDijpN4EgVpr1o31zWAMrVzkIt3q5ZvRh' \
--data-raw '
{
"amount": 250,
"currency": "USD",
"confirm": true,
"amount_to_capture": 250,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "StripeCustomer123",
"email": "abcdef123@gmail.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Please Pay for your XYZ",
"authentication_type": "no_three_ds",
"return_url": "https://google.com",
"setup_future_usage": "off_session",
"browser_info": {
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "127.0.0.1"
},
"routing": {
"type": "single",
"data": "nmi"
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "08",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"card_cvc": "999"
}
}
}
'
```
<img width="982" alt="Screenshot 2024-06-24 at 4 34 48 PM" src="https://github.com/juspay/hyperswitch/assets/26082680/f7fb5340-b303-45c9-9b7c-4600e165ae3a">
#####Payments Sync
with force_sync as False
```shell
curl --location 'http://localhost:8080/payments/pay_x99f0Q4DO2drPrt3QZX0' \
--header 'Accept: application/json' \
--header 'api-key: dev_ng5enE9FcquL9C0eYO1Jr0E6U8V8vbriDijpN4EgVpr1o31zWAMrVzkIt3q5ZvRh'
```
response
```shell
{
"payment_id": "pay_x99f0Q4DO2drPrt3QZX0",
"merchant_id": "merchant_1718267057",
"status": "processing",
"amount": 250,
"net_amount": 250,
"amount_capturable": 250,
"amount_received": 250,
"connector": "stripe",
"client_secret": "pay_x99f0Q4DO2drPrt3QZX0_secret_0A6rPzdRv1pvBLdZ61GA",
"created": "2024-06-24T11:03:39.655Z",
"currency": "USD",
"customer_id": "StripeCustomer123",
"customer": {
"id": "StripeCustomer123",
"name": "John Doe",
"email": "abcdef123@gmail.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Please Pay for your XYZ",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "4242",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "424242",
"card_extended_bin": null,
"card_exp_month": "08",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": null,
"order_details": null,
"email": "abcdef123@gmail.com",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://google.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": "Integrity Check Failed! Value mismatched for fields currency",
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": false,
"connector_transaction_id": "pi_3PVAgTCuXDMKrYZe0L9s7DNy",
"frm_message": null,
"metadata": {
"udf1": "value1",
"login_date": "2019-09-10T10:11:12Z",
"new_customer": "true"
},
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_rhbVuxclv1iy3M2pZkkI",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_sKlZxW37AYQNFv4Z4LGy",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-06-24T11:18:39.655Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_method_id": null,
"payment_method_status": null,
"updated": "2024-06-24T11:03:42.546Z",
"charges": null,
"frm_metadata": null
}
```
we should get error message as integrity check failed with status as processing.
with force_sync as true
```shell
curl --location 'http://localhost:8080/payments/pay_x99f0Q4DO2drPrt3QZX0?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_ng5enE9FcquL9C0eYO1Jr0E6U8V8vbriDijpN4EgVpr1o31zWAMrVzkIt3q5ZvRh'
```
<img width="952" alt="Screenshot 2024-06-24 at 4 38 30 PM" src="https://github.com/juspay/hyperswitch/assets/26082680/8dda331f-635a-4cb6-a524-7f886d773d0e">
#### Scenario[2] Where Connector send wrong currency in both authorize but fixes the same sync flow
#####Payments Create
```shell
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_ng5enE9FcquL9C0eYO1Jr0E6U8V8vbriDijpN4EgVpr1o31zWAMrVzkIt3q5ZvRh' \
--data-raw '
{
"amount": 250,
"currency": "USD",
"confirm": true,
"amount_to_capture": 250,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "StripeCustomer123",
"email": "abcdef123@gmail.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Please Pay for your XYZ",
"authentication_type": "no_three_ds",
"return_url": "https://google.com",
"setup_future_usage": "off_session",
"browser_info": {
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "127.0.0.1"
},
"routing": {
"type": "single",
"data": "nmi"
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "08",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"card_cvc": "999"
}
}
}
'
```
<img width="922" alt="Screenshot 2024-06-24 at 4 41 51 PM" src="https://github.com/juspay/hyperswitch/assets/26082680/1fb7a4fa-d9e3-489c-83b1-cc3c6a7e1e29">
##### Payments Sync
with force_sync true
```shell
curl --location 'http://localhost:8080/payments/pay_ExsGuWmhYUqDrkkAJnVg?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_ng5enE9FcquL9C0eYO1Jr0E6U8V8vbriDijpN4EgVpr1o31zWAMrVzkIt3q5ZvRh'
```
Response
```shell
{
"payment_id": "pay_ExsGuWmhYUqDrkkAJnVg",
"merchant_id": "merchant_1718267057",
"status": "succeeded",
"amount": 250,
"net_amount": 250,
"amount_capturable": 0,
"amount_received": 250,
"connector": "stripe",
"client_secret": "pay_ExsGuWmhYUqDrkkAJnVg_secret_upTfAFa5sOSTcGTMKKIO",
"created": "2024-06-24T11:11:45.150Z",
"currency": "USD",
"customer_id": "StripeCustomer123",
"customer": {
"id": "StripeCustomer123",
"name": "John Doe",
"email": "abcdef123@gmail.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Please Pay for your XYZ",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "4242",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "424242",
"card_extended_bin": null,
"card_exp_month": "08",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"payment_checks": {
"address_line1_check": null,
"address_postal_code_check": null,
"cvc_check": "pass"
},
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": null,
"order_details": null,
"email": "abcdef123@gmail.com",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://google.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": false,
"connector_transaction_id": "pi_3PVAoICuXDMKrYZe1GvfbMYa",
"frm_message": null,
"metadata": {
"udf1": "value1",
"login_date": "2019-09-10T10:11:12Z",
"new_customer": "true"
},
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pi_3PVAoICuXDMKrYZe1GvfbMYa",
"payment_link": null,
"profile_id": "pro_rhbVuxclv1iy3M2pZkkI",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_sKlZxW37AYQNFv4Z4LGy",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-06-24T11:26:45.150Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_method_id": null,
"payment_method_status": null,
"updated": "2024-06-24T11:12:40.350Z",
"charges": null,
"frm_metadata": null
}
```
Status should move to succeeded!
#### Scenario[3] Where connector sends correct data in both authorize and sync flow
#####Payments Create
```shell
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_ng5enE9FcquL9C0eYO1Jr0E6U8V8vbriDijpN4EgVpr1o31zWAMrVzkIt3q5ZvRh' \
--data-raw '
{
"amount": 250,
"currency": "USD",
"confirm": true,
"amount_to_capture": 250,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "StripeCustomer123",
"email": "abcdef123@gmail.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Please Pay for your XYZ",
"authentication_type": "no_three_ds",
"return_url": "https://google.com",
"setup_future_usage": "off_session",
"browser_info": {
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "127.0.0.1"
},
"routing": {
"type": "single",
"data": "nmi"
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "08",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"card_cvc": "999"
}
}
}
'
```
Response
```shell
{
"payment_id": "pay_HD0mGNbh3sY4SDzEJsPv",
"merchant_id": "merchant_1718267057",
"status": "succeeded",
"amount": 250,
"net_amount": 250,
"amount_capturable": 0,
"amount_received": 250,
"connector": "stripe",
"client_secret": "pay_HD0mGNbh3sY4SDzEJsPv_secret_EpmbV93ry8SiEMGIjCDF",
"created": "2024-06-24T11:16:26.868Z",
"currency": "USD",
"customer_id": "StripeCustomer123",
"customer": {
"id": "StripeCustomer123",
"name": "John Doe",
"email": "abcdef123@gmail.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Please Pay for your XYZ",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "4242",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "424242",
"card_extended_bin": null,
"card_exp_month": "08",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"payment_checks": {
"address_line1_check": null,
"address_postal_code_check": null,
"cvc_check": "pass"
},
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": null,
"order_details": null,
"email": "abcdef123@gmail.com",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://google.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "StripeCustomer123",
"created_at": 1719227786,
"expires": 1719231386,
"secret": "epk_3f099e2eb5f74a1db265f81af40082b3"
},
"manual_retry_allowed": false,
"connector_transaction_id": "pi_3PVAsqCuXDMKrYZe1FwwRbez",
"frm_message": null,
"metadata": {
"udf1": "value1",
"login_date": "2019-09-10T10:11:12Z",
"new_customer": "true"
},
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pi_3PVAsqCuXDMKrYZe1FwwRbez",
"payment_link": null,
"profile_id": "pro_rhbVuxclv1iy3M2pZkkI",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_sKlZxW37AYQNFv4Z4LGy",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-06-24T11:31:26.868Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_method_id": null,
"payment_method_status": null,
"updated": "2024-06-24T11:16:29.856Z",
"charges": null,
"frm_metadata": null
}
```
#####Payments Sync
```shell
curl --location 'http://localhost:8080/payments/pay_HD0mGNbh3sY4SDzEJsPv?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_ng5enE9FcquL9C0eYO1Jr0E6U8V8vbriDijpN4EgVpr1o31zWAMrVzkIt3q5ZvRh'
```
Response
```shell
{
"payment_id": "pay_HD0mGNbh3sY4SDzEJsPv",
"merchant_id": "merchant_1718267057",
"status": "succeeded",
"amount": 250,
"net_amount": 250,
"amount_capturable": 0,
"amount_received": 250,
"connector": "stripe",
"client_secret": "pay_HD0mGNbh3sY4SDzEJsPv_secret_EpmbV93ry8SiEMGIjCDF",
"created": "2024-06-24T11:16:26.868Z",
"currency": "USD",
"customer_id": "StripeCustomer123",
"customer": {
"id": "StripeCustomer123",
"name": "John Doe",
"email": "abcdef123@gmail.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"description": "Please Pay for your XYZ",
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": "off_session",
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "4242",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "424242",
"card_extended_bin": null,
"card_exp_month": "08",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"payment_checks": {
"cvc_check": "pass",
"address_line1_check": null,
"address_postal_code_check": null
},
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": null,
"order_details": null,
"email": "abcdef123@gmail.com",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://google.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "credit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": false,
"connector_transaction_id": "pi_3PVAsqCuXDMKrYZe1FwwRbez",
"frm_message": null,
"metadata": {
"udf1": "value1",
"login_date": "2019-09-10T10:11:12Z",
"new_customer": "true"
},
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pi_3PVAsqCuXDMKrYZe1FwwRbez",
"payment_link": null,
"profile_id": "pro_rhbVuxclv1iy3M2pZkkI",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_sKlZxW37AYQNFv4Z4LGy",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-06-24T11:31:26.868Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "127.0.0.1",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 1536,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 723,
"java_script_enabled": true
},
"payment_method_id": null,
"payment_method_status": null,
"updated": "2024-06-24T11:16:29.856Z",
"charges": null,
"frm_metadata": null
}
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
| <think>
PR Context:
- Title: Revert "feat(core): Added integrity framework for Authorize and Sync flow with connector as Stripe"
- Merged: 2024-06-24T14:30:07Z
- Files changed: 30 files
- Commits: 1 commits
Implementation approach:
Reverts juspay/hyperswitch#5057
</think>
To implement this, you'll need to modify:
(No detailed commit information available) | {"issue_number": 5057, "pr_number": 5108, "commits_count": 0, "files_changed": 30, "response_length": 361, "file_count": 0, "needs_breakdown": false} |
[FEATURE] Create a dummy connector for internal and external testing of payments and refunds flows
### Feature Description
A dummy test connector needs to be created with the ability to process all the payment methods available on Hyperswitch. This dummy connector will be useful for internal and external testing and it will be used extensively by those trying to test or integrate Hyperswitch without setting up any active accounts with any of the processors.
The dummy test connector will be able to simulate most basic scenarios (success/failure/pending) for all the available payment methods by having separate test payment method data for each of these flows. Payment failure can include further breakdown in scenarios according to the payment methods.
For example, there should be separate test card numbers for simulating success, failure, pending statuses of 3DS and Non 3DS flows. Under failure, different test card numbers should enable simulating errors like invalid card info, insufficient funds, declined by gateway, declined by issuing bank, declines due to bad fraud score, etc.
### Possible Implementation
We would need to create a dummy connector to test all the payment flows, refund flows, webhooks, etc.
The two major tasks are:
1. Server implementation for dummy connector for the following endpoints
a. payments #980
b. refunds #1071
c. webhooks
2. Integrating Hyperswitch with the dummy connector for the following endpoints
a. payments #1084
b. refunds #1084
c. webhooks
3. Enable Dummy Connector and make it default
**Cards:**
Non- 3DS payments flow https://github.com/juspay/hyperswitch/issues/727
### Have you spent some time to check if this feature request has been raised before?
- [X] I checked and didn't find similar issue
### Have you read the Contributing Guidelines?
- [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md)
### Are you willing to submit a PR?
No, but I'm happy to collaborate on a PR with someone else | <think>
PR Context:
- Title: feat(connector): add multiple dummy connectors and enable them
- Merged: 2023-05-13T11:12:49Z
- Files changed: 6 files
- Commits: 2 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
Add multiple dummy connectors and enable dummy connector by default
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat(connector): add multiple dummy connectors and enable them (#1147)
Files to modify:
**crates/api_models/src/enums.rs**
Modify existing code
**crates/router/src/connector/dummyconnector.rs**
Remove:
- struct: pub::DummyConnector
- impl: impl api::Payment for DummyConnector
- impl: impl api::PaymentSession for DummyConnector
- impl: impl api::ConnectorAccessToken for DummyConnector
- impl: impl api::PreVerify for DummyConnector
- impl: impl api::PaymentAuthorize for DummyConnector
- impl: impl api::PaymentSync for DummyConnector
- impl: impl api::PaymentCapture for DummyConnector
- impl: impl api::PaymentVoid for DummyConnector
- impl: impl api::Refund for DummyConnector
- impl: impl api::RefundExecute for DummyConnector
- impl: impl api::RefundSync for DummyConnector
- impl: impl api::PaymentToken for DummyConnector
- impl: impl impl<Flow, Request, Response> ConnectorCommonExt<Flow, Request, Response> for DummyConnector
- impl: impl ConnectorCommon for DummyConnector
- impl: impl ConnectorIntegration<api::Session, types::PaymentsSessionData, types::PaymentsResponseData> for DummyConnector
- impl: impl ConnectorIntegration<api::AccessTokenAuth, types::AccessTokenRequestData, types::AccessToken> for DummyConnector
- impl: impl ConnectorIntegration<api::Verify, types::VerifyRequestData, types::PaymentsResponseData> for DummyConnector
- impl: impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::PaymentsResponseData> for DummyConnector
- impl: impl ConnectorIntegration<api::PSync, types::PaymentsSyncData, types::PaymentsResponseData> for DummyConnector
- impl: impl ConnectorIntegration<api::Capture, types::PaymentsCaptureData, types::PaymentsResponseData> for DummyConnector
- impl: impl ConnectorIntegration<api::Void, types::PaymentsCancelData, types::PaymentsResponseData> for DummyConnector
- impl: impl ConnectorIntegration<api::Execute, types::RefundsData, types::RefundsResponseData> for DummyConnector
- impl: impl ConnectorIntegration<api::RSync, types::RefundsData, types::RefundsResponseData> for DummyConnector
- impl: impl api::IncomingWebhook for DummyConnector
Add:
- struct: pub::DummyConnector
- impl: impl api::Payment for DummyConnector<T>
- impl: impl api::PaymentSession for DummyConnector<T>
- impl: impl api::ConnectorAccessToken for DummyConnector<T>
- impl: impl api::PreVerify for DummyConnector<T>
- impl: impl api::PaymentAuthorize for DummyConnector<T>
- impl: impl api::PaymentSync for DummyConnector<T>
- impl: impl api::PaymentCapture for DummyConnector<T>
- impl: impl api::PaymentVoid for DummyConnector<T>
- impl: impl api::Refund for DummyConnector<T>
- impl: impl api::RefundExecute for DummyConnector<T>
- impl: impl api::RefundSync for DummyConnector<T>
- impl: impl api::PaymentToken for DummyConnector<T>
- impl: impl impl<const T: u8, Flow, Request, Response> ConnectorCommonExt<Flow, Request, Response>
for DummyConnector<T>
impl<const T: u8> ConnectorCommon for DummyConnector<T> {
match T
- impl: impl ConnectorIntegration<api::Session, types::PaymentsSessionData, types::PaymentsResponseData> for DummyConnector<T>
- impl: impl ConnectorIntegration<api::AccessTokenAuth, types::AccessTokenRequestData, types::AccessToken> for DummyConnector<T>
- impl: impl ConnectorIntegration<api::Verify, types::VerifyRequestData, types::PaymentsResponseData> for DummyConnector<T>
- impl: impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::PaymentsResponseData> for DummyConnector<T>
- impl: impl ConnectorIntegration<api::PSync, types::PaymentsSyncData, types::PaymentsResponseData> for DummyConnector<T>
- impl: impl ConnectorIntegration<api::Capture, types::PaymentsCaptureData, types::PaymentsResponseData> for DummyConnector<T>
- impl: impl ConnectorIntegration<api::Void, types::PaymentsCancelData, types::PaymentsResponseData> for DummyConnector<T>
- impl: impl ConnectorIntegration<api::Execute, types::RefundsData, types::RefundsResponseData> for DummyConnector<T>
- impl: impl ConnectorIntegration<api::RSync, types::RefundsData, types::RefundsResponseData> for DummyConnector<T>
- impl: impl api::IncomingWebhook for DummyConnector<T>
**crates/router/src/core/payments/flows.rs**
Add:
- function: private::get_flow_type
- impl: impl api::PaymentsCompleteAuthorize for connector::DummyConnector<T>
- impl: impl services::ConnectorIntegration<
api::CompleteAuthorize,
types::CompleteAuthorizeData,
types::PaymentsResponseData,
> for connector::DummyConnector<T>
- impl: impl api::ConnectorCustomer for connector::DummyConnector<T>
- impl: impl services::ConnectorIntegration<
api::CreateConnectorCustomer,
types::ConnectorCustomerData,
types::PaymentsResponseData,
> for connector::DummyConnector<T>
- impl: impl services::ConnectorRedirectResponse for connector::DummyConnector<T>
- impl: impl api::ConnectorTransactionId for connector::DummyConnector<T>
- impl: impl api::Dispute for connector::DummyConnector<T>
- impl: impl api::AcceptDispute for connector::DummyConnector<T>
- impl: impl services::ConnectorIntegration<
api::Accept,
types::AcceptDisputeRequestData,
types::AcceptDisputeResponse,
> for connector::DummyConnector<T>
- impl: impl api::FileUpload for connector::DummyConnector<T>
- impl: impl api::UploadFile for connector::DummyConnector<T>
- impl: impl services::ConnectorIntegration<
api::Upload,
types::UploadFileRequestData,
types::UploadFileResponse,
> for connector::DummyConnector<T>
- impl: impl api::RetrieveFile for connector::DummyConnector<T>
- impl: impl services::ConnectorIntegration<
api::Retrieve,
types::RetrieveFileRequestData,
types::RetrieveFileResponse,
> for connector::DummyConnector<T>
- impl: impl api::SubmitEvidence for connector::DummyConnector<T>
- impl: impl services::ConnectorIntegration<
api::Evidence,
types::SubmitEvidenceRequestData,
types::SubmitEvidenceResponse,
> for connector::DummyConnector<T>
- impl: impl api::DefendDispute for connector::DummyConnector<T>
- impl: impl services::ConnectorIntegration<
api::Defend,
types::DefendDisputeRequestData,
types::DefendDisputeResponse,
> for connector::DummyConnector<T>
**crates/router/src/types/api.rs**
Modify existing code
**crates/router/tests/connectors/dummyconnector.rs**
Modify existing code | {"issue_number": 726, "pr_number": 1147, "commits_count": 1, "files_changed": 6, "response_length": 7521, "file_count": 7, "needs_breakdown": true} |
feat(connector): [Peach Payments] add network token support for connector
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
add network token support for peach payments connector
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
- Create MCA for peach payments
- Enable network tokenization for profile
```
curl --location 'http://localhost:8080/account/merchant_id/business_profile/prof_id' \
--header 'Content-Type: application/json' \
--header 'api-key: api key' \
--data '{
"profile_name": "US_default",
"is_network_tokenization_enabled": true
}'
```
- Create payment
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_CNdykrXQ50vzfqwZtbakrK0awo6TkkdQHDXv0QnpB8tA05z3sVIKLAEUGqIEXWE8' \
--data-raw '
{
"amount": 200,
"currency": "EUR",
"confirm": true,
"capture_method": "manual",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "<customer_id>",
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://google.com",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "card_number",
"card_exp_month": "12",
"card_exp_year": "2026",
"card_holder_name": "joseph Doe",
"card_cvc": "123",
"card_network": "VISA"
}
},
"setup_future_usage": "on_session",
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "in sit",
"user_agent": "amet irure esse"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "PiX",
"last_name": "ss"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "John",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"browser_info": {
"user_agent": "Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36",
"accept_header": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "125.0.0.1"
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {},
"order_details": [
{
"product_name": "Apple iphone 15",
"quantity": 1,
"amount": 0,
"account_name": "transaction_processing"
}
],
"profile_id": "<profile_id>"
}'
```
- Do repeat CIT [Saved Card flow]
using saved card,
payment method data sent to connector in logs should be network token data.
ps. please search for raw_connector_request
create payment-
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_CNdykrXQ50vzfqwZtbakrK0awo6TkkdQHDXv0QnpB8tA05z3sVIKLAEUGqIEXWE8' \
--data '{
"amount": 200,
"currency": "EUR",
"capture_method": "manual",
"authentication_type": "no_three_ds",
"confirm": false,
"setup_future_usage": "on_session",
"customer_id": "cu_1760091918",
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US"
}
},
"profile_id": "pro_55Ey3rupyS9BnqWKLkG3"
}'
```
confirm -
```
curl --location 'http://localhost:8080/payments/<payment_id>/confirm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: api key' \
--data '
{
"payment_token": "payment_token",
"client_secret": "client_secret",
"browser_info": {
"user_agent": "Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/70.0.3538.110 Safari\/537.36",
"accept_header": "text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,image\/apng,*\/*;q=0.8",
"language": "nl-NL",
"color_depth": 24,
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "125.0.0.1"
},
"payment_method": "card",
"payment_method_data":{
"card_token":{
"card_cvc": "737"
}
}
}'
```
<img width="1728" height="140" alt="Screenshot 2025-10-13 at 3 58 40 PM" src="https://github.com/user-attachments/assets/e75f7977-77cd-4022-b99f-e13ec478913a" />
<img width="952" height="576" alt="Screenshot 2025-10-13 at 4 42 39 PM" src="https://github.com/user-attachments/assets/64623865-5fbb-4152-8e48-68909809f439" />
<img width="876" height="739" alt="Screenshot 2025-10-13 at 4 42 58 PM" src="https://github.com/user-attachments/assets/69fb00b2-4183-4187-b5f5-b2b3d7b8f366" />
three test cases are failing due to incorrect assertion. this is currently on main.
How to replicate this -
in create call, confirm is set to falsem capture method to automatic, and payment method data is not sent. in create response, requires_payment_method status is given.
now in confirm api, send payment method data.
expected - Throw error saying automatic capture is not supported
current output - Trying to make a call to connector.
Can be taken up in seperate pr.
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
| <think>
PR Context:
- Title: feat(connector): [Peach Payments] add network token support for connector
- Merged: 2025-10-13T14:00:59Z
- Files changed: 8 files
- Commits: 1 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
add network token support for peach payments connector
hotfix for - #9754
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/envir
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat(connector): [Peach Payments] add network token support for connector (#9814)
Co-authored-by: hy
Files to modify:
**crates/hyperswitch_connectors/src/connectors/peachpayments/transformers.rs**
Remove:
- struct: pub::PeachpaymentsPaymentsRequest
Add:
- function: private::from
- function: private::try_from
- function: private::try_from
- struct: pub::PeachpaymentsPaymentsCardRequest
- struct: pub::CardOnFileData
- struct: pub::EcommerceNetworkTokenPaymentOnlyTransactionData
- struct: pub::NetworkTokenDetails
- enum: pub::PeachpaymentsPaymentsRequest
- enum: pub::EcommercePaymentOnlyTransactionData
- enum: pub::CardNetworkLowercase
- impl: impl From<common_enums::CardNetwork> for CardNetworkLowercase
- impl: impl TryFrom<(
&PeachpaymentsRouterData<&PaymentsAuthorizeRouterData>,
NetworkTokenData,
)> for PeachpaymentsPaymentsRequest
- impl: impl TryFrom<(&PeachpaymentsRouterData<&PaymentsAuthorizeRouterData>, Card)> for PeachpaymentsPaymentsRequest
**crates/router/src/core/payment_methods/network_tokenization.rs**
Modify existing code | {"issue_number": 9754, "pr_number": 9814, "commits_count": 1, "files_changed": 8, "response_length": 1940, "file_count": 4, "needs_breakdown": false} |
Fix: populating the docker related changes from main to stable release
Replicating
https://github.com/juspay/hyperswitch/issues/8091
https://github.com/juspay/hyperswitch/pull/8092
to stable release | <think>
PR Context:
- Title: fix: updated the docker setup
- Merged: 2025-05-22T09:46:58Z
- Files changed: 2 files
- Commits: 2 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
Enhanced the script to pre-configure a user and a dummy connector in the control center for the local setup.
replica of https://github.com/juspay/hyperswitch/pull/8093 on the main
### Additional Changes
- [ ] This PR modifies the API
</think>
To implement this, you'll need to modify:
(No detailed commit information available) | {"issue_number": 8094, "pr_number": 8092, "commits_count": 0, "files_changed": 2, "response_length": 759, "file_count": 0, "needs_breakdown": false} |
[BUG] : Noon Api Contract Changes
### Bug Description
Noon API contract has changed. Therefore subscription payments is failing in Noon sandbox.
### Expected Behavior
Noon subscriptions work in sandbox
### Actual Behavior
Throwing Missing Field error
### Steps To Reproduce
Provide an unambiguous set of steps to reproduce this bug. Include code or configuration to reproduce, if relevant.
Make a Noon Card or Applepay subscription payment through hyperswitch
### Context For The Bug
_No response_
### Environment
Are you using hyperswitch hosted version? Yes/No
If yes, please provide the value of the `x-request-id` response header to help us debug your issue.
If not (or if building/running locally), please provide the following details:
1. Operating System or Linux distribution:
2. Rust version (output of `rustc --version`): ``
3. App version (output of `cargo r --features vergen -- --version`): ``
Sandbox
### Have you spent some time checking if this bug has been raised before?
- [X] I checked and didn't find a similar issue
### Have you read the Contributing Guidelines?
- [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md)
### Are you willing to submit a PR?
Yes, I am willing to submit a PR! | <think>
PR Context:
- Title: refactor: [Noon] add new field max_amount to mandate request
- Merged: 2024-02-07T09:32:34Z
- Files changed: 2 files
- Commits: 18 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
Resolves #3445
_Note
1.While connector create ensure `test_mode` is set to true
2.Ensure the currency passed is `AED` and country is `AE`_
## How did you test it?
1.Create a CIT with noon
with
```
"connector_metadata": {
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** refactor: [Noon] add new field max_amount to mandate request (#3481)
Co-authored-by: swangi-kumari
Files to modify:
**crates/router/src/compatibility/stripe/payment_intents/types.rs**
Modify existing code
**crates/router/src/connector/noon/transformers.rs**
Modify existing code | {"issue_number": 3445, "pr_number": 3481, "commits_count": 1, "files_changed": 2, "response_length": 1081, "file_count": 4, "needs_breakdown": false} |
[FEATURE] : [Billwerk] Add Payment and Refund Flows
### Feature Description
Add all the payment flows for non-3ds cards:
Authorise, Capture, Void, Psync
And the refund flows:
Refund and Rsync
### Possible Implementation
Add all the payment flows for non-3ds cards:
Authorise, Capture, Void, Psync
And the refund flows:
Refund and Rsync
### Have you spent some time checking if this feature request has been raised before?
- [X] I checked and didn't find a similar issue
### Have you read the Contributing Guidelines?
- [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md)
### Are you willing to submit a PR?
Yes, I am willing to submit a PR! | <think>
PR Context:
- Title: feat(connector): [billwerk] implement payment and refund flows
- Merged: 2024-04-01T14:31:48Z
- Files changed: 20 files
- Commits: 25 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
implement all the basic flows for Billwerk (Reepay):
- [Authorise/Charge](https://optimize-docs.billwerk.com/reference/createcharge)
- [Capture](https://optimize-docs.billwerk.com/reference/settlecharge)
- [Void](https://optimize-docs.bil
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat(connector): [billwerk] implement payment and refund flows (#4245)
Co-authored-by: hyperswitch-b
Files to modify:
**crates/api_models/src/enums.rs**
Modify existing code
**crates/common_enums/src/enums.rs**
Modify existing code
**crates/connector_configs/src/connector.rs**
Modify existing code
**crates/router/src/connector/billwerk.rs**
Remove:
- impl: impl ConnectorIntegration<
api::PaymentMethodToken,
types::PaymentMethodTokenizationData,
types::PaymentsResponseData,
> for Billwerk
Add:
- function: private::get_headers
- function: private::get_content_type
- function: private::get_url
- function: private::get_request_body
- function: private::build_request
- function: private::handle_response
- function: private::get_error_response
- function: private::get_5xx_error_response
- function: private::get_5xx_error_response
- function: private::get_5xx_error_response
- function: private::get_5xx_error_response
- function: private::get_headers
- function: private::get_content_type
- function: private::get_url
- function: private::build_request
- function: private::handle_response
- function: private::get_error_response
- function: private::get_5xx_error_response
- function: private::get_5xx_error_response
- impl: impl ConnectorIntegration<
api::PaymentMethodToken,
types::PaymentMethodTokenizationData,
types::PaymentsResponseData,
> for Billwerk
**crates/router/src/connector/billwerk/transformers.rs**
Remove:
- struct: pub::BillwerkPaymentsRequest
Add:
- function: private::try_from
- function: private::try_from
- struct: pub::BillwerkAuthType
- struct: pub::BillwerkTokenRequest
- struct: pub::BillwerkCaptureRequest
- enum: pub::BillwerkTokenRequestIntent
- enum: pub::BillwerkStrongAuthRule
- enum: pub::BillwerkPaymentState
- enum: pub::RefundState
- impl: impl TryFrom<&BillwerkRouterData<&types::PaymentsCaptureRouterData>> for BillwerkCaptureRequest
**crates/router/src/connector/utils.rs**
Add:
- function: private::get_optional_billing_line1
- function: private::get_optional_billing_line2
- function: private::get_optional_billing_city
- function: private::get_optional_billing_country
- function: private::get_optional_billing_zip
- function: private::get_optional_billing_state
- function: private::get_optional_billing_first_name
- function: private::get_optional_billing_last_name
**crates/router/src/core/admin.rs**
Modify existing code
**crates/router/src/types/api.rs**
Modify existing code
**crates/router/src/types/transformers.rs**
Modify existing code | {"issue_number": 4246, "pr_number": 4245, "commits_count": 1, "files_changed": 20, "response_length": 3540, "file_count": 11, "needs_breakdown": false} |
[FEATURE] : [Cybersource] Add Card holder name in dynamic field
### Feature Description
Add Card holder name as required field in dynamic field
### Possible Implementation
Add Card holder name as required field in dynamic field in `default.rs`
### Have you spent some time checking if this feature request has been raised before?
- [X] I checked and didn't find a similar issue
### Have you read the Contributing Guidelines?
- [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md)
### Are you willing to submit a PR?
Yes, I am willing to submit a PR! | <think>
PR Context:
- Title: feat(connector): [cybersource] add card holder name in dynamic fields
- Merged: 2024-03-14T07:45:28Z
- Files changed: 1 files
- Commits: 1 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
add card holder name as a required field in dynamic fields for cyber source
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/envi
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat(connector): [cybersource] add card holder name in dynamic fields (#4082)
Files to modify:
**crates/router/src/configs/defaults.rs**
Modify existing code | {"issue_number": 4083, "pr_number": 4082, "commits_count": 1, "files_changed": 1, "response_length": 963, "file_count": 3, "needs_breakdown": false} |
[BUG] Bug in merchant connector account create - delete flows
### Bug Description
There is a problem with how the `configs` table is updated. The problem arises when a user deletes a connector and then adds the same one, the config isn't cleaned from the connector when it's deleted, and the new connector (with the same type) is appended to the array.
It looks something like this:
```json
[{"connector":"adyen","merchant_connector_id":"mca_123XXX"}, //old one, already deleted
{"connector":"adyen","merchant_connector_id":"mca_456XXX"}] //new one
```
When a payment (or payout or anything else connector related) is being created the router looks at the first occurrence of the connector (which is already deleted) and then looks at the `merchant_connector_account` table for an already deleted `merchant_connector_id`, unsurprisingly does not find it and throws an error. Affects both payment and payout processors
### Expected Behavior
I think either the payment connector delete function should clean the config array of the deleted connector, or the update function should prepend the config instead of appending.
### Actual Behavior
The delete function does not clean the config and then just appends it when new creator of same type is added
### Steps To Reproduce
To reproduce:
1. Create a merchant connector account of any type
2. Delete it
3. Create the same connector
4. Try to make a payment with that connector
5. Get error 404:
```json
{
"error": {
"type": "invalid_request",
"message": "Merchant connector account does not exist in our records",
"code": "HE_02",
"reason": "mca_123XXX does not exist"
}
}
```
### Context For The Bug
Trace for update config:
```sh
at crates/diesel_models/src/query/generics.rs:247
in router::db::configs::update_config_in_database
in storage_impl::redis::cache::publish_and_redact
in router::db::configs::update_config_by_key
in core::routing::helpers::update_merchant_default_config
in router::core::retrieve_and_update_default_fallback_routing_algorithm_if_routable_connector_exists
```
### Environment
Are you using hyperswitch hosted version? No
If not (or if building/running locally), please provide the following details:
1. Operating System or Linux distribution: Ubuntu 22.04
2. Rust version (output of `rustc --version`): `rustc 1.80.1 (3f5fd8dd4 2024-08-06)`
3. App version (output of `cargo r --features vergen -- --version`): `2024.08.27` (not running the latest version but checked the functions responsible and there weren't any changes)
### Have you spent some time checking if this bug has been raised before?
- [x] I checked and didn't find a similar issue
### Have you read the Contributing Guidelines?
- [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md)
### Are you willing to submit a PR?
Yes, I am willing to submit a PR! | <think>
PR Context:
- Title: fix(connector): add config cleanup on payment connector deletion
- Merged: 2024-12-06T08:36:24Z
- Files changed: 2 files
- Commits: 7 commits
Implementation approach:
## Description
Fixes #5966 (in both v1 and v2). Now the router cleans up the configs table (or business_profile in v2) when a connector is deleted.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application c
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** fix(connector): add config cleanup on payment connector deletion (#5998)
Files to modify:
**crates/common_enums/src/enums.rs**
Add:
- function: private::from
- impl: impl From<ConnectorType> for TransactionType
**crates/router/src/core/admin.rs**
Add:
- function: private::retrieve_and_delete_from_default_fallback_routing_algorithm_if_routable_connector_exists
- function: private::retrieve_and_delete_from_default_fallback_routing_algorithm_if_routable_connector_exists | {"issue_number": 5966, "pr_number": 5998, "commits_count": 1, "files_changed": 2, "response_length": 1291, "file_count": 4, "needs_breakdown": false} |
Pre-configuring an account in the local setup using docker
Pre-configuring an account in the local setup using docker | <think>
PR Context:
- Title: fix: updated the docker setup
- Merged: 2025-05-21T09:51:53Z
- Files changed: 2 files
- Commits: 3 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
Enhanced the script to pre-configure a user and a dummy connector in the control center for the local setup.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifi
</think>
To implement this, you'll need to modify:
(No detailed commit information available) | {"issue_number": 8091, "pr_number": 8093, "commits_count": 0, "files_changed": 2, "response_length": 759, "file_count": 0, "needs_breakdown": false} |
Implement `EphemeralKeyInterface` for `MockDb`
Spin out from https://github.com/juspay/hyperswitch/issues/172. Please refer to that issue for more information. | <think>
PR Context:
- Title: feat(db): implement `EphemeralKeyInterface` for `MockDb`
- Merged: 2023-06-25T05:52:25Z
- Files changed: 3 files
- Commits: 6 commits
Implementation approach:
## Description
Implemented Mock db for ephemeral key
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
## Motivation and Context
Fixes #1191
## How did you test it?
## Checklist
- [ ]
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat(db): implement `EphemeralKeyInterface` for `MockDb` (#1285)
Files to modify:
**crates/router/src/db.rs**
Modify existing code
**crates/router/src/db/ephemeral_key.rs**
Modify existing code
**crates/router/src/types/storage.rs**
Modify existing code | {"issue_number": 1191, "pr_number": 1285, "commits_count": 1, "files_changed": 3, "response_length": 1052, "file_count": 5, "needs_breakdown": false} |
feat: add cache for MCA and API key tables.
Add support for in memory and redis cache for Merchant Connector Account and API keys tables to the functions that are frequently called for less latency during payments. | <think>
PR Context:
- Title: feat: add cache for api_key and mca tables
- Merged: 2023-07-07T07:08:21Z
- Files changed: 3 files
- Commits: 10 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
This PR adds in memory and redis cache for Merchant Connector Account and API keys. To the fetch functions that are frequently called during a payment
This PR closes #1211.
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat: add cache for api_key and mca tables (#1212)
Files to modify:
**crates/router/src/db/api_keys.rs**
Add:
- function: private::test_api_keys_cache
**crates/router/src/db/merchant_connector_account.rs**
Add:
- function: private::test_connector_label_cache
- mod: private::merchant_connector_account_cache_tests
**crates/storage_models/src/api_keys.rs**
Modify existing code | {"issue_number": 1211, "pr_number": 1212, "commits_count": 1, "files_changed": 3, "response_length": 1174, "file_count": 5, "needs_breakdown": false} |
fix(mandate): add mandate_id column in payment_attempt table
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
## Description
This change includes
- Adding a new column `mandate_id` in the table `payment_attempt`
- Similarly, adding `mandate_id` field in `PaymentAttempt` structs (which include `New`, `Update` variants)
- Storing `mandate_id`, if generated during payment creation, to the `PaymentAttempt` table (in `PostUpdateTracker`)
<!-- Describe your changes in detail -->
### Additional Changes
- [x] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!-- Provide links to the files with corresponding changes -->
## Motivation and Context
Originally, we didn't have any way to link a payment that is made to a specific mandate. Which makes it impossible to get the related mandate_id while performing a payment sync operation. This change will allow, the payments core to have access to the mandate that is related to the specific payment attempt while performing payment sync and further mandate related functionalities.
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless its an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed submitted code
- [ ] I added unit tests for my changes where possible
- [ ] I added a [CHANGELOG](/CHANGELOG.md) entry if applicable
| <think>
PR Context:
- Title: fix(router): fixed integrity check failures in case of 3ds flow in sync flow
- Merged: 2024-07-12T00:04:26Z
- Files changed: 12 files
- Commits: 5 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
we have implemented integrity checks for stripe, we have implemented integrity in authorise, sync, capture and refund, refund sync
but, where in sync flow we check amount, currency and amount_captured.
the bug is in 3ds flow, where after the transaction is completed we do a sync with the connector, but our trackers are not updated at this point.
In
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** fix(router): fixed integrity check failures in case of 3ds flow in sync flow (#5279)
Files to modify:
**crates/hyperswitch_domain_models/src/router_request_types.rs**
Modify existing code
**crates/hyperswitch_interfaces/src/integrity.rs**
Add:
- function: private::format_mismatch
**crates/router/src/connector/stripe.rs**
Modify existing code
**crates/router/src/connector/utils.rs**
Modify existing code
**crates/router/src/core/payments/flows/psync_flow.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
**crates/router/tests/connectors/bambora.rs**
Modify existing code
**crates/router/tests/connectors/forte.rs**
Modify existing code
**crates/router/tests/connectors/nexinets.rs**
Modify existing code
**crates/router/tests/connectors/paypal.rs**
Modify existing code
**crates/router/tests/connectors/utils.rs**
Modify existing code
**crates/router/tests/connectors/zen.rs**
Modify existing code | {"issue_number": 3, "pr_number": 5279, "commits_count": 1, "files_changed": 12, "response_length": 1800, "file_count": 14, "needs_breakdown": false} |
Updating the API reference documentation - payments
We have had feedback related to the API doc being outdated, and lacking proper visibility of the latest spec of the API collection. | <think>
PR Context:
- Title: Docs: Updated API - ref for payments
- Merged: 2024-07-04T13:33:48Z
- Files changed: 4 files
- Commits: 13 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding ch
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** Docs: Updated API - ref for payments (#5172)
Co-authored-by: hyperswitch-bot[bot] <148525504+hypersw
Files to modify:
**crates/api_models/src/payments.rs**
Modify existing code
**crates/common_enums/src/enums.rs**
Modify existing code
**crates/openapi/src/routes/payments.rs**
Modify existing code | {"issue_number": 5174, "pr_number": 5172, "commits_count": 1, "files_changed": 4, "response_length": 1077, "file_count": 5, "needs_breakdown": false} |
[CI] Add workflow to ensure a pull request contains at least one linked issue
### Description
Add a CI workflow to ensure that each pull request contains at least one linked issue. We wish to introduce this requirement for improved project tracking. The workflow should do nothing else: just succeed/fail the check based on the presence/absence of linked issues in a pull request, respectively. | <think>
PR Context:
- Title: ci(pr-convention-checks): add job to check for linked issues for pull requests
- Merged: 2024-01-19T06:54:05Z
- Files changed: 2 files
- Commits: 10 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
This PR adds a new pull request CI check to ensure that all pull requests have at least one linked issue.
However, GitHub does not send any webhooks when a pull request is linked with an issue, so the check does not get triggered automatic
</think>
To implement this, you'll need to modify:
(No detailed commit information available) | {"issue_number": 3375, "pr_number": 3376, "commits_count": 0, "files_changed": 2, "response_length": 809, "file_count": 0, "needs_breakdown": false} |
Connector changes for 3ds in v2
In v2, the `PreProcessing` and `CompleteAuthorize` flows will not be present.
We will introduce new flows `PreAuthenticate`, `Authenticate` and `PostAuthenticate` to better represent the domain. | <think>
PR Context:
- Title: feat(router): Add Connector changes for 3ds (v2)
- Merged: 2025-09-11T14:33:57Z
- Files changed: 8 files
- Commits: 1 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
- Add `PreAuthenticate`, `Authenticate` and `PostAuthenticate` connector integration and implement them for cybersource
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] T
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat(router): Add Connector changes for 3ds (v2) (#9117)
Files to modify:
**crates/hyperswitch_connectors/src/connectors/cybersource.rs**
Add:
- function: private::get_headers
- function: private::get_content_type
- function: private::get_url
- function: private::get_request_body
- function: private::build_request
- function: private::handle_response
- function: private::get_error_response
- function: private::get_headers
- function: private::get_content_type
- function: private::get_url
- function: private::get_request_body
- function: private::build_request
- function: private::handle_response
- function: private::get_error_response
- function: private::get_headers
- function: private::get_content_type
- function: private::get_url
- function: private::get_request_body
- function: private::build_request
- function: private::handle_response
- function: private::get_error_response
- function: private::get_headers
- function: private::get_content_type
- function: private::get_url
- function: private::get_request_body
- function: private::build_request
- function: private::handle_response
- function: private::get_error_response
- function: private::get_5xx_error_response
- impl: impl api::PaymentsPreAuthenticate for Cybersource
- impl: impl api::PaymentsPostAuthenticate for Cybersource
- impl: impl api::PaymentsAuthenticate for Cybersource
- impl: impl ConnectorIntegration<PreAuthenticate, PaymentsPreAuthenticateData, PaymentsResponseData> for Cybersource
- impl: impl ConnectorIntegration<Authenticate, PaymentsAuthenticateData, PaymentsResponseData> for Cybersource
- impl: impl ConnectorIntegration<PostAuthenticate, PaymentsPostAuthenticateData, PaymentsResponseData> for Cybersource
- impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Cybersource
**crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs**
Remove:
- struct: pub::CybersourceConsumerAuthValidateResponse
- struct: pub::CybersourceThreeDSMetadata
- struct: pub::CybersourceConsumerAuthInformationEnrollmentResponse
- struct: pub::ClientAuthCheckInfoResponse
- enum: pub::CybersourceAuthEnrollmentStatus
- enum: pub::CybersourcePreProcessingResponse
- impl: impl TryFrom<&CybersourceRouterData<&PaymentsCompleteAuthorizeRouterData>> for [serde(rename_all = "SCREAMING_SNAKE_CASE")]
Add:
- function: private::from
- function: private::try_from
- impl: impl From<&CybersourceRouterData<&PaymentsPreAuthenticateRouterData>> for ClientReferenceInformation
- impl: impl TryFrom<&CybersourceRouterData<&PaymentsPreAuthenticateRouterData>> for CybersourceAuthSetupRequest
- impl: impl TryFrom<&CybersourceRouterData<&PaymentsAuthenticateRouterData>> for (item.router_data.connector_request_reference_id.clone())
- impl: impl TryFrom<&CybersourceRouterData<&PaymentsPostAuthenticateRouterData>> for (item.router_data.connector_request_reference_id.clone())
**crates/hyperswitch_connectors/src/default_implementations.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_request_types.rs**
Add:
- function: private::try_from
- function: private::try_from
- function: private::try_from
- struct: pub::PaymentsPreAuthenticateData
- struct: pub::PaymentsAuthenticateData
- struct: pub::PaymentsPostAuthenticateData
- impl: impl TryFrom<PaymentsAuthorizeData> for PaymentsPreAuthenticateData
- impl: impl TryFrom<PaymentsAuthorizeData> for PaymentsAuthenticateData
- impl: impl TryFrom<PaymentsAuthorizeData> for PaymentsPostAuthenticateData
**crates/hyperswitch_domain_models/src/types.rs**
Modify existing code
**crates/hyperswitch_interfaces/src/api/payments.rs**
Add:
- trait: pub::PaymentsPreAuthenticate
- trait: pub::PaymentsAuthenticate
- trait: pub::PaymentsPostAuthenticate
**crates/hyperswitch_interfaces/src/api/payments_v2.rs**
Add:
- trait: pub::PaymentsPreAuthenticateV2
- trait: pub::PaymentsAuthenticateV2
- trait: pub::PaymentsPostAuthenticateV2
**crates/hyperswitch_interfaces/src/types.rs**
Modify existing code | {"issue_number": 9116, "pr_number": 9117, "commits_count": 1, "files_changed": 8, "response_length": 5050, "file_count": 10, "needs_breakdown": true} |
fix(payments): populate merchant order reference id in payments list response
In payment list response populate merchant order reference id | <think>
PR Context:
- Title: fix(payments): populate merchant order ref id in list
- Merged: 2024-07-12T11:51:05Z
- Files changed: 1 files
- Commits: 1 commits
Implementation approach:
## Description
Populate merchant order reference id in payments list response
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files w
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** fix(payments): populate merchant order ref id in list (#5310)
Files to modify:
**crates/router/src/core/payments/transformers.rs**
Modify existing code
**Commit 2:** fix(payments): populate merchant order ref id in list (#5310)
Files to modify:
**crates/router/src/core/payments/transformers.rs**
Modify existing code | {"issue_number": 5309, "pr_number": 5310, "commits_count": 2, "files_changed": 1, "response_length": 1112, "file_count": 5, "needs_breakdown": false} |
feat(payments): show aggregate count of payment status
Show count of aggregate payments status in the given time range:

This can be part of filter Api. | <think>
PR Context:
- Title: feat(payments): add support for aggregates in payments
- Merged: 2024-08-21T13:01:59Z
- Files changed: 12 files
- Commits: 2 commits
Implementation approach:
## Description

- The endpoint `/aggregate` to support views

- Add support for aggregates in payments.
- For now it
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat(payments): add support for aggregates in payments (#5654)
Files to modify:
**crates/api_models/src/events/payment.rs**
Add:
- function: private::get_api_event_type
- impl: impl ApiEventMetric for PaymentsAggregateResponse
**crates/api_models/src/payments.rs**
Add:
- struct: pub::PaymentsAggregateResponse
**crates/hyperswitch_domain_models/src/payments/payment_intent.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Add:
- function: pub::get_aggregates_for_payments
**crates/router/src/db/kafka_store.rs**
Add:
- function: private::get_intent_status_with_count
**crates/router/src/routes/app.rs**
Modify existing code
**crates/router/src/routes/lock_utils.rs**
Modify existing code
**crates/router/src/routes/payments.rs**
Add:
- function: pub::get_payments_aggregates
**crates/router/src/types/api/payments.rs**
Modify existing code
**crates/router_env/src/logger/types.rs**
Modify existing code
**crates/storage_impl/src/mock_db/payment_intent.rs**
Add:
- function: private::get_intent_status_with_count
**crates/storage_impl/src/payments/payment_intent.rs**
Add:
- function: private::get_intent_status_with_count
- function: private::get_intent_status_with_count | {"issue_number": 5627, "pr_number": 5654, "commits_count": 1, "files_changed": 12, "response_length": 2049, "file_count": 14, "needs_breakdown": false} |
[FEATURE]: [Bambora] Use `connector_request_reference_id` as reference to the connector
### :memo: Feature Description
- We transmit our reference id from Hyperswitch to the connector, enabling merchants to subsequently locate the payment within the connector dashboard.
- Presently, there is a lack of uniformity in this process, as some implementations employ `payment_id` while others utilize `attempt_id`.
- This inconsistency arises from the fact that `payment_id` and `attempt_id` correspond to two distinct entities within our system.
### :hammer: Possible Implementation
- To mitigate this confusion, we've introduced a new field called `connector_request_reference_id` in our RouterData.
- This id should replace them as a reference id to the connector for payment request.
- One might need to have exposure to api docs of the connector for which it is being implemented.
- You can check this PR for further reference https://github.com/juspay/hyperswitch/pull/2052
:bookmark: Note : All the changes needed should be contained within `hyperswitch/crates/router/src/connector/`
### :package: Have you spent some time checking if this feature request has been raised before?
- [X] I checked and didn't find a similar issue
### :package: Have you read the Contributing Guidelines?
- [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md)
### :sparkles: Are you willing to submit a PR?
| <think>
PR Context:
- Title: feat(connector): [Bambora] use connector_request_reference_id
- Merged: 2023-10-18T10:45:39Z
- Files changed: 1 files
- Commits: 17 commits
Implementation approach:
Addresses #2293
## Description
<!-- Describe your changes in detail -->
This PR updates the use of `RequestData.request.connector_transaction_id` to `RequestData.connector_request_reference_id` for Bambora.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modif
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat(connector): [Bambora] use connector_request_reference_id (#2518)
Files to modify:
**crates/router/src/connector/bambora/transformers.rs**
Modify existing code | {"issue_number": 2293, "pr_number": 2518, "commits_count": 1, "files_changed": 1, "response_length": 962, "file_count": 3, "needs_breakdown": false} |
feat: Create new versions of BE pre-login APIs
Currently we've made SPT and decision starter APIs. Now we have to integrate SPT into email specific, signin and signup APIs.
For backwards compatibility, old version should also need to be kept. So we can do these new APIs accessible with a query param. | <think>
PR Context:
- Title: feat(users): Create Token only support for pre-login user flow APIs
- Merged: 2024-05-07T09:41:39Z
- Files changed: 8 files
- Commits: 11 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
This PR will add new core functions for the following APIs which can be used with SPTs.
1. Accept Invite
2. Sign up
3. Verify Email
4. Accept Invite from Email
### Additional Changes
- [x] This PR modifies the API contract
- [ ] Thi
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat(users): Create Token only support for pre-login user flow APIs (#4558)
Files to modify:
**crates/api_models/src/events/user.rs**
Add:
- function: private::get_api_event_type
- impl: impl ApiEventMetric for TokenOrPayloadResponse<T>
**crates/api_models/src/user.rs**
Remove:
- enum: pub::SignInWithTokenResponse
Add:
- enum: pub::TokenOrPayloadResponse
**crates/api_models/src/user_role.rs**
Modify existing code
**crates/router/src/core/user.rs**
Modify existing code
**crates/router/src/core/user_role.rs**
Add:
- function: pub::accept_invitation_token_only_flow
**crates/router/src/routes/user.rs**
Modify existing code
**crates/router/src/routes/user_role.rs**
Modify existing code
**crates/router/src/types/domain/user/decision_manager.rs**
Add:
- function: pub::get_token_with_user_role
- function: private::from
- function: private::from
- impl: impl From<SPTFlow> for UserFlow
- impl: impl From<JWTFlow> for UserFlow | {"issue_number": 4556, "pr_number": 4558, "commits_count": 1, "files_changed": 8, "response_length": 1796, "file_count": 10, "needs_breakdown": false} |
refactor: Separate out recovery codes from TOTP
Even though recovery codes is dependent entity on TOTP. But the new findings suggest that TOTP is a part of entity called 2FA and TOTP is depended on the 2FA entity not the TOTP entity.
This will be more clear when we add multiple 2FAs like SMS OTP.
So, we want to separate out recovery codes from the TOTP. This means `begin_totp` should not return the recovery codes anymore. | <think>
PR Context:
- Title: feat(users): Create generate recovery codes API
- Merged: 2024-05-22T08:42:47Z
- Files changed: 11 files
- Commits: 3 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
Currently recovery code are being generated in `begin_totp` API. We want to make a separate out recovery codes and TOTP, so this PR creates a new API which generates the recovery codes.
This API will also be used to regenerate recovery code
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat(users): Create generate recovery codes API (#4708)
Files to modify:
**crates/api_models/src/events/user.rs**
Modify existing code
**crates/api_models/src/user.rs**
Add:
- struct: pub::RecoveryCodes
**crates/router/src/consts/user.rs**
Modify existing code
**crates/router/src/core/errors/user.rs**
Modify existing code
**crates/router/src/core/user.rs**
Add:
- function: pub::generate_recovery_codes
**crates/router/src/routes/app.rs**
Modify existing code
**crates/router/src/routes/lock_utils.rs**
Modify existing code
**crates/router/src/routes/user.rs**
Add:
- function: pub::generate_recovery_codes
**crates/router/src/utils/user.rs**
Remove:
- function: pub::generate_default_totp
Add:
- mod: pub::two_factor_auth
**crates/router/src/utils/user/two_factor_auth.rs**
Add:
- function: pub::generate_default_totp
- function: pub::check_totp_in_redis
- function: private::get_redis_connection
**crates/router_env/src/logger/types.rs**
Modify existing code | {"issue_number": 4707, "pr_number": 4708, "commits_count": 1, "files_changed": 11, "response_length": 1811, "file_count": 13, "needs_breakdown": false} |
[FEATURE]: [Cybersource] Currency Unit Conversion
### :memo: Feature Description
- Each currency can be described in terms of base or minor units.
- For instance, when dealing with USD currency, the Cent is considered as the minor unit, while the Dollar is considered the base unit.
- In Hyperswitch, the amount value is expected to be always provided in minor units.
- For example: In USD, If the amount is 1 in base unit (Dollar), then it will be equivalent to 100 in minor units (Cent)
- Some of the connectors integrated require the amount to be converted to a desirable unit before being passed to them.
- We have functions `to_currency_base_unit` and `to_currency_lower_unit` in place to convert the minor unit amount to its decimal equivalent and vice versa. These conversions are handled explicitly based on the connector.
### :hammer: Possible Implementation
- ConnectorCommon trait have been implemented for the connector.
- This trait contains `get_currency_unit` method. This method needs to be implemented.
- It will define what type of conversion needs to be done during `connector_router_data` creation. Concurrently handle the creation of `connector_router_data` to be passed for the connector request body creation.
- You can check this PR for further reference https://github.com/juspay/hyperswitch/pull/2196
:bookmark: Note: All the changes needed should be contained within `hyperswitch/crates/router/src/connector/`
### :package: Have you spent some time checking if this feature request has been raised before?
- [X] I checked and didn't find a similar issue
### :package: Have you read the Contributing Guidelines?
- [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md)
### :sparkles: Are you willing to submit a PR?
| <think>
PR Context:
- Title: refactor(connector): [CyberSource] Enhance currency Mapping with ConnectorCurrencyCommon Trait
- Merged: 2023-10-25T09:38:44Z
- Files changed: 3 files
- Commits: 10 commits
Implementation approach:
## Description
This PR implements `get_currency_unit` for cybersource to convert payments from `Base` to `Minor` it also implements router data to handle the conversion.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** refactor(connector): [CyberSource] Enhance currency Mapping with ConnectorCurrencyCommon Trait (#262
Files to modify:
**crates/router/src/connector/cybersource.rs**
Add:
- function: private::get_currency_unit
**crates/router/src/connector/cybersource/transformers.rs**
Add:
- function: private::try_from
- struct: pub::CybersourceRouterData
- impl: impl TryFrom<(
&types::api::CurrencyUnit,
types::storage::enums::Currency,
i64,
T,
)> for CybersourceRouterData<T>
**crates/router/src/connector/utils.rs**
Modify existing code | {"issue_number": 2222, "pr_number": 2626, "commits_count": 1, "files_changed": 3, "response_length": 1415, "file_count": 5, "needs_breakdown": false} |
[FEATURE]: [Rapyd] Currency Unit Conversion
### :memo: Feature Description
- Each currency can be described in terms of base or minor units.
- For instance, when dealing with USD currency, the Cent is considered as the minor unit, while the Dollar is considered the base unit.
- In Hyperswitch, the amount value is expected to be always provided in minor units.
- For example: In USD, If the amount is 1 in base unit (Dollar), then it will be equivalent to 100 in minor units (Cent)
- Some of the connectors integrated require the amount to be converted to a desirable unit before being passed to them.
- We have functions `to_currency_base_unit` and `to_currency_lower_unit` in place to convert the minor unit amount to its decimal equivalent and vice versa. These conversions are handled explicitly based on the connector.
### :hammer: Possible Implementation
- ConnectorCommon trait have been implemented for the connector.
- This trait contains `get_currency_unit` method. This method needs to be implemented.
- It will define what type of conversion needs to be done during `connector_router_data` creation. Concurrently handle the creation of `connector_router_data` to be passed for the connector request body creation.
- You can check this PR for further reference https://github.com/juspay/hyperswitch/pull/2196
:bookmark: Note: All the changes needed should be contained within `hyperswitch/crates/router/src/connector/`
### :package: Have you spent some time checking if this feature request has been raised before?
- [X] I checked and didn't find a similar issue
### :package: Have you read the Contributing Guidelines?
- [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md)
### :sparkles: Are you willing to submit a PR?
| <think>
PR Context:
- Title: refactor(connector): [Rapyd] add and implement the get_currency_unit function
- Merged: 2023-10-27T13:17:37Z
- Files changed: 2 files
- Commits: 18 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
This PR solves issue number #2244 for currency unit conversion in Rapyd Connector
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuratio
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** refactor(connector): [Rapyd] add and implement the get_currency_unit function (#2664)
Co-authored-by
Files to modify:
**crates/router/src/connector/rapyd.rs**
Add:
- function: private::get_currency_unit
**crates/router/src/connector/rapyd/transformers.rs**
Add:
- function: private::try_from
- struct: pub::RapydRouterData
- impl: impl TryFrom<(
&types::api::CurrencyUnit,
types::storage::enums::Currency,
i64,
T,
)> for RapydRouterData<T>
**Commit 2:** refactor(connector): [Rapyd] add and implement the get_currency_unit function (#2664)
Co-authored-by
Files to modify:
**crates/router/src/connector/rapyd.rs**
Add:
- function: private::get_currency_unit
**crates/router/src/connector/rapyd/transformers.rs**
Add:
- function: private::try_from
- struct: pub::RapydRouterData
- impl: impl TryFrom<(
&types::api::CurrencyUnit,
types::storage::enums::Currency,
i64,
T,
)> for RapydRouterData<T> | {"issue_number": 2244, "pr_number": 2664, "commits_count": 2, "files_changed": 2, "response_length": 1823, "file_count": 7, "needs_breakdown": false} |
fix(connector): [Cybersource] change commerce indicator for applepay
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Change the commerce indicator for cybersource applepay payment which was failing payment in production
Note: This pr is crucial for flowbird
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
Tested through postman:
- Create an MCA for Cybersource:
- Create a Payment with Applepay:
```
{
"amount": 650,
"currency": "USD",
"confirm": true,
"amount_to_capture": 650,
"customer_id": "test_fb",
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"authentication_type": "three_ds",
"return_url": "https://google.com",
"email": "something@gmail.com",
"name": "Joseph Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payment request",
"statement_descriptor_name": "Juspay",
"statement_descriptor_suffix": "Router",
"payment_method": "wallet",
"payment_method_type": "apple_pay",
"payment_method_data": {
"wallet": {
"apple_pay": {
"payment_data": "{{payment_data}}",
"payment_method": {
"display_name": "MasterCard 7599",
"network": "MasterCard",
"type": "credit"
},
"transaction_identifier": "{{transaction_identifier}}"
}
},
"billing": {
"address": {
"line1": "jhkdsa",
"zip": "10000",
"last_name": "chikke",
"city": "adf",
"country": "US",
"first_name": "srujan",
"state": "Alabama"
},
"email": "chikke.srujan@juspay.in"
}
}
}
```
- The payment should `succeed`
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
| <think>
PR Context:
- Title: fix(connector): [Cybersource] change commerce indicator for applepay
- Merged: 2024-11-27T11:30:18Z
- Files changed: 1 files
- Commits: 1 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
Change the commerce indicator for cybersource applepay payment which was failing payment in production
Hotfix correspond to PR - [#6634](https://github.com/juspay/hyperswitch/pull/6634)
Note: This pr is crucial for flowbird
### Additi
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** fix(connector): [Cybersource] change commerce indicator for applepay (#6675)
Files to modify:
**crates/router/src/connector/cybersource/transformers.rs**
Modify existing code | {"issue_number": 6634, "pr_number": 6675, "commits_count": 1, "files_changed": 1, "response_length": 979, "file_count": 3, "needs_breakdown": false} |
feat(webhooks): allow manually retrying delivery of outgoing webhooks
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
This PR includes changes in the outgoing webhooks flow to allow manually retrying webhook deliveries, and adds an API endpoint for the same.
- URL: `/events/{merchant_id_or_profile_id}/{event_id}/retry`
- Authentication: Admin API authentication + JWT
- The endpoint must return the request and response information for the attempted retry.
### Additional Changes
- [x] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
This PR adds a new endpoint to retry outgoing webhook delivery.
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
This allows users to debug issues in case the delivery of webhooks to their application server fails, without having to wait for the application to automatically retry at set intervals.
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
This PR adds a new endpoint and testing it is pretty straightforward. It can be tried out using a request like so:
```shell
curl -X POST -H 'api-key: {{admin_api_key}}' '{{baseUrl}}/events/{{merchant_id_or_profile_id}}/{{event_id}}/retry'
```
- In case of errors hitting the merchant server (say URL is inaccessible):
```shell
curl -X POST -H 'api-key: test_admin' 'http://localhost:8080/events/pro_H7FbvX2pBuJLjlPhkpRa/evt_018e62ea2215731c915c3a47e4753e4a/retry' 2>/dev/null | jq '.'
{
"event_id": "evt_018e6581512d7b9bba60ec4ca44f364f",
"merchant_id": "merchant_1710609960",
"profile_id": "pro_H7FbvX2pBuJLjlPhkpRa",
"object_id": "pay_6AMmb6rtlPDarBLlotAH",
"event_type": "payment_succeeded",
"event_class": "payments",
"is_delivery_successful": false,
"initial_attempt_id": "evt_018e48d5ad6c73d5a289342e6132b224",
"created": "2024-03-22T09:32:37.550Z",
"request": {
"body": "{\"merchant_id\":\"merchant_1710609960\",\"event_id\":\"evt_018e48d5ad6c73d5a289342e6132b224\",\"event_type\":\"payment_succeeded\",\"content\":{\"type\":\"payment_details\",\"object\":{\"payment_id\":\"pay_6AMmb6rtlPDarBLlotAH\",\"merchant_id\":\"merchant_1710609960\",\"status\":\"succeeded\",\"amount\":6540,\"net_amount\":6540,\"amount_capturable\":0,\"amount_received\":6540,\"connector\":\"stripe\",\"client_secret\":\"pay_6AMmb6rtlPDarBLlotAH_secret_1hjI8KVOKf5xhMXBTwRj\",\"created\":\"2024-03-16T19:55:45.335Z\",\"currency\":\"USD\",\"customer_id\":\"StripeCustomer\",\"description\":\"Its my first payment request\",\"refunds\":null,\"disputes\":null,\"mandate_id\":null,\"mandate_data\":null,\"setup_future_usage\":null,\"off_session\":null,\"capture_on\":null,\"capture_method\":\"automatic\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"last4\":\"4242\",\"card_type\":null,\"card_network\":null,\"card_issuer\":null,\"card_issuing_country\":null,\"card_isin\":\"424242\",\"card_extended_bin\":\"42424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"card_holder_name\":\"joseph Doe\"},\"billing\":{\"address\":{\"city\":\"San Fransico\",\"country\":\"US\",\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"zip\":\"94122\",\"state\":\"California\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"8056594427\",\"country_code\":\"+91\"},\"email\":null}},\"payment_token\":null,\"shipping\":{\"address\":{\"city\":\"San Fransico\",\"country\":\"US\",\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"zip\":\"94122\",\"state\":\"California\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"8056594427\",\"country_code\":\"+91\"},\"email\":null},\"billing\":{\"address\":{\"city\":\"San Fransico\",\"country\":\"US\",\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"zip\":\"94122\",\"state\":\"California\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"8056594427\",\"country_code\":\"+91\"},\"email\":null},\"order_details\":null,\"email\":\"guest@example.com\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"return_url\":\"https://google.com/\",\"authentication_type\":\"no_three_ds\",\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"next_action\":null,\"cancellation_reason\":null,\"error_code\":null,\"error_message\":null,\"unified_code\":null,\"unified_message\":null,\"payment_experience\":null,\"payment_method_type\":\"credit\",\"connector_label\":null,\"business_country\":null,\"business_label\":\"default\",\"business_sub_label\":null,\"allowed_payment_method_types\":null,\"ephemeral_key\":{\"customer_id\":\"StripeCustomer\",\"created_at\":1710618945,\"expires\":1710622545,\"secret\":\"epk_5736317c91e04787838bd300d6f53877\"},\"manual_retry_allowed\":false,\"connector_transaction_id\":\"pi_3Ov3KXD5R7gDAGff1ZbtdptB\",\"frm_message\":null,\"metadata\":{\"udf1\":\"value1\",\"login_date\":\"2019-09-10T10:11:12Z\",\"new_customer\":\"true\"},\"connector_metadata\":null,\"feature_metadata\":null,\"reference_id\":\"pi_3Ov3KXD5R7gDAGff1ZbtdptB\",\"payment_link\":null,\"profile_id\":\"pro_H7FbvX2pBuJLjlPhkpRa\",\"surcharge_details\":null,\"attempt_count\":1,\"merchant_decision\":null,\"merchant_connector_id\":\"mca_qeS5H2fLkr8GLzN9SNWd\",\"incremental_authorization_allowed\":null,\"authorization_count\":null,\"incremental_authorizations\":null,\"external_authentication_details\":null,\"external_3ds_authentication_attempted\":false,\"expires_on\":\"2024-03-16T20:10:45.335Z\",\"fingerprint\":null,\"payment_method_id\":null,\"payment_method_status\":null}},\"timestamp\":\"2024-03-16T19:55:46.924Z\"}",
"headers": [
[
"content-type",
"application/json"
],
[
"X-Webhook-Signature-512",
"68dd7abf747b5c33eaef5d7450990594aff5b260e79a33405539311f037efc2b70f86b062bcab9a231bd8fa8e8141df078e5834d52add7751da48247bf31ece5"
]
]
},
"response": {
"body": null,
"headers": null,
"status_code": null,
"error_message": "Unable to send request to merchant server"
},
"delivery_attempt": "manual_retry"
}
```
Note:
- `initial_attempt_id` would not contain the `event_id` of the event being retried, but the `initial_attempt_id` of the event being retried. This would allow us to list all attempts including manual delivery attempts related to the initial attempt.
- `delivery_attempt` is `manual_retry` in this case
- `response.error_message` is non-null
- Successful delivery:
```shell
curl -X POST -H 'api-key: test_admin' 'http://localhost:8080/events/pro_H7FbvX2pBuJLjlPhkpRa/evt_018e62ea2215731c915c3a47e4753e4a/retry' 2>/dev/null | jq '.'
{
"event_id": "evt_018e6589a52e75a9bb0dbb72fd6b6434",
"merchant_id": "merchant_1710609960",
"profile_id": "pro_H7FbvX2pBuJLjlPhkpRa",
"object_id": "pay_6AMmb6rtlPDarBLlotAH",
"event_type": "payment_succeeded",
"event_class": "payments",
"is_delivery_successful": true,
"initial_attempt_id": "evt_018e48d5ad6c73d5a289342e6132b224",
"created": "2024-03-22T09:41:43.342Z",
"request": {
"body": "{\"merchant_id\":\"merchant_1710609960\",\"event_id\":\"evt_018e48d5ad6c73d5a289342e6132b224\",\"event_type\":\"payment_succeeded\",\"content\":{\"type\":\"payment_details\",\"object\":{\"payment_id\":\"pay_6AMmb6rtlPDarBLlotAH\",\"merchant_id\":\"merchant_1710609960\",\"status\":\"succeeded\",\"amount\":6540,\"net_amount\":6540,\"amount_capturable\":0,\"amount_received\":6540,\"connector\":\"stripe\",\"client_secret\":\"pay_6AMmb6rtlPDarBLlotAH_secret_1hjI8KVOKf5xhMXBTwRj\",\"created\":\"2024-03-16T19:55:45.335Z\",\"currency\":\"USD\",\"customer_id\":\"StripeCustomer\",\"description\":\"Its my first payment request\",\"refunds\":null,\"disputes\":null,\"mandate_id\":null,\"mandate_data\":null,\"setup_future_usage\":null,\"off_session\":null,\"capture_on\":null,\"capture_method\":\"automatic\",\"payment_method\":\"card\",\"payment_method_data\":{\"card\":{\"last4\":\"4242\",\"card_type\":null,\"card_network\":null,\"card_issuer\":null,\"card_issuing_country\":null,\"card_isin\":\"424242\",\"card_extended_bin\":\"42424242\",\"card_exp_month\":\"10\",\"card_exp_year\":\"25\",\"card_holder_name\":\"joseph Doe\"},\"billing\":{\"address\":{\"city\":\"San Fransico\",\"country\":\"US\",\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"zip\":\"94122\",\"state\":\"California\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"8056594427\",\"country_code\":\"+91\"},\"email\":null}},\"payment_token\":null,\"shipping\":{\"address\":{\"city\":\"San Fransico\",\"country\":\"US\",\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"zip\":\"94122\",\"state\":\"California\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"8056594427\",\"country_code\":\"+91\"},\"email\":null},\"billing\":{\"address\":{\"city\":\"San Fransico\",\"country\":\"US\",\"line1\":\"1467\",\"line2\":\"Harrison Street\",\"line3\":\"Harrison Street\",\"zip\":\"94122\",\"state\":\"California\",\"first_name\":\"joseph\",\"last_name\":\"Doe\"},\"phone\":{\"number\":\"8056594427\",\"country_code\":\"+91\"},\"email\":null},\"order_details\":null,\"email\":\"guest@example.com\",\"name\":\"John Doe\",\"phone\":\"999999999\",\"return_url\":\"https://google.com/\",\"authentication_type\":\"no_three_ds\",\"statement_descriptor_name\":\"joseph\",\"statement_descriptor_suffix\":\"JS\",\"next_action\":null,\"cancellation_reason\":null,\"error_code\":null,\"error_message\":null,\"unified_code\":null,\"unified_message\":null,\"payment_experience\":null,\"payment_method_type\":\"credit\",\"connector_label\":null,\"business_country\":null,\"business_label\":\"default\",\"business_sub_label\":null,\"allowed_payment_method_types\":null,\"ephemeral_key\":{\"customer_id\":\"StripeCustomer\",\"created_at\":1710618945,\"expires\":1710622545,\"secret\":\"epk_5736317c91e04787838bd300d6f53877\"},\"manual_retry_allowed\":false,\"connector_transaction_id\":\"pi_3Ov3KXD5R7gDAGff1ZbtdptB\",\"frm_message\":null,\"metadata\":{\"udf1\":\"value1\",\"login_date\":\"2019-09-10T10:11:12Z\",\"new_customer\":\"true\"},\"connector_metadata\":null,\"feature_metadata\":null,\"reference_id\":\"pi_3Ov3KXD5R7gDAGff1ZbtdptB\",\"payment_link\":null,\"profile_id\":\"pro_H7FbvX2pBuJLjlPhkpRa\",\"surcharge_details\":null,\"attempt_count\":1,\"merchant_decision\":null,\"merchant_connector_id\":\"mca_qeS5H2fLkr8GLzN9SNWd\",\"incremental_authorization_allowed\":null,\"authorization_count\":null,\"incremental_authorizations\":null,\"external_authentication_details\":null,\"external_3ds_authentication_attempted\":false,\"expires_on\":\"2024-03-16T20:10:45.335Z\",\"fingerprint\":null,\"payment_method_id\":null,\"payment_method_status\":null}},\"timestamp\":\"2024-03-16T19:55:46.924Z\"}",
"headers": [
[
"content-type",
"application/json"
],
[
"X-Webhook-Signature-512",
"68dd7abf747b5c33eaef5d7450990594aff5b260e79a33405539311f037efc2b70f86b062bcab9a231bd8fa8e8141df078e5834d52add7751da48247bf31ece5"
]
]
},
"response": {
"body": "",
"headers": [
[
"content-length",
"0"
],
[
"date",
"Fri, 22 Mar 2024 09:41:44 GMT"
],
[
"access-control-allow-origin",
"*"
],
[
"set-cookie",
"ARRAffinity=669b1a143e31fb4dd62d7cac87cd552f46ae1eaa9e19a1bc7e87014967e06b05;Path=/;HttpOnly;Secure;Domain=smee.io"
],
[
"set-cookie",
"ARRAffinitySameSite=669b1a143e31fb4dd62d7cac87cd552f46ae1eaa9e19a1bc7e87014967e06b05;Path=/;HttpOnly;SameSite=None;Secure;Domain=smee.io"
],
[
"request-context",
"appId=cid-v1:"
],
[
"x-powered-by",
"Express"
]
],
"status_code": 200,
"error_message": null
},
"delivery_attempt": "manual_retry"
}
```
- The above request should behave the same way by replacing the profile ID with the merchant ID, or replacing the `api-key` header and value with the JWT token received after user sign in.
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
- [ ] I added a [CHANGELOG](/CHANGELOG.md) entry if applicable
| <think>
PR Context:
- Title: refactor(webhook_events): allow listing unique webhook events based on profile ID
- Merged: 2024-08-14T09:51:26Z
- Files changed: 15 files
- Commits: 3 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
This PR adds back a feature that was removed in #5566: the ability to list unique webhook events by profile ID. This is done by accepting `profile_id` as a query parameter in the Events List endpoint. As for the other two webhook endpoints (
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** refactor(webhook_events): allow listing unique webhook events based on profile ID (#5598)
Files to modify:
**crates/api_models/src/webhook_events.rs**
Modify existing code
**crates/common_utils/src/events.rs**
Modify existing code
**crates/diesel_models/src/query/business_profile.rs**
Add:
- function: pub::find_by_merchant_id_profile_id
**crates/openapi/src/routes/webhook_events.rs**
Modify existing code
**crates/router/src/core/webhooks/webhook_events.rs**
Modify existing code
**crates/router/src/db/business_profile.rs**
Add:
- function: private::find_business_profile_by_merchant_id_profile_id
- function: private::find_business_profile_by_merchant_id_profile_id
**crates/router/src/db/events.rs**
Remove:
- function: private::list_events_by_profile_id_initial_attempt_id
- function: private::list_events_by_profile_id_initial_attempt_id
**crates/router/src/db/kafka_store.rs**
Remove:
- function: private::list_events_by_profile_id_initial_attempt_id
Add:
- function: private::find_business_profile_by_merchant_id_profile_id
**crates/router/src/routes/app.rs**
Modify existing code
**crates/router/src/routes/webhook_events.rs**
Modify existing code
**crates/router/src/services/authentication.rs**
Modify existing code | {"issue_number": 4176, "pr_number": 5598, "commits_count": 1, "files_changed": 15, "response_length": 2107, "file_count": 13, "needs_breakdown": false} |
[REFACTOR]: [Dlocal] Remove Default Case Handling
### :memo: Feature Description
- We utilize match statements to make pivotal decisions, such as generating requests based on the payment method type and managing responses received from the connector.
- These conditions generally go hand in hand with enum variants.
- Default case is used because a match statement needs to be exhaustive i.e. every variant needs to be covered.
- So, if all the explicit cases are handled then default is used to handle the rest.
- Each connector have these match statements but many of them don’t provide reference to each variant in their default case, rather a `_` is put to handle all the other cases.
- This approach carries a risk because developers may inadvertently overlook the need for explicit handling of the new cases.
### :hammer: Possible Implementation
- Instead of relying on a default match case `_`, developers should handle each and every variant explicitly.
- By doing so, if there are any changes in the future, they can readily assess the impact of their modifications simply by compiling the code.
- You can check this PR for further reference https://github.com/juspay/hyperswitch/pull/1955
:bookmark: Note: All the changes needed should be contained within `hyperswitch/crates/router/src/connector/`
### :package: Have you spent some time checking if this feature request has been raised before?
- [X] I checked and didn't find a similar issue
### :package: Have you read the Contributing Guidelines?
- [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md)
### :sparkles: Are you willing to submit a PR?
| <think>
PR Context:
- Title: refactor(connector): [Dlocal] remove default case handling
- Merged: 2023-10-19T14:26:05Z
- Files changed: 1 files
- Commits: 4 commits
Implementation approach:
## Description
removed all the default case in dlocal and handle all the missing cases
closes #2269
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Prov
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** refactor(connector): [Dlocal] remove default case handling (#2624)
Files to modify:
**crates/router/src/connector/dlocal/transformers.rs**
Modify existing code | {"issue_number": 2269, "pr_number": 2624, "commits_count": 1, "files_changed": 1, "response_length": 954, "file_count": 3, "needs_breakdown": false} |
Updating the API reference documentation
We have had feedback related to the API doc being outdated, and lacking proper visibility of the latest spec of the API collection. | <think>
PR Context:
- Title: Docs: Api reference docs update for Payments - Create
- Merged: 2024-06-28T11:47:58Z
- Files changed: 9 files
- Commits: 25 commits
Implementation approach:
## Description
This is regarding the API Reference Doc changes using OpenAPI.
This PR just the doc changes for Payments - Create (Including the Payments - Response)
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifi
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** Docs: Api reference docs update for Payments - Create (#4955)
Co-authored-by: Gorakhnath Yadav <gora
Files to modify:
**crates/api_models/src/admin.rs**
Modify existing code
**crates/api_models/src/enums.rs**
Modify existing code
**crates/api_models/src/ephemeral_key.rs**
Modify existing code
**crates/api_models/src/mandates.rs**
Modify existing code
**crates/api_models/src/payments.rs**
Modify existing code
**crates/common_enums/src/enums.rs**
Modify existing code
**crates/openapi/src/openapi.rs**
Modify existing code
**crates/openapi/src/routes/payments.rs**
Modify existing code | {"issue_number": 5014, "pr_number": 4955, "commits_count": 1, "files_changed": 9, "response_length": 1399, "file_count": 10, "needs_breakdown": false} |
Force password reset
- Force user to change the password after certain amount of time.
- Force user to set password after user lands to dashboard without setting his/her password (invite flow). | <think>
PR Context:
- Title: feat(users): implement force set and force change password
- Merged: 2024-05-07T14:25:34Z
- Files changed: 25 files
- Commits: 12 commits
Implementation approach:
## Description
- Allow users to set password when newly signing in
- Allow users to force change password after specified duration of time
### Additional Changes
- [x] This PR modifies the API contract
- [x] This PR modifies the database schema
- [ ] This PR modifies application configurati
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat(users): implement force set and force change password (#4564)
Co-authored-by: hyperswitch-bot[b
Files to modify:
**crates/api_models/src/events/user.rs**
Modify existing code
**crates/api_models/src/user.rs**
Add:
- struct: pub::RotatePasswordRequest
**crates/common_enums/src/enums.rs**
Modify existing code
**crates/diesel_models/src/schema.rs**
Modify existing code
**crates/diesel_models/src/user.rs**
Modify existing code
**crates/router/src/configs/secrets_transformers.rs**
Modify existing code
**crates/router/src/configs/settings.rs**
Add:
- struct: pub::UserSettings
**crates/router/src/core/errors/user.rs**
Modify existing code
**crates/router/src/core/user.rs**
Add:
- function: private::rotate_password
**crates/router/src/db/user.rs**
Modify existing code
**crates/router/src/routes/app.rs**
Modify existing code
**crates/router/src/routes/lock_utils.rs**
Modify existing code
**crates/router/src/routes/user.rs**
Modify existing code
**crates/router/src/types/domain/user.rs**
Add:
- function: pub::is_password_rotate_required
**crates/router/src/types/domain/user/decision_manager.rs**
Modify existing code
**crates/router_env/src/logger/types.rs**
Modify existing code | {"issue_number": 4411, "pr_number": 4564, "commits_count": 1, "files_changed": 25, "response_length": 2049, "file_count": 18, "needs_breakdown": true} |
feat(connector): Add recovery support for stripebilling
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Context: In case of some billing connectors we dont get the enough data in the webhook itself to support creation of payment intent and payment attempt in our system. So previously we derived a flow named "AdditionalRevenuerecoveryDetails" in this PR:#7402 which name is now changed to "BillingConnectorPaymentSync". This flow is used to fetch payment details of the invoices from the billing connectors using an API call to that billing connector. In this pr we are calling the flow and getting the details which are needed to create payment intent and attempt in our system.
1. Creates a connector integration in stripe billing that supports the API call.
2. Call the flow in recovery_incoming.rs file and using that details further we are creating the payment intent and attempt and verifying them.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
3. `crates/router/src/configs`
4. `loadtest/config`
-->
## Motivation and Context
## Testing
1. Go to stripe create a new webhook endpoint with a dummy url to get webhook secret key.
2. create a payment processor stripe
```
curl --location 'http://localhost:8080/v2/connector-accounts' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'x-merchant-id: cloth_seller_mQRYaJduFokPeZ54W6bN' \
--header 'x-profile-id: pro_me6dnNKlhwuq32xhfjCA' \
--header 'Authorization: admin-api-key=test_admin' \
--header 'api-key: test_admin' \
--data '{
"connector_type": "payment_processor",
"connector_name": "stripe",
"connector_account_details": {
"auth_type": "HeaderKey",
"api_key": "api-key
},
"payment_methods_enabled": [
{
"payment_method_type": "card_redirect",
"payment_method_subtypes": [
{
"payment_method_subtype": "card_redirect",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method_type": "card",
"payment_method_subtypes": [
{
"payment_method_subtype": "credit",
"payment_experience": null,
"card_networks": [
"Visa",
"Mastercard"
],
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "debit",
"payment_experience": null,
"card_networks": [
"Visa",
"Mastercard"
],
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method_type": "wallet",
"payment_method_subtypes": [
{
"payment_method_subtype": "google_pay",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "apple_pay",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "we_chat_pay",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "ali_pay",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "paypal",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "mb_way",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method_type": "pay_later",
"payment_method_subtypes": [
{
"payment_method_subtype": "klarna",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "affirm",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "afterpay_clearpay",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "walley",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method_type": "bank_redirect",
"payment_method_subtypes": [
{
"payment_method_subtype": "giropay",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "ideal",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "eps",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "bancontact_card",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "przelewy24",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "sofort",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "blik",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "trustly",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "online_banking_finland",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "online_banking_poland",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method_type": "bank_transfer",
"payment_method_subtypes": [
{
"payment_method_subtype": "ach",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "sepa",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "bacs",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method_type": "bank_debit",
"payment_method_subtypes": [
{
"payment_method_subtype": "ach",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "sepa",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "bacs",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "becs",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
}
],
"metadata": {
"status_url": "https://2753-2401-4900-1cb8-2ff9-24dd-1ccf-ed12-b464.in.ngrok.io/webhooks/merchant_1678699058/globalpay",
"account_name": "transaction_processing",
"pricing_type": "fixed_price",
"acquirer_bin": "438309",
"acquirer_merchant_id": "00002000000"
},
"frm_configs": null,
"connector_webhook_details": {
"merchant_secret": ""
},
"profile_id": "pro_me6dnNKlhwuq32xhfjCA"
}'
```
change the profile id and other feilds while creating you own one
3. copy the mca id of stripe and paste it in the billing mca curl in feature metadata
```
curl --location 'http://localhost:8080/v2/connector-accounts' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'x-merchant-id: cloth_seller_mQRYaJduFokPeZ54W6bN' \
--header 'x-profile-id: pro_me6dnNKlhwuq32xhfjCA' \
--header 'Authorization: admin-api-key=test_admin' \
--header 'api-key: test_admin' \
--data '{
"connector_type": "billing_processor",
"connector_name": "stripebilling",
"connector_account_details": {
"auth_type": "HeaderKey",
"api_key": "{your api key}"
},
"payment_methods_enabled": [
{
"payment_method_type": "card",
"payment_method_subtypes": [
{
"payment_method_subtype": "credit",
"payment_experience": null,
"card_networks": [
"Visa",
"Mastercard"
],
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_subtype": "debit",
"payment_experience": null,
"card_networks": [
"Visa",
"Mastercard"
],
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": -1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
}
],
"metadata": {
"status_url": "https://2753-2401-4900-1cb8-2ff9-24dd-1ccf-ed12-b464.in.ngrok.io/webhooks/merchant_1678699058/globalpay",
"account_name": "transaction_processing",
"pricing_type": "fixed_price",
"acquirer_bin": "438309",
"acquirer_merchant_id": "00002000000"
},
"frm_configs": null,
"feature_metadata" : {
"revenue_recovery":{
"max_retry_count" : 16,
"billing_connector_retry_threshold": 2,
"billing_account_reference": {
"{your stripe mca id here}": "stripebilling"
}
}
},
"connector_webhook_details": {
"merchant_secret": "{webhook secret you have copied here}"
},
"profile_id": "pro_me6dnNKlhwuq32xhfjCA"
}'
```
4. copy the mca id, profile id and merchant id to construct the endpoint of the webhook.
5. install ngrok and run the service it will give you a https url for your local host port.
6. copy the https url of ngrok
7. construct the webhook endpoint : url/v2/webhooks/merchant_id/profile_id/billing_mca_id
8. paste this endpoint in the place of dummy url you have used to create endpoint in stripe dashboard
9. now create a test subscription use this card "4000 0000 0000 0341" while creating a test subscription and the billing day should start from the next day. If you are creating a test subscription today billing date should start from tommorow.
10. now move the clock past one month.
11. no observe the payment intent table and payment attempt table in db and verify those details with ones we are getting.
Images of the logs:
<img width="1728" alt="Screenshot 2025-03-11 at 5 52 53 PM" src="https://github.com/user-attachments/assets/0a97b656-2417-4812-b9cd-a808183411ea" />
<img width="1728" alt="Screenshot 2025-03-11 at 5 53 10 PM" src="https://github.com/user-attachments/assets/5a9872f1-45a3-4bf5-978c-6e477df36c9f" />
<img width="1728" alt="Screenshot 2025-03-11 at 5 53 21 PM" src="https://github.com/user-attachments/assets/5cbac559-09d8-4939-b2a6-04bc8f50a1bc" />
<img width="1728" alt="Screenshot 2025-03-11 at 5 54 32 PM" src="https://github.com/user-attachments/assets/3eb3fb41-afd4-4a05-8c8b-715310a79d7d" />
<img width="1710" alt="Screenshot 2025-03-10 at 4 52 08 PM" src="https://github.com/user-attachments/assets/05477fdc-656b-42cd-ba27-880d5748cc19" />
<img width="1190" alt="Screenshot 2025-03-10 at 4 52 20 PM" src="https://github.com/user-attachments/assets/d9900f24-2b8f-45c5-b6c5-bd5dcd62357d" />
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
| <think>
PR Context:
- Title: feat(core): consume card details from billing connectors and first error codes and store them in payment intent table
- Merged: 2025-06-16T11:39:32Z
- Files changed: 16 files
- Commits: 30 commits
Implementation approach:
## Description
The following details are needed to be stored in the payment intent feature metadata as a part of transaction monitoring system for revenue recovery.
1. Card Network
2. Card Issuer
3. First Payment Gateway Error Code
4. First Network Error Code
5. First Network Advice Cod
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** feat(core): consume card details from billing connectors and first error codes and store them in pay
Files to modify:
**crates/api_models/src/payments.rs**
Add:
- struct: pub::BillingConnectorAdditionalCardInfo
- enum: pub::BillingConnectorPaymentMethodDetails
**crates/diesel_models/src/types.rs**
Add:
- struct: pub::BillingConnectorAdditionalCardInfo
- enum: pub::BillingConnectorPaymentMethodDetails
**crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/recurly/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/stripebilling/transformers.rs**
Remove:
- struct: pub::StripeCardFundingTypeDetails
Add:
- function: private::from
- struct: pub::StripeBillingCardDetails
**crates/hyperswitch_domain_models/src/lib.rs**
Add:
- function: private::convert_from
- function: private::convert_back
- function: private::convert_from
- function: private::convert_back
- impl: impl ApiModelToDieselModelConvertor<ApiBillingConnectorAdditionalCardInfo> for BillingConnectorAdditionalCardInfo
- impl: impl ApiModelToDieselModelConvertor<ApiBillingConnectorPaymentMethodDetails> for BillingConnectorPaymentMethodDetails
**crates/hyperswitch_domain_models/src/payments.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/revenue_recovery.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_response_types/revenue_recovery.rs**
Modify existing code
**crates/openapi/src/openapi_v2.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_attempt_record.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Add:
- function: private::foreign_from
- impl: impl ForeignFrom<&diesel_models::types::BillingConnectorPaymentMethodDetails> for api_models::payments::BillingConnectorPaymentMethodDetails
**crates/router/src/core/revenue_recovery.rs**
Modify existing code
**crates/router/src/core/revenue_recovery/api.rs**
Modify existing code
**crates/router/src/core/webhooks/recovery_incoming.rs**
Modify existing code | {"issue_number": 7461, "pr_number": 8250, "commits_count": 1, "files_changed": 16, "response_length": 3062, "file_count": 17, "needs_breakdown": true} |
[BUG] : Bank Transfer status mapping is wrong for stripe
### Bug Description
While making the payment for bank transfer its going to "processing" state instead of "requires_customer_action".
Even after payment sync also its in processing state.
### Expected Behavior
It should be in "requires_customer_action" state
### Actual Behavior
Its going to "processing" state
### Steps To Reproduce
1.Create a payment intent
2.confirm the payment with bank transfer payment method details
3.The status is going to processing instead of requires_customer_action.
### Context For The Bug
_No response_
### Environment
Integ
### Have you spent some time to check if this bug has been raised before?
- [X] I checked and didn't find similar issue
### Have you read the Contributing Guidelines?
- [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md)
### Are you willing to submit a PR?
None | <think>
PR Context:
- Title: fix(update_trackers): handle preprocessing steps status update
- Merged: 2023-06-22T04:20:03Z
- Files changed: 9 files
- Commits: 8 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
The status of `router_data` was being updated after update trackers to `processing`. But in case of Bank transfers, the status of payment is updated in pre processing steps, so we need to persist the routerdata instead of overriding it.
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue,
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** fix(update_trackers): handle preprocessing steps status update (#1496)
Co-authored-by: Sangamesh <sa
Files to modify:
**crates/router/src/connector/trustpay/transformers.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/core/payments/flows.rs**
Modify existing code
**crates/router/src/core/payments/flows/authorize_flow.rs**
Modify existing code
**crates/router/src/core/payments/flows/cancel_flow.rs**
Modify existing code
**crates/router/src/core/payments/flows/capture_flow.rs**
Modify existing code
**crates/router/src/core/payments/flows/complete_authorize_flow.rs**
Modify existing code
**crates/router/src/core/payments/flows/psync_flow.rs**
Modify existing code
**crates/router/src/core/payments/flows/verify_flow.rs**
Modify existing code | {"issue_number": 1495, "pr_number": 1496, "commits_count": 1, "files_changed": 9, "response_length": 1627, "file_count": 11, "needs_breakdown": false} |
ci(connector-sanity-tests): fix invalid YAML syntax
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [x] CI/CD
## Description
<!-- Describe your changes in detail -->
This PR fixes invalid YAML syntax in the connector sanity tests workflow file.
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless its an obvious bug or documentation fix
that will have little conversation).
-->
Fixes CI builds not running due to invalid syntax of the workflow file.
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
I have the GitHub Actions VS Code extension installed, which previously complained about the invalid syntax when I opened the file. After this change, it no longer complains, so I believe this fixes it.
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [x] I reviewed submitted code
- [ ] I added unit tests for my changes where possible
- [ ] I added a [CHANGELOG](/CHANGELOG.md) entry if applicable
| <think>
PR Context:
- Title: ci(connector-sanity-tests): fix no tests being run
- Merged: 2023-05-10T12:55:23Z
- Files changed: 3 files
- Commits: 5 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
This PR fixes no tests being run after my derp in #1099.
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** ci(connector-sanity-tests): fix no tests being run (#1106)
Co-authored-by: Jagan Elavarasan <jaganel
Files to modify:
**crates/router/tests/connectors/adyen.rs**
Modify existing code
**crates/router/tests/connectors/shift4.rs**
Modify existing code | {"issue_number": 1099, "pr_number": 1106, "commits_count": 1, "files_changed": 3, "response_length": 1038, "file_count": 4, "needs_breakdown": false} |
fix(docker): currency enum fix for docker config
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
This PR fixes the following bug
```
2024-08-08 21:08:07 thread 'main' panicked at crates/router/src/bin/router.rs:16:10:
2024-08-08 21:08:07 Unable to construct application configuration: Application configuration error
2024-08-08 21:08:07 ├╴at crates/router/src/configs/settings.rs:759:14
2024-08-08 21:08:07 │
2024-08-08 21:08:07 ╰─▶ payout_method_filters.adyenplatform.sepa.currency: Some errors occurred:
2024-08-08 21:08:07 Unable to deserialize `NOR` as `common_enums::enums::Currency`: Matching variant not found
2024-08-08 21:08:07 ├╴at crates/router/src/configs/settings.rs:758:14
2024-08-08 21:08:07 ╰╴Unable to deserialize application configuration
2024-08-08 21:08:07 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
| <think>
PR Context:
- Title: fix(docker): currency enum fix for docker config
- Merged: 2024-08-09T08:44:39Z
- Files changed: 1 files
- Commits: 1 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
This PR fixes the following bug
```
2024-08-08 21:08:07 thread 'main' panicked at crates/router/src/bin/router.rs:16:10:
2024-08-08 21:08:07 Unable to construct application configuration: Application configuration error
2024-08-08 21:08:0
</think>
To implement this, you'll need to modify:
(No detailed commit information available) | {"issue_number": 5577, "pr_number": 5578, "commits_count": 0, "files_changed": 1, "response_length": 778, "file_count": 0, "needs_breakdown": false} |
[CYPRESS_FRAMEWORK] Verify URL after redirection
**Description:**
Cypress is the testing framework that Hyperswitch uses to run automated tests as it helps test both backend as well as frontend in a single shot that includes redirection flows like `3ds` and `bank redirect`.
Redirection tests in Cypress at present do not validate the end URL. This can lead to unnecessary complication and false positives when running tests that involve redirection say, 3ds tests, bank redirect tests, bank transfer tests and etc.,
The task is to refactor the [verifyReturnUrl function](https://github.com/juspay/hyperswitch/blob/45c19a1729af3f4b80bde2661868cb213138df86/cypress-tests/cypress/support/redirectionHandler.js#L397-L414) in [redirection handler](https://github.com/juspay/hyperswitch/blob/main/cypress-tests/cypress/support/redirectionHandler.js) to validate the URL
**Getting started:**
Go through the [README](https://github.com/juspay/hyperswitch/blob/main/cypress-tests/readme.md) for guidelines on file structure, formatting and instructions on how to set up and run Cypress.
**Possible implementation:**
- Refactor the [verifyReturnUrl](https://github.com/juspay/hyperswitch/blob/45c19a1729af3f4b80bde2661868cb213138df86/cypress-tests/cypress/support/redirectionHandler.js#L397-L414) function in [redirection handler](https://github.com/juspay/hyperswitch/blob/main/cypress-tests/cypress/support/redirectionHandler.js) support file
- Verify that `redirection_url` has status that equates to either succeeded or processing. Fail the test otherwise
Example:
Below is the `redirection_url` that has the terminal status of the payment after redirection. `verifyReturnUrl` function should parse `redirection_url` and validate the status.
redirection_url: `https://duckduckgo.com/?payment_id=pay_K29MmxZKI9rDhhSY7sb8&status=succeeded`
**Additional info:**
- Language: Javascript
- Difficulty: Easy
### Submission Process:
- Ask the maintainers for assignment of the issue, you can request for assignment by commenting on the issue itself.
- Once assigned, submit a pull request (PR).
- Maintainers will review and provide feedback, if any.
- Maintainers can unassign issues due to inactivity, [read more here](https://github.com/juspay/hyperswitch/wiki/Hacktoberfest-Contribution-Rules).
Refer [here](https://github.com/juspay/hyperswitch/blob/main/docs/TERMS_OF_CONTEST.md) for Terms and conditions for the contest. | <think>
PR Context:
- Title: refactor(cypress): verify payment status after payment redirection
- Merged: 2025-01-13T08:18:18Z
- Files changed: 1 files
- Commits: 26 commits
Implementation approach:
## Description
This PR refactors the verifyReturnUrl function to validate the redirection_url and ensure that the payment status is either succeeded or processing. If the status is invalid, the test will now fail, preventing false positives in redirection tests like 3DS or bank redirects.
###Key Changes:
</think>
To implement this, you'll need to modify:
(No detailed commit information available) | {"issue_number": 5915, "pr_number": 6187, "commits_count": 0, "files_changed": 1, "response_length": 797, "file_count": 0, "needs_breakdown": false} |
fix: verify email in decision manger
Currently decision manager is giving verify email flow for users who are already verified but not for users who are not verified. This should be other way around. | <think>
PR Context:
- Title: fix(users): Correct the condition for `verify_email` flow in decision manger
- Merged: 2024-05-08T08:31:55Z
- Files changed: 1 files
- Commits: 2 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
- Currently decision manager is giving verify email flow for users who are already verified but not for users who are not verified. This should be other way around, so condition is negated.
### Additional Changes
- [ ] This PR modifies t
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** fix(users): Correct the condition for `verify_email` flow in decision manger (#4580)
Files to modify:
**crates/router/src/types/domain/user/decision_manager.rs**
Modify existing code | {"issue_number": 4579, "pr_number": 4580, "commits_count": 1, "files_changed": 1, "response_length": 995, "file_count": 3, "needs_breakdown": false} |
[REFACTOR] facilitapay destination bank account number should be merchant facing
destination bank account number should be added by merchant, not customer. this is a design flaw that needs to be fixed. | <think>
PR Context:
- Title: refactor(connector): [facilitapay] move destination bank account number to connector metadata
- Merged: 2025-07-25T12:44:09Z
- Files changed: 11 files
- Commits: 7 commits
Implementation approach:
## Description
<!-- Describe your changes in detail -->
Destination bank account id should be merchant facing, not customer. This PR removes any references to destination bank account id and moves it to connector metadata instead.
### Additional Changes
- [ ] This PR modifies the API contra
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** refactor(connector): [facilitapay] move destination bank account number to connector metadata (#8704
Files to modify:
**crates/api_models/src/payments.rs**
Modify existing code
**crates/api_models/src/payments/additional_info.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/facilitapay/transformers.rs**
Remove:
- function: private::from_auth_type
- function: private::try_from
- function: private::try_from
- struct: pub::FacilitapayAuthType
- impl: impl FacilitapayAuthRequest
- impl: impl TryFrom<&ConnectorAuthType> for FacilitapayAuthType
- impl: impl TryFrom<&RefreshTokenRouterData> for FacilitapayAuthRequest
Add:
- function: private::from_auth_type
- function: private::try_from
- function: private::try_from
- function: private::try_from
- struct: pub::FacilitapayAuthType
- struct: pub::FacilitapayConnectorMetadataObject
- impl: impl FacilitapayAuthRequest
- impl: impl TryFrom<&ConnectorAuthType> for FacilitapayAuthType
- impl: impl TryFrom<&RefreshTokenRouterData> for FacilitapayAuthRequest
- impl: impl TryFrom<&Option<pii::SecretSerdeValue>> for FacilitapayConnectorMetadataObject
**crates/payment_methods/src/configs/payment_connector_required_fields.rs**
Modify existing code
**crates/router/src/core/connector_validation.rs**
Modify existing code | {"issue_number": 8703, "pr_number": 8704, "commits_count": 1, "files_changed": 11, "response_length": 2205, "file_count": 7, "needs_breakdown": false} |
refactor: Basilisk hs integration
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
## Description
Legacy locker will be depreciated as it doesn't have the key rotation feature,
We will be using basilisk-hs card vault to store card and other payment method
### Additional Changes
- [ ] This PR modifies the database schema
- [x] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless its an obvious bug or documentation fix
that will have little conversation).
-->
## How did you test it?
Tested it locally with basiliks-hs setup , we need to test basilisk-v3 as this is the services effected with the changes
Lets do it in custom pods post review
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed submitted code
- [ ] I added unit tests for my changes where possible
- [ ] I added a [CHANGELOG](/CHANGELOG.md) entry if applicable
| <think>
PR Context:
- Title: feat: Integrate basilisk-hs for card storage alongside legacy locker
- Merged: 2023-03-13T13:52:55Z
- Files changed: 9 files
- Commits: 6 commits
Implementation approach:
## Description
This PR is an extension for #704 . Earlier @manoj-juspay added the support for `basilisk_hs` permanent locker. But, in doing so removed the support of legacy locker. The current situation of the testing environment will still be using the legacy locker or some time, and for the mean while, we also need to support bo
</think>
To implement this, you'll need to modify:
(No detailed commit information available) | {"issue_number": 704, "pr_number": 718, "commits_count": 0, "files_changed": 9, "response_length": 798, "file_count": 0, "needs_breakdown": false} |
[REFACTOR] update auth data for recon APIs
### Refactor Description
Refactor the code to
- pass only the required authentication data to recon APIs (remove UserFromToken which contains different resource IDs)
- remove existing impls for fetching user from DB
### Have you spent some time checking if this feature request has been raised before?
- [X] I checked and didn't find a similar issue
### Have you read the Contributing Guidelines?
- [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md)
### Are you willing to submit a PR?
Yes, I am willing to submit a PR! | <think>
PR Context:
- Title: refactor(recon): use AuthDataWithUser and use JWTAuth for token verif…
- Merged: 2024-09-19T13:54:06Z
- Files changed: 4 files
- Commits: 27 commits
Implementation approach:
## Description
Described in #5838
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
<!--
Provide links to the files with corresponding changes.
Following are
</think>
To implement this, you'll need to modify:
**Detailed Implementation:**
**Commit 1:** refactor(recon): use AuthDataWithUser and use JWTAuth for token verif… (#5829)
Co-authored-by: hyper
Files to modify:
**crates/router/src/core/recon.rs**
Modify existing code
**crates/router/src/core/user.rs**
Modify existing code
**crates/router/src/routes/user.rs**
Modify existing code
**crates/router/src/services/authentication.rs**
Remove:
- struct: pub::UserFromTokenWithAuthData
- impl: impl AuthenticateAndFetch<UserFromTokenWithAuthData, A> for (user_id.clone())
Add:
- impl: impl AuthenticateAndFetch<AuthenticationDataWithUser, A> for Ok((auth, auth_type)) | {"issue_number": 5838, "pr_number": 5829, "commits_count": 1, "files_changed": 4, "response_length": 1399, "file_count": 6, "needs_breakdown": false} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.