prompt
stringlengths 83
247k
| response
stringlengths 121
36.1k
| metadata
stringlengths 314
42.3k
|
|---|---|---|
feat(payment_method): add logic for setup_future_usage downgrade and add filter based on zero mandate config
## 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 -->
- In list payment method for merchant, list both mandate and non-mandate payment methods unless it is zero mandate flow
- If the `setup_future_usage` is `off_session` for a payment method, downgrade it to `on_session` for that payment method
- Add config for the zero mandates (being used in list payment method for merchant)
- Add `setup_future_usage` field to payment_attempt to keep track of it for every attempt made
Below contains the new filtering logic:
<img width="645" alt="image" src="https://github.com/user-attachments/assets/65c6f7fa-1497-492d-a548-b8368ceda83b" />
Below represents the PaymentType for each payment_method_type during list call based the following parameters:
<img width="1042" alt="image" src="https://github.com/user-attachments/assets/afef3e79-d91c-48ca-a402-f4e34b5b033d" />
### Additional Changes
- [ ] This PR modifies the API contract
- [x] This PR modifies the database schema
```
Added setup_future_usage column to payment_attempt table
```
- [x] This PR modifies application configuration/environment variables
```
Added filter config for zero_mandates.
This represent the combination of payment_method, payment_method_type and connector for which zero_mandate flow is present
```
<!--
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)?
-->
#### Testing Payment Method List for Merchant:
Curls:
1) Create Payment
```
curl --location '{{baseUrl}}/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: {{api_key}}' \
--data-raw '{
"amount": 10,
"currency": "USD",
"confirm": false,
"capture_method": "automatic",
"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://duck.com",
"billing": {
"address": {
"city": "test",
"country": "HR",
"line1": "here is some \n there is some \n none is some? \n ",
"line2": "there",
"line3": "anywhere",
"zip": "560095",
"state": "Varaždin County",
"first_name": "S@k!l",
"last_name": "M*st@k"
}
},
"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"
},
"setup_future_usage": "off_session",
}'
```
2) Payment Method List for Merchant
```
curl --location '{{baseUrl}}/account/payment_methods?client_secret={{client_secret}}' \
--header 'Accept: application/json' \
--header 'api-key: {{api_key}}'
```
Scenarios:
Case 1: Non-zero amount and setup_future_usage as on_session
Result:
- Payment Method List should have all the payment method type selected by merchant
Case 2: Non-zero amount and setup_future_usage as off_session
Result:
- Payment Method List should have all the payment method type selected by merchant
Case 3: Zero amount and setup_future_usage as on_session
Result:
- Payment Method List should have all the payment method type selected by merchant
-
Case 4: Zero amount and setup_future_usage as off_session
Result:
- Payment Method List should filter the payment method type based on whether zero mandate is supported
##### Testing setup_future_usage downgrade logic:
Curls:
Payment Create+Confirm:
```
curl --location '{{baseUrl}}/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: ••••••' \
--data-raw '{
"amount": 141,
"currency": "EUR",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"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://google.com",
"payment_method": "gift_card",
"payment_method_type": "givex",
"payment_method_data": {
"gift_card": {
"givex": {
"number": "{{gift_card_number}}",
"cvc": "{{gift_card_cvc}}"
}
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "GB",
"first_name": "joseph",
"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": "127.0.0.1"
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "GB",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"setup_future_usage": "off_session"
}'
```
Scenarios:
Case 1: Create a payment with cards for Adyen with setup_future_usage as off_session
Result:
- The response should contain payment_method_id and setup_future_usage as off_session
Reason:
- Since card for adyen support mandates, the filter allowed for the creation of mandate
Case 2: Create a payment with gift cards for Adyen with setup_future_usage as off_session
Result:
- In response, setup_future_usage should be on_session with payment_method_id as null
Reason:
- setup_future_usage is downgraded to on_session since mandate is not supported by gift card for adyen
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/payment_attempt.rs`
- `crates/diesel_models/src/schema.rs`
- `crates/diesel_models/src/user/sample_data.rs`
**2. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/payments/payment_attempt.rs`
**3. Core Business Logic**
- `crates/router/src/core/payment_methods/cards.rs`
- `crates/router/src/core/payments/flows/authorize_flow.rs`
- `crates/router/src/core/payments/helpers.rs`
- ... and 4 more files
**4. External Connector Integration**
- `crates/router/src/configs/defaults/payment_connector_required_fields.rs`
**5. Type Definitions**
- `crates/router/src/types/storage/payment_attempt.rs`
**6. Utils**
- `crates/router/src/utils/user/sample_data.rs`
**7. Tests**
- `config/deployments/integration_test.toml`
**8. Configuration Files**
- `config/config.example.toml`
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- ... and 4 more files
**9. Other**
- `crates/storage_impl/src/mock_db/payment_attempt.rs`
- `crates/storage_impl/src/payments/payment_attempt.rs`
- `migrations/2025-04-09-074315_add_setup_future_usage_to_payment_attempt/down.sql`
- ... and 2 more files
**Code Patterns Applied:**
- Define new data structures (1 changes)
- Implement new functions (1 changes)
- Extend existing types with new fields (59 changes)
- Add conditional logic for feature flags or filtering (4 changes)
**Detailed Identifier Changes:**
Commit d061e0a7:
Files to modify:
**crates/diesel_models/src/payment_attempt.rs**
Modify existing code
**crates/diesel_models/src/schema.rs**
Modify existing code
**crates/diesel_models/src/user/sample_data.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payments/payment_attempt.rs**
Modify existing code
**crates/router/src/configs/defaults/payment_connector_required_fields.rs**
Add:
- function: private::default
- impl: impl Default for ZeroMandates
**crates/router/src/configs/secrets_transformers.rs**
Modify existing code
**crates/router/src/configs/settings.rs**
Add:
- struct: pub::ZeroMandates
**crates/router/src/core/payment_methods/cards.rs**
Modify existing code
**crates/router/src/core/payments/flows/authorize_flow.rs**
Modify existing code
**crates/router/src/core/payments/helpers.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_create.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_response.rs**
Modify existing code
**crates/router/src/core/payments/retry.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
**crates/router/src/types/storage/payment_attempt.rs**
Modify existing code
**crates/router/src/utils/user/sample_data.rs**
Modify existing code
**crates/storage_impl/src/mock_db/payment_attempt.rs**
Modify existing code
**crates/storage_impl/src/payments/payment_attempt.rs**
Modify existing code
|
{"pr_number": 7775, "pr_title": "feat(payment_method): add logic for setup_future_usage downgrade and add filter based on zero mandate config", "merged_at": "2025-04-17T12:09:52Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"database": ["crates/diesel_models/src/payment_attempt.rs", "crates/diesel_models/src/schema.rs", "crates/diesel_models/src/user/sample_data.rs"], "domain": ["crates/hyperswitch_domain_models/src/payments/payment_attempt.rs"], "core_business": ["crates/router/src/core/payment_methods/cards.rs", "crates/router/src/core/payments/flows/authorize_flow.rs", "crates/router/src/core/payments/helpers.rs", "crates/router/src/core/payments/operations/payment_create.rs", "crates/router/src/core/payments/operations/payment_response.rs", "crates/router/src/core/payments/retry.rs", "crates/router/src/core/payments/transformers.rs"], "connectors": ["crates/router/src/configs/defaults/payment_connector_required_fields.rs"], "types": ["crates/router/src/types/storage/payment_attempt.rs"], "utils": ["crates/router/src/utils/user/sample_data.rs"], "tests": ["config/deployments/integration_test.toml"], "config": ["config/config.example.toml", "config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml", "crates/router/src/configs/secrets_transformers.rs", "crates/router/src/configs/settings.rs"], "other": ["crates/storage_impl/src/mock_db/payment_attempt.rs", "crates/storage_impl/src/payments/payment_attempt.rs", "migrations/2025-04-09-074315_add_setup_future_usage_to_payment_attempt/down.sql", "migrations/2025-04-09-074315_add_setup_future_usage_to_payment_attempt/up.sql", "v2_migrations/2025-01-13-081847_drop_v1_columns/up.sql"]}, "change_types": {"structs_added": 1, "functions_added": 1, "fields_added": 59, "imports_added": 1, "conditionals_added": 4}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(core): fixed ctp bug for confirmation and added multi profile support for modular auth
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
## Description
<!-- Describe your changes in detail -->
Currently normal 3ds payments are failing if we enable a merchant for UAS. This pr fixes that
https://github.com/juspay/hyperswitch/pull/9545
### 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 -->
- [ ] 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/payments.rs`
- `crates/router/src/core/unified_authentication_service.rs`
**2. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/aci/transformers.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (1 changes)
**Detailed Identifier Changes:**
Commit f62178d3:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/aci/transformers.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/core/unified_authentication_service.rs**
Modify existing code
|
{"pr_number": 9546, "pr_title": "fix(core): fixed ctp bug for confirmation and added multi profile support for modular auth", "merged_at": "2025-09-25T07:45:31Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments.rs", "crates/router/src/core/unified_authentication_service.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/aci/transformers.rs"]}, "change_types": {"fields_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(router): Add payment_type to Get Intent response (v2)
## 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 `payment_type` to Payments Get Intent response
### 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).
-->
Closes #9065
## 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)?
-->
Request:
```
curl --location 'http://localhost:8080/v2/payments/create-intent' \
--header 'api-key: dev_5DkqRwXafcKhIFXyzwGtSjrnqsQuFWELuWJsepMgoRrjY1AxF7lhtNGeeja9BEHt' \
--header 'Content-Type: application/json' \
--header 'x-profile-id: pro_RAH6QGkLhuQfmi97QhPZ' \
--header 'Authorization: api-key=dev_5DkqRwXafcKhIFXyzwGtSjrnqsQuFWELuWJsepMgoRrjY1AxF7lhtNGeeja9BEHt' \
--data-raw '{
"amount_details": {
"order_amount": 1000,
"currency": "USD"
},
"capture_method": "automatic",
"authentication_type": "three_ds",
"order_details": [
{
"product_name": "Apple iphone 15",
"quantity": 1,
"amount": 1000
}
],
"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"
},
"phone": {
"number": "123456789",
"country_code": "+1"
},
"email": "user@gmail.com"
},
"shipping": {
"address": {
"first_name": "John",
"last_name": "Dough",
"city": "Karwar",
"zip": "571201",
"state": "California",
"country": "US"
},
"email": "example@example.com",
"phone": {
"number": "123456789",
"country_code": "+1"
}
},
"customer_id": "12345_cus_0198e5ff10ea7622abbf89f383110c99"
}'
```
Response:
```json
{
"id": "12345_pay_0198e5ff18b77a63ab0e91be36d6f9b7",
"status": "requires_payment_method",
"amount_details": {
"order_amount": 1000,
"currency": "USD",
"shipping_cost": null,
"order_tax_amount": null,
"external_tax_calculation": "skip",
"surcharge_calculation": "skip",
"surcharge_amount": null,
"tax_on_surcharge": null
},
"client_secret": "cs_0198e5ff18c57d729ec8fbbb03141331",
"profile_id": "pro_RAH6QGkLhuQfmi97QhPZ",
"merchant_reference_id": null,
"routing_algorithm_id": null,
"capture_method": "automatic",
"authentication_type": "three_ds",
"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",
"origin_zip": null
},
"phone": {
"number": "123456789",
"country_code": "+1"
},
"email": "user@gmail.com"
},
"shipping": {
"address": {
"city": "Karwar",
"country": "US",
"line1": null,
"line2": null,
"line3": null,
"zip": "571201",
"state": "California",
"first_name": "John",
"last_name": "Dough",
"origin_zip": null
},
"phone": {
"number": "123456789",
"country_code": "+1"
},
"email": "example@example.com"
},
"customer_id": "12345_cus_0198e5ff10ea7622abbf89f383110c99",
"customer_present": "present",
"description": null,
"return_url": null,
"setup_future_usage": "on_session",
"apply_mit_exemption": "Skip",
"statement_descriptor": null,
"order_details": [
{
"product_name": "Apple iphone 15",
"quantity": 1,
"amount": 1000,
"tax_rate": null,
"total_tax_amount": null,
"requires_shipping": null,
"product_img_link": null,
"product_id": null,
"category": null,
"sub_category": null,
"brand": null,
"product_type": null,
"product_tax_code": null,
"description": null,
"sku": null,
"upc": null,
"commodity_code": null,
"unit_of_measure": null,
"total_amount": null,
"unit_discount_amount": null
}
],
"allowed_payment_method_types": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"payment_link_enabled": "Skip",
"payment_link_config": null,
"request_incremental_authorization": "false",
"expires_on": "2025-08-26T11:04:17.247Z",
"frm_metadata": null,
"request_external_three_ds_authentication": "Skip",
"payment_type": "normal"
}
```
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/payments.rs`
**2. Core Business Logic**
- `crates/router/src/core/payments/transformers.rs`
**3. Other**
- `api-reference/v2/openapi_spec_v2.json`
**Code Patterns Applied:**
- Extend existing types with new fields (1 changes)
**Detailed Identifier Changes:**
Commit 26930a47:
Files to modify:
**crates/api_models/src/payments.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
|
{"pr_number": 9066, "pr_title": "feat(router): Add payment_type to Get Intent response (v2)", "merged_at": "2025-08-28T06:22:39Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/payments.rs"], "core_business": ["crates/router/src/core/payments/transformers.rs"], "other": ["api-reference/v2/openapi_spec_v2.json"]}, "change_types": {"fields_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(connector): [BILLWERK, FISERVEMEA, TSYS] use LazyLock instead of lazy_static
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
Closes this [issue](https://github.com/juspay/hyperswitch/issues/7495)
## Description
<!-- Describe your changes in detail -->
Refactored the feature matrix PR by using `LazyLock` instead of `lazy_static!`
### 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)?
-->
Postman Test
Feature API curl:
```
curl --location 'http://localhost:8080/feature_matrix' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: {{api_key}}'
```
Response:
```
{
"connector_count": 3,
"connectors": [
{
"name": "BILLWERK",
"display_name": "Billwerk",
"description": "Billwerk+ Pay is an acquirer independent payment gateway that's easy to setup with more than 50 recurring and non-recurring payment methods.",
"category": "payment_gateway",
"supported_payment_methods": [
{
"payment_method": "card",
"payment_method_type": "debit",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"three_ds": "not_supported",
"no_three_ds": "supported",
"supported_card_networks": [
"Mastercard",
"Visa",
"AmericanExpress",
"Discover",
"JCB",
"UnionPay",
"DinersClub",
"Interac",
"CartesBancaires"
],
"supported_countries": [
"DK",
"DE",
"FR",
"SE"
],
"supported_currencies": [
"DKK",
"NOK"
]
},
{
"payment_method": "card",
"payment_method_type": "credit",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"three_ds": "not_supported",
"no_three_ds": "supported",
"supported_card_networks": [
"Mastercard",
"Visa",
"AmericanExpress",
"Discover",
"JCB",
"UnionPay",
"DinersClub",
"Interac",
"CartesBancaires"
],
"supported_countries": [
"SE",
"FR",
"DE",
"DK"
],
"supported_currencies": [
"NOK",
"DKK"
]
}
],
"supported_webhook_flows": []
},
{
"name": "FISERVEMEA",
"display_name": "Fiservemea",
"description": "Fiserv powers over 6+ million merchants and 10,000+ financial institutions enabling them to accept billions of payments a year.",
"category": "bank_acquirer",
"supported_payment_methods": [
{
"payment_method": "card",
"payment_method_type": "debit",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"three_ds": "not_supported",
"no_three_ds": "supported",
"supported_card_networks": [
"Mastercard",
"Visa",
"AmericanExpress",
"Discover",
"JCB",
"UnionPay",
"DinersClub",
"Interac",
"CartesBancaires"
],
"supported_countries": [
"AE",
"PL",
"FR",
"ES",
"GB",
"ZA",
"DE",
"NL",
"IT"
],
"supported_currencies": [
"SSP",
"BIF",
"MOP",
"KMF",
"HNL",
"SYP",
"CVE",
"SGD",
"KHR",
"MXN",
"NPR",
"RUB",
"TMT",
"BRL",
"MRU",
"SHP",
"KPW",
"KZT",
"SLE",
"CZK",
"CAD",
"VUV",
"PYG",
"SOS",
"AFN",
"MVR",
"YER",
"ZAR",
"TTD",
"CHF",
"AMD",
"NGN",
"KYD",
"ERN",
"PKR",
"MZN",
"TJS",
"BTN",
"IDR",
"SCR",
"AED",
"MUR",
"CLP",
"XPF",
"TOP",
"PHP",
"THB",
"AZN",
"RON",
"DZD",
"SBD",
"PAB",
"HRK",
"KRW",
"SEK",
"BOB",
"LKR",
"SAR",
"KGS",
"NIO",
"RSD",
"PLN",
"NZD",
"BYN",
"SVC",
"GYD",
"SZL",
"USD",
"ISK",
"BMD",
"COP",
"SDG",
"TZS",
"KWD",
"UYU",
"JOD",
"CUP",
"LYD",
"LAK",
"DOP",
"AUD",
"VES",
"FJD",
"CRC",
"FKP",
"HKD",
"IRR",
"BDT",
"BBD",
"EUR",
"BHD",
"UAH",
"MGA",
"CNY",
"HTG",
"ALL",
"INR",
"GHS",
"MAD",
"TWD",
"MYR",
"BND",
"NAD",
"QAR",
"GIP",
"GEL",
"AOA",
"UGX",
"LSL",
"XAF",
"LBP",
"DJF",
"ETB",
"TND",
"XCD",
"SRD",
"GNF",
"BGN",
"GTQ",
"MWK",
"ZMW",
"MKD",
"HUF",
"PEN",
"RWF",
"DKK",
"BZD",
"IQD",
"ANG",
"ARS",
"GBP",
"WST",
"ZWL",
"PGK",
"TRY",
"KES",
"MDL",
"MNT",
"CDF",
"BAM",
"LRD",
"JPY",
"GMD",
"STN",
"VND",
"BWP",
"OMR",
"NOK",
"SLL",
"JMD",
"XOF",
"MMK",
"EGP",
"AWG",
"ILS",
"UZS",
"BSD"
]
},
{
"payment_method": "card",
"payment_method_type": "credit",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"three_ds": "not_supported",
"no_three_ds": "supported",
"supported_card_networks": [
"Mastercard",
"Visa",
"AmericanExpress",
"Discover",
"JCB",
"UnionPay",
"DinersClub",
"Interac",
"CartesBancaires"
],
"supported_countries": [
"NL",
"ES",
"DE",
"PL",
"IT",
"AE",
"GB",
"ZA",
"FR"
],
"supported_currencies": [
"JOD",
"AED",
"ALL",
"BOB",
"ERN",
"LBP",
"PAB",
"HNL",
"AZN",
"TMT",
"DKK",
"AWG",
"PKR",
"LAK",
"PGK",
"JMD",
"CUP",
"PHP",
"BAM",
"THB",
"FKP",
"HRK",
"UYU",
"KZT",
"BYN",
"PLN",
"SDG",
"VND",
"NZD",
"KWD",
"CDF",
"SCR",
"VUV",
"CHF",
"USD",
"GYD",
"ANG",
"DOP",
"MKD",
"STN",
"SAR",
"QAR",
"PEN",
"RSD",
"BRL",
"KGS",
"SGD",
"TWD",
"BHD",
"KHR",
"MOP",
"GHS",
"UGX",
"XPF",
"SSP",
"CAD",
"TOP",
"OMR",
"MXN",
"BGN",
"RUB",
"MDL",
"GNF",
"PYG",
"SRD",
"AFN",
"MNT",
"NOK",
"XAF",
"BWP",
"NGN",
"GIP",
"CZK",
"MGA",
"DZD",
"YER",
"DJF",
"SBD",
"CNY",
"ZAR",
"LYD",
"BMD",
"MUR",
"NIO",
"UZS",
"GBP",
"VES",
"SVC",
"CVE",
"NPR",
"RON",
"KMF",
"BZD",
"KPW",
"SLL",
"LKR",
"AUD",
"LSL",
"XCD",
"TJS",
"KYD",
"UAH",
"ARS",
"NAD",
"SEK",
"GTQ",
"BSD",
"IDR",
"WST",
"AMD",
"BTN",
"HUF",
"ZMW",
"COP",
"BIF",
"FJD",
"INR",
"IRR",
"GEL",
"HTG",
"SOS",
"CLP",
"ISK",
"MVR",
"RWF",
"BBD",
"KRW",
"BDT",
"LRD",
"AOA",
"MMK",
"MWK",
"SLE",
"XOF",
"MRU",
"KES",
"MYR",
"MZN",
"SYP",
"SZL",
"TRY",
"SHP",
"TTD",
"GMD",
"TZS",
"ETB",
"ILS",
"IQD",
"CRC",
"BND",
"HKD",
"EGP",
"JPY",
"MAD",
"TND",
"EUR",
"ZWL"
]
}
],
"supported_webhook_flows": []
},
{
"name": "TSYS",
"display_name": "Tsys",
"description": "TSYS, a Global Payments company, is the payment stack for the future, powered by unmatched expertise.",
"category": "bank_acquirer",
"supported_payment_methods": [
{
"payment_method": "card",
"payment_method_type": "credit",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"three_ds": "not_supported",
"no_three_ds": "supported",
"supported_card_networks": [
"Mastercard",
"Visa",
"AmericanExpress",
"Discover",
"JCB",
"UnionPay"
],
"supported_countries": [
"NA"
],
"supported_currencies": [
"CUP",
"SZL",
"GMD",
"AMD",
"MRU",
"BWP",
"SSP",
"QAR",
"XOF",
"VES",
"XAF",
"BBD",
"BSD",
"ETB",
"GBP",
"BHD",
"UYU",
"XCD",
"JPY",
"VUV",
"SAR",
"ZAR",
"MOP",
"MDL",
"IRR",
"SGD",
"MVR",
"BIF",
"BTN",
"STN",
"AED",
"TTD",
"TWD",
"UZS",
"KZT",
"ALL",
"UGX",
"DOP",
"BMD",
"FJD",
"KGS",
"KPW",
"ZMW",
"IQD",
"HRK",
"KMF",
"GTQ",
"LSL",
"NOK",
"MWK",
"CDF",
"KRW",
"ERN",
"RUB",
"GEL",
"MGA",
"OMR",
"HUF",
"HTG",
"PYG",
"MUR",
"HKD",
"BZD",
"LRD",
"SRD",
"THB",
"IDR",
"TJS",
"TRY",
"VND",
"JOD",
"PKR",
"GNF",
"LKR",
"TND",
"BDT",
"DJF",
"SDG",
"AOA",
"SVC",
"PEN",
"KYD",
"BRL",
"JMD",
"ISK",
"COP",
"BAM",
"BOB",
"CVE",
"INR",
"RWF",
"SCR",
"YER",
"LYD",
"MYR",
"LBP",
"CZK",
"NIO",
"SEK",
"DKK",
"UAH",
"USD",
"AZN",
"RON",
"HNL",
"SYP",
"CHF",
"PAB",
"NGN",
"NPR",
"AFN",
"CAD",
"ANG",
"GYD",
"MXN",
"BND",
"LAK",
"PGK",
"PLN",
"SHP",
"ARS",
"KWD",
"ILS",
"TMT",
"XPF",
"ZWL",
"FKP",
"CLP",
"AUD",
"DZD",
"GHS",
"PHP",
"NAD",
"TZS",
"CNY",
"MAD",
"NZD",
"MNT",
"WST",
"KHR",
"CRC",
"SLE",
"AWG",
"GIP",
"BGN",
"RSD",
"SOS",
"MKD",
"MMK",
"TOP",
"MZN",
"BYN",
"KES",
"EGP",
"EUR",
"SBD"
]
},
{
"payment_method": "card",
"payment_method_type": "debit",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"three_ds": "not_supported",
"no_three_ds": "supported",
"supported_card_networks": [
"Mastercard",
"Visa",
"AmericanExpress",
"Discover",
"JCB",
"UnionPay"
],
"supported_countries": [
"NA"
],
"supported_currencies": [
"AZN",
"SAR",
"ZWL",
"MRU",
"SZL",
"TRY",
"TOP",
"YER",
"LKR",
"ISK",
"NIO",
"TTD",
"BMD",
"PAB",
"MNT",
"BTN",
"SYP",
"HUF",
"CHF",
"UAH",
"DJF",
"DOP",
"XPF",
"MVR",
"WST",
"ZMW",
"TMT",
"TWD",
"LBP",
"PGK",
"XOF",
"ARS",
"PLN",
"MUR",
"MZN",
"NGN",
"MDL",
"SDG",
"SLE",
"VND",
"STN",
"KZT",
"THB",
"SGD",
"HRK",
"AUD",
"NAD",
"KHR",
"BSD",
"GEL",
"NOK",
"KPW",
"GNF",
"GHS",
"MWK",
"RUB",
"MAD",
"GMD",
"BWP",
"VUV",
"GTQ",
"BZD",
"MYR",
"BND",
"KMF",
"CVE",
"SSP",
"BBD",
"ALL",
"UZS",
"ERN",
"GYD",
"CUP",
"TJS",
"CZK",
"OMR",
"GIP",
"XCD",
"CNY",
"SBD",
"RON",
"KES",
"HKD",
"IQD",
"BDT",
"CDF",
"SEK",
"JPY",
"HNL",
"ETB",
"GBP",
"VES",
"TZS",
"MXN",
"XAF",
"CLP",
"AMD",
"LAK",
"EGP",
"NZD",
"SCR",
"SHP",
"ILS",
"KRW",
"SOS",
"MGA",
"JMD",
"ZAR",
"NPR",
"BAM",
"BIF",
"EUR",
"UYU",
"CRC",
"RSD",
"TND",
"PKR",
"SRD",
"AED",
"BOB",
"INR",
"MOP",
"USD",
"PEN",
"LRD",
"UGX",
"MMK",
"KGS",
"BRL",
"SVC",
"FKP",
"ANG",
"MKD",
"BGN",
"BHD",
"PHP",
"IRR",
"KYD",
"RWF",
"LSL",
"QAR",
"DKK",
"IDR",
"DZD",
"LYD",
"AWG",
"AFN",
"KWD",
"BYN",
"JOD",
"AOA",
"HTG",
"COP",
"FJD",
"CAD",
"PYG"
]
}
],
"supported_webhook_flows": []
},
]
}
```
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/billwerk.rs`
- `crates/hyperswitch_connectors/src/connectors/fiservemea.rs`
- `crates/hyperswitch_connectors/src/connectors/tsys.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (23 changes)
**Detailed Identifier Changes:**
Commit 413a7eee:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/billwerk.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/fiservemea.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/tsys.rs**
Modify existing code
|
{"pr_number": 7494, "pr_title": "refactor(connector): [BILLWERK, FISERVEMEA, TSYS] use LazyLock instead of lazy_static", "merged_at": "2025-04-24T10:35:43Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "refund"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/billwerk.rs", "crates/hyperswitch_connectors/src/connectors/fiservemea.rs", "crates/hyperswitch_connectors/src/connectors/tsys.rs"]}, "change_types": {"fields_added": 23, "imports_added": 6}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(core): add profile level config for debit routing feature
## 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 -->
Added is_debit_routing_enabled in profile Create req types and update Profile table
### 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
## How did you test it?
1. Merchant Account - Create
Request cURL :
```
curl --location 'http://localhost:8080/accounts' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--header 'Cookie: PHPSESSID=0b47db9d7de94c37b6b272087a9f2fa7' \
--data-raw '{
"merchant_id": "merchant_1742827499",
"locker_id": "m0010",
"merchant_name": "NewAge Retailer",
"merchant_details": {
"primary_contact_person": "John Test",
"primary_email": "JohnTest@test.com",
"primary_phone": "sunt laborum",
"secondary_contact_person": "John Test2",
"secondary_email": "JohnTest2@test.com",
"secondary_phone": "cillum do dolor id",
"website": "https://www.example.com",
"about_business": "Online Retail with a wide selection of organic products for North America",
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"first_name":"john",
"last_name":"Doe"
}
},
"return_url": "https://google.com/success",
"webhook_details": {
"webhook_version": "1.0.1",
"webhook_username": "ekart_retail",
"webhook_password": "password_ekart@123",
"webhook_url":"https://webhook.site",
"payment_created_enabled": true,
"payment_succeeded_enabled": true,
"payment_failed_enabled": true
},
"sub_merchants_enabled": false,
"parent_merchant_id":"merchant_123",
"metadata": {
"city": "NY",
"unit": "245"
},
"primary_business_details": [
{
"country": "US",
"business": "default"
}
]
}'
```
Response :
```
{
"merchant_id": "merchant_1742827344",
"merchant_name": "NewAge Retailer",
"return_url": "https://google.com/success",
"enable_payment_response_hash": true,
"payment_response_hash_key": "qvfVV7WEJ3WKGtFFBZ8JC2OnAUMCm0hU5mdgwHf7COAOQgjB8C4VnIhcOY3WuzI7",
"redirect_to_merchant_with_http_post": false,
"merchant_details": {
"primary_contact_person": "John Test",
"primary_phone": "sunt laborum",
"primary_email": "JohnTest@test.com",
"secondary_contact_person": "John Test2",
"secondary_phone": "cillum do dolor id",
"secondary_email": "JohnTest2@test.com",
"website": "https://www.example.com",
"about_business": "Online Retail with a wide selection of organic products for North America",
"address": {
"city": "San Fransico",
"country": null,
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "john",
"last_name": "Doe"
}
},
"webhook_details": {
"webhook_version": "1.0.1",
"webhook_username": "ekart_retail",
"webhook_password": "password_ekart@123",
"webhook_url": "https://webhook.site",
"payment_created_enabled": true,
"payment_succeeded_enabled": true,
"payment_failed_enabled": true
},
"payout_routing_algorithm": null,
"sub_merchants_enabled": false,
"parent_merchant_id": null,
"publishable_key": "pk_dev_fc0b78b1951b4c0aba40c00e17958e97",
"metadata": {
"city": "NY",
"unit": "245",
"compatible_connector": null
},
"locker_id": "m0010",
"primary_business_details": [
{
"country": "US",
"business": "default"
}
],
"frm_routing_algorithm": null,
"organization_id": "org_TvuYRQgMu3e9Zlf9GD04",
"is_recon_enabled": false,
"default_profile": "pro_DaZ3vsoT8HQVXt1ZQYNI",
"recon_status": "not_requested",
"pm_collect_link_config": null,
"product_type": "orchestration"
}
```
2. Business Profile Retrieve
Request cURL :
```
curl --location 'http://localhost:8080/account/merchant_1742878207/business_profile/pro_7QLj5zlucM8yV5zHBl3s' \
--header 'api-key: test_admin' \
--header 'Cookie: PHPSESSID=0b47db9d7de94c37b6b272087a9f2fa7'
```
Response:
```
{
"merchant_id": "merchant_1742878207",
"profile_id": "pro_7QLj5zlucM8yV5zHBl3s",
"profile_name": "US_default",
"return_url": "https://google.com/success",
"enable_payment_response_hash": true,
"payment_response_hash_key": "ESrOI4G8uSF15Sr1nzuFqHirYaihkQwlKFUT7nSDiIWOO7PSvcf36g6xIXSZHsjb",
"redirect_to_merchant_with_http_post": false,
"webhook_details": {
"webhook_version": "1.0.1",
"webhook_username": "ekart_retail",
"webhook_password": "password_ekart@123",
"webhook_url": "https://webhook.site",
"payment_created_enabled": true,
"payment_succeeded_enabled": true,
"payment_failed_enabled": true
},
"metadata": null,
"routing_algorithm": null,
"intent_fulfillment_time": 900,
"frm_routing_algorithm": null,
"payout_routing_algorithm": null,
"applepay_verified_domains": null,
"session_expiry": 900,
"payment_link_config": null,
"authentication_connector_details": null,
"use_billing_as_payment_method_billing": true,
"extended_card_info_config": null,
"collect_shipping_details_from_wallet_connector": false,
"collect_billing_details_from_wallet_connector": false,
"always_collect_shipping_details_from_wallet_connector": false,
"always_collect_billing_details_from_wallet_connector": false,
"is_connector_agnostic_mit_enabled": false,
"payout_link_config": null,
"outgoing_webhook_custom_http_headers": null,
"tax_connector_id": null,
"is_tax_connector_enabled": false,
"is_network_tokenization_enabled": false,
"is_auto_retries_enabled": false,
"max_auto_retries_enabled": null,
"always_request_extended_authorization": null,
"is_click_to_pay_enabled": false,
"authentication_product_ids": null,
"card_testing_guard_config": {
"card_ip_blocking_status": "disabled",
"card_ip_blocking_threshold": 3,
"guest_user_card_blocking_status": "disabled",
"guest_user_card_blocking_threshold": 10,
"customer_id_blocking_status": "disabled",
"customer_id_blocking_threshold": 5,
"card_testing_guard_expiry": 3600
},
"is_clear_pan_retries_enabled": false,
"force_3ds_challenge": false,
"is_debit_routing_enabled": false,
"merchant_business_country": null
}
```
3. Business Profile Update
Request cURL :
```
curl --location 'http://localhost:8080/account/merchant_1742827344/business_profile/pro_DaZ3vsoT8HQVXt1ZQYNI' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--header 'Cookie: PHPSESSID=0b47db9d7de94c37b6b272087a9f2fa7' \
--data-raw '{
"profile_name": "Update",
"return_url": "https://google.com/success",
"enable_payment_response_hash": true,
"redirect_to_merchant_with_http_post": false,
"webhook_details": {
"webhook_version": "1.0.1",
"webhook_username": "ekart_retail",
"webhook_password": "password_ekart@123",
"webhook_url": "https://webhook.site",
"payment_created_enabled": true,
"payment_succeeded_enabled": true,
"payment_failed_enabled": true
},
"metadata": null,
"intent_fulfillment_time": 900,
"frm_routing_algorithm": null,
"payout_routing_algorithm": null,
"applepay_verified_domains": null,
"session_expiry": 900,
"payment_link_config": null,
"authentication_connector_details": null,
"use_billing_as_payment_method_billing": true,
"collect_shipping_details_from_wallet_connector": false,
"collect_billing_details_from_wallet_connector": false,
"is_connector_agnostic_mit_enabled": false,
"payout_link_config": null,
"outgoing_webhook_custom_http_headers": null,
"is_debit_routing_enabled": true,
"merchant_business_country": "US"
}'
```
Response :
```
{
"merchant_id": "merchant_1742827344",
"profile_id": "pro_DaZ3vsoT8HQVXt1ZQYNI",
"profile_name": "Update",
"return_url": "https://google.com/success",
"enable_payment_response_hash": true,
"payment_response_hash_key": "qvfVV7WEJ3WKGtFFBZ8JC2OnAUMCm0hU5mdgwHf7COAOQgjB8C4VnIhcOY3WuzI7",
"redirect_to_merchant_with_http_post": false,
"webhook_details": {
"webhook_version": "1.0.1",
"webhook_username": "ekart_retail",
"webhook_password": "password_ekart@123",
"webhook_url": "https://webhook.site",
"payment_created_enabled": true,
"payment_succeeded_enabled": true,
"payment_failed_enabled": true
},
"metadata": null,
"routing_algorithm": null,
"intent_fulfillment_time": 900,
"frm_routing_algorithm": null,
"payout_routing_algorithm": null,
"applepay_verified_domains": null,
"session_expiry": 900,
"payment_link_config": null,
"authentication_connector_details": null,
"use_billing_as_payment_method_billing": true,
"extended_card_info_config": null,
"collect_shipping_details_from_wallet_connector": false,
"collect_billing_details_from_wallet_connector": false,
"always_collect_shipping_details_from_wallet_connector": false,
"always_collect_billing_details_from_wallet_connector": false,
"is_connector_agnostic_mit_enabled": false,
"payout_link_config": null,
"outgoing_webhook_custom_http_headers": null,
"tax_connector_id": null,
"is_tax_connector_enabled": false,
"is_network_tokenization_enabled": false,
"is_auto_retries_enabled": false,
"max_auto_retries_enabled": null,
"always_request_extended_authorization": null,
"is_click_to_pay_enabled": false,
"authentication_product_ids": null,
"card_testing_guard_config": {
"card_ip_blocking_status": "disabled",
"card_ip_blocking_threshold": 3,
"guest_user_card_blocking_status": "disabled",
"guest_user_card_blocking_threshold": 10,
"customer_id_blocking_status": "disabled",
"customer_id_blocking_threshold": 5,
"card_testing_guard_expiry": 3600
},
"is_clear_pan_retries_enabled": false,
"force_3ds_challenge": false,
"is_debit_routing_enabled": true,
"merchant_business_country": "US"
}
```
4. Making a DB query and reconfirming
<img width="1529" alt="Screenshot 2025-03-26 at 6 09 29 PM" src="https://github.com/user-attachments/assets/ded58683-a045-49fb-b6ec-c9458d855963" />
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/admin.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/business_profile.rs`
- `crates/diesel_models/src/schema.rs`
- `crates/diesel_models/src/schema_v2.rs`
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/business_profile.rs`
**4. Core Business Logic**
- `crates/router/src/core/admin.rs`
**5. Type Definitions**
- `crates/router/src/types/api/admin.rs`
**6. Other**
- `api-reference-v2/openapi_spec.json`
- `api-reference/openapi_spec.json`
- `migrations/2025-03-10-103959_add_is_debit_routing_enabled_to_profile/down.sql`
- ... and 3 more files
**Code Patterns Applied:**
- Extend existing types with new fields (114 changes)
**Detailed Identifier Changes:**
Commit d2d68bd5:
Files to modify:
**crates/api_models/src/admin.rs**
Modify existing code
**crates/diesel_models/src/business_profile.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_domain_models/src/business_profile.rs**
Modify existing code
**crates/router/src/core/admin.rs**
Modify existing code
**crates/router/src/types/api/admin.rs**
Modify existing code
Commit 8e854657:
Files to modify:
**crates/api_models/src/admin.rs**
Modify existing code
**crates/diesel_models/src/business_profile.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_domain_models/src/business_profile.rs**
Modify existing code
**crates/router/src/core/admin.rs**
Modify existing code
**crates/router/src/types/api/admin.rs**
Modify existing code
|
{"pr_number": 7470, "pr_title": "feat(core): add profile level config for debit routing feature", "merged_at": "2025-03-26T14:19:46Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/admin.rs"], "database": ["crates/diesel_models/src/business_profile.rs", "crates/diesel_models/src/schema.rs", "crates/diesel_models/src/schema_v2.rs"], "domain": ["crates/hyperswitch_domain_models/src/business_profile.rs"], "core_business": ["crates/router/src/core/admin.rs"], "types": ["crates/router/src/types/api/admin.rs"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json", "migrations/2025-03-10-103959_add_is_debit_routing_enabled_to_profile/down.sql", "migrations/2025-03-10-103959_add_is_debit_routing_enabled_to_profile/up.sql", "migrations/2025-03-21-134323_add_merchant_business_country_in_business_profile/down.sql", "migrations/2025-03-21-134323_add_merchant_business_country_in_business_profile/up.sql"]}, "change_types": {"fields_added": 114, "imports_added": 1}, "has_identifier_data": true, "commits_matched": 2, "match_method": "pr_number"}
|
feat: Add attach_printable() for better error logging
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [✔️ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Just modified the error logging on change of password for getting better error details and description. This helps in knowing about error in more 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 changes.
Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->
I made changes to crates/router/src/core/user.rs
## Motivation and Context
Fixes #9641 [ENHANCE] Improve Error Reporting in change_password with Printable Context issue was there which was assigned to me.
## How did you test it?
Tried to run cargo build.
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/user.rs`
**Detailed Identifier Changes:**
Commit f9bd87dd:
Files to modify:
**crates/router/src/core/user.rs**
Modify existing code
|
{"pr_number": 9667, "pr_title": "feat: Add attach_printable() for better error logging", "merged_at": "2025-10-15T16:19:48Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"core_business": ["crates/router/src/core/user.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connector): Update mandate PMT configs for Mandate Supported Connectors
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [x] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] 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 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Tests**
- `config/deployments/integration_test.toml`
- `loadtest/config/development.toml`
**2. Configuration Files**
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- `config/development.toml`
|
{"pr_number": 6903, "pr_title": "fix(connector): Update mandate PMT configs for Mandate Supported Connectors", "merged_at": "2024-12-20T11:06:57Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"tests": ["config/deployments/integration_test.toml", "loadtest/config/development.toml"], "config": ["config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
feat(vsaas): enable platform merchant API Key authentication for org-level operations
## 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 -->
This PR enables **authenticated access for platform merchants** via their API key to perform the following operations:
#### Merchant Account Operations
- Create connected merchant accounts within the platform org
- List merchant accounts
- Retrieve a specific merchant account
- Update a merchant account
#### API Key Operations
- Create an API key for a standard merchant
- List API keys for a standard merchant
- Retrieve an API Key
- Update an API key
- Revoke an API key
#### Organization Operations
- Retrieve organization details
- Update organization details
#### Analytics (Organization level)
- Metrics
- Filters
> All of the above have strict org-matching checks to ensure platform merchants can only access resources within their organization.
Introduced and integrated new auth flows to enforce this behavior:
- `PlatformOrgAdminAuth` – For org-scoped APIs (e.g., merchant list, org update)
- `PlatformOrgAdminAuthWithMerchantIdFromRoute` – For APIs scoped by merchant path param
- Enhanced `JWTAuthOrganizationFromRoute` – Validates org_id in token matches path param
Each of these flows:
- Validates platform merchant identity and scope
- Ensures cross-org access is prevented
- Supports fallback to Admin API Key when `is_admin_auth_allowed` is set (and also fallback merchant API key, if configured)
#### MerchantAccountType:
- Added `MerchantAccountType` field in `MerchantAccountResponse`
### 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).
-->
Platform merchants are intended to manage and orchestrate multiple standard merchant accounts under a single organization. However, until now, they couldn't interact with many core APIs using their own API key — including merchant management, organization operations, API key handling, and analytics access.
## 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)?
-->
### Merchant Account APIs
#### 1. Create Merchant
Request:
```bash
curl --location 'http://localhost:8080/accounts' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_30M0S1Q1phnSUXWbRmvSScAdShlCwLrqDYby1jCuc2tHXsstIvPRo5qy7Q65RJJO' \
--data-raw '{
"merchant_id": "merchant_1748354786",
"locker_id": "m0010",
"merchant_name": "Platform API Merchant",
"merchant_details": {
"primary_contact_person": "John Test",
"primary_email": "JohnTest@test.com",
"primary_phone": "sunt laborum",
"secondary_contact_person": "John Test2",
"secondary_email": "JohnTest2@test.com",
"secondary_phone": "cillum do dolor id",
"website": "https://www.example.com",
"about_business": "Online Retail with a wide selection of organic products for North America",
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name":"john",
"last_name":"Doe"
}
},
"organization_id": "org_CfdN8ia42BzMUrjbYNiM",
"return_url": "https://google.com/success",
"webhook_details": {
"webhook_version": "1.0.1",
"webhook_username": "ekart_retail",
"webhook_password": "password_ekart@123",
"webhook_url":"https://webhook.site",
"payment_created_enabled": true,
"payment_succeeded_enabled": true,
"payment_failed_enabled": true
},
"sub_merchants_enabled": false,
"parent_merchant_id":"merchant_123",
"metadata": {
"city": "NY",
"unit": "245"
},
"primary_business_details": [
{
"country": "US",
"business": "default"
}
]
}'
```
Expected Response:
```json
{
"merchant_id": "merchant_1748339362",
"merchant_name": "Platform API Merchant",
"return_url": "https://google.com/success",
"enable_payment_response_hash": true,
"payment_response_hash_key": "ha1Rq2nQSzcCnEy3FBLKtnwPg8yc9RjMmyZboGNSEKJwKMM81K8CYXqJNWJKrp5E",
"redirect_to_merchant_with_http_post": false,
"merchant_details": {
"primary_contact_person": "John Test",
"primary_phone": "sunt laborum",
"primary_email": "JohnTest@test.com",
"secondary_contact_person": "John Test2",
"secondary_phone": "cillum do dolor id",
"secondary_email": "JohnTest2@test.com",
"website": "https://www.example.com",
"about_business": "Online Retail with a wide selection of organic products for North America",
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "john",
"last_name": "Doe"
}
},
"webhook_details": {
"webhook_version": "1.0.1",
"webhook_username": "ekart_retail",
"webhook_password": "password_ekart@123",
"webhook_url": "https://webhook.site",
"payment_created_enabled": true,
"payment_succeeded_enabled": true,
"payment_failed_enabled": true
},
"payout_routing_algorithm": null,
"sub_merchants_enabled": false,
"parent_merchant_id": null,
"publishable_key": "pk_dev_d8aba9f251c44ba8bda28d7b48103125",
"metadata": {
"city": "NY",
"unit": "245",
"compatible_connector": null
},
"locker_id": "m0010",
"primary_business_details": [
{
"country": "US",
"business": "default"
}
],
"frm_routing_algorithm": null,
"organization_id": "org_CfdN8ia42BzMUrjbYNiM",
"is_recon_enabled": false,
"default_profile": "pro_iM8KYK4hLNSanTF8CFPR",
"recon_status": "not_requested",
"pm_collect_link_config": null,
"product_type": "orchestration",
"merchant_account_type": "connected"
}
```
| Scenario | Auth Type | Expected Behavior |
|----------|-----------|-------------------|
| 1.1 | Platform API Key (same org) | Merchant created |
| 1.2 | Platform API Key (different org) | Unauthorized |
| 1.3 | Admin API Key | Merchant created |
| 1.4 | Fallback API Key (config) | Merchant created |
| 1.5 | Any other case | Unauthorized |
---
#### 2. List Merchants
Request:
```bash
curl --location 'http://localhost:8080/accounts/list?organization_id=org_CfdN8ia42BzMUrjbYNiM' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'X-Merchant-Id: merchant_1748247188' \
--header 'api-key: test_admin' \
--data ''
```
Expected Response:
```json
[
{
"merchant_id": "merchant_1748339023",
"merchant_name": "Hyperswitch",
"return_url": null,
"enable_payment_response_hash": true,
"payment_response_hash_key": "Y6pZAHKZCteIlcLlvPVKpj4auwVMOUyp4Gl5P3HSMCsE0W71XsqZNgjlfHInswrN",
"redirect_to_merchant_with_http_post": false,
"merchant_details": null,
"webhook_details": null,
"payout_routing_algorithm": null,
"sub_merchants_enabled": false,
"parent_merchant_id": null,
"publishable_key": "pk_dev_9a085084db3943589d04e596c790e2a2",
"metadata": null,
"locker_id": null,
"primary_business_details": [],
"frm_routing_algorithm": null,
"organization_id": "org_CfdN8ia42BzMUrjbYNiM",
"is_recon_enabled": false,
"default_profile": "pro_mky2SQ3h1hmmUDkVxlVU",
"recon_status": "not_requested",
"pm_collect_link_config": null,
"product_type": "orchestration",
"merchant_account_type": "platform"
},
{
"merchant_id": "merchant_1748339074",
"merchant_name": "Admin Merchant",
"return_url": "https://google.com/success",
"enable_payment_response_hash": true,
"payment_response_hash_key": "3LoplBmFLLUIysEIr8o4FRQF2lT2bfBpsmtNZNCat7A9SV8gEUGDTV2dznCrXNqJ",
"redirect_to_merchant_with_http_post": false,
"merchant_details": {
"primary_contact_person": "John Test",
"primary_phone": "sunt laborum",
"primary_email": "JohnTest@test.com",
"secondary_contact_person": "John Test2",
"secondary_phone": "cillum do dolor id",
"secondary_email": "JohnTest2@test.com",
"website": "https://www.example.com",
"about_business": "Online Retail with a wide selection of organic products for North America",
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "john",
"last_name": "Doe"
}
},
"webhook_details": {
"webhook_version": "1.0.1",
"webhook_username": "ekart_retail",
"webhook_password": "password_ekart@123",
"webhook_url": "https://webhook.site",
"payment_created_enabled": true,
"payment_succeeded_enabled": true,
"payment_failed_enabled": true
},
"payout_routing_algorithm": null,
"sub_merchants_enabled": false,
"parent_merchant_id": null,
"publishable_key": "pk_dev_844d5c1dbe96424784c30ef393e76619",
"metadata": {
"city": "NY",
"unit": "245",
"compatible_connector": null
},
"locker_id": "m0010",
"primary_business_details": [
{
"country": "US",
"business": "default"
}
],
"frm_routing_algorithm": null,
"organization_id": "org_CfdN8ia42BzMUrjbYNiM",
"is_recon_enabled": false,
"default_profile": "pro_mwDaCNBw8LirhyMZGf1B",
"recon_status": "not_requested",
"pm_collect_link_config": null,
"product_type": "orchestration",
"merchant_account_type": "connected"
}
]
```
| Scenario | Auth Type | Expected Behavior |
|----------|-----------|-------------------|
| 2.1 | Platform API Key + matching `org_id` in query | Merchant list returned |
| 2.2 | Platform API Key + mismatched `org_id` | Unauthorized |
| 2.3 | Admin API Key + any `org_id` | Merchant list returned |
| 2.4 | Fallback API Key (config) | Merchant list returned |
| 2.5 | JWT + matching `org_id` in query | Merchant list returned |
| 2.6 | JWT + mismatched `org_id` | InvalidJwtToken |
| 2.7 | Any other case | Unauthorized |
---
#### 3. Retrieve Merchant
Request:
```bash
curl --location 'http://localhost:8080/accounts/merchant_1748247055' \
--header 'Accept: application/json' \
--header 'api-key: test_admin'
```
Expected Response:
```json
{
"merchant_id": "merchant_1748247055",
"merchant_name": "Connected JWT",
"return_url": null,
"enable_payment_response_hash": true,
"payment_response_hash_key": "R214M17EUqiZyDbkP3Slv5sB8WVLUHONaYm3Ly6YOfPPYzdiqgvCi6LOMVzNmi6p",
"redirect_to_merchant_with_http_post": false,
"merchant_details": null,
"webhook_details": null,
"payout_routing_algorithm": null,
"sub_merchants_enabled": false,
"parent_merchant_id": null,
"publishable_key": "pk_dev_7c64347723494ab1ad56df8180385bdd",
"metadata": null,
"locker_id": null,
"primary_business_details": [],
"frm_routing_algorithm": null,
"organization_id": "org_l8ol6KqrQ5eaHBPwZ2V3",
"is_recon_enabled": false,
"default_profile": "pro_rOryKpNr5QUEynTrT0TD",
"recon_status": "not_requested",
"pm_collect_link_config": null,
"product_type": "orchestration",
"merchant_account_type": "connected"
}
```
| Scenario | Auth Type | Expected Behavior |
|----------|-----------|-------------------|
| 3.1 | Platform API Key + merchant from same org | Merchant retrieved |
| 3.2 | Platform API Key + merchant from different org | Unauthorized |
| 3.3 | Admin API Key | Merchant retrieved |
| 3.4 | Fallback API Key (config) | Merchant retrieved |
| 3.5 | JWT + `merchant_id` in org | Merchant retrieved |
| 3.6 | JWT + mismatched `merchant_id` or org | InvalidJwtToken |
| 3.7 | Any other case | Unauthorized |
---
#### 4. Update Merchant
Request:
```bash
curl --location 'http://localhost:8080/accounts/merchant_1748244954' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_cW7LmHwdGurYUqCHLMkUX8AfU9uYzKJc6sT0bsAB1wQJFe6lOP01lRO30Dj0WpcH' \
--data-raw '{
"merchant_id": "merchant_1744225676",
"locker_id": "m0010",
"merchant_name": "Platform Merchant",
"merchant_details": {
"primary_contact_person": "John Test",
"primary_email": "JohnTest@test.com",
"primary_phone": "sunt laborum",
"secondary_contact_person": "John Test2",
"secondary_email": "JohnTest2@test.com",
"secondary_phone": "cillum do dolor id",
"website": "https://www.example.com",
"about_business": "Online Retail with a wide selection of organic products for North America",
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name":"john",
"last_name":"Doe"
}
},
"return_url": "https://google.com/success",
"webhook_details": {
"webhook_version": "1.0.1",
"webhook_username": "ekart_retail",
"webhook_password": "password_ekart@123",
"webhook_url":"https://webhook.site",
"payment_created_enabled": true,
"payment_succeeded_enabled": true,
"payment_failed_enabled": true
},
"sub_merchants_enabled": false,
"parent_merchant_id":"merchant_123",
"metadata": {
"city": "NY",
"unit": "245"
},
"primary_business_details": [
{
"country": "US",
"business": "default"
}
]
}'
```
Expected Response:
```json
{
"merchant_id": "merchant_1748244954",
"merchant_name": "Platform Merchant",
"return_url": "https://google.com/success",
"enable_payment_response_hash": true,
"payment_response_hash_key": "1zbZFZFo6yrsd44wwMjzaFC3GlLCxAPWhPYlGcWu7GSzDblhl4g8tRl2EdDTRpke",
"redirect_to_merchant_with_http_post": false,
"merchant_details": {
"primary_contact_person": "John Test",
"primary_phone": "sunt laborum",
"primary_email": "JohnTest@test.com",
"secondary_contact_person": "John Test2",
"secondary_phone": "cillum do dolor id",
"secondary_email": "JohnTest2@test.com",
"website": "https://www.example.com",
"about_business": "Online Retail with a wide selection of organic products for North America",
"address": {
"city": "San Fransico",
"country": "US",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "California",
"first_name": "john",
"last_name": "Doe"
}
},
"webhook_details": {
"webhook_version": "1.0.1",
"webhook_username": "ekart_retail",
"webhook_password": "password_ekart@123",
"webhook_url": "https://webhook.site",
"payment_created_enabled": true,
"payment_succeeded_enabled": true,
"payment_failed_enabled": true
},
"payout_routing_algorithm": null,
"sub_merchants_enabled": false,
"parent_merchant_id": null,
"publishable_key": "pk_dev_9a9589f79f664920bb63c5ca1a5448cd",
"metadata": {
"city": "NY",
"unit": "245"
},
"locker_id": "m0010",
"primary_business_details": [
{
"country": "US",
"business": "default"
}
],
"frm_routing_algorithm": null,
"organization_id": "org_l8ol6KqrQ5eaHBPwZ2V3",
"is_recon_enabled": false,
"default_profile": null,
"recon_status": "not_requested",
"pm_collect_link_config": null,
"product_type": "orchestration"
}
```
| Scenario | Auth Type | Expected Behavior |
|----------|-----------|-------------------|
| 4.1 | Platform API Key + merchant from same org | Merchant updated |
| 4.2 | Platform API Key + merchant from different org | Unauthorized |
| 4.3 | Admin API Key | Merchant updated |
| 4.4 | Fallback API Key (config) | Merchant updated |
| 4.5 | JWT + `merchant_id` in org | Merchant updated |
| 4.6 | JWT + mismatched `merchant_id` or org | InvalidJwtToken |
| 4.7 | Any other case | Unauthorized |
---
### API Key APIs
#### 5. Create API Key
Request:
```bash
curl --location 'http://localhost:8080/api_keys/merchant_1748339362' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_30M0S1Q1phnSUXWbRmvSScAdShlCwLrqDYby1jCuc2tHXsstIvPRo5qy7Q65RJJO' \
--data '{
"name": "Nike API Key 2",
"description": null,
"expiration": "2038-01-19T03:14:08.000Z"
}'
```
Expected Response:
```json
{
"key_id": "dev_nNAgIKTXitQ6BcLVZae5",
"merchant_id": "merchant_1748339362",
"name": "Nike API Key 2",
"description": null,
"api_key": "dev_3CaIJZiLTY7lVafRs9atnxAPrHREm4yauTrvhQD8Y44KwwXCbu25fIm64QEGbCz2",
"created": "2025-05-27T09:49:50.936Z",
"expiration": "2038-01-19T03:14:08.000Z"
}
```
| Scenario | Auth Type | Expected Behavior |
|----------|-----------|-------------------|
| 5.1 | Platform API Key + merchant from same org | API Key created |
| 5.2 | Platform API Key + merchant from different org | Unauthorized |
| 5.3 | Admin API Key | API Key created |
| 5.4 | Fallback API Key (config) | API Key created |
| 5.5 | JWT + `merchant_id` in org | API Key created |
| 5.6 | JWT + merchant in different org | Forbidden / InvalidJwtToken |
| 5.7 | Any other case | Unauthorized |
---
#### 6. List API Keys
Request:
```bash
curl --location 'http://localhost:8080/api_keys/merchant_1748252478/list' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_1jmsnLQvYEan1qFCxMxNhMbT8xre9LvGJbiRzS90ZyBHO3d9smCbdNg0MjBWMroP'
```
Expected Response:
```json
[
{
"key_id": "dev_Upyxxd2nyxZ6ptIe70zE",
"merchant_id": "merchant_1748252478",
"name": "Nike API Key 2",
"description": null,
"prefix": "dev_nRxdo8Wu",
"created": "2025-05-26T10:58:25.475Z",
"expiration": "2038-01-19T03:14:08.000Z"
},
{
"key_id": "dev_PxEjbjfyf1qykaMd7s7l",
"merchant_id": "merchant_1748252478",
"name": "Nike API Key 2",
"description": null,
"prefix": "dev_f9MG2CJf",
"created": "2025-05-26T10:58:30.545Z",
"expiration": "2038-01-19T03:14:08.000Z"
}
]
```
| Scenario | Auth Type | Expected Behavior |
|----------|-----------|-------------------|
| 6.1 | Platform API Key + merchant from same org | API Keys listed |
| 6.2 | Platform API Key + merchant from different org | Unauthorized |
| 6.3 | Admin API Key | API Keys listed |
| 5.4 | Fallback API Key (config) | API Keys listed |
| 6.5 | JWT + matching merchant & permission | API Keys listed |
| 6.6 | JWT + merchant in different org | InvalidJwtToken or Forbidden |
| 6.7 | Any other case | Unauthorized |
---
#### 7. Retrieve API Key
Request:
```bash
curl --location 'http://localhost:8080/api_keys/merchant_1748339362/dev_uHMMaVMYseYOLfhZrNEL' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin'
```
Expected Response:
```json
{
"key_id": "dev_uHMMaVMYseYOLfhZrNEL",
"merchant_id": "merchant_1748339362",
"name": "Nike API Key 2",
"description": null,
"prefix": "dev_wKJ5D5LU",
"created": "2025-05-27T14:15:16.455Z",
"expiration": "2038-01-19T03:14:08.000Z"
}
```
| Scenario | Auth Type | Expected Behavior |
|----------|-----------|-------------------|
| 7.1 | Platform API Key + merchant from same org | API Key retrieved |
| 7.2 | Platform API Key + merchant from different org | Unauthorized |
| 7.3 | Admin API Key | API Key retrieved |
| 7.4 | Fallback API Key (config) | API Key retrieved |
| 7.5 | JWT + matching merchant & permission | API Key retrieved |
| 7.6 | JWT + merchant in different org | InvalidJwtToken or Forbidden |
| 7.7 | Any other case | Unauthorized |
---
#### 8. Update API Key
Request:
```bash
curl --location 'http://localhost:8080/api_keys/merchant_1748252478/dev_b7kajJZbITKra0FdwDne' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiY2Y1ZTMwYjMtOTZkMi00YWJkLWJlMzMtYjhmOGFlOWRiMmZkIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQ4MjUyNDc4Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0ODQyOTg2NSwib3JnX2lkIjoib3JnX2w4b2w2S3FyUTVlYUhCUHdaMlYzIiwicHJvZmlsZV9pZCI6InByb19yM0R3VlVHUnZaVExZWEx5eHZkZSIsInRlbmFudF9pZCI6InB1YmxpYyJ9.ElVIJMr7-FPkW3N3h_cVyrOxEh4q1_u94KHVdVnJQ9g' \
--data '{
"name": "Test API Key 3",
"description": "My very awesome API key",
"expiration": null
}'
```
Expected Response:
```json
{
"key_id": "dev_b7kajJZbITKra0FdwDne",
"merchant_id": "merchant_1748252478",
"name": "Test API Key 3",
"description": "My very awesome API key",
"prefix": "dev_5m97MTk0",
"created": "2025-05-26T10:59:56.935Z",
"expiration": "2038-01-19T03:14:08.000Z"
}
```
| Scenario | Auth Type | Expected Behavior |
|----------|-----------|-------------------|
| 8.1 | Platform API Key + merchant from same org | API Key updated |
| 8.2 | Platform API Key + merchant from different org | Unauthorized |
| 8.3 | Admin API Key | API Key updated |
| 8.4 | Fallback API Key (config) | API Key updated |
| 8.5 | JWT + matching merchant & permission | API Key updated |
| 8.6 | JWT + merchant in different org | InvalidJwtToken or Forbidden |
| 8.7 | Any other case | Unauthorized |
---
#### 9. Revoke API Key
Request:
```bash
curl --location --request DELETE 'http://localhost:8080/api_keys/merchant_1748252478/dev_b7kajJZbITKra0FdwDne' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiY2Y1ZTMwYjMtOTZkMi00YWJkLWJlMzMtYjhmOGFlOWRiMmZkIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQ4MjUyNDc4Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0ODQyOTg2NSwib3JnX2lkIjoib3JnX2w4b2w2S3FyUTVlYUhCUHdaMlYzIiwicHJvZmlsZV9pZCI6InByb19yM0R3VlVHUnZaVExZWEx5eHZkZSIsInRlbmFudF9pZCI6InB1YmxpYyJ9.ElVIJMr7-FPkW3N3h_cVyrOxEh4q1_u94KHVdVnJQ9g'
```
Expected Response:
```json
{
"merchant_id": "merchant_1748339362",
"key_id": "dev_uHMMaVMYseYOLfhZrNEL",
"revoked": true
}
```
| Scenario | Auth Type | Expected Behavior |
|----------|-----------|-------------------|
| 9.1 | Platform API Key + merchant from same org | API Key revoked |
| 9.2 | Platform API Key + merchant from different org | Unauthorized |
| 9.3 | Admin API Key | API Key revoked |
| 9.4 | Fallback API Key (config) | API Key revoked |
| 9.5 | JWT + matching merchant & permission | API Key revoked |
| 9.6 | JWT + merchant in different org | InvalidJwtToken or Forbidden |
| 9.7 | Any other case | Unauthorized |
---
### Organization APIs
#### 10. Retrieve Org
Request:
```bash
curl --location 'http://localhost:8080/organization/org_l8ol6KqrQ5eaHBPwZ2V3' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiY2Y1ZTMwYjMtOTZkMi00YWJkLWJlMzMtYjhmOGFlOWRiMmZkIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQ4MjUyNDI5Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0ODQyOTI2MCwib3JnX2lkIjoib3JnX2w4b2w2S3FyUTVlYUhCUHdaMlYzIiwicHJvZmlsZV9pZCI6InByb19GemFxMVVIdDh5RG5ZUVBOVzlhRSIsInRlbmFudF9pZCI6InB1YmxpYyJ9.TKS85mCJxR0jqMNsYZ7YL4FrwH8K2OOTPp6O_SHdq8w'
```
Expected Response:
```json
{
"organization_id": "org_l8ol6KqrQ5eaHBPwZ2V3",
"organization_name": "Platform Organization 3",
"organization_details": null,
"metadata": null,
"modified_at": "2025-05-26 10:48:43.380292",
"created_at": "2025-05-26 07:35:54.645102"
}
```
| Scenario | Auth Type | Expected Behavior |
|----------|-----------|-------------------|
| 10.1 | Platform API Key | Organization retrieved |
| 10.2 | Platform API Key + different org | Unauthorized |
| 10.3 | Admin API Key | Organization retrieved |
| 10.4 | Fallback API Key (config) | Organization retrieved |
| 10.5 | JWT + matching organization | Organization retrieved |
| 10.6 | JWT + different org | InvalidJwtToken or Forbidden |
| 10.7 | Any other case | Unauthorized |
---
#### 11. Update Org
Request:
```bash
curl --location --request PUT 'http://localhost:8080/organization/org_l8ol6KqrQ5eaHBPwZ2V3' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiY2Y1ZTMwYjMtOTZkMi00YWJkLWJlMzMtYjhmOGFlOWRiMmZkIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzQ4MjUyNDI5Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTc0ODQyOTI2MCwib3JnX2lkIjoib3JnX2w4b2w2S3FyUTVlYUhCUHdaMlYzIiwicHJvZmlsZV9pZCI6InByb19GemFxMVVIdDh5RG5ZUVBOVzlhRSIsInRlbmFudF9pZCI6InB1YmxpYyJ9.TKS85mCJxR0jqMNsYZ7YL4FrwH8K2OOTPp6O_SHdq8w' \
--data '{
"organization_name": "Platform Organization 3"
}'
```
Expected Response:
```json
{
"organization_id": "org_l8ol6KqrQ5eaHBPwZ2V3",
"organization_name": "Platform Organization 3",
"organization_details": null,
"metadata": null,
"modified_at": "2025-05-26 10:48:43.380292",
"created_at": "2025-05-26 07:35:54.645102"
}
```
| Scenario | Auth Type | Expected Behavior |
|----------|-----------|-------------------|
| 11.1 | Platform API Key | Organization updated |
| 11.2 | Platform API Key + different org | Unauthorized |
| 11.3 | Admin API Key | Organization updated |
| 11.4 | Fallback API Key (config) | Organization updated |
| 11.5 | JWT + matching organization | Organization updated |
| 11.6 | JWT + different org | InvalidJwtToken or Forbidden |
| 11.7 | Any other case | Unauthorized |
### Analytics APIs
#### 12. Payments Metrics
Request:
```bash
curl --location 'http://localhost:8080/analytics/v1/org/metrics/payments' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.9' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'Origin: http://localhost:9000' \
--header 'Referer: http://localhost:9000/' \
--header 'Sec-Fetch-Dest: empty' \
--header 'Sec-Fetch-Mode: cors' \
--header 'Sec-Fetch-Site: same-site' \
--header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36' \
--header 'sec-ch-ua: "Chromium";v="128", "Not;A=Brand";v="24", "Google Chrome";v="128"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--header 'api-key: dev_cW7LmHwdGurYUqCHLMkUX8AfU9uYzKJc6sT0bsAB1wQJFe6lOP01lRO30Dj0WpcH' \
--data '[
{
"timeRange": {
"startTime": "2025-03-01T18:30:00Z",
"endTime": "2025-05-31T09:22:00Z"
},
"filters": {
"currency": [
"USD"
]
},
"source": "BATCH",
"metrics": [
"payment_success_rate"
],
"timeSeries": {
"granularity": "G_ONEDAY"
},
"delta": true
}
]'
```
Expected Response:
```json
{
"queryData": [
{
"payment_success_rate": 100.0,
"payment_count": null,
"payment_success_count": null,
"payment_processed_amount": 0,
"payment_processed_amount_in_usd": null,
"payment_processed_count": null,
"payment_processed_amount_without_smart_retries": 0,
"payment_processed_amount_without_smart_retries_usd": null,
"payment_processed_count_without_smart_retries": null,
"avg_ticket_size": null,
"payment_error_message": null,
"retries_count": null,
"retries_amount_processed": 0,
"connector_success_rate": null,
"payments_success_rate_distribution": null,
"payments_success_rate_distribution_without_smart_retries": null,
"payments_success_rate_distribution_with_only_retries": null,
"payments_failure_rate_distribution": null,
"payments_failure_rate_distribution_without_smart_retries": null,
"payments_failure_rate_distribution_with_only_retries": null,
"failure_reason_count": 0,
"failure_reason_count_without_smart_retries": 0,
"currency": null,
"status": null,
"connector": null,
"authentication_type": null,
"payment_method": null,
"payment_method_type": null,
"client_source": null,
"client_version": null,
"profile_id": null,
"card_network": null,
"merchant_id": null,
"card_last_4": null,
"card_issuer": null,
"error_reason": null,
"time_range": {
"start_time": "2025-05-26T00:00:00.000Z",
"end_time": "2025-05-26T23:00:00.000Z"
},
"time_bucket": "2025-05-26 00:00:00"
}
],
"metaData": [
{
"total_payment_processed_amount": 0,
"total_payment_processed_amount_in_usd": null,
"total_payment_processed_amount_without_smart_retries": 0,
"total_payment_processed_amount_without_smart_retries_usd": null,
"total_payment_processed_count": 0,
"total_payment_processed_count_without_smart_retries": 0,
"total_failure_reasons_count": 0,
"total_failure_reasons_count_without_smart_retries": 0
}
]
}
```
| Scenario | Auth Type | Expected Behavior |
|----------|-----------|-------------------|
| 12.1 | Platform API Key | Access to analytics |
| 12.3 | Admin API Key | Unauthorized |
| 12.4 | Fallback API Key (config) | Unauthorized |
| 12.5 | JWT | Access to analytics |
| 12.7 | Any other case | Unauthorized |
---
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/admin.rs`
**2. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/merchant_account.rs`
**3. Type Definitions**
- `crates/router/src/types/api/admin.rs`
**4. Other**
- `api-reference/openapi_spec.json`
- `crates/common_enums/src/enums/accounts.rs`
- `crates/openapi/src/openapi.rs`
- ... and 4 more files
**Code Patterns Applied:**
- Define new data structures (2 changes)
- Implement new functions (6 changes)
- Extend existing types with new fields (86 changes)
- Add conditional logic for feature flags or filtering (18 changes)
**Detailed Identifier Changes:**
Commit 7a446262:
Files to modify:
**crates/api_models/src/admin.rs**
Modify existing code
**crates/common_enums/src/enums/accounts.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/merchant_account.rs**
Add:
- function: pub::is_platform_account
**crates/openapi/src/openapi.rs**
Modify existing code
**crates/router/src/analytics.rs**
Modify existing code
**crates/router/src/routes/admin.rs**
Modify existing code
**crates/router/src/routes/api_keys.rs**
Modify existing code
**crates/router/src/services/authentication.rs**
Add:
- function: private::authenticate_and_fetch
- function: private::authenticate_and_fetch
- function: private::fetch_key_store_and_account
- function: private::authenticate_and_fetch
- function: private::authenticate_and_fetch
- struct: pub::PlatformOrgAdminAuth
- struct: pub::PlatformOrgAdminAuthWithMerchantIdFromRoute
- impl: impl AuthenticateAndFetch<Option<AuthenticationDataWithOrg>, A> for PlatformOrgAdminAuth
- impl: impl AuthenticateAndFetch<AuthenticationData, A> for PlatformOrgAdminAuth
- impl: impl PlatformOrgAdminAuthWithMerchantIdFromRoute
- impl: impl AuthenticateAndFetch<AuthenticationData, A> for PlatformOrgAdminAuthWithMerchantIdFromRoute
- impl: impl AuthenticateAndFetch<Option<AuthenticationDataWithOrg>, A> for JWTAuthOrganizationFromRoute
**crates/router/src/types/api/admin.rs**
Modify existing code
|
{"pr_number": 8156, "pr_title": "feat(vsaas): enable platform merchant API Key authentication for org-level operations", "merged_at": "2025-05-30T14:04:26Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "user"]}, "hierarchy": {"api_models": ["crates/api_models/src/admin.rs"], "domain": ["crates/hyperswitch_domain_models/src/merchant_account.rs"], "types": ["crates/router/src/types/api/admin.rs"], "other": ["api-reference/openapi_spec.json", "crates/common_enums/src/enums/accounts.rs", "crates/openapi/src/openapi.rs", "crates/router/src/analytics.rs", "crates/router/src/routes/admin.rs", "crates/router/src/routes/api_keys.rs", "crates/router/src/services/authentication.rs"]}, "change_types": {"structs_added": 2, "functions_added": 6, "fields_added": 86, "conditionals_added": 18}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
ci(CI-pr): disable `cargo-hack` step for hotfix PRs
## 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 disables the `cargo-hack` step for PRs opened against hotfix branches, and in such cases `cargo check --features release` would be run instead. This is done to (hopefully) reduce the time required to get the hotfixes merged, and thus, deployed to our hosted environments.
Additionally, I've completely disabled the MSRV check for hotfix PRs, since the workflow only runs a `cargo-hack` step. And I didn't modify the v2 check, since it only runs `just clippy_v2` and a command like `cargo check --features release,v2`.
## 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 would hopefully reduce the time required to get the hotfixes merged, and thus, deployed to our hosted environments.
## 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 --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **connector_integration** feature, you'll need to modify these architectural layers:
**1. Configuration Files**
- `.github/workflows/CI-pr.yml`
**Code Patterns Applied:**
- Extend existing types with new fields (6 changes)
|
{"pr_number": 7334, "pr_title": "ci(CI-pr): disable `cargo-hack` step for hotfix PRs", "merged_at": "2025-02-24T20:56:28Z", "intent": {"feature_type": "connector_integration", "action": "add_feature", "entities": []}, "hierarchy": {"config": [".github/workflows/CI-pr.yml"]}, "change_types": {"fields_added": 6}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
ci(cypress): fix nmi and paypal
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [x] CI/CD
## Description
<!-- Describe your changes in detail -->
This PR fixes NTID for PayPal by disabling it from running.
closes #7172
### 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)?
-->
|NMI|PayPal|
|-|-|
|||
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `npm run format`
- [x] I addressed lints thrown by `npm run lint`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Tests**
- `.github/workflows/cypress-tests-runner.yml`
- `cypress-tests/cypress/e2e/configs/Payment/Utils.js`
- `cypress-tests/cypress/e2e/spec/Payment/00020-MandatesUsingNTIDProxy.cy.js`
- ... and 2 more files
**Code Patterns Applied:**
- Extend existing types with new fields (6 changes)
- Add conditional logic for feature flags or filtering (4 changes)
|
{"pr_number": 7173, "pr_title": "ci(cypress): fix nmi and paypal", "merged_at": "2025-02-06T10:39:20Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"tests": [".github/workflows/cypress-tests-runner.yml", "cypress-tests/cypress/e2e/configs/Payment/Utils.js", "cypress-tests/cypress/e2e/spec/Payment/00020-MandatesUsingNTIDProxy.cy.js", "cypress-tests/cypress/e2e/spec/Payment/00022-Variations.cy.js", "cypress-tests/cypress/e2e/spec/Payment/00024-ConnectorAgnosticNTID.cy.js"]}, "change_types": {"fields_added": 6, "conditionals_added": 4}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
fix(connector): Ideal and multiple other failing PMs fixed in Ayden
## 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 -->
`Trustly` and `Ideal` Bank Redirect payments were failing for `Ayden`.
`Trustly` error message: `Required object 'paymentMethod' is not provided.`
`Ideal` error message: `Could not find issuer for issuerId`
For `Trustly`, populated the `paymentMethod` to fix the issue.
`Ideal` is moving to a more centralized infrastructure to process payments, which does not need issuer. So removed issuer field from connector request body.
Reference: https://docs.adyen.com/payment-methods/ideal/api-only/
Multiple PMTs were failing due to this error `Required object 'paymentMethod' is not provided.` fixed.
Also, cypress test for `Giropay` and `Sofort` is removed for connector `Adyen`. These payment methods have been deprecated and removed in this PR: https://github.com/juspay/hyperswitch/pull/7100
### 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).
-->
https://github.com/juspay/hyperswitch-cloud/issues/8251
## 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)?
-->
No-3DS auto capture
<img width="1720" alt="Screenshot 2025-02-10 at 5 25 26 PM" src="https://github.com/user-attachments/assets/0ca86a25-1c0c-41cf-9348-9676b1254cf7" />
3DS auto capture
<img width="1715" alt="Screenshot 2025-02-10 at 5 25 46 PM" src="https://github.com/user-attachments/assets/fb4f99ae-2d89-4833-8e1c-f918c303020d" />
No-3DS manual capture
<img width="1724" alt="Screenshot 2025-02-10 at 5 26 06 PM" src="https://github.com/user-attachments/assets/407799ef-67de-4f26-b458-a5a4329303f4" />
3DS manual capture
<img width="1727" alt="Screenshot 2025-02-10 at 5 26 54 PM" src="https://github.com/user-attachments/assets/6dcf53b9-4c2e-45c9-a521-8985090032f8" />
Bank Redirect -- All test cases in bank redirect is passed, other than `ideal`. Ideal's cypress test failing as ideal itself is redirecting to some other origin.
<img width="1722" alt="Screenshot 2025-02-10 at 5 36 47 PM" src="https://github.com/user-attachments/assets/a823e7cb-744a-455f-b004-63b6834fb63c" />
<img width="1725" alt="Screenshot 2025-02-10 at 5 36 56 PM" src="https://github.com/user-attachments/assets/ab0369c1-d49c-4606-9830-63992c701040" />
1. Trustly
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_6yAsmqONdJRee1Za1RsUCvaXlSG6kp8qU12QlluTaHycTOiojrk2b3huLTRPT2ds' \
--data-raw '{
"amount": 1000,
"currency": "EUR",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 1000,
"payment_method": "bank_redirect",
"payment_method_type": "trustly",
"payment_method_data": {
"bank_redirect": {
"trustly": {
"billing_details": {
"billing_name": "John Doe"
},
"bank_name": "ing",
"preferred_language": "en",
"country": "FI"
}
}
},
"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",
"billing": {
"address": {
"first_name": "John",
"last_name": "Doe",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "FI"
}
},
"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"
}
}
'
```
Response
```
{
"payment_id": "pay_VXuewdMlK3cNlnjOG6Ni",
"merchant_id": "merchant_1738137594",
"status": "requires_customer_action",
"amount": 1000,
"net_amount": 1000,
"shipping_cost": null,
"amount_capturable": 1000,
"amount_received": null,
"connector": "adyen",
"client_secret": "pay_VXuewdMlK3cNlnjOG6Ni_secret_iJqTyE7HzC1WPREUTMkm",
"created": "2025-01-29T11:00:14.555Z",
"currency": "EUR",
"customer_id": null,
"customer": null,
"description": null,
"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": "bank_redirect",
"payment_method_data": {
"bank_redirect": {
"type": "BankRedirectResponse",
"bank_name": 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": {
"type": "redirect_to_url",
"redirect_to_url": "http://localhost:8080/payments/redirect/pay_VXuewdMlK3cNlnjOG6Ni/merchant_1738137594/pay_VXuewdMlK3cNlnjOG6Ni_1"
},
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "trustly",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": null,
"connector_transaction_id": "VBLF93X8LV2D97V5",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "VBLF93X8LV2D97V5",
"payment_link": null,
"profile_id": "pro_LqHTmp6SEFvZsZEzNevb",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_iC4SXg873LfMdmklc82l",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-01-29T11:15:14.555Z",
"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": "2025-01-29T11:00:15.006Z",
"split_payments": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
2. Ideal
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_6yAsmqONdJRee1Za1RsUCvaXlSG6kp8qU12QlluTaHycTOiojrk2b3huLTRPT2ds' \
--data-raw '{
"amount": 100,
"currency": "EUR",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 100,
"customer_id": "StripeCustomer",
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+1",
"description": "Its my first payment request",
"authentication_type": "three_ds",
"return_url": "https://duck.com",
"payment_method": "bank_redirect",
"payment_method_type": "ideal",
"payment_method_data": {
"bank_redirect": {
"ideal": {
"billing_details": {
"billing_name": "Example",
"email": "guest@example.com"
},
"bank_name": "ing"
}
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "NL",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "NL",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"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"
},
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"order_details": [
{
"product_name": "Apple iphone 15",
"quantity": 1,
"amount": 6540,
"account_name": "transaction_processing"
}
]
}'
```
Response
```
{
"payment_id": "pay_Bs4sZJUYU8Bn6dGeXclU",
"merchant_id": "merchant_1738137594",
"status": "requires_customer_action",
"amount": 100,
"net_amount": 100,
"shipping_cost": null,
"amount_capturable": 100,
"amount_received": null,
"connector": "adyen",
"client_secret": "pay_Bs4sZJUYU8Bn6dGeXclU_secret_AFpcBZamAqPIKy2HqZKP",
"created": "2025-01-29T10:56:33.114Z",
"currency": "EUR",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+1"
},
"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": "bank_redirect",
"payment_method_data": {
"bank_redirect": {
"type": "BankRedirectResponse",
"bank_name": "ing"
},
"billing": null
},
"payment_token": null,
"shipping": {
"address": {
"city": "San Fransico",
"country": "NL",
"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": "NL",
"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": [
{
"brand": null,
"amount": 6540,
"category": null,
"quantity": 1,
"tax_rate": null,
"product_id": null,
"product_name": "Apple iphone 15",
"product_type": null,
"sub_category": null,
"product_img_link": null,
"product_tax_code": null,
"total_tax_amount": null,
"requires_shipping": null
}
],
"email": "guest@example.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": {
"type": "redirect_to_url",
"redirect_to_url": "http://localhost:8080/payments/redirect/pay_Bs4sZJUYU8Bn6dGeXclU/merchant_1738137594/pay_Bs4sZJUYU8Bn6dGeXclU_1"
},
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "ideal",
"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": 1738148193,
"expires": 1738151793,
"secret": "epk_725ec96a42464776b2490a336cd39d60"
},
"manual_retry_allowed": null,
"connector_transaction_id": "CRFMZRL9WB7WCCV5",
"frm_message": null,
"metadata": {
"udf1": "value1",
"login_date": "2019-09-10T10:11:12Z",
"new_customer": "true"
},
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "CRFMZRL9WB7WCCV5",
"payment_link": null,
"profile_id": "pro_LqHTmp6SEFvZsZEzNevb",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_iC4SXg873LfMdmklc82l",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-01-29T11:11:33.114Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "125.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": "2025-01-29T10:56:33.760Z",
"split_payments": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/router/src/connector/adyen/transformers.rs`
**2. Tests**
- `cypress-tests/cypress/e2e/configs/Payment/Adyen.js`
- `cypress-tests/cypress/support/redirectionHandler.js`
**Code Patterns Applied:**
- Extend existing types with new fields (11 changes)
**Detailed Identifier Changes:**
Commit e704d175:
Files to modify:
**crates/router/src/connector/adyen/transformers.rs**
Remove:
- function: private::try_from
Add:
- enum: pub::PaymentMethod
|
{"pr_number": 7139, "pr_title": "fix(connector): Ideal and multiple other failing PMs fixed in Ayden", "merged_at": "2025-02-25T20:27:57Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/router/src/connector/adyen/transformers.rs"], "tests": ["cypress-tests/cypress/e2e/configs/Payment/Adyen.js", "cypress-tests/cypress/support/redirectionHandler.js"]}, "change_types": {"enums_added": 1, "fields_added": 11}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(router): Add revenue recovery retry algorithm type and data columns to business_profile table
## 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 adds support for configuring revenue recovery retry algorithms at the business level. When a new billing connector is created, the columns are updated with Monitoring as the default algorithm type and the current timestamp. It introduces two new columns in the `business_profile` table:
---
### `revenue_recovery_retry_algorithm_type` (enum)
Specifies the retry algorithm type to be used for revenue recovery. This value will be used to determine the retry strategy for a transaction and will be included in the tracking data for the process tracker.
Supported values:
- **`Cascading`** – Exponential retry strategy that increases the interval between retries after each attempt.
- **`Smart`** – Data-driven retry approach that adapts dynamically based on historical performance and success rates.
- **`Monitoring`** *(default)* – Passive mode with no active retries; used to observe behavior without influencing outcomes.
---
### `revenue_recovery_retry_algorithm_data` (JSON)
A `serde_json` column to store additional data for the configured algorithm.
In `Monitoring` mode, it includes:
```json
{
"timestamp": "2025-04-15T10:30:00Z"
}
```
### Additional Changes
- [ ] This PR modifies the API contract
- [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`
-->
## 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)?
-->
### Curl
```
curl --location 'http://localhost:8080/v2/profiles' \
--header 'x-merchant-id: cloth_seller_163hj0DHc6ZpApzDPxhk' \
--header 'Authorization: admin-api-key=test_admin' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data-raw '{
"profile_name": "business4",
"return_url": "https://google.com/success",
"enable_payment_response_hash": true,
"redirect_to_merchant_with_http_post": false,
"webhook_details": {
"webhook_version": "1.0.1",
"webhook_username": "ekart_retail",
"webhook_password": "password_ekart@123",
"webhook_url": "https://webhook.site",
"payment_created_enabled": true,
"payment_succeeded_enabled": true,
"payment_failed_enabled": true
},
"metadata": null,
"order_fulfillment_time": 900,
"order_fulfillment_time_origin": "create",
"applepay_verified_domains": null,
"session_expiry": 900,
"payment_link_config": null,
"authentication_connector_details": null,
"use_billing_as_payment_method_billing": true,
"collect_shipping_details_from_wallet_connector_if_required": false,
"collect_billing_details_from_wallet_connector_if_required": false,
"always_collect_shipping_details_from_wallet_connector": false,
"always_collect_billing_details_from_wallet_connector": false,
"is_connector_agnostic_mit_enabled": false,
"payout_link_config": null,
"outgoing_webhook_custom_http_headers": null
}'
```
revenue_recovery_retry_algorithm_type and revenue_recovery_retry_algorithm_data columns added in business_profile table.
<img width="1454" alt="Screenshot 2025-04-22 at 11 20 45 AM" src="https://github.com/user-attachments/assets/12d5fe3d-bbbf-4dbb-becc-7085646e6ef4" />
### Curl 2
When a new billing processor is created, the revenue_recovery_retry_algorithm_type and revenue_recovery_retry_algorithm_data columns in the business_profile table are updated to Monitoring and the current timestamp by default.
```
curl --location 'http://localhost:8080/v2/connector-accounts' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'x-merchant-id: cloth_seller_upLI6BmuDD2B9Vm3rqXO' \
--header 'x-profile-id: pro_0whZPSu2KxnSJRLvCg6F' \
--header 'Authorization: admin-api-key=test_admin' \
--header 'api-key: test_admin' \
--data '{
"connector_type": "billing_processor",
"connector_name": "recurly",
"connector_account_details": {
"auth_type": "HeaderKey",
"api_key": "{{connector_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"
},
"feature_metadata": {
"revenue_recovery":{
"max_retry_count": 16,
"billing_connector_retry_threshold":10,
"billing_account_reference":{
"mca_0nVCxY1ZpTSPmvcCNt1j": "recurly"
}
}
},
"frm_configs": null,
"connector_webhook_details": {
"merchant_secret": "3d8feef681477c19d1d58d0df134ea40490f39763e678e4d8e561e9a5ba3d264"
},
"profile_id": "pro_0whZPSu2KxnSJRLvCg6F"
}'
```
<img width="1478" alt="Screenshot 2025-04-22 at 4 06 47 PM" src="https://github.com/user-attachments/assets/20fc4148-f8d1-472d-9329-a829c17c3fc1" />
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/business_profile.rs`
- `crates/diesel_models/src/enums.rs`
- `crates/diesel_models/src/schema_v2.rs`
**2. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/business_profile.rs`
**3. Core Business Logic**
- `crates/router/src/core/admin.rs`
**4. Other**
- `crates/common_enums/src/enums.rs`
- `v2_migrations/2025-04-08-101702_add_recovery_algorithm_column_in_business_profile/down.sql`
- `v2_migrations/2025-04-08-101702_add_recovery_algorithm_column_in_business_profile/up.sql`
**Code Patterns Applied:**
- Define new data structures (1 changes)
- Implement new functions (1 changes)
- Extend existing types with new fields (94 changes)
- Add conditional logic for feature flags or filtering (1 changes)
**Detailed Identifier Changes:**
Commit c633b336:
Files to modify:
**crates/common_enums/src/enums.rs**
Add:
- enum: pub::RevenueRecoveryAlgorithmType
**crates/diesel_models/src/business_profile.rs**
Add:
- struct: pub::RevenueRecoveryAlgorithmData
**crates/diesel_models/src/enums.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/router/src/core/admin.rs**
Add:
- function: pub::update_revenue_recovery_algorithm_under_profile
|
{"pr_number": 7772, "pr_title": "feat(router): Add revenue recovery retry algorithm type and data columns to business_profile table", "merged_at": "2025-04-24T10:03:20Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "user"]}, "hierarchy": {"database": ["crates/diesel_models/src/business_profile.rs", "crates/diesel_models/src/enums.rs", "crates/diesel_models/src/schema_v2.rs"], "domain": ["crates/hyperswitch_domain_models/src/business_profile.rs"], "core_business": ["crates/router/src/core/admin.rs"], "other": ["crates/common_enums/src/enums.rs", "v2_migrations/2025-04-08-101702_add_recovery_algorithm_column_in_business_profile/down.sql", "v2_migrations/2025-04-08-101702_add_recovery_algorithm_column_in_business_profile/up.sql"]}, "change_types": {"structs_added": 1, "functions_added": 1, "enums_added": 1, "fields_added": 94, "imports_added": 1, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(payment_methods): add external vault connector service
## 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 -->
### Vault Flow for Hyperswitch:
- Vault Insert:
This flow insert data into the vault
Data can either be inserted to internal or external vault
The logic of which vault to insert is saved in business profile
Singleton data dump with its respective id generation (no bulk insert)
- Vault Retrieve:
This flow retrieves data from the vault
Data can either be retrieved from internal or external vault
The logic of which vault to retrieve from is saved in business profile
Retrieve data against a single unique id per request
- Vault Delete:
This flow delete data from the vault
Data can either be deleted from internal or external vault
The logic of which vault to delete from is saved in business profile
Delete data against one unique id per request
### Task Done:
- Introducing API flow traits to hyperswitch
- Adding business profile logic for vault selection
- Adding logic for insertion in vault, retrieval from vault and deletion from vault
- Propagate external’s vault error
### 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)?
-->
Testing to be done once VGS integration PR is merged
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/payment_method.rs`
- `crates/diesel_models/src/schema_v2.rs`
**2. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/business_profile.rs`
- `crates/hyperswitch_domain_models/src/errors/api_error_response.rs`
- `crates/hyperswitch_domain_models/src/lib.rs`
- ... and 10 more files
**3. Core Business Logic**
- `crates/router/src/core/errors/utils.rs`
- `crates/router/src/core/payment_methods.rs`
- `crates/router/src/core/payment_methods/transformers.rs`
- ... and 4 more files
**4. External Connector Integration**
- `crates/hyperswitch_connectors/src/default_implementations.rs`
- `crates/hyperswitch_connectors/src/default_implementations_v2.rs`
- `crates/hyperswitch_interfaces/src/connector_integration_v2.rs`
- ... and 2 more files
**5. Type Definitions**
- `crates/router/src/types.rs`
- `crates/router/src/types/api.rs`
- `crates/router/src/types/payment_methods.rs`
- ... and 1 more files
**6. Other**
- `crates/common_enums/src/enums.rs`
- `crates/hyperswitch_interfaces/src/api.rs`
- `crates/hyperswitch_interfaces/src/api/vault.rs`
- ... and 5 more files
**Code Patterns Applied:**
- Define new data structures (5 changes)
- Implement new functions (22 changes)
- Extend existing types with new fields (104 changes)
**Detailed Identifier Changes:**
Commit 1238ae77:
Files to modify:
**crates/common_enums/src/enums.rs**
Modify existing code
**crates/diesel_models/src/payment_method.rs**
Modify existing code
**crates/diesel_models/src/schema_v2.rs**
Modify existing code
**crates/hyperswitch_connectors/src/default_implementations.rs**
Modify existing code
**crates/hyperswitch_connectors/src/default_implementations_v2.rs**
Add:
- impl: impl ExternalVaultV2 for $connector
**crates/hyperswitch_domain_models/src/business_profile.rs**
Add:
- function: pub::is_external_vault_enabled
**crates/hyperswitch_domain_models/src/errors/api_error_response.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/lib.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payment_method_data.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payment_methods.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_data_v2.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_data_v2/flow_common_types.rs**
Add:
- struct: pub::VaultConnectorFlowData
**crates/hyperswitch_domain_models/src/router_flow_types.rs**
Add:
- mod: pub::vault
**crates/hyperswitch_domain_models/src/router_flow_types/vault.rs**
Add:
- struct: pub::ExternalVaultInsertFlow
- struct: pub::ExternalVaultRetrieveFlow
- struct: pub::ExternalVaultDeleteFlow
**crates/hyperswitch_domain_models/src/router_request_types.rs**
Add:
- struct: pub::VaultRequestData
**crates/hyperswitch_domain_models/src/router_response_types.rs**
Add:
- function: private::default
- enum: pub::VaultResponseData
- impl: impl Default for VaultResponseData
**crates/hyperswitch_domain_models/src/types.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/vault.rs**
Modify existing code
**crates/hyperswitch_interfaces/src/api.rs**
Add:
- mod: pub::vault
- mod: pub::vault_v2
**crates/hyperswitch_interfaces/src/api/vault.rs**
Add:
- trait: pub::ExternalVaultInsert
- trait: pub::ExternalVaultRetrieve
- trait: pub::ExternalVaultDelete
- trait: pub::ExternalVault
**crates/hyperswitch_interfaces/src/api/vault_v2.rs**
Add:
- trait: pub::ExternalVaultInsertV2
- trait: pub::ExternalVaultRetrieveV2
- trait: pub::ExternalVaultDeleteV2
- trait: pub::ExternalVaultV2
**crates/hyperswitch_interfaces/src/connector_integration_v2.rs**
Modify existing code
**crates/hyperswitch_interfaces/src/conversion_impls.rs**
Add:
- function: private::from_old_router_data
- function: private::to_old_router_data
- impl: impl RouterDataConversion<T, Req, Resp> for VaultConnectorFlowData
**crates/router/src/compatibility/stripe/errors.rs**
Modify existing code
**crates/router/src/core/errors/utils.rs**
Add:
- function: private::to_vault_failed_response
**crates/router/src/core/payment_methods.rs**
Add:
- function: pub::vault_payment_method_internal
- function: pub::vault_payment_method_external
- function: pub::get_vault_response_for_insert_payment_method_data
**crates/router/src/core/payment_methods/transformers.rs**
Modify existing code
**crates/router/src/core/payment_methods/vault.rs**
Add:
- function: pub::retrieve_payment_method_from_vault_internal
- function: pub::get_vault_response_for_retrieve_payment_method_data
- function: pub::retrieve_payment_method_from_vault
- function: pub::delete_payment_method_data_from_vault_internal
- function: pub::get_vault_response_for_delete_payment_method_data
- function: pub::delete_payment_method_data_from_vault
**crates/router/src/core/payments/flows.rs**
Add:
- impl: impl ExternalVault for connector::DummyConnector<T>
- impl: impl ExternalVaultInsert for connector::DummyConnector<T>
- impl: impl services::ConnectorIntegration<
ExternalVaultInsertFlow,
types::VaultRequestData,
types::VaultResponseData,
> for connector::DummyConnector<T>
- impl: impl ExternalVaultRetrieve for connector::DummyConnector<T>
- impl: impl services::ConnectorIntegration<
ExternalVaultRetrieveFlow,
types::VaultRequestData,
types::VaultResponseData,
> for connector::DummyConnector<T>
- impl: impl ExternalVaultDelete for connector::DummyConnector<T>
- impl: impl services::ConnectorIntegration<
ExternalVaultDeleteFlow,
types::VaultRequestData,
types::VaultResponseData,
> for connector::DummyConnector<T>
**crates/router/src/core/payments/operations/payment_response.rs**
Modify existing code
**crates/router/src/core/utils.rs**
Add:
- function: pub::construct_vault_router_data
**crates/router/src/routes/payment_methods.rs**
Modify existing code
**crates/router/src/services/api.rs**
Modify existing code
**crates/router/src/types.rs**
Modify existing code
**crates/router/src/types/api.rs**
Add:
- function: pub::get_external_vault_connector_by_name
**crates/router/src/types/payment_methods.rs**
Modify existing code
**crates/router/src/types/transformers.rs**
Modify existing code
|
{"pr_number": 7917, "pr_title": "feat(payment_methods): add external vault connector service", "merged_at": "2025-05-21T12:16:40Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"database": ["crates/diesel_models/src/payment_method.rs", "crates/diesel_models/src/schema_v2.rs"], "domain": ["crates/hyperswitch_domain_models/src/business_profile.rs", "crates/hyperswitch_domain_models/src/errors/api_error_response.rs", "crates/hyperswitch_domain_models/src/lib.rs", "crates/hyperswitch_domain_models/src/payment_method_data.rs", "crates/hyperswitch_domain_models/src/payment_methods.rs", "crates/hyperswitch_domain_models/src/router_data_v2.rs", "crates/hyperswitch_domain_models/src/router_data_v2/flow_common_types.rs", "crates/hyperswitch_domain_models/src/router_flow_types.rs", "crates/hyperswitch_domain_models/src/router_flow_types/vault.rs", "crates/hyperswitch_domain_models/src/router_request_types.rs", "crates/hyperswitch_domain_models/src/router_response_types.rs", "crates/hyperswitch_domain_models/src/types.rs", "crates/hyperswitch_domain_models/src/vault.rs"], "core_business": ["crates/router/src/core/errors/utils.rs", "crates/router/src/core/payment_methods.rs", "crates/router/src/core/payment_methods/transformers.rs", "crates/router/src/core/payment_methods/vault.rs", "crates/router/src/core/payments/flows.rs", "crates/router/src/core/payments/operations/payment_response.rs", "crates/router/src/core/utils.rs"], "connectors": ["crates/hyperswitch_connectors/src/default_implementations.rs", "crates/hyperswitch_connectors/src/default_implementations_v2.rs", "crates/hyperswitch_interfaces/src/connector_integration_v2.rs", "v2_compatible_migrations/2025-05-07-084022_add-merhcant_connector_id-column-to-payment-methods/down.sql", "v2_compatible_migrations/2025-05-07-084022_add-merhcant_connector_id-column-to-payment-methods/up.sql"], "types": ["crates/router/src/types.rs", "crates/router/src/types/api.rs", "crates/router/src/types/payment_methods.rs", "crates/router/src/types/transformers.rs"], "other": ["crates/common_enums/src/enums.rs", "crates/hyperswitch_interfaces/src/api.rs", "crates/hyperswitch_interfaces/src/api/vault.rs", "crates/hyperswitch_interfaces/src/api/vault_v2.rs", "crates/hyperswitch_interfaces/src/conversion_impls.rs", "crates/router/src/compatibility/stripe/errors.rs", "crates/router/src/routes/payment_methods.rs", "crates/router/src/services/api.rs"]}, "change_types": {"structs_added": 5, "functions_added": 22, "enums_added": 1, "fields_added": 104, "imports_added": 12}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(router): disable partial auth feature for relay
## 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 -->
disable partial auth feature for relay
### 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Tests**
- `config/deployments/integration_test.toml`
**2. Configuration Files**
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
**3. Other**
- `crates/router/src/routes/relay.rs`
**Detailed Identifier Changes:**
Commit 931c3220:
Files to modify:
**crates/router/src/routes/relay.rs**
Modify existing code
|
{"pr_number": 6928, "pr_title": "fix(router): disable partial auth feature for relay", "merged_at": "2024-12-24T08:40:13Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"tests": ["config/deployments/integration_test.toml"], "config": ["config/deployments/production.toml", "config/deployments/sandbox.toml"], "other": ["crates/router/src/routes/relay.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(router): add accept-language from request headers into browser-info
## 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 -->
- add accept-language from request headers into browser-info
- propagate the value to netcetera
### 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 Manually
Perform a sanity external authentication payment through Netcetera
CURL
```
curl --location '{{baseURL}}/payments/{{PAYMENT_ID}}/3ds/authentication' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: {{API_KEY}}' \
--data '{
"client_secret": "pay_ushmApvG7K7IGxZ0qCmy_secret_8xIk7n11c5p5JSQSG0Vp",
"device_channel": "BRW",
"threeds_method_comp_ind": "Y"
}'
```
Raw connector Request
<img width="1728" alt="image" src="https://github.com/user-attachments/assets/42b5468e-f031-4186-a129-2bd34ae3c651" />
Browser Info in Database

## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/router_request_types.rs`
**2. External Connector Integration**
- `crates/router/src/connector/netcetera/netcetera_types.rs`
- `crates/router/src/connector/trustpay/transformers.rs`
- `crates/router/tests/connectors/trustpay.rs`
- ... and 1 more files
**3. Type Definitions**
- `crates/common_utils/src/types.rs`
**4. Utils**
- `crates/router/src/routes/payments/helpers.rs`
**5. Other**
- `api-reference-v2/openapi_spec.json`
- `crates/router/src/routes/payments.rs`
**Code Patterns Applied:**
- Implement new functions (2 changes)
- Extend existing types with new fields (9 changes)
- Add conditional logic for feature flags or filtering (3 changes)
**Detailed Identifier Changes:**
Commit 5381eb99:
Files to modify:
**crates/common_utils/src/types.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_request_types.rs**
Modify existing code
**crates/router/src/connector/netcetera/netcetera_types.rs**
Add:
- function: pub::get_list_of_accept_languages
**crates/router/src/connector/trustpay/transformers.rs**
Modify existing code
**crates/router/src/routes/payments.rs**
Modify existing code
**crates/router/src/routes/payments/helpers.rs**
Add:
- function: pub::populate_browser_info
**crates/router/tests/connectors/trustpay.rs**
Modify existing code
**crates/router/tests/connectors/utils.rs**
Modify existing code
|
{"pr_number": 7074, "pr_title": "feat(router): add accept-language from request headers into browser-info", "merged_at": "2025-01-29T08:33:30Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user", "connector"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/router_request_types.rs"], "connectors": ["crates/router/src/connector/netcetera/netcetera_types.rs", "crates/router/src/connector/trustpay/transformers.rs", "crates/router/tests/connectors/trustpay.rs", "crates/router/tests/connectors/utils.rs"], "types": ["crates/common_utils/src/types.rs"], "utils": ["crates/router/src/routes/payments/helpers.rs"], "other": ["api-reference-v2/openapi_spec.json", "crates/router/src/routes/payments.rs"]}, "change_types": {"functions_added": 2, "fields_added": 9, "conditionals_added": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): [Adyen] receive incoming webhooks for pix expiry
## Type of Change
- [x] New feature
## Description
This PR implements payment expiration handling for QR code-based payments through Adyen's OFFER_CLOSED webhook and fixes next_action display for terminal payment states.
### Changes:
1. Adyen `OFFER_CLOSED` webhook:
- Added `OfferClosed` to `WebhookEventCode` enum
- Handle `OfferClosed` events as `Expired` status in AttemptStatus
- Maps `OFFER_CLOSED` events to `PaymentIntentExpired` webhook
2. Added `Expired` status support:
- Added to both `AttemptStatus` and `IntentStatus` enums
- Database migration for new enum values
- Add `PaymentExpired` event type for outgoing webhooks
3. Fixed next_action for terminal payments
- Prevents showing QR codes/redirects data for terminal payments
## Motivation and Context
QR code payments (like PIX) have expiration times. When they expire, Adyen sends OFFER_CLOSED webhooks, but Hyperswitch wasn't handling these properly. Additionally, cancelled payments were still showing actionable `next_action` content.
## How did you test it?
<details>
<summary>1. Create a Pix Payment (with expiry)</summary>
cURL
curl --location --request POST 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_W8rGDzCct9xjU2Rqd8xxZubP9rRJ4u1Y42J1im7qplUxjOgWmJS4ZPq9lRfvOCnd' \
--data-raw '{"amount":4500,"currency":"BRL","confirm":true,"profile_id":"pro_HvmsPUKxoCtI58mtCUhg","capture_on":"2022-09-10T10:11:12Z","connector":["adyen"],"customer_id":"cus_HXi1vEcMXQ74qsaNq57p","email":"abc@example.com","return_url":"https://google.com","payment_method":"bank_transfer","payment_method_type":"pix","payment_method_data":{"bank_transfer":{"pix":{"pix_key":"test","cpf":"test","cnpj":"test","expiry_date":"2025-07-22T14:58:00Z"}}},"billing":{"address":{"line1":"1467","line2":"Harrison Street","line3":"Harrison Street","city":"San Fransico","state":"California","zip":"94122","country":"BR","first_name":"joseph","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":"guest@example.com"},"metadata":{"Force-PSP":"Adyen","udf1":"value1","new_customer":"true","login_date":"2019-09-10T10:11:12Z"},"browser_info":{"user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.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-US","color_depth":32,"screen_height":1117,"screen_width":1728,"time_zone":-330,"java_enabled":true,"java_script_enabled":true,"ip_address":"127.0.0.1"},"customer_acceptance":{"acceptance_type":"online","accepted_at":"1963-05-03T04:07:52.723Z","online":{"ip_address":"127.0.0.1","user_agent":"amet irure esse"}},"session_expiry":60}'
Response
{"payment_id":"pay_8P2b5MuSkplj8d3U06Nj","merchant_id":"merchant_1753193103","status":"requires_customer_action","amount":4500,"net_amount":4500,"shipping_cost":null,"amount_capturable":4500,"amount_received":null,"connector":"adyen","client_secret":"pay_8P2b5MuSkplj8d3U06Nj_secret_px8ZGtda34okt5ngtFdb","created":"2025-07-22T14:57:52.108Z","currency":"BRL","customer_id":"cus_HXi1vEcMXQ74qsaNq57p","customer":{"id":"cus_HXi1vEcMXQ74qsaNq57p","name":"John Nether","email":"abc@example.com","phone":"6168205362","phone_country_code":"+1"},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":null,"payment_method":"bank_transfer","payment_method_data":{"bank_transfer":{"pix":{"pix_key":"test","cpf":"test","cnpj":"test","source_bank_account_id":null,"destination_bank_account_id":null,"expiry_date":"2025-07-22T14:58:00.000Z"}},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"San Fransico","country":"BR","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":"guest@example.com"},"order_details":null,"email":"abc@example.com","name":"John Nether","phone":"6168205362","return_url":"https://google.com/","authentication_type":"no_three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":{"type":"qr_code_information","image_data_url":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQgAAAEICAAAAACGnTUjAAAGJElEQVR4Ae3gAZAkSZIkSRKLqpm7R0REZmZmVlVVVVV3d3d3d/fMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMdHd3d3dXV1VVVVVmZkZGRIS7m5kKz0xmV3d1d3dPz8zMzMxMYjVXAVSuAqByFQCVqwCoXAVA5SoAKlcBULkKgMpVAFSuAqByFQCVqwCoXAVA5SoAKlcBULkKgMpVAFSuAqByFQCVqwCoXAVA5SoAKlcBULkKgMpVAFSuAqByFQCVqwCoXAVA5SoAKlcBULkKgMq/QPzbmCvEFeY5iedkrhDPn7lC/NuYF4rKVQBUrgKgchUAlasAqFwFQOUqACpXAVB5EZkXjXhO5gpxhXnhzHMSz5950YgXCZWrAKhcBUDlKgAqVwFQuQqAylUAVK4CoPKvJJ4/88KZK8QV5grx/IkrzAsnnj/zr0LlKgAqVwFQuQqAylUAVK4CoHIVAJWrAKj8JxPPn7jCvHDiCvOfispVAFSuAqByFQCVqwCoXAVA5SoAKlcBUPkvZq4Qz5/4b0HlKgAqVwFQuQqAylUAVK4CoHIVAJWrAKj8K5l/H/GcxBXmCvOcxAtn/kNQuQqAylUAVK4CoHIVAJWrAKhcBUDlKgAqLyLx72OuEFeYK8RzEleYF078h6JyFQCVqwCoXAVA5SoAKlcBULkKgMpVAFT+Bea/hrjCvHDmPwWVqwCoXAVA5SoAKlcBULkKgMpVAFSuAqDyLxBXmOdPXGGuEM+fuMK8aMQV5grxojHPSVxhXigqVwFQuQqAylUAVK4CoHIVAJWrAKhcBYDMv494TuYK8fyZK8S/jnn+xBXmOYkrzIuEylUAVK4CoHIVAJWrAKhcBUDlKgAqVwFQ+VcSz5+5QlxhrhAvGvOcxBXmhTPPn/lXoXIVAJWrAKhcBUDlKgAqVwFQuQqAylUAVP4F4oUzV4grzPNnXjTiCvPCiSvMcxJXmH8VKlcBULkKgMpVAFSuAqByFQCVqwCoXAWAzAsnrjBXiBeNeU7iOZnnJJ4/c4V4/swV4oUzLxSVqwCoXAVA5SoAKlcBULkKgMpVAFSuAqDyIhJXmOdPXGGuEFeYF05cYZ6TuEJcYa4QV5grxHMy/yZUrgKgchUAlasAqFwFQOUqACpXAVC5CgCZfxtxhXlO4grznMQV5grxr2Oek3jhzL8KlasAqFwFQOUqACpXAVC5CoDKVQBUrgKg8m9krhDPyTwncYV5/swV4gpzhbjCvGjMFeIKcYV5kVC5CoDKVQBUrgKgchUAlasAqFwFQOUqAGReOPH8medPPCfznMQV5grxnMxzEv865grxnMwLReUqACpXAVC5CoDKVQBUrgKgchUAlasAkPnPJa4wL5x44czzJ64wz0k8J/NCUbkKgMpVAFSuAqByFQCVqwCoXAVA5SoAKv8C8W9j/nXMcxLPn7jCPH/iCvOvQuUqACpXAVC5CoDKVQBUrgKgchUAlasAqLyIzItGPCdzhbjCPCdxhblCXGGuEM/JvGjEczIvFJWrAKhcBUDlKgAqVwFQuQqAylUAVK4CoPKvJJ4/8/yJK8wV4jmZK8QLJ144cYV5TuJFQuUqACpXAVC5CoDKVQBUrgKgchUAlasAqPwnM1eI52SuEFeYfxvz/Il/FSpXAVC5CoDKVQBUrgKgchUAlasAqFwFQOW/iXhO4jmZ589cIZ6TuMI8J/MioXIVAJWrAKhcBUDlKgAqVwFQuQqAylUAVP6VzL+NeU7iCnOFuMI8f+YK8ZzEFeYK8W9C5SoAKlcBULkKgMpVAFSuAqByFQCVqwCovIjEv424wlwhrjBXiOdPXGGuEC8ac4W4QlxhXigqVwFQuQqAylUAVK4CoHIVAJWrAKhcBYDMVQCVqwCoXAVA5SoAKlcBULkKgMpVAFSuAqByFQCVqwCoXAVA5SoAKlcBULkKgMpVAFSuAqByFQCVqwCoXAVA5SoAKlcBULkKgMpVAFSuAqByFQCVqwCoXAVA5SoAKlcBULkKgMpVAFSuAuAfAfHRhAhvVmeEAAAAAElFTkSuQmCC","display_to_timestamp":1753196280000,"qr_code_url":"https://test.adyen.com/hpp/generateQRCodeImage.shtml?url=TestQRCodeEMVToken","display_text":null,"border_color":null},"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"pix","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":{"customer_id":"cus_HXi1vEcMXQ74qsaNq57p","created_at":1753196272,"expires":1753199872,"secret":"epk_7b539192a86b4d3baf83c0dcc93da9a6"},"manual_retry_allowed":null,"connector_transaction_id":"BGC4GRDTH5V3NDV5","frm_message":null,"metadata":{"udf1":"value1","Force-PSP":"Adyen","login_date":"2019-09-10T10:11:12Z","new_customer":"true"},"connector_metadata":null,"feature_metadata":null,"reference_id":"BGC4GRDTH5V3NDV5","payment_link":null,"profile_id":"pro_HvmsPUKxoCtI58mtCUhg","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_c5mj7ZUwHtsNKo5EfexQ","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-07-22T14:58:52.108Z","fingerprint":null,"browser_info":{"language":"en-US","time_zone":-330,"ip_address":"127.0.0.1","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","color_depth":32,"java_enabled":true,"screen_width":1728,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":1117,"java_script_enabled":true},"payment_method_id":null,"payment_method_status":null,"updated":"2025-07-22T14:57:53.084Z","split_payments":null,"frm_metadata":null,"extended_authorization_applied":null,"capture_before":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null,"card_discovery":null,"force_3ds_challenge":false,"force_3ds_challenge_trigger":false,"issuer_error_code":null,"issuer_error_message":null,"is_iframe_redirection_enabled":null,"whole_connector_response":null}
Wait for it to expire
Receive incoming webhooks for OFFER_CLOSED
</details>
<details>
<summary>2. Verify outgoing webhook</summary>
{"merchant_id":"merchant_1753397156","event_id":"evt_019841219a907f8084065fb9d9e2842e","event_type":"payment_expired","content":{"type":"payment_details","object":{"payment_id":"pay_GE6MyVzON0EXIcyOFh5p","merchant_id":"merchant_1753397156","status":"expired","amount":4500,"net_amount":4500,"shipping_cost":null,"amount_capturable":0,"amount_received":null,"connector":"adyen","client_secret":"pay_GE6MyVzON0EXIcyOFh5p_secret_44s26p5R8wAp9cXOQ3Qt","created":"2025-07-25T10:26:23.600Z","currency":"BRL","customer_id":"cus_J2NWO1RbnwNdiEO6KdIt","customer":{"id":"cus_J2NWO1RbnwNdiEO6KdIt","name":null,"email":"abc@example.com","phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":null,"payment_method":"bank_transfer","payment_method_data":{"bank_transfer":{"pix":{"pix_key":"test","cpf":"test","cnpj":"test","source_bank_account_id":null,"destination_bank_account_id":null,"expiry_date":"2025-07-25T10:28:00.000Z"}},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"San Fransico","country":"BR","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":"guest@example.com"},"order_details":null,"email":"abc@example.com","name":null,"phone":null,"return_url":"https://google.com/","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":"pix","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":"BXSX5X9VLW5PB2V5","frm_message":null,"metadata":{"udf1":"value1","Force-PSP":"Adyen","login_date":"2019-09-10T10:11:12Z","new_customer":"true"},"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_GE6MyVzON0EXIcyOFh5p_1","payment_link":null,"profile_id":"pro_zJpGj6xSodQqoBYltbzl","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_PTFqfuKnofhHIFDFLBsu","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-07-25T10:27:23.600Z","fingerprint":null,"browser_info":{"language":"en-US","time_zone":-330,"ip_address":"127.0.0.1","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","color_depth":32,"java_enabled":true,"screen_width":1728,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":1117,"java_script_enabled":true},"payment_method_id":"pm_uHViByM1aRfvzf4cCKYH","payment_method_status":"inactive","updated":"2025-07-25T10:29:38.062Z","split_payments":null,"frm_metadata":null,"extended_authorization_applied":null,"capture_before":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null,"card_discovery":null,"force_3ds_challenge":false,"force_3ds_challenge_trigger":false,"issuer_error_code":null,"issuer_error_message":null,"is_iframe_redirection_enabled":null,"whole_connector_response":null}},"timestamp":"2025-07-25T10:29:38.064Z"}
It should have
- event_type as payment_expired
- status as expired
- `next_action` should be null
</details>
<details>
<summary>3. Verify payments retrieve</summary>
cURL
curl --location --request GET 'http://localhost:8080/payments/pay_8P2b5MuSkplj8d3U06Nj?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_W8rGDzCct9xjU2Rqd8xxZubP9rRJ4u1Y42J1im7qplUxjOgWmJS4ZPq9lRfvOCnd'
Response
{"payment_id":"pay_cqxjoA0Drk0NBgmCpbQf","merchant_id":"merchant_1753397156","status":"expired","amount":4500,"net_amount":4500,"shipping_cost":null,"amount_capturable":0,"amount_received":null,"connector":"adyen","client_secret":"pay_cqxjoA0Drk0NBgmCpbQf_secret_S3VytS4Ym1KOhpKRQvtV","created":"2025-07-24T22:51:17.081Z","currency":"BRL","customer_id":"cus_J2NWO1RbnwNdiEO6KdIt","customer":{"id":"cus_J2NWO1RbnwNdiEO6KdIt","name":null,"email":"abc@example.com","phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":null,"payment_method":"bank_transfer","payment_method_data":{"bank_transfer":{"pix":{"pix_key":"test","cpf":"test","cnpj":"test","source_bank_account_id":null,"destination_bank_account_id":null,"expiry_date":"2025-07-24T22:54:00.000Z"}},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"San Fransico","country":"BR","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":"guest@example.com"},"order_details":null,"email":"abc@example.com","name":null,"phone":null,"return_url":"https://google.com/","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":"pix","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":"BD7QBLW3MDSQNS65","frm_message":null,"metadata":{"udf1":"value1","Force-PSP":"Adyen","login_date":"2019-09-10T10:11:12Z","new_customer":"true"},"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_cqxjoA0Drk0NBgmCpbQf_1","payment_link":null,"profile_id":"pro_zJpGj6xSodQqoBYltbzl","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_PTFqfuKnofhHIFDFLBsu","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-07-24T22:52:17.081Z","fingerprint":null,"browser_info":{"language":"en-US","time_zone":-330,"ip_address":"127.0.0.1","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","color_depth":32,"java_enabled":true,"screen_width":1728,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":1117,"java_script_enabled":true},"payment_method_id":"pm_EN1YZr7i5sD4qHXH2uV5","payment_method_status":"inactive","updated":"2025-07-24T22:55:13.196Z","split_payments":null,"frm_metadata":null,"extended_authorization_applied":null,"capture_before":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null,"card_discovery":null,"force_3ds_challenge":false,"force_3ds_challenge_trigger":false,"issuer_error_code":null,"issuer_error_message":null,"is_iframe_redirection_enabled":null,"whole_connector_response":null}
</details>
## Checklist
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
|
To implement this **payment** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/webhooks.rs`
**2. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/revenue_recovery.rs`
- `crates/hyperswitch_domain_models/src/router_data.rs`
**3. Core Business Logic**
- `crates/router/src/core/payments.rs`
- `crates/router/src/core/payments/helpers.rs`
- `crates/router/src/core/payments/operations/payment_attempt_record.rs`
- ... and 12 more files
**4. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs`
- `crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs`
- `crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs`
- ... and 3 more files
**5. Type Definitions**
- `crates/router/src/compatibility/stripe/payment_intents/types.rs`
- `crates/router/src/compatibility/stripe/setup_intents/types.rs`
- `crates/router/src/types.rs`
- ... and 1 more files
**6. Other**
- `api-reference/v1/openapi_spec_v1.json`
- `api-reference/v2/openapi_spec_v2.json`
- `crates/common_enums/src/enums.rs`
- ... and 4 more files
**Code Patterns Applied:**
- Extend existing types with new fields (26 changes)
- Add conditional logic for feature flags or filtering (4 changes)
- Modify database queries (1 changes)
**Detailed Identifier Changes:**
Commit 45875648:
Files to modify:
**crates/api_models/src/webhooks.rs**
Modify existing code
**crates/common_enums/src/enums.rs**
Modify existing code
**crates/common_enums/src/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/recurly/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/utils.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/revenue_recovery.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_data.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/compatibility/stripe/webhooks.rs**
Modify existing code
**crates/router/src/connector/utils.rs**
Modify existing code
**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/payment_attempt_record.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_capture_v2.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_confirm_intent.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_get.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_response.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_session_intent.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_update_intent.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/core/payments/retry.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
**crates/router/src/core/revenue_recovery/transformers.rs**
Modify existing code
**crates/router/src/core/routing/helpers.rs**
Modify existing code
**crates/router/src/types.rs**
Modify existing code
**crates/router/src/types/transformers.rs**
Modify existing code
|
{"pr_number": 8720, "pr_title": "feat(connector): [Adyen] receive incoming webhooks for pix expiry", "merged_at": "2025-07-29T08:47:11Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/webhooks.rs"], "domain": ["crates/hyperswitch_domain_models/src/revenue_recovery.rs", "crates/hyperswitch_domain_models/src/router_data.rs"], "core_business": ["crates/router/src/core/payments.rs", "crates/router/src/core/payments/helpers.rs", "crates/router/src/core/payments/operations/payment_attempt_record.rs", "crates/router/src/core/payments/operations/payment_capture_v2.rs", "crates/router/src/core/payments/operations/payment_confirm_intent.rs", "crates/router/src/core/payments/operations/payment_get.rs", "crates/router/src/core/payments/operations/payment_response.rs", "crates/router/src/core/payments/operations/payment_session_intent.rs", "crates/router/src/core/payments/operations/payment_update_intent.rs", "crates/router/src/core/payments/operations/proxy_payments_intent.rs", "crates/router/src/core/payments/payment_methods.rs", "crates/router/src/core/payments/retry.rs", "crates/router/src/core/payments/transformers.rs", "crates/router/src/core/revenue_recovery/transformers.rs", "crates/router/src/core/routing/helpers.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs", "crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs", "crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs", "crates/hyperswitch_connectors/src/connectors/recurly/transformers.rs", "crates/hyperswitch_connectors/src/utils.rs", "crates/router/src/connector/utils.rs"], "types": ["crates/router/src/compatibility/stripe/payment_intents/types.rs", "crates/router/src/compatibility/stripe/setup_intents/types.rs", "crates/router/src/types.rs", "crates/router/src/types/transformers.rs"], "other": ["api-reference/v1/openapi_spec_v1.json", "api-reference/v2/openapi_spec_v2.json", "crates/common_enums/src/enums.rs", "crates/common_enums/src/transformers.rs", "crates/router/src/compatibility/stripe/webhooks.rs", "migrations/2025-07-24-214849_add_expired_to_intent_and_attempt_status_and_event/down.sql", "migrations/2025-07-24-214849_add_expired_to_intent_and_attempt_status_and_event/up.sql"]}, "change_types": {"fields_added": 26, "conditionals_added": 4, "database_queries": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/router/src/connector/cybersource/transformers.rs`
**Detailed Identifier Changes:**
Commit 8d0639ea:
Files to modify:
**crates/router/src/connector/cybersource/transformers.rs**
Modify existing code
|
{"pr_number": 6634, "pr_title": "fix(connector): [Cybersource] change commerce indicator for applepay", "merged_at": "2024-11-22T11:45:06Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "card"]}, "hierarchy": {"connectors": ["crates/router/src/connector/cybersource/transformers.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(router): Add new api for delete tokenization record
## 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 -->
added new endpoint to delete tokenization record from tokenization table
### 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)?
-->
test case -
- create customer
- create new tokenization entry using generic tokenization api
```
curl --location 'http://localhost:8080/v2/tokenize' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'X-Profile-Id: pro_Hl15xaxv8ZrDw3OuOxmn' \
--header 'Authorization: api-key=api-key' \
--data '{
"customer_id": "12345_cus_0197f85ca4a97623a31912ddff91c96c",
"token_request":{
"card_number":"card_num",
"card_exp_month": "09",
"card_exp_year": "2025"
}
}'
```
- delete tokenization api -
req -
```
curl --location --request DELETE 'http://localhost:8080/v2/tokenize/<token_id>' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'X-Profile-Id: profile id' \
--header 'Authorization: api-key=api-key' \
--data '{
"customer_id": "<customer_id>",
"session_id": "<session_id>"
}'
```
response -
```
{
"id": "12345_tok_0197f85cd1dc77939238f464d2676e15"
}
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [ ] 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/events.rs`
- `crates/api_models/src/tokenization.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/query/tokenization.rs`
- `crates/diesel_models/src/tokenization.rs`
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/errors/api_error_response.rs`
- `crates/hyperswitch_domain_models/src/tokenization.rs`
**4. Core Business Logic**
- `crates/router/src/core/tokenization.rs`
**5. Type Definitions**
- `crates/router_env/src/logger/types.rs`
**6. Utils**
- `crates/router/src/routes/lock_utils.rs`
**7. Other**
- `api-reference/v2/openapi_spec_v2.json`
- `crates/openapi/src/openapi_v2.rs`
- `crates/openapi/src/routes/tokenization.rs`
- ... and 5 more files
**Code Patterns Applied:**
- Define new data structures (3 changes)
- Implement new functions (11 changes)
- Extend existing types with new fields (52 changes)
- Modify database queries (2 changes)
**Detailed Identifier Changes:**
Commit 0e957854:
Files to modify:
**crates/api_models/src/events.rs**
Add:
- impl: impl ApiEventMetric for tokenization::DeleteTokenDataResponse
- impl: impl ApiEventMetric for tokenization::DeleteTokenDataRequest
**crates/api_models/src/tokenization.rs**
Add:
- struct: pub::DeleteTokenDataRequest
- struct: pub::DeleteTokenDataResponse
**crates/diesel_models/src/query/tokenization.rs**
Add:
- function: pub::update_with_id
**crates/diesel_models/src/tokenization.rs**
Remove:
- struct: pub::TokenizationUpdate
Add:
- struct: pub::TokenizationUpdateInternal
**crates/hyperswitch_domain_models/src/errors/api_error_response.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/tokenization.rs**
Add:
- function: pub::is_disabled
- function: private::from
- enum: pub::TokenizationUpdate
- impl: impl Tokenization
- impl: impl From<TokenizationUpdate> for diesel_models::tokenization::TokenizationUpdateInternal
**crates/openapi/src/openapi_v2.rs**
Modify existing code
**crates/openapi/src/routes/tokenization.rs**
Add:
- function: pub::delete_tokenized_data_api
**crates/router/src/compatibility/stripe/errors.rs**
Modify existing code
**crates/router/src/core/tokenization.rs**
Add:
- function: pub::delete_tokenized_data_core
**crates/router/src/db/kafka_store.rs**
Add:
- function: private::update_tokenization_record
**crates/router/src/routes/app.rs**
Modify existing code
**crates/router/src/routes/lock_utils.rs**
Modify existing code
**crates/router/src/routes/tokenization.rs**
Add:
- function: pub::delete_tokenized_data_api
**crates/router_env/src/logger/types.rs**
Modify existing code
**crates/storage_impl/src/tokenization.rs**
Add:
- function: private::update_tokenization_record
- function: private::update_tokenization_record
- function: private::update_tokenization_record
|
{"pr_number": 8361, "pr_title": "feat(router): Add new api for delete tokenization record", "merged_at": "2025-08-11T10:44:32Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "session", "token"]}, "hierarchy": {"api_models": ["crates/api_models/src/events.rs", "crates/api_models/src/tokenization.rs"], "database": ["crates/diesel_models/src/query/tokenization.rs", "crates/diesel_models/src/tokenization.rs"], "domain": ["crates/hyperswitch_domain_models/src/errors/api_error_response.rs", "crates/hyperswitch_domain_models/src/tokenization.rs"], "core_business": ["crates/router/src/core/tokenization.rs"], "types": ["crates/router_env/src/logger/types.rs"], "utils": ["crates/router/src/routes/lock_utils.rs"], "other": ["api-reference/v2/openapi_spec_v2.json", "crates/openapi/src/openapi_v2.rs", "crates/openapi/src/routes/tokenization.rs", "crates/router/src/compatibility/stripe/errors.rs", "crates/router/src/db/kafka_store.rs", "crates/router/src/routes/app.rs", "crates/router/src/routes/tokenization.rs", "crates/storage_impl/src/tokenization.rs"]}, "change_types": {"structs_added": 3, "functions_added": 11, "enums_added": 1, "fields_added": 52, "imports_added": 5, "database_queries": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(cypress): uncaught exceptions thrown by `hyperswitch.io`
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [x] CI/CD
## Description
<!-- Describe your changes in detail -->
the return url i.e., `hyperswitch.io` is throwing uncaught exceptions. the issue has been escalated to the team managing the website. and for now, we're ignoring any uncaught exceptions thrown by it.
additionally, have bumped the package versions except for cypress since it is a major upgrade and breaks redirection tests left right and center.
this pr also removes redundant code from redirection handler
closes https://github.com/juspay/hyperswitch/issues/7093
### 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).
-->
ci
## 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)?
-->
ci checks should pass, but works in local:
payouts: wise

payments: adyen

payments: bankofamerica

payments: bluesnap

payments: cybersource

payments: nmi

payments: paypal

payments: stripe

payments: trustpay

payment method list

routing

## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `npm run format`
- [x] I addressed lints thrown by `npm run lint`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Tests**
- `cypress-tests/cypress/support/e2e.js`
- `cypress-tests/cypress/support/redirectionHandler.js`
- `cypress-tests/package-lock.json`
- ... and 1 more files
**Code Patterns Applied:**
- Extend existing types with new fields (2 changes)
- Add conditional logic for feature flags or filtering (1 changes)
|
{"pr_number": 7092, "pr_title": "fix(cypress): uncaught exceptions thrown by `hyperswitch.io`", "merged_at": "2025-01-24T07:22:53Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user"]}, "hierarchy": {"tests": ["cypress-tests/cypress/support/e2e.js", "cypress-tests/cypress/support/redirectionHandler.js", "cypress-tests/package-lock.json", "cypress-tests/package.json"]}, "change_types": {"fields_added": 2, "conditionals_added": 1}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
feat(analytics): add `smart_retries` only metrics for analytics v2 dashboard
## 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 -->
Added support for calculating new metrics based on smart retries for Analytics v2 dashboard.
The 2 metrics are:
- Payment Processed Amount and Count for smart retries
- Payments Success Rate and Failure Rate distribution for Smart Retries
`Payment Processed Amount and Count for Smart Retries` can be calculated with the existing metrics, with just a subtraction of `payment_processed_amount_without_smart_retries` from `payment_processed_amount`, hence doesn't require a separate metric.
In the `PaymentDistributionAccumulator`, I added another field variant with the signature
`<field_name>_with_only_smart_retries`.
Where `field_name` can be anything from `success_rate`, `failure_rate`.
### 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).
-->
Fixes #6574
## 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)?
-->
### Request
- Hit the curl:
```bash
curl --location 'http://localhost:8080/analytics/v1/org/metrics/payments' \
--header 'Accept: */*' \
--header 'Accept-Language: en-GB,en-US;q=0.9,en;q=0.8' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'Origin: http://localhost:9000' \
--header 'QueryType: SingleStat' \
--header 'Referer: http://localhost:9000/' \
--header 'Sec-Fetch-Dest: empty' \
--header 'Sec-Fetch-Mode: cors' \
--header 'Sec-Fetch-Site: same-site' \
--header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36' \
--header 'api-key: dev_r3kVZ4URj3fMiHhJJuhHOVqteaXwKyEMGCaFo6PiCS6S9vZsb0ErV4kCVqogM60H' \
--header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMDZlOGRmZWYtMzI0Zi00Yjc0LTg2MTItYzdkZjNhOGZmZTcyIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzI3NDM0NTkzIiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTczMTY1MTcyMCwib3JnX2lkIjoib3JnXzl3Y0kxQ2hTOGVEdnRRQmRXak9IIiwicHJvZmlsZV9pZCI6InByb19FNW5lek43YjZUbVB1WlUzbEU1VSJ9.gtctUL339INfdj6CVmZLW2NDMNcseMTCPX0uxSsOD1c' \
--header 'sec-ch-ua: "Chromium";v="130", "Google Chrome";v="130", "Not?A_Brand";v="99"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--data '[
{
"timeRange": {
"startTime": "2024-11-07T01:30:00Z",
"endTime": "2024-11-09T23:30:00Z"
},
"mode": "ORDER",
"source": "BATCH",
"metrics": [
"payments_distribution"
],
"delta": true
}
]'
```
### Response
```json
{
"queryData": [
{
"payment_success_rate": null,
"payment_count": null,
"payment_success_count": null,
"payment_processed_amount": 0,
"payment_processed_amount_usd": null,
"payment_processed_count": null,
"payment_processed_amount_without_smart_retries": 0,
"payment_processed_amount_without_smart_retries_usd": null,
"payment_processed_count_without_smart_retries": null,
"avg_ticket_size": null,
"payment_error_message": null,
"retries_count": null,
"retries_amount_processed": 0,
"connector_success_rate": null,
"payments_success_rate_distribution": 66.66666666666667,
"payments_success_rate_distribution_without_smart_retries": 57.142857142857146,
"payments_success_rate_distribution_with_only_retries": 100.0,
"payments_failure_rate_distribution": 33.333333333333336,
"payments_failure_rate_distribution_without_smart_retries": 42.857142857142854,
"payments_failure_rate_distribution_with_only_retries": 0.0,
"failure_reason_count": 0,
"failure_reason_count_without_smart_retries": 0,
"currency": null,
"status": null,
"connector": null,
"authentication_type": null,
"payment_method": null,
"payment_method_type": null,
"client_source": null,
"client_version": null,
"profile_id": null,
"card_network": null,
"merchant_id": null,
"card_last_4": null,
"card_issuer": null,
"error_reason": null,
"time_range": {
"start_time": "2024-11-07T01:30:00.000Z",
"end_time": "2024-11-09T23:30:00.000Z"
},
"time_bucket": "2024-11-07 01:30:00"
}
],
"metaData": [
{
"total_payment_processed_amount": 0,
"total_payment_processed_amount_usd": 0,
"total_payment_processed_amount_without_smart_retries": 0,
"total_payment_processed_amount_without_smart_retries_usd": 0,
"total_payment_processed_count": 0,
"total_payment_processed_count_without_smart_retries": 0,
"total_failure_reasons_count": 0,
"total_failure_reasons_count_without_smart_retries": 0
}
]
}
```
Fields that are required to be checked:
`queryData`:
```json
"payments_success_rate_distribution_with_only_retries": 100.0,
"payments_failure_rate_distribution_with_only_retries": 0.0,
```
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/analytics/payments.rs`
**2. Other**
- `crates/analytics/src/payments/accumulator.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (5 changes)
**Detailed Identifier Changes:**
Commit f3897dd6:
Files to modify:
**crates/analytics/src/payments/accumulator.rs**
Modify existing code
**crates/api_models/src/analytics/payments.rs**
Modify existing code
|
{"pr_number": 6575, "pr_title": "feat(analytics): add `smart_retries` only metrics for analytics v2 dashboard", "merged_at": "2024-11-19T19:21:45Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "user"]}, "hierarchy": {"api_models": ["crates/api_models/src/analytics/payments.rs"], "other": ["crates/analytics/src/payments/accumulator.rs"]}, "change_types": {"fields_added": 5}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
ci(workflows): Add code coverage reporting for v2
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [x] CI/CD
## Description
<!-- Describe your changes in detail -->
Added a CI pipeline that will run cypress tests and generate code coverage reports for v2
### 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).
-->
Closes #1593
Closes #1587
Closes #1622
Closes #1700
## 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)?
-->
Manually confirmed the pipeline works.
This PR contains only CI testing related changes. There is no need of adding test cases.
## 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 the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Tests**
- `.github/workflows/cypress-tests-runner.yml`
- `cypress-tests-v2/package-lock.json`
**2. Other**
- `.gitignore`
- `README.md`
- `docs/CONTRIBUTING.md`
- ... and 2 more files
**Code Patterns Applied:**
- Extend existing types with new fields (113 changes)
- Add conditional logic for feature flags or filtering (2 changes)
|
{"pr_number": 6884, "pr_title": "ci(workflows): Add code coverage reporting for v2", "merged_at": "2025-01-24T07:21:44Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"tests": [".github/workflows/cypress-tests-runner.yml", "cypress-tests-v2/package-lock.json"], "other": [".gitignore", "README.md", "docs/CONTRIBUTING.md", "justfile", "scripts/execute_cypress.sh"]}, "change_types": {"fields_added": 113, "conditionals_added": 2}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
chore: updated open api spec documentation for create platform account
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [x] Documentation
- [ ] CI/CD
## Description
- generated open api spec for create platform api
<img width="3182" height="2040" alt="image" src="https://github.com/user-attachments/assets/1373cff4-640d-4a4f-8b21-2fdb50a340e4" />
### 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?
- I run the `mint dev` command to check if the platform create api is reflecting in the api reference docs after these changes
- Refer the attached screenshot
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/user.rs`
**2. Other**
- `api-reference/README.md`
- `api-reference/docs.json`
- `api-reference/v1/openapi_spec_v1.json`
- ... and 4 more files
**Code Patterns Applied:**
- Implement new functions (1 changes)
**Detailed Identifier Changes:**
Commit 3bf4c490:
Files to modify:
**crates/api_models/src/user.rs**
Modify existing code
**crates/openapi/src/openapi.rs**
Modify existing code
**crates/openapi/src/routes.rs**
Add:
- mod: pub::platform
**crates/openapi/src/routes/platform.rs**
Add:
- function: pub::create_platform_account
|
{"pr_number": 8692, "pr_title": "chore: updated open api spec documentation for create platform account", "merged_at": "2025-07-28T09:50:55Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"api_models": ["crates/api_models/src/user.rs"], "other": ["api-reference/README.md", "api-reference/docs.json", "api-reference/v1/openapi_spec_v1.json", "api-reference/v1/platform/platform--create.mdx", "crates/openapi/src/openapi.rs", "crates/openapi/src/routes.rs", "crates/openapi/src/routes/platform.rs"]}, "change_types": {"functions_added": 1, "imports_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
chore(git): add code owner for payout modules
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
This PR assigns the code owner to relevant modules for `hyperswitch-payouts`.
## Motivation and Context
- Helps offload PR review tasks for payout related modules to the respective team.
## How did you test it?
Not needed
|
To implement this **unknown** feature, you'll need to modify these architectural layers:
**1. Other**
- `.github/CODEOWNERS`
|
{"pr_number": 9411, "pr_title": "chore(git): add code owner for payout modules", "merged_at": "2025-09-17T17:59:19Z", "intent": {"feature_type": "unknown", "action": "add_feature", "entities": []}, "hierarchy": {"other": [".github/CODEOWNERS"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
refactor(cypress-v2): change `Authorization` and `payment_methods_enabled` for v2 cypress tests
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [x] CI/CD
## Description
<!-- Describe your changes in detail -->
<details>
<summary>Changes</summary>
- Changed the Authorization in the `commands.js` because Authorization changes had been made recently.
- Changed field names in `payment_methods_enabled` accordingly as accepted by v2 endpoints.
</details>
### 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).
-->
The v2 Cypress Tests were failing due to the recent Authentication Changes in #7487.
## 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)?
-->
**_Before_**
<img width="715" alt="image" src="https://github.com/user-attachments/assets/70f6ccfe-8094-47f0-b70f-34cb66cccc86" />
**_After_**
<img width="714" alt="image" src="https://github.com/user-attachments/assets/3b1c6591-3667-468f-aa9d-01e8e01eb835" />
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Tests**
- `cypress-tests-v2/cypress/e2e/configs/Payment/Commons.js`
- `cypress-tests-v2/cypress/support/commands.js`
**Code Patterns Applied:**
- Extend existing types with new fields (38 changes)
|
{"pr_number": 7805, "pr_title": "refactor(cypress-v2): change `Authorization` and `payment_methods_enabled` for v2 cypress tests", "merged_at": "2025-04-17T13:17:01Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user"]}, "hierarchy": {"tests": ["cypress-tests-v2/cypress/e2e/configs/Payment/Commons.js", "cypress-tests-v2/cypress/support/commands.js"]}, "change_types": {"fields_added": 38}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
fix(connector): [AUTHORIZEDOTNET] Added Invoice Number Fix
## 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 -->
Added Invoice Number Fix
### 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).
-->
The maximum length of the `invoice_number` field accepted by connector is 20. Added fallback mechanism to fall back to get_random_string() function in case the length provided in the request is greater than 20.
## 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)?
-->
### Postman Tests
**Payment (merchant_order_reference_id<=20)**
-Request
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_YhiwP0poC2JOw2XJdxNXxodPNwpHUzVSH2dcTIJgRdUXNH9GEWVsvYA1AdBOwmRT' \
--data-raw '{
"amount": 6000,
"currency": "USD",
"amount_to_capture": 6000,
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"authentication_type": "no_three_ds",
"setup_future_usage": "on_session",
"customer": {
"id": "sweta11",
"name": "John Doe",
"email": "sweta11_on@gmail.com",
"phone": "9999999999",
"phone_country_code": "+1"
},
"phone_country_code": "+1",
"routing": {
"type": "single",
"data": "stripe"
},
"description": "Its my first payment request",
"return_url": "https://google.com",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "5424000000000015",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"card_cvc": "999"
}
},
"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"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "guest@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"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "guest@example.com"
},
"merchant_order_reference_id":"order_123",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"order_details": [
{
"product_name": "Apple iphone 15",
"quantity": 1,
"amount": 6540,
"account_name": "transaction_processing"
}
],
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"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": "128.0.0.1"
},
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "125.0.0.1",
"user_agent": "amet irure esse"
}
},
"connector_metadata": {
"noon": {
"order_category": "pay"
}
},
"payment_link": false,
"payment_link_config": {
"theme": "",
"logo": "",
"seller_name": "",
"sdk_layout": "",
"display_sdk_only": false,
"enabled_saved_payment_method": false
},
"payment_type": "normal",
"request_incremental_authorization": false,
"session_expiry": 900
}'
```
-Response
```
{
"payment_id": "pay_GJBjfcGqcmIeiPdXSVvi",
"merchant_id": "merchant_1752766460",
"status": "succeeded",
"amount": 6000,
"net_amount": 6000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 6000,
"connector": "authorizedotnet",
"client_secret": "pay_GJBjfcGqcmIeiPdXSVvi_secret_57nUD2fyZQVHekkSqFrt",
"created": "2025-07-17T18:08:45.893Z",
"currency": "USD",
"customer_id": "sweta11",
"customer": {
"id": "sweta11",
"name": "John Doe",
"email": "sweta11_on@gmail.com",
"phone": "9999999999",
"phone_country_code": "+1"
},
"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": "card",
"payment_method_data": {
"card": {
"last4": "0015",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "542400",
"card_extended_bin": null,
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"payment_checks": {
"description": "The street address and postal code matched.",
"avs_result_code": "Y"
},
"authentication_data": 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": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "guest@example.com"
},
"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": "guest@example.com"
},
"order_details": [
{
"brand": null,
"amount": 6540,
"category": null,
"quantity": 1,
"tax_rate": null,
"product_id": null,
"product_name": "Apple iphone 15",
"product_type": null,
"sub_category": null,
"product_img_link": null,
"product_tax_code": null,
"total_tax_amount": null,
"requires_shipping": null
}
],
"email": "sweta11_on@gmail.com",
"name": "John Doe",
"phone": "9999999999",
"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": "sweta11",
"created_at": 1752775725,
"expires": 1752779325,
"secret": "epk_946d394c9ca341188f90f5a7dae7a34c"
},
"manual_retry_allowed": false,
"connector_transaction_id": "80042666502",
"frm_message": null,
"metadata": {
"udf1": "value1",
"login_date": "2019-09-10T10:11:12Z",
"new_customer": "true"
},
"connector_metadata": {
"apple_pay": null,
"airwallex": null,
"noon": {
"order_category": "pay"
},
"braintree": null,
"adyen": null
},
"feature_metadata": null,
"reference_id": "80042666502",
"payment_link": null,
"profile_id": "pro_XotgmI7grHQUonGSoOzw",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_jsLDuC7mATxvPa1N4ni8",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-07-17T18:23:45.893Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "128.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": "2025-07-17T18:08:48.676Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": "order_123",
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": "manual",
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null
}
```
**Payment (merchant_order_reference_id>20)**
-Request
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_YhiwP0poC2JOw2XJdxNXxodPNwpHUzVSH2dcTIJgRdUXNH9GEWVsvYA1AdBOwmRT' \
--data-raw '{
"amount": 7000,
"currency": "USD",
"amount_to_capture": 7000,
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"authentication_type": "no_three_ds",
"setup_future_usage": "on_session",
"customer": {
"id": "sweta11",
"name": "John Doe",
"email": "sweta11_on@gmail.com",
"phone": "9999999999",
"phone_country_code": "+1"
},
"phone_country_code": "+1",
"routing": {
"type": "single",
"data": "stripe"
},
"description": "Its my first payment request",
"return_url": "https://google.com",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "5424000000000015",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"card_cvc": "999"
}
},
"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"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "guest@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"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "guest@example.com"
},
"merchant_order_reference_id":"order_123order_123order_123order_123order_123order_123",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"order_details": [
{
"product_name": "Apple iphone 15",
"quantity": 1,
"amount": 6540,
"account_name": "transaction_processing"
}
],
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"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": "128.0.0.1"
},
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "125.0.0.1",
"user_agent": "amet irure esse"
}
},
"connector_metadata": {
"noon": {
"order_category": "pay"
}
},
"payment_link": false,
"payment_link_config": {
"theme": "",
"logo": "",
"seller_name": "",
"sdk_layout": "",
"display_sdk_only": false,
"enabled_saved_payment_method": false
},
"payment_type": "normal",
"request_incremental_authorization": false,
"session_expiry": 900
}'
```
-Response
```
{
"payment_id": "pay_JeAeRjVcT56mrupdDafa",
"merchant_id": "merchant_1752766460",
"status": "succeeded",
"amount": 7000,
"net_amount": 7000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 7000,
"connector": "authorizedotnet",
"client_secret": "pay_JeAeRjVcT56mrupdDafa_secret_8TeukYpRz12B2aXIAjmK",
"created": "2025-07-17T18:10:56.337Z",
"currency": "USD",
"customer_id": "sweta11",
"customer": {
"id": "sweta11",
"name": "John Doe",
"email": "sweta11_on@gmail.com",
"phone": "9999999999",
"phone_country_code": "+1"
},
"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": "card",
"payment_method_data": {
"card": {
"last4": "0015",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "542400",
"card_extended_bin": null,
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"payment_checks": {
"description": "The street address and postal code matched.",
"avs_result_code": "Y"
},
"authentication_data": 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": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "guest@example.com"
},
"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": "guest@example.com"
},
"order_details": [
{
"brand": null,
"amount": 6540,
"category": null,
"quantity": 1,
"tax_rate": null,
"product_id": null,
"product_name": "Apple iphone 15",
"product_type": null,
"sub_category": null,
"product_img_link": null,
"product_tax_code": null,
"total_tax_amount": null,
"requires_shipping": null
}
],
"email": "sweta11_on@gmail.com",
"name": "John Doe",
"phone": "9999999999",
"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": "sweta11",
"created_at": 1752775856,
"expires": 1752779456,
"secret": "epk_57eb187e019442968c5413f4ead16eb1"
},
"manual_retry_allowed": false,
"connector_transaction_id": "80042666675",
"frm_message": null,
"metadata": {
"udf1": "value1",
"login_date": "2019-09-10T10:11:12Z",
"new_customer": "true"
},
"connector_metadata": {
"apple_pay": null,
"airwallex": null,
"noon": {
"order_category": "pay"
},
"braintree": null,
"adyen": null
},
"feature_metadata": null,
"reference_id": "80042666675",
"payment_link": null,
"profile_id": "pro_XotgmI7grHQUonGSoOzw",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_jsLDuC7mATxvPa1N4ni8",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-07-17T18:25:56.337Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "128.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": "2025-07-17T18:10:58.526Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": "order_123order_123order_123order_123order_123order_123",
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": "manual",
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (4 changes)
- Add conditional logic for feature flags or filtering (4 changes)
**Detailed Identifier Changes:**
Commit 00168496:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs**
Modify existing code
|
{"pr_number": 8685, "pr_title": "fix(connector): [AUTHORIZEDOTNET] Added Invoice Number Fix", "merged_at": "2025-07-18T07:47:38Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs"]}, "change_types": {"fields_added": 4, "conditionals_added": 4}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(router): Handle incoming webhooks adyen
## 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 acknowledgement in adyen for incoming webhooks by sending status 200.
### 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)?
-->
We need to create two profiles having same adyen account, both the profiles should return 200 to webhooks even if it doesnt belongs to them.
here i made two profiles:
```
pro_JcW9GqodbWptCntfDiiJ : mca_kAzlkhIkGnErSSc3L6Xr
pro_4vFskA1mTL8nf81s9Fzq : mca_4F3FOjPSWuvclkKoiG06
```
Making below payments API:
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_**' \
--data-raw '{
"amount": 700,
"currency": "USD",
"confirm": true,
"customer_id":"StripeCustomer",
"payment_link": false,
"capture_on": "2029-09-10T10:11:12Z",
"amount_to_capture": 700,
"name": "John Doe",
"email": "dg@example.com",
"phone": "999999999",
"phone_country_code": "+1",
"description": "Its my first payment request",
"authentication_type": "no_three_ds",
"return_url": "https://google.com",
"payment_method_data": {
"card": {
"card_number": "4111111111111111",
"card_exp_month": "03",
"card_exp_year": "30",
"card_cvc": "737"
},
"billing": {
"address": {
"line1": "1467",
"line2": "CA",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US"
}
}
},
"payment_method": "card",
"payment_method_type": "credit",
"profile_id": "pro_JcW9GqodbWptCntfDiiJ",
"browser_info": {
"color_depth": 24,
"java_enabled": true,
"java_script_enabled": true,
"language": "en-GB",
"screen_height": 720,
"screen_width": 1280,
"time_zone": -330,
"ip_address": "208.127.127.193",
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0"
},
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"order_details": [
{
"product_name": "Tea",
"quantity": 1,
"amount": 110,
"product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg"
},
{
"product_name": "Tea",
"quantity": 1,
"amount": 110,
"product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg"
},
{
"product_name": "Tea",
"quantity": 1,
"amount": 110,
"product_img_link": "https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg"
}
]
}'
```
Response:
```
{"payment_id":"pay_MGlcQq5UaVDvYSXAY6Xn","merchant_id":"merchant_1757925069","status":"succeeded","amount":700,"net_amount":700,"shipping_cost":null,"amount_capturable":0,"amount_received":700,"connector":"adyen","client_secret":"pay_MGlcQq5UaVDvYSXAY6Xn_secret_80ZstwkCzm9TyJVSzWLP","created":"2025-09-15T17:15:06.446Z","currency":"USD","customer_id":"StripeCustomer","customer":{"id":"StripeCustomer","name":"John Doe","email":"dg@example.com","phone":"999999999","phone_country_code":"+1"},"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":null,"payment_method":"card","payment_method_data":{"card":{"last4":"1111","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":{"address":{"city":"San Fransico","country":"US","line1":"1467","line2":"CA","line3":null,"zip":"94122","state":"California","first_name":null,"last_name":null,"origin_zip":null},"phone":null,"email":null}},"payment_token":null,"shipping":null,"billing":null,"order_details":[{"sku":null,"upc":null,"brand":null,"amount":110,"category":null,"quantity":1,"tax_rate":null,"product_id":null,"description":null,"product_name":"Tea","product_type":null,"sub_category":null,"total_amount":null,"commodity_code":null,"unit_of_measure":null,"product_img_link":"https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg","product_tax_code":null,"total_tax_amount":null,"requires_shipping":null,"unit_discount_amount":null},{"sku":null,"upc":null,"brand":null,"amount":110,"category":null,"quantity":1,"tax_rate":null,"product_id":null,"description":null,"product_name":"Tea","product_type":null,"sub_category":null,"total_amount":null,"commodity_code":null,"unit_of_measure":null,"product_img_link":"https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg","product_tax_code":null,"total_tax_amount":null,"requires_shipping":null,"unit_discount_amount":null},{"sku":null,"upc":null,"brand":null,"amount":110,"category":null,"quantity":1,"tax_rate":null,"product_id":null,"description":null,"product_name":"Tea","product_type":null,"sub_category":null,"total_amount":null,"commodity_code":null,"unit_of_measure":null,"product_img_link":"https://thumbs.dreamstime.com/b/indian-tea-spices-masala-chai-33827904.jpg","product_tax_code":null,"total_tax_amount":null,"requires_shipping":null,"unit_discount_amount":null}],"email":"dg@example.com","name":"John Doe","phone":"999999999","return_url":"https://google.com/","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":"StripeCustomer","created_at":1757956506,"expires":1757960106,"secret":"epk_"},"manual_retry_allowed":false,"connector_transaction_id":"MW2KB77642TBJWT5","frm_message":null,"metadata":{"udf1":"value1","login_date":"2019-09-10T10:11:12Z","new_customer":"true"},"connector_metadata":null,"feature_metadata":{"redirect_response":null,"search_tags":null,"apple_pay_recurring_details":null,"gateway_system":"direct"},"reference_id":"pay_MGlcQq5UaVDvYSXAY6Xn_1","payment_link":null,"profile_id":"pro_JcW9GqodbWptCntfDiiJ","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_kAzlkhIkGnErSSc3L6Xr","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-09-15T17:30:06.446Z","fingerprint":null,"browser_info":{"language":"en-GB","time_zone":-330,"ip_address":"208.127.127.193","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0","color_depth":24,"java_enabled":true,"screen_width":1280,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":720,"java_script_enabled":true},"payment_channel":null,"payment_method_id":null,"network_transaction_id":"596288259500941","payment_method_status":null,"updated":"2025-09-15T17:15:07.684Z","split_payments":null,"frm_metadata":null,"extended_authorization_applied":null,"capture_before":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null,"card_discovery":"manual","force_3ds_challenge":false,"force_3ds_challenge_trigger":false,"issuer_error_code":null,"issuer_error_message":null,"is_iframe_redirection_enabled":null,"whole_connector_response":null,"enable_partial_authorization":null,"enable_overcapture":null,"is_overcapture_enabled":null,"network_details":null}
```
Refund:
```
curl --location 'http://localhost:8080/refunds' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_OvYaTu43QFXUxM2Xs1KHS7YkWRkkh5nXp7x2BENotNMBzwCWVA0Yeug0f12ofDsB' \
--data '{
"payment_id": "pay_MGlcQq5UaVDvYSXAY6Xn",
"amount": 700,
"reason": "Customer returned product",
"refund_type": "instant",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}'
```
Response:
```
{"refund_id":"ref_aZfW2HjCEJKhRgsZguPr","payment_id":"pay_MGlcQq5UaVDvYSXAY6Xn","amount":700,"currency":"USD","status":"pending","reason":"Customer returned product","metadata":{"udf1":"value1","new_customer":"true","login_date":"2019-09-10T10:11:12Z"},"error_message":null,"error_code":null,"unified_code":null,"unified_message":null,"created_at":"2025-09-15T17:16:30.637Z","updated_at":"2025-09-15T17:16:31.861Z","connector":"adyen","profile_id":"pro_JcW9GqodbWptCntfDiiJ","merchant_connector_id":"mca_kAzlkhIkGnErSSc3L6Xr","split_refunds":null,"issuer_error_code":null,"issuer_error_message":null}
```
<img width="1888" height="127" alt="image" src="https://github.com/user-attachments/assets/562ef85f-f9c0-404e-b159-caa5ecfb06cb" />
<img width="1888" height="127" alt="image (1)" src="https://github.com/user-attachments/assets/de279cc0-5609-4e44-9396-98c3ab730b60" />
<img width="1888" height="127" alt="image (2)" src="https://github.com/user-attachments/assets/f3683d5e-c866-4fd7-9f9e-75c214f8267e" />
<img width="1888" height="127" alt="image" src="https://github.com/user-attachments/assets/c49f8495-f628-497e-baaa-e7c51957eb10" />
<img width="3456" height="2234" alt="image (6)" src="https://github.com/user-attachments/assets/5a0918e2-2cea-4bda-a135-63a637041079" />
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/common_enums/src/connector_enums.rs`
- `crates/hyperswitch_connectors/src/connectors/adyenplatform/transformers/payouts.rs`
**Detailed Identifier Changes:**
Commit 0e30fb6b:
Files to modify:
**crates/common_enums/src/connector_enums.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/adyenplatform/transformers/payouts.rs**
Modify existing code
|
{"pr_number": 9372, "pr_title": "feat(router): Handle incoming webhooks adyen", "merged_at": "2025-09-17T18:54:57Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/common_enums/src/connector_enums.rs", "crates/hyperswitch_connectors/src/connectors/adyenplatform/transformers/payouts.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): [AFFIRM] add Connector Template Code
## 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 -->
Affirm template code added
### 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)?
-->
This is a template PR, hence no testing required.
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/connector_endpoints.rs`
**2. External Connector Integration**
- `crates/connector_configs/toml/development.toml`
- `crates/connector_configs/toml/production.toml`
- `crates/connector_configs/toml/sandbox.toml`
- ... and 10 more files
**3. Tests**
- `config/deployments/integration_test.toml`
- `loadtest/config/development.toml`
**4. Configuration Files**
- `config/config.example.toml`
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- ... and 2 more files
**Code Patterns Applied:**
- Define new data structures (10 changes)
- Implement new functions (83 changes)
- Extend existing types with new fields (162 changes)
**Detailed Identifier Changes:**
Commit 9bc02516:
Files to modify:
**crates/hyperswitch_connectors/src/connectors.rs**
Add:
- mod: pub::affirm
**crates/hyperswitch_connectors/src/connectors/affirm.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::validate_mandate_payment
- function: private::validate_psync_reference_id
- 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
- function: private::get_connector_about
- function: private::get_supported_payment_methods
- function: private::get_supported_webhook_flows
- struct: pub::Affirm
- impl: impl Affirm
- impl: impl api::Payment for Affirm
- impl: impl api::PaymentSession for Affirm
- impl: impl api::ConnectorAccessToken for Affirm
- impl: impl api::MandateSetup for Affirm
- impl: impl api::PaymentAuthorize for Affirm
- impl: impl api::PaymentSync for Affirm
- impl: impl api::PaymentCapture for Affirm
- impl: impl api::PaymentVoid for Affirm
- impl: impl api::Refund for Affirm
- impl: impl api::RefundExecute for Affirm
- impl: impl api::RefundSync for Affirm
- impl: impl api::PaymentToken for Affirm
- impl: impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData> for Affirm
- impl: impl ConnectorCommonExt<Flow, Request, Response> for Affirm
- impl: impl ConnectorCommon for Affirm
- impl: impl ConnectorValidation for Affirm
- impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Affirm
- impl: impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for Affirm
- impl: impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Affirm
- impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Affirm
- impl: impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Affirm
- impl: impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for Affirm
- impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Affirm
- impl: impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Affirm
- impl: impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Affirm
- impl: impl webhooks::IncomingWebhook for Affirm
- impl: impl ConnectorSpecifications for Affirm
- mod: pub::transformers
**crates/hyperswitch_connectors/src/connectors/affirm/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::AffirmRouterData
- struct: pub::AffirmPaymentsRequest
- struct: pub::AffirmCard
- struct: pub::AffirmAuthType
- struct: pub::AffirmPaymentsResponse
- struct: pub::AffirmRefundRequest
- struct: pub::RefundResponse
- struct: pub::AffirmErrorResponse
- enum: pub::AffirmPaymentStatus
- enum: pub::RefundStatus
- impl: impl From<(StringMinorUnit, T)> for AffirmRouterData<T>
- impl: impl TryFrom<&AffirmRouterData<&PaymentsAuthorizeRouterData>> for AffirmPaymentsRequest
- impl: impl TryFrom<&ConnectorAuthType> for AffirmAuthType
- impl: impl From<AffirmPaymentStatus> for common_enums::AttemptStatus
- impl: impl TryFrom<ResponseRouterData<F, AffirmPaymentsResponse, T, PaymentsResponseData>> for RouterData<F, T, PaymentsResponseData>
- impl: impl TryFrom<&AffirmRouterData<&RefundsRouterData<F>>> for AffirmRefundRequest
- 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_domain_models/src/connector_endpoints.rs**
Modify existing code
**crates/router/src/connector.rs**
Modify existing code
**crates/router/tests/connectors/affirm.rs**
Add:
- 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::AffirmTest
- impl: impl ConnectorActions for AffirmTest
- impl: impl utils::Connector for AffirmTest
**crates/router/tests/connectors/main.rs**
Add:
- mod: private::affirm
**crates/test_utils/src/connector_auth.rs**
Modify existing code
|
{"pr_number": 8650, "pr_title": "feat(connector): [AFFIRM] add Connector Template Code", "merged_at": "2025-07-16T10:45:18Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/connector_endpoints.rs"], "connectors": ["crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml", "crates/hyperswitch_connectors/src/connectors.rs", "crates/hyperswitch_connectors/src/connectors/affirm.rs", "crates/hyperswitch_connectors/src/connectors/affirm/transformers.rs", "crates/hyperswitch_connectors/src/default_implementations.rs", "crates/hyperswitch_connectors/src/default_implementations_v2.rs", "crates/router/src/connector.rs", "crates/router/tests/connectors/affirm.rs", "crates/router/tests/connectors/main.rs", "crates/test_utils/src/connector_auth.rs", "scripts/add_connector.sh"], "tests": ["config/deployments/integration_test.toml", "loadtest/config/development.toml"], "config": ["config/config.example.toml", "config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml"]}, "change_types": {"structs_added": 10, "functions_added": 83, "enums_added": 2, "fields_added": 162, "imports_added": 22}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(routing): Enable volume split for dynamic routing
## 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 -->
Have added a new API for enabling volume split for dynamic routing service
### 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)?
-->
```
curl --location --request POST 'http://localhost:8080/account/sarthak1/business_profile/pro_WlO7KCOeDRB8kWk7MSy1/dynamic_routing/set_volume_split?split=20' \
--header 'api-key: dev_iricUDSeFis6RzTGCcYkOt4wmuBcRfjbVbWXbOUO5996boAgztmtfTKN6HNqerjM'
```
Status in DB -
<img width="1511" alt="image" src="https://github.com/user-attachments/assets/ce1f3149-ffcf-401d-86b8-093e002573af">
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/events/routing.rs`
- `crates/api_models/src/routing.rs`
**2. Core Business Logic**
- `crates/router/src/core/payments.rs`
- `crates/router/src/core/payments/routing.rs`
- `crates/router/src/core/routing.rs`
- ... and 1 more files
**3. Type Definitions**
- `crates/router_env/src/logger/types.rs`
**4. Utils**
- `crates/router/src/routes/lock_utils.rs`
**5. Configuration Files**
- `config/development.toml`
**6. Other**
- `crates/router/src/consts.rs`
- `crates/router/src/routes/app.rs`
- `crates/router/src/routes/routing.rs`
**Code Patterns Applied:**
- Define new data structures (3 changes)
- Implement new functions (9 changes)
- Extend existing types with new fields (36 changes)
- Add conditional logic for feature flags or filtering (2 changes)
**Detailed Identifier Changes:**
Commit 03b936a1:
Files to modify:
**crates/api_models/src/events/routing.rs**
Add:
- function: private::get_api_event_type
- impl: impl ApiEventMetric for RoutingVolumeSplitWrapper
**crates/api_models/src/routing.rs**
Remove:
- function: pub::new
- function: pub::new
- impl: impl EliminationRoutingAlgorithm
- impl: impl SuccessBasedAlgorithm
Add:
- function: pub::update_volume_split
- function: pub::new
- function: pub::new
- function: pub::is_dynamic_routing
- struct: pub::RoutingVolumeSplit
- struct: pub::DynamicRoutingVolumeSplitQuery
- enum: pub::RoutingType
- impl: impl EliminationRoutingAlgorithm
- impl: impl SuccessBasedAlgorithm
- impl: impl RoutingType
**crates/router/src/consts.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/core/payments/routing.rs**
Add:
- function: pub::perform_dynamic_routing_volume_split
**crates/router/src/core/routing.rs**
Add:
- function: pub::configure_dynamic_routing_volume_split
**crates/router/src/core/routing/helpers.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/routing.rs**
Add:
- function: pub::set_dynamic_routing_volume_split
**crates/router_env/src/logger/types.rs**
Modify existing code
|
{"pr_number": 6662, "pr_title": "feat(routing): Enable volume split for dynamic routing", "merged_at": "2024-12-05T09:45:49Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user"]}, "hierarchy": {"api_models": ["crates/api_models/src/events/routing.rs", "crates/api_models/src/routing.rs"], "core_business": ["crates/router/src/core/payments.rs", "crates/router/src/core/payments/routing.rs", "crates/router/src/core/routing.rs", "crates/router/src/core/routing/helpers.rs"], "types": ["crates/router_env/src/logger/types.rs"], "utils": ["crates/router/src/routes/lock_utils.rs"], "config": ["config/development.toml"], "other": ["crates/router/src/consts.rs", "crates/router/src/routes/app.rs", "crates/router/src/routes/routing.rs"]}, "change_types": {"structs_added": 3, "functions_added": 9, "enums_added": 1, "fields_added": 36, "imports_added": 2, "conditionals_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(connector): add amount conversion framework to rapyd
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
This PR adds amount conversion framework to rapyd.
rapyd accepts amount in MinorUnit
### 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).
-->
Amount conversion for rapyd
Fixes #6020
## 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`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/router/src/connector/rapyd.rs`
- `crates/router/src/connector/rapyd/transformers.rs`
- `crates/router/tests/connectors/rapyd.rs`
**2. Type Definitions**
- `crates/router/src/types/api.rs`
**Code Patterns Applied:**
- Define new data structures (1 changes)
- Implement new functions (2 changes)
- Extend existing types with new fields (6 changes)
**Detailed Identifier Changes:**
Commit 33bc83fc:
Files to modify:
**crates/router/src/connector/rapyd.rs**
Remove:
- struct: pub::Rapyd
Add:
- function: pub::new
- struct: pub::Rapyd
- impl: impl Rapyd
**crates/router/src/connector/rapyd/transformers.rs**
Modify existing code
**crates/router/src/types/api.rs**
Modify existing code
**crates/router/tests/connectors/rapyd.rs**
Modify existing code
|
{"pr_number": 6414, "pr_title": "refactor(connector): add amount conversion framework to rapyd", "merged_at": "2024-10-30T14:47:44Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"connectors": ["crates/router/src/connector/rapyd.rs", "crates/router/src/connector/rapyd/transformers.rs", "crates/router/tests/connectors/rapyd.rs"], "types": ["crates/router/src/types/api.rs"]}, "change_types": {"structs_added": 1, "functions_added": 2, "fields_added": 6, "imports_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(subscription): add support to create subscription with trial plans
## 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 -->
1. Add support to create a subscription with trial plans.
When this type of subscription is created, a payment of $0 will be made to validate the payment method and save it for future use. The incoming webhook for invoice-generated event should work similarly to the MIT flow.
2. Add support to make 3DS payments in subscriptions
### 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)?
-->
1. Create Merchant Account, create API key, create payment processor, create billing processor
2. Create Customer
Request
```
curl --location 'http://localhost:8080/customers' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_4IM0uzCEoKQ9lkSaTUEceuErgHTSnZhcc0CsjiSc1P2jVv5W4p9nYumBWwnJLqLb' \
--header 'X-Tenant-Id: public' \
--data-raw '{
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "First customer",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "IN",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "123456789",
"country_code": "+1"
}
}
}'
```
Response
```
{
"customer_id": "cus_PqvEsNGKq1kLRdX7HTHJ",
"name": "John Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+65",
"description": "First customer",
"address": null,
"created_at": "2025-10-08T06:35:33.524Z",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"default_payment_method_id": null,
"tax_registration_id": null
}
```
3. Create and Confirm subscription
Request
```
curl --location 'http://localhost:8080/subscriptions' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'X-Profile-Id: pro_BSjmSsJE4oqVfDdiJViI' \
--header 'api-key: dev_4IM0uzCEoKQ9lkSaTUEceuErgHTSnZhcc0CsjiSc1P2jVv5W4p9nYumBWwnJLqLb' \
--header 'X-Tenant-Id: public' \
--data '{
"item_price_id": "standard-plan-yearly",
"customer_id": "cus_PqvEsNGKq1kLRdX7HTHJ",
"description": "Hello this is description",
"merchant_reference_id": "mer_ref_1759906164",
"shipping": {
"address": {
"state": "zsaasdas",
"city": "Banglore",
"country": "US",
"line1": "sdsdfsdf",
"line2": "hsgdbhd",
"line3": "alsksoe",
"zip": "571201",
"first_name": "joseph",
"last_name": "doe"
},
"phone": {
"number": "123456789",
"country_code": "+1"
}
},
"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"
},
"phone": {
"number": "123456789",
"country_code": "+1"
}
},
"payment_details": {
"payment_type": "setup_mandate",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4111111111111111",
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "CLBRW dffdg",
"card_cvc": "737"
}
},
"authentication_type": "no_three_ds",
"setup_future_usage": "off_session",
"capture_method": "automatic",
"return_url": "https://google.com",
"customer_acceptance": {
"acceptance_type": "online",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "127.0.0.1",
"user_agent": "amet irure esse"
}
}
}
}'
```
Response
```
{
"id": "sub_ZEqweuW4DlSc5BuM6zhW",
"merchant_reference_id": "mer_ref_1759906160",
"status": "trial",
"plan_id": null,
"price_id": null,
"coupon": null,
"profile_id": "pro_BSjmSsJE4oqVfDdiJViI",
"payment": {
"payment_id": "pay_1B9LjwEWwAfHb4bf0rcS",
"status": "succeeded",
"amount": 0,
"currency": "USD",
"connector": "stripe",
"payment_method_id": "pm_kLqHMaoTQwDD5wRFj4mf",
"payment_experience": null,
"error_code": null,
"error_message": null,
"payment_method_type": "credit",
"client_secret": "pay_1B9LjwEWwAfHb4bf0rcS_secret_a5IfTsNMNyh2hXHmmIEq",
"payment_type": null
},
"customer_id": "cus_PqvEsNGKq1kLRdX7HTHJ",
"invoice": {
"id": "invoice_gO4K4XTvSoBJygwXBmsf",
"subscription_id": "sub_ZEqweuW4DlSc5BuM6zhW",
"merchant_id": "merchant_1759818834",
"profile_id": "pro_BSjmSsJE4oqVfDdiJViI",
"merchant_connector_id": "mca_4C0kfzkr1veBQWDVKnUj",
"payment_intent_id": "pay_1B9LjwEWwAfHb4bf0rcS",
"payment_method_id": null,
"customer_id": "cus_PqvEsNGKq1kLRdX7HTHJ",
"amount": 0,
"currency": "USD",
"status": "invoice_created"
},
"billing_processor_subscription_id": "sub_ZEqweuW4DlSc5BuM6zhW"
}
```
<img width="1309" height="107" alt="Screenshot 2025-10-08 at 12 20 19 PM" src="https://github.com/user-attachments/assets/feaf1e79-3ed4-441c-8401-767b0a76ac00" />
Time travel to the next billing date, an invoice will be generated with payment due statue and webhook will be received
<img width="847" height="200" alt="Screenshot 2025-10-08 at 12 22 26 PM" src="https://github.com/user-attachments/assets/e5fe8953-a3a2-4773-a83c-060bb7385b94" />
4. Time travel to the next billing date and accept the incoming webhook for `invoice_generated` event, now the invoice should get marked as paid
Request
```
curl --location 'http://localhost:8080/webhooks/merchant_1759818834/mca_4C0kfzkr1veBQWDVKnUj' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'X-Profile-Id: pro_BSjmSsJE4oqVfDdiJViI' \
--header 'api-key: dev_4IM0uzCEoKQ9lkSaTUEceuErgHTSnZhcc0CsjiSc1P2jVv5W4p9nYumBWwnJLqLb' \
--header 'X-tenant-id: public' \
--header 'Authorization: Basic aHlwZXJzd2l0Y2g6aHlwZXJzd2l0Y2g=' \
--data '{
"api_version": "v2",
"content": {
"invoice": {
"adjustment_credit_notes": [],
"amount_adjusted": 0,
"amount_due": 12000,
"amount_paid": 0,
"amount_to_collect": 12000,
"applied_credits": [],
"base_currency_code": "INR",
"billing_address": {
"city": "San Fransico",
"country": "US",
"first_name": "joseph",
"last_name": "Doe",
"line1": "1467",
"object": "billing_address",
"state": "California",
"state_code": "CA",
"validation_status": "not_validated",
"zip": "94122"
},
"channel": "web",
"credits_applied": 0,
"currency_code": "USD",
"customer_id": "cus_PqvEsNGKq1kLRdX7HTHJ",
"date": 1745303361,
"deleted": false,
"due_date": 1745303361,
"dunning_attempts": [],
"exchange_rate": 0.011742719,
"first_invoice": true,
"generated_at": 1745303361,
"has_advance_charges": false,
"id": "8",
"is_gifted": false,
"issued_credit_notes": [],
"line_items": [
{
"amount": 12000,
"customer_id": "cus_PqvEsNGKq1kLRdX7HTHJ",
"date_from": 1745303361,
"date_to": 1776839361,
"description": "Standard Plan - Yearly",
"discount_amount": 0,
"entity_id": "standard-plan-yearly",
"entity_type": "plan_item_price",
"id": "li_169lH1Uz11LJr2CNi",
"is_taxed": false,
"item_level_discount_amount": 0,
"object": "line_item",
"pricing_model": "flat_fee",
"quantity": 1,
"subscription_id": "sub_ZEqweuW4DlSc5BuM6zhW",
"tax_amount": 0,
"tax_exempt_reason": "tax_not_configured",
"unit_amount": 12000
}
],
"linked_orders": [],
"linked_payments": [],
"net_term_days": 0,
"new_sales_amount": 12000,
"object": "invoice",
"price_type": "tax_exclusive",
"recurring": true,
"reference_transactions": [],
"resource_version": 1745303362952,
"round_off_amount": 0,
"site_details_at_creation": {
"timezone": "Asia/Calcutta"
},
"status": "payment_due",
"sub_total": 12000,
"subscription_id": "sub_ZEqweuW4DlSc5BuM6zhW",
"tax": 0,
"term_finalized": true,
"total": 12000,
"updated_at": 1745303362,
"write_off_amount": 0
}
},
"event_type": "invoice_generated",
"id": "ev_169lH1Uz11LL82CNk",
"object": "event",
"occurred_at": 1745303363,
"source": "scheduled_job",
"webhook_status": "scheduled",
"webhooks": [
{
"id": "whv2_169wFTUz0zZE6S87",
"object": "webhook",
"webhook_status": "scheduled"
}
]
}'
```
Response
```
200 OK
```
<img width="820" height="153" alt="Screenshot 2025-10-08 at 2 49 12 PM" src="https://github.com/user-attachments/assets/fc43b38d-03eb-4015-b8d0-0bbc4e07e2bf" />
5. Create Customer and create subscription with auth_type: "three_ds" to create 3DS payment
Request
```
curl --location 'http://localhost:8080/subscriptions' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'X-Profile-Id: pro_Z5PRkNfUsNYHHGgKDmSc' \
--header 'api-key: dev_TVnuWX7gAfpjrVv4Ex5OHjwTZ7lUKY5LNy8MQnvnSbj19ys5nbEDME4kejTBZ0tg' \
--header 'X-tenant-id: public' \
--data '{
"item_price_id": "standard-plan-USD-Monthly",
"customer_id": "cus_Pp7MTQL9p1ovyoKB2QtS",
"description": "Hello this is description",
"merchant_reference_id": "mer_ref_1760016459",
"shipping": {
"address": {
"state": "zsaasdas",
"city": "Banglore",
"country": "US",
"line1": "sdsdfsdf",
"line2": "hsgdbhd",
"line3": "alsksoe",
"zip": "571201",
"first_name": "joseph",
"last_name": "doe"
},
"phone": {
"number": "123456789",
"country_code": "+1"
}
},
"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"
},
"phone": {
"number": "123456789",
"country_code": "+1"
}
},
"payment_details": {
"payment_type": "setup_mandate",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4111111111111111",
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "CLBRW dffdg",
"card_cvc": "737"
}
},
"authentication_type": "three_ds",
"setup_future_usage": "off_session",
"capture_method": "automatic",
"return_url": "https://google.com",
"customer_acceptance": {
"acceptance_type": "online",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "127.0.0.1",
"user_agent": "amet irure esse"
}
}
}
}'
```
Response
```
{
"id": "sub_XSgS745pisVSvcXEWxiE",
"merchant_reference_id": "mer_ref_1760016450",
"status": "active",
"plan_id": null,
"price_id": null,
"coupon": null,
"profile_id": "pro_Z5PRkNfUsNYHHGgKDmSc",
"payment": {
"payment_id": "pay_pwKrT9HW6vmSukp56Oo0",
"status": "requires_customer_action",
"amount": 1200,
"currency": "USD",
"profile_id": "pro_Z5PRkNfUsNYHHGgKDmSc",
"connector": "stripe",
"payment_method_id": "pm_2i4KXYKijSeX0u4PymkJ",
"return_url": "https://google.com/",
"next_action": {
"type": "redirect_to_url",
"redirect_to_url": "http://localhost:8080/payments/redirect/pay_pwKrT9HW6vmSukp56Oo0/merchant_1760009370/pay_pwKrT9HW6vmSukp56Oo0_1"
},
"payment_experience": null,
"error_code": null,
"error_message": null,
"payment_method_type": "credit",
"client_secret": "pay_pwKrT9HW6vmSukp56Oo0_secret_Z8ZehHMFc45D1KliHX0g",
"payment_type": null
},
"customer_id": "cus_Pp7MTQL9p1ovyoKB2QtS",
"invoice": {
"id": "invoice_iVKvCnVwg9aotKN2tcwn",
"subscription_id": "sub_XSgS745pisVSvcXEWxiE",
"merchant_id": "merchant_1760009370",
"profile_id": "pro_Z5PRkNfUsNYHHGgKDmSc",
"merchant_connector_id": "mca_hbJ2wahF6dp7ACUW72eO",
"payment_intent_id": "pay_pwKrT9HW6vmSukp56Oo0",
"payment_method_id": null,
"customer_id": "cus_Pp7MTQL9p1ovyoKB2QtS",
"amount": 1200,
"currency": "USD",
"status": "payment_pending"
},
"billing_processor_subscription_id": "sub_XSgS745pisVSvcXEWxiE"
}
```
<img width="1195" height="542" alt="Screenshot 2025-10-09 at 6 59 39 PM" src="https://github.com/user-attachments/assets/24457ec6-f816-4956-8d88-b59302f9e654" />
Created Unique index on subscription_id_connector_invoice_id in invoice table to avoid multiple MIT payments
```
➜ ~ seq 1 4 | xargs -n1 -P5 curl -w "\nStatus: %{http_code}\n" --location 'http://localhost.proxyman.io:8080/webhooks/merchant_1760030871/mca_Qxsaj3wPHpCw2BfVLfcp' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'X-Profile-Id: pro_fRxGSwMSfrfb19ttnUJt' \
--header 'api-key: dev_oioLdMN4eQuEHr6e9H3WWllhWgJMwkhYhZgiEP2nc2whZ7tPtC8xx4pCHKt3d8C7' \
--header 'X-tenant-id: public' \
--header 'Authorization: Basic aHlwZXJzd2l0Y2g6aHlwZXJzd2l0Y2g=' \
--data '{"api_version":"v2","content":{"invoice":{"adjustment_credit_notes":[],"amount_adjusted":0,"amount_due":12000,"amount_paid":0,"amount_to_collect":12000,"applied_credits":[],"base_currency_code":"INR","billing_address":{"city":"San Fransico","country":"US","first_name":"joseph","last_name":"Doe","line1":"1467","object":"billing_address","state":"California","state_code":"CA","validation_status":"not_validated","zip":"94122"},"channel":"web","credits_applied":0,"currency_code":"USD","customer_id":"cus_4dPaSdR6AvhvVRGsw2j3","date":1745428099,"deleted":false,"due_date":1745428099,"dunning_attempts":[],"exchange_rate":0.011732607,"first_invoice":true,"generated_at":1745428099,"has_advance_charges":false,"id":"30","is_gifted":false,"issued_credit_notes":[],"line_items":[{"amount":12000,"customer_id":"cus_4dPaSdR6AvhvVRGsw2j3","date_from":1745428099,"date_to":1776964099,"description":"Standard Plan - Yearly","discount_amount":0,"entity_id":"standard-plan-yearly","entity_type":"plan_item_price","id":"li_AzZtuxUz9SYOs8pX8","is_taxed":false,"item_level_discount_amount":0,"object":"line_item","pricing_model":"flat_fee","quantity":1,"subscription_id":"sub_Q1awfb6GdSXDf3QXcmQr","tax_amount":0,"tax_exempt_reason":"tax_not_configured","unit_amount":12000}],"linked_orders":[],"linked_payments":[],"net_term_days":0,"new_sales_amount":12000,"object":"invoice","price_type":"tax_exclusive","recurring":true,"reference_transactions":[],"resource_version":1745428100772,"round_off_amount":0,"site_details_at_creation":{"timezone":"Asia/Calcutta"},"status":"payment_due","sub_total":12000,"subscription_id":"sub_Q1awfb6GdSXDf3QXcmQr","tax":0,"term_finalized":true,"total":12000,"updated_at":1745428100,"write_off_amount":0}},"event_type":"invoice_generated","id":"ev_AzZtuxUz9SYQ08pXA","object":"event","occurred_at":1745428100,"source":"scheduled_job","webhook_status":"scheduled","webhooks":[{"id":"whv2_169wFTUz0zZE6S87","object":"webhook","webhook_status":"scheduled"}]}'
{"error":{"type":"invalid_request","message":"Subscription operation: Create Invoice failed with connector","code":"CE_09"}}{"error":{"type":"invalid_request","message":"Subscription operation: Create Invoice failed with connector","code":"CE_09"}}{"error":{"type":"invalid_request","message":"Subscription operation: Create Invoice failed with connector","code":"CE_09"}}
Status: 400
Status: 400
Status: 400
curl: (7) Failed to connect to 0.0.0.1 port 80 after 0 ms: Couldn't connect to server
Status: 000
curl: (7) Failed to connect to 0.0.0.3 port 80 after 0 ms: Couldn't connect to server
Status: 000
curl: (7) Failed to connect to 0.0.0.4 port 80 after 0 ms: Couldn't connect to server
Status: 000
Status: 200
curl: (7) Failed to connect to 0.0.0.2 port 80 after 0 ms: Couldn't connect to server
Status: 000
```
Here there is only one 200 and rest of the parallel request are 400
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/payments.rs`
- `crates/api_models/src/subscription.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/invoice.rs`
- `crates/diesel_models/src/query/invoice.rs`
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/customer.rs`
- `crates/hyperswitch_domain_models/src/invoice.rs`
**4. Core Business Logic**
- `crates/router/src/core/subscription.rs`
- `crates/router/src/core/subscription/billing_processor_handler.rs`
- `crates/router/src/core/subscription/invoice_handler.rs`
- ... and 3 more files
**5. External Connector Integration**
- `crates/common_enums/src/connector_enums.rs`
- `migrations/2025-10-09-171834_invoice_subscription_id_connector_invoice_id_unique_index/down.sql`
- `migrations/2025-10-09-171834_invoice_subscription_id_connector_invoice_id_unique_index/up.sql`
**6. Type Definitions**
- `crates/router/src/types/storage/invoice_sync.rs`
**7. Other**
- `crates/router/src/db/kafka_store.rs`
- `crates/router/src/workflows/invoice_sync.rs`
- `crates/storage_impl/src/invoice.rs`
**Code Patterns Applied:**
- Implement new functions (13 changes)
- Extend existing types with new fields (91 changes)
- Add conditional logic for feature flags or filtering (5 changes)
- Modify database queries (2 changes)
**Detailed Identifier Changes:**
Commit c2a9ce78:
Files to modify:
**crates/api_models/src/payments.rs**
Modify existing code
**crates/api_models/src/subscription.rs**
Modify existing code
**crates/common_enums/src/connector_enums.rs**
Modify existing code
**crates/diesel_models/src/invoice.rs**
Modify existing code
**crates/diesel_models/src/query/invoice.rs**
Add:
- function: pub::get_invoice_by_subscription_id_connector_invoice_id
**crates/hyperswitch_domain_models/src/customer.rs**
Add:
- function: pub::get_connector_customer_map
**crates/hyperswitch_domain_models/src/invoice.rs**
Modify existing code
**crates/router/src/core/subscription.rs**
Modify existing code
**crates/router/src/core/subscription/billing_processor_handler.rs**
Modify existing code
**crates/router/src/core/subscription/invoice_handler.rs**
Add:
- function: pub::find_invoice_by_subscription_id_connector_invoice_id
**crates/router/src/core/subscription/payments_api_client.rs**
Modify existing code
**crates/router/src/core/subscription/subscription_handler.rs**
Add:
- function: pub::update_connector_customer_id_in_customer
- function: pub::update_customer
**crates/router/src/core/webhooks/incoming.rs**
Modify existing code
**crates/router/src/db/kafka_store.rs**
Add:
- function: private::find_invoice_by_subscription_id_connector_invoice_id
**crates/router/src/types/storage/invoice_sync.rs**
Modify existing code
**crates/router/src/workflows/invoice_sync.rs**
Add:
- function: pub::perform_billing_processor_record_back_if_possible
**crates/storage_impl/src/invoice.rs**
Add:
- function: private::find_invoice_by_subscription_id_connector_invoice_id
- function: private::find_invoice_by_subscription_id_connector_invoice_id
- function: private::find_invoice_by_subscription_id_connector_invoice_id
|
{"pr_number": 9721, "pr_title": "feat(subscription): add support to create subscription with trial plans", "merged_at": "2025-10-10T14:44:11Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/payments.rs", "crates/api_models/src/subscription.rs"], "database": ["crates/diesel_models/src/invoice.rs", "crates/diesel_models/src/query/invoice.rs"], "domain": ["crates/hyperswitch_domain_models/src/customer.rs", "crates/hyperswitch_domain_models/src/invoice.rs"], "core_business": ["crates/router/src/core/subscription.rs", "crates/router/src/core/subscription/billing_processor_handler.rs", "crates/router/src/core/subscription/invoice_handler.rs", "crates/router/src/core/subscription/payments_api_client.rs", "crates/router/src/core/subscription/subscription_handler.rs", "crates/router/src/core/webhooks/incoming.rs"], "connectors": ["crates/common_enums/src/connector_enums.rs", "migrations/2025-10-09-171834_invoice_subscription_id_connector_invoice_id_unique_index/down.sql", "migrations/2025-10-09-171834_invoice_subscription_id_connector_invoice_id_unique_index/up.sql"], "types": ["crates/router/src/types/storage/invoice_sync.rs"], "other": ["crates/router/src/db/kafka_store.rs", "crates/router/src/workflows/invoice_sync.rs", "crates/storage_impl/src/invoice.rs"]}, "change_types": {"functions_added": 13, "fields_added": 91, "imports_added": 2, "conditionals_added": 5, "database_queries": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): [Redsys] Use merchant payment_id for ds_merchant_order with length check
## 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 -->
### Additional Changes
- [ ] This PR modifies the API contract
- [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`
-->
## 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).
-->
Redsys requires the payment_id (ds_merchant_order) to be no longer than 12 characters.
Currently, Hyperswitch generates a random payment_id internally, which gets passed to Redsys.
This PR does the following:
1. Uses merchant provided payment_id if present: Instead of generating a random ID, it will now use the payment_id sent by the merchant if is_config_enabled_to_send_payment_id_as_connector_request_id is true.
2. Validation: If the merchant-provided payment_id exceeds 12 characters, a 4xx error is returned.
3. If the merchant does not provide a payment_id, it will generate one that conforms to Redsys constraints (max 12 characters).
4. A new field is_payment_id_from_merchant is introduced in the payment_intent table and RouterData. It indicates whether the payment_id was provided by the merchant (true) or generated internally by Hyperswitch (false).
4. A new field connector_request_reference_id is introduced in the payment_attempt table.
## 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)?
-->
<details>
<summary>Redsys Connector Create</summary>
```json
{
"connector_type": "payment_processor",
"connector_name": "redsys",
"business_country": "US",
"business_label": "default",
"connector_account_details": {
"auth_type": "SignatureKey",
"api_key": "**********************",
"key1": "****",
"api_secret": "***********"
},
"test_mode": false,
"disabled": false,
"payment_methods_enabled": [
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "credit",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "debit",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "wallet",
"payment_method_types": [
{
"payment_method_type": "apple_pay",
"payment_experience": "invoke_sdk_client",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "wallet",
"payment_method_types": [
{
"payment_method_type": "google_pay",
"payment_experience": "invoke_sdk_client",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
}
]
}
```
Response
```json
{
"connector_type": "payment_processor",
"connector_name": "redsys",
"connector_label": "redsys_US_default",
"merchant_connector_id": "mca_ORJf5rnLEcFeI3o7Fxiw",
"profile_id": "pro_Pg2QIEEzbZewBtns4HzP",
"connector_account_details": {
"auth_type": "SignatureKey",
"api_key": "3*******1",
"key1": "***",
"api_secret": "s******************************7"
},
"payment_methods_enabled": [
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "credit",
"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": "card",
"payment_method_types": [
{
"payment_method_type": "debit",
"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": "wallet",
"payment_method_types": [
{
"payment_method_type": "apple_pay",
"payment_experience": "invoke_sdk_client",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "wallet",
"payment_method_types": [
{
"payment_method_type": "google_pay",
"payment_experience": "invoke_sdk_client",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
}
],
"connector_webhook_details": null,
"metadata": null,
"test_mode": false,
"disabled": false,
"frm_configs": null,
"business_country": "US",
"business_label": "default",
"business_sub_label": null,
"applepay_verified_domains": null,
"pm_auth_config": null,
"status": "active",
"additional_merchant_data": null,
"connector_wallets_details": null
}
```
</details>
<details>
<summary>Payment Create without passing payment_id</summary>
```json
{
"amount": 10,
"currency": "EUR",
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "First_Customer",
"name": "John Doe",
"confirm": true,
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4548814479727229",
"card_exp_month": "12",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"card_cvc": "124"
}
},
"authentication_type": "three_ds",
"return_url": "https://google.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"
}
,
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "Ceuta",
"zip": "94122",
"country": "ES",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "Ceuta",
"zip": "94122",
"country": "ES",
"first_name": "John",
"last_name": "Doe"
}
},
"setup_future_usage":"on_session"
}
```
Response
```json
{
"payment_id": "pay_17nevdGKbQmhtYU3Ecx0",
"merchant_id": "merchant_1751452129",
"status": "succeeded",
"amount": 10,
"net_amount": 10,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 10,
"connector": "redsys",
"client_secret": "pay_17nevdGKbQmhtYU3Ecx0_secret_UBBzpAVIuo9QJ6wcfGLa",
"created": "2025-07-02T10:30:52.589Z",
"currency": "EUR",
"customer_id": "First_Customer",
"customer": {
"id": "First_Customer",
"name": "John Doe",
"email": null,
"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": "7229",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "454881",
"card_extended_bin": null,
"card_exp_month": "12",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": "token_aEceGVQiuQALUkhR0WpU",
"shipping": {
"address": {
"city": "San Fransico",
"country": "ES",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "Ceuta",
"first_name": "John",
"last_name": "Doe"
},
"phone": null,
"email": null
},
"billing": {
"address": {
"city": "San Fransico",
"country": "ES",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "Ceuta",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"order_details": null,
"email": null,
"name": "John Doe",
"phone": null,
"return_url": "https://google.com/",
"authentication_type": "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": "First_Customer",
"created_at": 1751452252,
"expires": 1751455852,
"secret": "epk_20aadf0c4f9240e18ffc20d13d46e896"
},
"manual_retry_allowed": false,
"connector_transaction_id": "656153631970",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "656153631970",
"payment_link": null,
"profile_id": "pro_Pg2QIEEzbZewBtns4HzP",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_ORJf5rnLEcFeI3o7Fxiw",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-07-02T10:45:52.588Z",
"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": "2025-07-02T10:30:55.133Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": "manual",
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null
}
```
</details>
<details>
<summary>Payment Create by passing payment_id with 12 characters</summary>
```json
{
"amount": 10,
"currency": "EUR",
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "First_Customer",
"payment_id": "777123456712" ,
"name": "John Doe",
"confirm": true,
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4548814479727229",
"card_exp_month": "12",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"card_cvc": "124"
}
},
"authentication_type": "three_ds",
"return_url": "https://google.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"
}
,
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "Ceuta",
"zip": "94122",
"country": "ES",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "Ceuta",
"zip": "94122",
"country": "ES",
"first_name": "John",
"last_name": "Doe"
}
},
"setup_future_usage":"on_session"
}
```
Response
```json
{
"payment_id": "777123456712",
"merchant_id": "merchant_1751452129",
"status": "succeeded",
"amount": 10,
"net_amount": 10,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 10,
"connector": "redsys",
"client_secret": "777123456712_secret_PpTcAh299S5LBU8hAA7h",
"created": "2025-07-02T10:32:42.984Z",
"currency": "EUR",
"customer_id": "First_Customer",
"customer": {
"id": "First_Customer",
"name": "John Doe",
"email": null,
"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": "7229",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "454881",
"card_extended_bin": null,
"card_exp_month": "12",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": "token_YTFQhiBGwJ7QMnGVq7UQ",
"shipping": {
"address": {
"city": "San Fransico",
"country": "ES",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "Ceuta",
"first_name": "John",
"last_name": "Doe"
},
"phone": null,
"email": null
},
"billing": {
"address": {
"city": "San Fransico",
"country": "ES",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "Ceuta",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"order_details": null,
"email": null,
"name": "John Doe",
"phone": null,
"return_url": "https://google.com/",
"authentication_type": "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": "First_Customer",
"created_at": 1751452362,
"expires": 1751455962,
"secret": "epk_ecd021e84b2d4cdabdd66d07f7d49bbd"
},
"manual_retry_allowed": false,
"connector_transaction_id": "777123456712",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "777123456712",
"payment_link": null,
"profile_id": "pro_Pg2QIEEzbZewBtns4HzP",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_ORJf5rnLEcFeI3o7Fxiw",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-07-02T10:47:42.984Z",
"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": "2025-07-02T10:32:45.666Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": "manual",
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null
}
```
</details>
<details>
<summary>Payment Create by passing payment_id with more than 12 characters</summary>
```json
{
"amount": 10,
"currency": "EUR",
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "First_Customer",
"payment_id": "77712345671233" ,
"name": "John Doe",
"confirm": true,
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4548814479727229",
"card_exp_month": "12",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"card_cvc": "124"
}
},
"authentication_type": "three_ds",
"return_url": "https://google.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"
}
,
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "Ceuta",
"zip": "94122",
"country": "ES",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "Ceuta",
"zip": "94122",
"country": "ES",
"first_name": "John",
"last_name": "Doe"
}
},
"setup_future_usage":"on_session"
}
```
Response
```json
{
"error": {
"type": "invalid_request",
"message": "Connector 'Redsys' rejected field 'ds_merchant_order': length 14 exceeds maximum of 12",
"code": "IR_47",
"connector": "Redsys"
}
}
```
</details>
<details>
<summary>Payment Update with payment_id from merchant</summary>
Payment create request
```json
{
"amount": 10,
"currency": "EUR",
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "First_Customer",
"payment_id": "777123456" ,
"name": "John Doe",
// "confirm": true,
// "payment_method": "card",
// "payment_method_type": "credit",
// "payment_method_data": {
// "card": {
// "card_number": "4548814479727229",
// "card_exp_month": "12",
// "card_exp_year": "25",
// "card_holder_name": "joseph Doe",
// "card_cvc": "124"
// }
// },
"authentication_type": "three_ds",
"return_url": "https://google.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"
}
,
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "Ceuta",
"zip": "94122",
"country": "ES",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "Ceuta",
"zip": "94122",
"country": "ES",
"first_name": "John",
"last_name": "Doe"
}
},
"setup_future_usage":"on_session"
}
```
Payment create Response
```json
{
"payment_id": "777123456",
"merchant_id": "merchant_1751452129",
"status": "requires_payment_method",
"amount": 10,
"net_amount": 10,
"shipping_cost": null,
"amount_capturable": 10,
"amount_received": null,
"connector": null,
"client_secret": "777123456_secret_Q1a4FhoD0V89IjisTkVJ",
"created": "2025-07-02T10:35:25.045Z",
"currency": "EUR",
"customer_id": "First_Customer",
"customer": {
"id": "First_Customer",
"name": "John Doe",
"email": null,
"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": null,
"payment_method_data": null,
"payment_token": null,
"shipping": {
"address": {
"city": "San Fransico",
"country": "ES",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "Ceuta",
"first_name": "John",
"last_name": "Doe"
},
"phone": null,
"email": null
},
"billing": {
"address": {
"city": "San Fransico",
"country": "ES",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "Ceuta",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"order_details": null,
"email": null,
"name": "John Doe",
"phone": null,
"return_url": "https://google.com/",
"authentication_type": "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": null,
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "First_Customer",
"created_at": 1751452525,
"expires": 1751456125,
"secret": "epk_d4bec8814d3a435aa48f647bef687da7"
},
"manual_retry_allowed": null,
"connector_transaction_id": null,
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_Pg2QIEEzbZewBtns4HzP",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": null,
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-07-02T10:50:25.045Z",
"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": "2025-07-02T10:35:25.073Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": null,
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null
}
```
Payment Update request
```json
{
"amount": 10,
"currency": "EUR",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "First_Customer",
"name": "John Doe",
"authentication_type": "three_ds",
"return_url": "https://google.com",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4548814479727229",
"card_exp_month": "12",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"card_cvc": "124"
}
},
"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"
}
,
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "Ceuta",
"zip": "94122",
"country": "ES",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "Ceuta",
"zip": "94122",
"country": "ES",
"first_name": "John",
"last_name": "Doe"
}
},
"setup_future_usage":"on_session"
}
```
Payment Update Response
```json
{
"payment_id": "777123456",
"merchant_id": "merchant_1751452129",
"status": "succeeded",
"amount": 10,
"net_amount": 10,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 10,
"connector": "redsys",
"client_secret": "777123456_secret_Q1a4FhoD0V89IjisTkVJ",
"created": "2025-07-02T10:35:25.045Z",
"currency": "EUR",
"customer_id": "First_Customer",
"customer": {
"id": "First_Customer",
"name": "John Doe",
"email": null,
"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": "7229",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "454881",
"card_extended_bin": null,
"card_exp_month": "12",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": "token_i0yM6VGkpHLxYDtFHN9Z",
"shipping": {
"address": {
"city": "San Fransico",
"country": "ES",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "Ceuta",
"first_name": "John",
"last_name": "Doe"
},
"phone": null,
"email": null
},
"billing": {
"address": {
"city": "San Fransico",
"country": "ES",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "Ceuta",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"order_details": null,
"email": null,
"name": "John Doe",
"phone": null,
"return_url": "https://google.com/",
"authentication_type": "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": "777123456",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "777123456",
"payment_link": null,
"profile_id": "pro_Pg2QIEEzbZewBtns4HzP",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_ORJf5rnLEcFeI3o7Fxiw",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-07-02T10:50:25.045Z",
"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": "2025-07-02T10:36:32.646Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": "manual",
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null
}
```
</details>
<details>
<summary>Payment Confirm with payment_id from merchant</summary>
Payment create request
```json
{
"amount": 10,
"currency": "EUR",
"payment_id": "1234567892",
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "First_Customer",
"name": "John Doe",
"authentication_type": "three_ds",
"return_url": "https://google.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"
}
,
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "Ceuta",
"zip": "94122",
"country": "ES",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "Ceuta",
"zip": "94122",
"country": "ES",
"first_name": "John",
"last_name": "Doe"
}
},
"setup_future_usage":"on_session"
}
```
Payment create Response
```json
{
"payment_id": "1234567892",
"merchant_id": "merchant_1751036107",
"status": "requires_payment_method",
"amount": 10,
"net_amount": 10,
"shipping_cost": null,
"amount_capturable": 10,
"amount_received": null,
"connector": null,
"client_secret": "1234567892_secret_sfp8EvQSs23ilg7kcEYs",
"created": "2025-06-27T18:55:55.126Z",
"currency": "EUR",
"customer_id": "First_Customer",
"customer": {
"id": "First_Customer",
"name": "John Doe",
"email": null,
"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": null,
"payment_method_data": null,
"payment_token": null,
"shipping": {
"address": {
"city": "San Fransico",
"country": "ES",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "Ceuta",
"first_name": "John",
"last_name": "Doe"
},
"phone": null,
"email": null
},
"billing": {
"address": {
"city": "San Fransico",
"country": "ES",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "Ceuta",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"order_details": null,
"email": null,
"name": "John Doe",
"phone": null,
"return_url": "https://google.com/",
"authentication_type": "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": null,
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "First_Customer",
"created_at": 1751050555,
"expires": 1751054155,
"secret": "epk_d90edd41dd8c47cb9067fc9cbf42c597"
},
"manual_retry_allowed": null,
"connector_transaction_id": null,
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_tWAYQMPpvJPRI8CbB959",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": null,
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-06-27T19:10:55.126Z",
"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": "2025-06-27T18:55:55.174Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": null,
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null
}
```
Payment Confirm Request
```json
{
"amount": 10,
"currency": "EUR",
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "First_Customer",
"name": "John Doe",
"authentication_type": "three_ds",
"return_url": "https://google.com",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4548814479727229",
"card_exp_month": "12",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"card_cvc": "124"
}
},
"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"
}
,
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "Ceuta",
"zip": "94122",
"country": "ES",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "Ceuta",
"zip": "94122",
"country": "ES",
"first_name": "John",
"last_name": "Doe"
}
},
"setup_future_usage":"on_session"
}
```
Payment Confirm Response
```json
{
"payment_id": "1234567892",
"merchant_id": "merchant_1751036107",
"status": "succeeded",
"amount": 10,
"net_amount": 10,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 10,
"connector": "redsys",
"client_secret": "1234567892_secret_sfp8EvQSs23ilg7kcEYs",
"created": "2025-06-27T18:55:55.126Z",
"currency": "EUR",
"customer_id": "First_Customer",
"customer": {
"id": "First_Customer",
"name": "John Doe",
"email": null,
"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": "7229",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "454881",
"card_extended_bin": null,
"card_exp_month": "12",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": "token_Vz4dZyJWpwLNGkgHlu2v",
"shipping": {
"address": {
"city": "San Fransico",
"country": "ES",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "Ceuta",
"first_name": "John",
"last_name": "Doe"
},
"phone": null,
"email": null
},
"billing": {
"address": {
"city": "San Fransico",
"country": "ES",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "Ceuta",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"order_details": null,
"email": null,
"name": "John Doe",
"phone": null,
"return_url": "https://google.com/",
"authentication_type": "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": "1234567892",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "1234567892",
"payment_link": null,
"profile_id": "pro_tWAYQMPpvJPRI8CbB959",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_zBfGoDuXmZOYXg7cDPPC",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-06-27T19:10:55.126Z",
"fingerprint": null,
"browser_info": {
"os_type": null,
"language": "nl-NL",
"time_zone": 0,
"ip_address": "13.232.74.226",
"os_version": null,
"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,
"device_model": null,
"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,
"accept_language": "en",
"java_script_enabled": true
},
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-06-27T18:56:04.524Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": "manual",
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null
}
```
</details>
cypress tests for redsys
<img width="499" alt="Screenshot 2025-07-03 at 8 09 20 PM" src="https://github.com/user-attachments/assets/68167b4b-e5ed-48bb-8b49-2ae2d3f0a29e" />
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/payments.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/payment_attempt.rs`
- `crates/diesel_models/src/payment_intent.rs`
- `crates/diesel_models/src/schema.rs`
- ... and 2 more files
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/payments.rs`
- `crates/hyperswitch_domain_models/src/payments/payment_attempt.rs`
- `crates/hyperswitch_domain_models/src/payments/payment_intent.rs`
- ... and 1 more files
**4. Core Business Logic**
- `crates/router/src/core/authentication/transformers.rs`
- `crates/router/src/core/fraud_check/flows/checkout_flow.rs`
- `crates/router/src/core/fraud_check/flows/fulfillment_flow.rs`
- ... and 15 more files
**5. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/redsys.rs`
- `crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs`
- `crates/hyperswitch_connectors/src/utils.rs`
- ... and 6 more files
**6. Type Definitions**
- `crates/router/src/types.rs`
- `crates/router/src/types/storage/payment_attempt.rs`
**7. Utils**
- `crates/router/src/utils/user/sample_data.rs`
**8. Other**
- `crates/hyperswitch_interfaces/src/api.rs`
- `crates/hyperswitch_interfaces/src/conversion_impls.rs`
- `crates/router/src/routes/payments.rs`
- ... and 6 more files
**Code Patterns Applied:**
- Implement new functions (9 changes)
- Extend existing types with new fields (135 changes)
- Add conditional logic for feature flags or filtering (2 changes)
**Detailed Identifier Changes:**
Commit 6678ee35:
Files to modify:
**crates/api_models/src/payments.rs**
Modify existing code
**crates/diesel_models/src/payment_attempt.rs**
Modify existing code
**crates/diesel_models/src/payment_intent.rs**
Modify existing code
**crates/diesel_models/src/schema.rs**
Modify existing code
**crates/diesel_models/src/schema_v2.rs**
Modify existing code
**crates/diesel_models/src/user/sample_data.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/redsys.rs**
Add:
- function: private::generate_connector_request_reference_id
**crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/utils.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payments.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payments/payment_attempt.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payments/payment_intent.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_data.rs**
Modify existing code
**crates/hyperswitch_interfaces/src/api.rs**
Add:
- function: private::generate_connector_request_reference_id
**crates/hyperswitch_interfaces/src/connector_integration_interface.rs**
Add:
- function: private::generate_connector_request_reference_id
**crates/hyperswitch_interfaces/src/conversion_impls.rs**
Modify existing code
**crates/router/src/core/authentication/transformers.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/mandate/utils.rs**
Modify existing code
**crates/router/src/core/payment_methods.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Add:
- function: private::set_connector_request_reference_id_in_payment_attempt
- function: private::set_connector_request_reference_id_in_payment_attempt
- function: private::set_connector_request_reference_id_in_payment_attempt
- function: private::set_connector_request_reference_id_in_payment_attempt
- function: private::set_connector_request_reference_id_in_payment_attempt
**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/retry.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
**crates/router/src/core/relay/utils.rs**
Modify existing code
**crates/router/src/core/unified_authentication_service/utils.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/routes/payments.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.rs**
Modify existing code
**crates/router/src/types/api/verify_connector.rs**
Modify existing code
**crates/router/src/types/storage/payment_attempt.rs**
Modify existing code
**crates/router/src/utils/user/sample_data.rs**
Modify existing code
**crates/router/tests/connectors/aci.rs**
Modify existing code
**crates/router/tests/connectors/utils.rs**
Modify existing code
**crates/storage_impl/src/mock_db/payment_attempt.rs**
Modify existing code
**crates/storage_impl/src/payments/payment_attempt.rs**
Modify existing code
|
{"pr_number": 8485, "pr_title": "feat(connector): [Redsys] Use merchant payment_id for ds_merchant_order with length check", "merged_at": "2025-07-03T16:58:18Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/payments.rs"], "database": ["crates/diesel_models/src/payment_attempt.rs", "crates/diesel_models/src/payment_intent.rs", "crates/diesel_models/src/schema.rs", "crates/diesel_models/src/schema_v2.rs", "crates/diesel_models/src/user/sample_data.rs"], "domain": ["crates/hyperswitch_domain_models/src/payments.rs", "crates/hyperswitch_domain_models/src/payments/payment_attempt.rs", "crates/hyperswitch_domain_models/src/payments/payment_intent.rs", "crates/hyperswitch_domain_models/src/router_data.rs"], "core_business": ["crates/router/src/core/authentication/transformers.rs", "crates/router/src/core/fraud_check/flows/checkout_flow.rs", "crates/router/src/core/fraud_check/flows/fulfillment_flow.rs", "crates/router/src/core/fraud_check/flows/record_return.rs", "crates/router/src/core/fraud_check/flows/sale_flow.rs", "crates/router/src/core/fraud_check/flows/transaction_flow.rs", "crates/router/src/core/mandate/utils.rs", "crates/router/src/core/payment_methods.rs", "crates/router/src/core/payments.rs", "crates/router/src/core/payments/helpers.rs", "crates/router/src/core/payments/operations/payment_confirm.rs", "crates/router/src/core/payments/operations/payment_create.rs", "crates/router/src/core/payments/retry.rs", "crates/router/src/core/payments/transformers.rs", "crates/router/src/core/relay/utils.rs", "crates/router/src/core/unified_authentication_service/utils.rs", "crates/router/src/core/utils.rs", "crates/router/src/core/webhooks/utils.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/redsys.rs", "crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs", "crates/hyperswitch_connectors/src/utils.rs", "crates/hyperswitch_interfaces/src/connector_integration_interface.rs", "crates/router/src/types/api/verify_connector.rs", "crates/router/tests/connectors/aci.rs", "crates/router/tests/connectors/utils.rs", "migrations/2025-07-01-073253_add_connector_request_reference_id_and_is_payment_id_from_merchant/down.sql", "migrations/2025-07-01-073253_add_connector_request_reference_id_and_is_payment_id_from_merchant/up.sql"], "types": ["crates/router/src/types.rs", "crates/router/src/types/storage/payment_attempt.rs"], "utils": ["crates/router/src/utils/user/sample_data.rs"], "other": ["crates/hyperswitch_interfaces/src/api.rs", "crates/hyperswitch_interfaces/src/conversion_impls.rs", "crates/router/src/routes/payments.rs", "crates/router/src/services/kafka/payment_intent.rs", "crates/router/src/services/kafka/payment_intent_event.rs", "crates/storage_impl/src/mock_db/payment_attempt.rs", "crates/storage_impl/src/payments/payment_attempt.rs", "v2_migrations/2025-01-13-081847_drop_v1_columns/down.sql", "v2_migrations/2025-01-13-081847_drop_v1_columns/up.sql"]}, "change_types": {"functions_added": 9, "fields_added": 135, "imports_added": 1, "conditionals_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(router): add `organization_id` in authentication table and add it in authentication events
## 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 -->
1. add `organization_id` in authentication table of postgres
2. add `organization_id` in kafka queue and authentications table of clickhouse
3. send `organization_id` while logging events to clickhouse
### Additional Changes
- [ ] This PR modifies the API contract
- [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`
4. `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 Manually
Perform Sanity External 3DS payment to check organization_id being stored in authentication table
CURL
```
curl --location 'localhost:8080/payments/pay_EXpcC46YuZUwLX8DrXlA/3ds/authentication' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: pk_dev_74ab7c8aac7c49d793f9c980c544a09f' \
--data '{
"client_secret": "pay_EXpcC46YuZUwLX8DrXlA_secret_AcTKJleY3B1DFVdS3hlU",
"device_channel": "BRW",
"threeds_method_comp_ind": "Y"
}'
```
Database

Kafka Queue

Clickhouse table

## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/authentication.rs`
- `crates/diesel_models/src/schema.rs`
- `crates/diesel_models/src/schema_v2.rs`
**2. Core Business Logic**
- `crates/router/src/core/authentication.rs`
- `crates/router/src/core/authentication/utils.rs`
- `crates/router/src/core/payments/operations/payment_confirm.rs`
- ... and 1 more files
**3. Other**
- `crates/analytics/docs/clickhouse/scripts/authentications.sql`
- `crates/router/src/db/authentication.rs`
- `crates/router/src/services/kafka/authentication.rs`
- ... and 3 more files
**Code Patterns Applied:**
- Extend existing types with new fields (10 changes)
- Modify database queries (2 changes)
**Detailed Identifier Changes:**
Commit f2117542:
Files to modify:
**crates/diesel_models/src/authentication.rs**
Modify existing code
**crates/diesel_models/src/schema.rs**
Modify existing code
**crates/diesel_models/src/schema_v2.rs**
Modify existing code
**crates/router/src/core/authentication.rs**
Modify existing code
**crates/router/src/core/authentication/utils.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_confirm.rs**
Modify existing code
**crates/router/src/core/unified_authentication_service.rs**
Modify existing code
**crates/router/src/db/authentication.rs**
Modify existing code
**crates/router/src/services/kafka/authentication.rs**
Modify existing code
**crates/router/src/services/kafka/authentication_event.rs**
Modify existing code
|
{"pr_number": 7168, "pr_title": "feat(router): add `organization_id` in authentication table and add it in authentication events", "merged_at": "2025-02-06T15:19:15Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user"]}, "hierarchy": {"database": ["crates/diesel_models/src/authentication.rs", "crates/diesel_models/src/schema.rs", "crates/diesel_models/src/schema_v2.rs"], "core_business": ["crates/router/src/core/authentication.rs", "crates/router/src/core/authentication/utils.rs", "crates/router/src/core/payments/operations/payment_confirm.rs", "crates/router/src/core/unified_authentication_service.rs"], "other": ["crates/analytics/docs/clickhouse/scripts/authentications.sql", "crates/router/src/db/authentication.rs", "crates/router/src/services/kafka/authentication.rs", "crates/router/src/services/kafka/authentication_event.rs", "migrations/2025-01-30-111507_add_organization_id_in_authentication/down.sql", "migrations/2025-01-30-111507_add_organization_id_in_authentication/up.sql"]}, "change_types": {"fields_added": 10, "database_queries": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): add click to pay feature for trustpay
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
Closes this [issue](https://github.com/juspay/hyperswitch/issues/8297)
## Description
<!-- Describe your changes in detail -->
Added click to pay feature for Trustpay.
### 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)?
-->
Postman Test
1. Payment Connector - Create (Trustpay)
Request:
```
curl --location 'http://localhost:8080/account/merchant_1749546439/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: {{api-key}}' \
--data '{
"connector_type": "payment_processor",
"connector_name": "trustpay",
"connector_account_details": {
"auth_type": "SignatureKey",
"api_key": "API KEY",
"key1": "KEY1",
"api_secret": "API SECRET"
},
"test_mode": true,
"disabled": false,
"payment_methods_enabled": [
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "credit",
"card_networks": [
"Visa",
"Mastercard"
],
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true,
"accepted_countries": {
"type": "disable_only",
"list": [
"HK"
]
},
"accepted_currencies": {
"type": "enable_only",
"list": [
"USD",
"GBP",
"INR"
]
}
},
{
"payment_method_type": "debit",
"card_networks": [
"Visa",
"Mastercard"
],
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true,
"accepted_countries": {
"type": "disable_only",
"list": [
"HK"
]
},
"accepted_currencies": {
"type": "enable_only",
"list": [
"USD",
"GBP",
"INR"
]
}
}
]
},
{
"payment_method": "pay_later",
"payment_method_types": [
{
"payment_method_type": "klarna",
"payment_experience": "redirect_to_url",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "affirm",
"payment_experience": "redirect_to_url",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "afterpay_clearpay",
"payment_experience": "redirect_to_url",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
}
],
"metadata": {
"city": "NY",
"unit": "245"
},
"connector_webhook_details": {
"merchant_secret": "***"
},
"business_country": "US",
"business_label": "default"
}'
```
Response:
```
{
"connector_type": "payment_processor",
"connector_name": "trustpay",
"connector_label": "trustpay_US_default",
"merchant_connector_id": "mca_v8hmmeB14qT4cMdRVueZ",
"profile_id": "pro_xxUlbqufnXVCUkRP97xs",
"connector_account_details": {
"auth_type": "SignatureKey",
"api_key": "****************************************************",
"key1": "******",
"api_secret": "****************************"
},
"payment_methods_enabled": [
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "credit",
"payment_experience": null,
"card_networks": [
"Visa",
"Mastercard"
],
"accepted_currencies": {
"type": "enable_only",
"list": [
"USD",
"GBP",
"INR"
]
},
"accepted_countries": {
"type": "disable_only",
"list": [
"HK"
]
},
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "debit",
"payment_experience": null,
"card_networks": [
"Visa",
"Mastercard"
],
"accepted_currencies": {
"type": "enable_only",
"list": [
"USD",
"GBP",
"INR"
]
},
"accepted_countries": {
"type": "disable_only",
"list": [
"HK"
]
},
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "pay_later",
"payment_method_types": [
{
"payment_method_type": "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_type": "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_type": "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
}
]
}
],
"connector_webhook_details": {
"merchant_secret": "***",
"additional_secret": null
},
"metadata": {
"city": "NY",
"unit": "245"
},
"test_mode": true,
"disabled": false,
"frm_configs": null,
"business_country": "US",
"business_label": "default",
"business_sub_label": null,
"applepay_verified_domains": null,
"pm_auth_config": null,
"status": "active",
"additional_merchant_data": null,
"connector_wallets_details": null
}
```
2. Configs
Request:
```
curl --location 'http://localhost:8080/configs' \
--header 'Content-Type: application/json' \
--header 'api-key: {{api-key}}' \
--data '{
"key": "merchants_eligible_for_authentication_service",
"value": "[\"xyz\", \"merchant_1749546439\", \"dqwdwljildwduoqwhduwqcqwjd\"]"
}'
```
3. Create Merchant connector account for mastercard click to pay
Request:
```
curl --location 'http://localhost:8080/account/dqwdwljildwduoqwhduwqcqwjd/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: {{api-key}}' \
--data '
{
"connector_type": "authentication_processor",
"connector_name": "ctp_mastercard",
"connector_account_details": {
"auth_type": "HeaderKey",
"api_key": "API-KEY"
},
"test_mode": true,
"disabled": false,
"payment_methods_enabled": [
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "credit",
"card_networks": [
"Visa",
"Mastercard"
],
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "debit",
"card_networks": [
"Visa",
"Mastercard"
],
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
}
],
"business_country": "US",
"business_label": "default",
"metadata": {
"dpa_id": "DPA ID",
"dpa_name": "TestMerchant",
"locale": "en_AU",
"card_brands": ["mastercard", "visa"],
"acquirer_bin": "ACQUIRER BIN",
"acquirer_merchant_id": "ACQUIRER MERCHANT ID",
"merchant_category_code": "0001",
"merchant_country_code": "US"
}
}
'
```
Response:
```
{
"connector_type": "authentication_processor",
"connector_name": "ctp_mastercard",
"connector_label": "ctp_mastercard_US_default",
"merchant_connector_id": "mca_yHkNx6WMa6GXtoVq3ezk",
"profile_id": "pro_xxUlbqufnXVCUkRP97xs",
"connector_account_details": {
"auth_type": "HeaderKey",
"api_key": "********************************"
},
"payment_methods_enabled": [
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "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_type": "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
}
]
}
],
"connector_webhook_details": null,
"metadata": {
"dpa_id": "DPA ID",
"locale": "en_AU",
"dpa_name": "TestMerchant",
"card_brands": [
"mastercard",
"visa"
],
"acquirer_bin": "ACQUIRER BIN",
"acquirer_merchant_id": "ACQUIRER MERCHANT ID",
"merchant_country_code": "US",
"merchant_category_code": "0001"
},
"test_mode": true,
"disabled": false,
"frm_configs": null,
"business_country": "US",
"business_label": "default",
"business_sub_label": null,
"applepay_verified_domains": null,
"pm_auth_config": null,
"status": "active",
"additional_merchant_data": null,
"connector_wallets_details": null
}
```
4. Update business profile with ctp_mastercard mca_id
Request:
```
curl --location 'http://localhost:8080/account/merchant_1749546439/business_profile/pro_xxUlbqufnXVCUkRP97xs' \
--header 'Content-Type: application/json' \
--header 'api-key: {{api-key}}' \
--data '{
"is_click_to_pay_enabled": true,
"authentication_product_ids": {"click_to_pay": "mca_yHkNx6WMa6GXtoVq3ezk"}
}'
```
Response:
```
{
"merchant_id": "merchant_1749546439",
"profile_id": "pro_xxUlbqufnXVCUkRP97xs",
"profile_name": "US_default",
"return_url": "https://google.com/success",
"enable_payment_response_hash": true,
"payment_response_hash_key": "***",
"redirect_to_merchant_with_http_post": false,
"webhook_details": {
"webhook_version": "1.0.1",
"webhook_username": "***",
"webhook_password": "***",
"webhook_url": "https://webhook.site",
"payment_created_enabled": true,
"payment_succeeded_enabled": true,
"payment_failed_enabled": true
},
"metadata": null,
"routing_algorithm": null,
"intent_fulfillment_time": 900,
"frm_routing_algorithm": null,
"payout_routing_algorithm": null,
"applepay_verified_domains": null,
"session_expiry": 900,
"payment_link_config": null,
"authentication_connector_details": null,
"use_billing_as_payment_method_billing": true,
"extended_card_info_config": null,
"collect_shipping_details_from_wallet_connector": false,
"collect_billing_details_from_wallet_connector": false,
"always_collect_shipping_details_from_wallet_connector": false,
"always_collect_billing_details_from_wallet_connector": false,
"is_connector_agnostic_mit_enabled": false,
"payout_link_config": null,
"outgoing_webhook_custom_http_headers": null,
"tax_connector_id": null,
"is_tax_connector_enabled": false,
"is_network_tokenization_enabled": false,
"is_auto_retries_enabled": false,
"max_auto_retries_enabled": null,
"always_request_extended_authorization": null,
"is_click_to_pay_enabled": true,
"authentication_product_ids": {
"click_to_pay": "mca_yHkNx6WMa6GXtoVq3ezk"
},
"card_testing_guard_config": {
"card_ip_blocking_status": "disabled",
"card_ip_blocking_threshold": 3,
"guest_user_card_blocking_status": "disabled",
"guest_user_card_blocking_threshold": 10,
"customer_id_blocking_status": "disabled",
"customer_id_blocking_threshold": 5,
"card_testing_guard_expiry": 3600
},
"is_clear_pan_retries_enabled": false,
"force_3ds_challenge": false,
"is_debit_routing_enabled": false,
"merchant_business_country": null,
"is_pre_network_tokenization_enabled": false
}
```
5. Payments - Create
Request:
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: {{api-key}}' \
--data-raw '{
"amount": 1130,
"currency": "USD",
"confirm": false,
"return_url": "https://hyperswitch.io",
"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"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "guest@example.com"
}
}
'
```
Response:
```
{
"payment_id": "pay_1vu2W3eLWiCYnvO4xw9V",
"merchant_id": "merchant_1749541493",
"status": "requires_payment_method",
"amount": 1130,
"net_amount": 1130,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": null,
"client_secret": "pay_1vu2W3eLWiCYnvO4xw9V_secret_nnQEs4RBqKBpiajfzOyx",
"created": "2025-06-10T07:46:31.636Z",
"currency": "USD",
"customer_id": null,
"customer": null,
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": null,
"payment_method": null,
"payment_method_data": null,
"payment_token": null,
"shipping": 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": "guest@example.com"
},
"order_details": null,
"email": null,
"name": null,
"phone": null,
"return_url": "https://hyperswitch.io/",
"authentication_type": null,
"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": null,
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": null,
"connector_transaction_id": null,
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_MhKcVLclOBPMduS23UEE",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": null,
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-06-10T08:01:31.635Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-06-10T07:46:31.689Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": null,
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null
}
```
6. Payments - Confirm
Request:
```
curl --location 'http://localhost:8080/payments/pay_1vu2W3eLWiCYnvO4xw9V/confirm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: {{publishable-key}}' \
--data '
{
"payment_method": "card",
"payment_method_type": "debit",
"client_secret": "pay_1vu2W3eLWiCYnvO4xw9V_secret_nnQEs4RBqKBpiajfzOyx",
"ctp_service_details" : {
"merchant_transaction_id": "MERCHANT TRANSACTION ID",
"correlation_id": "CORRELATION ID",
"x_src_flow_id" : "X SRC FLOW ID"
},
"browser_info": {
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"color_depth": 24,
"java_enabled":true,
"java_script_enabled": true,
"language": "en-GB",
"screen_height": 1440,
"screen_width": 2560,
"time_zone": -330,
"user_agent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36"
}
}'
```
Response:
```
{
"payment_id": "pay_1vu2W3eLWiCYnvO4xw9V",
"merchant_id": "merchant_1749541493",
"status": "succeeded",
"amount": 1130,
"net_amount": 1130,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 1130,
"connector": "trustpay",
"client_secret": "pay_1vu2W3eLWiCYnvO4xw9V_secret_nnQEs4RBqKBpiajfzOyx",
"created": "2025-06-10T07:46:31.636Z",
"currency": "USD",
"customer_id": null,
"customer": null,
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": null,
"payment_method": "card",
"payment_method_data": null,
"payment_token": null,
"shipping": 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": "guest@example.com"
},
"order_details": null,
"email": null,
"name": null,
"phone": null,
"return_url": "https://hyperswitch.io/",
"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": "debit",
"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": "***",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_MhKcVLclOBPMduS23UEE",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_IlgCBX2F3GYYHdL0gqGj",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": {
"authentication_flow": null,
"electronic_commerce_indicator": "06",
"status": "success",
"ds_transaction_id": null,
"version": null,
"error_code": null,
"error_message": null
},
"external_3ds_authentication_attempted": false,
"expires_on": "2025-06-10T08:01:31.635Z",
"fingerprint": null,
"browser_info": {
"os_type": null,
"language": "en-GB",
"time_zone": -330,
"ip_address": "::1",
"os_version": null,
"user_agent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36",
"color_depth": 24,
"device_model": null,
"java_enabled": true,
"screen_width": 2560,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 1440,
"accept_language": "en",
"java_script_enabled": true
},
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-06-10T07:47:18.148Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": "click_to_pay",
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": 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
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **New Features**
- Added support for network token payments through Trustpay, including 3DSecure authentication and expiry date handling.
- Introduced standardized methods to format and retrieve two-digit expiry year and combined expiry month-year for network tokens.
- **Bug Fixes**
- Enhanced error handling for missing required fields in network token payment requests.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs`
- `crates/hyperswitch_connectors/src/utils.rs`
**Code Patterns Applied:**
- Define new data structures (1 changes)
- Implement new functions (6 changes)
- Extend existing types with new fields (22 changes)
**Detailed Identifier Changes:**
Commit 46709ae3:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/utils.rs**
Add:
- function: private::get_token_expiry_year_2_digit
- function: private::get_token_expiry_year_2_digit
- function: private::get_token_expiry_month_year_2_digit_with_delimiter
- function: private::get_token_expiry_month_year_2_digit_with_delimiter
|
{"pr_number": 8304, "pr_title": "feat(connector): add click to pay feature for trustpay", "merged_at": "2025-06-25T06:31:44Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs", "crates/hyperswitch_connectors/src/utils.rs"]}, "change_types": {"structs_added": 1, "functions_added": 6, "fields_added": 22}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): Introduce connector template code for Facilitapay
## 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 template code for new connector named `Facilitapay`.
Docs: https://sandbox-portal.facilitapay.com/#/docs
### 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`
-->
YES.
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).
-->
New connector -- Facilitapay
Closes #7630
## 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)?
-->
```sh
just clippy
cargo +nightly fmt --all
cargo c
```
Hyperswitch code base should compile.
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `just clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/configs.rs`
**2. Core Business Logic**
- `crates/router/src/core/admin.rs`
- `crates/router/src/core/payments/flows.rs`
**3. External Connector Integration**
- `crates/common_enums/src/connector_enums.rs`
- `crates/connector_configs/src/connector.rs`
- `crates/hyperswitch_connectors/src/connectors.rs`
- ... and 9 more files
**4. Type Definitions**
- `crates/router/src/types/api.rs`
- `crates/router/src/types/transformers.rs`
**5. Tests**
- `config/deployments/integration_test.toml`
- `loadtest/config/development.toml`
**6. Configuration Files**
- `config/config.example.toml`
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- ... and 2 more files
**Code Patterns Applied:**
- Define new data structures (10 changes)
- Implement new functions (78 changes)
- Extend existing types with new fields (155 changes)
**Detailed Identifier Changes:**
Commit f3d6b15a:
Files to modify:
**crates/common_enums/src/connector_enums.rs**
Modify existing code
**crates/connector_configs/src/connector.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors.rs**
Add:
- mod: pub::facilitapay
**crates/hyperswitch_connectors/src/connectors/facilitapay.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::Facilitapay
- impl: impl Facilitapay
- impl: impl api::Payment for Facilitapay
- impl: impl api::PaymentSession for Facilitapay
- impl: impl api::ConnectorAccessToken for Facilitapay
- impl: impl api::MandateSetup for Facilitapay
- impl: impl api::PaymentAuthorize for Facilitapay
- impl: impl api::PaymentSync for Facilitapay
- impl: impl api::PaymentCapture for Facilitapay
- impl: impl api::PaymentVoid for Facilitapay
- impl: impl api::Refund for Facilitapay
- impl: impl api::RefundExecute for Facilitapay
- impl: impl api::RefundSync for Facilitapay
- impl: impl api::PaymentToken for Facilitapay
- impl: impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData> for Facilitapay
- impl: impl ConnectorCommonExt<Flow, Request, Response> for Facilitapay
- impl: impl ConnectorCommon for Facilitapay
- impl: impl ConnectorValidation for Facilitapay
- impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Facilitapay
- impl: impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for Facilitapay
- impl: impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Facilitapay
- impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Facilitapay
- impl: impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Facilitapay
- impl: impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for Facilitapay
- impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Facilitapay
- impl: impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Facilitapay
- impl: impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Facilitapay
- impl: impl webhooks::IncomingWebhook for Facilitapay
- impl: impl ConnectorSpecifications for Facilitapay
- mod: pub::transformers
**crates/hyperswitch_connectors/src/connectors/facilitapay/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::FacilitapayRouterData
- struct: pub::FacilitapayPaymentsRequest
- struct: pub::FacilitapayCard
- struct: pub::FacilitapayAuthType
- struct: pub::FacilitapayPaymentsResponse
- struct: pub::FacilitapayRefundRequest
- struct: pub::RefundResponse
- struct: pub::FacilitapayErrorResponse
- enum: pub::FacilitapayPaymentStatus
- enum: pub::RefundStatus
- impl: impl From<(StringMinorUnit, T)> for FacilitapayRouterData<T>
- impl: impl TryFrom<&FacilitapayRouterData<&PaymentsAuthorizeRouterData>> for FacilitapayPaymentsRequest
- impl: impl TryFrom<&ConnectorAuthType> for FacilitapayAuthType
- impl: impl From<FacilitapayPaymentStatus> for common_enums::AttemptStatus
- impl: impl TryFrom<ResponseRouterData<F, FacilitapayPaymentsResponse, T, PaymentsResponseData>> for RouterData<F, T, PaymentsResponseData>
- impl: impl TryFrom<&FacilitapayRouterData<&RefundsRouterData<F>>> for FacilitapayRefundRequest
- 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_domain_models/src/configs.rs**
Modify existing code
**crates/router/src/connector.rs**
Modify existing code
**crates/router/src/core/admin.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/facilitapay.rs**
Add:
- 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::FacilitapayTest
- impl: impl ConnectorActions for FacilitapayTest
- impl: impl utils::Connector for FacilitapayTest
**crates/router/tests/connectors/main.rs**
Add:
- mod: private::facilitapay
**crates/test_utils/src/connector_auth.rs**
Modify existing code
|
{"pr_number": 7631, "pr_title": "feat(connector): Introduce connector template code for Facilitapay", "merged_at": "2025-03-27T13:33:42Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["connector"]}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/configs.rs"], "core_business": ["crates/router/src/core/admin.rs", "crates/router/src/core/payments/flows.rs"], "connectors": ["crates/common_enums/src/connector_enums.rs", "crates/connector_configs/src/connector.rs", "crates/hyperswitch_connectors/src/connectors.rs", "crates/hyperswitch_connectors/src/connectors/facilitapay.rs", "crates/hyperswitch_connectors/src/connectors/facilitapay/transformers.rs", "crates/hyperswitch_connectors/src/default_implementations.rs", "crates/hyperswitch_connectors/src/default_implementations_v2.rs", "crates/router/src/connector.rs", "crates/router/tests/connectors/facilitapay.rs", "crates/router/tests/connectors/main.rs", "crates/test_utils/src/connector_auth.rs", "scripts/add_connector.sh"], "types": ["crates/router/src/types/api.rs", "crates/router/src/types/transformers.rs"], "tests": ["config/deployments/integration_test.toml", "loadtest/config/development.toml"], "config": ["config/config.example.toml", "config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml"]}, "change_types": {"structs_added": 10, "functions_added": 78, "enums_added": 2, "fields_added": 155, "imports_added": 20}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(analytics): fix refund status filter on dashboard
## 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 -->
- Whenever `Refund Status` filter is applied on the analytics section on dashboard, errors are being generated.
- The wrong `RefundStatus` enum has been imported for the `RefundStatus` filter in `RefundFilters` struct in this PR: [https://github.com/juspay/hyperswitch/pull/2988](https://github.com/juspay/hyperswitch/pull/2988).
- Updated the code to use the correct `RefundStatus` import.
### 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).
-->
To fix the issue on dashboard whenever refund status filter is applied.
## 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)?
-->
- Apply the refund status filter on the dashboard
- Hit the curl:
```bash
curl --location 'http://localhost:8080/analytics/v1/org/metrics/refunds' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.9' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'Origin: http://localhost:9000' \
--header 'QueryType: SingleStatTimeseries' \
--header 'Referer: http://localhost:9000/' \
--header 'Sec-Fetch-Dest: empty' \
--header 'Sec-Fetch-Mode: cors' \
--header 'Sec-Fetch-Site: same-site' \
--header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36' \
--header 'api-key: dev_LZcIA7XeMpnK5satp4CDvjcnHCaeKTBcosyuBBJaknZu1odhFo96cwS0nSdfzuJF' \
--header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTQ5ZTNkMmItMTY5Yi00NzUzLWJmNTQtZDcxMTM2YjRiN2JkIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzI2MDQ2MzI4Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTcyOTkyOTAwOCwib3JnX2lkIjoib3JnX1ZwU0hPanNZZkR2YWJWWUpnQ0FKIiwicHJvZmlsZV9pZCI6InByb192NXNGb0hlODBPZWlVbElvbm9jTSJ9.B7sxut7HMs1C7QDRJWqOhQXHbugw4Ev3w8EAzskmzeo' \
--header 'sec-ch-ua: "Google Chrome";v="129", "Not=A?Brand";v="8", "Chromium";v="129"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--data '[
{
"timeRange": {
"startTime": "2024-10-16T18:30:00Z",
"endTime": "2024-10-24T13:17:00Z"
},
"timeSeries": {
"granularity": "G_ONEDAY"
},
"filters": {
"refund_status": ["success"]
},
"mode": "ORDER",
"source": "BATCH",
"metrics": [
"refund_success_rate",
"refund_count",
"refund_success_count",
"refund_processed_amount"
]
}
]'
```
Respoonse:
```bash
{
"queryData": [
{
"refund_success_rate": 100.0,
"refund_count": 1,
"refund_success_count": 1,
"refund_processed_amount": 600,
"currency": null,
"refund_status": null,
"connector": null,
"refund_type": null,
"profile_id": null,
"time_range": {
"start_time": "2024-10-24T00:00:00.000Z",
"end_time": "2024-10-24T23:00:00.000Z"
},
"time_bucket": "2024-10-24 00:00:00"
}
],
"metaData": [
{
"current_time_range": {
"start_time": "2024-10-16T18:30:00.000Z",
"end_time": "2024-10-24T13:17:00.000Z"
}
}
]
}
```
<img width="1332" alt="image" src="https://github.com/user-attachments/assets/bf8d08a6-e2e6-437c-884f-6de6c2bcaae3">
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/analytics/refunds.rs`
**Code Patterns Applied:**
**Detailed Identifier Changes:**
Commit d58f706d:
Files to modify:
**crates/api_models/src/analytics/refunds.rs**
Modify existing code
|
{"pr_number": 6431, "pr_title": "fix(analytics): fix refund status filter on dashboard", "merged_at": "2024-10-25T13:30:37Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user", "order", "refund"]}, "hierarchy": {"api_models": ["crates/api_models/src/analytics/refunds.rs"]}, "change_types": {"imports_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connector): GooglePay fixed in Ayden
## 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 -->
GooglePay fixed in Ayden
### 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)?
-->
<img width="1063" alt="Screenshot 2025-02-27 at 6 39 19 PM" src="https://github.com/user-attachments/assets/eead90cb-da62-4e5d-9ade-f8f0f2f2de19" />
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_Coa5dQU6Vo2ezZrfgvAlgmDed2NjJmuW1hTcmI5uMevC27Tkp4F16r5Om4HEb9UU' \
--data-raw '{
"amount": 6540,
"currency": "USD",
"amount_to_capture": 6540,
"confirm": true,
"profile_id": null,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"authentication_type": "three_ds",
"setup_future_usage": "on_session",
"customer": {
"id": "customer123",
"name": "John Doe",
"email": "customer@gmail.com",
"phone": "9999999999",
"phone_country_code": "+1"
},
"customer_id": "customer123",
"phone_country_code": "+1",
"routing": {
"type": "single",
"data": "stripe"
},
"description": "Its my first payment request",
"return_url": "https://google.com",
"payment_method": "wallet",
"payment_method_type": "google_pay",
"payment_method_data": {
"wallet": {
"google_pay": {
"type": "CARD",
"description": "Amex •••• 0002",
"info": {
"assurance_details": {
"account_verified": true,
"card_holder_authenticated": false
},
"card_details": "0002",
"card_network": "AMEX"
},
"tokenization_data": {
"token": "{\"signature\":\"MEYCIQC7ferzG3SQgMMoJ18frh9oLAdQigN4jTAeAlx26IoCawIhAIL/6we459IuANws+AeNbeU5+eBnscy7FBjaANj9lJmd\",\"protocolVersion\":\"ECv1\",\"signedMessage\":\"{\\\"encryptedMessage\\\":\\\"VFe6XC/1MKP2O9ETH6Uv/NUe0MtyHjAe0uqDsZ3b1jtUw/crQ+LIAEhgFt0+B2r6pqJdg56yYzZ4nuuEiIVMvgDtMr6Lz8bHRDv620RSFT+lfZOHFAX0JtKAzUSbfzR50tnMFAlBEPBfOKCGVKboA0g2dfQhfhyYFX5pqgEM8rg0/YHl5FPpfSH1ZaZQxM/PXwF/ju84zB9doOVyYyT6/jUtnoW6FmGChVZPSuV3o++y9Q+lOEGTjOEQTsLrWtqiRit3atkiLguzo57xrK6TE9hK6+3XXv8o/7gbBQPaxlXYWSbjRK4mHkOmkC0LTSiPVvJkKlY0SHMjKz85jwcttWs3LgPSHkKkFv+VM4vQiXIjAbmX1KMfgbLcEVNfAWL+/j/IwSif66DVakkO277KcsVhpQC2y/p/1VMTDtg45guT2kMVJsqQORumwJPvYumVgpwIFmlg5uDKo7j0ioyeagp67lBdhZbsyvyJsyzFbSCyGoXaFCJbYqNQIVl8ioFuCIe50ePc79Mkxony\\\",\\\"ephemeralPublicKey\\\":\\\"BBWzyB4tX5yqOEDaryLLlX9h91M2298ChS0lYgHLbXwN/eEh0V8w2PX/psg12dY2do2ksP2NA3be/e+9NhvTlU0\\\\u003d\\\",\\\"tag\\\":\\\"123ZOhok0+5uiBUYaO3i5U/h73+YsXPbwK8IhinHVl8\\\\u003d\\\"}\"}",
"type": "PAYMENT_GATEWAY"
}
}
}
},
"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"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "guest@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"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "guest@example.com"
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"order_details": [
{
"product_name": "Apple iphone 15",
"quantity": 1,
"amount": 6540,
"account_name": "transaction_processing"
}
],
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"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": "128.0.0.1"
},
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "125.0.0.1",
"user_agent": "amet irure esse"
}
},
"connector_metadata": {
"noon": {
"order_category": "pay"
}
},
"payment_link": false,
"payment_link_config": {
"theme": "",
"logo": "",
"seller_name": "",
"sdk_layout": "",
"display_sdk_only": false,
"enabled_saved_payment_method": false
},
"payment_type": "normal",
"request_incremental_authorization": false,
"merchant_order_reference_id": "test_ord",
"session_expiry": 900
}'
```
Response
```
{
"payment_id": "pay_BHtu7Av3hbxF6YGyNg6y",
"merchant_id": "merchant_1740661643",
"status": "succeeded",
"amount": 6540,
"net_amount": 6540,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 6540,
"connector": "adyen",
"client_secret": "pay_BHtu7Av3hbxF6YGyNg6y_secret_Ta6ChMs3WiuxCppvsKm8",
"created": "2025-02-27T13:07:38.606Z",
"currency": "USD",
"customer_id": "customer123",
"customer": {
"id": "customer123",
"name": "John Doe",
"email": "customer@gmail.com",
"phone": "9999999999",
"phone_country_code": "+1"
},
"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": "wallet",
"payment_method_data": {
"wallet": {
"google_pay": {
"last4": "0002",
"card_network": "AMEX",
"type": "CARD"
}
},
"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": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "guest@example.com"
},
"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": "guest@example.com"
},
"order_details": [
{
"brand": null,
"amount": 6540,
"category": null,
"quantity": 1,
"tax_rate": null,
"product_id": null,
"product_name": "Apple iphone 15",
"product_type": null,
"sub_category": null,
"product_img_link": null,
"product_tax_code": null,
"total_tax_amount": null,
"requires_shipping": null
}
],
"email": "customer@gmail.com",
"name": "John Doe",
"phone": "9999999999",
"return_url": "https://google.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": "google_pay",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "customer123",
"created_at": 1740661658,
"expires": 1740665258,
"secret": "epk_fa7ee7a7801840348e3e6f6e6f20adf3"
},
"manual_retry_allowed": false,
"connector_transaction_id": "LMSBT86ZTGGNFL75",
"frm_message": null,
"metadata": {
"udf1": "value1",
"login_date": "2019-09-10T10:11:12Z",
"new_customer": "true"
},
"connector_metadata": {
"apple_pay": null,
"airwallex": null,
"noon": {
"order_category": "pay"
}
},
"feature_metadata": null,
"reference_id": "pay_BHtu7Av3hbxF6YGyNg6y_1",
"payment_link": null,
"profile_id": "pro_5CrLzkPfIhQSZT0e92na",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_kc9GbBR2tswsauYa0J2O",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-02-27T13:22:38.605Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "128.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": "2025-02-27T13:07:40.697Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": "test_ord",
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/router/src/connector/adyen/transformers.rs`
**Detailed Identifier Changes:**
Commit 96a11ac1:
Files to modify:
**crates/router/src/connector/adyen/transformers.rs**
Modify existing code
|
{"pr_number": 7393, "pr_title": "fix(connector): GooglePay fixed in Ayden ", "merged_at": "2025-03-03T07:51:16Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/router/src/connector/adyen/transformers.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(dashboard_metadata): Add `ReconStatus` in `dashboard_metadata`
## 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 -->
This PR will add a new variant in Dashboard Metadata for storing the recon state.
### Additional Changes
- [x] This PR modifies the API contract
- [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`
-->
## 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).
-->
Closes [#2647](https://github.com/juspay/hyperswitch-control-center/issues/2647)
## 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)?
-->
```bash
curl --location 'http://localhost:8080/user/data' \
--header 'Content-Type: application/json' \
--header 'Authorization: User JWT' \
--data '{
"ReconStatus": {
"is_order_data_set": true,
"is_processor_data_set": true
}
}'
```
The above API will give 200 OK.
```bash
curl --location 'http://localhost:8080/user/data?keys=ReconStatus' \
--header 'Authorization: User JWT'
```
Response:
```json
{
"ReconStatus": {
"is_order_data_set": true,
"is_processor_data_set": true
}
}
```
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/user/dashboard_metadata.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/enums.rs`
**3. Core Business Logic**
- `crates/router/src/core/user/dashboard_metadata.rs`
**4. Type Definitions**
- `crates/router/src/types/domain/user/dashboard_metadata.rs`
**5. Utils**
- `crates/router/src/utils/user/dashboard_metadata.rs`
**6. Other**
- `migrations/2025-03-21-113624_add-recon-status-enum-variant-dashboard-metadata/down.sql`
- `migrations/2025-03-21-113624_add-recon-status-enum-variant-dashboard-metadata/up.sql`
**Code Patterns Applied:**
- Define new data structures (1 changes)
- Extend existing types with new fields (2 changes)
- Add conditional logic for feature flags or filtering (1 changes)
- Modify database queries (1 changes)
**Detailed Identifier Changes:**
Commit 7b275ec4:
Files to modify:
**crates/api_models/src/user/dashboard_metadata.rs**
Add:
- struct: pub::ReconStatus
**crates/diesel_models/src/enums.rs**
Modify existing code
**crates/router/src/core/user/dashboard_metadata.rs**
Modify existing code
**crates/router/src/types/domain/user/dashboard_metadata.rs**
Modify existing code
**crates/router/src/utils/user/dashboard_metadata.rs**
Modify existing code
|
{"pr_number": 7595, "pr_title": "feat(dashboard_metadata): Add `ReconStatus` in `dashboard_metadata`", "merged_at": "2025-03-26T10:26:02Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user", "order"]}, "hierarchy": {"api_models": ["crates/api_models/src/user/dashboard_metadata.rs"], "database": ["crates/diesel_models/src/enums.rs"], "core_business": ["crates/router/src/core/user/dashboard_metadata.rs"], "types": ["crates/router/src/types/domain/user/dashboard_metadata.rs"], "utils": ["crates/router/src/utils/user/dashboard_metadata.rs"], "other": ["migrations/2025-03-21-113624_add-recon-status-enum-variant-dashboard-metadata/down.sql", "migrations/2025-03-21-113624_add-recon-status-enum-variant-dashboard-metadata/up.sql"]}, "change_types": {"structs_added": 1, "fields_added": 2, "conditionals_added": 1, "database_queries": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(users): Make `profile_id` in the JWT non-optional
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
- Currently `profile_id` in the JWT is optional, this PR makes it non-optional.
### 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).
-->
Closes #6534.
## 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 is a internal change and it should not affect any APIs.
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/query/user_role.rs`
**2. Core Business Logic**
- `crates/router/src/core/user.rs`
- `crates/router/src/core/user_role.rs`
**3. Type Definitions**
- `crates/router/src/types/domain/user/decision_manager.rs`
**4. Utils**
- `crates/router/src/utils/user.rs`
**5. Other**
- `crates/router/src/db/kafka_store.rs`
- `crates/router/src/db/user_role.rs`
- `crates/router/src/services/authentication.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (30 changes)
- Add conditional logic for feature flags or filtering (3 changes)
- Modify database queries (9 changes)
**Detailed Identifier Changes:**
Commit d32397f0:
Files to modify:
**crates/diesel_models/src/query/user_role.rs**
Modify existing code
**crates/router/src/core/user.rs**
Modify existing code
**crates/router/src/core/user_role.rs**
Modify existing code
**crates/router/src/db/kafka_store.rs**
Modify existing code
**crates/router/src/db/user_role.rs**
Modify existing code
**crates/router/src/services/authentication.rs**
Modify existing code
**crates/router/src/types/domain/user/decision_manager.rs**
Modify existing code
**crates/router/src/utils/user.rs**
Modify existing code
|
{"pr_number": 6537, "pr_title": "refactor(users): Make `profile_id` in the JWT non-optional", "merged_at": "2024-11-18T07:57:18Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"database": ["crates/diesel_models/src/query/user_role.rs"], "core_business": ["crates/router/src/core/user.rs", "crates/router/src/core/user_role.rs"], "types": ["crates/router/src/types/domain/user/decision_manager.rs"], "utils": ["crates/router/src/utils/user.rs"], "other": ["crates/router/src/db/kafka_store.rs", "crates/router/src/db/user_role.rs", "crates/router/src/services/authentication.rs"]}, "change_types": {"fields_added": 30, "conditionals_added": 3, "database_queries": 9}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(payment-method): api contract change for confirm with hs vault token
## 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 -->
api contract change for confirm with hs vault token
### 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/payments.rs`
**2. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/payment_method_data.rs`
**3. Core Business Logic**
- `crates/router/src/core/payments/helpers.rs`
- `crates/router/src/core/payments/operations/payment_confirm_intent.rs`
**4. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/aci/transformers.rs`
- `crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs`
- `crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs`
- ... and 53 more files
**5. Type Definitions**
- `crates/router/src/types/transformers.rs`
**Code Patterns Applied:**
- Implement new functions (1 changes)
- Extend existing types with new fields (3 changes)
|
{"pr_number": 8624, "pr_title": "feat(payment-method): api contract change for confirm with hs vault token", "merged_at": "2025-07-13T11:06:02Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["token"]}, "hierarchy": {"api_models": ["crates/api_models/src/payments.rs"], "domain": ["crates/hyperswitch_domain_models/src/payment_method_data.rs"], "core_business": ["crates/router/src/core/payments/helpers.rs", "crates/router/src/core/payments/operations/payment_confirm_intent.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/aci/transformers.rs", "crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs", "crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs", "crates/hyperswitch_connectors/src/connectors/archipel/transformers.rs", "crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs", "crates/hyperswitch_connectors/src/connectors/bambora/transformers.rs", "crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs", "crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs", "crates/hyperswitch_connectors/src/connectors/billwerk/transformers.rs", "crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs", "crates/hyperswitch_connectors/src/connectors/boku/transformers.rs", "crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs", "crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs", "crates/hyperswitch_connectors/src/connectors/cryptopay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs", "crates/hyperswitch_connectors/src/connectors/datatrans/transformers.rs", "crates/hyperswitch_connectors/src/connectors/dlocal/transformers.rs", "crates/hyperswitch_connectors/src/connectors/facilitapay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/fiserv/transformers.rs", "crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs", "crates/hyperswitch_connectors/src/connectors/forte/transformers.rs", "crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs", "crates/hyperswitch_connectors/src/connectors/helcim/transformers.rs", "crates/hyperswitch_connectors/src/connectors/iatapay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/itaubank/transformers.rs", "crates/hyperswitch_connectors/src/connectors/jpmorgan/transformers.rs", "crates/hyperswitch_connectors/src/connectors/klarna.rs", "crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs", "crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs", "crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs", "crates/hyperswitch_connectors/src/connectors/noon/transformers.rs", "crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs", "crates/hyperswitch_connectors/src/connectors/opayo/transformers.rs", "crates/hyperswitch_connectors/src/connectors/payeezy/transformers.rs", "crates/hyperswitch_connectors/src/connectors/payme/transformers.rs", "crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs", "crates/hyperswitch_connectors/src/connectors/placetopay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/powertranz/transformers.rs", "crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs", "crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs", "crates/hyperswitch_connectors/src/connectors/square/transformers.rs", "crates/hyperswitch_connectors/src/connectors/stax/transformers.rs", "crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs", "crates/hyperswitch_connectors/src/connectors/trustpay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/tsys/transformers.rs", "crates/hyperswitch_connectors/src/connectors/volt/transformers.rs", "crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs", "crates/hyperswitch_connectors/src/connectors/worldline/transformers.rs", "crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/zen/transformers.rs", "crates/hyperswitch_connectors/src/connectors/zsl/transformers.rs", "crates/hyperswitch_connectors/src/utils.rs", "crates/router/src/connector/utils.rs"], "types": ["crates/router/src/types/transformers.rs"]}, "change_types": {"functions_added": 1, "enums_added": 2, "fields_added": 3}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
feat(connector): [fiuu] Add support for payment and refund 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 -->
Add support for payment and refund webhooks
note: Needs dashboard wasm deployment to test in sandbox.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] 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 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 cases :
**Payment Webhooks**
<details>
<summary>Create payment(curl ) </summary>
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_b8UHhFyzeGg5ftn9f6oGstBF6gWmxtrCpvWaj6KL7dj9NSBeSmHS9q9Mg5UU7d7O' \
--data-raw '{
"amount":100,
"currency": "MYR",
"confirm": true,
"payment_link" : false,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 100,
"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://google.com",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "5105105105105100",
"card_exp_month": "12",
"card_exp_year": "2030",
"card_holder_name": "Max Mustermann",
"card_cvc": "444"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "CA",
"line3": "CA",
"city": "Musterhausen",
"state": "California",
"zip": "12345",
"country": "MY",
"first_name": "Max",
"last_name": "Mustermann"
},
"email": "test@novalnet.de",
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"shipping": {
"address": {
"line1": "Musterstr",
"line2": "CA",
"line3": "CA",
"city": "Musterhausen",
"state": "California",
"zip": "94122",
"country": "MY",
"first_name": "joseph",
"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,
"ip_address": "103.77.139.95",
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}'
```
response
```
{
"payment_id": "pay_Im39Mej9j58nwAHKDNyd",
"merchant_id": "merchant_1728366259",
"status": "processing",
"amount": 100,
"net_amount": 100,
"amount_capturable": 0,
"amount_received": null,
"connector": "fiuu",
"client_secret": "pay_Im39Mej9j58nwAHKDNyd_secret_ASusk2VbfGl5hwOMrRjD",
"created": "2024-10-15T08:25:44.957Z",
"currency": "MYR",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+1"
},
"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": "5100",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "510510",
"card_extended_bin": null,
"card_exp_month": "12",
"card_exp_year": "2030",
"card_holder_name": null,
"payment_checks": null,
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": {
"address": {
"city": "Musterhausen",
"country": "MY",
"line1": "Musterstr",
"line2": "CA",
"line3": "CA",
"zip": "94122",
"state": "California",
"first_name": "joseph",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": null
},
"billing": {
"address": {
"city": "Musterhausen",
"country": "MY",
"line1": "1467",
"line2": "CA",
"line3": "CA",
"zip": "12345",
"state": "California",
"first_name": "Max",
"last_name": "Mustermann"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "test@novalnet.de"
},
"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": 1728980744,
"expires": 1728984344,
"secret": "epk_db79053f1d12419496081948424ed1ad"
},
"manual_retry_allowed": false,
"connector_transaction_id": "30886384",
"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_OQKAbm8s3bQTKQbYxfnj",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_8Am6c072Z9KWAA9lCKds",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-10-15T08:40:44.957Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 0,
"ip_address": "103.77.139.95",
"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-10-15T08:25:53.397Z",
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
</details>
<details> <summary> source verification = true & status update in db </summary>
<img width="959" alt="Screenshot 2024-10-15 at 1 56 38 PM" src="https://github.com/user-attachments/assets/7ef28978-0688-4210-858e-6a40fda24aee">
<img width="945" alt="Screenshot 2024-10-15 at 1 57 37 PM" src="https://github.com/user-attachments/assets/ac20c41d-3c13-4783-ad2c-e42cdedce013">
</details>
With source verification false, it should call the connector psync and update the status .
**Refund Webhooks**
With source verification true it will update status as above.
<details>
Refund Webhooks
<summary>refund create </summary>
```
curl --location 'http://localhost:8080/refunds' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_b8UHhFyzeGg5ftn9f6oGstBF6gWmxtrCpvWaj6KL7dj9NSBeSmHS9q9Mg5UU7d7O' \
--data '{
"payment_id": "pay_k21bxXbtTb3h8593OqOa",
"amount": 100,
"reason": "Customer returned product",
"refund_type": "instant",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}'
```
</details>
<details>
<summary>refund webhook logs </summary>
For source verification = false
<img width="649" alt="Screenshot 2024-10-15 at 1 31 30 PM" src="https://github.com/user-attachments/assets/f473cdef-9856-4861-b479-2432d9b3673a">
<img width="664" alt="Screenshot 2024-10-15 at 1 32 04 PM" src="https://github.com/user-attachments/assets/0fe98d08-6344-4a8f-93e0-f3e2e6d5a44d">
</details>
<details>
<summary>Status update in DB</summary>
<img width="668" alt="Screenshot 2024-10-15 at 1 38 10 PM" src="https://github.com/user-attachments/assets/13c4add5-138a-4852-a102-2ffb8301bb6f">
</details>
Behaviour when source verification is false it will call the connector(Psync) and update the status
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/connector_configs/toml/development.toml`
- `crates/connector_configs/toml/production.toml`
- `crates/connector_configs/toml/sandbox.toml`
- ... and 2 more files
**Code Patterns Applied:**
- Define new data structures (6 changes)
- Implement new functions (9 changes)
- Extend existing types with new fields (76 changes)
**Detailed Identifier Changes:**
Commit d04a87be:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/fiuu.rs**
Add:
- function: private::get_webhook_source_verification_algorithm
- function: private::get_webhook_source_verification_signature
- function: private::get_webhook_source_verification_message
- function: private::get_webhook_object_reference_id
**crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs**
Add:
- function: private::from
- function: private::from
- function: private::from
- function: private::from
- struct: pub::FiuuWebhooksPaymentResponse
- struct: pub::FiuuWebhooksRefundResponse
- struct: pub::FiuuWebhookSignauture
- struct: pub::FiuuWebhookResourceId
- struct: pub::FiuWebhookEvent
- enum: pub::FiuuPaymentResponse
- enum: pub::FiuuWebhooksResponse
- enum: pub::FiuuRefundsWebhookStatus
- enum: pub::FiuuWebhooksRefundType
- enum: pub::FiuuPaymentWebhookStatus
- impl: impl TryFrom<PaymentsSyncResponseRouterData<FiuuPaymentResponse>> for PaymentsSyncRouterData
- impl: impl From<FiuuPaymentWebhookStatus> for StatCode
- impl: impl From<FiuuPaymentWebhookStatus> for api_models::webhooks::IncomingWebhookEvent
- impl: impl From<FiuuRefundsWebhookStatus> for api_models::webhooks::IncomingWebhookEvent
- impl: impl From<FiuuRefundsWebhookStatus> for enums::RefundStatus
|
{"pr_number": 6315, "pr_title": "feat(connector): [fiuu] Add support for payment and refund webhooks", "merged_at": "2024-10-16T14:17:04Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml", "crates/hyperswitch_connectors/src/connectors/fiuu.rs", "crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs"]}, "change_types": {"structs_added": 6, "functions_added": 9, "enums_added": 5, "fields_added": 76, "imports_added": 4}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): [AFFIRM] BNPL flow added (Alpha)
## 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 -->
BNPL flow added for affirm connector.
Only added mock server for affirm and not cypress because BNPL is currently not supported in cypress.
### 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)?
-->
This is an alpha connector, also cypress doen't support pay_later PMs as of now.
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/connector_validation.rs`
**2. External Connector Integration**
- `crates/common_enums/src/connector_enums.rs`
- `crates/connector_configs/src/connector.rs`
- `crates/connector_configs/toml/development.toml`
- ... and 7 more files
**3. Type Definitions**
- `crates/router/src/types/api/feature_matrix.rs`
**4. Tests**
- `config/deployments/integration_test.toml`
- `cypress-tests/cypress/e2e/configs/mock-server/Connectors/Affirm.ts`
- `cypress-tests/cypress/e2e/configs/mock-server/Creds.json`
- ... and 2 more files
**5. Configuration Files**
- `config/config.example.toml`
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- ... and 2 more files
**6. Other**
- `api-reference/v1/openapi_spec_v1.json`
- `api-reference/v2/openapi_spec_v2.json`
**Code Patterns Applied:**
- Define new data structures (20 changes)
- Implement new functions (28 changes)
- Extend existing types with new fields (444 changes)
- Add conditional logic for feature flags or filtering (15 changes)
**Detailed Identifier Changes:**
Commit ad247b76:
Files to modify:
**crates/common_enums/src/connector_enums.rs**
Modify existing code
**crates/connector_configs/src/connector.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/affirm.rs**
Remove:
- impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Affirm
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
- impl: impl api::PaymentsCompleteAuthorize for Affirm
- impl: impl ConnectorIntegration<CompleteAuthorize, CompleteAuthorizeData, PaymentsResponseData> for Affirm
- impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Affirm
**crates/hyperswitch_connectors/src/connectors/affirm/transformers.rs**
Add:
- function: private::from
- function: private::try_from
- function: private::try_from
- function: private::try_from
- function: private::try_from
- struct: pub::AffirmCompleteAuthorizeRequest
- struct: pub::Merchant
- struct: pub::Item
- struct: pub::Shipping
- struct: pub::Billing
- struct: pub::Name
- struct: pub::Address
- struct: pub::Metadata
- struct: pub::TransactionEvent
- struct: pub::LoanInformation
- struct: pub::LoanFees
- struct: pub::AffirmPSyncResponse
- struct: pub::AffirmRsyncResponse
- struct: pub::AffirmCancelRequest
- struct: pub::AffirmCancelResponse
- enum: pub::AffirmTransactionStatus
- enum: pub::AffirmRefundStatus
- enum: pub::AffirmResponseWrapper
- impl: impl From<(MinorUnit, T)> for AffirmRouterData<T>
- impl: impl TryFrom<&PaymentsCompleteAuthorizeRouterData> for AffirmCompleteAuthorizeRequest
- impl: impl TryFrom<&PaymentsCancelRouterData> for AffirmCancelRequest
- impl: impl TryFrom<ResponseRouterData<F, AffirmCancelResponse, PaymentsCancelData, PaymentsResponseData>> for RouterData<F, PaymentsCancelData, PaymentsResponseData>
**crates/hyperswitch_connectors/src/default_implementations.rs**
Modify existing code
**crates/router/src/core/connector_validation.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/src/types/connector_transformers.rs**
Modify existing code
|
{"pr_number": 8795, "pr_title": "feat(connector): [AFFIRM] BNPL flow added (Alpha)", "merged_at": "2025-08-24T20:12:21Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["connector"]}, "hierarchy": {"core_business": ["crates/router/src/core/connector_validation.rs"], "connectors": ["crates/common_enums/src/connector_enums.rs", "crates/connector_configs/src/connector.rs", "crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml", "crates/hyperswitch_connectors/src/connectors/affirm.rs", "crates/hyperswitch_connectors/src/connectors/affirm/transformers.rs", "crates/hyperswitch_connectors/src/default_implementations.rs", "crates/router/src/types/api/connector_mapping.rs", "crates/router/src/types/connector_transformers.rs"], "types": ["crates/router/src/types/api/feature_matrix.rs"], "tests": ["config/deployments/integration_test.toml", "cypress-tests/cypress/e2e/configs/mock-server/Connectors/Affirm.ts", "cypress-tests/cypress/e2e/configs/mock-server/Creds.json", "cypress-tests/cypress/e2e/configs/mock-server/router.ts", "loadtest/config/development.toml"], "config": ["config/config.example.toml", "config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml"], "other": ["api-reference/v1/openapi_spec_v1.json", "api-reference/v2/openapi_spec_v2.json"]}, "change_types": {"structs_added": 20, "functions_added": 28, "enums_added": 4, "fields_added": 444, "imports_added": 7, "conditionals_added": 15}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(payments): update error handling for payment void v2
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Add error details when payment void is failed at connector level and update the status accordingly.
### 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)?
-->
Request:
```
curl --location 'http://localhost:8080/v2/payments/12345_pay_01999518b93e7d92bf68807c23919ddd/cancel' \
--header 'X-Profile-Id: pro_qBLZYRTYcOoyu0qPg4Nn' \
--header 'X-Merchant-Id: cloth_seller_nG8IQZGXCrxMkMyNF6oL' \
--header 'Authorization: api-key=dev_JqT4NtSwFvhxcBGkuWyDTIHvC7tkwp63QoyATDSxZ5X6PzudKWtOkzbJJvwZuRl3' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_JqT4NtSwFvhxcBGkuWyDTIHvC7tkwp63QoyATDSxZ5X6PzudKWtOkzbJJvwZuRl3' \
--data '{
"cancellation_reason": "duplicat"
}'
```
Response:
```
{
"id": "12345_pay_01999518b93e7d92bf68807c23919ddd",
"status": "failed",
"cancellation_reason": "duplicat",
"amount": {
"order_amount": 10000,
"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": 10000,
"amount_to_capture": null,
"amount_capturable": 0,
"amount_captured": 0
},
"customer_id": "12345_cus_019995055fdd795190c715dccfbcdef4",
"connector": "stripe",
"created": "2025-09-29T10:50:49.594Z",
"payment_method_type": "card",
"payment_method_subtype": "credit",
"attempts": null,
"return_url": null,
"error": {
"code": "No error code",
"message": "No error message",
"reason": "Invalid cancellation_reason: must be one of duplicate, fraudulent, requested_by_customer, or abandoned",
"unified_code": null,
"unified_message": null,
"network_advice_code": null,
"network_decline_code": null,
"network_error_message": null
}
}
```
Request:
```
curl --location 'http://localhost:8080/v2/payments/12345_pay_0199951c2f4274b3b5a2825b0849a279/cancel' \
--header 'X-Profile-Id: pro_qBLZYRTYcOoyu0qPg4Nn' \
--header 'X-Merchant-Id: cloth_seller_nG8IQZGXCrxMkMyNF6oL' \
--header 'Authorization: api-key=dev_JqT4NtSwFvhxcBGkuWyDTIHvC7tkwp63QoyATDSxZ5X6PzudKWtOkzbJJvwZuRl3' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_JqT4NtSwFvhxcBGkuWyDTIHvC7tkwp63QoyATDSxZ5X6PzudKWtOkzbJJvwZuRl3' \
--data '{
"cancellation_reason": "duplicate"
}'
```
Response:
```
{
"id": "12345_pay_0199951c2f4274b3b5a2825b0849a279",
"status": "cancelled",
"cancellation_reason": "duplicate",
"amount": {
"order_amount": 10000,
"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": 10000,
"amount_to_capture": null,
"amount_capturable": 10000,
"amount_captured": 0
},
"customer_id": "12345_cus_019995055fdd795190c715dccfbcdef4",
"connector": "stripe",
"created": "2025-09-29T10:54:36.366Z",
"payment_method_type": "card",
"payment_method_subtype": "credit",
"attempts": null,
"return_url": null,
"error": null
}
```
closes #9616
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/payments.rs`
**2. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/router_data.rs`
- `crates/hyperswitch_domain_models/src/router_data_v2/flow_common_types.rs`
**3. Core Business Logic**
- `crates/router/src/core/payments/transformers.rs`
**4. Other**
- `api-reference/v2/openapi_spec_v2.json`
- `crates/hyperswitch_interfaces/src/conversion_impls.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (20 changes)
**Detailed Identifier Changes:**
Commit e2ed289f:
Files to modify:
**crates/api_models/src/payments.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_data.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_data_v2/flow_common_types.rs**
Modify existing code
**crates/hyperswitch_interfaces/src/conversion_impls.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
|
{"pr_number": 9595, "pr_title": "fix(payments): update error handling for payment void v2", "merged_at": "2025-10-07T08:22:58Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/payments.rs"], "domain": ["crates/hyperswitch_domain_models/src/router_data.rs", "crates/hyperswitch_domain_models/src/router_data_v2/flow_common_types.rs"], "core_business": ["crates/router/src/core/payments/transformers.rs"], "other": ["api-reference/v2/openapi_spec_v2.json", "crates/hyperswitch_interfaces/src/conversion_impls.rs"]}, "change_types": {"fields_added": 20}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(router): Move Customer PML endpoint to OLAP (v2)
## 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 -->
Moved customer saved PML route to OLAP in v2
### 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).
-->
Closes #8302
## 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)?
-->
Verified as working. No change in response.
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Other**
- `crates/router/src/routes/app.rs`
**Detailed Identifier Changes:**
Commit aee3f644:
Files to modify:
**crates/router/src/routes/app.rs**
Modify existing code
|
{"pr_number": 8303, "pr_title": "fix(router): Move Customer PML endpoint to OLAP (v2)", "merged_at": "2025-06-18T08:23:04Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer"]}, "hierarchy": {"other": ["crates/router/src/routes/app.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(core): Add network_transaction_id 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
<!-- Describe your changes in detail -->
Database Changes:
Added network_transaction_id column (VARCHAR(255), nullable) to the payment_attempt table via migration 2025-08-20-095434_add_ntid_in_attempt_table.
Added get_network_transaction_id method to PaymentsResponseData in crates/hyperswitch_domain_models/src/router_response_types.rs to extract network_transaction_id from transaction responses.
### Additional Changes
- [ ] This PR modifies the API contract
- [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`
-->
## 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)?
-->
For CIT Transaction:
Request:
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_DD2unr7vk4xDt33fxLlCT7JRyc5lX0ffC5fSLUo8Qrwcz4MLzt55T8jnBzveIgLs' \
--data-raw '{
"amount": 1000,
"currency": "USD",
"amount_to_capture": 1000,
"customer_id":"131123",
"confirm": true,
"capture_method": "automatic",
"setup_future_usage": "off_session",
"authentication_type": "no_three_ds",
"payment_method": "card",
"payment_method_type": "credit",
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "in sit",
"user_agent": "amet irure esse"
}
},
"email": "guest@example.com",
"payment_method_data": {
"card": {
"card_number": "5404000000000001",
"card_exp_month": "09",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"card_cvc": "123"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "Zurich",
"state": "asd",
"zip": "8008",
"country": "CH",
"first_name": "joseph",
"last_name": "Doe",
"origin_zip":"43234"
}
}
}'
```
Response
```
{
"payment_id": "pay_SdL4iUqO5d7j0FzJYU65",
"merchant_id": "merchant_1755880712",
"status": "processing",
"amount": 1000,
"net_amount": 1000,
"shipping_cost": null,
"amount_capturable": 1000,
"amount_received": null,
"connector": "worldpayvantiv",
"client_secret": "pay_SdL4iUqO5d7j0FzJYU65_secret_yKgYTJrT0zHhYi5JruGO",
"created": "2025-08-22T16:44:09.334Z",
"currency": "USD",
"customer_id": "131123",
"customer": {
"id": "131123",
"name": null,
"email": "guest@example.com",
"phone": null,
"phone_country_code": null
},
"description": null,
"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": "0001",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "540400",
"card_extended_bin": null,
"card_exp_month": "09",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"payment_checks": {
"avs_result": "00",
"advanced_a_v_s_result": null,
"authentication_result": null,
"card_validation_result": "M"
},
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": {
"address": {
"city": "Zurich",
"country": "CH",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "8008",
"state": "asd",
"first_name": "joseph",
"last_name": "Doe",
"origin_zip": "43234"
},
"phone": null,
"email": null
},
"order_details": null,
"email": "guest@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": "131123",
"created_at": 1755881049,
"expires": 1755884649,
"secret": "epk_9348e3aa032c4d098bbfd192de70ef12"
},
"manual_retry_allowed": false,
"connector_transaction_id": "83997485375813577",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": {
"redirect_response": null,
"search_tags": null,
"apple_pay_recurring_details": null,
"gateway_system": "direct"
},
"reference_id": "pay_SdL4iUqO5d7j0FzJYU65_1",
"payment_link": null,
"profile_id": "pro_hu1z8tTKASkmCSAzpgrG",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_lWpk5Il3XuhAhU9yZCYv",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-08-22T16:59:09.334Z",
"fingerprint": null,
"browser_info": null,
"payment_channel": null,
"payment_method_id": "pm_g1hGld5oStSlL23yZMU7",
"network_transaction_id": "1096408000822",
"payment_method_status": "inactive",
"updated": "2025-08-22T16:44:10.187Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": "2592937072890001",
"card_discovery": "manual",
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null,
"enable_partial_authorization": null
}
```
Payments Method table:
<img width="835" height="546" alt="Screenshot 2025-08-22 at 10 19 32 PM" src="https://github.com/user-attachments/assets/132caeb5-00e3-418b-9e3f-385206f692c7" />
Payments Attempt Table:
<img width="897" height="408" alt="Screenshot 2025-08-22 at 10 20 02 PM" src="https://github.com/user-attachments/assets/a73c4faf-be4e-4861-98e2-4c48a6b30b55" />
Normal Card's Flow
Request
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_DD2unr7vk4xDt33fxLlCT7JRyc5lX0ffC5fSLUo8Qrwcz4MLzt55T8jnBzveIgLs' \
--data-raw '{
"amount": 1000,
"currency": "USD",
"amount_to_capture": 1000,
"customer_id":"131123",
"confirm": true,
"capture_method": "automatic",
"authentication_type": "no_three_ds",
"payment_method": "card",
"payment_method_type": "credit",
"email": "guest@example.com",
"payment_method_data": {
"card": {
"card_number": "5404000000000001",
"card_exp_month": "09",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"card_cvc": "123"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "Zurich",
"state": "asd",
"zip": "8008",
"country": "CH",
"first_name": "joseph",
"last_name": "Doe",
"origin_zip":"43234"
}
}
}'
```
Response
```
{
"payment_id": "pay_6nYH976LGZjIxtPDiPBH",
"merchant_id": "merchant_1755880712",
"status": "processing",
"amount": 1000,
"net_amount": 1000,
"shipping_cost": null,
"amount_capturable": 1000,
"amount_received": null,
"connector": "worldpayvantiv",
"client_secret": "pay_6nYH976LGZjIxtPDiPBH_secret_xEhb0OgmGKkfmggg9aXW",
"created": "2025-08-22T16:55:44.705Z",
"currency": "USD",
"customer_id": "131123",
"customer": {
"id": "131123",
"name": null,
"email": "guest@example.com",
"phone": null,
"phone_country_code": null
},
"description": null,
"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": "0001",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "540400",
"card_extended_bin": null,
"card_exp_month": "09",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"payment_checks": {
"avs_result": "00",
"advanced_a_v_s_result": null,
"authentication_result": null,
"card_validation_result": "M"
},
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": {
"address": {
"city": "Zurich",
"country": "CH",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "8008",
"state": "asd",
"first_name": "joseph",
"last_name": "Doe",
"origin_zip": "43234"
},
"phone": null,
"email": null
},
"order_details": null,
"email": "guest@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": "131123",
"created_at": 1755881744,
"expires": 1755885344,
"secret": "epk_e922a4645c01494495dc217f2edab3ef"
},
"manual_retry_allowed": false,
"connector_transaction_id": "83997485380421630",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": {
"redirect_response": null,
"search_tags": null,
"apple_pay_recurring_details": null,
"gateway_system": "direct"
},
"reference_id": "pay_6nYH976LGZjIxtPDiPBH_1",
"payment_link": null,
"profile_id": "pro_hu1z8tTKASkmCSAzpgrG",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_lWpk5Il3XuhAhU9yZCYv",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-08-22T17:10:44.705Z",
"fingerprint": null,
"browser_info": null,
"payment_channel": null,
"payment_method_id": null,
"network_transaction_id": "3614028940822",
"payment_method_status": null,
"updated": "2025-08-22T16:55:45.233Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": "manual",
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null,
"enable_partial_authorization": null
}
```
Payments Attempt
<img width="835" height="299" alt="Screenshot 2025-08-22 at 10 27 16 PM" src="https://github.com/user-attachments/assets/f3a6a7f2-adb0-453b-a6d7-20513d64fd98" />
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/payment_attempt.rs`
- `crates/diesel_models/src/schema.rs`
- `crates/diesel_models/src/schema_v2.rs`
- ... and 1 more files
**2. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/payments/payment_attempt.rs`
- `crates/hyperswitch_domain_models/src/router_response_types.rs`
**3. Core Business Logic**
- `crates/router/src/core/payments/helpers.rs`
- `crates/router/src/core/payments/operations/payment_confirm.rs`
- `crates/router/src/core/payments/operations/payment_create.rs`
- ... and 4 more files
**4. Type Definitions**
- `crates/router/src/types/storage/payment_attempt.rs`
**5. Utils**
- `crates/router/src/utils/user/sample_data.rs`
**6. Other**
- `crates/router/src/services/kafka/payment_attempt.rs`
- `crates/router/src/services/kafka/payment_attempt_event.rs`
- `crates/storage_impl/src/mock_db/payment_attempt.rs`
- ... and 3 more files
**Code Patterns Applied:**
- Implement new functions (1 changes)
- Extend existing types with new fields (62 changes)
**Detailed Identifier Changes:**
Commit 7047c3fa:
Files to modify:
**crates/diesel_models/src/payment_attempt.rs**
Modify existing code
**crates/diesel_models/src/schema.rs**
Modify existing code
**crates/diesel_models/src/schema_v2.rs**
Modify existing code
**crates/diesel_models/src/user/sample_data.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payments/payment_attempt.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_response_types.rs**
Add:
- function: pub::get_network_transaction_id
**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_response.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_update.rs**
Modify existing code
**crates/router/src/core/payments/retry.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
**crates/router/src/services/kafka/payment_attempt.rs**
Modify existing code
**crates/router/src/services/kafka/payment_attempt_event.rs**
Modify existing code
**crates/router/src/types/storage/payment_attempt.rs**
Modify existing code
**crates/router/src/utils/user/sample_data.rs**
Modify existing code
**crates/storage_impl/src/mock_db/payment_attempt.rs**
Modify existing code
**crates/storage_impl/src/payments/payment_attempt.rs**
Modify existing code
|
{"pr_number": 9032, "pr_title": "feat(core): Add network_transaction_id in payments Response ", "merged_at": "2025-08-24T17:00:41Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"database": ["crates/diesel_models/src/payment_attempt.rs", "crates/diesel_models/src/schema.rs", "crates/diesel_models/src/schema_v2.rs", "crates/diesel_models/src/user/sample_data.rs"], "domain": ["crates/hyperswitch_domain_models/src/payments/payment_attempt.rs", "crates/hyperswitch_domain_models/src/router_response_types.rs"], "core_business": ["crates/router/src/core/payments/helpers.rs", "crates/router/src/core/payments/operations/payment_confirm.rs", "crates/router/src/core/payments/operations/payment_create.rs", "crates/router/src/core/payments/operations/payment_response.rs", "crates/router/src/core/payments/operations/payment_update.rs", "crates/router/src/core/payments/retry.rs", "crates/router/src/core/payments/transformers.rs"], "types": ["crates/router/src/types/storage/payment_attempt.rs"], "utils": ["crates/router/src/utils/user/sample_data.rs"], "other": ["crates/router/src/services/kafka/payment_attempt.rs", "crates/router/src/services/kafka/payment_attempt_event.rs", "crates/storage_impl/src/mock_db/payment_attempt.rs", "crates/storage_impl/src/payments/payment_attempt.rs", "migrations/2025-08-20-095434_add_ntid_in_attempt_table/down.sql", "migrations/2025-08-20-095434_add_ntid_in_attempt_table/up.sql"]}, "change_types": {"functions_added": 1, "fields_added": 62}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(session): Added dpa_client_id, provider to click to pay session response
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Enhancement
## Description
<!-- Describe your changes in detail -->
Added dpa_client_id, , provider to click to pay session response
## 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)?
-->
setup visa_ctp
Create merchant connector account for Ctp_visa
```shell
{
"connector_type": "authentication_processor",
"connector_name": "ctp_visa",
"connector_account_details": {
"auth_type": "NoKey"
},
"metadata": {
"dpa_id": "DPA-ID",
"dpa_name": "TestMerchant",
"locale": "en_AU",
"card_brands": [
"mastercard",
"visa"
],
"acquirer_bin": "BIN",
"acquirer_merchant_id": "MERCHANT-ID",
"merchant_category_code": "0001",
"merchant_country_code": "US",
"dpa_client_id": "TestMerchant"
}
}
'
```
update business profile
```shell
curl --location 'http://localhost:8080/account/sahkal/business_profile/pro_NlNPDiGljBSrdEUcIsND' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_YB8CxdKov4e1tOUkhc98y38CaI5rRh1dTtGeQ10Tc7j09yo6xiz9a0ERuSsg7odl' \
--data '{
"is_click_to_pay_enabled": true,
"authentication_product_ids": {"click_to_pay": "mca_zpT6F8IIZQgG2INqL96J"}
}'
```
Do Payments Create
```shell
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_YB8CxdKov4e1tOUkhc98y38CaI5rRh1dTtGeQ10Tc7j09yo6xiz9a0ERuSsg7odl' \
--data-raw '
{
"amount": 100,
"currency": "USD",
"confirm": false,
"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"
},
"email": "guest@example.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65"
}
'
```
Try doing session call with client-secret and payment_id from payments create response
```shell
curl --location 'localhost:8080/payments/session_tokens' \
--header 'Content-Type: application/json' \
--header 'api-key: pk_dev_3ce83bd14fa54b09915672f0c0bd3fbb' \
--data '{
"payment_id": "pay_0E2ZGHeZigpSx1pyQ0pK",
"wallets": [],
"client_secret": "pay_0E2ZGHeZigpSx1pyQ0pK_secret_Cd7xcFwyEPF3RBFANI2G"
}'
```
Response: should look like this
```shell
{
"payment_id": "pay_0E2ZGHeZigpSx1pyQ0pK",
"client_secret": "pay_0E2ZGHeZigpSx1pyQ0pK_secret_Cd7xcFwyEPF3RBFANI2G",
"session_token": [
{
"wallet_name": "click_to_pay",
"dpa_id":"Dpa ID",
"dpa_name": "TestMerchant",
"locale": "en_AU",
"card_brands": [
"mastercard",
"visa"
],
"acquirer_bin": "bin",
"acquirer_merchant_id": "merchant id",
"merchant_category_code": "0001",
"merchant_country_code": "US",
"transaction_amount": "1.00",
"transaction_currency_code": "USD",
"phone_number": "999999999",
"email": "guest@example.com",
"phone_country_code": "+65",
"provider": "visa",
"dpa_client_id": "TestMerchant"
}
]
}
```
## 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
|
To implement this **payment** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/payments.rs`
**2. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/payments.rs`
**3. Core Business Logic**
- `crates/router/src/core/payments.rs`
**4. External Connector Integration**
- `crates/connector_configs/toml/development.toml`
- `crates/connector_configs/toml/production.toml`
- `crates/connector_configs/toml/sandbox.toml`
**5. Other**
- `api-reference-v2/openapi_spec.json`
- `api-reference/openapi_spec.json`
**Code Patterns Applied:**
- Extend existing types with new fields (4 changes)
**Detailed Identifier Changes:**
Commit fbc092f7:
Files to modify:
**crates/api_models/src/payments.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payments.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Modify existing code
|
{"pr_number": 7683, "pr_title": "feat(session): Added dpa_client_id, provider to click to pay session response", "merged_at": "2025-04-04T09:41:14Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["payment", "merchant", "user"]}, "hierarchy": {"api_models": ["crates/api_models/src/payments.rs"], "domain": ["crates/hyperswitch_domain_models/src/payments.rs"], "core_business": ["crates/router/src/core/payments.rs"], "connectors": ["crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json"]}, "change_types": {"fields_added": 4}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(payments): add tokenization action handling to payment flow for braintree
## 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 feature add connector-level tokenization to Hyperswitch V2, allowing secure storage of card data as tokens at payment connectors like Braintree.
Additionally Tokenization in router is not implemented, because of temp locker mechanism which is still pending.
For connector-level tokenization:
1.When a payment comes with raw card data and the connector supports tokenization, send the card details to the connector’s tokenization API.
2. Receive the tokenized payment method ID.
3. Use the token for the subsequent payment call.
### 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).
-->
Closes #9501
## 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)?
-->
<details>
<summary>▶ Create and Confirm Request</summary>
**Request:**
```bash
curl --location 'http://localhost:8080/v2/payments' \
--header 'Content-Type: application/json' \
--header 'x-profile-id: pro_pYmCUDflXtfYghJEbwig' \
--header 'Authorization: api-key=dev_NJmZgHkdmFD5DC5ldyvqUObC7LgVZAkuNSsUCxlcwTYfdMb2zxsvKZQyFJ5AdIwI' \
--data-raw '{
"amount_details": {
"order_amount": 100,
"currency": "USD"
},
"capture_method": "automatic",
"authentication_type": "no_three_ds",
"billing": {
"address": {
"first_name": "John",
"last_name": "Dough"
},
"email": "example@example.com"
},
"payment_method_data": {
"card": {
"card_number": "4111111111111111",
"card_exp_month": "01",
"card_exp_year": "29",
"card_holder_name": "John Doe",
"card_cvc": "100"
}
},
"payment_method_type": "card",
"payment_method_subtype": "credit",
"shipping": {
"address": {
"first_name": "John",
"last_name": "Dough",
"city": "Karwar",
"zip": "581301",
"state": "Karnataka"
},
"email": "example@example.com"
}
}'
```
**Response:**
```json
{
"id": "12345_pay_0199758923487c2380efbcb7a0480045",
"status": "succeeded",
"amount": {
"order_amount": 100,
"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": 100,
"amount_to_capture": null,
"amount_capturable": 0,
"amount_captured": 100
},
"customer_id": null,
"connector": "braintree",
"created": "2025-09-23T07:45:45.801Z",
"modified_at": "2025-09-23T07:45:46.773Z",
"payment_method_data": {
"billing": null
},
"payment_method_type": "card",
"payment_method_subtype": "credit",
"connector_transaction_id": "dHJhbnNhY3Rpb25fcWE0NGtmdHM",
"connector_reference_id": null,
"merchant_connector_id": "mca_15ue2HSPzmSPtuWvipkZ",
"browser_info": null,
"error": null,
"shipping": null,
"billing": null,
"attempts": null,
"connector_token_details": null,
"payment_method_id": null,
"next_action": null,
"return_url": "https://google.com/success",
"authentication_type": "no_three_ds",
"authentication_type_applied": "no_three_ds",
"is_iframe_redirection_enabled": null,
"merchant_reference_id": null,
"raw_connector_response": null,
"feature_metadata": null,
"metadata": null
}
```
</details>
---
<details>
<summary>▶ Create Intent</summary>
**Request:**
```
{
"amount_details": {
"order_amount": 10000,
"currency": "USD"
},
"capture_method":"automatic",
"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"
}
}
```
**Response:**
```json
{
"id": "12345_pay_019975899d367c61ae62b88f1edde4e9",
"status": "requires_payment_method",
"amount_details": {
"order_amount": 10000,
"currency": "USD",
"shipping_cost": null,
"order_tax_amount": null,
"external_tax_calculation": "skip",
"surcharge_calculation": "skip",
"surcharge_amount": null,
"tax_on_surcharge": null
},
"client_secret": "cs_019975899d487c93a8bf823b41c05b44",
"profile_id": "pro_pYmCUDflXtfYghJEbwig",
"merchant_reference_id": null,
"routing_algorithm_id": null,
"capture_method": "automatic",
"authentication_type": "no_three_ds",
"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",
"origin_zip": null
},
"phone": null,
"email": "example@example.com"
},
"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",
"origin_zip": null
},
"phone": null,
"email": "example@example.com"
},
"customer_id": null,
"customer_present": "present",
"description": null,
"return_url": null,
"setup_future_usage": "on_session",
"apply_mit_exemption": "Skip",
"statement_descriptor": null,
"order_details": null,
"allowed_payment_method_types": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"payment_link_enabled": "Skip",
"payment_link_config": null,
"request_incremental_authorization": "false",
"split_txns_enabled": "skip",
"expires_on": "2025-09-23T08:01:17.027Z",
"frm_metadata": null,
"request_external_three_ds_authentication": "Skip",
"payment_type": "normal"
}
```
</details>
---
<details>
<summary>▶ Confirm Intent</summary>
**Request:**
```
curl --location 'http://localhost:8080/v2/payments/12345_pay_01997581b5657212a9e70f003b9d90b4/confirm-intent' \
--header 'x-profile-id: pro_k9nKKsBbyN4y6mOzfNe3' \
--header 'x-client-secret: cs_01997581b57e7683ae1c09b731afd73c' \
--header 'Authorization: api-key=dev_RDL3XpNVl4roIIGE1841URGxogUhALsFsxybasIi5yX62pvgFh4A3SNEWrKGvvBX' \
--header 'Content-Type: application/json' \
--header 'api-key: pk_dev_e02152d7d0c542dc934d95388df8a940' \
--data '{
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "01",
"card_exp_year": "26",
"card_holder_name": "John Doe",
"card_cvc": "100"
}
},
"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"
}
}'
```
**Response:**
```json
{
"id": "12345_pay_019975899d367c61ae62b88f1edde4e9",
"status": "succeeded",
"amount": {
"order_amount": 10000,
"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": 10000,
"amount_to_capture": null,
"amount_capturable": 0,
"amount_captured": 10000
},
"customer_id": null,
"connector": "braintree",
"created": "2025-09-23T07:46:17.027Z",
"modified_at": "2025-09-23T07:47:00.359Z",
"payment_method_data": {
"billing": null
},
"payment_method_type": "card",
"payment_method_subtype": "credit",
"connector_transaction_id": "dHJhbnNhY3Rpb25fZnhxaDczNXY",
"connector_reference_id": null,
"merchant_connector_id": "mca_15ue2HSPzmSPtuWvipkZ",
"browser_info": null,
"error": null,
"shipping": null,
"billing": null,
"attempts": null,
"connector_token_details": null,
"payment_method_id": null,
"next_action": null,
"return_url": "https://google.com/success",
"authentication_type": "no_three_ds",
"authentication_type_applied": "no_three_ds",
"is_iframe_redirection_enabled": null,
"merchant_reference_id": null,
"raw_connector_response": null,
"feature_metadata": null,
"metadata": null
}
```
</details>
<img width="1728" height="428" alt="image" src="https://github.com/user-attachments/assets/84ef20bd-fbbd-43ab-8733-07ec7d693c5b" />
<img width="1727" height="452" alt="image" src="https://github.com/user-attachments/assets/fb66e5f9-95d8-4a1a-bc68-c90809f8b5e0" />
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/payments.rs`
- `crates/router/src/core/payments/operations.rs`
- `crates/router/src/core/payments/operations/payment_confirm_intent.rs`
**Code Patterns Applied:**
- Implement new functions (4 changes)
- Extend existing types with new fields (13 changes)
- Add conditional logic for feature flags or filtering (2 changes)
**Detailed Identifier Changes:**
Commit efab34f0:
Files to modify:
**crates/router/src/core/payments.rs**
Add:
- function: private::is_payment_method_tokenization_enabled_for_connector
- function: private::is_payment_flow_allowed_for_connector
- enum: pub::TokenizationAction
**crates/router/src/core/payments/operations.rs**
Add:
- function: private::get_connector_tokenization_action
**crates/router/src/core/payments/operations/payment_confirm_intent.rs**
Add:
- function: private::get_connector_tokenization_action
|
{"pr_number": 9506, "pr_title": "feat(payments): add tokenization action handling to payment flow for braintree", "merged_at": "2025-09-30T08:07:13Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments.rs", "crates/router/src/core/payments/operations.rs", "crates/router/src/core/payments/operations/payment_confirm_intent.rs"]}, "change_types": {"functions_added": 4, "enums_added": 1, "fields_added": 13, "imports_added": 1, "conditionals_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(router): fixed netcetera flow for backward flow cavv fetching
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
## Description
<!-- Describe your changes in detail -->
Currently if we cancel the transaction after initiating with netcetera we are trying hard fetch cavv stored in temp locker, which is causing 5xx.
with this PR we will be ignoring the cavv fetch error since it will be fetched in authorisation flow if authorisation need to be done!
## 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 via sdk
forward flow ( friction)
https://github.com/user-attachments/assets/0c1e56c1-b849-47b9-9a3a-734ba7675a33
forward flow ( friction less)
https://github.com/user-attachments/assets/b3daf207-3942-486d-b4eb-b351adf5c81e
backward flow
https://github.com/user-attachments/assets/4e53d72b-584d-488b-b67b-8b1c3e1ca469
table screenshot
<img width="1464" alt="Screenshot 2025-05-15 at 3 07 09 PM" src="https://github.com/user-attachments/assets/d1eb4e1f-24cb-4ea5-928f-b9c71db24f5a" />
## 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
|
To implement this **payment** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/authentication.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (1 changes)
**Detailed Identifier Changes:**
Commit fc914203:
Files to modify:
**crates/router/src/core/authentication.rs**
Modify existing code
|
{"pr_number": 8035, "pr_title": "fix(router): fixed netcetera flow for backward flow cavv fetching", "merged_at": "2025-05-15T12:44:04Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["user", "transaction"]}, "hierarchy": {"core_business": ["crates/router/src/core/authentication.rs"]}, "change_types": {"fields_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
revert: feat(core): add support for api locking with multiple keys for a single api (#8887)
## 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 -->
Revert this PR:
https://github.com/juspay/hyperswitch/pull/8887
### 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/api_locking.rs`
**2. Type Definitions**
- `crates/redis_interface/src/types.rs`
**3. Other**
- `crates/redis_interface/src/commands.rs`
- `crates/redis_interface/src/lib.rs`
- `crates/router/src/routes/payments.rs`
**Code Patterns Applied:**
- Implement new functions (1 changes)
- Extend existing types with new fields (4 changes)
- Modify database queries (1 changes)
|
{"pr_number": 9001, "pr_title": "revert: feat(core): add support for api locking with multiple keys for a single api (#8887)", "merged_at": "2025-08-20T11:53:35Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"core_business": ["crates/router/src/core/api_locking.rs"], "types": ["crates/redis_interface/src/types.rs"], "other": ["crates/redis_interface/src/commands.rs", "crates/redis_interface/src/lib.rs", "crates/router/src/routes/payments.rs"]}, "change_types": {"functions_added": 1, "fields_added": 4, "imports_added": 2, "database_queries": 1}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
chore: fix typos in the repo
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
This PR updates all the typos in the repository. For reference, check: https://github.com/juspay/hyperswitch/actions/runs/15082629873/job/42401247676?pr=8056
### 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).
-->
Fix typos. Closes #8064
## 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)?
-->
```sh
cargo +nightly fmt --all && just clippy && just clippy_v2
```
## Checklist
<!-- Put an `x` in the boxes that apply -->
- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `just clippy && just clippy_v2`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/payments.rs`
**2. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/router_request_types/unified_authentication_service.rs`
**3. Core Business Logic**
- `crates/router/src/core/payment_methods.rs`
- `crates/router/src/core/payments.rs`
- `crates/router/src/core/payments/retry.rs`
- ... and 2 more files
**4. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs`
- `crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs`
- `crates/hyperswitch_connectors/src/connectors/recurly.rs`
- ... and 1 more files
**5. Type Definitions**
- `crates/common_types/src/payment_methods.rs`
- `crates/common_utils/src/types.rs`
**6. Utils**
- `crates/common_utils/src/macros.rs`
- `crates/router/src/utils/currency.rs`
**7. Tests**
- `postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario5-Create a mandate and recurring payment/List payment methods for a Customer/event.test.js`
- `postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6-Saved card flow/Payment methods - List and get token/event.test.js`
- `postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6-Saved card flow/Payments - Confirm secod and use saved card/event.test.js`
**8. Configuration Files**
- `api-reference/hyperswitch_intelligent_router_open_api_spec.yml`
- `config/dashboard.toml`
**9. Other**
- `api-reference-v2/openapi_spec.json`
- `api-reference/openapi_spec.json`
- `postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6-Saved card flow/.meta.json`
- ... and 6 more files
**Code Patterns Applied:**
- Define new data structures (1 changes)
- Extend existing types with new fields (13 changes)
**Detailed Identifier Changes:**
Commit 6fc50b67:
Files to modify:
**crates/api_models/src/payments.rs**
Modify existing code
**crates/common_types/src/payment_methods.rs**
Modify existing code
**crates/common_utils/src/macros.rs**
Modify existing code
**crates/common_utils/src/types.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs**
Remove:
- struct: pub::FiuuWebhookSignauture
Add:
- struct: pub::FiuuWebhookSignature
**crates/hyperswitch_connectors/src/connectors/recurly.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/worldpay/response.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_request_types/unified_authentication_service.rs**
Modify existing code
**crates/router/src/core/payment_methods.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/core/payments/retry.rs**
Modify existing code
**crates/router/src/core/revenue_recovery.rs**
Modify existing code
**crates/router/src/core/unified_authentication_service.rs**
Modify existing code
**crates/router/src/utils/currency.rs**
Modify existing code
|
{"pr_number": 8063, "pr_title": "chore: fix typos in the repo", "merged_at": "2025-05-23T07:52:09Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"api_models": ["crates/api_models/src/payments.rs"], "domain": ["crates/hyperswitch_domain_models/src/router_request_types/unified_authentication_service.rs"], "core_business": ["crates/router/src/core/payment_methods.rs", "crates/router/src/core/payments.rs", "crates/router/src/core/payments/retry.rs", "crates/router/src/core/revenue_recovery.rs", "crates/router/src/core/unified_authentication_service.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs", "crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs", "crates/hyperswitch_connectors/src/connectors/recurly.rs", "crates/hyperswitch_connectors/src/connectors/worldpay/response.rs"], "types": ["crates/common_types/src/payment_methods.rs", "crates/common_utils/src/types.rs"], "utils": ["crates/common_utils/src/macros.rs", "crates/router/src/utils/currency.rs"], "tests": ["postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario5-Create a mandate and recurring payment/List payment methods for a Customer/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6-Saved card flow/Payment methods - List and get token/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6-Saved card flow/Payments - Confirm secod and use saved card/event.test.js"], "config": ["api-reference/hyperswitch_intelligent_router_open_api_spec.yml", "config/dashboard.toml"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6-Saved card flow/.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6-Saved card flow/Payments - Confirm secod and use saved card/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6-Saved card flow/Payments - Confirm secod and use saved card/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6-Saved card flow/Payments - Confirm secod and use saved card/response.json", "postman/collection-dir/archipel/Flow Testcases/Negative Cases/Scenario6-Create a recurring payment with greater mandate amount/Recurring Payments - Create/request.json", "postman/collection-json/archipel.postman_collection.json", "v2_compatible_migrations/2024-08-28-081757_drop_not_null_constraints_on_v1_columns/up.sql"]}, "change_types": {"structs_added": 1, "fields_added": 13}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(payments): add support for connector testing (Adyen)
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Hotfix for https://github.com/juspay/hyperswitch/pull/7874
### 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
Connectors like Adyen provide special values for certain fields that can be used to simulate different error scenarios in their sandbox environments. These special values help merchants test error handling without requiring them to modify their actual implementation.
For example, sending a specific holder name value like "CARD_EXPIRED" can simulate a card expiration error from Adyen.
This feature enables merchants to test various error scenarios in a systematic way through HyperSwitch API without changing their integration code.
## How did you test it?
Same as described in https://github.com/juspay/hyperswitch/pull/7874
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/payments.rs`
**2. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/router_request_types.rs`
**3. Core Business Logic**
- `crates/router/src/core/payments/transformers.rs`
**4. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs`
- `crates/hyperswitch_connectors/src/utils.rs`
- `crates/router/src/types/api/verify_connector.rs`
- ... and 1 more files
**5. Type Definitions**
- `crates/router/src/types.rs`
**6. Other**
- `api-reference-v2/openapi_spec.json`
- `api-reference/openapi_spec.json`
- `crates/openapi/src/openapi.rs`
- ... and 1 more files
**Code Patterns Applied:**
- Define new data structures (3 changes)
- Implement new functions (3 changes)
- Extend existing types with new fields (32 changes)
**Detailed Identifier Changes:**
Commit 227f9b64:
Files to modify:
**crates/api_models/src/payments.rs**
Add:
- struct: pub::AdyenConnectorMetadata
- struct: pub::AdyenTestingData
**crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs**
Add:
- function: private::try_from
- struct: pub::AdyenTestingData
- impl: impl TryFrom<common_utils::pii::SecretSerdeValue> for AdyenTestingData
**crates/hyperswitch_connectors/src/utils.rs**
Add:
- function: private::get_connector_testing_data
**crates/hyperswitch_domain_models/src/router_request_types.rs**
Modify existing code
**crates/openapi/src/openapi.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/types.rs**
Modify existing code
**crates/router/src/types/api/verify_connector.rs**
Modify existing code
**crates/router/tests/connectors/utils.rs**
Modify existing code
|
{"pr_number": 7898, "pr_title": "feat(payments): add support for connector testing (Adyen)", "merged_at": "2025-04-25T07:55:19Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["merchant", "connector", "card"]}, "hierarchy": {"api_models": ["crates/api_models/src/payments.rs"], "domain": ["crates/hyperswitch_domain_models/src/router_request_types.rs"], "core_business": ["crates/router/src/core/payments/transformers.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs", "crates/hyperswitch_connectors/src/utils.rs", "crates/router/src/types/api/verify_connector.rs", "crates/router/tests/connectors/utils.rs"], "types": ["crates/router/src/types.rs"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json", "crates/openapi/src/openapi.rs", "crates/openapi/src/openapi_v2.rs"]}, "change_types": {"structs_added": 3, "functions_added": 3, "fields_added": 32}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
docs(openapi): Fixed API documentation for V2
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [x] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Improved OpenAPI documentation for V2
### 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`
-->
## Issues Addressed
<!--
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).
-->
- Merchant Account Update: Path Parameters in definition says it is {account_id} instead that should be {id}
- Merchant Profile List Changes: Instead `Profile - list` make `Merchant Account - Profile List` , Path Parameters in definition says it is {account_id} instead that should be {id}
- Profile Changes: In profile all routes has [profile_id] in the path, change the path to [id] and the explanation in path parameter also to [id]. For `Merchant Connector - list` in side-bar, change to `Profile - Connector Accounts list`. In the definition of the api
`List Merchant Connector Details for the business profile` instead
`List Connector Accounts for the profile`
- Connector Account Changes: Instead of `Merchant Connector Account` use the term `Connector Account`
- Api-Key Changes: In the path param and its definition we are using {key_id] instead use [id]
- Routing Changes: In path param and its definition we are using {routing_algorithm_id} instead is {id] , these changes are in api-documentation
## 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`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `api-reference-v2/api-reference/merchant-connector-account/merchant-connector--create.mdx`
- `api-reference-v2/api-reference/merchant-connector-account/merchant-connector--delete.mdx`
- `api-reference-v2/api-reference/merchant-connector-account/merchant-connector--retrieve.mdx`
- ... and 3 more files
**2. Other**
- `api-reference-v2/api-reference/api-key/api-key--retrieve.mdx`
- `api-reference-v2/api-reference/api-key/api-key--revoke.mdx`
- `api-reference-v2/api-reference/api-key/api-key--update.mdx`
- ... and 18 more files
**Detailed Identifier Changes:**
Commit 7dfcd514:
Files to modify:
**crates/openapi/src/openapi_v2.rs**
Modify existing code
**crates/openapi/src/routes/api_keys.rs**
Modify existing code
**crates/openapi/src/routes/merchant_account.rs**
Modify existing code
**crates/openapi/src/routes/merchant_connector_account.rs**
Modify existing code
**crates/openapi/src/routes/payments.rs**
Modify existing code
**crates/openapi/src/routes/profile.rs**
Modify existing code
**crates/openapi/src/routes/routing.rs**
Modify existing code
|
{"pr_number": 6496, "pr_title": "docs(openapi): Fixed API documentation for V2", "merged_at": "2024-11-12T07:16:32Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["merchant", "connector"]}, "hierarchy": {"connectors": ["api-reference-v2/api-reference/merchant-connector-account/merchant-connector--create.mdx", "api-reference-v2/api-reference/merchant-connector-account/merchant-connector--delete.mdx", "api-reference-v2/api-reference/merchant-connector-account/merchant-connector--retrieve.mdx", "api-reference-v2/api-reference/merchant-connector-account/merchant-connector--update.mdx", "api-reference-v2/api-reference/profile/merchant-connector--list.mdx", "crates/openapi/src/routes/merchant_connector_account.rs"], "other": ["api-reference-v2/api-reference/api-key/api-key--retrieve.mdx", "api-reference-v2/api-reference/api-key/api-key--revoke.mdx", "api-reference-v2/api-reference/api-key/api-key--update.mdx", "api-reference-v2/api-reference/merchant-account/business-profile--list.mdx", "api-reference-v2/api-reference/payments/payments--session-token.mdx", "api-reference-v2/api-reference/profile/profile--activate-routing-algorithm.mdx", "api-reference-v2/api-reference/profile/profile--deactivate-routing-algorithm.mdx", "api-reference-v2/api-reference/profile/profile--retrieve-active-routing-algorithm.mdx", "api-reference-v2/api-reference/profile/profile--retrieve-default-fallback-routing-algorithm.mdx", "api-reference-v2/api-reference/profile/profile--retrieve.mdx", "api-reference-v2/api-reference/profile/profile--update-default-fallback-routing-algorithm.mdx", "api-reference-v2/api-reference/profile/profile--update.mdx", "api-reference-v2/api-reference/routing/routing--retrieve.mdx", "api-reference-v2/mint.json", "api-reference-v2/openapi_spec.json", "crates/openapi/src/openapi_v2.rs", "crates/openapi/src/routes/api_keys.rs", "crates/openapi/src/routes/merchant_account.rs", "crates/openapi/src/routes/payments.rs", "crates/openapi/src/routes/profile.rs", "crates/openapi/src/routes/routing.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connector): restrict preprocessing to only apple pay for paysafe
## 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 bug in paysafe where skrill wallet payment method was throwing `501`. the reason being, we've added a check in preprocessing call that applied to all wallet payment methods for paysafe instead of having it applied to apple pay specifically.
this pr fixes that.
### 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).
-->
skrill, unintentionally went to preprocessing step that resulted in 501 while the payment method is implemented in authorize call.
## 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)?
-->
<details>
<summary>Apple Pay</summary>
Create
```bash
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Accept-Language: ja' \
--header 'api-key: dev_wcCEnIpNCiH8uz9vhjaLpojPpZLQAo0ScLnQ1VPuSFGWa5x1vbKtBGqwd2wII9HM' \
--data-raw '{
"amount": 1000,
"currency": "USD",
"confirm": false,
"business_country": "US",
"business_label": "default",
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"customer_id": "StripeCustomer",
"email": "likhin.bopanna@gmail.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",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}'
```
```json
{
"payment_id": "pay_nKWxEfg6kk2sBUFGFMeR",
"merchant_id": "postman_merchant_GHAction_1759750181",
"status": "requires_payment_method",
"amount": 1000,
"net_amount": 1000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": null,
"client_secret": "pay_nKWxEfg6kk2sBUFGFMeR_secret_89GK0HlI7M74crmy87AS",
"created": "2025-10-06T11:32:52.402Z",
"currency": "USD",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "likhin.bopanna@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": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": null,
"payment_method_data": null,
"payment_token": null,
"shipping": null,
"billing": null,
"order_details": null,
"email": "likhin.bopanna@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": null,
"connector_label": null,
"business_country": "US",
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "StripeCustomer",
"created_at": 1759750372,
"expires": 1759753972,
"secret": "epk_5cf9e0984e984eadb290d4d6f68e1070"
},
"manual_retry_allowed": null,
"connector_transaction_id": null,
"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_HwXSI9BzQBCoG4QkGRlw",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": null,
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-10-06T11:47:52.402Z",
"fingerprint": null,
"browser_info": null,
"payment_channel": null,
"payment_method_id": null,
"network_transaction_id": null,
"payment_method_status": null,
"updated": "2025-10-06T11:32:52.431Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"request_extended_authorization": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": null,
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null,
"enable_partial_authorization": null,
"enable_overcapture": null,
"is_overcapture_enabled": null,
"network_details": null,
"is_stored_credential": null,
"mit_category": null
}
```
Session
```bash
curl --location 'http://localhost:8080/payments/session_tokens' \
--header 'Content-Type: application/json' \
--header 'api-key: pk_dev_7d80afd0f4b841e2a0b0e1a460f6039c' \
--data '{
"payment_id": "pay_nKWxEfg6kk2sBUFGFMeR",
"wallets": [],
"client_secret": "pay_nKWxEfg6kk2sBUFGFMeR_secret_89GK0HlI7M74crmy87AS"
}'
```
```json
{
"payment_id": "pay_nKWxEfg6kk2sBUFGFMeR",
"client_secret": "pay_nKWxEfg6kk2sBUFGFMeR_secret_89GK0HlI7M74crmy87AS",
"session_token": [
{
"wallet_name": "apple_pay",
"session_token_data": {
"epoch_timestamp": 1759750383162,
"expires_at": 1759753983162,
"merchant_session_identifier": "SS..C3",
"nonce": "08ed5fa4",
"merchant_identifier": "8C..C4",
"domain_name": "hyperswitch.app",
"display_name": "apple pay",
"signature": "30..00",
"operational_analytics_identifier": "apple pay:8C...C4",
"retries": 0,
"psp_id": "8C...C4"
},
"payment_request_data": {
"country_code": "US",
"currency_code": "USD",
"total": {
"label": "applepay",
"type": "final",
"amount": "10.00"
},
"merchant_capabilities": [
"supports3DS"
],
"supported_networks": [
"visa",
"masterCard",
"amex",
"discover"
],
"merchant_identifier": "merchant.lol"
},
"connector": "paysafe",
"delayed_session_token": false,
"sdk_next_action": {
"next_action": "confirm"
},
"connector_reference_id": null,
"connector_sdk_public_key": null,
"connector_merchant_id": null
}
]
}
```
Confirm
```bash
curl --location 'http://localhost:8080/payments/pay_nKWxEfg6kk2sBUFGFMeR/confirm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_7hcskEypRcDWscoO2H26tDR7GKLF3kT0ypXEF1YMCoLPKAm7fglmqZ4zBTaiLlid' \
--data '{
"confirm": true,
"payment_method": "wallet",
"payment_method_type": "apple_pay",
"payment_method_data": {
"wallet": {
"apple_pay": {
"payment_data": {
"application_primary_account_number": "5204245253050839",
"application_expiration_month": "01",
"application_expiration_year": "30",
"payment_data": {
"online_payment_cryptogram": "A/FwSJkAlul/sRItXYorMAACAAA=",
"eci_indicator": "1"
}
},
"payment_method": {
"display_name": "Visa 4228",
"network": "Mastercard",
"type": "debit"
},
"transaction_identifier": "a0...4a"
}
},
"billing": null
},
"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"
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "John",
"last_name": "Doe"
}
},
"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"
}
}
}'
```
```json
{
"payment_id": "pay_nKWxEfg6kk2sBUFGFMeR",
"merchant_id": "postman_merchant_GHAction_1759750181",
"status": "succeeded",
"amount": 1000,
"net_amount": 1000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 1000,
"connector": "paysafe",
"client_secret": "pay_nKWxEfg6kk2sBUFGFMeR_secret_89GK0HlI7M74crmy87AS",
"created": "2025-10-06T11:34:26.900Z",
"currency": "USD",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "likhin.bopanna@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": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "wallet",
"payment_method_data": {
"wallet": {
"apple_pay": {
"last4": "4228",
"card_network": "Mastercard",
"type": "debit"
}
},
"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",
"origin_zip": 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": "John",
"last_name": "Doe",
"origin_zip": null
},
"phone": null,
"email": null
},
"order_details": null,
"email": "likhin.bopanna@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": "apple_pay",
"connector_label": "paysafe_US_default",
"business_country": "US",
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": null,
"connector_transaction_id": "f115ce9c-fd30-49dc-94f1-81e3cb868154",
"frm_message": null,
"metadata": {
"udf1": "value1",
"login_date": "2019-09-10T10:11:12Z",
"new_customer": "true"
},
"connector_metadata": null,
"feature_metadata": {
"redirect_response": null,
"search_tags": null,
"apple_pay_recurring_details": null,
"gateway_system": "direct"
},
"reference_id": null,
"payment_link": null,
"profile_id": "pro_3ChHsAtYFOz9hH9VMtnw",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_4L5eJPYlmGaJigFIaTZl",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-10-06T11:49:26.900Z",
"fingerprint": null,
"browser_info": {
"os_type": null,
"referer": null,
"language": "nl-NL",
"time_zone": 0,
"ip_address": "127.0.0.1",
"os_version": null,
"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,
"device_model": null,
"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,
"accept_language": "en",
"java_script_enabled": true
},
"payment_channel": null,
"payment_method_id": null,
"network_transaction_id": null,
"payment_method_status": null,
"updated": "2025-10-06T11:34:32.130Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"request_extended_authorization": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": null,
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null,
"enable_partial_authorization": null,
"enable_overcapture": null,
"is_overcapture_enabled": null,
"network_details": null,
"is_stored_credential": null,
"mit_category": null
}
```
</details>
<details>
<summary>Skrill</summary>
```bash
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Accept-Language: ja' \
--header 'api-key: dev_wcCEnIpNCiH8uz9vhjaLpojPpZLQAo0ScLnQ1VPuSFGWa5x1vbKtBGqwd2wII9HM' \
--data-raw '{
"amount": 1500,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"customer_id": "aaaa",
"authentication_type": "three_ds",
"payment_method": "wallet",
"payment_method_type": "skrill",
"payment_method_data": {
"wallet": {
"skrill": {}
}
},
"billing": {
"address": {
"line1": "Singapore Changi Airport. 2nd flr",
"line2": "",
"line3": "",
"city": "Downtown Core",
"state": "Central Indiana America",
"zip": "039393",
"country": "SG",
"first_name": "박성준",
"last_name": "박성준"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "swangi.kumari@juspay.in"
},
"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"
}
}'
```
```json
{
"payment_id": "pay_ZR36mAH59ofEyHCuMfNr",
"merchant_id": "postman_merchant_GHAction_1759750181",
"status": "requires_customer_action",
"amount": 1500,
"net_amount": 1500,
"shipping_cost": null,
"amount_capturable": 1500,
"amount_received": null,
"connector": "paysafe",
"client_secret": "pay_ZR36mAH59ofEyHCuMfNr_secret_fHOQqa4f7kuV026Br3Sx",
"created": "2025-10-06T11:29:48.570Z",
"currency": "USD",
"customer_id": "aaaa",
"customer": {
"id": "aaaa",
"name": null,
"email": null,
"phone": null,
"phone_country_code": null
},
"description": null,
"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": "wallet",
"payment_method_data": {
"wallet": {},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": {
"address": {
"city": "Downtown Core",
"country": "SG",
"line1": "Singapore Changi Airport. 2nd flr",
"line2": "",
"line3": "",
"zip": "039393",
"state": "Central Indiana America",
"first_name": "박성준",
"last_name": "박성준",
"origin_zip": null
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "swangi.kumari@juspay.in"
},
"order_details": null,
"email": null,
"name": null,
"phone": null,
"return_url": null,
"authentication_type": "three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": {
"type": "redirect_to_url",
"redirect_to_url": "http://localhost:8080/payments/redirect/pay_ZR36mAH59ofEyHCuMfNr/postman_merchant_GHAction_1759750181/pay_ZR36mAH59ofEyHCuMfNr_1"
},
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "skrill",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "aaaa",
"created_at": 1759750188,
"expires": 1759753788,
"secret": "epk_5802f16446f44f4286501593b0a0efe0"
},
"manual_retry_allowed": null,
"connector_transaction_id": null,
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": {
"redirect_response": null,
"search_tags": null,
"apple_pay_recurring_details": null,
"gateway_system": "direct"
},
"reference_id": null,
"payment_link": null,
"profile_id": "pro_HwXSI9BzQBCoG4QkGRlw",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_akveLwRd2jjVRaaaPyl5",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-10-06T11:44:48.570Z",
"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_channel": null,
"payment_method_id": null,
"network_transaction_id": null,
"payment_method_status": null,
"updated": "2025-10-06T11:29:49.759Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"request_extended_authorization": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": null,
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null,
"enable_partial_authorization": null,
"enable_overcapture": null,
"is_overcapture_enabled": null,
"network_details": null,
"is_stored_credential": null,
"mit_category": null
}
```
<img width="1650" height="837" alt="image" src="https://github.com/user-attachments/assets/d02971d2-e598-49dd-a854-a17829cb3d59" />
<img width="543" height="49" alt="image" src="https://github.com/user-attachments/assets/95eac0ff-f57d-4594-9d4a-1dc06b1d1d57" />
Retrieve
```bash
curl --location 'https://base_url/payments/pay_N9z0Jg00H5Dynb7CSKQ0?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_zrrGPfKKd8sxgS7BmJrkv4vpl2murNtShyPc8o9YlGzuaonmYJwMMyQOdbCfCXcu'
```
```json
{
"payment_id": "pay_N9z0Jg00H5Dynb7CSKQ0",
"merchant_id": "postman_merchant_GHAction_1759750928",
"status": "succeeded",
"amount": 1500,
"net_amount": 1500,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 1500,
"connector": "paysafe",
"client_secret": "pay_N9z0Jg00H5Dynb7CSKQ0_secret_uzp2n3oQPqD0tIjdNPVU",
"created": "2025-10-06T12:22:47.738Z",
"currency": "USD",
"customer_id": "aaaa",
"customer": {
"id": "aaaa",
"name": null,
"email": null,
"phone": null,
"phone_country_code": null
},
"description": null,
"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": "wallet",
"payment_method_data": {
"wallet": {},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": {
"address": {
"city": "Downtown Core",
"country": "SG",
"line1": "Singapore Changi Airport. 2nd flr",
"line2": "",
"line3": "",
"zip": "039393",
"state": "Central Indiana America",
"first_name": "박성준",
"last_name": "박성준",
"origin_zip": null
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "swangi.kumari@juspay.in"
},
"order_details": null,
"email": null,
"name": null,
"phone": null,
"return_url": null,
"authentication_type": "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": "skrill",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": null,
"connector_transaction_id": "9abc1eaf-af0f-49b9-834c-afb2b12291f4",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": {
"redirect_response": null,
"search_tags": null,
"apple_pay_recurring_details": null,
"gateway_system": "direct"
},
"reference_id": null,
"payment_link": null,
"profile_id": "pro_gb3FQWk8hJtjW6FP5c6K",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_AkDHUgxUaV8R6UP65h8v",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-10-06T12:37:47.738Z",
"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_channel": null,
"payment_method_id": null,
"network_transaction_id": null,
"payment_method_status": null,
"updated": "2025-10-06T12:23:02.068Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"request_extended_authorization": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": null,
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null,
"enable_partial_authorization": null,
"enable_overcapture": null,
"is_overcapture_enabled": null,
"network_details": null,
"is_stored_credential": null,
"mit_category": 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 `just clippy && just clippy_v2`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/payments.rs`
**Detailed Identifier Changes:**
Commit 7f6bed3f:
Files to modify:
**crates/router/src/core/payments.rs**
Modify existing code
|
{"pr_number": 9687, "pr_title": "fix(connector): restrict preprocessing to only apple pay for paysafe", "merged_at": "2025-10-07T11:04:41Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(router): Handle encoded_data in PSync [V2]
## 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 -->
Add `encoded_data` from `PaymentsRetrieveRequest` in `payment_attempt` inside `get_trackers` for PSync
### 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).
-->
Closes #8176
## 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)?
-->
No visible changes in API response. Verified that payment status changes to `succeeded`.
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/payments/operations/payment_get.rs`
**Detailed Identifier Changes:**
Commit a19e12c0:
Files to modify:
**crates/router/src/core/payments/operations/payment_get.rs**
Modify existing code
|
{"pr_number": 8177, "pr_title": "fix(router): Handle encoded_data in PSync [V2]", "merged_at": "2025-06-02T10:26:16Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments/operations/payment_get.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(themes): Create user APIs for managing themes
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
This PR adds user APIs to manage themes. Earlier themes was being managed using Admin apis.
These are the following APIs
1. Create Theme
2. Delete Theme
3. Update Theme
4. Upload Asset
5. Find Theme by Theme ID
6. List themes by entity level
7. Get Theme by lineage
- Added Theme resource and ThemeManage permission group
- Assigned ThemeManage permission to OrganizationAdmin role
### 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?
1. Create theme
```
curl --location 'http://localhost:8080/user/theme' \
--header 'Content-Type: application/json' \
--header 'cookie: login_token=••••••' \
--header 'Authorization: ••••••' \
--data '{
"entity_type": "merchant",
"theme_name": "Test_integ",
"theme_data": {
"settings": {
"colors": {
"primary": "#3498db",
"sidebar": "#2ecc71"
},
"buttons": {
"primary": {
"hoverBackgroundColor": "#27ae60"
}
}
}
}
}'
```
2. Get theme by theme ID
```
curl --location --request GET 'http://localhost:8080/user/theme/9e144c3e-a68c-4653-b180-5771380df699' \
--header 'cookie: login_token=••••••' \
--header 'Authorization: ••••••'
```
3. Update theme
```
curl --location --request PUT 'http://localhost:8080/user/theme/9e144c3e-a68c-4653-b180-5771380df699' \
--header 'cookie: login_token=••••••' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{
"theme_data": {
"settings": {
"colors": {
"primary": "#ffffff",
"sidebar": "#2ecc71"
},
"buttons": {
"primary": {
"hoverBackgroundColor": "#27ae60"
}
}
}
},
"email_config": {
"entity_name": "Merchant123",
"entity_logo_url": "https://app.hyperswitch.io/email-assets/HyperswitchLogo.png",
"primary_color": "#006DF9",
"foreground_color": "#111326",
"background_color": "#FFFFFF"
}
}'
```
4. Upload Asset
```
curl --location 'http://localhost:8080/user/theme/9e144c3e-a68c-4653-b180-5771380df699' \
--header 'cookie: login_token=••••••' \
--header 'Authorization: ••••••' \
--form 'asset_name="logo.png"' \
--form 'asset_data=@"/Users/kanika.bansal/Desktop/zurichLogo.png"'
```
5. Delete Theme
```
curl --location --request DELETE 'http://localhost:8080/user/theme/9e144c3e-a68c-4653-b180-5771380df699' \
--header 'cookie: login_token=••••••' \
--header 'Authorization: ••••••'
```
6. List themes by entity level
```
curl --location 'http://localhost:8080/user/theme/list?entity_type=organization' \
--header 'cookie: login_token=••••••' \
--header 'Authorization: ••••••'
```
7. Get theme by lineage
```
curl --location 'http://localhost:8080/user/theme?entity_type=merchant' \
--header 'cookie: login_token=••••••' \
--header 'Authorization: ••••••'
```
Response
- Delete Theme and Upload Asset: 200 OK
- list themes by entity level
```
[
{
"theme_id": "2bab0cbb-491b-420e-aa82-cdd02e1a890d",
"theme_name": "Test_org",
"entity_type": "organization",
"tenant_id": "public",
"org_id": "o1",
"merchant_id": null,
"profile_id": null,
"email_config": {
"entity_name": "Hyperswitch",
"entity_logo_url": "https://app.hyperswitch.io/email-assets/HyperswitchLogo.png",
"primary_color": "#006DF9",
"foreground_color": "#111326",
"background_color": "#FFFFFF"
},
"theme_data": {
"settings": {
"colors": {
"primary": "#3498db",
"secondary": null,
"background": null
},
"sidebar": null,
"typography": null,
"buttons": {
"primary": {
"backgroundColor": null,
"textColor": null,
"hoverBackgroundColor": "#27ae60"
},
"secondary": null
},
"borders": null,
"spacing": null
},
"urls": null
}
},
{
"theme_id": "8ffbed01-5b65-4f7f-8323-bcb0689a2e3c",
"theme_name": "Test_o1_m2_profile",
"entity_type": "profile",
"tenant_id": "public",
"org_id": "o1",
"merchant_id": "m1",
"profile_id": "p1",
"email_config": {
"entity_name": "Hyperswitch",
"entity_logo_url": "https://app.hyperswitch.io/email-assets/HyperswitchLogo.png",
"primary_color": "#006DF9",
"foreground_color": "#111326",
"background_color": "#FFFFFF"
},
"theme_data": {
"settings": {
"colors": {
"primary": "#3498db",
"secondary": null,
"background": null
},
"sidebar": null,
"typography": null,
"buttons": {
"primary": {
"backgroundColor": null,
"textColor": null,
"hoverBackgroundColor": "#27ae60"
},
"secondary": null
},
"borders": null,
"spacing": null
},
"urls": null
}
},
{
"theme_id": "9b0186c1-7ae2-412c-b91f-a5439cae5839",
"theme_name": "Test_o1_merchant",
"entity_type": "merchant",
"tenant_id": "public",
"org_id": "o1",
"merchant_id": "m1",
"profile_id": null,
"email_config": {
"entity_name": "Hyperswitch",
"entity_logo_url": "https://app.hyperswitch.io/email-assets/HyperswitchLogo.png",
"primary_color": "#006DF9",
"foreground_color": "#111326",
"background_color": "#FFFFFF"
},
"theme_data": {
"settings": {
"colors": {
"primary": "#3498db",
"secondary": null,
"background": null
},
"sidebar": null,
"typography": null,
"buttons": {
"primary": {
"backgroundColor": null,
"textColor": null,
"hoverBackgroundColor": "#27ae60"
},
"secondary": null
},
"borders": null,
"spacing": null
},
"urls": null
}
},
{
"theme_id": "929dcbb1-9dbf-4062-8b32-80683e6a8418",
"theme_name": "Test_o1_m1_profile",
"entity_type": "profile",
"tenant_id": "public",
"org_id": "o1",
"merchant_id": "m1",
"profile_id": "p2",
"email_config": {
"entity_name": "Hyperswitch",
"entity_logo_url": "https://app.hyperswitch.io/email-assets/HyperswitchLogo.png",
"primary_color": "#006DF9",
"foreground_color": "#111326",
"background_color": "#FFFFFF"
},
"theme_data": {
"settings": {
"colors": {
"primary": "#3498db",
"secondary": null,
"background": null
},
"sidebar": null,
"typography": null,
"buttons": {
"primary": {
"backgroundColor": null,
"textColor": null,
"hoverBackgroundColor": "#27ae60"
},
"secondary": null
},
"borders": null,
"spacing": null
},
"urls": null
}
}
]
```
- Everything else
```
{
"theme_id": "9e144c3e-a68c-4653-b180-5771380df699",
"theme_name": "Test_Integ",
"entity_type": "merchant",
"tenant_id": "t1",
"org_id": "o1",
"merchant_id": "m1",
"profile_id": null,
"email_config": {
"entity_name": "Hyperswitch",
"entity_logo_url": "https://app.hyperswitch.io/email-assets/HyperswitchLogo.png",
"primary_color": "#006DF9",
"foreground_color": "#111326",
"background_color": "#FFFFFF"
},
"theme_data": {
"settings": {
"colors": {
"primary": "#3498db",
"secondary": null,
"background": null
},
"sidebar": null,
"typography": null,
"buttons": {
"primary": {
"backgroundColor": null,
"textColor": null,
"hoverBackgroundColor": "#27ae60"
},
"secondary": null
},
"borders": null,
"spacing": null
},
"urls": 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/events/user.rs`
- `crates/api_models/src/user/theme.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/query/user/theme.rs`
**3. Core Business Logic**
- `crates/router/src/core/user/theme.rs`
**4. Type Definitions**
- `crates/common_utils/src/types/user/theme.rs`
- `crates/router_env/src/logger/types.rs`
**5. Utils**
- `crates/common_utils/src/id_type/profile.rs`
- `crates/router/src/routes/lock_utils.rs`
- `crates/router/src/utils/user/theme.rs`
**6. Other**
- `crates/common_enums/src/enums.rs`
- `crates/router/src/db/kafka_store.rs`
- `crates/router/src/db/user/theme.rs`
- ... and 6 more files
**Code Patterns Applied:**
- Define new data structures (2 changes)
- Implement new functions (30 changes)
- Extend existing types with new fields (120 changes)
- Add conditional logic for feature flags or filtering (6 changes)
- Modify database queries (13 changes)
**Detailed Identifier Changes:**
Commit 20049d52:
Files to modify:
**crates/api_models/src/events/user.rs**
Modify existing code
**crates/api_models/src/user/theme.rs**
Add:
- struct: pub::CreateUserThemeRequest
- struct: pub::EntityTypeQueryParam
**crates/common_enums/src/enums.rs**
Modify existing code
**crates/common_utils/src/id_type/profile.rs**
Modify existing code
**crates/common_utils/src/types/user/theme.rs**
Modify existing code
**crates/diesel_models/src/query/user/theme.rs**
Add:
- function: private::lineage_hierarchy_filter
- function: pub::delete_by_theme_id
- function: pub::find_all_by_lineage_hierarchy
**crates/router/src/core/user/theme.rs**
Add:
- function: pub::delete_theme
- function: pub::create_user_theme
- function: pub::update_user_theme
- function: pub::upload_file_to_user_theme_storage
- function: pub::list_all_themes_in_lineage
- function: pub::get_user_theme_using_theme_id
- function: pub::get_user_theme_using_lineage
**crates/router/src/db/kafka_store.rs**
Modify existing code
**crates/router/src/db/user/theme.rs**
Add:
- function: private::check_theme_belongs_to_lineage_hierarchy
- function: private::delete_theme_by_theme_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/theme.rs**
Add:
- function: pub::create_user_theme
- function: pub::get_user_theme_using_theme_id
- function: pub::update_user_theme
- function: pub::delete_user_theme
- function: pub::upload_file_to_user_theme_storage
- function: pub::list_all_themes_in_lineage
- function: pub::get_user_theme_using_lineage
**crates/router/src/services/authorization/info.rs**
Modify existing code
**crates/router/src/services/authorization/permission_groups.rs**
Modify existing code
**crates/router/src/services/authorization/permissions.rs**
Modify existing code
**crates/router/src/services/authorization/roles/predefined_roles.rs**
Modify existing code
**crates/router/src/utils/user/theme.rs**
Add:
- function: pub::get_theme_lineage_from_user_token
- function: pub::can_user_access_theme
**crates/router_env/src/logger/types.rs**
Modify existing code
|
{"pr_number": 8387, "pr_title": "feat(themes): Create user APIs for managing themes", "merged_at": "2025-07-28T07:46:16Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["merchant", "user", "order"]}, "hierarchy": {"api_models": ["crates/api_models/src/events/user.rs", "crates/api_models/src/user/theme.rs"], "database": ["crates/diesel_models/src/query/user/theme.rs"], "core_business": ["crates/router/src/core/user/theme.rs"], "types": ["crates/common_utils/src/types/user/theme.rs", "crates/router_env/src/logger/types.rs"], "utils": ["crates/common_utils/src/id_type/profile.rs", "crates/router/src/routes/lock_utils.rs", "crates/router/src/utils/user/theme.rs"], "other": ["crates/common_enums/src/enums.rs", "crates/router/src/db/kafka_store.rs", "crates/router/src/db/user/theme.rs", "crates/router/src/routes/app.rs", "crates/router/src/routes/user/theme.rs", "crates/router/src/services/authorization/info.rs", "crates/router/src/services/authorization/permission_groups.rs", "crates/router/src/services/authorization/permissions.rs", "crates/router/src/services/authorization/roles/predefined_roles.rs"]}, "change_types": {"structs_added": 2, "functions_added": 30, "fields_added": 120, "imports_added": 1, "conditionals_added": 6, "database_queries": 13}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(analytics): modified authentication queries and added generate report for authentications
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Hotfix PR
Original PR: [https://github.com/juspay/hyperswitch/pull/7483](https://github.com/juspay/hyperswitch/pull/7483)
### 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/analytics/auth_events.rs`
- `crates/api_models/src/analytics/sdk_events.rs`
**2. Database Layer (Queries & Schema)**
- `crates/analytics/src/query.rs`
**3. Core Business Logic**
- `crates/analytics/src/auth_events/core.rs`
**4. Other**
- `crates/analytics/src/auth_events/filters.rs`
- `crates/analytics/src/auth_events/metrics.rs`
- `crates/analytics/src/auth_events/metrics/authentication_attempt_count.rs`
- ... and 12 more files
**Code Patterns Applied:**
- Define new data structures (1 changes)
- Implement new functions (3 changes)
- Extend existing types with new fields (36 changes)
- Add conditional logic for feature flags or filtering (1 changes)
- Modify database queries (1 changes)
**Detailed Identifier Changes:**
Commit 73958816:
Files to modify:
**crates/analytics/src/auth_events/core.rs**
Modify existing code
**crates/analytics/src/auth_events/filters.rs**
Modify existing code
**crates/analytics/src/auth_events/metrics.rs**
Modify existing code
**crates/analytics/src/auth_events/metrics/authentication_attempt_count.rs**
Modify existing code
**crates/analytics/src/auth_events/metrics/authentication_count.rs**
Modify existing code
**crates/analytics/src/auth_events/metrics/authentication_error_message.rs**
Modify existing code
**crates/analytics/src/auth_events/metrics/authentication_funnel.rs**
Modify existing code
**crates/analytics/src/auth_events/metrics/authentication_success_count.rs**
Modify existing code
**crates/analytics/src/auth_events/metrics/challenge_attempt_count.rs**
Modify existing code
**crates/analytics/src/auth_events/metrics/challenge_flow_count.rs**
Modify existing code
**crates/analytics/src/auth_events/metrics/challenge_success_count.rs**
Modify existing code
**crates/analytics/src/auth_events/metrics/frictionless_flow_count.rs**
Modify existing code
**crates/analytics/src/auth_events/metrics/frictionless_success_count.rs**
Modify existing code
**crates/analytics/src/lib.rs**
Modify existing code
**crates/analytics/src/query.rs**
Modify existing code
**crates/analytics/src/sqlx.rs**
Modify existing code
**crates/api_models/src/analytics/auth_events.rs**
Add:
- struct: pub::AuthenticationFunnel
**crates/api_models/src/analytics/sdk_events.rs**
Modify existing code
**crates/router/src/analytics.rs**
Add:
- function: pub::generate_merchant_authentication_report
- function: pub::generate_org_authentication_report
- function: pub::generate_profile_authentication_report
|
{"pr_number": 7499, "pr_title": "feat(analytics): modified authentication queries and added generate report for authentications", "merged_at": "2025-03-12T12:31:20Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"api_models": ["crates/api_models/src/analytics/auth_events.rs", "crates/api_models/src/analytics/sdk_events.rs"], "database": ["crates/analytics/src/query.rs"], "core_business": ["crates/analytics/src/auth_events/core.rs"], "other": ["crates/analytics/src/auth_events/filters.rs", "crates/analytics/src/auth_events/metrics.rs", "crates/analytics/src/auth_events/metrics/authentication_attempt_count.rs", "crates/analytics/src/auth_events/metrics/authentication_count.rs", "crates/analytics/src/auth_events/metrics/authentication_error_message.rs", "crates/analytics/src/auth_events/metrics/authentication_funnel.rs", "crates/analytics/src/auth_events/metrics/authentication_success_count.rs", "crates/analytics/src/auth_events/metrics/challenge_attempt_count.rs", "crates/analytics/src/auth_events/metrics/challenge_flow_count.rs", "crates/analytics/src/auth_events/metrics/challenge_success_count.rs", "crates/analytics/src/auth_events/metrics/frictionless_flow_count.rs", "crates/analytics/src/auth_events/metrics/frictionless_success_count.rs", "crates/analytics/src/lib.rs", "crates/analytics/src/sqlx.rs", "crates/router/src/analytics.rs"]}, "change_types": {"structs_added": 1, "functions_added": 3, "fields_added": 36, "imports_added": 9, "conditionals_added": 1, "database_queries": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(RevenueRecovery): Skip record-back for failed invoices on auto-voiding billing connectors
## 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 addresses two issues :
#### Unnecessary record-back for certain billing processors
billing processors (like Stripebilling, Recurly) automatically void invoices after 30 days and cancel the associated subscription. Because of this, we don't need to call a record-back flow for failed invoices on our end.
#### PSync flow fetching incorrect transaction
In the billing connector PSync flow, we were fetching invoice and transaction details using the invoice ID. However, the logic always selected the last transaction from the list, regardless of its status or relevance. This caused the retry count to not be updated correctly.
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] 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 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 a mca
```
curl --location 'http://localhost:8080/v2/connector-accounts' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'x-merchant-id: cloth_seller_UtjuUuRAKVfLLLoRfZgg' \
--header 'x-profile-id: pro_oCx1cn5sCSpSnwZaw63U' \
--header 'Authorization: admin-api-key=test_admin' \
--data '{
"connector_type": "payment_processor",
"connector_name": "stripe",
"connector_account_details": {
"auth_type": "HeaderKey",
"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,
"connector_webhook_details": {
"merchant_secret": ""
},
"profile_id": ""
}'
```
#### Create billing processor
```
curl --location 'http://localhost:8080/v2/connector-accounts' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'x-merchant-id: cloth_seller_UtjuUuRAKVfLLLoRfZgg' \
--header 'x-profile-id: pro_oCx1cn5sCSpSnwZaw63U' \
--header 'Authorization: admin-api-key=test_admin' \
--data '{
"connector_type": "billing_processor",
"connector_name": "stripebilling",
"connector_account_details": {
"auth_type": "HeaderKey",
"api_key": ""
},
"connector_webhook_details": {
"merchant_secret": "secret_needed",
"additional_secret": "password"
},
"feature_metadata": {
"revenue_recovery": {
"max_retry_count": 7,
"billing_connector_retry_threshold": 2,
"billing_account_reference": {
"mca_id": "stripebilling"
}
}
},
"profile_id": ""
}'
```
### Webhook
```
curl --location 'http://localhost:8080/v2/webhooks/cloth_seller_UtjuUuRAKVfLLLoRfZgg/pro_oCx1cn5sCSpSnwZaw63U/mca_BRNBJA0Q8sBoqhgNrqKc' \
--header 'stripe-signature: t=1751527430,v1=d0436759f119bd0d4c32d9601b0fb7a1b0c614a41fa8774189d82f143ceb0d54,v0=d718933a2ded633f9dae5b23d642d9c819cc618dca8b055b61810e25e961b1dc' \
--header 'accept: */*; q=0.5, application/json' \
--header 'user-agent: Stripe/1.0 (+https://stripe.com/docs/webhooks)' \
--header 'cache-control: no-cache' \
--header 'content-type: application/json; charset=utf-8' \
--data '{
"id": "evt_1RghUoCZJlEh6syL2Rj25wzT",
"object": "event",
"api_version": "2025-02-24.acacia",
"created": 1751527427,
"data": {
"object": {
"id": "in_1RghUdCZJlEh6syL1Mn3uN6W",
"object": "invoice",
"account_country": "US",
"account_name": "nishanth2",
"account_tax_ids": null,
"amount_due": 10000,
"amount_overpaid": 0,
"amount_paid": 0,
"amount_remaining": 10000,
"amount_shipping": 0,
"application": null,
"application_fee_amount": null,
"attempt_count": 1,
"attempted": true,
"auto_advance": true,
"automatic_tax": {
"disabled_reason": null,
"enabled": false,
"liability": null,
"provider": null,
"status": null
},
"automatically_finalizes_at": null,
"billing_reason": "subscription_cycle",
"charge": "ch_3RghUiCZJlEh6syL1A8rC285",
"collection_method": "charge_automatically",
"created": 1751567400,
"currency": "usd",
"custom_fields": null,
"customer": "cus_SbvK4XDxQhrfp2",
"customer_address": null,
"customer_email": null,
"customer_name": "Anikwet",
"customer_phone": null,
"customer_shipping": null,
"customer_tax_exempt": "none",
"customer_tax_ids": [],
"default_payment_method": null,
"default_source": null,
"default_tax_rates": [],
"description": null,
"discount": null,
"discounts": [],
"due_date": null,
"effective_at": 1751571000,
"ending_balance": 0,
"footer": null,
"from_invoice": null,
"hosted_invoice_url": "https://invoice.stripe.com/i/acct_1R156rCZJlEh6syL/test_YWNjdF8xUjE1NnJDWkpsRWg2c3lMLF9TYnZMZkJVZWxLc21ka3NnanVpcFRBaUZpdnlvdE8wLDE0MjA2ODIzMA0200ziIDipdc?s=ap",
"invoice_pdf": "https://pay.stripe.com/invoice/acct_1R156rCZJlEh6syL/test_YWNjdF8xUjE1NnJDWkpsRWg2c3lMLF9TYnZMZkJVZWxLc21ka3NnanVpcFRBaUZpdnlvdE8wLDE0MjA2ODIzMA0200ziIDipdc/pdf?s=ap",
"issuer": {
"type": "self"
},
"last_finalization_error": null,
"latest_revision": null,
"lines": {
"object": "list",
"data": [
{
"id": "il_1RgrtUCZJlEh6syLIS3D3MBo",
"object": "line_item",
"amount": 10000,
"amount_excluding_tax": 10000,
"currency": "usd",
"description": "1 × bhfhbwfh (at $100.00 / month)",
"discount_amounts": [],
"discountable": true,
"discounts": [],
"invoice": "in_1RghUdCZJlEh6syL1Mn3uN6W",
"livemode": false,
"metadata": {},
"parent": {
"invoice_item_details": null,
"subscription_item_details": {
"invoice_item": null,
"proration": false,
"proration_details": {
"credited_items": null
},
"subscription": "sub_1RghUJCZJlEh6syLYSoCZ5DF",
"subscription_item": "si_SbvKW8KTf722nZ"
},
"type": "subscription_item_details"
},
"period": {
"end": 1754245800,
"start": 1751567400
},
"plan": {
"id": "price_1RNvrDCZJlEh6syLxM0yTOmJ",
"object": "plan",
"active": true,
"aggregate_usage": null,
"amount": 10000,
"amount_decimal": "10000",
"billing_scheme": "per_unit",
"created": 1747054403,
"currency": "usd",
"interval": "month",
"interval_count": 1,
"livemode": false,
"metadata": {},
"meter": null,
"nickname": null,
"product": "prod_SIWvOH70HUE0k4",
"tiers_mode": null,
"transform_usage": null,
"trial_period_days": null,
"usage_type": "licensed"
},
"pretax_credit_amounts": [],
"price": {
"id": "price_1RNvrDCZJlEh6syLxM0yTOmJ",
"object": "price",
"active": true,
"billing_scheme": "per_unit",
"created": 1747054403,
"currency": "usd",
"custom_unit_amount": null,
"livemode": false,
"lookup_key": null,
"metadata": {},
"nickname": null,
"product": "prod_SIWvOH70HUE0k4",
"recurring": {
"aggregate_usage": null,
"interval": "month",
"interval_count": 1,
"meter": null,
"trial_period_days": null,
"usage_type": "licensed"
},
"tax_behavior": "unspecified",
"tiers_mode": null,
"transform_quantity": null,
"type": "recurring",
"unit_amount": 10000,
"unit_amount_decimal": "10000"
},
"pricing": {
"price_details": {
"price": "price_1RNvrDCZJlEh6syLxM0yTOmJ",
"product": "prod_SIWvOH70HUE0k4"
},
"type": "price_details",
"unit_amount_decimal": "10000"
},
"proration": false,
"proration_details": {
"credited_items": null
},
"quantity": 1,
"subscription": "sub_1RghUJCZJlEh6syLYSoCZ5DF",
"subscription_item": "si_SbvKW8KTf722nZ",
"tax_amounts": [],
"tax_rates": [],
"taxes": [],
"type": "subscription",
"unit_amount_excluding_tax": "10000"
}
],
"has_more": false,
"total_count": 1,
"url": "/v1/invoices/in_1RghUdCZJlEh6syL1Mn3uN6W/lines"
},
"livemode": false,
"metadata": {},
"next_payment_attempt": 1751728637,
"number": "5AY2AUB1-0001",
"on_behalf_of": null,
"paid": false,
"paid_out_of_band": false,
"parent": {
"quote_details": null,
"subscription_details": {
"metadata": {},
"subscription": "sub_1RghUJCZJlEh6syLYSoCZ5DF"
},
"type": "subscription_details"
},
"payment_intent": "pi_3RghUiCZJlEh6syL1nf1DJjU",
"payment_settings": {
"default_mandate": null,
"payment_method_options": null,
"payment_method_types": null
},
"period_end": 1751567400,
"period_start": 1751527399,
"post_payment_credit_notes_amount": 0,
"pre_payment_credit_notes_amount": 0,
"quote": null,
"receipt_number": null,
"rendering": null,
"shipping_cost": null,
"shipping_details": null,
"starting_balance": 0,
"statement_descriptor": null,
"status": "open",
"status_transitions": {
"finalized_at": 1751571000,
"marked_uncollectible_at": null,
"paid_at": null,
"voided_at": null
},
"subscription": "sub_1RghUJCZJlEh6syLYSoCZ5DF",
"subscription_details": {
"metadata": {}
},
"subtotal": 10000,
"subtotal_excluding_tax": 10000,
"tax": null,
"test_clock": "clock_1RghUYCZJlEh6syL7rjupJQi",
"total": 10000,
"total_discount_amounts": [],
"total_excluding_tax": 10000,
"total_pretax_credit_amounts": [],
"total_tax_amounts": [],
"total_taxes": [],
"transfer_data": null,
"webhooks_delivered_at": 1751567400
}
},
"livemode": false,
"pending_webhooks": 1,
"request": {
"id": null,
"idempotency_key": null
},
"type": "invoice.payment_failed"
}'
```
#### Webhook 2
```
curl --location 'http://localhost:8080/v2/webhooks/cloth_seller_UtjuUuRAKVfLLLoRfZgg/pro_oCx1cn5sCSpSnwZaw63U/mca_BRNBJA0Q8sBoqhgNrqKc' \
--header 'stripe-signature: t=1751528782,v1=3949ccd6d2cf800faabbae0d9444831d1b00b75c098e0b4a5c5be2fcfcc99c68,v0=97e97facf998e448ee86130da153924e8905ac8fc94b5fb4bd48e6382b26caac' \
--header 'accept: */*; q=0.5, application/json' \
--header 'user-agent: Stripe/1.0 (+https://stripe.com/docs/webhooks)' \
--header 'cache-control: no-cache' \
--header 'content-type: application/json; charset=utf-8' \
--header 'api-key;' \
--data '{
"id": "evt_1RghqcCZJlEh6syLWc3NGaNJ",
"object": "event",
"api_version": "2025-02-24.acacia",
"created": 1751528781,
"data": {
"object": {
"id": "in_1RghUdCZJlEh6syL1Mn3uN6W",
"object": "invoice",
"account_country": "US",
"account_name": "nishanth2",
"account_tax_ids": null,
"amount_due": 10000,
"amount_overpaid": 0,
"amount_paid": 0,
"amount_remaining": 10000,
"amount_shipping": 0,
"application": null,
"application_fee_amount": null,
"attempt_count": 1,
"attempted": true,
"auto_advance": true,
"automatic_tax": {
"disabled_reason": null,
"enabled": false,
"liability": null,
"provider": null,
"status": null
},
"automatically_finalizes_at": null,
"billing_reason": "subscription_cycle",
"charge": "ch_3RghUiCZJlEh6syL17CszxuH",
"collection_method": "charge_automatically",
"created": 1751567400,
"currency": "usd",
"custom_fields": null,
"customer": "cus_SbvK4XDxQhrfp2",
"customer_address": null,
"customer_email": null,
"customer_name": "Anikwet",
"customer_phone": null,
"customer_shipping": null,
"customer_tax_exempt": "none",
"customer_tax_ids": [],
"default_payment_method": null,
"default_source": null,
"default_tax_rates": [],
"description": null,
"discount": null,
"discounts": [],
"due_date": null,
"effective_at": 1751571000,
"ending_balance": 0,
"footer": null,
"from_invoice": null,
"hosted_invoice_url": "https://invoice.stripe.com/i/acct_1R156rCZJlEh6syL/test_YWNjdF8xUjE1NnJDWkpsRWg2c3lMLF9TYnZMZkJVZWxLc21ka3NnanVpcFRBaUZpdnlvdE8wLDE0MjA2OTU4Mg0200bHHKOjrD?s=ap",
"invoice_pdf": "https://pay.stripe.com/invoice/acct_1R156rCZJlEh6syL/test_YWNjdF8xUjE1NnJDWkpsRWg2c3lMLF9TYnZMZkJVZWxLc21ka3NnanVpcFRBaUZpdnlvdE8wLDE0MjA2OTU4Mg0200bHHKOjrD/pdf?s=ap",
"issuer": {
"type": "self"
},
"last_finalization_error": null,
"latest_revision": null,
"lines": {
"object": "list",
"data": [
{
"id": "il_1RgrtUCZJlEh6syLIS3D3MBo",
"object": "line_item",
"amount": 10000,
"amount_excluding_tax": 10000,
"currency": "usd",
"description": "1 × bhfhbwfh (at $100.00 / month)",
"discount_amounts": [],
"discountable": true,
"discounts": [],
"invoice": "in_1RghUdCZJlEh6syL1Mn3uN6W",
"livemode": false,
"metadata": {},
"parent": {
"invoice_item_details": null,
"subscription_item_details": {
"invoice_item": null,
"proration": false,
"proration_details": {
"credited_items": null
},
"subscription": "sub_1RghUJCZJlEh6syLYSoCZ5DF",
"subscription_item": "si_SbvKW8KTf722nZ"
},
"type": "subscription_item_details"
},
"period": {
"end": 1754245800,
"start": 1751567400
},
"plan": {
"id": "price_1RNvrDCZJlEh6syLxM0yTOmJ",
"object": "plan",
"active": true,
"aggregate_usage": null,
"amount": 10000,
"amount_decimal": "10000",
"billing_scheme": "per_unit",
"created": 1747054403,
"currency": "usd",
"interval": "month",
"interval_count": 1,
"livemode": false,
"metadata": {},
"meter": null,
"nickname": null,
"product": "prod_SIWvOH70HUE0k4",
"tiers_mode": null,
"transform_usage": null,
"trial_period_days": null,
"usage_type": "licensed"
},
"pretax_credit_amounts": [],
"price": {
"id": "price_1RNvrDCZJlEh6syLxM0yTOmJ",
"object": "price",
"active": true,
"billing_scheme": "per_unit",
"created": 1747054403,
"currency": "usd",
"custom_unit_amount": null,
"livemode": false,
"lookup_key": null,
"metadata": {},
"nickname": null,
"product": "prod_SIWvOH70HUE0k4",
"recurring": {
"aggregate_usage": null,
"interval": "month",
"interval_count": 1,
"meter": null,
"trial_period_days": null,
"usage_type": "licensed"
},
"tax_behavior": "unspecified",
"tiers_mode": null,
"transform_quantity": null,
"type": "recurring",
"unit_amount": 10000,
"unit_amount_decimal": "10000"
},
"pricing": {
"price_details": {
"price": "price_1RNvrDCZJlEh6syLxM0yTOmJ",
"product": "prod_SIWvOH70HUE0k4"
},
"type": "price_details",
"unit_amount_decimal": "10000"
},
"proration": false,
"proration_details": {
"credited_items": null
},
"quantity": 1,
"subscription": "sub_1RghUJCZJlEh6syLYSoCZ5DF",
"subscription_item": "si_SbvKW8KTf722nZ",
"tax_amounts": [],
"tax_rates": [],
"taxes": [],
"type": "subscription",
"unit_amount_excluding_tax": "10000"
}
],
"has_more": false,
"total_count": 1,
"url": "/v1/invoices/in_1RghUdCZJlEh6syL1Mn3uN6W/lines"
},
"livemode": false,
"metadata": {},
"next_payment_attempt": 1751728637,
"number": "5AY2AUB1-0001",
"on_behalf_of": null,
"paid": false,
"paid_out_of_band": false,
"parent": {
"quote_details": null,
"subscription_details": {
"metadata": {},
"subscription": "sub_1RghUJCZJlEh6syLYSoCZ5DF"
},
"type": "subscription_details"
},
"payment_intent": "pi_3RghUiCZJlEh6syL1nf1DJjU",
"payment_settings": {
"default_mandate": null,
"payment_method_options": null,
"payment_method_types": null
},
"period_end": 1751567400,
"period_start": 1751527399,
"post_payment_credit_notes_amount": 0,
"pre_payment_credit_notes_amount": 0,
"quote": null,
"receipt_number": null,
"rendering": null,
"shipping_cost": null,
"shipping_details": null,
"starting_balance": 0,
"statement_descriptor": null,
"status": "open",
"status_transitions": {
"finalized_at": 1751571000,
"marked_uncollectible_at": null,
"paid_at": null,
"voided_at": null
},
"subscription": "sub_1RghUJCZJlEh6syLYSoCZ5DF",
"subscription_details": {
"metadata": {}
},
"subtotal": 10000,
"subtotal_excluding_tax": 10000,
"tax": null,
"test_clock": "clock_1RghUYCZJlEh6syL7rjupJQi",
"total": 10000,
"total_discount_amounts": [],
"total_excluding_tax": 10000,
"total_pretax_credit_amounts": [],
"total_tax_amounts": [],
"total_taxes": [],
"transfer_data": null,
"webhooks_delivered_at": 1751567400
}
},
"livemode": false,
"pending_webhooks": 1,
"request": {
"id": "req_3YsUGkNRBqgJ2c",
"idempotency_key": "072f9dde-db1d-45bd-9a64-483cc341b70a"
},
"type": "invoice.payment_failed"
}'
```
#### Webhook 3
```
curl --location 'http://localhost:8080/v2/webhooks/cloth_seller_UtjuUuRAKVfLLLoRfZgg/pro_oCx1cn5sCSpSnwZaw63U/mca_BRNBJA0Q8sBoqhgNrqKc' \
--header 'stripe-signature: t=1751528824,v1=4fd343c36f9b1c61a77b2f430b525ce3b435e4cbf6e58a8946752418aedf10d3,v0=b122d260854d5ad2b8f86f3bc78e09e8a19f1914e5bdf399e6a52a4da2c7190a' \
--header 'accept: */*; q=0.5, application/json' \
--header 'user-agent: Stripe/1.0 (+https://stripe.com/docs/webhooks)' \
--header 'cache-control: no-cache' \
--header 'content-type: application/json; charset=utf-8' \
--header 'api-key;' \
--data '{
"id": "evt_1RghrICZJlEh6syL9K2XJoSP",
"object": "event",
"api_version": "2025-02-24.acacia",
"created": 1751528823,
"data": {
"object": {
"id": "in_1RghUdCZJlEh6syL1Mn3uN6W",
"object": "invoice",
"account_country": "US",
"account_name": "nishanth2",
"account_tax_ids": null,
"amount_due": 10000,
"amount_overpaid": 0,
"amount_paid": 0,
"amount_remaining": 10000,
"amount_shipping": 0,
"application": null,
"application_fee_amount": null,
"attempt_count": 1,
"attempted": true,
"auto_advance": true,
"automatic_tax": {
"disabled_reason": null,
"enabled": false,
"liability": null,
"provider": null,
"status": null
},
"automatically_finalizes_at": null,
"billing_reason": "subscription_cycle",
"charge": "ch_3RghUiCZJlEh6syL1aUfCKJ9",
"collection_method": "charge_automatically",
"created": 1751567400,
"currency": "usd",
"custom_fields": null,
"customer": "cus_SbvK4XDxQhrfp2",
"customer_address": null,
"customer_email": null,
"customer_name": "Anikwet",
"customer_phone": null,
"customer_shipping": null,
"customer_tax_exempt": "none",
"customer_tax_ids": [],
"default_payment_method": null,
"default_source": null,
"default_tax_rates": [],
"description": null,
"discount": null,
"discounts": [],
"due_date": null,
"effective_at": 1751571000,
"ending_balance": 0,
"footer": null,
"from_invoice": null,
"hosted_invoice_url": "https://invoice.stripe.com/i/acct_1R156rCZJlEh6syL/test_YWNjdF8xUjE1NnJDWkpsRWg2c3lMLF9TYnZMZkJVZWxLc21ka3NnanVpcFRBaUZpdnlvdE8wLDE0MjA2OTYyNA0200i196xMb2?s=ap",
"invoice_pdf": "https://pay.stripe.com/invoice/acct_1R156rCZJlEh6syL/test_YWNjdF8xUjE1NnJDWkpsRWg2c3lMLF9TYnZMZkJVZWxLc21ka3NnanVpcFRBaUZpdnlvdE8wLDE0MjA2OTYyNA0200i196xMb2/pdf?s=ap",
"issuer": {
"type": "self"
},
"last_finalization_error": null,
"latest_revision": null,
"lines": {
"object": "list",
"data": [
{
"id": "il_1RgrtUCZJlEh6syLIS3D3MBo",
"object": "line_item",
"amount": 10000,
"amount_excluding_tax": 10000,
"currency": "usd",
"description": "1 × bhfhbwfh (at $100.00 / month)",
"discount_amounts": [],
"discountable": true,
"discounts": [],
"invoice": "in_1RghUdCZJlEh6syL1Mn3uN6W",
"livemode": false,
"metadata": {},
"parent": {
"invoice_item_details": null,
"subscription_item_details": {
"invoice_item": null,
"proration": false,
"proration_details": {
"credited_items": null
},
"subscription": "sub_1RghUJCZJlEh6syLYSoCZ5DF",
"subscription_item": "si_SbvKW8KTf722nZ"
},
"type": "subscription_item_details"
},
"period": {
"end": 1754245800,
"start": 1751567400
},
"plan": {
"id": "price_1RNvrDCZJlEh6syLxM0yTOmJ",
"object": "plan",
"active": true,
"aggregate_usage": null,
"amount": 10000,
"amount_decimal": "10000",
"billing_scheme": "per_unit",
"created": 1747054403,
"currency": "usd",
"interval": "month",
"interval_count": 1,
"livemode": false,
"metadata": {},
"meter": null,
"nickname": null,
"product": "prod_SIWvOH70HUE0k4",
"tiers_mode": null,
"transform_usage": null,
"trial_period_days": null,
"usage_type": "licensed"
},
"pretax_credit_amounts": [],
"price": {
"id": "price_1RNvrDCZJlEh6syLxM0yTOmJ",
"object": "price",
"active": true,
"billing_scheme": "per_unit",
"created": 1747054403,
"currency": "usd",
"custom_unit_amount": null,
"livemode": false,
"lookup_key": null,
"metadata": {},
"nickname": null,
"product": "prod_SIWvOH70HUE0k4",
"recurring": {
"aggregate_usage": null,
"interval": "month",
"interval_count": 1,
"meter": null,
"trial_period_days": null,
"usage_type": "licensed"
},
"tax_behavior": "unspecified",
"tiers_mode": null,
"transform_quantity": null,
"type": "recurring",
"unit_amount": 10000,
"unit_amount_decimal": "10000"
},
"pricing": {
"price_details": {
"price": "price_1RNvrDCZJlEh6syLxM0yTOmJ",
"product": "prod_SIWvOH70HUE0k4"
},
"type": "price_details",
"unit_amount_decimal": "10000"
},
"proration": false,
"proration_details": {
"credited_items": null
},
"quantity": 1,
"subscription": "sub_1RghUJCZJlEh6syLYSoCZ5DF",
"subscription_item": "si_SbvKW8KTf722nZ",
"tax_amounts": [],
"tax_rates": [],
"taxes": [],
"type": "subscription",
"unit_amount_excluding_tax": "10000"
}
],
"has_more": false,
"total_count": 1,
"url": "/v1/invoices/in_1RghUdCZJlEh6syL1Mn3uN6W/lines"
},
"livemode": false,
"metadata": {},
"next_payment_attempt": 1751728637,
"number": "5AY2AUB1-0001",
"on_behalf_of": null,
"paid": false,
"paid_out_of_band": false,
"parent": {
"quote_details": null,
"subscription_details": {
"metadata": {},
"subscription": "sub_1RghUJCZJlEh6syLYSoCZ5DF"
},
"type": "subscription_details"
},
"payment_intent": "pi_3RghUiCZJlEh6syL1nf1DJjU",
"payment_settings": {
"default_mandate": null,
"payment_method_options": null,
"payment_method_types": null
},
"period_end": 1751567400,
"period_start": 1751527399,
"post_payment_credit_notes_amount": 0,
"pre_payment_credit_notes_amount": 0,
"quote": null,
"receipt_number": null,
"rendering": null,
"shipping_cost": null,
"shipping_details": null,
"starting_balance": 0,
"statement_descriptor": null,
"status": "open",
"status_transitions": {
"finalized_at": 1751571000,
"marked_uncollectible_at": null,
"paid_at": null,
"voided_at": null
},
"subscription": "sub_1RghUJCZJlEh6syLYSoCZ5DF",
"subscription_details": {
"metadata": {}
},
"subtotal": 10000,
"subtotal_excluding_tax": 10000,
"tax": null,
"test_clock": "clock_1RghUYCZJlEh6syL7rjupJQi",
"total": 10000,
"total_discount_amounts": [],
"total_excluding_tax": 10000,
"total_pretax_credit_amounts": [],
"total_tax_amounts": [],
"total_taxes": [],
"transfer_data": null,
"webhooks_delivered_at": 1751567400
}
},
"livemode": false,
"pending_webhooks": 1,
"request": {
"id": "req_mRsFYF3quUnlh5",
"idempotency_key": "53d702db-6ee1-4964-a2bc-a6e34fe4f834"
},
"type": "invoice.payment_failed"
}'
```
PASSIVE_RECOVERY_WORKFLOW_EXECUTE_WORKFLOW was executed and on failure the invoice was not voided.
<img width="1140" alt="Screenshot 2025-07-04 at 4 47 45 PM" src="https://github.com/user-attachments/assets/62d5a3bd-da78-46a3-bd65-e1560357e7ad" />
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/revenue_recovery/types.rs`
**2. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/stripebilling.rs`
- `crates/hyperswitch_connectors/src/connectors/stripebilling/transformers.rs`
**Code Patterns Applied:**
- Define new data structures (1 changes)
**Detailed Identifier Changes:**
Commit 82cf2cb1:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/stripebilling.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/stripebilling/transformers.rs**
Remove:
- struct: pub::StripebillingBillingConnectorPaymentSyncResponseData
- struct: pub::StripebillingLatestChargeData
Add:
- struct: pub::StripebillingRecoveryDetailsData
**crates/router/src/core/revenue_recovery/types.rs**
Modify existing code
|
{"pr_number": 8548, "pr_title": "fix(RevenueRecovery): Skip record-back for failed invoices on auto-voiding billing connectors", "merged_at": "2025-08-01T10:58:15Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/revenue_recovery/types.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/stripebilling.rs", "crates/hyperswitch_connectors/src/connectors/stripebilling/transformers.rs"]}, "change_types": {"structs_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(payouts): apple pay decrypt payout
## 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 -->
- Payout is done via Decrypted Token data of Apple pay.
- The decrypted data is directly collected in the request to initiate payout.
- Integration is done via Worldpay for the following flow
Note: this is a hotfix raised against https://github.com/juspay/hyperswitch/pull/9857
### Additional Changes
- [x] This PR modifies the API contract
```
"payout_method_data": {
"wallet": {
"apple_pay_decrypt": {
"dpan": "4444333322221111",
"expiry_month": "05",
"expiry_year": "2035",
"card_holder_name": "John Appleseed"
}
}
},
```
- [ ] 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 an MCA with WorldPay for payouts
Do a payout request with apple pay decrypted data:
```
curl --location '{{baseUrl}}/payouts/create' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: ={{api_key}}' \
--data-raw '{
"amount": 100,
"currency": "GBP",
"customer_id": "payout_customer",
"email": "payout_customer@example.com",
"name": "John Doe",
"phone": "999999999",
"profile_id": "{{profile_id}}",
"phone_country_code": "+65",
"description": "Its my first payout request",
"payout_type": "wallet",
"payout_method_data": {
"wallet": {
"apple_pay_decrypt": {
"dpan": "4444333322221111",
"expiry_month": "05",
"expiry_year": "2035",
"card_holder_name": "John Appleseed"
}
}
},
"entity_type": "Individual",
"recurring": true,
"metadata": {
"ref": "123"
},
"auto_fulfill": true,
"confirm": true
}'
```
response should have status as `initiated`, below is an example
```
{
"payout_id": "payout_EVQi7ysLwVQ7cSuK2POO",
"merchant_id": "merchant_1760528955",
"merchant_order_reference_id": null,
"amount": 100,
"currency": "GBP",
"connector": "worldpay",
"payout_type": "wallet",
"payout_method_data": {
"wallet": {
"email": null,
"telephone_number": null,
"paypal_id": null
}
},
"billing": null,
"auto_fulfill": true,
"customer_id": "payout_customer",
"customer": {
"id": "payout_customer",
"name": "John Doe",
"email": "payout_customer@example.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"client_secret": "payout_payout_EVQi7ysLwVQ7cSuK2POO_secret_6UFSzfVYuJ5GfA9Brxb1",
"return_url": null,
"business_country": null,
"business_label": null,
"description": "Its my first payout request",
"entity_type": "Individual",
"recurring": true,
"metadata": {
"ref": "123"
},
"merchant_connector_id": "mca_SRDKLfmRXfgKlJgjxE2P",
"status": "initiated",
"error_message": null,
"error_code": null,
"profile_id": "pro_UE5pBOruekGz1eD2yWxW",
"created": "2025-10-15T12:05:17.747Z",
"connector_transaction_id": null,
"priority": null,
"payout_link": null,
"email": "payout_customer@example.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"unified_code": null,
"unified_message": null,
"payout_method_id": "pm_s8SUzT8ndfakfZ7Pw0Dn"
}
```
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/enums.rs`
- `crates/api_models/src/payouts.rs`
**2. Core Business Logic**
- `crates/router/src/core/payment_methods/vault.rs`
**3. External Connector Integration**
- `crates/common_enums/src/connector_enums.rs`
- `crates/connector_configs/src/connector.rs`
- `crates/connector_configs/toml/development.toml`
- ... and 10 more files
**4. Type Definitions**
- `crates/router/src/types/transformers.rs`
**5. Utils**
- `crates/common_utils/src/payout_method_utils.rs`
**6. Other**
- `api-reference/v1/openapi_spec_v1.json`
- `api-reference/v2/openapi_spec_v2.json`
- `crates/openapi/src/openapi.rs`
- ... and 1 more files
**Code Patterns Applied:**
- Define new data structures (13 changes)
- Implement new functions (27 changes)
- Extend existing types with new fields (107 changes)
- Add conditional logic for feature flags or filtering (1 changes)
**Detailed Identifier Changes:**
Commit 4b27e118:
Files to modify:
**crates/api_models/src/enums.rs**
Modify existing code
**crates/api_models/src/payouts.rs**
Add:
- struct: pub::ApplePayDecrypt
**crates/common_enums/src/connector_enums.rs**
Modify existing code
**crates/common_utils/src/payout_method_utils.rs**
Modify existing code
**crates/connector_configs/src/connector.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/worldpay.rs**
Add:
- function: private::get_url
- function: private::get_headers
- 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::Payouts for Worldpay
- impl: impl api::PayoutFulfill for Worldpay
- impl: impl ConnectorIntegration<PoFulfill, PayoutsData, PayoutsResponseData> for Worldpay
- mod: private::payout_requests
- mod: private::payout_response
- mod: pub::payout_transformers
**crates/hyperswitch_connectors/src/connectors/worldpay/payout_requests.rs**
Add:
- struct: pub::WorldpayPayoutRequest
- struct: pub::PayoutInstruction
- struct: pub::PayoutValue
- struct: pub::Merchant
- struct: pub::InstructionNarrative
- struct: pub::ApplePayDecrypt
- struct: pub::PayoutExpiryDate
- enum: pub::PayoutInstrument
- enum: pub::PayoutType
**crates/hyperswitch_connectors/src/connectors/worldpay/payout_response.rs**
Add:
- struct: pub::WorldpayPayoutResponse
- enum: pub::PayoutOutcome
**crates/hyperswitch_connectors/src/connectors/worldpay/payout_transformers.rs**
Add:
- function: private::try_from
- function: private::try_from
- function: private::try_from
- function: private::try_from
- function: private::try_from
- function: private::from
- function: private::try_from
- struct: pub::WorldpayPayoutRouterData
- struct: pub::WorldpayPayoutAuthType
- struct: pub::WorldpayPayoutConnectorMetadataObject
- impl: impl TryFrom<(&api::CurrencyUnit, enums::Currency, MinorUnit, T)> for WorldpayPayoutRouterData<T>
- impl: impl TryFrom<&ConnectorAuthType> for WorldpayPayoutAuthType
- impl: impl TryFrom<Option<&pii::SecretSerdeValue>> for WorldpayPayoutConnectorMetadataObject
- impl: impl TryFrom<(
&WorldpayPayoutRouterData<&types::PayoutsRouterData<F>>,
&Secret<String>,
)> for WorldpayPayoutRequest
- impl: impl TryFrom<api_models::payouts::PayoutMethodData> for PayoutInstrument
- impl: impl From<PayoutOutcome> for enums::PayoutStatus
- impl: impl TryFrom<PayoutsResponseRouterData<PoFulfill, WorldpayPayoutResponse>> for types::PayoutsRouterData<PoFulfill>
**crates/hyperswitch_connectors/src/default_implementations.rs**
Modify existing code
**crates/hyperswitch_connectors/src/utils.rs**
Add:
- function: private::get_card_expiry_year_2_digit
- function: private::get_card_expiry_month_2_digit
- function: private::get_card_issuer
- function: private::get_card_expiry_month_year_2_digit_with_delimiter
- function: private::get_expiry_date_as_yyyymm
- function: private::get_expiry_date_as_mmyyyy
- function: private::get_expiry_year_4_digit
- function: private::get_expiry_date_as_yymm
- function: private::get_expiry_date_as_mmyy
- function: private::get_expiry_month_as_i8
- function: private::get_expiry_year_as_i32
- function: private::get_expiry_year_as_4_digit_i32
- function: private::get_cardholder_name
- impl: impl CardData for api_models::payouts::ApplePayDecrypt
**crates/openapi/src/openapi.rs**
Modify existing code
**crates/openapi/src/openapi_v2.rs**
Modify existing code
**crates/router/src/core/payment_methods/vault.rs**
Modify existing code
**crates/router/src/types/transformers.rs**
Modify existing code
|
{"pr_number": 9875, "pr_title": "feat(payouts): apple pay decrypt payout", "merged_at": "2025-10-16T08:47:47Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "merchant", "order"]}, "hierarchy": {"api_models": ["crates/api_models/src/enums.rs", "crates/api_models/src/payouts.rs"], "core_business": ["crates/router/src/core/payment_methods/vault.rs"], "connectors": ["crates/common_enums/src/connector_enums.rs", "crates/connector_configs/src/connector.rs", "crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml", "crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs", "crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs", "crates/hyperswitch_connectors/src/connectors/worldpay.rs", "crates/hyperswitch_connectors/src/connectors/worldpay/payout_requests.rs", "crates/hyperswitch_connectors/src/connectors/worldpay/payout_response.rs", "crates/hyperswitch_connectors/src/connectors/worldpay/payout_transformers.rs", "crates/hyperswitch_connectors/src/default_implementations.rs", "crates/hyperswitch_connectors/src/utils.rs"], "types": ["crates/router/src/types/transformers.rs"], "utils": ["crates/common_utils/src/payout_method_utils.rs"], "other": ["api-reference/v1/openapi_spec_v1.json", "api-reference/v2/openapi_spec_v2.json", "crates/openapi/src/openapi.rs", "crates/openapi/src/openapi_v2.rs"]}, "change_types": {"structs_added": 13, "functions_added": 27, "enums_added": 3, "fields_added": 107, "imports_added": 17, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
ci(cypress-ci): remove wise payout from running in github ci
## 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 updates the `adyen` payouts credentials and it also replaces wise from running in github ci
### 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).
-->
ci checks are failing across all prs. closes #7755
## 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)?
-->
ci checks should pass.
## 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 the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Tests**
- `.github/workflows/cypress-tests-runner.yml`
**Code Patterns Applied:**
- Extend existing types with new fields (1 changes)
|
{"pr_number": 7756, "pr_title": "ci(cypress-ci): remove wise payout from running in github ci", "merged_at": "2025-04-08T08:31:18Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"tests": [".github/workflows/cypress-tests-runner.yml"]}, "change_types": {"fields_added": 1}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
fix(connector): Added Paypal in feature matrix for authorizedotnet
## Type of Change
Added paypal in feature matrix for authorizedotnet
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Added the missed feature matrix supported PM , paypal for authorizedotnet.
Changes we added to authorizedotnet.rs file only, .toml files already have the desired changes in original PR.
Original PR : #7854
### 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)?
-->
- Test 1 automatic capture



- Test 2 manual caputre



### Curls
- Create payment
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_WlwTNRDOUFvLzRht0IFye9JoAUwJ46AYUsLoPixau2EW1pgE78hRg8dveoMiNJH8' \
--data-raw '{
"amount": 1,
"currency": "USD",
"confirm": true,
"capture_method": "manual",
"connector": [
"authorizedotnet"
],
"authentication_type": "three_ds",
"customer_id": "customer_paypal_test_123",
"description": "PAYPAL TEST payment through authorizedotnet",
"return_url": "http://localhost:8080/",
"payment_method": "wallet",
"payment_method_type": "paypal",
"payment_method_data": {
"wallet": {
"paypal_redirect": {}
}
},
"billing": {
"address": {
"line1": "123 Mandate Lane",
"city": "Mandateville",
"state": "TestState",
"zip": "12345",
"country": "US",
"first_name": "Mandate",
"last_name": "User"
},
"phone": {
"number": "9997776666",
"country_code": "+1"
},
"email": "user@example.com"
},
"merchant_order_reference_id": "authnet_paypal_test"
}'
```
- Get payment status
```
curl --location 'http://localhost:8080/payments/{{PAYMENT_ID}}?force_sync=true&expand_captures=true&expand_attempts=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_WlwTNRDOUFvLzRht0IFye9JoAUwJ46AYUsLoPixau2EW1pgE78hRg8dveoMiNJH8'
```
- Manual Capture
```
curl --location 'http://localhost:8080/payments/{{PAYMENT_IDS}}/capture' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_WlwTNRDOUFvLzRht0IFye9JoAUwJ46AYUsLoPixau2EW1pgE78hRg8dveoMiNJH8' \
--data '{
"amount_to_capture": 1,
"statement_descriptor_name": "Joseph",
"statement_descriptor_prefix" :"joseph",
"statement_descriptor_suffix": "JS"
}'
```
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (4 changes)
**Detailed Identifier Changes:**
Commit 5f5998fb:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs**
Modify existing code
|
{"pr_number": 8072, "pr_title": "fix(connector): Added Paypal in feature matrix for authorizedotnet", "merged_at": "2025-05-21T10:23:21Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs"]}, "change_types": {"fields_added": 4}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): [BRAINTREE] Add revoke mandate 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 -->
ORIGINAL PR: https://github.com/juspay/hyperswitch/pull/7525
Add mandate revoke flow to Braintree
https://developer.paypal.com/braintree/graphql/guides/payment_methods/#delete
### 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).
-->
https://github.com/juspay/hyperswitch/issues/7526
## 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)?
-->
Revoking an existing mandate using tunnel needs to be tested:
Request:
```
curl --location 'http://localhost:8080/vs/v1/payment_methods/man_OVY39ecmn6QDAxh18qIe/detach' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'User-Agent: helloMozilla/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' \
--header 'api-key: HIDDEN' \
--data-urlencode 'merchant_connector_details%5Bencoded_data%5D=HIDDEN'
```
Response:
```
{
"mandate_id": "man_OVY39ecmn6QDAxh18qIe",
"status": "revoked",
"error_code": null,
"error_message": 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/braintree.rs`
- `crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs`
- `crates/hyperswitch_connectors/src/default_implementations.rs`
**Code Patterns Applied:**
- Define new data structures (5 changes)
- Implement new functions (8 changes)
- Extend existing types with new fields (26 changes)
**Detailed Identifier Changes:**
Commit ffc25ded:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/braintree.rs**
Add:
- function: private::get_headers
- function: private::get_url
- function: private::build_request
- function: private::get_request_body
- function: private::handle_response
- function: private::get_error_response
- impl: impl api::ConnectorMandateRevoke for Braintree
- impl: impl ConnectorIntegration<MandateRevoke, MandateRevokeRequestData, MandateRevokeResponseData> for Braintree
**crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs**
Add:
- function: private::try_from
- function: private::try_from
- struct: pub::DeletePaymentMethodFromVaultInputData
- struct: pub::VariableDeletePaymentMethodFromVaultInput
- struct: pub::BraintreeRevokeMandateRequest
- struct: pub::RevokeMandateResponse
- struct: pub::DeletePaymentMethodFromVault
- enum: pub::BraintreeRevokeMandateResponse
- impl: impl TryFrom<&types::MandateRevokeRouterData> for BraintreeRevokeMandateRequest
- impl: impl TryFrom<
ResponseRouterData<
F,
BraintreeRevokeMandateResponse,
MandateRevokeRequestData,
MandateRevokeResponseData,
>,
> for RouterData<F, MandateRevokeRequestData, MandateRevokeResponseData>
**crates/hyperswitch_connectors/src/default_implementations.rs**
Modify existing code
|
{"pr_number": 7527, "pr_title": "feat(connector): [BRAINTREE] Add revoke mandate flow", "merged_at": "2025-03-15T12:12:25Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "user"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/braintree.rs", "crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs", "crates/hyperswitch_connectors/src/default_implementations.rs"]}, "change_types": {"structs_added": 5, "functions_added": 8, "enums_added": 1, "fields_added": 26}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connector): [Novalnet] send decoded token for apple pay payment
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [X] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
We're passing base64 encoded data in SetupMandate flow for apple pay token, but Novalnet expects apple pay token as decoded raw string. This PR fixes this.
### 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)?
-->
Cannot be tested locally.
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (1 changes)
**Detailed Identifier Changes:**
Commit 9aef6fcd:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs**
Modify existing code
|
{"pr_number": 7973, "pr_title": "fix(connector): [Novalnet] send decoded token for apple pay payment", "merged_at": "2025-05-12T15:06:33Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["token"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs"]}, "change_types": {"fields_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): [PAYSTACK] Electronic Fund Transfer(EFT) Payment Flows
## 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 -->
Paystack EFT flow (Payments, PSync, Refunds, RSync, Webhooks).
### 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)?
-->
1. Merchant Account Create:
```
curl --location 'http://localhost:8080/accounts' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data-raw '{
"merchant_id": "merchant_1739960795",
"locker_id": "m0010",
"merchant_name": "NewAge Retailer",
"merchant_details": {
"primary_contact_person": "John Test",
"primary_email": "JohnTest@test.com",
"primary_phone": "sunt laborum",
"secondary_contact_person": "John Test2",
"secondary_email": "JohnTest2@test.com",
"secondary_phone": "cillum do dolor id",
"website": "https://www.example.com",
"about_business": "Online Retail with a wide selection of organic products for North America",
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US"
}
},
"return_url": "https://google.com/success",
"webhook_details": {
"webhook_version": "1.0.1",
"webhook_username": "ekart_retail",
"webhook_password": "password_ekart@123",
"payment_created_enabled": true,
"payment_succeeded_enabled": true,
"payment_failed_enabled": true
},
"sub_merchants_enabled": false,
"metadata": {
"city": "NY",
"unit": "245"
},
"primary_business_details": [
{
"country": "US",
"business": "food"
}
]
}'
```
2. API Key Create:
```
curl --location 'http://localhost:8080/api_keys/merchant_1739898797' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data '{
"name": "API Key 1",
"description": null,
"expiration": "2025-09-23T01:02:03.000Z"
}'
```
3. Paystack Connector Create:
```
curl --location 'http://localhost:8080/account/merchant_1739898797/connectors?=' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data '{
"connector_type": "payment_processor",
"connector_name": "paystack",
"connector_account_details": {
"auth_type": "HeaderKey",
"api_key": "abc"
},
"test_mode": false,
"disabled": false,
"payment_methods_enabled": [
{
"payment_method": "bank_redirect",
"payment_method_types": [
{
"payment_method_type": "eft",
"payment_experience": "redirect_to_url",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
}
]
}
],
"connector_webhook_details": {
"merchant_secret": "abc",
"additional_secret": null
}
}'
```
4. Payments Create:
Request:
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_ykM0z3Y0k65EtZIce9BsbJXPtoq7KzcAWsLZUS3SIT13cdYEOQQ4mMkb4UMB5Oyd' \
--data-raw '{
"amount": 6540,
"currency": "ZAR",
"confirm": true,
"amount_to_capture": 6540,
"customer_id": "StripbmnxeCustomer",
"email": "abc@gmail.com",
"description": "Its my first payment request",
"return_url": "https://google.com",
"payment_method": "bank_redirect",
"payment_method_type": "eft",
"payment_method_data": {
"bank_redirect": {
"eft": {
"provider": "ozow"
}
}
}
}'
```
Response:
```
{
"payment_id": "pay_kQrdGr1rVMmwEKYXorLM",
"merchant_id": "merchant_1739898797",
"status": "requires_customer_action",
"amount": 6540,
"net_amount": 6540,
"shipping_cost": null,
"amount_capturable": 6540,
"amount_received": null,
"connector": "paystack",
"client_secret": "pay_kQrdGr1rVMmwEKYXorLM_secret_U7lStVK9TuKNY4l0mxmc",
"created": "2025-02-19T10:32:31.775Z",
"currency": "ZAR",
"customer_id": "StripbmnxeCustomer",
"customer": {
"id": "StripbmnxeCustomer",
"name": null,
"email": "abc@gmail.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": null,
"payment_method": "bank_redirect",
"payment_method_data": {
"bank_redirect": {
"type": "BankRedirectResponse",
"bank_name": null
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": null,
"order_details": null,
"email": "abc@gmail.com",
"name": null,
"phone": null,
"return_url": "https://google.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": {
"type": "redirect_to_url",
"redirect_to_url": "http://localhost:8080/payments/redirect/pay_kQrdGr1rVMmwEKYXorLM/merchant_1739898797/pay_kQrdGr1rVMmwEKYXorLM_1"
},
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "eft",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "StripbmnxeCustomer",
"created_at": 1739961151,
"expires": 1739964751,
"secret": "epk_09592792e8504aa3a943feff38c3e3e2"
},
"manual_retry_allowed": null,
"connector_transaction_id": "sug0jyf5kbbbpe5",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_z5wMP3CJUUrMDF5CBGl9",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_Ux3UO8AL0iD9BlzLSE83",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-02-19T10:47:31.774Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-02-19T10:32:32.739Z",
"split_payments": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
5. Payments Retrieve
Request:
```
curl --location 'http://localhost:8080/payments/pay_kWVz157PfvGL9GyAiTnI?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_ykM0z3Y0k65EtZIce9BsbJXPtoq7KzcAWsLZUS3SIT13cdYEOQQ4mMkb4UMB5Oyd' \
--data ''
```
Response: Same as payments response>
6. Refunds Create
Request:
```
curl --location 'http://localhost:8080/refunds' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_ykM0z3Y0k65EtZIce9BsbJXPtoq7KzcAWsLZUS3SIT13cdYEOQQ4mMkb4UMB5Oyd' \
--data '{
"payment_id": "pay_6Ww3WmcWCT8ni7O5K5gV",
"amount": 1000,
"reason": "Customer returned product",
"refund_type": "instant",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}'
```
Response:
```
{
"refund_id": "ref_XSsCj6O6bujAZypJAFJk",
"payment_id": "pay_6Ww3WmcWCT8ni7O5K5gV",
"amount": 1000,
"currency": "ZAR",
"status": "succeeded",
"reason": "Customer returned product",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"error_message": null,
"error_code": null,
"unified_code": null,
"unified_message": null,
"created_at": "2025-02-19T10:31:32.658Z",
"updated_at": "2025-02-19T10:31:34.094Z",
"connector": "paystack",
"profile_id": "pro_z5wMP3CJUUrMDF5CBGl9",
"merchant_connector_id": "mca_Ux3UO8AL0iD9BlzLSE83",
"split_refunds": null
}
```
7. Refunds Retrieve
Request:
```
curl --location 'http://localhost:8080/refunds/ref_XSsCj6O6bujAZypJAFJk' \
--header 'Accept: application/json' \
--header 'api-key: dev_ZgTXlFsnanc0o4AW2Ag32dJQsA1rAvU1prQVsIE0JbUjPv7g65ZU5pO7MyiPLL5J'
```
Response: Same as Refunds response.
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/connector_configs/toml/development.toml`
- `crates/connector_configs/toml/production.toml`
- `crates/connector_configs/toml/sandbox.toml`
- ... and 2 more files
**Code Patterns Applied:**
- Define new data structures (11 changes)
- Implement new functions (10 changes)
- Extend existing types with new fields (127 changes)
- Add conditional logic for feature flags or filtering (1 changes)
**Detailed Identifier Changes:**
Commit c39ecda7:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/paystack.rs**
Add:
- function: private::get_webhook_source_verification_algorithm
- function: private::get_webhook_source_verification_signature
- function: private::get_webhook_source_verification_message
**crates/hyperswitch_connectors/src/connectors/paystack/transformers.rs**
Remove:
- struct: pub::PaystackPaymentsRequest
- enum: pub::PaystackPaymentStatus
Add:
- function: private::from
- struct: pub::PaystackEftProvider
- struct: pub::PaystackRefundsData
- enum: pub::PaystackPSyncStatus
- impl: impl From<(MinorUnit, T)> for PaystackRouterData<T>
|
{"pr_number": 7440, "pr_title": "feat(connector): [PAYSTACK] Electronic Fund Transfer(EFT) Payment Flows", "merged_at": "2025-03-17T07:21:35Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml", "crates/hyperswitch_connectors/src/connectors/paystack.rs", "crates/hyperswitch_connectors/src/connectors/paystack/transformers.rs"]}, "change_types": {"structs_added": 11, "functions_added": 10, "enums_added": 6, "fields_added": 127, "imports_added": 5, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
ci(cypress): Added Config Testcases
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [x] CI/CD
## Description
Added below config related testcases in cypress
"collect_shipping_details_from_wallet_connector"
"collect_billing_details_from_wallet_connector"
"always_collect_billing_details_from_wallet_connector"
"always_collect_shipping_details_from_wallet_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
To validate the config changes in automation
## How did you test it?
Ran locally
<img width="611" alt="Screenshot 2024-11-20 at 6 53 20 PM" src="https://github.com/user-attachments/assets/b051a521-8448-4a95-854a-96adf1a096cf">
<img width="616" alt="Screenshot 2024-11-20 at 6 56 25 PM" src="https://github.com/user-attachments/assets/6ae1ff8a-2a4d-4da2-a7f7-69657a37e43a">
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Tests**
- `cypress-tests/cypress/e2e/PaymentTest/00024-ConnectorAgnostic.cy.js`
- `cypress-tests/cypress/e2e/PaymentTest/00025-ConfigTest.cy.js`
- `cypress-tests/cypress/fixtures/business-profile.json`
- ... and 4 more files
**Code Patterns Applied:**
- Add conditional logic for feature flags or filtering (17 changes)
|
{"pr_number": 6622, "pr_title": "ci(cypress): Added Config Testcases", "merged_at": "2024-11-28T09:34:54Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user", "connector"]}, "hierarchy": {"tests": ["cypress-tests/cypress/e2e/PaymentTest/00024-ConnectorAgnostic.cy.js", "cypress-tests/cypress/e2e/PaymentTest/00025-ConfigTest.cy.js", "cypress-tests/cypress/fixtures/business-profile.json", "cypress-tests/cypress/fixtures/create-business-profile.json", "cypress-tests/cypress/fixtures/imports.js", "cypress-tests/cypress/fixtures/update-business-profile.json", "cypress-tests/cypress/support/commands.js"]}, "change_types": {"conditionals_added": 17}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
refactor(grpc): send `x-tenant-id` and `x-request-id` in grpc headers
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
This PR adds support for sending the `x-tenant-id` and `x-request-id` in the grpc headers
### 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)?
-->
1. Create merchant_account, api_key and mca (any connector)
2. Toggle dynamic routing
```
curl --location --request POST 'http://localhost:8080/account/merchant_1734609410/business_profile/pro_gPTjn9jLm0CxI8ZD1omL/dynamic_routing/success_based/toggle?enable=metrics' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_K70Wr6zqJLbPECg8eEXrnZ43TW41JNUuXYHzRB50geiG0lViLExjxNUld6sgdNd0' \
--data ''
```
3. Create a payment
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_K70Wr6zqJLbPECg8eEXrnZ43TW41JNUuXYHzRB50geiG0lViLExjxNUld6sgdNd0' \
--data '{
"amount": 6540,
"authentication_type": "no_three_ds",
"confirm": true,
"currency": "USD",
"customer_acceptance": {
"acceptance_type": "online"
},
"customer_id": "cus_uYakn3OQTUtAgetLDOE1",
"payment_method": "card",
"payment_method_data": {
"card": {
"card_cvc": "123",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"card_number": "4242424242424242"
}
}
}'
```
Check the grafana dashboard with `app = dynamo` label in loki. Logs should have `x-tenant-id` and `x-request-id` in the headers.
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/payments/routing.rs`
- `crates/router/src/core/routing.rs`
- `crates/router/src/core/routing/helpers.rs`
**2. Utils**
- `crates/common_utils/src/consts.rs`
**3. Other**
- `crates/external_services/src/grpc_client.rs`
- `crates/external_services/src/grpc_client/dynamic_routing/elimination_rate_client.rs`
- `crates/external_services/src/grpc_client/dynamic_routing/success_rate_client.rs`
- ... and 1 more files
**Code Patterns Applied:**
- Define new data structures (1 changes)
- Implement new functions (3 changes)
- Extend existing types with new fields (16 changes)
**Detailed Identifier Changes:**
Commit dc0a92dc:
Files to modify:
**crates/common_utils/src/consts.rs**
Modify existing code
**crates/external_services/src/grpc_client.rs**
Add:
- function: private::add_headers_to_grpc_request
- struct: pub::GrpcHeaders
- trait: pub::AddHeaders
- impl: impl AddHeaders for tonic::Request<T>
**crates/external_services/src/grpc_client/dynamic_routing/elimination_rate_client.rs**
Modify existing code
**crates/external_services/src/grpc_client/dynamic_routing/success_rate_client.rs**
Modify existing code
**crates/router/src/core/payments/routing.rs**
Modify existing code
**crates/router/src/core/routing.rs**
Modify existing code
**crates/router/src/core/routing/helpers.rs**
Modify existing code
**crates/router/src/routes/app.rs**
Add:
- function: pub::get_grpc_headers
|
{"pr_number": 6904, "pr_title": "refactor(grpc): send `x-tenant-id` and `x-request-id` in grpc headers", "merged_at": "2024-12-22T18:11:45Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments/routing.rs", "crates/router/src/core/routing.rs", "crates/router/src/core/routing/helpers.rs"], "utils": ["crates/common_utils/src/consts.rs"], "other": ["crates/external_services/src/grpc_client.rs", "crates/external_services/src/grpc_client/dynamic_routing/elimination_rate_client.rs", "crates/external_services/src/grpc_client/dynamic_routing/success_rate_client.rs", "crates/router/src/routes/app.rs"]}, "change_types": {"structs_added": 1, "functions_added": 3, "fields_added": 16, "imports_added": 5}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(users): profile level custom role write
## 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 will enable profile level custom creation from API and also enable org level custom role read
### Additional Changes
- [ ] This PR modifies the API contract
- [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`
-->
## 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)?
-->
1 . Valid operation
Request :
```
curl --location 'http://localhost:8080/user/role' \
--header 'authorization: Bearer JWT' \
--header 'cookie: login_token=JWT' \
--data '{
"role_scope": "profile",
"entity_type": "profile",
"groups": [
"operations_view",
"operations_manage"
],
"role_name": "profile-role-at-profile-scope"
}'
```
Response
```
{
"role_id": "role_vcPMQVtjv0jblNi1tOxB",
"groups": [
"operations_view",
"operations_manage"
],
"role_name": "profile-role-at-profile-scope",
"role_scope": "profile",
"entity_type": "profile"
}
```
2. Invalid operation
Request
```
curl --location 'http://localhost:8080/user/role' \
--header 'authorization: Bearer JWT' \
--header 'cookie: login_token=JWT' \
--data '{
"role_scope": "profile",
"entity_type": "merchant",
"groups": [
"operations_view",
"operations_manage"
],
"role_name": "merchant-role-at-profile-scope"
}'
```
Response
```
{
"error": {
"type": "invalid_request",
"message": "User Role Operation Not Supported",
"code": "UR_23"
}
}
```
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/role.rs`
- `crates/diesel_models/src/schema.rs`
- `crates/diesel_models/src/schema_v2.rs`
**2. Core Business Logic**
- `crates/router/src/core/user_role/role.rs`
**3. Other**
- `crates/router/src/db/role.rs`
- `migrations/2025-02-06-122415_udpate-roles/down.sql`
- `migrations/2025-02-06-122415_udpate-roles/up.sql`
**Code Patterns Applied:**
- Extend existing types with new fields (2 changes)
- Modify database queries (1 changes)
**Detailed Identifier Changes:**
Commit 54e91058:
Files to modify:
**crates/diesel_models/src/role.rs**
Modify existing code
**crates/diesel_models/src/schema.rs**
Modify existing code
**crates/diesel_models/src/schema_v2.rs**
Modify existing code
**crates/router/src/core/user_role/role.rs**
Modify existing code
**crates/router/src/db/role.rs**
Modify existing code
|
{"pr_number": 7877, "pr_title": "feat(users): profile level custom role write", "merged_at": "2025-04-24T10:35:43Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["merchant", "user", "token"]}, "hierarchy": {"database": ["crates/diesel_models/src/role.rs", "crates/diesel_models/src/schema.rs", "crates/diesel_models/src/schema_v2.rs"], "core_business": ["crates/router/src/core/user_role/role.rs"], "other": ["crates/router/src/db/role.rs", "migrations/2025-02-06-122415_udpate-roles/down.sql", "migrations/2025-02-06-122415_udpate-roles/up.sql"]}, "change_types": {"fields_added": 2, "database_queries": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(docker): add webhook notifiers for installation tracking
## 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 -->
Added a webhook notifier for pre- and post-installation of `hyperswitch` using docker compose. This webhook sends the following API call to `https://hyperswitch.gateway.scarf.sh`:
- **initiated** (when a user tries to install hyperswitch)
- **success** (when all the components are successfully up and running)
- **error** (when any of the component fails or the server is unreachable)
The API calls include information about the platform(docker/helm/cdk), version and additional information about success/failure.
### 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).
-->
This change enables tracking of installation attempts, providing valuable insights into user adoption and setup experience. By monitoring success and failure rates, we can identify and resolve potential setup issues, ultimately improving user experience.
## 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 mock server and replace the url of the mock server inplace of `WEBHOOK_URL` in `scripts/prestart_hook.sh` and `scripts/poststart_hook.sh`
2. Run `docker compose up -d`
3. You can verify the status responses about your installation in your mock server.
<img width="726" alt="Screenshot 2025-03-26 at 7 19 16 PM" src="https://github.com/user-attachments/assets/c175b069-36de-4476-8ae0-cbd7a05c17e9" />
## 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 the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Configuration Files**
- `docker-compose.yml`
**2. Other**
- `scripts/poststart_hook.sh`
- `scripts/prestart_hook.sh`
**Code Patterns Applied:**
- Extend existing types with new fields (13 changes)
- Add conditional logic for feature flags or filtering (2 changes)
|
{"pr_number": 7653, "pr_title": "feat(docker): add webhook notifiers for installation tracking", "merged_at": "2025-04-15T08:08:13Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["user", "webhook"]}, "hierarchy": {"config": ["docker-compose.yml"], "other": ["scripts/poststart_hook.sh", "scripts/prestart_hook.sh"]}, "change_types": {"fields_added": 13, "conditionals_added": 2}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
feat(analytics): add support for multiple emails as input to forward reports
## 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 -->
Currently, while generating reports on the dashboard, the current setup only supports forwarding reports to the email of the account signed in.
This PR adds support to have custom emails in the input text box on the dashboard while generating and forwarding the report, to make the reporting module slightly flexible and convenient.
- Adding the field for taking multiple emails as input in the report request body.
- Currently having it as an Option, for backwards compatibility.
### 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).
-->
To make the reporting module slightly flexible and convenient, to send the report to emails entered by the users.
## 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)?
-->
Hit the curl:
```bash
curl --location 'http://localhost:8080/analytics/v1/org/report/payments' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.9' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'Origin: http://localhost:9000' \
--header 'Referer: http://localhost:9000/' \
--header 'Sec-Fetch-Dest: empty' \
--header 'Sec-Fetch-Mode: cors' \
--header 'Sec-Fetch-Site: same-site' \
--header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36' \
--header 'api-key: dev_LZcIA7XeMpnK5satp4CDvjcnHCaeKTBcosyuBBJaknZu1odhFo96cwS0nSdfzuJF' \
--header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTQ5ZTNkMmItMTY5Yi00NzUzLWJmNTQtZDcxMTM2YjRiN2JkIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzI2MDQ2MzI4Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTczMzg5OTY3Nywib3JnX2lkIjoib3JnX1ZwU0hPanNZZkR2YWJWWUpnQ0FKIiwicHJvZmlsZV9pZCI6InByb192NXNGb0hlODBPZWlVbElvbm9jTSIsInRlbmFudF9pZCI6InB1YmxpYyJ9.poRn4McNVvd9Yrv2py9FO3HmG1ENu_SqYYc4hfF1Jm8' \
--header 'sec-ch-ua: "Google Chrome";v="131", "Chromium";v="131", "Not_A Brand";v="24"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--data-raw '{
"timeRange": {
"startTime": "2024-10-31T18:30:00Z",
"endTime": "2024-11-30T18:29:59Z"
},
"emails": [
"test@gmail.com", "test2@juspay.in"
]
}'
```
Sample request payload:
```bash
payload: ReportRequest { time_range: TimeRange { start_time: 2024-10-31 18:30:00.0, end_time: Some(2024-11-30 18:29:59.0) }, emails: Some([****@gmail.com, *****@juspay.in]) }
```
Sample lambda request:
```bash
lambda_req: GenerateReportRequest { request: ReportRequest { time_range: TimeRange { start_time: 2024-10-31 18:30:00.0, end_time: Some(2024-11-30 18:29:59.0) }, emails: Some([****@gmail.com, *****@juspay.in]) }, merchant_id: None, auth: OrgLevel { org_id: OrganizationId("org_VpSHOjsYfDvabVYJgCAJ") }, email: *************@juspay.in }
```
- emails is an Option (for backwards compatibility): So its not compulsary as of now to add this field.
```bash
curl --location 'http://localhost:8080/analytics/v1/org/report/payments' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.9' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'Origin: http://localhost:9000' \
--header 'Referer: http://localhost:9000/' \
--header 'Sec-Fetch-Dest: empty' \
--header 'Sec-Fetch-Mode: cors' \
--header 'Sec-Fetch-Site: same-site' \
--header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36' \
--header 'api-key: dev_LZcIA7XeMpnK5satp4CDvjcnHCaeKTBcosyuBBJaknZu1odhFo96cwS0nSdfzuJF' \
--header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTQ5ZTNkMmItMTY5Yi00NzUzLWJmNTQtZDcxMTM2YjRiN2JkIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzI2MDQ2MzI4Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTczMzg5OTY3Nywib3JnX2lkIjoib3JnX1ZwU0hPanNZZkR2YWJWWUpnQ0FKIiwicHJvZmlsZV9pZCI6InByb192NXNGb0hlODBPZWlVbElvbm9jTSIsInRlbmFudF9pZCI6InB1YmxpYyJ9.poRn4McNVvd9Yrv2py9FO3HmG1ENu_SqYYc4hfF1Jm8' \
--header 'sec-ch-ua: "Google Chrome";v="131", "Chromium";v="131", "Not_A Brand";v="24"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--data '{
"timeRange": {
"startTime": "2024-10-31T18:30:00Z",
"endTime": "2024-11-30T18:29:59Z"
}
}'
```
Sample request payload:
```bash
payload: ReportRequest { time_range: TimeRange { start_time: 2024-10-31 18:30:00.0, end_time: Some(2024-11-30 18:29:59.0) }, emails: None }
```
Sample lambda request:
```bash
lambda_req: GenerateReportRequest { request: ReportRequest { time_range: TimeRange { start_time: 2024-10-31 18:30:00.0, end_time: Some(2024-11-30 18:29:59.0) }, emails: None }, merchant_id: None, auth: OrgLevel { org_id: OrganizationId("org_VpSHOjsYfDvabVYJgCAJ") }, email: *************@juspay.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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/analytics.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (1 changes)
**Detailed Identifier Changes:**
Commit 3df42333:
Files to modify:
**crates/api_models/src/analytics.rs**
Modify existing code
|
{"pr_number": 6776, "pr_title": "feat(analytics): add support for multiple emails as input to forward reports", "merged_at": "2024-12-10T12:20:39Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "user"]}, "hierarchy": {"api_models": ["crates/api_models/src/analytics.rs"]}, "change_types": {"fields_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(core): Confirm true mandatory when using stored payment method id in payouts
## 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 -->
During the recurring payout transaction, if confirm false is being explicitly sent in the request - throw a Bad Request Error.
### 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)?
-->
1. Make a CIT payout txn :
```
curl --location 'http://localhost:8080/payouts/create' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_GRihX98pcCHFjnBaR1LBMxTLCNAk8Fx214kdchJz984QzWNAZ2ss8esm5XmbSU6u' \
--data-raw '{
"amount": 11,
"currency": "EUR",
"email": "abc@email.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payout request",
"payout_type": "bank",
"payout_method_data": {
"bank": {
"iban": "DE57331060435647542639",
"bic": "DEUTDE5M551",
"bank_name": "Deutsche Bank",
"bank_country_code": "NL",
"bank_city": "Amsterdam"
}
},
"billing": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "CA",
"zip": "94122",
"country": "DE",
"first_name": "John",
"last_name": "Doe"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "abc@email.com"
},
"entity_type": "Individual",
"recurring": true,
"metadata": {
"ref": "123"
},
"connector": [
"nomupay"
],
"confirm": true,
"auto_fulfill": true
}'
```
Response :
```
{
"payout_id": "payout_fC7mISO0fflLYbBV2xAA",
"merchant_id": "merchant_1758103920",
"merchant_order_reference_id": null,
"amount": 11,
"currency": "EUR",
"connector": "nomupay",
"payout_type": "bank",
"payout_method_data": {
"bank": {
"iban": "DE573************42639",
"bank_name": "Deutsche Bank",
"bank_country_code": "NL",
"bank_city": "Amsterdam",
"bic": "DEU*****551"
}
},
"billing": {
"address": {
"city": "San Fransico",
"country": "DE",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"zip": "94122",
"state": "CA",
"first_name": "John",
"last_name": "Doe",
"origin_zip": null
},
"phone": {
"number": "8056594427",
"country_code": "+91"
},
"email": "abc@email.com"
},
"auto_fulfill": true,
"customer_id": "cus_VRTNOR0g3ED8S1AU8w6h",
"customer": {
"id": "cus_VRTNOR0g3ED8S1AU8w6h",
"name": "John Doe",
"email": "abc@email.com",
"phone": "999999999",
"phone_country_code": "+65"
},
"client_secret": "payout_payout_fC7mISO0fflLYbBV2xAA_secret_FIvH4TPRCDYR6Cmzed18",
"return_url": null,
"business_country": null,
"business_label": null,
"description": "Its my first payout request",
"entity_type": "Individual",
"recurring": true,
"metadata": {
"ref": "123"
},
"merchant_connector_id": "mca_buKwqk62TSF6Sg3FzVOe",
"status": "pending",
"error_message": null,
"error_code": null,
"profile_id": "pro_gIzlvTGmHkBZQFOCtbwq",
"created": "2025-09-17T15:05:12.913Z",
"connector_transaction_id": "PMT-068cace2cdcc72ad8000df5ec0eb92b5",
"priority": null,
"payout_link": null,
"email": "abc@email.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"unified_code": null,
"unified_message": null,
"payout_method_id": "pm_TDncPGeo63VCTYDYOyiy"
}
```
2a. In the Recurring Txn, pass confirm as `false`
Request:
```
curl --location 'http://localhost:8080/payouts/create' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_GRihX98pcCHFjnBaR1LBMxTLCNAk8Fx214kdchJz984QzWNAZ2ss8esm5XmbSU6u' \
--data-raw '{
"amount": 11,
"currency": "EUR",
"customer_id": "cus_VRTNOR0g3ED8S1AU8w6h",
"email": "anbb@email.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payout request",
"payout_type": "bank",
"payout_method_id": "pm_TDncPGeo63VCTYDYOyiy",
"entity_type": "Individual",
"recurring": false,
"metadata": {
"ref": "123"
},
"connector": [
"nomupay"
],
"confirm": false,
"auto_fulfill": true
}'
```
Response:
```
{
"error": {
"type": "invalid_request",
"message": "Cannot set confirm to false when using stored payout method data",
"code": "IR_06"
}
}
```
2b. Donot pass any confirm field
cURL:
```
curl --location 'http://localhost:8080/payouts/create' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_55KM08VzVQC9BiL3g3VKyLmC1d8x49lZtwIaiopRlQTDa5SmE5wN31Mj6LQsPuDN' \
--data-raw '{
"amount": 11,
"currency": "EUR",
"customer_id": "cus_HTvbqNOOOTV4KSmKyyZy",
"email": "anbb@email.com",
"name": "John Doe",
"phone": "999999999",
"phone_country_code": "+65",
"description": "Its my first payout request",
"payout_type": "bank",
"payout_method_id": "pm_sJOaQuT9CcVsaYJIIFu9",
"entity_type": "Individual",
"recurring": false,
"metadata": {
"ref": "123"
},
"connector": [
"nomupay"
],
"auto_fulfill": true
}'
```
Response:
```
{
"error": {
"type": "invalid_request",
"message": "Confirm must be true for recurring payouts",
"code": "IR_06"
}
}
```
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/payouts/validator.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (1 changes)
- Add conditional logic for feature flags or filtering (1 changes)
**Detailed Identifier Changes:**
Commit fd2f8570:
Files to modify:
**crates/router/src/core/payouts/validator.rs**
Modify existing code
|
{"pr_number": 9424, "pr_title": "feat(core): Confirm true mandatory when using stored payment method id in payouts", "merged_at": "2025-09-25T07:15:42Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "merchant", "order"]}, "hierarchy": {"core_business": ["crates/router/src/core/payouts/validator.rs"]}, "change_types": {"fields_added": 1, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): [AMAZONPAY] add Payment flows for Amazon Pay Wallet
## 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 -->
Added Amazon Pay connector using Amazon Pay Wallet for the US region.
Flow:
1. In the Hyperswitch dashboard, when configuring the Amazon Pay connector, merchants are required to provide their API keys, Merchant ID, and Store ID. The Merchant ID and Store ID are specifically necessary for rendering the Amazon Pay SDK.
2. During the `payments-create` API call, merchants must include the amount and currency (currently, only USD is supported). Additionally, the following fields can be provided:
- `order_tax_amount`: Required only if tax is being applied to the bill.
- `shipping_cost`: This value must match the amount specified in the default delivery_option. This validation is enforced in the backend.
- `delivery_options`: Passed within the metadata field, this should be an array of objects. Each object must include:
- `id`
- `price`: An object containing `amount` and `currency`
- `shipping_method`: An object containing `shipping_method_name` and `shipping_method_code`
- `is_default`: A boolean indicating whether the option is the default. Exactly one delivery option must have `is_default` set to true, which will determine the applicable shipping cost.
3. In the `session_tokens` API call, all required information for rendering the Amazon Pay SDK on the frontend is provided.
4. The Amazon Pay SDK is rendered on the frontend. Upon successful checkout, the frontend returns a `checkout_session_id` via the `confirm` API call. This identifier is essential for making the Authorize call. Currently, only the automatic capture method is supported, meaning the capture process is performed within the same call.
Note:
This PR currently supports only the `Automatic` capture method. Therefore, invoking the authorization flow will move the payment to a terminal state.
### 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`
6. `crates/router/src/configs`
7. `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).
-->
https://developer.amazon.com/docs/amazon-pay-api-v2/introduction.html
## 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)?
-->
Postman Test
<details>
<summary>Connector configuration with merchant account</summary>
Request:
```
curl --location --globoff 'http://localhost:8080/account/{{merchant_id}}/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: {{admin_api_key}}' \
--data '{
"connector_type": "payment_processor",
"connector_name": "amazonpay",
"connector_account_details": {
"auth_type": "BodyKey",
"api_key": "Merchant'\''s Public Key here",
"key1": "Merchant'\''s Private Key here"
},
"test_mode": true,
"disabled": false,
"payment_methods_enabled": [
{
"payment_method": "wallet",
"payment_method_types": [
{
"payment_method_type": "amazon_pay",
"payment_experience": "invoke_sdk_client",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
}
],
"connector_wallets_details": {
"amazon_pay": {
"merchant_id": "Merchant Id here",
"store_id": "Store Id here"
}
},
"metadata": {
"city": "NY",
"unit": "245"
},
"connector_webhook_details": {
"merchant_secret": "MyWebhookSecret"
},
"business_country": "US",
"business_label": "default"
}'
```
Response:
```
{
"connector_type": "payment_processor",
"connector_name": "amazonpay",
"connector_label": "amazonpay_US_default",
"merchant_connector_id": "mca_dzcaJz3OXpbsEUtmnRRB",
"profile_id": "pro_KjH58F7Kk38DKamoARZo",
"connector_account_details": {
"auth_type": "BodyKey",
"api_key": "SA****************************YL",
"key1": "--*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************--"
},
"payment_methods_enabled": [
{
"payment_method": "wallet",
"payment_method_types": [
{
"payment_method_type": "amazon_pay",
"payment_experience": "invoke_sdk_client",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
}
],
"connector_webhook_details": {
"merchant_secret": "MyWebhookSecret",
"additional_secret": null
},
"metadata": {
"city": "NY",
"unit": "245"
},
"test_mode": true,
"disabled": false,
"frm_configs": null,
"business_country": "US",
"business_label": "default",
"business_sub_label": null,
"applepay_verified_domains": null,
"pm_auth_config": null,
"status": "active",
"additional_merchant_data": null,
"connector_wallets_details": {
"amazon_pay": {
"merchant_id": "***",
"store_id": "***"
}
}
}
```
</details>
<details>
<summary>Create Payment</summary>
Request:
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: {{admin_api_key}}' \
--data '
{
"amount": 5044,
"currency": "USD",
"shipping_cost": 2000,
"order_tax_amount": 1000,
"confirm": false,
"metadata": {
"delivery_options": [
{
"id": "standard-delivery",
"price":{
"amount": 2000,
"currency_code":"USD"
},
"shipping_method":{
"shipping_method_name":"standard-courier",
"shipping_method_code":"standard-courier"
},
"is_default":true
},
{
"id":"express-delivery",
"price":{
"amount":5000,
"currency_code":"USD"
},
"shipping_method":{
"shipping_method_name":"express-courier",
"shipping_method_code":"express-courier"
},
"is_default":false
}
]
},
"shipping": {
"address": {
"line1": "10 Ditka Ave",
"line2": "Suite 2500",
"line3": null,
"city": "Chicago",
"state": "IL",
"zip": "60602",
"country": "US",
"first_name": "Susie",
"last_name": "Smith"
},
"phone": {
"number": "8000000000"
}
}
}'
```
Response:
```
{
"payment_id": "***",
"merchant_id": "merchant_1738388546",
"status": "requires_payment_method",
"amount": 5044,
"net_amount": 11044,
"shipping_cost": 5000,
"amount_capturable": 0,
"amount_received": null,
"connector": null,
"client_secret": "***",
"created": "2025-02-01T06:04:17.308Z",
"currency": "USD",
"customer_id": null,
"customer": null,
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": null,
"payment_method": null,
"payment_method_data": null,
"payment_token": null,
"shipping": {
"address": {
"city": "Chicago",
"country": "US",
"line1": "10 Ditka Ave",
"line2": "Suite 2500",
"line3": null,
"zip": "60602",
"state": "IL",
"first_name": "Susie",
"last_name": "Smith"
},
"phone": {
"number": "8000000000",
"country_code": null
},
"email": null
},
"billing": null,
"order_details": null,
"email": null,
"name": null,
"phone": null,
"return_url": null,
"authentication_type": null,
"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": null,
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": null,
"connector_transaction_id": null,
"frm_message": null,
"metadata": {
"delivery_options": [
{
"id": "standard-delivery",
"price": {
"amount": 2000,
"currency_code": "USD"
},
"is_default": true,
"shipping_method": {
"shipping_method_code": "standard-courier",
"shipping_method_name": "standard-courier"
}
},
{
"id": "express-delivery",
"price": {
"amount": 5000,
"currency_code": "USD"
},
"is_default": false,
"shipping_method": {
"shipping_method_code": "express-courier",
"shipping_method_name": "express-courier"
}
}
]
},
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_gv8MXTZYhAFvCVPskAYY",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": null,
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-02-01T06:19:17.308Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-02-01T06:04:17.329Z",
"split_payments": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": 1000,
"connector_mandate_id": null
}
```
</details>
<details>
<summary>Session Token</summary>
Request:
```
curl --location 'http://localhost:8080/payments/session_tokens' \
--header 'Content-Type: application/json' \
--header 'api-key: {{publishable_key}}' \
--data '{
"payment_id": "Payment Id here",
"wallets": [],
"client_secret": "Client Secret here"
}'
```
Response:
```
{
"payment_id": "***",
"client_secret": "***",
"session_token": [
{
"wallet_name": "amazon_pay",
"merchant_id": "***",
"ledger_currency": "USD",
"store_id": "***",
"payment_intent": "AuthorizeWithCapture",
"total_shipping_amount": "20.00",
"total_tax_amount": "10.00",
"total_base_amount": "50.44",
"delivery_options": [
{
"id": "standard-delivery",
"price": {
"amount": 2000,
"display_amount": "20.00",
"currency_code": "USD"
},
"shipping_method": {
"shipping_method_name": "standard-courier",
"shipping_method_code": "standard-courier"
},
"is_default": true
},
{
"id": "express-delivery",
"price": {
"amount": 5000,
"display_amount": "50.00",
"currency_code": "USD"
},
"shipping_method": {
"shipping_method_name": "express-courier",
"shipping_method_code": "express-courier"
},
"is_default": false
}
]
}
]
}
```
</details>
**If any field within the `metadata` is missing, the `session_token` in the response will be empty.**
<details>
<summary>Payments - Create (with missing field in metadata)</summary>
Request:
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: {{admin_api_key}}' \
--data '{
"amount": 5044,
"currency": "USD",
"shipping_cost": 2000,
"order_tax_amount": 1000,
"confirm": false,
"metadata": {
"delivery_options": [
{
"id": "standard-delivery",
"price":{
"amount": 2000,
"currency_code":"USD"
},
"shipping_method":{
"shipping_method_code":"standard-courier"
},
"is_default":true
},
{
"id":"express-delivery",
"price":{
"amount":5000,
"currency_code":"USD"
},
"shipping_method":{
"shipping_method_name":"express-courier",
"shipping_method_code":"express-courier"
},
"is_default":false
}
]
}
}'
```
Response:
```
{
"payment_id": "****",
"merchant_id": "****",
"status": "requires_payment_method",
"amount": 5044,
"net_amount": 8044,
"shipping_cost": 2000,
"amount_capturable": 0,
"amount_received": null,
"connector": null,
"client_secret": "***",
"created": "2025-02-11T15:19:11.396Z",
"currency": "USD",
"customer_id": null,
"customer": null,
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": null,
"payment_method": null,
"payment_method_data": null,
"payment_token": null,
"shipping": null,
"billing": null,
"order_details": null,
"email": null,
"name": null,
"phone": null,
"return_url": null,
"authentication_type": null,
"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": null,
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": null,
"connector_transaction_id": null,
"frm_message": null,
"metadata": {
"delivery_options": [
{
"id": "standard-delivery",
"price": {
"amount": 2000,
"currency_code": "USD"
},
"is_default": true,
"shipping_method": {
"shipping_method_code": "standard-courier"
}
},
{
"id": "express-delivery",
"price": {
"amount": 5000,
"currency_code": "USD"
},
"is_default": false,
"shipping_method": {
"shipping_method_code": "express-courier",
"shipping_method_name": "express-courier"
}
}
]
},
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "***",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": null,
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-02-11T15:34:11.396Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-02-11T15:19:11.418Z",
"split_payments": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": 1000,
"connector_mandate_id": null
}
```
</details>
<details>
<summary>Session Token (when metadata is passed with missing field in payments-create call)</summary>
Request:
```
curl --location 'http://localhost:8080/payments/session_tokens' \
--header 'Content-Type: application/json' \
--header 'api-key: {{publishable_key}}' \
--data '{
"payment_id": "Payment_ID_Here",
"wallets": [],
"client_secret": "Client_Secret_Here"
}'
```
Response:
```
{
"payment_id": "***",
"client_secret": "***",
"session_token": []
}
```
</details>
<details>
<summary>Payments - Confirm</summary>
Request:
```
curl --location 'http://localhost:8080/payments/{{payment_id}}/confirm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: {{api_key}}' \
--data '{
"capture_method": "automatic",
"shipping": {
"address": {
"line1": "10 Ditka Ave",
"line2": "Suite 2500",
"line3": null,
"city": "Chicago",
"state": "IL",
"zip": "60602",
"country": "US",
"first_name": "Susie",
"last_name": "Smith"
},
"phone": {
"number": "800-000-0000"
}
},
"payment_method": "wallet",
"payment_method_type": "amazon_pay",
"payment_experience": "invoke_sdk_client",
"payment_method_data": {
"wallet": {
"amazon_pay": {
"checkout_session_id": "Checkout Session Id here"
}
}
}
}'
```
Response:
```
{
"payment_id": "***",
"merchant_id": "merchant_1738388546",
"status": "succeeded",
"amount": 5044,
"net_amount": 11044,
"shipping_cost": 5000,
"amount_capturable": 0,
"amount_received": 11044,
"connector": "amazonpay",
"client_secret": "***",
"created": "2025-02-01T06:04:17.308Z",
"currency": "USD",
"customer_id": null,
"customer": null,
"description": null,
"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": "wallet",
"payment_method_data": {
"wallet": {},
"billing": null
},
"payment_token": null,
"shipping": {
"address": {
"city": "Chicago",
"country": "US",
"line1": "10 Ditka Ave",
"line2": "Suite 2500",
"line3": null,
"zip": "60602",
"state": "IL",
"first_name": "Susie",
"last_name": "Smith"
},
"phone": {
"number": "800-000-0000",
"country_code": null
},
"email": 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": "invoke_sdk_client",
"payment_method_type": "amazon_pay",
"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": "***",
"frm_message": null,
"metadata": {
"delivery_options": [
{
"id": "standard-delivery",
"price": {
"amount": "20.00",
"currency_code": "USD"
},
"is_default": true,
"shipping_method": {
"shipping_method_code": "standard-courier",
"shipping_method_name": "standard-courier"
}
},
{
"id": "express-delivery",
"price": {
"amount": "50",
"currency_code": "USD"
},
"is_default": false,
"shipping_method": {
"shipping_method_code": "express-courier",
"shipping_method_name": "express-courier"
}
}
]
},
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_gv8MXTZYhAFvCVPskAYY",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_GaSYTsJoc2VB9jkwD9Ag",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-02-01T06:19:17.308Z",
"fingerprint": null,
"browser_info": {
"os_type": null,
"language": null,
"time_zone": null,
"ip_address": "::1",
"os_version": null,
"user_agent": null,
"color_depth": null,
"device_model": null,
"java_enabled": null,
"screen_width": null,
"accept_header": null,
"screen_height": null,
"accept_language": "en",
"java_script_enabled": null
},
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-02-01T06:12:41.541Z",
"split_payments": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": 1000,
"connector_mandate_id": null
}
```
</details>
<details>
<summary>Refunds - Create</summary>
Request:
```
curl --location 'http://localhost:8080/refunds' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: {{api_key}}' \
--data '{
"payment_id": "{{payment_id}}",
"amount": 11044,
"reason": "Customer returned product",
"refund_type": "instant"
}'
```
Response:
```
{
"refund_id": "***",
"payment_id": "***",
"amount": 11044,
"currency": "USD",
"status": "pending",
"reason": "Customer returned product",
"metadata": null,
"error_message": null,
"error_code": null,
"unified_code": null,
"unified_message": null,
"created_at": "2025-02-01T06:16:01.318Z",
"updated_at": "2025-02-01T06:16:03.084Z",
"connector": "amazonpay",
"profile_id": "pro_gv8MXTZYhAFvCVPskAYY",
"merchant_connector_id": "mca_GaSYTsJoc2VB9jkwD9Ag",
"split_refunds": null
}
```
</details>
<details>
<summary>Refunds - Retrieve</summary>
Request:
```
curl --location 'http://localhost:8080/refunds/{{refund_id}}' \
--header 'Accept: application/json' \
--header 'api-key: {{api_key}}'
```
Response:
```
{
"refund_id": "***",
"payment_id": "***",
"amount": 11044,
"currency": "USD",
"status": "succeeded",
"reason": "Customer returned product",
"metadata": null,
"error_message": null,
"error_code": null,
"unified_code": null,
"unified_message": null,
"created_at": "2025-02-01T06:16:01.318Z",
"updated_at": "2025-02-01T06:18:16.267Z",
"connector": "amazonpay",
"profile_id": "pro_gv8MXTZYhAFvCVPskAYY",
"merchant_connector_id": "mca_GaSYTsJoc2VB9jkwD9Ag",
"split_refunds": null
}
```
</details>
<details>
<summary>Feature API</summary>
Request:
```
curl --location 'http://localhost:8080/feature_matrix' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: ***'
```
Response:
```
{
"connector_count": 1,
"connectors": [
{
"name": "AMAZONPAY",
"description": "Amazon Pay is an Alternative Payment Method (APM) connector that allows merchants to accept payments using customers' stored Amazon account details, providing a seamless checkout experience.",
"category": "alternative_payment_method",
"supported_payment_methods": [
{
"payment_method": "wallet",
"payment_method_type": "amazon_pay",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic"
],
"supported_countries": [
"US"
],
"supported_currencies": [
"USD"
]
}
],
"supported_webhook_flows": []
},
]
}
```
</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
- [x] I added unit tests for my changes where possible
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/admin.rs`
- `crates/api_models/src/payments.rs`
**2. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/payment_method_data.rs`
- `crates/hyperswitch_domain_models/src/payments/payment_attempt.rs`
- `crates/hyperswitch_domain_models/src/router_request_types.rs`
**3. Core Business Logic**
- `crates/router/src/core/connector_validation.rs`
- `crates/router/src/core/payments/flows/session_flow.rs`
- `crates/router/src/core/payments/helpers.rs`
- ... and 3 more files
**4. External Connector Integration**
- `crates/common_enums/src/connector_enums.rs`
- `crates/connector_configs/src/connector.rs`
- `crates/connector_configs/src/transformer.rs`
- ... and 40 more files
**5. Type Definitions**
- `crates/router/src/types/api/feature_matrix.rs`
**6. Utils**
- `crates/common_utils/Cargo.toml`
- `crates/common_utils/src/crypto.rs`
- `crates/common_utils/src/errors.rs`
**7. Tests**
- `config/deployments/integration_test.toml`
- `loadtest/config/development.toml`
**8. Configuration Files**
- `config/config.example.toml`
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- ... and 2 more files
**9. Other**
- `Cargo.lock`
- `api-reference/v1/openapi_spec_v1.json`
- `api-reference/v2/openapi_spec_v2.json`
- ... and 2 more files
**Code Patterns Applied:**
- Define new data structures (30 changes)
- Implement new functions (41 changes)
- Extend existing types with new fields (338 changes)
- Add conditional logic for feature flags or filtering (6 changes)
- Modify database queries (1 changes)
**Detailed Identifier Changes:**
Commit 23cf4376:
Files to modify:
**crates/api_models/src/admin.rs**
Modify existing code
**crates/api_models/src/payments.rs**
Add:
- function: pub::validate_currency
- function: pub::insert_display_amount
- struct: pub::AmazonPaySessionTokenData
- struct: pub::AmazonPayMerchantCredentials
- struct: pub::AmazonPayWalletData
**crates/common_enums/src/connector_enums.rs**
Modify existing code
**crates/common_utils/src/crypto.rs**
Add:
- function: private::sign_message
- function: private::test_rsa_pss_sha256_verify_signature
- struct: pub::RsaPssSha256
- impl: impl SignMessage for RsaPssSha256
**crates/common_utils/src/errors.rs**
Modify existing code
**crates/connector_configs/src/connector.rs**
Modify existing code
**crates/connector_configs/src/transformer.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/aci/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/amazonpay.rs**
Remove:
- function: private::get_auth_header
- function: private::get_headers
- function: private::get_content_type
- function: private::get_url
- function: private::get_request_body
- function: private::handle_response
- impl: impl ConnectorValidation for Amazonpay
- impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Amazonpay
- impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Amazonpay
- impl: impl ConnectorSpecifications for Amazonpay
Add:
- function: private::get_last_segment
- function: pub::create_authorization_header
- function: private::create_signature
- function: private::sign
- function: private::get_connector_about
- function: private::get_supported_payment_methods
- function: private::get_supported_webhook_flows
- impl: impl ConnectorValidation for Amazonpay
- impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Amazonpay
- impl: impl ConnectorSpecifications for Amazonpay
**crates/hyperswitch_connectors/src/connectors/amazonpay/transformers.rs**
Remove:
- struct: pub::AmazonpayPaymentsRequest
Add:
- function: private::from
- function: private::from
- struct: pub::AmazonpayFinalizeRequest
- struct: pub::ChargeAmount
- struct: pub::AmazonpayFinalizeResponse
- struct: pub::WebCheckoutDetails
- struct: pub::PaymentDetails
- struct: pub::CartDetails
- struct: pub::DeliveryOptions
- struct: pub::ShippingMethod
- struct: pub::RecurringMetadata
- struct: pub::Frequency
- struct: pub::BuyerDetails
- struct: pub::FinalizeStatusDetails
- struct: pub::DeliverySpecifications
- struct: pub::AddressRestrictions
- struct: pub::Restriction
- struct: pub::PaymentProcessingMetaData
- enum: pub::FinalizeState
- impl: impl From<(StringMajorUnit, T)> for AmazonpayRouterData<T>
- impl: impl TryFrom<&AmazonpayRouterData<&PaymentsAuthorizeRouterData>> for AmazonpayFinalizeRequest
- impl: impl From<FinalizeState> for common_enums::AttemptStatus
**crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/boku/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/noon/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/payme/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/square/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/zen/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/utils.rs**
Add:
- function: private::get_optional_shipping_phone_number_without_country_code
- function: private::get_required_shipping_full_name
- function: private::get_required_shipping_line1
- function: private::get_required_shipping_city
- function: private::get_required_shipping_state
- function: private::get_required_shipping_zip
- function: private::get_required_shipping_phone_number
**crates/hyperswitch_domain_models/src/payment_method_data.rs**
Add:
- struct: pub::AmazonPayWalletData
**crates/hyperswitch_domain_models/src/payments/payment_attempt.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_request_types.rs**
Modify existing code
**crates/openapi/src/openapi.rs**
Modify existing code
**crates/openapi/src/openapi_v2.rs**
Modify existing code
**crates/payment_methods/src/configs/payment_connector_required_fields.rs**
Modify existing code
**crates/router/src/connector/utils.rs**
Add:
- function: private::get_optional_shipping_line3
**crates/router/src/core/connector_validation.rs**
Modify existing code
**crates/router/src/core/payments/flows/session_flow.rs**
Add:
- function: private::create_amazon_pay_session_token
**crates/router/src/core/payments/helpers.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_session.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_session_intent.rs**
Modify existing code
**crates/router/src/core/payments/transformers.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/src/types/connector_transformers.rs**
Modify existing code
**crates/test_utils/src/connector_auth.rs**
Modify existing code
|
{"pr_number": 7062, "pr_title": "feat(connector): [AMAZONPAY] add Payment flows for Amazon Pay Wallet", "merged_at": "2025-08-29T08:49:23Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/admin.rs", "crates/api_models/src/payments.rs"], "domain": ["crates/hyperswitch_domain_models/src/payment_method_data.rs", "crates/hyperswitch_domain_models/src/payments/payment_attempt.rs", "crates/hyperswitch_domain_models/src/router_request_types.rs"], "core_business": ["crates/router/src/core/connector_validation.rs", "crates/router/src/core/payments/flows/session_flow.rs", "crates/router/src/core/payments/helpers.rs", "crates/router/src/core/payments/operations/payment_session.rs", "crates/router/src/core/payments/operations/payment_session_intent.rs", "crates/router/src/core/payments/transformers.rs"], "connectors": ["crates/common_enums/src/connector_enums.rs", "crates/connector_configs/src/connector.rs", "crates/connector_configs/src/transformer.rs", "crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml", "crates/hyperswitch_connectors/Cargo.toml", "crates/hyperswitch_connectors/src/connectors/aci/transformers.rs", "crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs", "crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs", "crates/hyperswitch_connectors/src/connectors/amazonpay.rs", "crates/hyperswitch_connectors/src/connectors/amazonpay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/authorizedotnet/transformers.rs", "crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs", "crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs", "crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs", "crates/hyperswitch_connectors/src/connectors/boku/transformers.rs", "crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs", "crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs", "crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs", "crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs", "crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs", "crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs", "crates/hyperswitch_connectors/src/connectors/noon/transformers.rs", "crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs", "crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs", "crates/hyperswitch_connectors/src/connectors/payme/transformers.rs", "crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs", "crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs", "crates/hyperswitch_connectors/src/connectors/square/transformers.rs", "crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs", "crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs", "crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/zen/transformers.rs", "crates/hyperswitch_connectors/src/utils.rs", "crates/payment_methods/src/configs/payment_connector_required_fields.rs", "crates/router/src/connector/utils.rs", "crates/router/src/types/api/connector_mapping.rs", "crates/router/src/types/connector_transformers.rs", "crates/router/tests/connectors/sample_auth.toml", "crates/test_utils/src/connector_auth.rs"], "types": ["crates/router/src/types/api/feature_matrix.rs"], "utils": ["crates/common_utils/Cargo.toml", "crates/common_utils/src/crypto.rs", "crates/common_utils/src/errors.rs"], "tests": ["config/deployments/integration_test.toml", "loadtest/config/development.toml"], "config": ["config/config.example.toml", "config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml"], "other": ["Cargo.lock", "api-reference/v1/openapi_spec_v1.json", "api-reference/v2/openapi_spec_v2.json", "crates/openapi/src/openapi.rs", "crates/openapi/src/openapi_v2.rs"]}, "change_types": {"structs_added": 30, "functions_added": 41, "enums_added": 4, "fields_added": 338, "imports_added": 14, "conditionals_added": 6, "database_queries": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connector): Add WASM Changes for Finix Google Pay
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
Closes this [issue](https://github.com/juspay/hyperswitch/issues/9844)
## Description
<!-- Describe your changes in detail -->
This PR involves adding WASM changes for Google Pay for Finix Connector.
Previously `Merchant Identity ID` was being retrieved from the metadata in MCA call. This field is now moved to Authentication field `MultiAuthKey`.
### 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`
6. `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)?
-->
Dashboard Screenshot:
<img width="1728" height="1043" alt="Screenshot 2025-10-15 at 3 02 31 PM" src="https://github.com/user-attachments/assets/003aae54-f302-4a14-bf9f-c758fafce468" />
<img width="1728" height="1045" alt="Screenshot 2025-10-15 at 3 03 35 PM" src="https://github.com/user-attachments/assets/82ecd6e0-f8db-4652-8bd6-b03f33e77cf3" />
<img width="1728" height="1048" alt="Screenshot 2025-10-14 at 10 06 42 PM" src="https://github.com/user-attachments/assets/564ae5ae-9868-4a2f-bfd8-f96cd851cef6" />
Postman Test:
Connector Create - Finix:
Request:
```curl
curl --location '{{base_url}}/account/:merchant_id/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: {{api_key}}' \
--data '{
"connector_type": "payment_processor",
"connector_name": "finix",
"connector_account_details": {
"auth_type": "AUTH TYPE",
"key1": "KEY1",
"api_key":"API KEY",
"api_secret":"API SECRET",
"key2": "KEY2"
},
"test_mode": true,
"disabled": false,
"payment_methods_enabled": [
{
"payment_method": "wallet",
"payment_method_types": [
{
"payment_method_type": "google_pay",
"payment_experience": "invoke_sdk_client",
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
}
]
}
],
"business_country": "US",
"business_label": "default"
}'
```
Response:
```json
{
"connector_type": "payment_processor",
"connector_name": "finix",
"connector_label": "finix_US_default",
"merchant_connector_id": "mca_bXi0H6cYIbo6MZlyDsQJ",
"profile_id": "pro_boQW0tf9TooWEMQAudj5",
"connector_account_details": {
"auth_type": "*****",
"api_key": "********************",
"key1": "********************",
"api_secret": "********************************",
"key2": "*******************"
},
"payment_methods_enabled": [
{
"payment_method": "wallet",
"payment_method_types": [
{
"payment_method_type": "google_pay",
"payment_experience": "invoke_sdk_client",
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": 0,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": false
}
]
}
],
"connector_webhook_details": null,
"metadata": null,
"test_mode": true,
"disabled": false,
"frm_configs": null,
"business_country": "US",
"business_label": "default",
"business_sub_label": null,
"applepay_verified_domains": null,
"pm_auth_config": null,
"status": "active",
"additional_merchant_data": null,
"connector_wallets_details": null
}
```
Payments - Create (Google Pay):
Request:
```curl
curl --location '{{base_url}}/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: ••••••' \
--data-raw '{
"amount": 6500,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 6500,
"customer_id": "abcdef1234",
"email": "abcdef123@gmail.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",
"billing": {
"address": {
"first_name": "John",
"last_name": "Doe",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US"
}
},
"payment_method": "wallet",
"payment_method_type": "google_pay",
"payment_method_data": {
"wallet": {
"google_pay": {
"description": "DESCRIPTION",
"tokenization_data": {
"type": "PAYMENT_GATEWAY",
"token": "TOKEN"
},
"type": "CARD",
"info": {
"card_network": "CARD_NETWORK",
"card_details": "CARD_DETAILS"
}
}
}
},
"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": "2025-07-25T11:46:12Z"
}
}
'
```
Response:
```json
{
"payment_id": "pay_ZqWKwoSKid1HYROr5S5L",
"merchant_id": "merchant_1760461381",
"status": "succeeded",
"amount": 6500,
"net_amount": 6500,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 6500,
"connector": "finix",
"client_secret": "pay_ZqWKwoSKid1HYROr5S5L_secret_jT4OetNUvwdsNY8y85qd",
"created": "2025-10-14T17:03:15.633Z",
"currency": "USD",
"customer_id": "abcdef1234",
"customer": {
"id": "abcdef1234",
"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": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "wallet",
"payment_method_data": {
"wallet": {
"google_pay": {
"last4": "1000",
"card_network": "VISA",
"type": "CARD"
}
},
"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",
"origin_zip": 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": "John",
"last_name": "Doe",
"origin_zip": 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": "google_pay",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "abcdef1234",
"created_at": 1760461395,
"expires": 1760464995,
"secret": "epk_7a9aea4bbedf478899dca2789a3860a4"
},
"manual_retry_allowed": null,
"connector_transaction_id": "TRnsvNeJgwvMdqCaNehfHpZn",
"frm_message": null,
"metadata": {
"udf1": "value1",
"login_date": "2025-07-25T11:46:12Z",
"new_customer": "true"
},
"connector_metadata": null,
"feature_metadata": {
"redirect_response": null,
"search_tags": null,
"apple_pay_recurring_details": null,
"gateway_system": "direct"
},
"reference_id": null,
"payment_link": null,
"profile_id": "pro_boQW0tf9TooWEMQAudj5",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_bXi0H6cYIbo6MZlyDsQJ",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-10-14T17:18:15.633Z",
"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_channel": null,
"payment_method_id": null,
"network_transaction_id": null,
"payment_method_status": null,
"updated": "2025-10-14T17:03:18.227Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"request_extended_authorization": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": null,
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null,
"enable_partial_authorization": null,
"enable_overcapture": null,
"is_overcapture_enabled": null,
"network_details": null,
"is_stored_credential": null,
"mit_category": 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/connector_validation.rs`
**2. External Connector Integration**
- `crates/connector_configs/toml/development.toml`
- `crates/connector_configs/toml/production.toml`
- `crates/connector_configs/toml/sandbox.toml`
- ... and 3 more files
**Code Patterns Applied:**
- Extend existing types with new fields (3 changes)
**Detailed Identifier Changes:**
Commit e641ea29:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/finix/transformers.rs**
Remove:
- function: private::try_from
- impl: impl TryFrom<&Option<common_utils::pii::SecretSerdeValue>> for FinixMeta
**crates/hyperswitch_connectors/src/connectors/finix/transformers/request.rs**
Remove:
- struct: pub::FinixMeta
**crates/router/src/core/connector_validation.rs**
Modify existing code
|
{"pr_number": 9845, "pr_title": "fix(connector): Add WASM Changes for Finix Google Pay", "merged_at": "2025-10-15T16:19:48Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/connector_validation.rs"], "connectors": ["crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml", "crates/hyperswitch_connectors/src/connectors/finix/transformers.rs", "crates/hyperswitch_connectors/src/connectors/finix/transformers/request.rs", "crates/router/tests/connectors/sample_auth.toml"]}, "change_types": {"fields_added": 3}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(currency_conversion): release redis lock if api call fails
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Refactors for currency conversion which invlolves:
-> Better error propagation
-> Redis lock realease, if data isn't fetched from api, so that the other subsequent calls donot fail.
### 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).
-->
Reqired for analytics
## 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)?
-->
Scenarios tested:
1. No api_keys provided: call returned error and redis key was deleted after being set.
2. fallback api_key provided: call returned forex rates and lock was also released.
3. primary api_key provided: call returned forex rates and lock was also released.
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Utils**
- `crates/router/src/utils/currency.rs`
**Code Patterns Applied:**
**Detailed Identifier Changes:**
Commit ae7d16e2:
Files to modify:
**crates/router/src/utils/currency.rs**
Modify existing code
|
{"pr_number": 6671, "pr_title": "refactor(currency_conversion): release redis lock if api call fails", "merged_at": "2024-11-29T10:37:43Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"utils": ["crates/router/src/utils/currency.rs"]}, "change_types": {"imports_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(openapi): Added Error Response Schema for Status Code 400
## 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 schemas weren't there for Error Response structs. Added them for status code 400 in payments and refunds APIs.
### 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)?
-->
<img width="642" height="189" alt="Screenshot 2025-07-17 at 11 06 29 PM" src="https://github.com/user-attachments/assets/ea706060-3000-4dbb-bb97-91dcc7bafc4d" />
<img width="668" height="189" alt="Screenshot 2025-07-17 at 11 07 57 PM" src="https://github.com/user-attachments/assets/a3f63237-7747-4fd6-b3e7-04a65b59960b" />
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/errors/types.rs`
**2. Configuration Files**
- `crates/openapi/Cargo.toml`
**3. Other**
- `api-reference/v1/openapi_spec_v1.json`
- `api-reference/v2/openapi_spec_v2.json`
- `crates/openapi/src/openapi.rs`
- ... and 3 more files
**Code Patterns Applied:**
- Define new data structures (1 changes)
- Implement new functions (1 changes)
- Extend existing types with new fields (8 changes)
**Detailed Identifier Changes:**
Commit a01d6083:
Files to modify:
**crates/api_models/src/errors/types.rs**
Remove:
- struct: private::ErrorResponse
Add:
- struct: pub::ErrorResponse
**crates/openapi/src/openapi.rs**
Modify existing code
**crates/openapi/src/openapi_v2.rs**
Modify existing code
**crates/openapi/src/routes/payments.rs**
Modify existing code
**crates/openapi/src/routes/refunds.rs**
Modify existing code
|
{"pr_number": 8684, "pr_title": "fix(openapi): Added Error Response Schema for Status Code 400", "merged_at": "2025-07-22T09:00:55Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user", "refund"]}, "hierarchy": {"api_models": ["crates/api_models/src/errors/types.rs"], "config": ["crates/openapi/Cargo.toml"], "other": ["api-reference/v1/openapi_spec_v1.json", "api-reference/v2/openapi_spec_v2.json", "crates/openapi/src/openapi.rs", "crates/openapi/src/openapi_v2.rs", "crates/openapi/src/routes/payments.rs", "crates/openapi/src/routes/refunds.rs"]}, "change_types": {"structs_added": 1, "functions_added": 1, "fields_added": 8, "imports_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): Add Peachpayments Cypress
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
Closes this [issue](https://github.com/juspay/hyperswitch/issues/9572)
## Description
<!-- Describe your changes in detail -->
Added Peachpayments Cypress Test.
### 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)?
-->
Cypress Test Screenshot:
**Peachpayments** -
<img width="325" height="839" alt="Screenshot 2025-09-26 at 2 42 26 PM" src="https://github.com/user-attachments/assets/af0e67f4-1811-453a-b47d-442a4b8665c6" />
**Refund flow of Adyen(prod connector)** -
<img width="888" height="1077" alt="Screenshot 2025-09-26 at 4 13 20 PM" src="https://github.com/user-attachments/assets/ba7ce251-bd47-4c31-b123-aaf729af345a" />
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/peachpayments.rs`
- `crates/hyperswitch_connectors/src/connectors/peachpayments/transformers.rs`
**2. Tests**
- `cypress-tests/cypress/e2e/configs/Payment/Peachpayments.js`
- `cypress-tests/cypress/e2e/configs/Payment/Utils.js`
- `cypress-tests/cypress/e2e/spec/Payment/00009-RefundPayment.cy.js`
**Code Patterns Applied:**
- Implement new functions (1 changes)
- Extend existing types with new fields (450 changes)
- Add conditional logic for feature flags or filtering (1 changes)
**Detailed Identifier Changes:**
Commit e03c0096:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/peachpayments.rs**
Add:
- function: private::build_request
**crates/hyperswitch_connectors/src/connectors/peachpayments/transformers.rs**
Modify existing code
|
{"pr_number": 9573, "pr_title": "feat(connector): Add Peachpayments Cypress", "merged_at": "2025-09-29T09:06:41Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user", "refund"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/peachpayments.rs", "crates/hyperswitch_connectors/src/connectors/peachpayments/transformers.rs"], "tests": ["cypress-tests/cypress/e2e/configs/Payment/Peachpayments.js", "cypress-tests/cypress/e2e/configs/Payment/Utils.js", "cypress-tests/cypress/e2e/spec/Payment/00009-RefundPayment.cy.js"]}, "change_types": {"functions_added": 1, "fields_added": 450, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(ui): hide visible scrollbar from checkout widget for windows
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
This PR hides the visible scrollbars on payment link's checkout widget.
### 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
## How did you test it?
Can only be tested on windows device. Tested by using below payment link config on windows device
```
"payment_link_config": {
"payment_link_ui_rules": {
"#submit": {
"color": "#003264 !important",
"padding": "25px 0",
"fontSize": "19px",
"fontWeight": "700",
"borderRadius": "5px",
"backgroundColor": "#CBB7FF !important"
},
"#payment-form-wrap": {
"width": "100% !important",
"backgroundColor": "#FFFFFF !important"
},
"#payment-form::-webkit-scrollbar": {
"display": "none"
}
}
}
```
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/payment_link/payment_link_initiate/payment_link.css`
**Code Patterns Applied:**
- Extend existing types with new fields (1 changes)
|
{"pr_number": 9541, "pr_title": "fix(ui): hide visible scrollbar from checkout widget for windows", "merged_at": "2025-10-01T13:15:54Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "order"]}, "hierarchy": {"core_business": ["crates/router/src/core/payment_link/payment_link_initiate/payment_link.css"]}, "change_types": {"fields_added": 1}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
fix(core): connector customer id population dependency removed from config
## 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 were required to populate connector_customer_id after merchant migrates the data (data having connector_customer_id) in shopper_reference_id (customer_id for Adyen).
- But connector_customer_id gets populated in router_data only for connectors listed under:
```
[connector_customer]
connector_list = "adyen,facilitapay,gocardless,hyperswitch_vault,stax,stripe"
```
To ensure the value gets populated for Adyen (to populate in shopper_reference), we added Adyen to this list.
- 3. But this list also controls whether the `CreateConnectorCustomer` flow is automatically triggered for the mentioned connectors. As a result, for every Adyen payment, the system attempts to trigger `CreateConnectorCustomer`, which is not implemented for Adyen.
This caused the error to be repeatedly logged from `crates/router/src/core/payments/customers.rs` line 69, but payments are still successful.
```
let connector_customer_id = match resp.response {
Ok(response) => match response {
types::PaymentsResponseData::ConnectorCustomerResponse {
connector_customer_id,
} => Some(connector_customer_id),
_ => None,
},
Err(err) => {
logger::error!(create_connector_customer_error=?err);
None
}
};
```
In this PR, the dependency of `connector_customer_id` on connector_customer `config` for getting populated in RouterData is been removed and also `Adyen` is removed from connector_customer config, which will prevent createConnectorCustomer flow getting triggered for Adyen, but still we can use `connector_customer_id` (if present after data migration).
### 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)?
-->
<img width="1461" height="975" alt="Screenshot 2025-08-13 at 4 04 17 PM" src="https://github.com/user-attachments/assets/d11a7d64-9d27-4dbe-98d5-a8d122a850e0" />
2/31 failed
In main, 4/31 failed:
<img width="1277" height="1055" alt="Screenshot 2025-08-13 at 4 06 08 PM" src="https://github.com/user-attachments/assets/d86a7662-8408-4ae2-9cc9-6c0cc717e890" />
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/payments/customers.rs`
**2. Tests**
- `config/deployments/integration_test.toml`
- `loadtest/config/development.toml`
**3. Configuration Files**
- `config/config.example.toml`
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- ... and 2 more files
**Detailed Identifier Changes:**
Commit f762f4f5:
Files to modify:
**crates/router/src/core/payments/customers.rs**
Modify existing code
|
{"pr_number": 8937, "pr_title": "fix(core): connector customer id population dependency removed from config", "merged_at": "2025-08-18T08:01:02Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments/customers.rs"], "tests": ["config/deployments/integration_test.toml", "loadtest/config/development.toml"], "config": ["config/config.example.toml", "config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(connector): Move connectors Bamboraapac, Boku, Gocardless, Prophetpay, Rapyd
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Moved connectors Bamboraapac, Boku, Ebanx, Gocardless, Prophetpay and Rapyd from router crate to hyperswitch_connectors crate
### 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)?
-->
Rapyd: Testing not possible because account has been deactivated
---
Prophetpay
1. Merchant Account Create
```
curl --location 'http://localhost:8080/accounts' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data-raw '{"merchant_id":"postman_merchant_GHAction_cb9398ef-f35f-46f1-b811-da024a94bba5","locker_id":"m0010","merchant_name":"NewAge Retailer","merchant_details":{"primary_contact_person":"John Test","primary_email":"JohnTest@test.com","primary_phone":"sunt laborum","secondary_contact_person":"John Test2","secondary_email":"JohnTest2@test.com","secondary_phone":"cillum do dolor id","website":"www.example.com","about_business":"Online Retail with a wide selection of organic products for North America","address":{"line1":"1467","line2":"Harrison Street","line3":"Harrison Street","city":"San Fransico","state":"California","zip":"94122","country":"US"}},"return_url":"https://duck.com","webhook_details":{"webhook_version":"1.0.1","webhook_username":"ekart_retail","webhook_password":"password_ekart@123","payment_created_enabled":true,"payment_succeeded_enabled":true,"payment_failed_enabled":true},"sub_merchants_enabled":false,"metadata":{"city":"NY","unit":"245"},"primary_business_details":[{"country":"US","business":"default"}]}'
```
2. API Key Create
```
curl --location 'http://localhost:8080/api_keys/postman_merchant_GHAction_c6ca85d0-9cfe-4c63-b6f8-501e3bddec30' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data '{"name":"API Key 1","description":null,"expiration":"2069-09-23T01:02:03.000Z"}'
```
3. Payment Connector Create
```
curl --location 'http://localhost:8080/account/postman_merchant_GHAction_c6ca85d0-9cfe-4c63-b6f8-501e3bddec30/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data '{
"connector_type": "payment_processor",
"connector_name": "prophetpay",
"connector_account_details": {
"auth_type": "SignatureKey",
"api_key": "*********",
"api_secret": "***********",
"key1": "**********"
},
"business_country": "US",
"business_label": "default",
"test_mode": false,
"disabled": false,
"payment_methods_enabled": [
{
"payment_method": "card_redirect",
"payment_method_types": [
{
"payment_method_type": "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
}
]
}
],
"metadata": {
"city": "NY",
"unit": "245"
}
}'
```
4. Payments Create
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_rkLYc4TkjKRGLZdY774ujcSF3ugQR4BNtXIET7kfST57QmW1eW7II9sTffhT2jv6' \
--data '{
"amount": 10000,
"currency": "USD",
"confirm": true,
"amount_to_capture": 10000,
"business_country": "US",
"customer_id": "not_a_rick_roll",
"return_url": "https://www.google.com",
"payment_method": "card_redirect",
"payment_method_type": "card_redirect",
"payment_method_data": {
"card_redirect": {
"card_redirect": {}
}
}
}'
```
Response
```
{
"payment_id": "pay_Z4j23nC96dZRw1v9swbm",
"merchant_id": "postman_merchant_GHAction_3bd2bcf9-fc0d-4bb3-9a92-9a7134405e12",
"status": "requires_customer_action",
"amount": 10000,
"net_amount": 10000,
"shipping_cost": null,
"amount_capturable": 10000,
"amount_received": null,
"connector": "prophetpay",
"client_secret": "pay_Z4j23nC96dZRw1v9swbm_secret_cl5RhD95NrOuiJcZCBDA",
"created": "2024-12-03T12:17:06.875Z",
"currency": "USD",
"customer_id": "not_a_rick_roll",
"customer": {
"id": "not_a_rick_roll",
"name": null,
"email": null,
"phone": null,
"phone_country_code": null
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": null,
"payment_method": "card_redirect",
"payment_method_data": {
"card_redirect": {
"card_redirect": {}
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": null,
"order_details": null,
"email": null,
"name": null,
"phone": null,
"return_url": "https://www.google.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": {
"type": "redirect_to_url",
"redirect_to_url": "http://localhost:8080/payments/redirect/pay_Z4j23nC96dZRw1v9swbm/postman_merchant_GHAction_3bd2bcf9-fc0d-4bb3-9a92-9a7134405e12/pay_Z4j23nC96dZRw1v9swbm_1"
},
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "card_redirect",
"connector_label": "prophetpay_US_default",
"business_country": "US",
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "not_a_rick_roll",
"created_at": 1733228226,
"expires": 1733231826,
"secret": "epk_0fd4497cec8a45009e0ee050e9496bd9"
},
"manual_retry_allowed": null,
"connector_transaction_id": null,
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_0rEpfGBRM6uOaedbCVgY",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_8TGosSooBN4mvfxJMDue",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-12-03T12:32:06.875Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2024-12-03T12:17:07.306Z",
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
5. Payments Retrieve
```
curl --location 'http://localhost:8080/payments/pay_Z4j23nC96dZRw1v9swbm' \
--header 'Accept: application/json' \
--header 'api-key: dev_79y4Bk6BJl0eDg66Z97SHQfKMwairDyPC5uSDw7Tk5Eycai3G6VFMx4LyBhtVDct'
```
Response
```
{
"payment_id": "pay_Z4j23nC96dZRw1v9swbm",
"merchant_id": "postman_merchant_GHAction_3bd2bcf9-fc0d-4bb3-9a92-9a7134405e12",
"status": "requires_customer_action",
"amount": 10000,
"net_amount": 10000,
"shipping_cost": null,
"amount_capturable": 10000,
"amount_received": null,
"connector": "prophetpay",
"client_secret": "pay_Z4j23nC96dZRw1v9swbm_secret_cl5RhD95NrOuiJcZCBDA",
"created": "2024-12-03T12:17:06.875Z",
"currency": "USD",
"customer_id": "not_a_rick_roll",
"customer": {
"id": "not_a_rick_roll",
"name": null,
"email": null,
"phone": null,
"phone_country_code": null
},
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": null,
"payment_method": "card_redirect",
"payment_method_data": {
"card_redirect": {
"card_redirect": {}
},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": null,
"order_details": null,
"email": null,
"name": null,
"phone": null,
"return_url": "https://www.google.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": {
"type": "redirect_to_url",
"redirect_to_url": "http://localhost:8080/payments/redirect/pay_Z4j23nC96dZRw1v9swbm/postman_merchant_GHAction_3bd2bcf9-fc0d-4bb3-9a92-9a7134405e12/pay_Z4j23nC96dZRw1v9swbm_1"
},
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "card_redirect",
"connector_label": "prophetpay_US_default",
"business_country": "US",
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": null,
"connector_transaction_id": null,
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_0rEpfGBRM6uOaedbCVgY",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_8TGosSooBN4mvfxJMDue",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-12-03T12:32:06.875Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2024-12-03T12:17:07.306Z",
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
Bamboraapac
1. Merchant Account Create
```
curl --location 'http://localhost:8080/accounts' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data-raw '{
"merchant_id": "merchant_1733233888",
"locker_id": "m0010",
"merchant_name": "NewAge Retailer",
"primary_business_details": [
{
"country": "US",
"business": "default"
}
],
"merchant_details": {
"primary_contact_person": "John Test",
"primary_email": "JohnTest@test.com",
"primary_phone": "sunt laborum",
"secondary_contact_person": "John Test2",
"secondary_email": "JohnTest2@test.com",
"secondary_phone": "cillum do dolor id",
"website": "www.example.com",
"about_business": "Online Retail with a wide selection of organic products for North America",
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US"
}
},
"return_url": "https://duck.com",
"webhook_details": {
"webhook_version": "1.0.1",
"webhook_username": "ekart_retail",
"webhook_password": "password_ekart@123",
"payment_created_enabled": true,
"payment_succeeded_enabled": true,
"payment_failed_enabled": true
},
"sub_merchants_enabled": false,
"metadata": {
"city": "NY",
"unit": "245"
}
}'
```
2. API Key Create
```
curl --location 'http://localhost:8080/api_keys/merchant_1733233863' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data '{"name":"API Key 1","description":null,"expiration":"2069-09-23T01:02:03.000Z"}'
```
3. Payment Connector Create
```
curl --location 'http://localhost:8080/account/merchant_1733233863/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data '{
"connector_type": "payment_processor",
"connector_name": "bamboraapac",
"connector_account_details": {
"auth_type": "SignatureKey",
"api_key": "*********",
"key1": "*******",
"api_secret": "*******"
},
"test_mode": false,
"disabled": false,
"business_country": "US",
"business_label": "default",
"payment_methods_enabled": [
{
"payment_method": "pay_later",
"payment_method_types": [
{
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true,
"payment_experience": "redirect_to_url",
"payment_method_type": "affirm"
}
]
},
{
"payment_method": "pay_later",
"payment_method_types": [
{
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true,
"payment_experience": "redirect_to_url",
"payment_method_type": "afterpay_clearpay"
}
]
},
{
"payment_method": "pay_later",
"payment_method_types": [
{
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true,
"payment_experience": "redirect_to_url",
"payment_method_type": "klarna"
}
]
},
{
"payment_method": "pay_later",
"payment_method_types": [
{
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true,
"payment_experience": "invoke_sdk_client",
"payment_method_type": "klarna"
}
]
},
{
"payment_method": "bank_redirect",
"payment_method_types": [
{
"payment_method_type": "ideal",
"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": "giropay",
"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": "sofort",
"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": "eps",
"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": "bank_debit",
"payment_method_types": [
{
"payment_method_type": "ach",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "becs",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "sepa",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "bank_transfer",
"payment_method_types": [
{
"payment_method_type": "ach",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "bacs",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "sepa",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "credit",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "debit",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "wallet",
"payment_method_types": [
{
"payment_method_type": "apple_pay",
"payment_experience": "invoke_sdk_client",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "wallet",
"payment_method_types": [
{
"payment_method_type": "google_pay",
"payment_experience": "invoke_sdk_client",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
}
]
}'
```
4. Payments Create
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_IejgLBaqAy6aDD36aU1J2wUbXESWON6TZp8DgGh49jxEoPpvqEc90VWJnTlD3eTy' \
--data-raw '{
"amount": 1050,
"currency": "EUR",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 1050,
"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": "4111111111111111",
"card_exp_month": "12",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"card_cvc": "789"
}
},
"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"
}
}'
```
Response
```
{
"payment_id": "pay_an7R6C8VfCRBf7yMqp5b",
"merchant_id": "merchant_1733233863",
"status": "succeeded",
"amount": 1050,
"net_amount": 1050,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 1050,
"connector": "bamboraapac",
"client_secret": "pay_an7R6C8VfCRBf7yMqp5b_secret_dDVP1sMzNtjFuKFk1AQx",
"created": "2024-12-03T13:52:34.491Z",
"currency": "EUR",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+1"
},
"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": "1111",
"card_type": "CREDIT",
"card_network": "Visa",
"card_issuer": "JP Morgan",
"card_issuing_country": "INDIA",
"card_isin": "411111",
"card_extended_bin": null,
"card_exp_month": "12",
"card_exp_year": "25",
"card_holder_name": null,
"payment_checks": null,
"authentication_data": 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": "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": "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": 1733233954,
"expires": 1733237554,
"secret": "epk_3ac721c706e84db8900e959681e4c4cb"
},
"manual_retry_allowed": false,
"connector_transaction_id": "32645468",
"frm_message": null,
"metadata": {
"udf1": "value1",
"login_date": "2019-09-10T10:11:12Z",
"new_customer": "true"
},
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "32645468",
"payment_link": null,
"profile_id": "pro_PWkVqhQCoj2AZwqeixJ7",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_uTwyKdYff5FC7p9kn8t7",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-12-03T14:07:34.491Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2024-12-03T13:52:35.943Z",
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
5. Payments Retrieve
```
curl --location 'http://localhost:8080/payments/pay_an7R6C8VfCRBf7yMqp5b' \
--header 'Accept: application/json' \
--header 'api-key: dev_IejgLBaqAy6aDD36aU1J2wUbXESWON6TZp8DgGh49jxEoPpvqEc90VWJnTlD3eTy'
```
Response
```
{
"payment_id": "pay_an7R6C8VfCRBf7yMqp5b",
"merchant_id": "merchant_1733233863",
"status": "succeeded",
"amount": 1050,
"net_amount": 1050,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 1050,
"connector": "bamboraapac",
"client_secret": "pay_an7R6C8VfCRBf7yMqp5b_secret_dDVP1sMzNtjFuKFk1AQx",
"created": "2024-12-03T13:52:34.491Z",
"currency": "EUR",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+1"
},
"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": "1111",
"card_type": "CREDIT",
"card_network": "Visa",
"card_issuer": "JP Morgan",
"card_issuing_country": "INDIA",
"card_isin": "411111",
"card_extended_bin": null,
"card_exp_month": "12",
"card_exp_year": "25",
"card_holder_name": null,
"payment_checks": null,
"authentication_data": 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": "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": "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": "32645468",
"frm_message": null,
"metadata": {
"udf1": "value1",
"login_date": "2019-09-10T10:11:12Z",
"new_customer": "true"
},
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "32645468",
"payment_link": null,
"profile_id": "pro_PWkVqhQCoj2AZwqeixJ7",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_uTwyKdYff5FC7p9kn8t7",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-12-03T14:07:34.491Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2024-12-03T13:52:35.943Z",
"charges": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
---
Boku: Creds not available
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/payments/connector_integration_v2_impls.rs`
- `crates/router/src/core/payments/flows.rs`
**2. External Connector Integration**
- `crates/hyperswitch_connectors/Cargo.toml`
- `crates/hyperswitch_connectors/src/connectors.rs`
- `crates/router/src/connector/bamboraapac.rs`
- ... and 13 more files
**3. Configuration Files**
- `crates/router/Cargo.toml`
**4. Other**
- `Cargo.lock`
- `crates/router/src/consts.rs`
**Code Patterns Applied:**
- Implement new functions (18 changes)
- Extend existing types with new fields (394 changes)
- Add conditional logic for feature flags or filtering (2 changes)
**Detailed Identifier Changes:**
Commit 36388d45:
Files to modify:
**crates/hyperswitch_connectors/src/connectors.rs**
Add:
- mod: pub::bamboraapac
- mod: pub::boku
- mod: pub::gocardless
- mod: pub::prophetpay
- mod: pub::rapyd
**crates/hyperswitch_connectors/src/default_implementations.rs**
Modify existing code
**crates/hyperswitch_connectors/src/default_implementations_v2.rs**
Modify existing code
**crates/hyperswitch_connectors/src/utils.rs**
Add:
- function: private::get_email
- trait: pub::CustomerData
- impl: impl CustomerData for ConnectorCustomerData
**crates/router/src/connector.rs**
Remove:
- mod: pub::bamboraapac
- mod: pub::boku
- mod: pub::gocardless
- mod: pub::prophetpay
- mod: pub::rapyd
**crates/router/src/consts.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
|
{"pr_number": 6652, "pr_title": "refactor(connector): Move connectors Bamboraapac, Boku, Gocardless, Prophetpay, Rapyd", "merged_at": "2024-12-05T08:14:44Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments/connector_integration_v2_impls.rs", "crates/router/src/core/payments/flows.rs"], "connectors": ["crates/hyperswitch_connectors/Cargo.toml", "crates/hyperswitch_connectors/src/connectors.rs", "crates/router/src/connector/bamboraapac.rs", "crates/router/src/connector/bamboraapac/transformers.rs", "crates/router/src/connector/boku.rs", "crates/router/src/connector/boku/transformers.rs", "crates/router/src/connector/gocardless.rs", "crates/router/src/connector/gocardless/transformers.rs", "crates/router/src/connector/prophetpay.rs", "crates/router/src/connector/prophetpay/transformers.rs", "crates/router/src/connector/rapyd.rs", "crates/router/src/connector/rapyd/transformers.rs", "crates/hyperswitch_connectors/src/default_implementations.rs", "crates/hyperswitch_connectors/src/default_implementations_v2.rs", "crates/hyperswitch_connectors/src/utils.rs", "crates/router/src/connector.rs"], "config": ["crates/router/Cargo.toml"], "other": ["Cargo.lock", "crates/router/src/consts.rs"]}, "change_types": {"functions_added": 18, "fields_added": 394, "imports_added": 50, "conditionals_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(payments): add PaymentListFilterConstraints and payments_list_by_filter endpoint for v2
## 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 -->
**Enhanced Payment Listing API with Multi-Value Filtering**
This feature adds support for retrieving a filtered list of payments via a `GET /v2/payments/list` endpoint where multiple values can be provided for a single filter key (e.g. `status`, `currency`, `connector`, etc.).
### 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)?
-->
GetRequest:
```
curl --location 'http://localhost:8080/v2/payments/list' \
--header 'api-key: dev_tP1IAK95c65hjO7NvF3dRliuiMuSIFhIeFjXBb1du3NZ1Ui6Av0XKyL3ONtB7tpy' \
--header 'Content-Type: application/json' \
--header 'x-profile-id: pro_G9buhoAY3Mpu9cFIeWoZ' \
--header 'Authorization: api-key=dev_tP1IAK95c65hjO7NvF3dRliuiMuSIFhIeFjXBb1du3NZ1Ui6Av0XKyL3ONtB7tpy' \
--data ''
```
GetResponse:
```
{
"count": 4,
"total_count": 4,
"data": [
{
"id": "12345_pay_01987e212eac7b23986ab9afee1d4f3f",
"merchant_id": "cloth_seller_qNqGZXs31yvrAlmFG1Jj",
"profile_id": "pro_G9buhoAY3Mpu9cFIeWoZ",
"customer_id": null,
"payment_method_id": null,
"status": "requires_payment_method",
"amount": {
"order_amount": 100,
"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": 100,
"amount_to_capture": null,
"amount_capturable": 0,
"amount_captured": null
},
"created": "2025-08-06T06:46:00.627Z",
"payment_method_type": null,
"payment_method_subtype": null,
"connector": null,
"merchant_connector_id": null,
"customer": null,
"merchant_reference_id": null,
"connector_payment_id": null,
"connector_response_reference_id": null,
"metadata": null,
"description": null,
"authentication_type": "no_three_ds",
"capture_method": "manual",
"setup_future_usage": "on_session",
"attempt_count": 0,
"error": null,
"cancellation_reason": null,
"order_details": null,
"return_url": null,
"statement_descriptor": null,
"allowed_payment_method_types": null,
"authorization_count": 0,
"modified_at": null
},
{
"id": "12345_pay_01987e212d6f7af18f54d484b9afad2f",
"merchant_id": "cloth_seller_qNqGZXs31yvrAlmFG1Jj",
"profile_id": "pro_G9buhoAY3Mpu9cFIeWoZ",
"customer_id": null,
"payment_method_id": null,
"status": "requires_payment_method",
"amount": {
"order_amount": 100,
"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": 100,
"amount_to_capture": null,
"amount_capturable": 0,
"amount_captured": null
},
"created": "2025-08-06T06:46:00.316Z",
"payment_method_type": null,
"payment_method_subtype": null,
"connector": null,
"merchant_connector_id": null,
"customer": null,
"merchant_reference_id": null,
"connector_payment_id": null,
"connector_response_reference_id": null,
"metadata": null,
"description": null,
"authentication_type": "no_three_ds",
"capture_method": "manual",
"setup_future_usage": "on_session",
"attempt_count": 0,
"error": null,
"cancellation_reason": null,
"order_details": null,
"return_url": null,
"statement_descriptor": null,
"allowed_payment_method_types": null,
"authorization_count": 0,
"modified_at": null
},
{
"id": "12345_pay_01987e212b497a7394a404b857f156bf",
"merchant_id": "cloth_seller_qNqGZXs31yvrAlmFG1Jj",
"profile_id": "pro_G9buhoAY3Mpu9cFIeWoZ",
"customer_id": null,
"payment_method_id": null,
"status": "requires_payment_method",
"amount": {
"order_amount": 100,
"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": 100,
"amount_to_capture": null,
"amount_capturable": 0,
"amount_captured": null
},
"created": "2025-08-06T06:45:59.767Z",
"payment_method_type": null,
"payment_method_subtype": null,
"connector": null,
"merchant_connector_id": null,
"customer": null,
"merchant_reference_id": null,
"connector_payment_id": null,
"connector_response_reference_id": null,
"metadata": null,
"description": null,
"authentication_type": "no_three_ds",
"capture_method": "manual",
"setup_future_usage": "on_session",
"attempt_count": 0,
"error": null,
"cancellation_reason": null,
"order_details": null,
"return_url": null,
"statement_descriptor": null,
"allowed_payment_method_types": null,
"authorization_count": 0,
"modified_at": null
},
{
"id": "12345_pay_01987e1fa70c7bb18fea2a1667c32e5e",
"merchant_id": "cloth_seller_qNqGZXs31yvrAlmFG1Jj",
"profile_id": "pro_G9buhoAY3Mpu9cFIeWoZ",
"customer_id": null,
"payment_method_id": null,
"status": "requires_payment_method",
"amount": {
"order_amount": 100,
"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": 100,
"amount_to_capture": null,
"amount_capturable": 0,
"amount_captured": null
},
"created": "2025-08-06T06:44:20.386Z",
"payment_method_type": null,
"payment_method_subtype": null,
"connector": null,
"merchant_connector_id": null,
"customer": null,
"merchant_reference_id": null,
"connector_payment_id": null,
"connector_response_reference_id": null,
"metadata": null,
"description": null,
"authentication_type": "no_three_ds",
"capture_method": "manual",
"setup_future_usage": "on_session",
"attempt_count": 0,
"error": null,
"cancellation_reason": null,
"order_details": null,
"return_url": null,
"statement_descriptor": null,
"allowed_payment_method_types": null,
"authorization_count": 0,
"modified_at": null
}
]
}
```
GETRequestWithMultipleFilters:
```
curl --location 'http://localhost:8080/v2/payments/list?status=requires_payment_method%2Crequires_capture%2Csucceeded¤cy=USD' \
--header 'api-key: dev_0M1HsoPENAKVcLprxBkqXvtLLA8myjdVHFUDvvknNykT1jlEdww31C8VNcj3emYL' \
--header 'Content-Type: application/json' \
--header 'x-profile-id: pro_qBIx1HzjxmvyeDgJmZLd' \
--header 'Authorization: api-key=dev_0M1HsoPENAKVcLprxBkqXvtLLA8myjdVHFUDvvknNykT1jlEdww31C8VNcj3emYL' \
--data ''
```
PostResponse:
```
{
"count": 6,
"total_count": 6,
"data": [
{
"id": "12345_pay_019897db488f74b2ace8d4f34a1afd2e",
"merchant_id": "cloth_seller_EWd2xVEKmKewu5gHgXMY",
"profile_id": "pro_qBIx1HzjxmvyeDgJmZLd",
"customer_id": null,
"payment_method_id": null,
"status": "succeeded",
"amount": {
"order_amount": 100,
"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": 100,
"amount_to_capture": null,
"amount_capturable": 0,
"amount_captured": 100
},
"created": "2025-08-11T06:39:47.356Z",
"payment_method_type": "card",
"payment_method_subtype": "credit",
"connector": "authorizedotnet",
"merchant_connector_id": "mca_t6Qa8RtV3MHmRAHlu1Zi",
"customer": null,
"merchant_reference_id": null,
"connector_payment_id": "80043331424",
"connector_response_reference_id": "80043331424",
"metadata": null,
"description": null,
"authentication_type": "no_three_ds",
"capture_method": "automatic",
"setup_future_usage": "on_session",
"attempt_count": 0,
"error": null,
"cancellation_reason": null,
"order_details": null,
"return_url": null,
"statement_descriptor": null,
"allowed_payment_method_types": null,
"authorization_count": 0,
"modified_at": "2025-08-11T06:39:50.721Z"
},
{
"id": "12345_pay_019897db458a7650b52dc95d1d2cedc5",
"merchant_id": "cloth_seller_EWd2xVEKmKewu5gHgXMY",
"profile_id": "pro_qBIx1HzjxmvyeDgJmZLd",
"customer_id": null,
"payment_method_id": null,
"status": "requires_payment_method",
"amount": {
"order_amount": 100,
"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": 100,
"amount_to_capture": null,
"amount_capturable": 0,
"amount_captured": null
},
"created": "2025-08-11T06:39:46.589Z",
"payment_method_type": null,
"payment_method_subtype": null,
"connector": null,
"merchant_connector_id": null,
"customer": null,
"merchant_reference_id": null,
"connector_payment_id": null,
"connector_response_reference_id": null,
"metadata": null,
"description": null,
"authentication_type": "no_three_ds",
"capture_method": "automatic",
"setup_future_usage": "on_session",
"attempt_count": 0,
"error": null,
"cancellation_reason": null,
"order_details": null,
"return_url": null,
"statement_descriptor": null,
"allowed_payment_method_types": null,
"authorization_count": 0,
"modified_at": null
},
{
"id": "12345_pay_019897db02ff7e10b129a3df71b09aaf",
"merchant_id": "cloth_seller_EWd2xVEKmKewu5gHgXMY",
"profile_id": "pro_qBIx1HzjxmvyeDgJmZLd",
"customer_id": null,
"payment_method_id": null,
"status": "requires_payment_method",
"amount": {
"order_amount": 100,
"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": 100,
"amount_to_capture": null,
"amount_capturable": 0,
"amount_captured": null
},
"created": "2025-08-11T06:39:29.562Z",
"payment_method_type": null,
"payment_method_subtype": null,
"connector": null,
"merchant_connector_id": null,
"customer": null,
"merchant_reference_id": null,
"connector_payment_id": null,
"connector_response_reference_id": null,
"metadata": null,
"description": null,
"authentication_type": "no_three_ds",
"capture_method": "automatic",
"setup_future_usage": "on_session",
"attempt_count": 0,
"error": null,
"cancellation_reason": null,
"order_details": null,
"return_url": null,
"statement_descriptor": null,
"allowed_payment_method_types": null,
"authorization_count": 0,
"modified_at": null
},
{
"id": "12345_pay_019897db003876b1b5f57f8d4c27072d",
"merchant_id": "cloth_seller_EWd2xVEKmKewu5gHgXMY",
"profile_id": "pro_qBIx1HzjxmvyeDgJmZLd",
"customer_id": null,
"payment_method_id": null,
"status": "requires_payment_method",
"amount": {
"order_amount": 100,
"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": 100,
"amount_to_capture": null,
"amount_capturable": 0,
"amount_captured": null
},
"created": "2025-08-11T06:39:28.839Z",
"payment_method_type": null,
"payment_method_subtype": null,
"connector": null,
"merchant_connector_id": null,
"customer": null,
"merchant_reference_id": null,
"connector_payment_id": null,
"connector_response_reference_id": null,
"metadata": null,
"description": null,
"authentication_type": "no_three_ds",
"capture_method": "automatic",
"setup_future_usage": "on_session",
"attempt_count": 0,
"error": null,
"cancellation_reason": null,
"order_details": null,
"return_url": null,
"statement_descriptor": null,
"allowed_payment_method_types": null,
"authorization_count": 0,
"modified_at": null
},
{
"id": "12345_pay_019897dafd2070c1956d1af439088873",
"merchant_id": "cloth_seller_EWd2xVEKmKewu5gHgXMY",
"profile_id": "pro_qBIx1HzjxmvyeDgJmZLd",
"customer_id": null,
"payment_method_id": null,
"status": "requires_payment_method",
"amount": {
"order_amount": 100,
"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": 100,
"amount_to_capture": null,
"amount_capturable": 0,
"amount_captured": null
},
"created": "2025-08-11T06:39:28.045Z",
"payment_method_type": null,
"payment_method_subtype": null,
"connector": null,
"merchant_connector_id": null,
"customer": null,
"merchant_reference_id": null,
"connector_payment_id": null,
"connector_response_reference_id": null,
"metadata": null,
"description": null,
"authentication_type": "no_three_ds",
"capture_method": "automatic",
"setup_future_usage": "on_session",
"attempt_count": 0,
"error": null,
"cancellation_reason": null,
"order_details": null,
"return_url": null,
"statement_descriptor": null,
"allowed_payment_method_types": null,
"authorization_count": 0,
"modified_at": null
},
{
"id": "12345_pay_019897dae26871f2be542d43fc570b13",
"merchant_id": "cloth_seller_EWd2xVEKmKewu5gHgXMY",
"profile_id": "pro_qBIx1HzjxmvyeDgJmZLd",
"customer_id": null,
"payment_method_id": null,
"status": "succeeded",
"amount": {
"order_amount": 100,
"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": 100,
"amount_to_capture": null,
"amount_capturable": 0,
"amount_captured": 100
},
"created": "2025-08-11T06:39:21.215Z",
"payment_method_type": "card",
"payment_method_subtype": "credit",
"connector": "authorizedotnet",
"merchant_connector_id": "mca_t6Qa8RtV3MHmRAHlu1Zi",
"customer": null,
"merchant_reference_id": null,
"connector_payment_id": "80043331420",
"connector_response_reference_id": "80043331420",
"metadata": null,
"description": null,
"authentication_type": "no_three_ds",
"capture_method": "automatic",
"setup_future_usage": "on_session",
"attempt_count": 0,
"error": null,
"cancellation_reason": null,
"order_details": null,
"return_url": null,
"statement_descriptor": null,
"allowed_payment_method_types": null,
"authorization_count": 0,
"modified_at": "2025-08-11T06:39:26.628Z"
}
]
}
```
GetRequestWithTimeDuration:
```
curl --location 'http://localhost:8080/v2/payments/list?status=requires_payment_method%2Crequires_capture%2Csucceeded¤cy=USD&created.gte=2025-08-01T00%3A00%3A00Z&created.lte=2025-08-09T23%3A59%3A59Z' \
--header 'api-key: dev_SfzD1JfNBMBwIxi6S55ku8kCXpt665huoFrJv1hnIFERGXNIUWldBQaOMJiHE0de' \
--header 'Content-Type: application/json' \
--header 'x-profile-id: pro_E7U8C0vjFGXvuaVEGH4M' \
--header 'Authorization: api-key=dev_SfzD1JfNBMBwIxi6S55ku8kCXpt665huoFrJv1hnIFERGXNIUWldBQaOMJiHE0de' \
--data ''
```
Response:
```
{
"count": 0,
"total_count": 0,
"data": []
}
```
GetRequestWithTimeDuration:
```
curl --location 'http://localhost:8080/v2/payments/list?status=failed¤cy=USD&created.gte=2025-08-01T00%3A00%3A00Z&created.lte=2025-08-31T23%3A59%3A59Z' \
--header 'api-key: dev_SfzD1JfNBMBwIxi6S55ku8kCXpt665huoFrJv1hnIFERGXNIUWldBQaOMJiHE0de' \
--header 'Content-Type: application/json' \
--header 'x-profile-id: pro_E7U8C0vjFGXvuaVEGH4M' \
--header 'Authorization: api-key=dev_SfzD1JfNBMBwIxi6S55ku8kCXpt665huoFrJv1hnIFERGXNIUWldBQaOMJiHE0de' \
--data ''
```
Response:
```
{
"count": 1,
"total_count": 1,
"data": [
{
"id": "12345_pay_01989e70b0fc7e219eb6352105ccd06f",
"merchant_id": "cloth_seller_bdCHKB6LXsvpWlKKcios",
"profile_id": "pro_E7U8C0vjFGXvuaVEGH4M",
"customer_id": "12345_cus_01989e7025b471c0ace0c31e46b83360",
"payment_method_id": null,
"status": "failed",
"amount": {
"order_amount": 10000,
"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": 10000,
"amount_to_capture": null,
"amount_capturable": 0,
"amount_captured": null
},
"created": "2025-08-12T13:20:42.244Z",
"payment_method_type": "card",
"payment_method_subtype": "credit",
"connector": "trustpay",
"merchant_connector_id": "mca_Z9a58zhABpHduskbCsf9",
"customer": null,
"merchant_reference_id": null,
"connector_payment_id": null,
"connector_response_reference_id": null,
"metadata": null,
"description": null,
"authentication_type": "no_three_ds",
"capture_method": "automatic",
"setup_future_usage": "on_session",
"attempt_count": 0,
"error": {
"code": "4",
"message": "4",
"unified_code": null,
"unified_message": null,
"network_advice_code": null,
"network_decline_code": null,
"network_error_message": null
},
"cancellation_reason": null,
"order_details": null,
"return_url": null,
"statement_descriptor": null,
"allowed_payment_method_types": null,
"authorization_count": 0,
"modified_at": "2025-08-12T13:20:47.624Z"
}
]
}
```
Closes #8792
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/payments.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/query/payment_attempt.rs`
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/payments/payment_attempt.rs`
- `crates/hyperswitch_domain_models/src/payments/payment_intent.rs`
**4. External Connector Integration**
- `crates/common_utils/src/id_type/merchant_connector_account.rs`
**5. Other**
- `api-reference/v2/openapi_spec_v2.json`
- `crates/router/src/db/kafka_store.rs`
- `crates/storage_impl/src/mock_db/payment_attempt.rs`
- ... and 2 more files
**Code Patterns Applied:**
- Implement new functions (2 changes)
- Extend existing types with new fields (65 changes)
- Add conditional logic for feature flags or filtering (9 changes)
- Modify database queries (59 changes)
**Detailed Identifier Changes:**
Commit 47ae9908:
Files to modify:
**crates/api_models/src/payments.rs**
Add:
- function: private::parse_comma_separated
**crates/common_utils/src/id_type/merchant_connector_account.rs**
Add:
- function: private::from_str
- impl: impl FromStr for MerchantConnectorAccountId
**crates/diesel_models/src/query/payment_attempt.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payments/payment_attempt.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payments/payment_intent.rs**
Modify existing code
**crates/router/src/db/kafka_store.rs**
Modify existing code
**crates/storage_impl/src/mock_db/payment_attempt.rs**
Modify existing code
**crates/storage_impl/src/payments/payment_attempt.rs**
Modify existing code
**crates/storage_impl/src/payments/payment_intent.rs**
Modify existing code
|
{"pr_number": 8794, "pr_title": "feat(payments): add PaymentListFilterConstraints and payments_list_by_filter endpoint for v2", "merged_at": "2025-08-21T14:04:23Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/payments.rs"], "database": ["crates/diesel_models/src/query/payment_attempt.rs"], "domain": ["crates/hyperswitch_domain_models/src/payments/payment_attempt.rs", "crates/hyperswitch_domain_models/src/payments/payment_intent.rs"], "connectors": ["crates/common_utils/src/id_type/merchant_connector_account.rs"], "other": ["api-reference/v2/openapi_spec_v2.json", "crates/router/src/db/kafka_store.rs", "crates/storage_impl/src/mock_db/payment_attempt.rs", "crates/storage_impl/src/payments/payment_attempt.rs", "crates/storage_impl/src/payments/payment_intent.rs"]}, "change_types": {"functions_added": 2, "fields_added": 65, "imports_added": 2, "conditionals_added": 9, "database_queries": 59}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(payouts): add domain type for PayoutId
feat(payouts): allow payout_id to be configurable in API request
feat(payouts): add merchant_order_reference_id for referencing payouts
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
This pull request introduces two main features for payouts:
1. **Configurable `payout_id` in API Requests**:
* The `payout_id` field in payout creation API requests can now be optionally provided by the merchant. If provided, this ID will be used for the payout. If not provided, the system will generate one.
* Internally, the usage of `payout_id` has been standardized to use the strongly-typed `common_utils::id_type::PayoutId` instead of `String`. This change has been propagated throughout relevant structs and functionalities like `PayoutsData`, data handling logic in `crates/router/src/core/utils.rs`, test utilities and DB queries.
2. **`merchant_order_reference_id` for Payout Referencing**:
* The `merchant_order_reference_id` field has been added/updated in payout API models (e.g., `PayoutListFilterConstraints` in `crates/api_models/src/payouts.rs`). This allows merchants to use their own unique identifier to reference payouts.
**Refactoring and Connector Updates**:
* To support the `id_type::PayoutId` change and ensure correct data flow, connector integrations (Adyen, Adyenplatform, Cybersource, Nomupay) have been refactored.
* Connectors now consistently use `RouterData.connector_request_reference_id` (which typically holds the `payout_attempt_id` as a `String`) when a string-based reference is required by the external service, rather than converting the internal `PayoutsData.payout_id`. This ensures that connectors receive the appropriate string identifier (e.g., `payout_attempt_id`) they expect.
### Additional Changes
- [x] This PR modifies the API contract.
- [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`
-->
## Motivation and Context
These changes address the need for greater flexibility and type safety in payout processing, as outlined in GitHub issues #8392 and #1321.
* **Configurable `payout_id`**: Allows merchants more control over their payout identifiers within the Hyperswitch.
* **`merchant_order_reference_id`**: Provides a dedicated field for merchants to use their internal order or reference IDs.
* **`PayoutId` Type Standardization**: Using `common_utils::id_type::PayoutId` enhances code robustness and maintainability by leveraging Rust's type system to prevent errors related to ID handling.
* **Connector Refactoring**: Ensures that connectors use the correct string-based identifiers (like `payout_attempt_id` via `connector_request_reference_id`) required by external payout processors, maintaining correctness of integrations.
Links to issues:
* https://github.com/juspay/hyperswitch/issues/8392
* https://github.com/juspay/hyperswitch/issues/1321
## How did you test it?
<details>
<summary>1. Card payouts via API</summary>
cURL
curl --location --request POST 'http://localhost:8080/payouts/create' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_lAISInmiO4UNrMmvkJogzRVKEGKlBKQbRCBFOkLJTXmq6nsD5G1H65BjOd4H72H8' \
--data '{"amount":100,"currency":"EUR","profile_id":"pro_vVSlzCG7M1GSX9SyssY8","customer_id":"cus_WULwykbL8laUbxDUeGEB","connector":["adyenplatform"],"description":"Its my first payout request","payout_type":"card","payout_method_data":{"card":{"card_number":"4111111111111111","expiry_month":"03","expiry_year":"2030"}},"billing":{"address":{"line1":"1467","line2":"Harrison Street","line3":"Harrison Street","city":"San Fransico","state":"CA","zip":"94122","country":"FR","first_name":"John","last_name":"Doe"}},"entity_type":"Individual","recurring":true,"metadata":{"ref":"123"},"confirm":true,"auto_fulfill":true}'
Response
{"payout_id":"ff21b89d-3cfd-4f0f-b3ff-c468d90d7074","merchant_id":"merchant_1751292662","amount":100,"currency":"EUR","connector":"adyenplatform","payout_type":"card","payout_method_data":{"card":{"card_issuer":null,"card_network":null,"card_type":null,"card_issuing_country":null,"bank_code":null,"last4":"1111","card_isin":"411111","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"2030","card_holder_name":null}},"billing":{"address":{"city":"San Fransico","country":"FR","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"CA","first_name":"John","last_name":"Doe"},"phone":null,"email":null},"auto_fulfill":true,"customer_id":"cus_WULwykbL8laUbxDUeGEB","customer":{"id":"cus_WULwykbL8laUbxDUeGEB","name":"John Nether","email":null,"phone":"6168205362","phone_country_code":"+1"},"client_secret":"payout_ff21b89d-3cfd-4f0f-b3ff-c468d90d7074_secret_qzFALtOg6ZhYAOAUr2qY","return_url":null,"business_country":null,"business_label":null,"description":"Its my first payout request","entity_type":"Individual","recurring":true,"metadata":{"ref":"123"},"merchant_connector_id":"mca_SfssFvg5RBT2k7iKRRsS","status":"initiated","error_message":null,"error_code":null,"profile_id":"pro_vVSlzCG7M1GSX9SyssY8","created":"2025-06-30T14:12:47.886Z","connector_transaction_id":"38EBIX67HBSYZ30V","priority":null,"payout_link":null,"email":null,"name":"John Nether","phone":"6168205362","phone_country_code":"+1","unified_code":null,"unified_message":null,"payout_method_id":"pm_wScFhCfxELZ7gN13Nbxz"}
</details>
<details>
<summary>2. Card payouts via Payout Links</summary>
cURL
curl --location --request POST 'http://localhost:8080/payouts/create' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_lAISInmiO4UNrMmvkJogzRVKEGKlBKQbRCBFOkLJTXmq6nsD5G1H65BjOd4H72H8' \
--data '{"amount":1,"currency":"EUR","customer_id":"cus_WULwykbL8laUbxDUeGEB","description":"Its my first payout request","entity_type":"Individual","confirm":false,"auto_fulfill":true,"session_expiry":1000000,"profile_id":"pro_vVSlzCG7M1GSX9SyssY8","payout_link":true,"return_url":"https://www.google.com","payout_link_config":{"form_layout":"journey","theme":"#0066ff","logo":"https://hyperswitch.io/favicon.ico","merchant_name":"HyperSwitch Inc.","test_mode":true}}'
Response
{"payout_id":"2371746b-df3d-41da-8fa2-455faf921ea9","merchant_id":"merchant_1751292662","amount":1,"currency":"EUR","connector":null,"payout_type":null,"payout_method_data":null,"billing":null,"auto_fulfill":true,"customer_id":"cus_WULwykbL8laUbxDUeGEB","customer":{"id":"cus_WULwykbL8laUbxDUeGEB","name":"John Nether","email":null,"phone":"6168205362","phone_country_code":"+1"},"client_secret":"payout_2371746b-df3d-41da-8fa2-455faf921ea9_secret_VwDeIScMTLFzG7Iz1DZU","return_url":"https://www.google.com","business_country":null,"business_label":null,"description":"Its my first payout request","entity_type":"Individual","recurring":false,"metadata":{},"merchant_connector_id":null,"status":"requires_payout_method_data","error_message":null,"error_code":null,"profile_id":"pro_vVSlzCG7M1GSX9SyssY8","created":"2025-06-30T14:14:48.897Z","connector_transaction_id":null,"priority":null,"payout_link":{"payout_link_id":"payout_link_vITmtOWGkaUfeXopruRs","link":"http://localhost:8080/payout_link/merchant_1751292662/2371746b-df3d-41da-8fa2-455faf921ea9?locale=en"},"email":null,"name":"John Nether","phone":"6168205362","phone_country_code":"+1","unified_code":null,"unified_message":null,"payout_method_id":null}
<img width="1719" alt="Screenshot 2025-06-30 at 7 45 32 PM" src="https://github.com/user-attachments/assets/e1ace815-74b5-411a-83be-badb2c04bf7d" />
<img width="1721" alt="Screenshot 2025-06-30 at 7 45 48 PM" src="https://github.com/user-attachments/assets/a8233053-9c1e-402d-87af-e59783fefc9d" />
<img width="913" alt="Screenshot 2025-06-30 at 7 45 54 PM" src="https://github.com/user-attachments/assets/586d1aa9-0116-46f3-b597-91b1f46ba5d2" />
</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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/events/payouts.rs`
- `crates/api_models/src/payouts.rs`
- `crates/api_models/src/webhooks.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/events.rs`
- `crates/diesel_models/src/generic_link.rs`
- `crates/diesel_models/src/payout_attempt.rs`
- ... and 6 more files
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/errors/api_error_response.rs`
- `crates/hyperswitch_domain_models/src/payouts.rs`
- `crates/hyperswitch_domain_models/src/payouts/payout_attempt.rs`
- ... and 2 more files
**4. Core Business Logic**
- `crates/router/src/core/payments/routing.rs`
- `crates/router/src/core/payout_link.rs`
- `crates/router/src/core/payouts.rs`
- ... and 6 more files
**5. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs`
- `crates/hyperswitch_connectors/src/connectors/adyenplatform/transformers/payouts.rs`
- `crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs`
- ... and 5 more files
**6. Utils**
- `crates/common_utils/src/events.rs`
- `crates/common_utils/src/id_type.rs`
- `crates/common_utils/src/id_type/payout.rs`
- ... and 2 more files
**7. Other**
- `api-reference/v1/openapi_spec_v1.json`
- `api-reference/v2/openapi_spec_v2.json`
- `crates/router/src/compatibility/stripe/errors.rs`
- ... and 16 more files
**Code Patterns Applied:**
- Implement new functions (10 changes)
- Extend existing types with new fields (155 changes)
- Add conditional logic for feature flags or filtering (1 changes)
- Modify database queries (27 changes)
**Detailed Identifier Changes:**
Commit a6e3d2c7:
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
|
{"pr_number": 8395, "pr_title": "feat(payouts): add domain type for PayoutId", "merged_at": "2025-07-01T14:45:02Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "merchant", "user"]}, "hierarchy": {"api_models": ["crates/api_models/src/events/payouts.rs", "crates/api_models/src/payouts.rs", "crates/api_models/src/webhooks.rs"], "database": ["crates/diesel_models/src/events.rs", "crates/diesel_models/src/generic_link.rs", "crates/diesel_models/src/payout_attempt.rs", "crates/diesel_models/src/payouts.rs", "crates/diesel_models/src/query/generic_link.rs", "crates/diesel_models/src/query/payout_attempt.rs", "crates/diesel_models/src/query/payouts.rs", "crates/diesel_models/src/schema.rs", "crates/diesel_models/src/schema_v2.rs"], "domain": ["crates/hyperswitch_domain_models/src/errors/api_error_response.rs", "crates/hyperswitch_domain_models/src/payouts.rs", "crates/hyperswitch_domain_models/src/payouts/payout_attempt.rs", "crates/hyperswitch_domain_models/src/payouts/payouts.rs", "crates/hyperswitch_domain_models/src/router_request_types.rs"], "core_business": ["crates/router/src/core/payments/routing.rs", "crates/router/src/core/payout_link.rs", "crates/router/src/core/payouts.rs", "crates/router/src/core/payouts/helpers.rs", "crates/router/src/core/payouts/retry.rs", "crates/router/src/core/payouts/transformers.rs", "crates/router/src/core/payouts/validator.rs", "crates/router/src/core/utils.rs", "crates/router/src/core/webhooks/incoming.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs", "crates/hyperswitch_connectors/src/connectors/adyenplatform/transformers/payouts.rs", "crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs", "crates/hyperswitch_connectors/src/connectors/nomupay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs", "crates/hyperswitch_connectors/src/connectors/stripe/transformers/connect.rs", "crates/hyperswitch_connectors/src/connectors/wise/transformers.rs", "crates/router/tests/connectors/utils.rs"], "utils": ["crates/common_utils/src/events.rs", "crates/common_utils/src/id_type.rs", "crates/common_utils/src/id_type/payout.rs", "crates/common_utils/src/link_utils.rs", "crates/router/src/utils.rs"], "other": ["api-reference/v1/openapi_spec_v1.json", "api-reference/v2/openapi_spec_v2.json", "crates/router/src/compatibility/stripe/errors.rs", "crates/router/src/compatibility/stripe/webhooks.rs", "crates/router/src/db/kafka_store.rs", "crates/router/src/events/outgoing_webhook_logs.rs", "crates/router/src/routes/payout_link.rs", "crates/router/src/routes/payouts.rs", "crates/router/src/services/kafka/payout.rs", "crates/router/src/workflows/outgoing_webhook_retry.rs", "crates/storage_impl/src/lib.rs", "crates/storage_impl/src/mock_db/payout_attempt.rs", "crates/storage_impl/src/mock_db/payouts.rs", "crates/storage_impl/src/payouts/payout_attempt.rs", "crates/storage_impl/src/payouts/payouts.rs", "crates/storage_impl/src/redis/kv_store.rs", "flake.nix", "migrations/2025-06-19-170656_alter_payout_primary_key/down.sql", "migrations/2025-06-19-170656_alter_payout_primary_key/up.sql"]}, "change_types": {"functions_added": 10, "fields_added": 155, "imports_added": 5, "conditionals_added": 1, "database_queries": 27}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(api): remove max_length validation for return_url in PaymentsRequest
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
This PR removes validation on `max_length` for the `return_url` in PaymentsRequest.
### 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
This PR will allow different ENVs to keep different DB constraints and not throw API validation errors specifically for `return_url`
## How did you test it?
Cannot be tested locally - as it throws 5xx.
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/payments.rs`
**2. Tests**
- `cypress-tests/cypress/e2e/spec/Payment/00022-Variations.cy.js`
**3. Other**
- `api-reference/openapi_spec.json`
**Detailed Identifier Changes:**
Commit 0465886f:
Files to modify:
**crates/api_models/src/payments.rs**
Modify existing code
|
{"pr_number": 8125, "pr_title": "refactor(api): remove max_length validation for return_url in PaymentsRequest", "merged_at": "2025-05-24T08:47:38Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment"]}, "hierarchy": {"api_models": ["crates/api_models/src/payments.rs"], "tests": ["cypress-tests/cypress/e2e/spec/Payment/00022-Variations.cy.js"], "other": ["api-reference/openapi_spec.json"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): [SIFT] add Connector Template Code
## 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 -->
### 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)?
-->
This is a template PR, hence no testing required.
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/connector_endpoints.rs`
**2. External Connector Integration**
- `crates/connector_configs/src/connector.rs`
- `crates/connector_configs/toml/development.toml`
- `crates/connector_configs/toml/production.toml`
- ... and 11 more files
**3. Tests**
- `config/deployments/integration_test.toml`
- `loadtest/config/development.toml`
**4. Configuration Files**
- `config/config.example.toml`
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- ... and 2 more files
**Code Patterns Applied:**
- Define new data structures (10 changes)
- Implement new functions (83 changes)
- Extend existing types with new fields (162 changes)
**Detailed Identifier Changes:**
Commit 2d3abd71:
Files to modify:
**crates/connector_configs/src/connector.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors.rs**
Add:
- mod: pub::sift
**crates/hyperswitch_connectors/src/connectors/sift.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::validate_mandate_payment
- function: private::validate_psync_reference_id
- 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
- function: private::get_connector_about
- function: private::get_supported_payment_methods
- function: private::get_supported_webhook_flows
- struct: pub::Sift
- impl: impl Sift
- impl: impl api::Payment for Sift
- impl: impl api::PaymentSession for Sift
- impl: impl api::ConnectorAccessToken for Sift
- impl: impl api::MandateSetup for Sift
- impl: impl api::PaymentAuthorize for Sift
- impl: impl api::PaymentSync for Sift
- impl: impl api::PaymentCapture for Sift
- impl: impl api::PaymentVoid for Sift
- impl: impl api::Refund for Sift
- impl: impl api::RefundExecute for Sift
- impl: impl api::RefundSync for Sift
- impl: impl api::PaymentToken for Sift
- impl: impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData> for Sift
- impl: impl ConnectorCommonExt<Flow, Request, Response> for Sift
- impl: impl ConnectorCommon for Sift
- impl: impl ConnectorValidation for Sift
- impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Sift
- impl: impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for Sift
- impl: impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Sift
- impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Sift
- impl: impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Sift
- impl: impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for Sift
- impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Sift
- impl: impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Sift
- impl: impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Sift
- impl: impl webhooks::IncomingWebhook for Sift
- impl: impl ConnectorSpecifications for Sift
- mod: pub::transformers
**crates/hyperswitch_connectors/src/connectors/sift/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::SiftRouterData
- struct: pub::SiftPaymentsRequest
- struct: pub::SiftCard
- struct: pub::SiftAuthType
- struct: pub::SiftPaymentsResponse
- struct: pub::SiftRefundRequest
- struct: pub::RefundResponse
- struct: pub::SiftErrorResponse
- enum: pub::SiftPaymentStatus
- enum: pub::RefundStatus
- impl: impl From<(StringMinorUnit, T)> for SiftRouterData<T>
- impl: impl TryFrom<&SiftRouterData<&PaymentsAuthorizeRouterData>> for SiftPaymentsRequest
- impl: impl TryFrom<&ConnectorAuthType> for SiftAuthType
- impl: impl From<SiftPaymentStatus> for common_enums::AttemptStatus
- impl: impl TryFrom<ResponseRouterData<F, SiftPaymentsResponse, T, PaymentsResponseData>> for RouterData<F, T, PaymentsResponseData>
- impl: impl TryFrom<&SiftRouterData<&RefundsRouterData<F>>> for SiftRefundRequest
- 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_domain_models/src/connector_endpoints.rs**
Modify existing code
**crates/router/src/connector.rs**
Modify existing code
**crates/router/tests/connectors/main.rs**
Add:
- mod: private::sift
**crates/router/tests/connectors/sift.rs**
Add:
- 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::SiftTest
- impl: impl ConnectorActions for SiftTest
- impl: impl utils::Connector for SiftTest
**crates/test_utils/src/connector_auth.rs**
Modify existing code
|
{"pr_number": 8488, "pr_title": "feat(connector): [SIFT] add Connector Template Code ", "merged_at": "2025-08-08T13:23:45Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"domain": ["crates/hyperswitch_domain_models/src/connector_endpoints.rs"], "connectors": ["crates/connector_configs/src/connector.rs", "crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml", "crates/hyperswitch_connectors/src/connectors.rs", "crates/hyperswitch_connectors/src/connectors/sift.rs", "crates/hyperswitch_connectors/src/connectors/sift/transformers.rs", "crates/hyperswitch_connectors/src/default_implementations.rs", "crates/hyperswitch_connectors/src/default_implementations_v2.rs", "crates/router/src/connector.rs", "crates/router/tests/connectors/main.rs", "crates/router/tests/connectors/sift.rs", "crates/test_utils/src/connector_auth.rs", "scripts/add_connector.sh"], "tests": ["config/deployments/integration_test.toml", "loadtest/config/development.toml"], "config": ["config/config.example.toml", "config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml"]}, "change_types": {"structs_added": 10, "functions_added": 83, "enums_added": 2, "fields_added": 162, "imports_added": 22}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): Add support for passive churn recovery 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 -->
**Recovery Incoming Webhooks service :**
Consume incoming webhooks of billing platforms to schedule revenue recovery retries in hs.
**Endpoint :**
v2/webhooks/revenue_recovery/{{profile_id}}/{{merchant_connector_account_id}}
**Authentication :**
Source verification.
**Method :**
POST
**Request :**
Accepts connector specific requests , unified fields that we are going to consume and verified across billing platforms(Chargebee, Recurly, Stripe Billing).
**Response :**
They expect us to send 200 back.
**DB changes** :
- Triggered by : Flag to find out whether an attempt was created external or internal. Possible enums of triggered_by EXTERNAL/ INTERNAL.
- Payment attempt
```
feature_metadata{
revenue_recovery : {
triggered_by : TriggeredBy
}
}
```
**triggered_by** : Flag to find out whether an attempt was created external or internal. Possible enums of triggered_by EXTERNAL/ INTERNAL
**Flow**
1) We receive invoice and transactional related incoming webhooks from billing connectors(ex: chargebee).
2) Verify the source with source verification logic using incoming webhook trait.
3) Fetch the intent using merchant reference id(Invoice id), if not found create new payment intent for the invoice.
4) Fetch the attempt if event is transactional event, if not found record new attempt against the payment intent .
5) Based on triggered_by and event type decide what actions needs to be taken for the webhook
Note: Only handler functions of payments core are called in webhooks flow to make revenue recovery flow modular. No direct DB call is made in recovery incoming webhook flow to payments(intent/attempt) table.
**why do we need attempt.triggered_by and event type to take the decision?**
- Recovery event types : There can be 4 types of events that we consume from billing connector.
- Payment Failure, payment success, payment pending, Invoice cancel
Based on event we take the action but we need to triggered by to know whether it was created by Hyperswitch or External system.
- Recovery Actions :
```
/// type of action that needs to taken after consuming recovery payload
RecoveryAction {
/// Stops the process tracker and update the payment intent.
CancelInvoice,
/// Records the external transaction against payment intent.
ScheduleFailedPayment,
/// Records the external payment and stops the internal process tracker.
SuccessPaymentExternal,
/// Pending payments from billing processor.
PendingPayment,
/// No action required.
NoAction,
/// Invalid event has been received.
InvalidAction,
}
```
Mapping between (event, triggered_by) and Actions
```
IncomingWebhookEvent::RecoveryPaymentFailure => match attempt_triggered_by {
Some(TriggeredBy::Internal) => RecoveryAction::NoAction,
Some(TriggeredBy::External) | None => RecoveryAction::ScheduleFailedPayment,
},
IncomingWebhookEvent::RecoveryPaymentSuccess => match attempt_triggered_by {
Some(TriggeredBy::Internal) => RecoveryAction::NoAction,
Some(TriggeredBy::External) | None => RecoveryAction::SuccessPaymentExternal,
},
IncomingWebhookEvent::RecoveryPaymentPending => RecoveryAction::PendingPayment,
IncomingWebhookEvent::RecoveryInvoiceCancel => RecoveryAction::CancelInvoice,
```
Note : Pending Task From this PR
- charegebee Webhooks implementations- #7110
- Record Attempt internal - #7236
### 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)?
-->
Cannot test this flow, will be tested once #7236 and #7110 are merged.
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/Cargo.toml`
- `crates/api_models/src/payments.rs`
- `crates/api_models/src/webhooks.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/payment_attempt.rs`
- `crates/diesel_models/src/schema_v2.rs`
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/Cargo.toml`
- `crates/hyperswitch_domain_models/src/lib.rs`
- `crates/hyperswitch_domain_models/src/payments/payment_attempt.rs`
- ... and 1 more files
**4. Core Business Logic**
- `crates/router/src/core/errors.rs`
- `crates/router/src/core/payments.rs`
- `crates/router/src/core/payments/transformers.rs`
- ... and 3 more files
**5. External Connector Integration**
- `crates/router/src/services/connector_integration_interface.rs`
**6. Type Definitions**
- `crates/router_env/src/logger/types.rs`
**7. Utils**
- `crates/common_utils/src/ext_traits.rs`
- `crates/router/src/routes/lock_utils.rs`
**8. Configuration Files**
- `crates/hyperswitch_interfaces/Cargo.toml`
- `crates/router/Cargo.toml`
**9. Other**
- `api-reference-v2/openapi_spec.json`
- `api-reference/openapi_spec.json`
- `crates/common_enums/src/enums.rs`
- ... and 8 more files
**Code Patterns Applied:**
- Define new data structures (12 changes)
- Implement new functions (29 changes)
- Extend existing types with new fields (144 changes)
- Add conditional logic for feature flags or filtering (1 changes)
**Detailed Identifier Changes:**
Commit 06889728:
Files to modify:
**crates/api_models/src/payments.rs**
Add:
- struct: pub::PaymentAttemptFeatureMetadata
- struct: pub::PaymentAttemptRevenueRecoveryData
**crates/api_models/src/webhooks.rs**
Add:
- enum: pub::InvoiceIdType
**crates/common_enums/src/enums.rs**
Add:
- enum: pub::TriggeredBy
**crates/common_utils/src/ext_traits.rs**
Add:
- function: private::async_unwrap_or_else
- function: private::async_unwrap_or_else
**crates/diesel_models/src/payment_attempt.rs**
Add:
- struct: pub::PaymentAttemptFeatureMetadata
- struct: pub::PaymentAttemptRecoveryData
**crates/diesel_models/src/schema_v2.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/lib.rs**
Add:
- mod: pub::revenue_recovery
**crates/hyperswitch_domain_models/src/payments/payment_attempt.rs**
Add:
- function: private::from
- function: private::from
- struct: pub::PaymentAttemptFeatureMetadata
- struct: pub::PaymentAttemptRevenueRecoveryData
- impl: impl From<&PaymentAttemptFeatureMetadata> for DieselPaymentAttemptFeatureMetadata
- impl: impl From<DieselPaymentAttemptFeatureMetadata> for PaymentAttemptFeatureMetadata
**crates/hyperswitch_domain_models/src/revenue_recovery.rs**
Add:
- function: pub::get_attempt_triggered_by
- function: pub::get_action
- function: private::from
- function: private::from
- struct: pub::RevenueRecoveryAttemptData
- struct: pub::RevenueRecoveryInvoiceData
- struct: pub::RecoveryPaymentIntent
- struct: pub::RecoveryPaymentAttempt
- enum: pub::RecoveryAction
- impl: impl RecoveryPaymentAttempt
- impl: impl RecoveryAction
- impl: impl From<&RevenueRecoveryInvoiceData> for api_models::payments::AmountDetails
- impl: impl From<&RevenueRecoveryInvoiceData> for api_models::payments::PaymentsCreateIntentRequest
**crates/hyperswitch_interfaces/src/webhooks.rs**
Add:
- function: private::get_revenue_recovery_attempt_details
- function: private::get_revenue_recovery_invoice_details
**crates/openapi/src/openapi.rs**
Modify existing code
**crates/openapi/src/openapi_v2.rs**
Modify existing code
**crates/router/src/core/errors.rs**
Add:
- enum: pub::RevenueRecoveryError
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
**crates/router/src/core/webhooks.rs**
Add:
- mod: private::recovery_incoming
**crates/router/src/core/webhooks/incoming_v2.rs**
Modify existing code
**crates/router/src/core/webhooks/recovery_incoming.rs**
Add:
- function: pub::recovery_incoming_webhook_flow
- function: private::get_payment_intent
- function: private::create_payment_intent
- function: private::get_payment_attempt
- function: private::record_payment_attempt
- struct: pub::RevenueRecoveryInvoice
- struct: pub::RevenueRecoveryAttempt
- impl: impl RevenueRecoveryInvoice
- impl: impl RevenueRecoveryAttempt
**crates/router/src/routes.rs**
Add:
- mod: pub::recovery_webhooks
**crates/router/src/routes/app.rs**
Modify existing code
**crates/router/src/routes/lock_utils.rs**
Modify existing code
**crates/router/src/routes/recovery_webhooks.rs**
Add:
- function: pub::recovery_receive_incoming_webhook
**crates/router/src/services/connector_integration_interface.rs**
Add:
- function: private::get_revenue_recovery_attempt_details
- function: private::get_revenue_recovery_invoice_details
**crates/router_env/src/logger/types.rs**
Modify existing code
|
{"pr_number": 7109, "pr_title": "feat(connector): Add support for passive churn recovery webhooks", "merged_at": "2025-02-22T21:44:08Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "connector"]}, "hierarchy": {"api_models": ["crates/api_models/Cargo.toml", "crates/api_models/src/payments.rs", "crates/api_models/src/webhooks.rs"], "database": ["crates/diesel_models/src/payment_attempt.rs", "crates/diesel_models/src/schema_v2.rs"], "domain": ["crates/hyperswitch_domain_models/Cargo.toml", "crates/hyperswitch_domain_models/src/lib.rs", "crates/hyperswitch_domain_models/src/payments/payment_attempt.rs", "crates/hyperswitch_domain_models/src/revenue_recovery.rs"], "core_business": ["crates/router/src/core/errors.rs", "crates/router/src/core/payments.rs", "crates/router/src/core/payments/transformers.rs", "crates/router/src/core/webhooks.rs", "crates/router/src/core/webhooks/incoming_v2.rs", "crates/router/src/core/webhooks/recovery_incoming.rs"], "connectors": ["crates/router/src/services/connector_integration_interface.rs"], "types": ["crates/router_env/src/logger/types.rs"], "utils": ["crates/common_utils/src/ext_traits.rs", "crates/router/src/routes/lock_utils.rs"], "config": ["crates/hyperswitch_interfaces/Cargo.toml", "crates/router/Cargo.toml"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json", "crates/common_enums/src/enums.rs", "crates/hyperswitch_interfaces/src/webhooks.rs", "crates/openapi/src/openapi.rs", "crates/openapi/src/openapi_v2.rs", "crates/router/src/routes.rs", "crates/router/src/routes/app.rs", "crates/router/src/routes/recovery_webhooks.rs", "v2_migrations/2025-01-17-042122_add_feature_metadata_in_payment_attempt/down.sql", "v2_migrations/2025-01-17-042122_add_feature_metadata_in_payment_attempt/up.sql"]}, "change_types": {"structs_added": 12, "functions_added": 29, "enums_added": 4, "fields_added": 144, "imports_added": 17, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor: add infra-values in intent kafka events
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
add infra-values in intent kafka events
### 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)?
-->
cluster populating in payment_intent kafka event
<img width="1327" alt="image" src="https://github.com/user-attachments/assets/f1a57f86-b657-4eec-a0e4-d2eee6d29e78" />
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Type Definitions**
- `crates/common_utils/src/types/keymanager.rs`
- `crates/router/src/types/domain/types.rs`
**2. Other**
- `crates/router/src/db/kafka_store.rs`
- `crates/router/src/services/kafka.rs`
- `crates/router/src/services/kafka/payment_intent.rs`
- ... and 1 more files
**Code Patterns Applied:**
- Implement new functions (4 changes)
- Extend existing types with new fields (7 changes)
**Detailed Identifier Changes:**
Commit 4a7c08fb:
Files to modify:
**crates/common_utils/src/types/keymanager.rs**
Modify existing code
**crates/router/src/db/kafka_store.rs**
Modify existing code
**crates/router/src/services/kafka.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/domain/types.rs**
Modify existing code
|
{"pr_number": 8264, "pr_title": "refactor: add infra-values in intent kafka events", "merged_at": "2025-06-05T13:46:55Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "user"]}, "hierarchy": {"types": ["crates/common_utils/src/types/keymanager.rs", "crates/router/src/types/domain/types.rs"], "other": ["crates/router/src/db/kafka_store.rs", "crates/router/src/services/kafka.rs", "crates/router/src/services/kafka/payment_intent.rs", "crates/router/src/services/kafka/payment_intent_event.rs"]}, "change_types": {"functions_added": 4, "fields_added": 7}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(core): fixed invalid merchant country code error object
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
## Description
<!-- Describe your changes in detail -->
1. Error type changed from `InternalServerError` to `InvalidRequestData`
2. The `attach_printable` method was removed
3. Instead, the error message is now included directly in the `InvalidRequestData` variant with a `message` field
## 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 business profile with both valid and invalid merchant_country_code
```shell
curl --location 'http://localhost:8080/account/sahkal11/business_profile' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_L6J6MmPC31oN9dnihHuS3996WUxL0u3lfXjsqAUc7Xx0QAJ3P9D4cyKR7hiCicfQ' \
--data '{
"profile_name": "dqwdwcweqcewcwdqwdxqwfqfqewcwqqd",
"merchant_country_code": "840"
}
'
```
Incorrect
```shell
curl --location 'http://localhost:8080/account/sahkal11/business_profile' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_L6J6MmPC31oN9dnihHuS3996WUxL0u3lfXjsqAUc7Xx0QAJ3P9D4cyKR7hiCicfQ' \
--data '{
"profile_name": "dqwdwcweqcewcwdqwdxqwfqfqewcwqqd",
"merchant_country_code": "841"
}
'
```
Response
```shell
{
"error": {
"type": "invalid_request",
"message": "Invalid merchant country code",
"code": "IR_06"
}
}
```
## 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
|
To implement this **connector_integration** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/admin.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (2 changes)
**Detailed Identifier Changes:**
Commit 20b37bdb:
Files to modify:
**crates/router/src/core/admin.rs**
Modify existing code
|
{"pr_number": 8665, "pr_title": "fix(core): fixed invalid merchant country code error object", "merged_at": "2025-07-24T09:08:53Z", "intent": {"feature_type": "connector_integration", "action": "add_feature", "entities": ["merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/admin.rs"]}, "change_types": {"fields_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
chore: Move async-bb8-diesel crate to crates.io version
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [x] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Changed `async-bb8-diesel crate from custom [fork](https://github.com/jarnura/async-bb8-diesel) to crates.io [version](https://github.com/oxidecomputer/async-bb8-diesel)
### 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).
-->
Closes #8026
## 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)?
-->
Ran clippy and tested multiple endpoints in the `router` binary
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Database Layer (Queries & Schema)**
- `crates/diesel_models/Cargo.toml`
**2. Configuration Files**
- `crates/drainer/Cargo.toml`
- `crates/router/Cargo.toml`
- `crates/storage_impl/Cargo.toml`
**3. Other**
- `Cargo.lock`
|
{"pr_number": 8028, "pr_title": "chore: Move async-bb8-diesel crate to crates.io version", "merged_at": "2025-05-15T12:05:55Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"database": ["crates/diesel_models/Cargo.toml"], "config": ["crates/drainer/Cargo.toml", "crates/router/Cargo.toml", "crates/storage_impl/Cargo.toml"], "other": ["Cargo.lock"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
feat(connector): [Worldpayxml] add card payment
## 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 -->
Implement card payment with Worldpay xml
Hotfix for https://github.com/juspay/hyperswitch/pull/8076
> Note: Status updation takes 5-10 mins at the connector
## 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)?
-->
<details>
<summary> 1. MCA create </summary>
```
curl --location 'http://localhost:8080/account/postman_merchant_GHAction_b90895b7-51ca-4824-9f06-834ddc53293c/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_RPa8nmiLG06tHc9W4v378FsyNnVwO7Ko2fBI7NmsJ1Cq4CXatdt3xqrMFIed9gbb' \
--data '{
"connector_type": "payment_processor",
"connector_name": "redsys",
"business_country": "US",
"business_label": "default",
"connector_account_details": {
"auth_type": "SignatureKey",
"api_key": "*******8",
"key1": "*******",
"api_secret": "****************"
},
"test_mode": false,
"disabled": false,
"payment_methods_enabled": [
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "credit",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "debit",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
],
"metadata": {
}
}'
```
Response
```json
{"connector_type":"payment_processor","connector_name":"redsys","connector_label":"redsys_US_default","merchant_connector_id":"mca_lTOks70dqG9F8f770IAt","profile_id":"pro_1OJnibg63SywyAechHCC","connector_account_details":{"auth_type":"SignatureKey","api_key":"33*****31","key1":"***","api_secret":"sq****************************J7"},"payment_methods_enabled":[{"payment_method":"pay_later","payment_method_types":[{"payment_method_type":"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":"pay_later","payment_method_types":[{"payment_method_type":"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":"pay_later","payment_method_types":[{"payment_method_type":"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":"pay_later","payment_method_types":[{"payment_method_type":"klarna","payment_experience":"invoke_sdk_client","card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true}]},{"payment_method":"bank_redirect","payment_method_types":[{"payment_method_type":"ideal","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":"bancontact_card","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":"przelewy24","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":"giropay","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":"sofort","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":"eps","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":"bank_debit","payment_method_types":[{"payment_method_type":"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_type":"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},{"payment_method_type":"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_type":"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":"bank_transfer","payment_method_types":[{"payment_method_type":"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_type":"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_type":"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":"card","payment_method_types":[{"payment_method_type":"credit","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":"card","payment_method_types":[{"payment_method_type":"debit","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":"wallet","payment_method_types":[{"payment_method_type":"apple_pay","payment_experience":"invoke_sdk_client","card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true}]},{"payment_method":"wallet","payment_method_types":[{"payment_method_type":"google_pay","payment_experience":"invoke_sdk_client","card_networks":null,"accepted_currencies":null,"accepted_countries":null,"minimum_amount":1,"maximum_amount":68607706,"recurring_enabled":true,"installment_payment_enabled":true}]}],"connector_webhook_details":null,"metadata":{"google_pay":{"merchant_info":{"merchant_name":"Narayan Bhat"},"allowed_payment_methods":[{"type":"CARD","parameters":{"allowed_auth_methods":["PAN_ONLY","CRYPTOGRAM_3DS"],"allowed_card_networks":["AMEX","DISCOVER","INTERAC","JCB","MASTERCARD","VISA"]},"tokenization_specification":{"type":"PAYMENT_GATEWAY","parameters":{"gateway":"example","gateway_merchant_id":"{{gateway_merchant_id}}"}}}]}},"test_mode":false,"disabled":false,"frm_configs":null,"business_country":"US","business_label":"default","business_sub_label":null,"applepay_verified_domains":null,"pm_auth_config":null,"status":"active","additional_merchant_data":null,"connector_wallets_details":null}
```
</details>
<details>
<summary>2. Automatic Card Payment</summary>
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_X1J2lFi1QS1vL4u11B4FMVtV4HakriV3Ow30FEgTQ4sMVieSpKKEt6vkEFwCQggW' \
--data '{
"amount": 100,
"currency": "EUR",
"confirm": true,
"description": "payments",
"authentication_type": "three_ds",
"payment_method": "card",
"payment_method_data": {
"card": {
"card_number": "4444333322221111",
"card_exp_month": "12",
"card_exp_year": "49",
"card_holder_name": "Akshaya",
"card_cvc": "123"
}
}
,"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
```json
{"payment_id":"pay_7uOikIjBhvjrYDXc36Cx","merchant_id":"postman_merchant_GHAction_2f406804-7af5-4850-abaa-4999b4fa3f14","status":"processing","amount":100,"net_amount":100,"shipping_cost":null,"amount_capturable":0,"amount_received":null,"connector":"worldpayxml","client_secret":"pay_7uOikIjBhvjrYDXc36Cx_secret_t0fuVie1nBw5hGl69WZe","created":"2025-05-20T06:21:18.104Z","currency":"EUR","customer_id":null,"customer":null,"description":"payments","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":null,"payment_method":"card","payment_method_data":{"card":{"last4":"1111","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"444433","card_extended_bin":null,"card_exp_month":"12","card_exp_year":"49","card_holder_name":"Akshaya","payment_checks":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":"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":null,"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":"pay_7uOikIjBhvjrYDXc36Cx_1","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_7uOikIjBhvjrYDXc36Cx_1","payment_link":null,"profile_id":"pro_3eQAt6KJcj2IkVeFHv4T","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_xBSM1IZ30g83XmJU3X3d","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-05-20T06:36:18.104Z","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":"2025-05-20T06:21:19.507Z","split_payments":null,"frm_metadata":null,"extended_authorization_applied":null,"capture_before":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null,"card_discovery":"manual","force_3ds_challenge":false,"force_3ds_challenge_trigger":false,"issuer_error_code":null,"issuer_error_message":null}
```
Psync
```
curl --location 'http://localhost:8080/payments/pay_7uOikIjBhvjrYDXc36Cx' \
--header 'Accept: application/json' \
--header 'api-key: dev_X1J2lFi1QS1vL4u11B4FMVtV4HakriV3Ow30FEgTQ4sMVieSpKKEt6vkEFwCQggW'
```
Response
```
{"payment_id":"pay_7uOikIjBhvjrYDXc36Cx","merchant_id":"postman_merchant_GHAction_2f406804-7af5-4850-abaa-4999b4fa3f14","status":"succeeded","amount":100,"net_amount":100,"shipping_cost":null,"amount_capturable":0,"amount_received":100,"connector":"worldpayxml","client_secret":"pay_7uOikIjBhvjrYDXc36Cx_secret_t0fuVie1nBw5hGl69WZe","created":"2025-05-20T06:21:18.104Z","currency":"EUR","customer_id":null,"customer":null,"description":"payments","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":null,"payment_method":"card","payment_method_data":{"card":{"last4":"1111","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"444433","card_extended_bin":null,"card_exp_month":"12","card_exp_year":"49","card_holder_name":"Akshaya","payment_checks":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":"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":null,"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":"pay_7uOikIjBhvjrYDXc36Cx_1","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_7uOikIjBhvjrYDXc36Cx_1","payment_link":null,"profile_id":"pro_3eQAt6KJcj2IkVeFHv4T","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_xBSM1IZ30g83XmJU3X3d","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-05-20T06:36:18.104Z","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":"2025-05-20T06:40:35.280Z","split_payments":null,"frm_metadata":null,"extended_authorization_applied":null,"capture_before":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null,"card_discovery":"manual","force_3ds_challenge":false,"force_3ds_challenge_trigger":false,"issuer_error_code":null,"issuer_error_message":null}
```
</details>
<details>
<summary>3. Manual Card Payment</summary>
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_X1J2lFi1QS1vL4u11B4FMVtV4HakriV3Ow30FEgTQ4sMVieSpKKEt6vkEFwCQggW' \
--data '{
"amount": 100,
"currency": "EUR",
"confirm": true,
"capture_method": "manual",
"description": "payments",
"payment_method": "card",
"payment_method_data": {
"card": {
"card_number": "4444333322221111",
"card_exp_month": "12",
"card_exp_year": "49",
"card_holder_name": "Akshaya",
"card_cvc": "123"
}
}
,"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_G9SuNUoZacHL0xaGxdi0","merchant_id":"postman_merchant_GHAction_2f406804-7af5-4850-abaa-4999b4fa3f14","status":"requires_capture","amount":100,"net_amount":100,"shipping_cost":null,"amount_capturable":100,"amount_received":null,"connector":"worldpayxml","client_secret":"pay_G9SuNUoZacHL0xaGxdi0_secret_ujj7y0xYJOiYkGazvGq1","created":"2025-05-20T09:00:55.987Z","currency":"EUR","customer_id":null,"customer":null,"description":"payments","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"manual","payment_method":"card","payment_method_data":{"card":{"last4":"1111","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"444433","card_extended_bin":null,"card_exp_month":"12","card_exp_year":"49","card_holder_name":"Akshaya","payment_checks":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":"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":null,"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":"pay_G9SuNUoZacHL0xaGxdi0_1","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_G9SuNUoZacHL0xaGxdi0_1","payment_link":null,"profile_id":"pro_3eQAt6KJcj2IkVeFHv4T","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_xBSM1IZ30g83XmJU3X3d","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-05-20T09:15:55.987Z","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":"2025-05-20T09:00:56.695Z","split_payments":null,"frm_metadata":null,"extended_authorization_applied":null,"capture_before":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null,"card_discovery":"manual","force_3ds_challenge":false,"force_3ds_challenge_trigger":false,"issuer_error_code":null,"issuer_error_message":null}
```
Capture call
```
curl --location 'http://localhost:8080/payments/pay_G9SuNUoZacHL0xaGxdi0/capture' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_X1J2lFi1QS1vL4u11B4FMVtV4HakriV3Ow30FEgTQ4sMVieSpKKEt6vkEFwCQggW' \
--data '{
"amount_to_capture": 10,
"statement_descriptor_name": "Joseph",
"statement_descriptor_suffix": "JS"
}'
```
Response
```json
{"payment_id":"pay_G9SuNUoZacHL0xaGxdi0","merchant_id":"postman_merchant_GHAction_2f406804-7af5-4850-abaa-4999b4fa3f14","status":"processing","amount":100,"net_amount":100,"shipping_cost":null,"amount_capturable":100,"amount_received":null,"connector":"worldpayxml","client_secret":"pay_G9SuNUoZacHL0xaGxdi0_secret_ujj7y0xYJOiYkGazvGq1","created":"2025-05-20T09:00:55.987Z","currency":"EUR","customer_id":null,"customer":null,"description":"payments","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"manual","payment_method":"card","payment_method_data":{"card":{"last4":"1111","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"444433","card_extended_bin":null,"card_exp_month":"12","card_exp_year":"49","card_holder_name":"Akshaya","payment_checks":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":"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":null,"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":"pay_G9SuNUoZacHL0xaGxdi0_1","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_G9SuNUoZacHL0xaGxdi0_1","payment_link":null,"profile_id":"pro_3eQAt6KJcj2IkVeFHv4T","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_xBSM1IZ30g83XmJU3X3d","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-05-20T09:15:55.987Z","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":"2025-05-20T09:02:48.712Z","split_payments":null,"frm_metadata":null,"extended_authorization_applied":null,"capture_before":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null,"card_discovery":"manual","force_3ds_challenge":false,"force_3ds_challenge_trigger":false,"issuer_error_code":null,"issuer_error_message":null}
```
Psync call
```
curl --location 'http://localhost:8080/payments/pay_G9SuNUoZacHL0xaGxdi0?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_X1J2lFi1QS1vL4u11B4FMVtV4HakriV3Ow30FEgTQ4sMVieSpKKEt6vkEFwCQggW'
```
Response
```
{"payment_id":"pay_G9SuNUoZacHL0xaGxdi0","merchant_id":"postman_merchant_GHAction_2f406804-7af5-4850-abaa-4999b4fa3f14","status":"partially_captured","amount":100,"net_amount":100,"shipping_cost":null,"amount_capturable":0,"amount_received":10,"connector":"worldpayxml","client_secret":"pay_G9SuNUoZacHL0xaGxdi0_secret_ujj7y0xYJOiYkGazvGq1","created":"2025-05-20T09:00:55.987Z","currency":"EUR","customer_id":null,"customer":null,"description":"payments","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"manual","payment_method":"card","payment_method_data":{"card":{"last4":"1111","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"444433","card_extended_bin":null,"card_exp_month":"12","card_exp_year":"49","card_holder_name":"Akshaya","payment_checks":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":"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":null,"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":"pay_G9SuNUoZacHL0xaGxdi0_1","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_G9SuNUoZacHL0xaGxdi0_1","payment_link":null,"profile_id":"pro_3eQAt6KJcj2IkVeFHv4T","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_xBSM1IZ30g83XmJU3X3d","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-05-20T09:15:55.987Z","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":"2025-05-20T09:05:56.777Z","split_payments":null,"frm_metadata":null,"extended_authorization_applied":null,"capture_before":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null,"card_discovery":"manual","force_3ds_challenge":false,"force_3ds_challenge_trigger":false,"issuer_error_code":null,"issuer_error_message":null}
```
</details>
<details>
<summary> 4. Refund </summary>
```
curl --location 'http://localhost:8080/refunds' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_X1J2lFi1QS1vL4u11B4FMVtV4HakriV3Ow30FEgTQ4sMVieSpKKEt6vkEFwCQggW' \
--data '{
"payment_id": "pay_OKYmLEJQY1O7DkDBO8Ax",
"amount": 10,
"reason": "Customer returned product",
"refund_type": "instant",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}
}'
```
Response
```
{"refund_id":"ref_oNkvIu2PWfKi2RfoVrBn","payment_id":"pay_OKYmLEJQY1O7DkDBO8Ax","amount":10,"currency":"EUR","status":"pending","reason":"Customer returned product","metadata":{"udf1":"value1","new_customer":"true","login_date":"2019-09-10T10:11:12Z"},"error_message":null,"error_code":null,"unified_code":null,"unified_message":null,"created_at":"2025-05-20T11:15:05.175Z","updated_at":"2025-05-20T11:15:05.402Z","connector":"worldpayxml","profile_id":"pro_3eQAt6KJcj2IkVeFHv4T","merchant_connector_id":"mca_xBSM1IZ30g83XmJU3X3d","split_refunds":{"stripe_split_refund":{"revert_platform_fee":true,"revert_transfer":true}},"issuer_error_code":null,"issuer_error_message":null}
```
Rsync
```
{"refund_id":"ref_oNkvIu2PWfKi2RfoVrBn","payment_id":"pay_OKYmLEJQY1O7DkDBO8Ax","amount":10,"currency":"EUR","status":"pending","reason":"Customer returned product","metadata":{"udf1":"value1","new_customer":"true","login_date":"2019-09-10T10:11:12Z"},"error_message":null,"error_code":null,"unified_code":null,"unified_message":null,"created_at":"2025-05-20T11:15:05.175Z","updated_at":"2025-05-20T11:21:35.656Z","connector":"worldpayxml","profile_id":"pro_3eQAt6KJcj2IkVeFHv4T","merchant_connector_id":"mca_xBSM1IZ30g83XmJU3X3d","split_refunds":{"stripe_split_refund":{"revert_platform_fee":true,"revert_transfer":true}},"issuer_error_code":null,"issuer_error_message":null}
```
</details>
<details>
<summary> Void </summary>
```
curl --location 'http://localhost:8080/payments/pay_P5IkFoEExowU6Nqf74k8/cancel' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_N2utjEdSs1p0PtPwRVYQp3Jnwdfj4HHlma1XQpcjIMysYca57WiMOHSM1H4bJD58' \
--data '{"cancellation_reason":"requested_by_customer"}'
```
Response
```
{"payment_id":"pay_P5IkFoEExowU6Nqf74k8","merchant_id":"postman_merchant_GHAction_2c820b48-09b9-4035-a144-662641c32be8","status":"processing","amount":5000,"net_amount":5000,"shipping_cost":null,"amount_capturable":0,"amount_received":null,"connector":"worldpayxml","client_secret":"pay_P5IkFoEExowU6Nqf74k8_secret_2bMWCYQGeVhcAJjKYXke","created":"2025-05-22T08:23:01.758Z","currency":"USD","customer_id":null,"customer":{"id":null,"name":null,"email":"hyperswitch_sdk_demo_id@gmail.com","phone":null,"phone_country_code":null},"description":"Test Payment","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"manual","payment_method":"card","payment_method_data":{"card":{"last4":"1111","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"444433","card_extended_bin":null,"card_exp_month":"01","card_exp_year":"27","card_holder_name":"AUTHORISED","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"New York","country":"US","line1":"123 Main Street Apt 4B","line2":"123 Main Street Apt 4B","line3":"123 Main Street Apt 4B","zip":"10001","state":"New York","first_name":"john","last_name":"doe"},"phone":null,"email":null},"order_details":null,"email":null,"name":null,"phone":null,"return_url":"https://example.com/","authentication_type":"no_three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":"requested_by_customer","error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":null,"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":"pay_P5IkFoEExowU6Nqf74k8_1","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_P5IkFoEExowU6Nqf74k8_1","payment_link":null,"profile_id":"pro_3qdXNDn2bZxbrHClQBwa","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_IhXe2U3f7XmrYnxk0NKk","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-05-22T08:38:01.758Z","fingerprint":null,"browser_info":{"language":"en-US","time_zone":-330,"ip_address":"127.0.0.1","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","color_depth":32,"java_enabled":true,"screen_width":1728,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":1117,"java_script_enabled":true},"payment_method_id":null,"payment_method_status":null,"updated":"2025-05-22T08:23:09.965Z","split_payments":null,"frm_metadata":null,"extended_authorization_applied":null,"capture_before":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null,"card_discovery":"manual","force_3ds_challenge":false,"force_3ds_challenge_trigger":false,"issuer_error_code":null,"issuer_error_message":null}
```
Psync
```
curl --location 'http://localhost:8080/payments/pay_P5IkFoEExowU6Nqf74k8?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_N2utjEdSs1p0PtPwRVYQp3Jnwdfj4HHlma1XQpcjIMysYca57WiMOHSM1H4bJD58'
```
Response
```
{"payment_id":"pay_P5IkFoEExowU6Nqf74k8","merchant_id":"postman_merchant_GHAction_2c820b48-09b9-4035-a144-662641c32be8","status":"cancelled","amount":5000,"net_amount":5000,"shipping_cost":null,"amount_capturable":0,"amount_received":null,"connector":"worldpayxml","client_secret":"pay_P5IkFoEExowU6Nqf74k8_secret_2bMWCYQGeVhcAJjKYXke","created":"2025-05-22T08:23:01.758Z","currency":"USD","customer_id":null,"customer":{"id":null,"name":null,"email":"hyperswitch_sdk_demo_id@gmail.com","phone":null,"phone_country_code":null},"description":"Test Payment","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"manual","payment_method":"card","payment_method_data":{"card":{"last4":"1111","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"444433","card_extended_bin":null,"card_exp_month":"01","card_exp_year":"27","card_holder_name":"AUTHORISED","payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"New York","country":"US","line1":"123 Main Street Apt 4B","line2":"123 Main Street Apt 4B","line3":"123 Main Street Apt 4B","zip":"10001","state":"New York","first_name":"john","last_name":"doe"},"phone":null,"email":null},"order_details":null,"email":null,"name":null,"phone":null,"return_url":"https://example.com/","authentication_type":"no_three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":"requested_by_customer","error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":null,"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":"pay_P5IkFoEExowU6Nqf74k8_1","frm_message":null,"metadata":null,"connector_metadata":null,"feature_metadata":null,"reference_id":"pay_P5IkFoEExowU6Nqf74k8_1","payment_link":null,"profile_id":"pro_3qdXNDn2bZxbrHClQBwa","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_IhXe2U3f7XmrYnxk0NKk","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-05-22T08:38:01.758Z","fingerprint":null,"browser_info":{"language":"en-US","time_zone":-330,"ip_address":"127.0.0.1","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","color_depth":32,"java_enabled":true,"screen_width":1728,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":1117,"java_script_enabled":true},"payment_method_id":null,"payment_method_status":null,"updated":"2025-05-22T08:46:18.210Z","split_payments":null,"frm_metadata":null,"extended_authorization_applied":null,"capture_before":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null,"card_discovery":"manual","force_3ds_challenge":false,"force_3ds_challenge_trigger":false,"issuer_error_code":null,"issuer_error_message":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`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
|
To implement this **payment** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/admin.rs`
**2. External Connector Integration**
- `crates/common_enums/src/connector_enums.rs`
- `crates/connector_configs/src/connector.rs`
- `crates/connector_configs/toml/development.toml`
- ... and 5 more files
**3. Type Definitions**
- `crates/router/src/types/api.rs`
- `crates/router/src/types/transformers.rs`
**4. Tests**
- `config/deployments/integration_test.toml`
**5. Configuration Files**
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- `config/development.toml`
- ... and 1 more files
**Code Patterns Applied:**
- Define new data structures (30 changes)
- Implement new functions (30 changes)
- Extend existing types with new fields (354 changes)
- Add conditional logic for feature flags or filtering (14 changes)
**Detailed Identifier Changes:**
Commit 4ba65eb9:
Files to modify:
**crates/common_enums/src/connector_enums.rs**
Modify existing code
**crates/connector_configs/src/connector.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/worldpayxml.rs**
Remove:
- impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Worldpayxml
- impl: impl ConnectorSpecifications for Worldpayxml
Add:
- function: private::validate_mandate_payment
- function: private::build_request
- function: private::get_request_body
- function: private::get_headers
- function: private::get_url
- 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_connector_about
- function: private::get_supported_payment_methods
- function: private::get_supported_webhook_flows
- impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Worldpayxml
- impl: impl ConnectorSpecifications for Worldpayxml
**crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs**
Remove:
- struct: pub::WorldpayxmlPaymentsRequest
- enum: private::RefundStatus
Add:
- function: private::try_from
- function: private::try_from
- function: private::try_from
- function: private::try_from
- function: private::try_from
- struct: pub::PaymentService
- struct: private::Modify
- struct: private::OrderModification
- struct: private::RefundRequest
- struct: private::CancelRequest
- struct: private::CaptureRequest
- struct: private::Inquiry
- struct: private::OrderInquiry
- struct: private::Submit
- struct: pub::Reply
- struct: private::OkResponse
- struct: private::ModifyRequestReceived
- struct: pub::WorldpayXmlErrorResponse
- struct: private::OrderStatus
- struct: private::Payment
- struct: private::ReturnCode
- struct: private::ResultCode
- struct: private::Balance
- struct: private::PaymentMethodDetail
- struct: private::CardResponse
- struct: private::AuthorisationId
- struct: private::SchemeResponse
- struct: private::Order
- struct: private::PaymentDetails
- struct: private::CardSSL
- struct: private::Date
- enum: private::LastEvent
- enum: private::AutoCapture
- impl: impl TryFrom<&Card> for PaymentDetails
- impl: impl TryFrom<(&WorldpayxmlRouterData<&PaymentsAuthorizeRouterData>, &Card)> for PaymentService
- impl: impl TryFrom<&WorldpayxmlRouterData<&PaymentsCaptureRouterData>> for PaymentService
- impl: impl TryFrom<&PaymentsCancelRouterData> for PaymentService
- impl: impl TryFrom<&WorldpayxmlRouterData<&RefundsRouterData<F>>> for PaymentService
- mod: pub::worldpayxml_constants
**crates/hyperswitch_connectors/src/utils.rs**
Add:
- function: pub::serialize_to_xml_bytes
- struct: pub::XmlSerializer
- impl: impl XmlSerializer
**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
|
{"pr_number": 8139, "pr_title": "feat(connector): [Worldpayxml] add card payment", "merged_at": "2025-05-26T11:52:53Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/admin.rs"], "connectors": ["crates/common_enums/src/connector_enums.rs", "crates/connector_configs/src/connector.rs", "crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml", "crates/hyperswitch_connectors/src/connectors/worldpayxml.rs", "crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs", "crates/hyperswitch_connectors/src/utils.rs"], "types": ["crates/router/src/types/api.rs", "crates/router/src/types/transformers.rs"], "tests": ["config/deployments/integration_test.toml"], "config": ["config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml"]}, "change_types": {"structs_added": 30, "functions_added": 30, "enums_added": 2, "fields_added": 354, "imports_added": 6, "conditionals_added": 14}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(users): custom role at profile read
## 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 adds the functionality to read custom role at profile level
### Additional Changes
- [x] This PR modifies the API contract
- [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`
-->
## 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).
-->
Closes #6488
## 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 custom role at profile-level
Request
```
curl --location 'http://localhost:9000/api/user/role' \
--header 'authorization: Bearer JWT' \
--data '{
"role_scope": "merchant",
"groups": [
"operations_manage",
"connectors_view"
],
"role_name": "profile-level-custom-role",
"entity_type":"profile"
}'
```
Response
```
{
"error": {
"type": "invalid_request",
"message": "User Role Operation Not Supported",
"code": "UR_23"
}
}
```
2. Older flows should work as before . Changes for create profile custom roles will be in consecutive pr
3. Validate custom role
If a role with the same name is created either below me or in my lineage , then i wouldn't be able to create the role with that same name
Request
```
curl 'http://localhost:9000/api/user/role' \
-H 'Accept: */*' \
-H 'authorization: Bearer JWT' \
--data-raw '{"role_scope":"merchant","groups":["operations_view","operations_manage"],"role_name":"m2-org"}'
```
Response
```
{
"error": {
"type": "invalid_request",
"message": "Role name already exists",
"code": "UR_35"
}
}
```
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/user_role/role.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/query/role.rs`
- `crates/diesel_models/src/role.rs`
- `crates/diesel_models/src/schema.rs`
- ... and 1 more files
**3. Core Business Logic**
- `crates/router/src/core/user.rs`
- `crates/router/src/core/user_role.rs`
- `crates/router/src/core/user_role/role.rs`
**4. Utils**
- `crates/router/src/utils/user_role.rs`
**5. Other**
- `crates/common_enums/src/enums.rs`
- `crates/router/src/db/kafka_store.rs`
- `crates/router/src/db/role.rs`
- ... and 7 more files
**Code Patterns Applied:**
- Implement new functions (9 changes)
- Extend existing types with new fields (44 changes)
- Add conditional logic for feature flags or filtering (8 changes)
- Modify database queries (41 changes)
**Detailed Identifier Changes:**
Commit 1a197e7f:
Files to modify:
**crates/api_models/src/user_role/role.rs**
Modify existing code
**crates/common_enums/src/enums.rs**
Add:
- function: private::from
**crates/diesel_models/src/query/role.rs**
Remove:
- function: pub::list_roles
Add:
- function: pub::generic_list_roles_by_entity_type
**crates/diesel_models/src/role.rs**
Add:
- enum: pub::ListRolesByEntityPayload
**crates/diesel_models/src/schema.rs**
Modify existing code
**crates/diesel_models/src/schema_v2.rs**
Modify existing code
**crates/router/src/core/user.rs**
Modify existing code
**crates/router/src/core/user_role.rs**
Modify existing code
**crates/router/src/core/user_role/role.rs**
Modify existing code
**crates/router/src/db/kafka_store.rs**
Remove:
- function: private::list_all_roles
Add:
- function: private::generic_list_roles_by_entity_type
**crates/router/src/db/role.rs**
Modify existing code
**crates/router/src/services/authorization/roles.rs**
Modify existing code
**crates/router/src/utils/user_role.rs**
Modify existing code
Commit 899c207d:
Files to modify:
**crates/api_models/src/user_role/role.rs**
Modify existing code
**crates/common_enums/src/enums.rs**
Add:
- function: private::from
**crates/diesel_models/src/query/role.rs**
Remove:
- function: pub::list_roles
Add:
- function: pub::generic_list_roles_by_entity_type
**crates/diesel_models/src/role.rs**
Add:
- enum: pub::ListRolesByEntityPayload
**crates/diesel_models/src/schema.rs**
Modify existing code
**crates/diesel_models/src/schema_v2.rs**
Modify existing code
**crates/router/src/core/user.rs**
Modify existing code
**crates/router/src/core/user_role.rs**
Modify existing code
**crates/router/src/core/user_role/role.rs**
Modify existing code
**crates/router/src/db/kafka_store.rs**
Remove:
- function: private::list_all_roles
Add:
- function: private::generic_list_roles_by_entity_type
**crates/router/src/db/role.rs**
Modify existing code
**crates/router/src/services/authorization/roles.rs**
Modify existing code
**crates/router/src/utils/user_role.rs**
Modify existing code
|
{"pr_number": 6875, "pr_title": "feat(users): custom role at profile read", "merged_at": "2025-02-05T14:28:03Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["merchant", "user", "connector"]}, "hierarchy": {"api_models": ["crates/api_models/src/user_role/role.rs"], "database": ["crates/diesel_models/src/query/role.rs", "crates/diesel_models/src/role.rs", "crates/diesel_models/src/schema.rs", "crates/diesel_models/src/schema_v2.rs"], "core_business": ["crates/router/src/core/user.rs", "crates/router/src/core/user_role.rs", "crates/router/src/core/user_role/role.rs"], "utils": ["crates/router/src/utils/user_role.rs"], "other": ["crates/common_enums/src/enums.rs", "crates/router/src/db/kafka_store.rs", "crates/router/src/db/role.rs", "crates/router/src/services/authorization/roles.rs", "migrations/2024-10-17-073555_add-profile-id-to-roles/down.sql", "migrations/2024-10-17-073555_add-profile-id-to-roles/up.sql", "migrations/2024-10-17-123943_add-profile-enum-in-role-scope/down.sql", "migrations/2024-10-17-123943_add-profile-enum-in-role-scope/up.sql", "migrations/2024-12-18-061400_change-roles-index/down.sql", "migrations/2024-12-18-061400_change-roles-index/up.sql"]}, "change_types": {"functions_added": 9, "enums_added": 1, "fields_added": 44, "imports_added": 6, "conditionals_added": 8, "database_queries": 41}, "has_identifier_data": true, "commits_matched": 2, "match_method": "pr_number"}
|
feat(core): Add visa click to pay support
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] New feature
## Description
<!-- Describe your changes in detail -->
Add visa click to pay support
### Additional Changes
- [x] This PR modifies the API contract
Adds `encypted_payload` field to `ctp_service_details` and makes `provider` as a required type enum from optional string in service_details struct
## 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)?
-->
Add config to make the merchant eligible for authentication service
```shell
curl --location 'http://localhost:8080/configs/' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data '{
"key": "merchants_eligible_for_authentication_service",
"value": "[\"sahkal\", \"cewqcewc\", \"dqwdwljildwduoqwhduwqcqwjd\"]"
}'
```
Create merchant connector account for Ctp_visa
```shell
{
"connector_type": "authentication_processor",
"connector_name": "ctp_visa",
"connector_account_details": {
"auth_type": "NoKey"
}
}
'
```
Adyen
```shell
curl --location 'http://localhost:8080/account/dqwdwljildwduoqwhduwqcqwjd/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data '
{
"connector_type": "payment_processor",
"connector_name": "adyen",
"connector_account_details": {
"auth_type": "SignatureKey",
"api_key": "API-KEY",
"key1": "KEY-1",
"api_secret": "API-SECRET"
},
"test_mode": true,
"disabled": false,
"payment_methods_enabled": [
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "credit",
"card_networks": [
"Visa",
"Mastercard"
],
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "debit",
"card_networks": [
"Visa",
"Mastercard"
],
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
}
],
"metadata": {
"city": "NY",
"unit": "245",
"live_endpoint_prefix": "vsfbjh"
},
"connector_webhook_details": {
"merchant_secret": "MERCHANT SECRET"
},
"business_country": "US",
"business_label": "default"
}
'
```
update business profile with ctp_visa mca_id
```shell
curl --location 'http://localhost:8080/account/dqwdwljildwduoqwhduwqcqwjd/business_profile/pro_KCTRv8sFQfC0r65CZxrn' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data '{
"is_click_to_pay_enabled": true,
"authentication_product_ids": {"click_to_pay": "mca_XAXUpel8ABbpoGNF8lGz"}
}'
```
do payments create
```shell
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_fQsdc9JbERQ7CWvmguo84XDROuXOD1oK9sdfCJXOko3SossoI4zdxpJkOIPmojwn' \
--data '{
"amount": 1130,
"currency": "USD",
"confirm": false,
"return_url": "https://hyperswitch.io"
}
'
```
do payments confirm
```shell
curl --location 'http://localhost:8080/payments/pay_Ft9Ke5Lun924OCJa7yll/confirm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: pk_dev_1f712ac5fd7f4d8c91da6a627862a4f0' \
--data '
{
"payment_method": "card",
"payment_method_type": "debit",
"client_secret": "pay_Ft9Ke5Lun924OCJa7yll_secret_po1FVW5adQWFolWJUhMb",
"ctp_service_details" : {
"encypted_payload": "eyJraWQiOiJMS1hNMExOOFE2UjdMV1YxOVUwVzEzc01pYjRvNTlRRXBKelpMeVloaXZ5cmNMRWprIiwiYWxnIjoiUlMyNTYiLCJqdGkiOiJNV0V6WWpWalltRXROR0pqWlMwME56ZzFMV0ppWVdFdE56WTJZamxtWlRWa1pXRXciLCJpYXQiOjE3MzYxNDczMTF9.eyJzcmNpVHJhbnNhY3Rpb25JZCI6IjcxZjFhYjQ3LWUzZDMtYzVhNC1lOTAyLTE3OWMyYzc1ZTgwMiIsImFzc3VyYW5jZURhdGEiOnsidmVyaWZpY2F0aW9uRGF0YSI6W3sibWV0aG9kUmVzdWx0cyI6eyJ0cmFuc1N0YXR1cyI6IlkiLCJkc1RyYW5zSWQiOiI4ZGUxMzQyMy1kZTM1LTQ3ZDYtODZhZC1hZmI5OWViZTE5YmMiLCJhY3NUcmFuc0lkIjoiZGMyMGMxYmUtYWM5OC00ZDc5LTg3NjItMDA2YTEwYjllNjYwIn19XSwiZWNpIjoiMDUifSwiZW5jcnlwdGVkUGF5bG9hZCI6ImV5SnJhV1FpT2lJeE1UZ3dNVE13T1RJNE1qUXlNak13T1RJNE5ueEZUVUZKVEVGRVJGSkZVMU05WVd0aGMyZ3VhMkZ0WW14bFFHcDFjM0JoZVM1cGJpd2dUMVU5U2xWVFVFRlpMQ0JQUFVwVlUxQkJXU3dnVEQxQ1FVNUhRVXhQVWtVc0lGTlVQVXRCVWs1QlZFRkxRU3dnUXoxSlRpSXNJblI1Y0NJNklrcFBVMFVpTENKbGJtTWlPaUpCTWpVMlIwTk5JaXdpWVd4bklqb2lVbE5CTFU5QlJWQXRNalUySW4wLlc4U2p6ZUNVd3MyYjRyWHlVbXRheEhsTGMwWlZhLTRJQjNCQURIVTBBNGI1STVjVGs0ckhHcFBpXzExb3d4Uk5aN0doVi1rRjRiMmtGcUlJRmM2TWRaR0ZmODlfTERoOFE2TXB6amlNbDJfbHFxUXI4bkJReUNzaGNXaE1Vd0cwekJNMGU4Smp6YmFhc0p0cEJkTlJ4TDhrU2ljZzVpRzcteHQxWVltMnNGQ0FhaVFscXU2MGtjRzdJOV9iQUJ6MFVsN3NhZVFIRDVlb0pybFM5eFlJOW1KYml0MmxoeWdUYjFpNDJ5bFY3NzBZR2libE9QMWI1WnRReUdDdVVWcTdlY21HOHRUdjhtd3ZfVGZ3Q291NFdzUVI3bElVWnZFTkpENUQzSnpZZE5odlIta2lGcWtWS3YwaGVDNlhzSTNtVFY5OEtCUXl6d3ZHLVducGpOaGFQUS44QzlLWDBadDRQZ0F3SDdNLnZLbHNjTFRtMXhGN09sOTJhUjU1OGpRcG4wN01aaWd2RE00b2dySUlFUmZIMDFrcFB1cHBRM2NQR1EycWpNYVlsZjJaYVJLVktBS0ZXVkQ1SjRJOFBKRzBqZkZwT0hhQTV0QlFjd0pqLW53WlhLZlRaNTY3Z0dUQTl6QTdXNTRiTDVPWTVmUzExY3lpdmJfU0N0RElZdGNYMy1ZWHc3RjlfUHM1RHVYUWV6eFFoMjNhRTZBQjhjVDJMYWlDbzAxMDBTVkNVUTlCZU04cG9GcVpTVDRta1ZJNHJOdE1remRsMDJuVzl0d3J2QUQyVklESWlSX1Zvdk5WUG0xOU5VQ1Z2b0x6U01ZUkR2YWVLZEMxX2cxVC12anJZZzZkamtGTXVkUGZjUUZuQnlMcng1eDMtM05nMzVtWEN4NGFBYThqQ2U2VEFkWHUxTzhoTm1BbzMzbUxTdk1BYXdWeG5iQ2ZuamhpQWY1MGd3cVdyY2hPQ1oyMmp6NVRwbERCZGFzLWdzeEJaY1dYZWZaS0ViS2lsdVhBd3U1NHV2eHhBdnFIZFlnS3QyWFhyejRfQVRoZHgxWmdPVkpXLXRWNG1SVThYUHhNNnJ5Z2VoUkZ1Um9sZy1OeVo2TXlqVlpBYi0tT2J6ZlBOdHhySUhtSzlRTjdxUWdaQ0IwQXFIbHR4MzRhXzA4YmljVkpYOWhaWGYtTDNiVWp3dHVOc1FBWmpGV1VTLVoteGJRamU0cmpVdmo2Z1VWcmdBcnpiZ0FSb0NGZlo2SG5UWGdIS25RaWE4ZDJ5VGZoSTlhVnYxak5hNlp6eG8zZ1BobllhQ1NoNWJrajZ5VGVwREJFZXdPTEE4MFdsakNVMzFuMVgxNm5YZG5QakxhV3o5S3o2UjdvU0ZZekRPYnlxZXI1MDVfenY0cWt4SVplck10c0J1bWc3N2k5ejFtTVM3QU12MS1UMHhWeGp0MVVyNXpjcHdmNDJkN25nanY2UC1Mb2VOTFZXUlNrZUVFTEF0Q2Z0QUNuRkdvZEVlYU9HTHBhWGdlSWNPQTNPN0hfLUEwcGV5SVZheWZ2SV82M050VDhZTnVKSWhFeFJXblkxX19kUFlUUV85TnhiMU9yaG0tTDliR1R0d0F2S1h1aEVvYjNjeVJ1NDVERzVJVUJQdk5OVkRRZkJPNGJuRklFUmV4ODVBXzdwa0M2aUwxeHRVUUloeVJSSlpLdnFUWllHVUlMWnRBZFNkaU1ZUWJDTkdEQ1hzRUljZ2lwLUJscXYxX3ctQk1DNzFTQVl3S2RYVTFfVFpGQlkxOGpROXNFS0ZWd3F3WGNVa1V4M3BGeWY4d2txUEFVelhTdzV0V0tEcnhDWXZZTXpYWFpQZmtOYkhEd3kyWnhwcVdqb0g4bjJJVldWZE5laHB0V3g3cjJweVFjNXYzbl9KWU5DU0xfbk1LUlBtZmNmLWZqMGhaOTF4bm5VZXdVaWxiaVRiMkF4aXJGSjlwcDhYdlNKcE9mTmphWlRLdmJvQjRfVHpEblRzdDZwcnFIVnJNX2lOZVVxZlp1Tm1GWlFHZUk2VDZSc3ZObmhyaWlMWHhZUm5SVHFGTFhjeUJEU08zOE1vaE84akdiYWpzdXdPLXNNNGxlV0Euc2hNMENPWVU3cDRaZ29BU0ludlN2USIsIm1hc2tlZENhcmQiOnsic3JjRGlnaXRhbENhcmRJZCI6ImE0MDYxOWFlYjVkNjdlMDhkOTMyMTNmYzIyZmU1YTAyIiwiZGF0ZU9mQ2FyZENyZWF0ZWQiOiIxOTcwLTAxLTAxVDAwOjAwOjAwLjQ0NloiLCJkYXRlT2ZDYXJkTGFzdFVzZWQiOiIxOTcwLTAxLTAxVDAwOjAwOjAwLjE5M1oiLCJkaWdpdGFsQ2FyZERhdGEiOnsic3RhdHVzIjoiQUNUSVZFIiwicHJlc2VudGF0aW9uTmFtZSI6IkFiaGlzaGVrIENob3JvdGl5YSIsImRlc2NyaXB0b3JOYW1lIjoiT0JOIiwiYXJ0VXJpIjoiaHR0cHM6Ly9zYW5kYm94LmFzc2V0cy52aW1zLnZpc2EuY29tL3ZpbXMvY2FyZGFydC81YWYzNzM0Y2NhNGU0MzllOTdmMDBlNDQ3NGQ4MjQ0N19pbWFnZUFAMngucG5nIiwiYXJ0SGVpZ2h0IjoiMjEwIiwiYXJ0V2lkdGgiOiIzMzQifSwibWFza2VkQmlsbGluZ0FkZHJlc3MiOnsiYWRkcmVzc0lkIjoiOGZkZGZhYWUtZTBkYS03ZDA0LWEyNmYtMTAzMjc2NjQxODAyIiwibGluZTEiOiI2NzMqKioqKiIsImNpdHkiOiIqKioqKiIsInN0YXRlIjoiQ0EiLCJ6aXAiOiIqKioqKiIsImNvdW50cnlDb2RlIjoiVVMifSwicGFuQmluIjoiNDM5NTg0IiwicGFuRXhwaXJhdGlvbk1vbnRoIjoiMTIiLCJwYW5FeHBpcmF0aW9uWWVhciI6IjIwMjUiLCJwYW5MYXN0Rm91ciI6IjAxMTAiLCJwYXltZW50QWNjb3VudFJlZmVyZW5jZSI6IlYwMDEwMDEzMDI0MzI0NTgyNjYwNDkyOTg5OTg2IiwicGF5bWVudENhcmRUeXBlIjoiREVCSVQiLCJ0b2tlbkJpblJhbmdlIjoiNDkwNjI0Njg2IiwidG9rZW5MYXN0Rm91ciI6IjM2NjYifSwibWFza2VkQ29uc3VtZXIiOnsiY291bnRyeUNvZGUiOiJVUyIsIm1hc2tlZENvbnN1bWVySWRlbnRpdHkiOnsiaWRlbnRpdHlUeXBlIjoiRU1BSUxfQUREUkVTUyIsIm1hc2tlZElkZW50aXR5VmFsdWUiOiJhYmgqKkBqdXNwYXkuaW4ifSwibWFza2VkRW1haWxBZGRyZXNzIjoiYWJoKipAanVzcGF5LmluIiwibWFza2VkRmlyc3ROYW1lIjoiQSoqKioqIiwibWFza2VkTGFzdE5hbWUiOiJDKioqKioiLCJtYXNrZWRGdWxsTmFtZSI6IkEqKioqKiBDKioqKioiLCJtYXNrZWRNb2JpbGVOdW1iZXIiOnsiY291bnRyeUNvZGUiOiI5MSIsInBob25lTnVtYmVyIjoiKioqKioqKioyMzY4In0sInNyY0NvbnN1bWVySWQiOiJBVnpuSW5Bb2pLUlgyVitQaVVXS09QeE5iQ3YxNkRDMWQyMlI3UGw0azMwPSIsInN0YXR1cyI6IkFDVElWRSJ9fQ.TDZGI-XbBO3DNkKUu5JIxPcjyqawSeOZWxzcI4K60dKnP-4tf4R1NDVYBkNXqgEuu22edE0Uv55CqqRh5TzqY9iSMrQFJz7ErQ7TVDEa8g3o9UfWvHy4L7Ips36taZR5XaMecaHS9dRH71lGI71Z2-m53AJ_Tcu8QXJaU5roFaKx130pM7NEjnG8wod1xjeL9STm96KfEyRf2Xk0a1SY4oVXIYol2WmTt9ZJhUbpmctZ5u-fxkpH1_-4Plx5g4tA5nZpL5VNFsyYAdUqb8XCAHGyO9buzYtLPI99too0BN_aLICfw8wJ0Jn_b0AMxk28SN9LZdS72aI7oWvVIU73cw",
"provider": "visa"
},
"browser_info": {
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"color_depth": 24,
"java_enabled":true,
"java_script_enabled": true,
"language": "en-GB",
"screen_height": 1440,
"screen_width": 2560,
"time_zone": -330,
"user_agent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36"
}
}'
```
Expected Response
```shell
{
"payment_id": "pay_Ft9Ke5Lun924OCJa7yll",
"merchant_id": "dqwdwljildwduoqwhduwqcqwjd",
"status": "failed",
"amount": 1130,
"net_amount": 1130,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": "adyen",
"client_secret": "pay_Ft9Ke5Lun924OCJa7yll_secret_po1FVW5adQWFolWJUhMb",
"created": "2024-12-18T13:00:47.663Z",
"currency": "USD",
"customer_id": null,
"customer": null,
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": null,
"payment_method": "card",
"payment_method_data": null,
"payment_token": null,
"shipping": null,
"billing": null,
"order_details": null,
"email": null,
"name": null,
"phone": null,
"return_url": "https://hyperswitch.io/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": "2",
"error_message": "Refused",
"unified_code": "UE_9000",
"unified_message": "Something went wrong",
"payment_experience": null,
"payment_method_type": "debit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": true,
"connector_transaction_id": "KN8X64SH6PRRVS65",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_KCTRv8sFQfC0r65CZxrn",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_L6N77PiH3BI2BTPwkZPL",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-12-18T13:15:47.663Z",
"fingerprint": null,
"browser_info": {
"language": "en-GB",
"time_zone": -330,
"ip_address": "::1",
"user_agent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36",
"color_depth": 24,
"java_enabled": true,
"screen_width": 2560,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 1440,
"java_script_enabled": true
},
"payment_method_id": null,
"payment_method_status": null,
"updated": "2024-12-18T13:04:08.461Z",
"split_payments": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
Reason for it being failed is ayden doesn't support click to pay in sandbox, but does support in production
## 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
|
To implement this **payment** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/payments.rs`
**2. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/configs.rs`
- `crates/hyperswitch_domain_models/src/router_request_types/unified_authentication_service.rs`
**3. Core Business Logic**
- `crates/router/src/core/admin.rs`
- `crates/router/src/core/payments.rs`
- `crates/router/src/core/unified_authentication_service.rs`
- ... and 2 more files
**4. External Connector Integration**
- `crates/common_enums/src/connector_enums.rs`
- `crates/connector_configs/src/connector.rs`
- `crates/connector_configs/toml/development.toml`
- ... and 5 more files
**5. Type Definitions**
- `crates/router/src/types/api.rs`
- `crates/router/src/types/api/authentication.rs`
- `crates/router/src/types/transformers.rs`
**6. Tests**
- `loadtest/config/development.toml`
**7. Configuration Files**
- `config/development.toml`
- `config/docker_compose.toml`
**8. Other**
- `api-reference-v2/openapi_spec.json`
- `api-reference/openapi_spec.json`
- `crates/common_enums/src/enums.rs`
- ... and 2 more files
**Code Patterns Applied:**
- Define new data structures (1 changes)
- Implement new functions (1 changes)
- Extend existing types with new fields (34 changes)
**Detailed Identifier Changes:**
Commit 9e5e6be7:
Files to modify:
**crates/api_models/src/payments.rs**
Add:
- function: pub::is_network_confirmation_call_required
- impl: impl CtpServiceDetails
**crates/common_enums/src/connector_enums.rs**
Modify existing code
**crates/common_enums/src/enums.rs**
Add:
- enum: pub::CtpServiceProvider
**crates/connector_configs/src/connector.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/unified_authentication_service.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/unified_authentication_service/transformers.rs**
Remove:
- function: private::try_from
- struct: pub::AuthenticationInfo
- struct: pub::UnifiedAuthenticationServiceAuthType
- enum: pub::AuthType
- impl: impl TryFrom<&ConnectorAuthType> for UnifiedAuthenticationServiceAuthType
**crates/hyperswitch_domain_models/src/configs.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_request_types/unified_authentication_service.rs**
Add:
- struct: pub::AuthenticationInfo
**crates/openapi/src/openapi.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.rs**
Modify existing code
**crates/router/src/core/unified_authentication_service.rs**
Modify existing code
**crates/router/src/core/unified_authentication_service/types.rs**
Modify existing code
**crates/router/src/core/unified_authentication_service/utils.rs**
Modify existing code
**crates/router/src/types/api.rs**
Modify existing code
**crates/router/src/types/api/authentication.rs**
Modify existing code
**crates/router/src/types/transformers.rs**
Modify existing code
|
{"pr_number": 7562, "pr_title": "feat(core): Add visa click to pay support", "merged_at": "2025-03-28T08:31:11Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/payments.rs"], "domain": ["crates/hyperswitch_domain_models/src/configs.rs", "crates/hyperswitch_domain_models/src/router_request_types/unified_authentication_service.rs"], "core_business": ["crates/router/src/core/admin.rs", "crates/router/src/core/payments.rs", "crates/router/src/core/unified_authentication_service.rs", "crates/router/src/core/unified_authentication_service/types.rs", "crates/router/src/core/unified_authentication_service/utils.rs"], "connectors": ["crates/common_enums/src/connector_enums.rs", "crates/connector_configs/src/connector.rs", "crates/connector_configs/toml/development.toml", "crates/connector_configs/toml/production.toml", "crates/connector_configs/toml/sandbox.toml", "crates/hyperswitch_connectors/src/connectors/unified_authentication_service.rs", "crates/hyperswitch_connectors/src/connectors/unified_authentication_service/transformers.rs", "scripts/add_connector.sh"], "types": ["crates/router/src/types/api.rs", "crates/router/src/types/api/authentication.rs", "crates/router/src/types/transformers.rs"], "tests": ["loadtest/config/development.toml"], "config": ["config/development.toml", "config/docker_compose.toml"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json", "crates/common_enums/src/enums.rs", "crates/openapi/src/openapi.rs", "crates/openapi/src/openapi_v2.rs"]}, "change_types": {"structs_added": 1, "functions_added": 1, "enums_added": 1, "fields_added": 34}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(analytics): add `first_attempt` as a filter for PaymentFilters
## 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 -->
Added `first_attempt` as a filter in `PaymentFilters`.
This is required for the new Analytics v2 `Smart Retries` Metrics, specifically `Smart Retries Successful Distribution` and `Smart Retries Failure Distribution`, for calculations only involving smart retries (ignoring first attempts).
### 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).
-->
Helps in calculating certain metrics seamlessly.
## 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)?
-->
Hit the curl:
```bash
curl --location 'http://localhost:8080/analytics/v1/org/metrics/payments' \
--header 'Accept: */*' \
--header 'Accept-Language: en-US,en;q=0.9' \
--header 'Connection: keep-alive' \
--header 'Content-Type: application/json' \
--header 'Origin: http://localhost:9000' \
--header 'Referer: http://localhost:9000/' \
--header 'Sec-Fetch-Dest: empty' \
--header 'Sec-Fetch-Mode: cors' \
--header 'Sec-Fetch-Site: same-site' \
--header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36' \
--header 'api-key: test_admin' \
--header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiNTQ5ZTNkMmItMTY5Yi00NzUzLWJmNTQtZDcxMTM2YjRiN2JkIiwibWVyY2hhbnRfaWQiOiJtZXJjaGFudF8xNzI2MDQ2MzI4Iiwicm9sZV9pZCI6Im9yZ19hZG1pbiIsImV4cCI6MTczMjYwODUzNCwib3JnX2lkIjoib3JnX1ZwU0hPanNZZkR2YWJWWUpnQ0FKIiwicHJvZmlsZV9pZCI6InByb192NXNGb0hlODBPZWlVbElvbm9jTSIsInRlbmFudF9pZCI6InB1YmxpYyJ9.tQYvWyhWQInhAymh0c4itE1CWVwhOG3L4_yHMY4RLkQ' \
--header 'sec-ch-ua: "Chromium";v="128", "Not;A=Brand";v="24", "Google Chrome";v="128"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--data '[
{
"timeRange": {
"startTime": "2024-11-19T00:30:00Z",
"endTime": "2024-11-19T23:30:00Z"
},
"groupByNames": [
"connector"
],
"filters": {
"first_attempt": [false]
},
"source": "BATCH",
"metrics": [
"payments_distribution"
],
"delta": true
}
]'
```
Response body:
```json
{
"queryData": [
{
"payment_success_rate": null,
"payment_count": null,
"payment_success_count": null,
"payment_processed_amount": 0,
"payment_processed_amount_in_usd": null,
"payment_processed_count": null,
"payment_processed_amount_without_smart_retries": 0,
"payment_processed_amount_without_smart_retries_usd": null,
"payment_processed_count_without_smart_retries": null,
"avg_ticket_size": null,
"payment_error_message": null,
"retries_count": null,
"retries_amount_processed": 0,
"connector_success_rate": null,
"payments_success_rate_distribution": 100.0,
"payments_success_rate_distribution_without_smart_retries": null,
"payments_success_rate_distribution_with_only_retries": 100.0,
"payments_failure_rate_distribution": 0.0,
"payments_failure_rate_distribution_without_smart_retries": null,
"payments_failure_rate_distribution_with_only_retries": 0.0,
"failure_reason_count": 0,
"failure_reason_count_without_smart_retries": 0,
"currency": null,
"status": null,
"connector": "stripe_test",
"authentication_type": null,
"payment_method": null,
"payment_method_type": null,
"client_source": null,
"client_version": null,
"profile_id": null,
"card_network": null,
"merchant_id": null,
"card_last_4": null,
"card_issuer": null,
"error_reason": null,
"time_range": {
"start_time": "2024-11-19T00:30:00.000Z",
"end_time": "2024-11-19T23:30:00.000Z"
},
"time_bucket": "2024-11-19 00:30:00"
}
],
"metaData": [
{
"total_payment_processed_amount": 0,
"total_payment_processed_amount_in_usd": 0,
"total_payment_processed_amount_without_smart_retries": 0,
"total_payment_processed_amount_without_smart_retries_usd": 0,
"total_payment_processed_count": 0,
"total_payment_processed_count_without_smart_retries": 0,
"total_failure_reasons_count": 0,
"total_failure_reasons_count_without_smart_retries": 0
}
]
}
```
Now this response will only have data related to the attempts which are not the first attempt, and are only subsequent smart rertries.
Fields that can be observed in the `queryData`:
```json
"payments_success_rate_distribution_with_only_retries": 100.0,
"payments_failure_rate_distribution_with_only_retries": 0.0,
```
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/analytics/payments.rs`
**2. Database Layer (Queries & Schema)**
- `crates/analytics/src/query.rs`
**3. Type Definitions**
- `crates/analytics/src/payments/types.rs`
**4. Other**
- `crates/analytics/src/payments/filters.rs`
- `crates/analytics/src/sqlx.rs`
**Code Patterns Applied:**
- Implement new functions (1 changes)
- Extend existing types with new fields (2 changes)
- Add conditional logic for feature flags or filtering (1 changes)
**Detailed Identifier Changes:**
Commit 9460041b:
Files to modify:
**crates/analytics/src/payments/filters.rs**
Modify existing code
**crates/analytics/src/payments/types.rs**
Modify existing code
**crates/analytics/src/query.rs**
Add:
- function: private::to_sql
- impl: impl ToSql<T> for bool
**crates/analytics/src/sqlx.rs**
Modify existing code
**crates/api_models/src/analytics/payments.rs**
Modify existing code
|
{"pr_number": 6604, "pr_title": "feat(analytics): add `first_attempt` as a filter for PaymentFilters", "merged_at": "2024-11-24T13:39:07Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "user"]}, "hierarchy": {"api_models": ["crates/api_models/src/analytics/payments.rs"], "database": ["crates/analytics/src/query.rs"], "types": ["crates/analytics/src/payments/types.rs"], "other": ["crates/analytics/src/payments/filters.rs", "crates/analytics/src/sqlx.rs"]}, "change_types": {"functions_added": 1, "fields_added": 2, "conditionals_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(core): remove merchant return url from `router_data`
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
- remove merchant return url from `router_data`
- We are not using merchant return url at the connectors, we should always send our return url to the connectors
### 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?
1. Create Merchant Account
2. Create API KEY
3. Create Adyen Connector
```
curl --location 'http://localhost:8080/account/merchant_1734600412/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data '{
"connector_type": "payment_processor",
"connector_name": "adyen",
"connector_account_details": {
"auth_type": "BodyKey",
"api_key": "_____",
"key1": "JuspayDEECOM",
"api_secret": "_____"
},
"test_mode": false,
"disabled": false,
"business_country": "US",
"business_label": "default",
"payment_methods_enabled": [
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "credit",
"card_networks": [
"AmericanExpress",
"Discover",
"Interac",
"JCB",
"Mastercard",
"Visa",
"DinersClub",
"UnionPay",
"RuPay"
],
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "debit",
"card_networks": [
"AmericanExpress",
"Discover",
"Interac",
"JCB",
"Mastercard",
"Visa",
"DinersClub",
"UnionPay",
"RuPay"
],
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "bank_debit",
"payment_method_types": [
{
"payment_method_type": "ach",
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "bacs",
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
}
],
"metadata": {
"endpoint_prefix" : ""
},
"connector_webhook_details": {
"merchant_secret": "BE8E89E2CC5A5EB3886777B5BB7874A183E13D03D398691FD4951C228CD642A3"
}
}'
```
4. Create a card 3ds payment (do not pass return_url in request)
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: ____' \
--data-raw '{
"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": "three_ds",
"payment_method": "card",
"payment_method_type": "debit",
"payment_method_data": {
"card": {
"card_number": "371449635398431",
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "joseph Doe",
"card_cvc": "7373"
}
},
"routing": {
"type": "single",
"data": "adyen"
},
"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"
},
"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": 30,
"java_enabled": true,
"java_script_enabled": true,
"ip_address": "127.0.0.1"
},
"profile_id": "pro_hxKnAPSvuLjWAWSRJM0Z"
}'
```
Resposne
```
{
"payment_id": "pay_475MU5SwDmns4g1sKQPA",
"merchant_id": "merchant_1734600412",
"status": "requires_customer_action",
"amount": 6540,
"net_amount": 6540,
"shipping_cost": null,
"amount_capturable": 6540,
"amount_received": null,
"connector": "adyen",
"client_secret": "pay_475MU5SwDmns4g1sKQPA_secret_zR6U5K20HAuquEy8LQjH",
"created": "2024-12-19T09:30:18.304Z",
"currency": "USD",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+1"
},
"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": "8431",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "371449",
"card_extended_bin": null,
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "joseph Doe",
"payment_checks": null,
"authentication_data": 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": "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": null,
"authentication_type": "three_ds",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"next_action": {
"type": "redirect_to_url",
"redirect_to_url": "http://localhost:8080/payments/redirect/pay_475MU5SwDmns4g1sKQPA/merchant_1734600412/pay_475MU5SwDmns4g1sKQPA_1"
},
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "debit",
"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": 1734600618,
"expires": 1734604218,
"secret": "epk_b77f25570c644f6da13059eb3e435742"
},
"manual_retry_allowed": null,
"connector_transaction_id": "PDWZFPKPZXTQ7RT5",
"frm_message": null,
"metadata": {
"udf1": "value1",
"login_date": "2019-09-10T10:11:12Z",
"new_customer": "true"
},
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "PDWZFPKPZXTQ7RT5",
"payment_link": null,
"profile_id": "pro_hxKnAPSvuLjWAWSRJM0Z",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_R1OpUF3Rw5wg2p0mT00r",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-12-19T09:45:18.304Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 30,
"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-12-19T09:30:18.782Z",
"split_payments": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
Complete authentication using redirection_url.
5. Do psync
```
curl --location 'http://localhost:8080/payments/pay_475MU5SwDmns4g1sKQPA' \
--header 'Accept: application/json' \
--header 'api-key: _'
```
Response
```
{
"payment_id": "pay_475MU5SwDmns4g1sKQPA",
"merchant_id": "merchant_1734600412",
"status": "succeeded",
"amount": 6540,
"net_amount": 6540,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 6540,
"connector": "adyen",
"client_secret": "pay_475MU5SwDmns4g1sKQPA_secret_zR6U5K20HAuquEy8LQjH",
"created": "2024-12-19T09:30:18.304Z",
"currency": "USD",
"customer_id": "StripeCustomer",
"customer": {
"id": "StripeCustomer",
"name": "John Doe",
"email": "guest@example.com",
"phone": "999999999",
"phone_country_code": "+1"
},
"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": "8431",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "371449",
"card_extended_bin": null,
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "joseph Doe",
"payment_checks": null,
"authentication_data": 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": "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": null,
"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": "debit",
"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": "PDWZFPKPZXTQ7RT5",
"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_475MU5SwDmns4g1sKQPA_1",
"payment_link": null,
"profile_id": "pro_hxKnAPSvuLjWAWSRJM0Z",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_R1OpUF3Rw5wg2p0mT00r",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-12-19T09:45:18.304Z",
"fingerprint": null,
"browser_info": {
"language": "nl-NL",
"time_zone": 30,
"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-12-19T09:30:32.072Z",
"split_payments": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
Note: We have to check if 3ds flow is getting redirected properly, it means in case of 3ds after authentication, it should get redirected to url which we provide in confirm.
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/payment_intent.rs`
**2. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/payments/payment_intent.rs`
- `crates/hyperswitch_domain_models/src/router_data.rs`
- `crates/hyperswitch_domain_models/src/router_data_v2/flow_common_types.rs`
**3. Core Business Logic**
- `crates/router/src/core/authentication/transformers.rs`
- `crates/router/src/core/fraud_check/flows/checkout_flow.rs`
- `crates/router/src/core/fraud_check/flows/fulfillment_flow.rs`
- ... and 11 more files
**4. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/bitpay/transformers.rs`
- `crates/hyperswitch_connectors/src/connectors/boku/transformers.rs`
- `crates/hyperswitch_connectors/src/connectors/coinbase/transformers.rs`
- ... and 25 more files
**5. Type Definitions**
- `crates/router/src/types.rs`
**6. Other**
- `crates/router/src/services/conversion_impls.rs`
**Code Patterns Applied:**
- Implement new functions (2 changes)
- Extend existing types with new fields (6 changes)
**Detailed Identifier Changes:**
Commit c5717a81:
Files to modify:
**crates/diesel_models/src/payment_intent.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/bitpay/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/boku/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/coinbase/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/mollie/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/rapyd/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/zen/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/utils.rs**
Remove:
- function: private::get_return_url
- function: private::get_return_url
**crates/hyperswitch_domain_models/src/payments/payment_intent.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_data.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_data_v2/flow_common_types.rs**
Modify existing code
**crates/router/src/connector/adyen/transformers.rs**
Modify existing code
**crates/router/src/connector/iatapay/transformers.rs**
Modify existing code
**crates/router/src/connector/klarna/transformers.rs**
Modify existing code
**crates/router/src/connector/nuvei/transformers.rs**
Modify existing code
**crates/router/src/connector/opennode/transformers.rs**
Modify existing code
**crates/router/src/connector/payme/transformers.rs**
Modify existing code
**crates/router/src/connector/paypal/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**
Remove:
- function: private::get_return_url
- function: private::get_return_url
**crates/router/src/core/authentication/transformers.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/mandate/utils.rs**
Modify existing code
**crates/router/src/core/payments/helpers.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_response.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
**crates/router/src/core/relay/utils.rs**
Modify existing code
**crates/router/src/core/unified_authentication_service/utils.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/services/conversion_impls.rs**
Modify existing code
**crates/router/src/types.rs**
Modify existing code
**crates/router/src/types/api/verify_connector.rs**
Modify existing code
**crates/router/tests/connectors/aci.rs**
Modify existing code
**crates/router/tests/connectors/cashtocode.rs**
Modify existing code
**crates/router/tests/connectors/cryptopay.rs**
Modify existing code
**crates/router/tests/connectors/iatapay.rs**
Modify existing code
**crates/router/tests/connectors/opennode.rs**
Modify existing code
**crates/router/tests/connectors/payme.rs**
Modify existing code
**crates/router/tests/connectors/square.rs**
Modify existing code
**crates/router/tests/connectors/stax.rs**
Modify existing code
**crates/router/tests/connectors/utils.rs**
Modify existing code
|
{"pr_number": 6895, "pr_title": "refactor(core): remove merchant return url from `router_data`", "merged_at": "2024-12-24T11:53:52Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"database": ["crates/diesel_models/src/payment_intent.rs"], "domain": ["crates/hyperswitch_domain_models/src/payments/payment_intent.rs", "crates/hyperswitch_domain_models/src/router_data.rs", "crates/hyperswitch_domain_models/src/router_data_v2/flow_common_types.rs"], "core_business": ["crates/router/src/core/authentication/transformers.rs", "crates/router/src/core/fraud_check/flows/checkout_flow.rs", "crates/router/src/core/fraud_check/flows/fulfillment_flow.rs", "crates/router/src/core/fraud_check/flows/record_return.rs", "crates/router/src/core/fraud_check/flows/sale_flow.rs", "crates/router/src/core/fraud_check/flows/transaction_flow.rs", "crates/router/src/core/mandate/utils.rs", "crates/router/src/core/payments/helpers.rs", "crates/router/src/core/payments/operations/payment_response.rs", "crates/router/src/core/payments/transformers.rs", "crates/router/src/core/relay/utils.rs", "crates/router/src/core/unified_authentication_service/utils.rs", "crates/router/src/core/utils.rs", "crates/router/src/core/webhooks/utils.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/bitpay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/boku/transformers.rs", "crates/hyperswitch_connectors/src/connectors/coinbase/transformers.rs", "crates/hyperswitch_connectors/src/connectors/mollie/transformers.rs", "crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs", "crates/hyperswitch_connectors/src/connectors/rapyd/transformers.rs", "crates/hyperswitch_connectors/src/connectors/zen/transformers.rs", "crates/hyperswitch_connectors/src/utils.rs", "crates/router/src/connector/adyen/transformers.rs", "crates/router/src/connector/iatapay/transformers.rs", "crates/router/src/connector/klarna/transformers.rs", "crates/router/src/connector/nuvei/transformers.rs", "crates/router/src/connector/opennode/transformers.rs", "crates/router/src/connector/payme/transformers.rs", "crates/router/src/connector/paypal/transformers.rs", "crates/router/src/connector/stripe/transformers.rs", "crates/router/src/connector/trustpay/transformers.rs", "crates/router/src/connector/utils.rs", "crates/router/src/types/api/verify_connector.rs", "crates/router/tests/connectors/aci.rs", "crates/router/tests/connectors/cashtocode.rs", "crates/router/tests/connectors/cryptopay.rs", "crates/router/tests/connectors/iatapay.rs", "crates/router/tests/connectors/opennode.rs", "crates/router/tests/connectors/payme.rs", "crates/router/tests/connectors/square.rs", "crates/router/tests/connectors/stax.rs", "crates/router/tests/connectors/utils.rs"], "types": ["crates/router/src/types.rs"], "other": ["crates/router/src/services/conversion_impls.rs"]}, "change_types": {"functions_added": 2, "fields_added": 6}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
refactor(payments): Add platform merchant account checks for payment intent
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
Currently payment_intent stores platform_merchant_id. This can be used to identify if the payment was created by platform merchant.
If the payment was initialized by platform merchant, the merchant who is the owner of the payment should not be able to do any operations on the payment and vice versa.
So, we need those validations on payment intents to check if the current merchant can be allowed to perform those operations even if the authentication module allows it.
These payment ops are modified in the process.
| Operation | Validation Added | Auth Used |
| ---------------------------------------- | ---------------- | ------------------------------ |
| Payment Approve | Yes | JWT + API Key |
| Payment Cancel | Yes | API Key |
| Payment Capture | Yes | API Key |
| Complete Authorize | No | Client Secret + API Key |
| Payment Confirm | No | Client Secret + API Key |
| Payment Reject | Yes | API Key |
| Payment Post Session Tokens | No | Publishable Key Auth |
| Payment Session | No | Publishable Key Auth |
| Payment Start | No | Merchant ID Auth |
| Payment Status | No | Client Secret + API Key + JWT |
| Payment Update | No | Publishable Key Auth + API Key |
| Payment Update Intent | Yes | API Key |
| Payment Incremental Authorization | Yes | API Key |
| Payment Session Update / Tax Calculation | No | Publishable Key Auth |
| Payment Create | No | API Key + JWT |
| Payment Intent Create | No | API Key + JWT |
| Payment Session Intent | No | Publishable Key Auth |
| Payment Get Intent | Yes | API Key |
| Payment Confirm Intent | No | Publishable Key Auth |
| Payment Get | Yes | API Key + JWT |
| Payment Capture V2 | Yes | API Key + JWT |
| Payment Get Intent | Yes | API Key |
### 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).
-->
Closes #7203.
## 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 two merchant accounts and make one platform. Refer #6882 to know what is a platform merchant and how to create a platform merchant account.
2. Create a payment for normal merchant account using platform merchant account
```bash
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'x-connected-merchant-id: merchant_1739261637' \
--header 'api-key: PLATFORM_API_KEY' \
--data '{
"amount": 6545,
"currency": "USD"
}'
```
3. Try to make any of the above mentioned operations using normal merchant account and it will throw error. Using payment cancel as an example.
```bash
curl --location 'http://localhost:8080/payments/pay_Hj5V6MPOVqIL44ODkX1j/cancel' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: NORMAL_MERCHANT_API_KEY' \
--data '{
"cancellation_reason": "requested_by_customer"
}'
```
```json
{
"error": {
"type": "invalid_request",
"message": "Invalid platform account operation",
"code": "IR_44"
}
}
```
- And the API should work if hit with platform merchant account api key
```bash
curl --location 'http://localhost:8080/payments/pay_Hj5V6MPOVqIL44ODkX1j/cancel' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'x-connected-merchant-id: merchant_1739261637' \
--header 'api-key: PLATFORM_API_KEY' \
--data '{
"cancellation_reason": "requested_by_customer"
}'
```
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/payments/operations/payment_approve.rs`
- `crates/router/src/core/payments/operations/payment_cancel.rs`
- `crates/router/src/core/payments/operations/payment_capture.rs`
- ... and 17 more files
**2. Other**
- `crates/router/src/routes/payment_methods.rs`
**Code Patterns Applied:**
- Implement new functions (3 changes)
- Extend existing types with new fields (13 changes)
- Add conditional logic for feature flags or filtering (2 changes)
**Detailed Identifier Changes:**
Commit 12ef8ee0:
Files to modify:
**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_capture_v2.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_confirm_intent.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_get.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_get_intent.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_post_session_tokens.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_session_intent.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/payment_update_intent.rs**
Modify existing code
**crates/router/src/core/payments/operations/payments_incremental_authorization.rs**
Modify existing code
**crates/router/src/core/payments/operations/tax_calculation.rs**
Modify existing code
**crates/router/src/core/utils.rs**
Add:
- function: private::validate_platform_merchant
- function: private::get_platform_merchant_id
- trait: pub::ValidatePlatformMerchant
- impl: impl ValidatePlatformMerchant for storage::PaymentIntent
**crates/router/src/routes/payment_methods.rs**
Modify existing code
|
{"pr_number": 7204, "pr_title": "refactor(payments): Add platform merchant account checks for payment intent", "merged_at": "2025-02-14T10:05:46Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/payments/operations/payment_approve.rs", "crates/router/src/core/payments/operations/payment_cancel.rs", "crates/router/src/core/payments/operations/payment_capture.rs", "crates/router/src/core/payments/operations/payment_capture_v2.rs", "crates/router/src/core/payments/operations/payment_complete_authorize.rs", "crates/router/src/core/payments/operations/payment_confirm.rs", "crates/router/src/core/payments/operations/payment_confirm_intent.rs", "crates/router/src/core/payments/operations/payment_get.rs", "crates/router/src/core/payments/operations/payment_get_intent.rs", "crates/router/src/core/payments/operations/payment_post_session_tokens.rs", "crates/router/src/core/payments/operations/payment_reject.rs", "crates/router/src/core/payments/operations/payment_session.rs", "crates/router/src/core/payments/operations/payment_session_intent.rs", "crates/router/src/core/payments/operations/payment_start.rs", "crates/router/src/core/payments/operations/payment_status.rs", "crates/router/src/core/payments/operations/payment_update.rs", "crates/router/src/core/payments/operations/payment_update_intent.rs", "crates/router/src/core/payments/operations/payments_incremental_authorization.rs", "crates/router/src/core/payments/operations/tax_calculation.rs", "crates/router/src/core/utils.rs"], "other": ["crates/router/src/routes/payment_methods.rs"]}, "change_types": {"functions_added": 3, "fields_added": 13, "conditionals_added": 2}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(core): add card_discovery filter to payment list and payments Response
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Enhancement
## Description
<!-- Describe your changes in detail -->
add card_discovery filter to payment list and payments Response
### 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)?
-->
Enable `Click To Pay` and try to do a payment, after that do list payment list with constraint `card_discovery`
to enable `Click To Pay` you can refer this PR (https://github.com/juspay/hyperswitch/pull/6982)
```shell
curl --location 'http://localhost:8080/payments/list' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'x-api-key: dev_lqs6topblZKyE7pXWRRtzmWkZcAZNxSzkXDCsNTfsgsaJXoGPN6JmR0Pwey4Aknz' \
--header 'api-key: dev_lqs6topblZKyE7pXWRRtzmWkZcAZNxSzkXDCsNTfsgsaJXoGPN6JmR0Pwey4Aknz' \
--data '{
"card_discovery": ["click_to_pay"]
}'
```
Response :
```shell
{
"count": 2,
"total_count": 1,
"data": [
{
"payment_id": "pay_JI24u3IxBDkutHtxqxVK",
"merchant_id": "sahkal",
"status": "failed",
"amount": 1130,
"net_amount": 1130,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": "adyen",
"client_secret": "pay_JI24u3IxBDkutHtxqxVK_secret_FzRctDiX9eBQLreSa1mo",
"created": "2025-02-11T09:20:28.155Z",
"currency": "USD",
"customer_id": null,
"customer": null,
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": null,
"payment_method": "card",
"payment_method_data": 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": "debit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": null,
"connector_transaction_id": "FGBRQ528VFKLJJV5",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_crxsi6miDgts1Y0j0qp8",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_sN3IpyjFt7nLkExHaZeu",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": null,
"expires_on": null,
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": null,
"split_payments": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
},
{
"payment_id": "pay_8g0o7JhNX9sSYFj6uyMS",
"merchant_id": "sahkal",
"status": "requires_payment_method",
"amount": 1130,
"net_amount": 1130,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": null,
"client_secret": "pay_8g0o7JhNX9sSYFj6uyMS_secret_vS15DUDv71Zy14hrvUxU",
"created": "2025-02-11T09:17:13.041Z",
"currency": "USD",
"customer_id": null,
"customer": null,
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": null,
"payment_method": null,
"payment_method_data": null,
"payment_token": null,
"shipping": null,
"billing": null,
"order_details": null,
"email": null,
"name": null,
"phone": null,
"return_url": null,
"authentication_type": null,
"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": null,
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": null,
"connector_transaction_id": null,
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_crxsi6miDgts1Y0j0qp8",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": null,
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": null,
"expires_on": null,
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": null,
"split_payments": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
]
}
```
Payment Response
```shell
{
"payment_id": "pay_d73IKuzppDYMaLCy7Jup",
"merchant_id": "sahkal",
"status": "failed",
"amount": 1130,
"net_amount": 1130,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": "adyen",
"client_secret": "pay_d73IKuzppDYMaLCy7Jup_secret_zImkzJOHimtj9mKLam7h",
"created": "2025-02-11T14:06:57.252Z",
"currency": "USD",
"customer_id": null,
"customer": null,
"description": null,
"refunds": null,
"disputes": null,
"mandate_id": null,
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": null,
"payment_method": "card",
"payment_method_data": null,
"payment_token": null,
"shipping": null,
"billing": null,
"order_details": null,
"email": null,
"name": null,
"phone": null,
"return_url": "https://hyperswitch.io/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": "2",
"error_message": "Refused",
"unified_code": "UE_9000",
"unified_message": "Something went wrong",
"payment_experience": null,
"payment_method_type": "debit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": true,
"connector_transaction_id": "MPDCQ27C4ZQJH275",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_crxsi6miDgts1Y0j0qp8",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_sN3IpyjFt7nLkExHaZeu",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-02-11T14:21:57.251Z",
"fingerprint": null,
"browser_info": {
"os_type": null,
"language": "en-GB",
"time_zone": -330,
"ip_address": "::1",
"os_version": null,
"user_agent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36",
"color_depth": 24,
"device_model": null,
"java_enabled": true,
"screen_width": 2560,
"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"screen_height": 1440,
"accept_language": "en",
"java_script_enabled": true
},
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-02-11T14:08:40.820Z",
"split_payments": null,
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": "click_to_pay"
}
```
Screenshot for kafka logs
<img width="667" alt="Screenshot 2025-02-12 at 2 51 03 PM" src="https://github.com/user-attachments/assets/ee7a5046-9004-4d6d-adce-8519124ef161" />
<img width="664" alt="Screenshot 2025-02-12 at 2 51 40 PM" src="https://github.com/user-attachments/assets/617f40a2-f25d-424b-9bf4-38ebbc2b2841" />
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/payments.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/query/payment_attempt.rs`
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/payments/payment_attempt.rs`
- `crates/hyperswitch_domain_models/src/payments/payment_intent.rs`
**4. Core Business Logic**
- `crates/router/src/core/payments.rs`
- `crates/router/src/core/payments/transformers.rs`
**5. Tests**
- `crates/router/tests/payments.rs`
- `crates/router/tests/payments2.rs`
**6. Other**
- `api-reference/openapi_spec.json`
- `crates/common_enums/src/enums.rs`
- `crates/openapi/src/openapi.rs`
- ... and 6 more files
**Code Patterns Applied:**
- Extend existing types with new fields (23 changes)
- Add conditional logic for feature flags or filtering (2 changes)
- Modify database queries (4 changes)
**Detailed Identifier Changes:**
Commit 3c7cb9e5:
Files to modify:
**crates/api_models/src/payments.rs**
Modify existing code
**crates/common_enums/src/enums.rs**
Modify existing code
**crates/diesel_models/src/query/payment_attempt.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payments/payment_attempt.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payments/payment_intent.rs**
Modify existing code
**crates/openapi/src/openapi.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
**crates/router/src/db/kafka_store.rs**
Modify existing code
**crates/router/src/services/kafka/payment_attempt.rs**
Modify existing code
**crates/router/src/services/kafka/payment_attempt_event.rs**
Modify existing code
**crates/router/tests/payments.rs**
Modify existing code
**crates/router/tests/payments2.rs**
Modify existing code
**crates/storage_impl/src/mock_db/payment_attempt.rs**
Modify existing code
**crates/storage_impl/src/payments/payment_attempt.rs**
Modify existing code
**crates/storage_impl/src/payments/payment_intent.rs**
Modify existing code
|
{"pr_number": 7230, "pr_title": "feat(core): add card_discovery filter to payment list and payments Response", "merged_at": "2025-02-14T10:05:46Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/payments.rs"], "database": ["crates/diesel_models/src/query/payment_attempt.rs"], "domain": ["crates/hyperswitch_domain_models/src/payments/payment_attempt.rs", "crates/hyperswitch_domain_models/src/payments/payment_intent.rs"], "core_business": ["crates/router/src/core/payments.rs", "crates/router/src/core/payments/transformers.rs"], "tests": ["crates/router/tests/payments.rs", "crates/router/tests/payments2.rs"], "other": ["api-reference/openapi_spec.json", "crates/common_enums/src/enums.rs", "crates/openapi/src/openapi.rs", "crates/router/src/db/kafka_store.rs", "crates/router/src/services/kafka/payment_attempt.rs", "crates/router/src/services/kafka/payment_attempt_event.rs", "crates/storage_impl/src/mock_db/payment_attempt.rs", "crates/storage_impl/src/payments/payment_attempt.rs", "crates/storage_impl/src/payments/payment_intent.rs"]}, "change_types": {"fields_added": 23, "conditionals_added": 2, "database_queries": 4}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(connector): [globalpay, globepay, itaubank, nexinets, nuvei, prophetpay, zen] add in feature matrix
## 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 -->
Add globalpay, globepay, itaubank, nexinets, nuvei, prophetpay, zen connectors in feature matrix
### 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)?
-->
```
curl --location 'http://localhost:8080/feature_matrix' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_jQNBYCfN5R0473yldj23Yl7HsGbCctexthWkELSAMAGpjCxKAspb2fcQDP1KmMJz'
```
Response
```
{
"connector_count": 39,
"connectors": [
{
"name": "GLOBALPAY",
"display_name": "Globalpay",
"description": "Global Payments is an American multinational financial technology company that provides payment technology and services to merchants, issuers and consumers.",
"category": "payment_gateway",
"supported_payment_methods": [
{
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_type_display_name": "Credit Card",
"mandates": "supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"three_ds": "not_supported",
"no_three_ds": "supported",
"supported_card_networks": [
"Visa",
"Mastercard",
"AmericanExpress",
"DinersClub",
"Discover",
"Interac",
"JCB",
"CartesBancaires",
"UnionPay"
],
"supported_countries": [
"SPM",
"BGD",
"SEN",
"GAB",
"MAF",
"LKA",
"JPN",
"TLS",
"IDN",
"SDN",
"BEL",
"TCA",
"CHL",
"PHL",
"ERI",
"GIB",
"MNE",
"NGA",
"HRV",
"NER",
"NIU",
"BFA",
"MCO",
"MEX",
"SYC",
"AGO",
"ATG",
"IRQ",
"CUW",
"SWZ",
"CYM",
"AUT",
"WSM",
"AND",
"COG",
"UKR",
"CXR",
"ATF",
"PRI",
"GNQ",
"KOR",
"VEN",
"VCT",
"REU",
"SHN",
"UGA",
"COM",
"CUB",
"SUR",
"VGB",
"JAM",
"UMI",
"CHN",
"EGY",
"ZWE",
"TUV",
"SJM",
"SVK",
"ZMB",
"BRA",
"SMR",
"ZAF",
"GNB",
"MRT",
"URY",
"NAM",
"GLP",
"IRL",
"CMR",
"BRN",
"FIN",
"HND",
"ETH",
"ABW",
"FSM",
"SVN",
"SLB",
"MNG",
"GTM",
"PRT",
"SGP",
"COD",
"ARE",
"PAN",
"BES",
"GUF",
"KGZ",
"CPV",
"CHE",
"MKD",
"ATA",
"BDI",
"DOM",
"TCD",
"TZA",
"MMR",
"GGY",
"MYT",
"CCK",
"SGS",
"LUX",
"VNM",
"NOR",
"RUS",
"BLM",
"MLT",
"BRB",
"FRA",
"MUS",
"NFK",
"YEM",
"OMN",
"MDA",
"MDG",
"ISR",
"ARM",
"HMD",
"BLZ",
"PLW",
"COK",
"IND",
"COL",
"FLK",
"BMU",
"BTN",
"DJI",
"VAT",
"TKM",
"TON",
"KHM",
"POL",
"VIR",
"RWA",
"HUN",
"KNA",
"NIC",
"TUR",
"LBY",
"ALB",
"MWI",
"DZA",
"BWA",
"SLV",
"PSE",
"TUN",
"SAU",
"MTQ",
"GUM",
"LSO",
"LIE",
"GRC",
"UZB",
"CIV",
"GRD",
"THA",
"BVT",
"KWT",
"AFG",
"CRI",
"BLR",
"DMA",
"KIR",
"BIH",
"LAO",
"WLF",
"SXM",
"GMB",
"TGO",
"DNK",
"CYP",
"HTI",
"TJK",
"PRY",
"MSR",
"USA",
"PNG",
"LBN",
"CAF",
"QAT",
"NZL",
"AUS",
"SYR",
"SWE",
"LBR",
"PYF",
"GHA",
"DEU",
"PAK",
"GIN",
"MAC",
"TKL",
"TWN",
"IMN",
"KEN",
"SRB",
"JOR",
"BHS",
"CZE",
"MLI",
"LVA",
"PRK",
"IOT",
"ALA",
"GRL",
"STP",
"FRO",
"BGR",
"SSD",
"PCN",
"HKG",
"MHL",
"GEO",
"NRU",
"GBR",
"LTU",
"ASM",
"JEY",
"LCA",
"ECU",
"AIA",
"ARG",
"BOL",
"MYS",
"BHR",
"SOM",
"FJI",
"AZE",
"ESH",
"NCL",
"MOZ",
"CAN",
"KAZ",
"ITA",
"BEN",
"ROU",
"MAR",
"EST",
"MDV",
"VUT",
"MNP",
"PER",
"IRN",
"ESP",
"NPL",
"NLD",
"TTO",
"SLE",
"ISL",
"GUY"
],
"supported_currencies": [
"ETB",
"TWD",
"KPW",
"BOB",
"KZT",
"GTQ",
"SYP",
"MNT",
"GBP",
"MVR",
"YER",
"RUB",
"GHS",
"LYD",
"QAR",
"GNF",
"PGK",
"USD",
"CLF",
"BWP",
"COP",
"XCD",
"PLN",
"AOA",
"SOS",
"UZS",
"BDT",
"SSP",
"MOP",
"HKD",
"SLL",
"SCR",
"ZMW",
"CDF",
"SAR",
"AFN",
"RSD",
"FJD",
"BIF",
"SGD",
"CAD",
"JPY",
"GEL",
"FKP",
"UYU",
"KHR",
"ZAR",
"BHD",
"IRR",
"DOP",
"MMK",
"NOK",
"ILS",
"SRD",
"TTD",
"BRL",
"GYD",
"EUR",
"MWK",
"ZWL",
"TND",
"BND",
"NIO",
"MKD",
"LAK",
"LRD",
"NAD",
"EGP",
"ERN",
"SDG",
"BMD",
"HTG",
"PHP",
"ARS",
"VUV",
"CUP",
"NGN",
"KMF",
"PEN",
"MGA",
"INR",
"JMD",
"GMD",
"JOD",
"BTN",
"CLP",
"UGX",
"BGN",
"ANG",
"IQD",
"LSL",
"BZD",
"BYN",
"SZL",
"PAB",
"MXN",
"LBP",
"ALL",
"PYG",
"KES",
"SEK",
"CNY",
"GIP",
"TJS",
"DZD",
"TMT",
"SVC",
"HRK",
"RWF",
"CVE",
"STD",
"KWD",
"TRY",
"IDR",
"HNL",
"MAD",
"NPR",
"AWG",
"CHF",
"SHP",
"AUD",
"TOP",
"WST",
"KRW",
"AZN",
"CRC",
"DJF",
"MDL",
"MZN",
"RON",
"TZS",
"PKR",
"CUC",
"KGS",
"DKK",
"AMD",
"ISK",
"MYR",
"BSD",
"AED",
"NZD",
"THB",
"MUR",
"HUF",
"UAH",
"BBD",
"CZK",
"LKR",
"OMR",
"VND",
"SBD"
]
},
{
"payment_method": "card",
"payment_method_type": "debit",
"payment_method_type_display_name": "Debit Card",
"mandates": "supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"three_ds": "not_supported",
"no_three_ds": "supported",
"supported_card_networks": [
"Visa",
"Mastercard",
"AmericanExpress",
"DinersClub",
"Discover",
"Interac",
"JCB",
"CartesBancaires",
"UnionPay"
],
"supported_countries": [
"TCD",
"JEY",
"BIH",
"PAN",
"EST",
"STP",
"USA",
"BTN",
"KOR",
"HND",
"MDA",
"FRO",
"GHA",
"SYC",
"RWA",
"LBN",
"GRL",
"BFA",
"ZAF",
"TLS",
"WLF",
"AUT",
"ZWE",
"BLR",
"HMD",
"JPN",
"ATF",
"COG",
"GUM",
"TZA",
"CYP",
"TKL",
"UZB",
"MYS",
"PER",
"CUB",
"AIA",
"SLE",
"BES",
"HRV",
"KEN",
"GRC",
"NOR",
"FIN",
"MWI",
"TUR",
"GMB",
"PNG",
"VIR",
"IOT",
"CYM",
"NLD",
"DEU",
"ETH",
"SGP",
"KGZ",
"LAO",
"ESH",
"LBY",
"BVT",
"BGD",
"IMN",
"CAN",
"DOM",
"BOL",
"MUS",
"SLB",
"SWZ",
"CHE",
"VCT",
"MDG",
"BEN",
"ATG",
"MTQ",
"ABW",
"SJM",
"TON",
"RUS",
"BGR",
"TUN",
"BRA",
"URY",
"AZE",
"SWE",
"GGY",
"SSD",
"JOR",
"OMN",
"BRB",
"PAK",
"VAT",
"MNE",
"POL",
"EGY",
"NZL",
"THA",
"BMU",
"IRQ",
"UKR",
"SLV",
"MKD",
"IDN",
"PYF",
"MNP",
"LBR",
"FSM",
"COM",
"BRN",
"PCN",
"ERI",
"ITA",
"FLK",
"CIV",
"CRI",
"ISL",
"MOZ",
"KNA",
"ECU",
"PRT",
"SEN",
"MRT",
"MEX",
"CMR",
"LVA",
"MCO",
"CHN",
"ESP",
"WSM",
"NER",
"GIN",
"SUR",
"ROU",
"ATA",
"HUN",
"QAT",
"NAM",
"IRN",
"SAU",
"CCK",
"GTM",
"BDI",
"NPL",
"ASM",
"CZE",
"CPV",
"CAF",
"LSO",
"LCA",
"REU",
"GBR",
"DMA",
"GNQ",
"LUX",
"ISR",
"BWA",
"PSE",
"MLT",
"GLP",
"DZA",
"UGA",
"MDV",
"ARE",
"IRL",
"GIB",
"BLM",
"GNB",
"CXR",
"JAM",
"BEL",
"CHL",
"NCL",
"VGB",
"DNK",
"KAZ",
"BHR",
"PRK",
"AUS",
"TWN",
"IND",
"LTU",
"SGS",
"TJK",
"GEO",
"NIU",
"HKG",
"SYR",
"AGO",
"COL",
"SDN",
"SPM",
"ALB",
"COD",
"MLI",
"TGO",
"TUV",
"SVN",
"COK",
"PRY",
"CUW",
"MAC",
"VEN",
"SOM",
"GRD",
"VNM",
"MMR",
"TKM",
"KHM",
"BLZ",
"GAB",
"HTI",
"VUT",
"KWT",
"MNG",
"MYT",
"PLW",
"SRB",
"ALA",
"MAR",
"NRU",
"GUF",
"SXM",
"MSR",
"SHN",
"UMI",
"PRI",
"TCA",
"ARM",
"AFG",
"YEM",
"DJI",
"FJI",
"LIE",
"SVK",
"PHL",
"MHL",
"GUY",
"TTO",
"AND",
"FRA",
"ZMB",
"KIR",
"ARG",
"NIC",
"BHS",
"LKA",
"NFK",
"NGA",
"MAF",
"SMR"
],
"supported_currencies": [
"PHP",
"TTD",
"LKR",
"DOP",
"CZK",
"LBP",
"MDL",
"EUR",
"SVC",
"LRD",
"KPW",
"CHF",
"QAR",
"PLN",
"VND",
"YER",
"AUD",
"GYD",
"SAR",
"SRD",
"RON",
"PYG",
"AED",
"LYD",
"PKR",
"SLL",
"UYU",
"PAB",
"SSP",
"SDG",
"MXN",
"USD",
"MGA",
"MUR",
"NPR",
"FJD",
"CNY",
"PGK",
"TND",
"DZD",
"NIO",
"CVE",
"MMK",
"HNL",
"SHP",
"BRL",
"ERN",
"RWF",
"TMT",
"KES",
"MYR",
"INR",
"IRR",
"MOP",
"SBD",
"ZMW",
"GBP",
"TRY",
"VUV",
"HRK",
"CUC",
"KRW",
"AWG",
"IDR",
"MWK",
"BSD",
"GHS",
"BMD",
"AOA",
"CRC",
"BWP",
"MKD",
"TWD",
"BIF",
"TJS",
"ANG",
"OMR",
"KZT",
"WST",
"KWD",
"EGP",
"XCD",
"JOD",
"NZD",
"SGD",
"NOK",
"BGN",
"CUP",
"RSD",
"UAH",
"KHR",
"TZS",
"TOP",
"ISK",
"RUB",
"JMD",
"MAD",
"BOB",
"MZN",
"SCR",
"NGN",
"NAD",
"ZAR",
"ARS",
"LAK",
"ETB",
"GIP",
"GTQ",
"BDT",
"HKD",
"UZS",
"COP",
"ILS",
"HUF",
"CAD",
"LSL",
"PEN",
"HTG",
"BYN",
"SYP",
"ALL",
"BTN",
"JPY",
"IQD",
"GEL",
"GMD",
"KGS",
"CLP",
"CLF",
"THB",
"GNF",
"AFN",
"BBD",
"AZN",
"BZD",
"DKK",
"DJF",
"BHD",
"FKP",
"SZL",
"SEK",
"KMF",
"AMD",
"MVR",
"UGX",
"CDF",
"BND",
"SOS",
"MNT",
"ZWL",
"STD"
]
},
{
"payment_method": "bank_redirect",
"payment_method_type": "giropay",
"payment_method_type_display_name": "Giropay",
"mandates": "supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"supported_countries": [
"DEU"
],
"supported_currencies": [
"EUR"
]
},
{
"payment_method": "bank_redirect",
"payment_method_type": "ideal",
"payment_method_type_display_name": "iDEAL",
"mandates": "supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"supported_countries": [
"NLD"
],
"supported_currencies": [
"EUR"
]
},
{
"payment_method": "bank_redirect",
"payment_method_type": "sofort",
"payment_method_type_display_name": "Sofort",
"mandates": "supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"supported_countries": [
"BEL",
"ITA",
"DEU",
"NLD",
"ESP",
"AUT"
],
"supported_currencies": [
"EUR"
]
},
{
"payment_method": "bank_redirect",
"payment_method_type": "eps",
"payment_method_type_display_name": "EPS",
"mandates": "supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"supported_countries": [
"AUT"
],
"supported_currencies": [
"EUR"
]
},
{
"payment_method": "wallet",
"payment_method_type": "paypal",
"payment_method_type_display_name": "PayPal",
"mandates": "supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"supported_countries": null,
"supported_currencies": null
},
{
"payment_method": "wallet",
"payment_method_type": "google_pay",
"payment_method_type_display_name": "Google Pay",
"mandates": "supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"supported_countries": null,
"supported_currencies": null
}
],
"supported_webhook_flows": [
"payments"
]
},
{
"name": "GLOBEPAY",
"display_name": "Globepay",
"description": "GlobePay Limited is a professional cross-border payment solution provider (WeChat Pay & Alipay) in the UK",
"category": "payment_gateway",
"supported_payment_methods": [
{
"payment_method": "wallet",
"payment_method_type": "ali_pay",
"payment_method_type_display_name": "Alipay",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"sequential_automatic"
],
"supported_countries": [
"GBR"
],
"supported_currencies": [
"GBP",
"CNY"
]
},
{
"payment_method": "wallet",
"payment_method_type": "we_chat_pay",
"payment_method_type_display_name": "WeChat Pay",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"sequential_automatic"
],
"supported_countries": [
"GBR"
],
"supported_currencies": [
"CNY",
"GBP"
]
}
],
"supported_webhook_flows": []
},
{
"name": "ITAUBANK",
"display_name": "Itaubank",
"description": "Itau Bank is a leading Brazilian financial institution offering a wide range of banking services, including retail banking, loans, and investment solutions.",
"category": "payment_gateway",
"supported_payment_methods": [
{
"payment_method": "bank_transfer",
"payment_method_type": "pix",
"payment_method_type_display_name": "Pix",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [],
"supported_countries": [
"BRA"
],
"supported_currencies": [
"BRL"
]
}
],
"supported_webhook_flows": []
},
{
"name": "NEXINETS",
"display_name": "Nexinets",
"description": "Nexi and Nets join forces to create The European PayTech leader, a strategic combination to offer future-proof innovative payment solutions.",
"category": "payment_gateway",
"supported_payment_methods": [
{
"payment_method": "card",
"payment_method_type": "debit",
"payment_method_type_display_name": "Debit Card",
"mandates": "supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"three_ds": "supported",
"no_three_ds": "supported",
"supported_card_networks": [
"Visa",
"Mastercard",
"AmericanExpress",
"DinersClub",
"Discover",
"Interac",
"JCB",
"CartesBancaires",
"UnionPay"
],
"supported_countries": [
"DEU"
],
"supported_currencies": [
"EUR"
]
},
{
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_type_display_name": "Credit Card",
"mandates": "supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"three_ds": "supported",
"no_three_ds": "supported",
"supported_card_networks": [
"Visa",
"Mastercard",
"AmericanExpress",
"DinersClub",
"Discover",
"Interac",
"JCB",
"CartesBancaires",
"UnionPay"
],
"supported_countries": [
"DEU"
],
"supported_currencies": [
"EUR"
]
},
{
"payment_method": "bank_redirect",
"payment_method_type": "ideal",
"payment_method_type_display_name": "iDEAL",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"supported_countries": [
"DEU"
],
"supported_currencies": [
"EUR"
]
},
{
"payment_method": "bank_redirect",
"payment_method_type": "giropay",
"payment_method_type_display_name": "Giropay",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"supported_countries": [
"DEU"
],
"supported_currencies": [
"EUR"
]
},
{
"payment_method": "bank_redirect",
"payment_method_type": "sofort",
"payment_method_type_display_name": "Sofort",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"supported_countries": [
"DEU"
],
"supported_currencies": [
"EUR"
]
},
{
"payment_method": "bank_redirect",
"payment_method_type": "eps",
"payment_method_type_display_name": "EPS",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"supported_countries": [
"DEU"
],
"supported_currencies": [
"EUR"
]
},
{
"payment_method": "wallet",
"payment_method_type": "apple_pay",
"payment_method_type_display_name": "Apple Pay",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"supported_countries": [
"DEU"
],
"supported_currencies": [
"EUR"
]
},
{
"payment_method": "wallet",
"payment_method_type": "paypal",
"payment_method_type_display_name": "PayPal",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"supported_countries": [
"DEU"
],
"supported_currencies": [
"EUR"
]
}
],
"supported_webhook_flows": []
},
{
"name": "NUVEI",
"display_name": "Nuvei",
"description": "Nuvei is the Canadian fintech company accelerating the business of clients around the world.",
"category": "payment_gateway",
"supported_payment_methods": [
{
"payment_method": "card",
"payment_method_type": "debit",
"payment_method_type_display_name": "Debit Card",
"mandates": "supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"sequential_automatic"
],
"three_ds": "supported",
"no_three_ds": "supported",
"supported_card_networks": [
"Visa",
"Mastercard",
"AmericanExpress",
"UnionPay",
"Interac",
"JCB",
"DinersClub",
"Discover",
"CartesBancaires"
],
"supported_countries": [
"THA",
"NZL",
"PHL",
"JPN",
"GBR",
"USA",
"AUS",
"IND",
"CAN",
"SGP"
],
"supported_currencies": [
"GBP",
"JOD",
"MAD",
"TTD",
"TWD",
"USD",
"YER",
"EGP",
"GEL",
"UAH",
"CAD",
"PEN",
"SEK",
"JPY",
"BAM",
"CRC",
"LBP",
"NZD",
"OMR",
"RSD",
"SGD",
"IDR",
"PYG",
"UYU",
"INR",
"SOS",
"NAD",
"MZN",
"MUR",
"ARS",
"KYD",
"PHP",
"PKR",
"UGX",
"MMK",
"IQD",
"UZS",
"MNT",
"TOP",
"TND",
"LKR",
"AUD",
"EUR",
"ISK",
"TRY",
"XAF",
"NOK",
"BMD",
"RUB",
"KES",
"KZT",
"BGN",
"MKD",
"RON",
"VND",
"KWD",
"AMD",
"BND",
"COP",
"MXN",
"SAR",
"AED",
"CHF",
"ZAR",
"CNY",
"CZK",
"HKD",
"HUF",
"KGS",
"AZN",
"BYN",
"GTQ",
"BDT",
"MWK",
"GHS",
"QAR",
"DKK",
"CLP",
"MYR",
"NGN",
"DOP",
"DZD",
"BHD",
"BRL",
"KRW",
"MDL",
"PLN",
"THB"
]
},
{
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_type_display_name": "Credit Card",
"mandates": "supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"sequential_automatic"
],
"three_ds": "supported",
"no_three_ds": "supported",
"supported_card_networks": [
"Visa",
"Mastercard",
"AmericanExpress",
"UnionPay",
"Interac",
"JCB",
"DinersClub",
"Discover",
"CartesBancaires"
],
"supported_countries": [
"SGP",
"GBR",
"CAN",
"PHL",
"THA",
"AUS",
"USA",
"NZL",
"JPN",
"IND"
],
"supported_currencies": [
"NGN",
"MXN",
"RUB",
"CZK",
"BDT",
"GBP",
"IDR",
"INR",
"NAD",
"THB",
"GEL",
"KZT",
"SEK",
"SOS",
"BYN",
"KYD",
"CNY",
"BRL",
"MWK",
"CLP",
"DZD",
"RON",
"EGP",
"EUR",
"UZS",
"BAM",
"TRY",
"KRW",
"KES",
"JPY",
"KWD",
"CHF",
"CRC",
"MYR",
"MZN",
"COP",
"MAD",
"GHS",
"NOK",
"CAD",
"NZD",
"PHP",
"HKD",
"OMR",
"PKR",
"QAR",
"AED",
"SGD",
"TOP",
"PYG",
"LKR",
"RSD",
"UAH",
"MKD",
"MUR",
"LBP",
"BMD",
"TTD",
"SAR",
"ARS",
"HUF",
"IQD",
"AMD",
"BND",
"DKK",
"DOP",
"BHD",
"KGS",
"MNT",
"JOD",
"PEN",
"ISK",
"TWD",
"UGX",
"USD",
"UYU",
"AZN",
"TND",
"VND",
"AUD",
"YER",
"ZAR",
"BGN",
"PLN",
"XAF",
"GTQ",
"MMK",
"MDL"
]
},
{
"payment_method": "pay_later",
"payment_method_type": "afterpay_clearpay",
"payment_method_type_display_name": "Afterpay Clearpay",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"sequential_automatic"
],
"supported_countries": [
"NZL",
"SGP",
"AUS",
"USA",
"IND",
"PHL",
"CAN",
"JPN",
"THA",
"GBR"
],
"supported_currencies": [
"MWK",
"TRY",
"CLP",
"NAD",
"UYU",
"AZN",
"MNT",
"KZT",
"XAF",
"BYN",
"NGN",
"GBP",
"DKK",
"GTQ",
"NOK",
"SGD",
"CNY",
"AED",
"BHD",
"KYD",
"IQD",
"MMK",
"PEN",
"BDT",
"TOP",
"PHP",
"MDL",
"CAD",
"AMD",
"USD",
"MUR",
"DZD",
"TTD",
"RSD",
"COP",
"SOS",
"AUD",
"NZD",
"BND",
"PLN",
"EUR",
"PYG",
"GHS",
"BGN",
"DOP",
"KGS",
"ARS",
"KWD",
"MKD",
"MZN",
"PKR",
"SEK",
"KES",
"JOD",
"MXN",
"MAD",
"RUB",
"ZAR",
"ISK",
"CHF",
"HUF",
"IDR",
"BRL",
"QAR",
"CRC",
"LBP",
"TND",
"BAM",
"UZS",
"UAH",
"SAR",
"JPY",
"OMR",
"MYR",
"RON",
"KRW",
"TWD",
"UGX",
"THB",
"VND",
"BMD",
"CZK",
"GEL",
"EGP",
"LKR",
"HKD",
"INR",
"YER"
]
},
{
"payment_method": "pay_later",
"payment_method_type": "klarna",
"payment_method_type_display_name": "Klarna",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"sequential_automatic"
],
"supported_countries": [
"USA",
"SGP",
"THA",
"GBR",
"IND",
"JPN",
"AUS",
"CAN",
"NZL",
"PHL"
],
"supported_currencies": [
"EGP",
"SEK",
"CZK",
"ISK",
"EUR",
"MMK",
"PLN",
"KGS",
"SOS",
"THB",
"MKD",
"TTD",
"LBP",
"USD",
"MNT",
"RUB",
"UGX",
"AZN",
"MZN",
"NOK",
"UAH",
"TND",
"AUD",
"SGD",
"KYD",
"RSD",
"AMD",
"SAR",
"JOD",
"BND",
"BRL",
"KRW",
"PHP",
"TWD",
"MAD",
"CNY",
"IDR",
"MXN",
"XAF",
"PEN",
"BMD",
"BDT",
"KWD",
"PKR",
"ZAR",
"YER",
"DZD",
"LKR",
"PYG",
"UZS",
"GHS",
"QAR",
"NZD",
"TRY",
"UYU",
"COP",
"MYR",
"GTQ",
"NGN",
"JPY",
"NAD",
"DOP",
"BAM",
"CHF",
"KZT",
"MDL",
"BGN",
"ARS",
"AED",
"CLP",
"BYN",
"BHD",
"CRC",
"GEL",
"IQD",
"CAD",
"KES",
"MUR",
"OMR",
"TOP",
"GBP",
"VND",
"DKK",
"MWK",
"RON",
"HUF",
"HKD",
"INR"
]
},
{
"payment_method": "bank_redirect",
"payment_method_type": "eps",
"payment_method_type_display_name": "EPS",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"sequential_automatic"
],
"supported_countries": [
"PHL",
"USA",
"AUS",
"CAN",
"NZL",
"SGP",
"GBR",
"JPN",
"THA",
"IND"
],
"supported_currencies": [
"DZD",
"PHP",
"TTD",
"AMD",
"XAF",
"AZN",
"NGN",
"TOP",
"IQD",
"OMR",
"MDL",
"BHD",
"MUR",
"MWK",
"USD",
"GEL",
"COP",
"CNY",
"AED",
"KRW",
"GBP",
"KZT",
"NOK",
"HKD",
"LKR",
"SEK",
"EGP",
"HUF",
"QAR",
"UGX",
"INR",
"MMK",
"THB",
"MKD",
"NZD",
"UZS",
"CHF",
"LBP",
"KWD",
"TND",
"KES",
"IDR",
"PYG",
"RON",
"VND",
"SOS",
"BAM",
"KYD",
"ZAR",
"MNT",
"BDT",
"DKK",
"ISK",
"NAD",
"CZK",
"CAD",
"MYR",
"CRC",
"GTQ",
"MZN",
"JOD",
"JPY",
"BMD",
"BYN",
"MAD",
"MXN",
"PEN",
"SAR",
"TRY",
"ARS",
"CLP",
"BGN",
"KGS",
"RSD",
"RUB",
"SGD",
"EUR",
"PLN",
"GHS",
"TWD",
"DOP",
"UAH",
"YER",
"UYU",
"PKR",
"BND",
"BRL",
"AUD"
]
},
{
"payment_method": "bank_redirect",
"payment_method_type": "ideal",
"payment_method_type_display_name": "iDEAL",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"sequential_automatic"
],
"supported_countries": [
"NZL",
"AUS",
"CAN",
"SGP",
"GBR",
"JPN",
"THA",
"USA",
"IND",
"PHL"
],
"supported_currencies": [
"GHS",
"NGN",
"EUR",
"DKK",
"JPY",
"BGN",
"MUR",
"MXN",
"KYD",
"KGS",
"RUB",
"EGP",
"TOP",
"BAM",
"TRY",
"KWD",
"LBP",
"HKD",
"HUF",
"LKR",
"TND",
"ISK",
"GTQ",
"MAD",
"MKD",
"BYN",
"TTD",
"OMR",
"YER",
"BHD",
"AZN",
"UAH",
"PEN",
"ZAR",
"PHP",
"KZT",
"CAD",
"GEL",
"SGD",
"VND",
"USD",
"XAF",
"IQD",
"MMK",
"NZD",
"PYG",
"QAR",
"RON",
"UGX",
"TWD",
"ARS",
"JOD",
"CRC",
"PKR",
"MDL",
"INR",
"KES",
"IDR",
"COP",
"CNY",
"BND",
"AED",
"BDT",
"CLP",
"MZN",
"PLN",
"RSD",
"CZK",
"MYR",
"DOP",
"SAR",
"CHF",
"KRW",
"THB",
"MNT",
"AMD",
"BRL",
"GBP",
"UYU",
"UZS",
"AUD",
"NAD",
"SEK",
"BMD",
"DZD",
"MWK",
"NOK",
"SOS"
]
},
{
"payment_method": "bank_redirect",
"payment_method_type": "sofort",
"payment_method_type_display_name": "Sofort",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"sequential_automatic"
],
"supported_countries": [
"AUS",
"NZL",
"JPN",
"GBR",
"USA",
"IND",
"THA",
"PHL",
"CAN",
"SGP"
],
"supported_currencies": [
"PLN",
"BAM",
"MXN",
"TOP",
"MUR",
"DOP",
"BMD",
"EUR",
"MWK",
"NOK",
"PHP",
"UZS",
"VND",
"BRL",
"BDT",
"AMD",
"AZN",
"GHS",
"THB",
"LKR",
"BYN",
"RSD",
"BGN",
"GTQ",
"UGX",
"CZK",
"BHD",
"EGP",
"AED",
"KRW",
"MNT",
"MKD",
"NZD",
"MAD",
"RUB",
"MMK",
"LBP",
"TND",
"YER",
"JOD",
"DZD",
"KZT",
"HKD",
"COP",
"HUF",
"JPY",
"BND",
"CRC",
"ISK",
"OMR",
"UAH",
"CAD",
"IDR",
"MDL",
"MZN",
"NAD",
"PYG",
"TTD",
"ZAR",
"MYR",
"UYU",
"TWD",
"PKR",
"SEK",
"CNY",
"KES",
"QAR",
"USD",
"GBP",
"GEL",
"KYD",
"TRY",
"PEN",
"AUD",
"CLP",
"IQD",
"SOS",
"CHF",
"NGN",
"KWD",
"SAR",
"INR",
"RON",
"SGD",
"DKK",
"ARS",
"XAF",
"KGS"
]
},
{
"payment_method": "bank_redirect",
"payment_method_type": "giropay",
"payment_method_type_display_name": "Giropay",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"sequential_automatic"
],
"supported_countries": [
"GBR",
"THA",
"PHL",
"NZL",
"IND",
"USA",
"AUS",
"JPN",
"SGP",
"CAN"
],
"supported_currencies": [
"TND",
"UZS",
"TRY",
"DZD",
"CZK",
"ISK",
"TTD",
"GBP",
"GHS",
"MUR",
"MWK",
"KZT",
"NGN",
"KGS",
"JPY",
"PLN",
"NOK",
"BYN",
"BND",
"KWD",
"PYG",
"RON",
"MDL",
"RSD",
"THB",
"VND",
"NAD",
"HKD",
"GTQ",
"BAM",
"XAF",
"BDT",
"PEN",
"IDR",
"LKR",
"MNT",
"CRC",
"KES",
"DOP",
"PHP",
"CHF",
"MXN",
"EGP",
"SEK",
"SOS",
"UYU",
"UAH",
"LBP",
"BGN",
"PKR",
"USD",
"GEL",
"AZN",
"MMK",
"BRL",
"COP",
"QAR",
"ZAR",
"UGX",
"ARS",
"CLP",
"RUB",
"CNY",
"CAD",
"SGD",
"DKK",
"INR",
"OMR",
"TWD",
"KRW",
"SAR",
"MYR",
"HUF",
"TOP",
"AED",
"MAD",
"MZN",
"EUR",
"BMD",
"KYD",
"MKD",
"JOD",
"NZD",
"AUD",
"IQD",
"YER",
"AMD",
"BHD"
]
},
{
"payment_method": "wallet",
"payment_method_type": "paypal",
"payment_method_type_display_name": "PayPal",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"sequential_automatic"
],
"supported_countries": [
"CAN",
"THA",
"USA",
"JPN",
"AUS",
"PHL",
"SGP",
"GBR",
"NZL",
"IND"
],
"supported_currencies": [
"BRL",
"SEK",
"BHD",
"MDL",
"MZN",
"SOS",
"NZD",
"EUR",
"KYD",
"OMR",
"PKR",
"TWD",
"AUD",
"YER",
"BAM",
"CLP",
"GBP",
"UYU",
"NAD",
"HUF",
"JOD",
"MWK",
"UZS",
"ISK",
"VND",
"LKR",
"USD",
"MNT",
"AZN",
"RUB",
"DOP",
"UAH",
"AED",
"INR",
"DKK",
"HKD",
"KWD",
"BDT",
"PHP",
"IQD",
"EGP",
"MAD",
"BGN",
"MYR",
"PLN",
"THB",
"BYN",
"MXN",
"CAD",
"COP",
"PYG",
"AMD",
"TOP",
"TRY",
"GEL",
"NGN",
"CRC",
"KGS",
"CHF",
"MMK",
"MUR",
"GTQ",
"QAR",
"RSD",
"TND",
"DZD",
"NOK",
"RON",
"SGD",
"TTD",
"UGX",
"KZT",
"CZK",
"XAF",
"KES",
"ARS",
"LBP",
"GHS",
"BND",
"MKD",
"CNY",
"ZAR",
"KRW",
"IDR",
"PEN",
"SAR",
"JPY",
"BMD"
]
},
{
"payment_method": "wallet",
"payment_method_type": "apple_pay",
"payment_method_type_display_name": "Apple Pay",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"sequential_automatic"
],
"supported_countries": [
"SGP",
"USA",
"CAN",
"GBR",
"PHL",
"AUS",
"NZL",
"THA",
"IND",
"JPN"
],
"supported_currencies": [
"UZS",
"XAF",
"DOP",
"TRY",
"ISK",
"AED",
"BND",
"PYG",
"CRC",
"BGN",
"OMR",
"PEN",
"GEL",
"BAM",
"CZK",
"NAD",
"RON",
"CHF",
"MWK",
"BRL",
"MYR",
"BDT",
"HUF",
"JPY",
"LKR",
"MAD",
"RSD",
"RUB",
"BMD",
"BYN",
"AMD",
"KGS",
"TND",
"TWD",
"AUD",
"IDR",
"KYD",
"MXN",
"ARS",
"CLP",
"MDL",
"NGN",
"SOS",
"TOP",
"TTD",
"LBP",
"GHS",
"KWD",
"MKD",
"MNT",
"CAD",
"EUR",
"ZAR",
"IQD",
"PKR",
"PHP",
"UAH",
"UYU",
"UGX",
"USD",
"BHD",
"KRW",
"CNY",
"SEK",
"PLN",
"YER",
"NZD",
"THB",
"KES",
"COP",
"HKD",
"KZT",
"GTQ",
"MZN",
"GBP",
"JOD",
"MMK",
"NOK",
"EGP",
"DKK",
"VND",
"MUR",
"INR",
"SGD",
"SAR",
"DZD",
"AZN",
"QAR"
]
},
{
"payment_method": "wallet",
"payment_method_type": "google_pay",
"payment_method_type_display_name": "Google Pay",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"sequential_automatic"
],
"supported_countries": [
"SGP",
"PHL",
"AUS",
"NZL",
"USA",
"CAN",
"JPN",
"THA",
"GBR",
"IND"
],
"supported_currencies": [
"RON",
"MAD",
"TWD",
"AZN",
"MYR",
"UAH",
"CZK",
"DKK",
"TND",
"MDL",
"MNT",
"NAD",
"PEN",
"ZAR",
"KWD",
"ARS",
"GBP",
"GEL",
"RSD",
"JPY",
"JOD",
"KYD",
"USD",
"SAR",
"CNY",
"KZT",
"PLN",
"UZS",
"YER",
"EGP",
"BYN",
"GTQ",
"NGN",
"BRL",
"QAR",
"AED",
"DZD",
"MWK",
"RUB",
"KRW",
"SGD",
"CHF",
"BDT",
"TTD",
"BMD",
"THB",
"UGX",
"XAF",
"BGN",
"MZN",
"MXN",
"PYG",
"VND",
"AMD",
"LKR",
"NOK",
"PHP",
"ISK",
"CLP",
"COP",
"EUR",
"AUD",
"BAM",
"TOP",
"KGS",
"UYU",
"IQD",
"NZD",
"LBP",
"MMK",
"DOP",
"IDR",
"HUF",
"HKD",
"CRC",
"GHS",
"SEK",
"CAD",
"INR",
"TRY",
"MKD",
"OMR",
"BND",
"PKR",
"SOS",
"MUR",
"BHD",
"KES"
]
}
],
"supported_webhook_flows": [
"payments"
]
},
{
"name": "PROPHETPAY",
"display_name": "Prophetpay",
"description": "GlobePay Limited is a professional cross-border payment solution provider (WeChat Pay & Alipay) in the UK",
"category": "payment_gateway",
"supported_payment_methods": [
{
"payment_method": "card_redirect",
"payment_method_type": "card_redirect",
"payment_method_type_display_name": "Card Redirect",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"sequential_automatic"
],
"supported_countries": [
"USA"
],
"supported_currencies": [
"USD"
]
}
],
"supported_webhook_flows": []
},
{
"name": "ZEN",
"display_name": "Zen",
"description": "Zen Payment Gateway is a secure and scalable payment solution that enables businesses to accept online payments globally with various methods and currencies.",
"category": "payment_gateway",
"supported_payment_methods": [
{
"payment_method": "bank_transfer",
"payment_method_type": "pix",
"payment_method_type_display_name": "Pix",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"supported_countries": [
"BRA"
],
"supported_currencies": [
"BRL"
]
},
{
"payment_method": "bank_transfer",
"payment_method_type": "multibanco",
"payment_method_type_display_name": "Multibanco",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"supported_countries": [
"PRT"
],
"supported_currencies": [
"EUR"
]
},
{
"payment_method": "bank_transfer",
"payment_method_type": "pse",
"payment_method_type_display_name": "PSE",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"supported_countries": [
"COL"
],
"supported_currencies": [
"COP"
]
},
{
"payment_method": "wallet",
"payment_method_type": "google_pay",
"payment_method_type_display_name": "Google Pay",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"supported_countries": null,
"supported_currencies": null
},
{
"payment_method": "wallet",
"payment_method_type": "apple_pay",
"payment_method_type_display_name": "Apple Pay",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"supported_countries": null,
"supported_currencies": null
},
{
"payment_method": "voucher",
"payment_method_type": "efecty",
"payment_method_type_display_name": "Efecty",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"supported_countries": [
"COL"
],
"supported_currencies": [
"COP"
]
},
{
"payment_method": "voucher",
"payment_method_type": "red_compra",
"payment_method_type_display_name": "RedCompra",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"supported_countries": [
"CHL"
],
"supported_currencies": [
"CLP"
]
},
{
"payment_method": "voucher",
"payment_method_type": "pago_efectivo",
"payment_method_type_display_name": "PagoEfectivo",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"supported_countries": [
"PER"
],
"supported_currencies": [
"PEN"
]
},
{
"payment_method": "voucher",
"payment_method_type": "red_pagos",
"payment_method_type_display_name": "RedPagos",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"supported_countries": [
"URY"
],
"supported_currencies": [
"UYU"
]
},
{
"payment_method": "voucher",
"payment_method_type": "boleto",
"payment_method_type_display_name": "Boleto Bancário",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"supported_countries": [
"BRA"
],
"supported_currencies": [
"BRL"
]
},
{
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_type_display_name": "Credit Card",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"three_ds": "not_supported",
"no_three_ds": "supported",
"supported_card_networks": [
"Visa",
"Mastercard",
"AmericanExpress",
"DinersClub",
"Discover",
"Interac",
"JCB",
"CartesBancaires",
"UnionPay"
],
"supported_countries": null,
"supported_currencies": null
},
{
"payment_method": "card",
"payment_method_type": "debit",
"payment_method_type_display_name": "Debit Card",
"mandates": "not_supported",
"refunds": "supported",
"supported_capture_methods": [
"automatic",
"manual",
"sequential_automatic"
],
"three_ds": "not_supported",
"no_three_ds": "supported",
"supported_card_networks": [
"Visa",
"Mastercard",
"AmericanExpress",
"DinersClub",
"Discover",
"Interac",
"JCB",
"CartesBancaires",
"UnionPay"
],
"supported_countries": null,
"supported_currencies": null
}
],
"supported_webhook_flows": [
"payments",
"refunds"
]
}
]
}
```
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/globalpay.rs`
- `crates/hyperswitch_connectors/src/connectors/globepay.rs`
- `crates/hyperswitch_connectors/src/connectors/itaubank.rs`
- ... and 4 more files
**2. Tests**
- `config/deployments/integration_test.toml`
- `loadtest/config/development.toml`
**3. Configuration Files**
- `config/config.example.toml`
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- ... and 2 more files
**Code Patterns Applied:**
- Implement new functions (21 changes)
- Extend existing types with new fields (218 changes)
**Detailed Identifier Changes:**
Commit 7c17996c:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/globalpay.rs**
Remove:
- function: private::validate_connector_against_payment_request
- impl: impl ConnectorSpecifications for Globalpay
Add:
- function: private::get_connector_about
- function: private::get_supported_payment_methods
- function: private::get_supported_webhook_flows
- impl: impl ConnectorSpecifications for Globalpay
**crates/hyperswitch_connectors/src/connectors/globepay.rs**
Add:
- function: private::get_connector_about
- function: private::get_supported_payment_methods
- function: private::get_supported_webhook_flows
- impl: impl ConnectorSpecifications for Globepay
**crates/hyperswitch_connectors/src/connectors/itaubank.rs**
Remove:
- impl: impl ConnectorSpecifications for Itaubank
Add:
- function: private::get_connector_about
- function: private::get_supported_payment_methods
- function: private::get_supported_webhook_flows
- impl: impl ConnectorSpecifications for Itaubank
**crates/hyperswitch_connectors/src/connectors/nexinets.rs**
Remove:
- function: private::validate_connector_against_payment_request
- impl: impl ConnectorSpecifications for Nexinets
Add:
- function: private::get_connector_about
- function: private::get_supported_payment_methods
- function: private::get_supported_webhook_flows
- impl: impl ConnectorSpecifications for Nexinets
**crates/hyperswitch_connectors/src/connectors/nuvei.rs**
Remove:
- function: private::validate_connector_against_payment_request
- impl: impl ConnectorSpecifications for Nuvei
Add:
- function: private::get_connector_about
- function: private::get_supported_payment_methods
- function: private::get_supported_webhook_flows
- impl: impl ConnectorSpecifications for Nuvei
**crates/hyperswitch_connectors/src/connectors/prophetpay.rs**
Remove:
- impl: impl ConnectorSpecifications for Prophetpay
Add:
- function: private::get_connector_about
- function: private::get_supported_payment_methods
- function: private::get_supported_webhook_flows
- impl: impl ConnectorSpecifications for Prophetpay
**crates/hyperswitch_connectors/src/connectors/zen.rs**
Remove:
- impl: impl ConnectorSpecifications for Zen
Add:
- function: private::get_connector_about
- function: private::get_supported_payment_methods
- function: private::get_supported_webhook_flows
- impl: impl ConnectorSpecifications for Zen
|
{"pr_number": 7258, "pr_title": "feat(connector): [globalpay, globepay, itaubank, nexinets, nuvei, prophetpay, zen] add in feature matrix", "merged_at": "2025-05-06T07:34:05Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["payment", "merchant", "order"]}, "hierarchy": {"connectors": ["crates/hyperswitch_connectors/src/connectors/globalpay.rs", "crates/hyperswitch_connectors/src/connectors/globepay.rs", "crates/hyperswitch_connectors/src/connectors/itaubank.rs", "crates/hyperswitch_connectors/src/connectors/nexinets.rs", "crates/hyperswitch_connectors/src/connectors/nuvei.rs", "crates/hyperswitch_connectors/src/connectors/prophetpay.rs", "crates/hyperswitch_connectors/src/connectors/zen.rs"], "tests": ["config/deployments/integration_test.toml", "loadtest/config/development.toml"], "config": ["config/config.example.toml", "config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml", "config/docker_compose.toml"]}, "change_types": {"functions_added": 21, "fields_added": 218, "imports_added": 11}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
ci(postman): fix `archipel` configs and test cases
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [x] Bugfix
- [ ] New feature
- [x] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [x] CI/CD
## Description
<!-- Describe your changes in detail -->
This pull request refactors and fixes the Postman test suite for the archipel payment connector in the Hyperswitch payments platform . The PR addresses several issues with the existing test cases and makes them compatible with the `archipel` connector's actual capabilities.
### Key Changes
- [x] Fix Connector Create Request Body.
- [x] Make necessary changes to request bodies all over the test suite.
- [x] Remove Unnecessary Test Cases (some of them fail because archipel does not support them).
- [x] Refunds are not working for the time being, so map them accordingly. (Will be changed later when it will be working)
- [x] Fix 3DS Payment Assertions.
- [x] Add necessary test cases.
- [x] Rename Test Scenarios wherever applicable.
- [x] Archipel supports mandates using only `mandate_id` and `connector_agnostic`. Add both cases.
## 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 PR primarily affects the CI/CD testing infrastructure. The changes ensure that:
1. Test Reliability: Removes failing tests for unsupported `archipel` features
2. Accurate Testing: Aligns test expectations with actual connector behavior
3. Better Coverage: Adds void payment scenarios that were previously missing
4. Future Readiness: Prepares for `Netcetera` 3DS integration
## 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)?
-->
**Before**
<img width="500" alt="image" src="https://github.com/user-attachments/assets/360cf5d5-b792-4183-ba10-37c3a05edf00" />
**After Refactoring**
<img width="500" alt="image" src="https://github.com/user-attachments/assets/0c77e703-64c6-499d-b901-f11b13d1cf02" />
**After Adding Other Test Cases**
<img width="500" alt="image" src="https://github.com/user-attachments/assets/910de8ce-144e-4518-873c-575f540578cc" />
## 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
|
To implement this **payment** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario5b-Create a zero auth mandate and recurring payment (using connector agnostic)/.meta.json`
- `postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario5b-Create a zero auth mandate and recurring payment (using connector agnostic)/List payment methods for a Customer/request.json`
- `postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario5b-Create a zero auth mandate and recurring payment (using connector agnostic)/Mandate Payments - Create/event.test.js`
- ... and 22 more files
**2. Tests**
- `postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment without external 3ds authentication /Payments - Confirm/event.test.js`
- `postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment/Payments - Create/event.test.js`
- `postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment without external 3ds authentication /Payments - Retrieve after confirm/event.test.js`
- ... and 55 more files
**3. Other**
- `postman/collection-dir/archipel/.meta.json`
- `postman/collection-dir/archipel/.variable.json`
- `postman/collection-dir/archipel/Flow Testcases/Happy Cases/.meta.json`
- ... and 172 more files
**Code Patterns Applied:**
- Add conditional logic for feature flags or filtering (109 changes)
|
{"pr_number": 8360, "pr_title": "ci(postman): fix `archipel` configs and test cases", "merged_at": "2025-06-25T12:17:36Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["payment", "user", "refund"]}, "hierarchy": {"connectors": ["postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario5b-Create a zero auth mandate and recurring payment (using connector agnostic)/.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario5b-Create a zero auth mandate and recurring payment (using connector agnostic)/List payment methods for a Customer/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario5b-Create a zero auth mandate and recurring payment (using connector agnostic)/Mandate Payments - Create/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario5b-Create a zero auth mandate and recurring payment (using connector agnostic)/Payments - Confirm/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario5b-Create a zero auth mandate and recurring payment (using connector agnostic)/Payments - Confirm/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario5b-Create a zero auth mandate and recurring payment (using connector agnostic)/Recurring Payments - Confirm/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario5b-Create a zero auth mandate and recurring payment (using connector agnostic)/Recurring Payments - Create/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario5b-Create a zero auth mandate and recurring payment (using connector agnostic)/Recurring Payments - Create/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6b-Create a mandate and recurring payment (using connector agnostic)/.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6b-Create a mandate and recurring payment (using connector agnostic)/List payment methods for a Customer/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6b-Create a mandate and recurring payment (using connector agnostic)/List payment methods for a Customer/response.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6b-Create a mandate and recurring payment (using connector agnostic)/Mandate Payments - Create/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6b-Create a mandate and recurring payment (using connector agnostic)/Mandate Payments - Create/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6b-Create a mandate and recurring payment (using connector agnostic)/Mandate Payments - Create/response.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6b-Create a mandate and recurring payment (using connector agnostic)/Payments - Confirm/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6b-Create a mandate and recurring payment (using connector agnostic)/Payments - Confirm/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6b-Create a mandate and recurring payment (using connector agnostic)/Payments - Confirm/response.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6b-Create a mandate and recurring payment (using connector agnostic)/Recurring Payments - Confirm/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6b-Create a mandate and recurring payment (using connector agnostic)/Recurring Payments - Confirm/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6b-Create a mandate and recurring payment (using connector agnostic)/Recurring Payments - Confirm/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6b-Create a mandate and recurring payment (using connector agnostic)/Recurring Payments - Confirm/response.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6b-Create a mandate and recurring payment (using connector agnostic)/Recurring Payments - Create/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6b-Create a mandate and recurring payment (using connector agnostic)/Recurring Payments - Create/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6b-Create a mandate and recurring payment (using connector agnostic)/Recurring Payments - Create/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6b-Create a mandate and recurring payment (using connector agnostic)/Recurring Payments - Create/response.json"], "tests": ["postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment without external 3ds authentication /Payments - Confirm/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment/Payments - Create/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment without external 3ds authentication /Payments - Retrieve after confirm/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment/Payments - Authorize request intent/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment/Payments - Confirm/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment/Payments - External 3ds authentication/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario4-Zero auth mandates/Payments - Retrieve recurring/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Cancel/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario4a-Void a payment/Payments - Create/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario4a-Void a payment/Payments - Retrieve/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6-Saved card flow/Payments - Confirm first and save card/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario4b-Void a partially captured payment/Payments - Capture/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario4b-Void a partially captured payment/Payments - Create/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario4b-Void a partially captured payment/Payments - Retrieve/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario4c-Void a successful payment/Payments - Cancel/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario4c-Void a successful payment/Payments - Capture/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Create/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment/Payments - Retrieve after confirm/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario5-Create a mandate and recurring payment/Payments - Confirm mandate/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario4-Zero auth mandates/Payments - Create mandate/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario4-Zero auth mandates/Payments - Confirm mandate/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario4-Zero auth mandates/Payments - Create recurring/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario5-Create a mandate and recurring payment/List payment methods for a Customer/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario5-Create a mandate and recurring payment/Payments - Create mandate/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario5-Create a mandate and recurring payment/Payments - Retrieve mandate/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario5-Create a mandate and recurring payment/Payments - Create recurring/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario5-Create a mandate and recurring payment/Payments - Retrieve recurring/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6-Saved card flow/Payment methods - List and get token/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario7-Save card flow/List payment methods for a Customer/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6-Saved card flow/Payments - Create second/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario7-Save card flow/Payments - Retrieve/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6-Saved card flow/Payments - Confirm second and use saved card/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6-Saved card flow/Payments - Create first/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario7-Save card flow/Save card payments - Retrieve/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario9a-Refund full payment/Refunds - Create/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario9a-Refund full payment/Refunds - Retrieve/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario9b-Refund partial payment/Refunds - Create/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario9b-Refund partial payment/Refunds - Retrieve/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario9c-Refund full incremented payment/Refunds - Create/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Negative Cases/Scenario3-Create payment with Manual capture but wrong pan/Payments - Capture/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Negative Cases/Scenario3-Create payment with Manual capture but wrong pan/Payments - Create/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Negative Cases/Scenario3-Create payment with Manual capture but wrong pan/Payments - Retrieve/event.test.js", "postman/collection-dir/archipel/Flow Testcases/QuickStart/3DS Authenticator - Configure/event.test.js", "postman/collection-dir/archipel/Flow Testcases/QuickStart/3DS Authenticator - Create/event.test.js", "postman/collection-dir/archipel/Flow Testcases/QuickStart/Connector Agnostic MIT - Enable/event.test.js", "postman/collection-dir/archipel/Flow Testcases/QuickStart/Customer - Create/event.test.js", "postman/collection-dir/archipel/Flow Testcases/QuickStart/Payment Connector - Create/event.test.js", "postman/collection-dir/archipel/Netcetera Testcases/Scenario1-Create 3DS payment with confirm true/Payments - Create/event.test.js", "postman/collection-dir/archipel/Netcetera Testcases/Scenario1-Create 3DS payment with confirm true/Payments - Retrieve/event.test.js", "postman/collection-dir/archipel/Netcetera Testcases/Scenario2-Create 3DS payment with confirm false/Payments - Confirm/event.test.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6-Saved card flow/Payments - Retrieve/event.test.js", "postman/collection-dir/archipel/Netcetera Testcases/Scenario2-Create 3DS payment with confirm false/Payments - Retrieve/event.test.js", "postman/collection-dir/archipel/Netcetera Testcases/Scenario3-Create 3DS Frictionless payment with Visa/Payments - Create/event.test.js", "postman/collection-dir/archipel/Netcetera Testcases/Scenario3-Create 3DS Frictionless payment with Visa/Payments - Retrieve/event.test.js", "postman/collection-dir/archipel/Netcetera Testcases/Scenario4-Create 3DS Frictionless payment with Mastercard/Payments - Create/event.test.js", "postman/collection-dir/archipel/Netcetera Testcases/Scenario4-Create 3DS Frictionless payment with Mastercard/Payments - Retrieve/event.test.js", "postman/collection-dir/archipel/Netcetera Testcases/Scenario5-Create 3DS Challenge payment with Mastercard/Payments - Create/event.test.js", "postman/collection-dir/archipel/Netcetera Testcases/Scenario5-Create 3DS Challenge payment with Mastercard/Payments - Retrieve/event.test.js"], "other": ["postman/collection-dir/archipel/.meta.json", "postman/collection-dir/archipel/.variable.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment/.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment/Payments - Confirm/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment/Payments - Confirm/event.prerequest.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment/Payments - Confirm/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment/Payments - Authorize request intent/response.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment/Payments - Create/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment/Payments - Create/event.prerequest.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment/Payments - Create/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment/Payments - Confirm/response.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment/Payments - Authorize request intent/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment/Payments - Retrieve after confirm/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment/Payments - Create/response.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario4-Zero auth mandates/.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario4a-Void a payment/.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario4a-Void a payment/Payments - Cancel/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Cancel/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment/Payments - External 3ds authentication/response.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario4a-Void a payment/Payments - Create/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6-Saved card flow/Payments - Create second/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment/Payments - Retrieve after confirm/response.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario4a-Void a payment/Payments - Retrieve/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario4a-Void a payment/Payments - Retrieve/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario4-Zero auth mandates/Payments - Confirm mandate/response.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario4b-Void a partially captured payment/.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario4b-Void a partially captured payment/Payments - Cancel/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario4b-Void a partially captured payment/Payments - Cancel/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario4-Zero auth mandates/Payments - Create mandate/response.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment/Payments - External 3ds authentication/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment/Payments - External 3ds authentication/event.prerequest.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario4b-Void a partially captured payment/Payments - Capture/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario4-Zero auth mandates/Payments - Create recurring/response.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario4b-Void a partially captured payment/Payments - Create/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Create/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario4-Zero auth mandates/Payments - Retrieve recurring/response.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario4b-Void a partially captured payment/Payments - Retrieve/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario4b-Void a partially captured payment/Payments - Retrieve/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario5-Create a mandate and recurring payment/List payment methods for a Customer/response.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario4c-Void a successful payment/.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario4c-Void a successful payment/Payments - Cancel/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario4c-Void a successful payment/Payments - Cancel/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario5-Create a mandate and recurring payment/Payments - Confirm mandate/response.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario5-Create a mandate and recurring payment/Payments - Confirm mandate/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario5-Create a mandate and recurring payment/Payments - Confirm mandate/event.prerequest.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario4c-Void a successful payment/Payments - Capture/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario5-Create a mandate and recurring payment/Payments - Create mandate/response.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6-Saved card flow/Payments - Confirm first and save card/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6-Saved card flow/Payments - Confirm first and save card/event.prerequest.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6-Saved card flow/Payments - Create first/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario5-Create a mandate and recurring payment/Payments - Create recurring/response.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment/Payments - Retrieve after confirm/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario4-Zero auth mandates/Payments - Retrieve recurring/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario5-Create a mandate and recurring payment/Payments - Retrieve mandate/response.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario5-Create a mandate and recurring payment/.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario5-Create a mandate and recurring payment/List payment methods for a Customer/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario5-Create a mandate and recurring payment/Payments - Confirm mandate/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario5a-Create a zero auth mandate and recurring payment (using mandate_id)/.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario4-Zero auth mandates/Payments - Confirm mandate/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario4-Zero auth mandates/Payments - Create recurring/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario5-Create a mandate and recurring payment/Payments - Retrieve recurring/response.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario4-Zero auth mandates/Payments - Create mandate/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario4-Zero auth mandates/Payments - Confirm mandate/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6-Saved card flow/Payment methods - List and get token/response.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario4-Zero auth mandates/Payments - Create recurring/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario5-Create a mandate and recurring payment/Payments - Create recurring/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6-Saved card flow/Payments - Confirm first and save card/response.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario4-Zero auth mandates/Payments - Retrieve recurring/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6-Saved card flow/Payments - Confirm second and use saved card/response.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario5-Create a mandate and recurring payment/List payment methods for a Customer/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario4-Zero auth mandates/Payments - Create mandate/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6-Saved card flow/Payments - Create first/response.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario5-Create a mandate and recurring payment/Payments - Create mandate/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6-Saved card flow/Payments - Create second/response.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario5-Create a mandate and recurring payment/Payments - Create recurring/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment/Payments - External 3ds authentication/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6-Saved card flow/Payments - Retrieve/response.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario5-Create a mandate and recurring payment/Payments - Retrieve mandate/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Cancel/response.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6-Saved card flow/.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6-Saved card flow/Payment methods - List and get token/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6a-Create a mandate and recurring payment (using mandate_id)/.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario5-Create a mandate and recurring payment/Payments - Retrieve recurring/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6a-Create a mandate and recurring payment (using mandate_id)/Payments - Create/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Create/response.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6-Saved card flow/Payment methods - List and get token/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario5-Create a mandate and recurring payment/Payments - Retrieve mandate/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6a-Create a mandate and recurring payment (using mandate_id)/Payments - Retrieve/response.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6-Saved card flow/Payments - Confirm second and use saved card/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6a-Create a mandate and recurring payment (using mandate_id)/Recurring Payments - Create/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6a-Create a mandate and recurring payment (using mandate_id)/Recurring Payments - Create/response.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6-Saved card flow/Payments - Create first/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario5-Create a mandate and recurring payment/Payments - Retrieve recurring/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6a-Create a mandate and recurring payment (using mandate_id)/Recurring Payments - Retrieve/response.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6-Saved card flow/Payments - Create second/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6-Saved card flow/Payments - Retrieve/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Cancel/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario7-Save card flow/.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario7-Save card flow/List payment methods for a Customer/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario7-Save card flow/List payment methods for a Customer/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario7-Save card flow/List payment methods for a Customer/response.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario7-Save card flow/Payments - Create/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario7-Save card flow/Payments - Create/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario7-Save card flow/Payments - Create/response.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario7-Save card flow/Payments - Retrieve/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6-Saved card flow/Payments - Retrieve/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario7-Save card flow/Payments - Retrieve/response.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario7-Save card flow/Save card payments - Confirm/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6-Saved card flow/Payments - Confirm second and use saved card/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario7-Save card flow/Save card payments - Confirm/response.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario7-Save card flow/Save card payments - Create/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario7-Save card flow/Save card payments - Create/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario7-Save card flow/Save card payments - Create/response.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario7-Save card flow/Save card payments - Retrieve/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario7-Save card flow/Save card payments - Retrieve/event.prerequest.js", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario10-Create 3DS payment/Payments - Authorize request intent/request.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario7-Save card flow/Save card payments - Retrieve/response.json", "postman/collection-dir/archipel/Flow Testcases/Negative Cases/Scenario3-Create payment with Manual capture but wrong pan/.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Create/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario7-Void the payment/Payments - Create/event.prerequest.js", "postman/collection-dir/archipel/Flow Testcases/Negative Cases/Scenario3-Create payment with Manual capture but wrong pan/Payments - Capture/request.json", "postman/collection-dir/archipel/Flow Testcases/Negative Cases/Scenario3-Create payment with Manual capture but wrong pan/Payments - Capture/response.json", "postman/collection-dir/archipel/Flow Testcases/Negative Cases/Scenario6-Create a recurring payment with greater mandate amount/Payments - Confirm/request.json", "postman/collection-dir/archipel/Flow Testcases/QuickStart/.meta.json", "postman/collection-dir/archipel/Flow Testcases/QuickStart/3DS Authenticator - Configure/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/QuickStart/3DS Authenticator - Configure/request.json", "postman/collection-dir/archipel/Flow Testcases/QuickStart/3DS Authenticator - Configure/response.json", "postman/collection-dir/archipel/Flow Testcases/QuickStart/3DS Authenticator - Create/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/QuickStart/3DS Authenticator - Create/request.json", "postman/collection-dir/archipel/Flow Testcases/QuickStart/3DS Authenticator - Create/response.json", "postman/collection-dir/archipel/Flow Testcases/QuickStart/Connector Agnostic MIT - Enable/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/QuickStart/Connector Agnostic MIT - Enable/request.json", "postman/collection-dir/archipel/Flow Testcases/QuickStart/Connector Agnostic MIT - Enable/response.json", "postman/collection-dir/archipel/Flow Testcases/QuickStart/Merchant Account - Create/request.json", "postman/collection-dir/archipel/Flow Testcases/QuickStart/Payment Connector - Create/request.json", "postman/collection-dir/archipel/Netcetera Testcases/.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario7-Void the payment/.meta.json", "postman/collection-dir/archipel/Netcetera Testcases/Scenario1-Create 3DS payment with confirm true/Payments - Create/.event.meta.json", "postman/collection-dir/archipel/Netcetera Testcases/Scenario1-Create 3DS payment with confirm true/Payments - Create/request.json", "postman/collection-dir/archipel/Netcetera Testcases/Scenario1-Create 3DS payment with confirm true/Payments - Create/response.json", "postman/collection-dir/archipel/Netcetera Testcases/Scenario1-Create 3DS payment with confirm true/Payments - Retrieve/.event.meta.json", "postman/collection-dir/archipel/Netcetera Testcases/Scenario1-Create 3DS payment with confirm true/Payments - Retrieve/request.json", "postman/collection-dir/archipel/Netcetera Testcases/Scenario1-Create 3DS payment with confirm true/Payments - Retrieve/response.json", "postman/collection-dir/archipel/Netcetera Testcases/Scenario2-Create 3DS payment with confirm false/.meta.json", "postman/collection-dir/archipel/Netcetera Testcases/Scenario2-Create 3DS payment with confirm false/Payments - Confirm/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario6-Saved card flow/Payments - Confirm first and save card/request.json", "postman/collection-dir/archipel/Netcetera Testcases/Scenario2-Create 3DS payment with confirm false/Payments - Confirm/response.json", "postman/collection-dir/archipel/Netcetera Testcases/Scenario2-Create 3DS payment with confirm false/Payments - Create/.event.meta.json", "postman/collection-dir/archipel/Flow Testcases/Happy Cases/Scenario5-Create a mandate and recurring payment/Payments - Create mandate/request.json", "postman/collection-dir/archipel/Netcetera Testcases/Scenario2-Create 3DS payment with confirm false/Payments - Create/response.json", "postman/collection-dir/archipel/Netcetera Testcases/Scenario2-Create 3DS payment with confirm false/Payments - Retrieve/.event.meta.json", "postman/collection-dir/archipel/Netcetera Testcases/Scenario2-Create 3DS payment with confirm false/Payments - Retrieve/request.json", "postman/collection-dir/archipel/Netcetera Testcases/Scenario2-Create 3DS payment with confirm false/Payments - Retrieve/response.json", "postman/collection-dir/archipel/Netcetera Testcases/Scenario3-Create 3DS Frictionless payment with Visa/.meta.json", "postman/collection-dir/archipel/Netcetera Testcases/Scenario3-Create 3DS Frictionless payment with Visa/Payments - Create/.event.meta.json", "postman/collection-dir/archipel/Netcetera Testcases/Scenario3-Create 3DS Frictionless payment with Visa/Payments - Create/request.json", "postman/collection-dir/archipel/Netcetera Testcases/Scenario3-Create 3DS Frictionless payment with Visa/Payments - Create/response.json", "postman/collection-dir/archipel/Netcetera Testcases/Scenario3-Create 3DS Frictionless payment with Visa/Payments - Retrieve/.event.meta.json", "postman/collection-dir/archipel/Netcetera Testcases/Scenario3-Create 3DS Frictionless payment with Visa/Payments - Retrieve/request.json", "postman/collection-dir/archipel/Netcetera Testcases/Scenario3-Create 3DS Frictionless payment with Visa/Payments - Retrieve/response.json", "postman/collection-dir/archipel/Netcetera Testcases/Scenario4-Create 3DS Frictionless payment with Mastercard/.meta.json", "postman/collection-dir/archipel/Netcetera Testcases/Scenario4-Create 3DS Frictionless payment with Mastercard/Payments - Create/.event.meta.json", "postman/collection-dir/archipel/Netcetera Testcases/Scenario4-Create 3DS Frictionless payment with Mastercard/Payments - Create/request.json", "postman/collection-dir/archipel/Netcetera Testcases/Scenario4-Create 3DS Frictionless payment with Mastercard/Payments - Create/response.json", "postman/collection-dir/archipel/Netcetera Testcases/Scenario4-Create 3DS Frictionless payment with Mastercard/Payments - Retrieve/.event.meta.json", "postman/collection-dir/archipel/Netcetera Testcases/Scenario4-Create 3DS Frictionless payment with Mastercard/Payments - Retrieve/request.json", "postman/collection-dir/archipel/Netcetera Testcases/Scenario4-Create 3DS Frictionless payment with Mastercard/Payments - Retrieve/response.json", "postman/collection-dir/archipel/Netcetera Testcases/Scenario5-Create 3DS Challenge payment with Mastercard/.meta.json", "postman/collection-dir/archipel/Netcetera Testcases/Scenario5-Create 3DS Challenge payment with Mastercard/Payments - Create/.event.meta.json", "postman/collection-dir/archipel/Netcetera Testcases/Scenario5-Create 3DS Challenge payment with Mastercard/Payments - Create/request.json", "postman/collection-dir/archipel/Netcetera Testcases/Scenario5-Create 3DS Challenge payment with Mastercard/Payments - Create/response.json", "postman/collection-dir/archipel/Netcetera Testcases/Scenario5-Create 3DS Challenge payment with Mastercard/Payments - Retrieve/.event.meta.json", "postman/collection-dir/archipel/Netcetera Testcases/Scenario5-Create 3DS Challenge payment with Mastercard/Payments - Retrieve/request.json", "postman/collection-dir/archipel/Netcetera Testcases/Scenario5-Create 3DS Challenge payment with Mastercard/Payments - Retrieve/response.json"]}, "change_types": {"conditionals_added": 109}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
fix(connector): [CALIDA] Treat Bluecode as an alias for Calida
## 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 -->
Irrespective of what is sent in the connector field - be it `bluecode` or `calida`, it will be treated as `calida` at Hyperswitch's end. We would be sending back connector as `calida` in the response and the db it would also be saved as `calida`.
### 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).
-->
1. Did a MCA Create with connector as `bluecode`
cURL:
```
curl --location 'http://localhost:8080/account/merchant_1760414049/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_YHP399K9CO9cl7NYrdX1IN7uQq2CjPu7F7kmfnsjmfMfgIlrCVw94eHNmqfLsRHB' \
--data '{
"connector_type": "payment_processor",
"connector_name": "bluecode",
"connector_account_details": {
"auth_type": "HeaderKey",
"api_key": "API_KEY"
},
"test_mode": true,
"disabled": false,
"payment_methods_enabled": [
{
"payment_method": "wallet",
"payment_method_types": [
{
"payment_method_type": "bluecode",
"payment_experience": "redirect_to_url",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
}
],
"metadata": {
"shop_name": "c2c_bluecode"
},
"connector_webhook_details": {
"merchant_secret": "MERCHANT_SECRET"
},
"business_country": "US",
"business_label": "default"
}'
```
Response:
```
{
"connector_type": "payment_processor",
"connector_name": "calida",
"connector_label": "calida_US_default",
"merchant_connector_id": "mca_vliv3dhtLYGLErrem0iT",
"profile_id": "pro_lKqX6nAGkOWIYoATvkp4",
"connector_account_details": {
"auth_type": "HeaderKey",
"api_key": "API_KEY"
},
"payment_methods_enabled": [
{
"payment_method": "wallet",
"payment_method_types": [
{
"payment_method_type": "bluecode",
"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
}
]
}
],
"connector_webhook_details": {
"merchant_secret": "MERCHANT_SECRET",
"additional_secret": null
},
"metadata": {
"shop_name": "c2c_bluecode"
},
"test_mode": true,
"disabled": false,
"frm_configs": null,
"business_country": "US",
"business_label": "default",
"business_sub_label": null,
"applepay_verified_domains": null,
"pm_auth_config": null,
"status": "active",
"additional_merchant_data": null,
"connector_wallets_details": null
}
```
2. Payments Confirm - connector as `calida`
cURL:
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_YHP399K9CO9cl7NYrdX1IN7uQq2CjPu7F7kmfnsjmfMfgIlrCVw94eHNmqfLsRHB' \
--data '{
"amount": 1,
"connector": [
"calida"
],
"currency": "EUR",
"confirm": true,
"capture_method": "automatic",
"return_url": "https://duck.com",
"payment_method": "wallet",
"payment_method_type": "bluecode",
"payment_method_data": {
"wallet": {
"bluecode_redirect": {}
}
},
"billing": {
"address": {
"first_name": "joseph",
"last_name": "Doe",
"line1": "1467",
"city": "San Fransico",
"country": "AT",
"zip": "94122"
}
}
}'
```
Response:
```
{
"payment_id": "pay_DgFokH34l2gSThEGhOdl",
"merchant_id": "merchant_1760414049",
"status": "requires_customer_action",
"amount": 1,
"net_amount": 1,
"shipping_cost": null,
"amount_capturable": 1,
"amount_received": null,
"connector": "calida",
"client_secret": "pay_DgFokH34l2gSThEGhOdl_secret_SLNb0sD8WeRrpuEKGZ1Y",
"created": "2025-10-14T03:56:41.581Z",
"currency": "EUR",
"customer_id": null,
"customer": null,
"description": null,
"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": "wallet",
"payment_method_data": {
"wallet": {},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": {
"address": {
"city": "San Fransico",
"country": "AT",
"line1": "1467",
"line2": null,
"line3": null,
"zip": "94122",
"state": null,
"first_name": "joseph",
"last_name": "Doe",
"origin_zip": null
},
"phone": null,
"email": null
},
"order_details": null,
"email": null,
"name": null,
"phone": null,
"return_url": "https://duck.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": {
"type": "redirect_to_url",
"redirect_to_url": "http://localhost:8080/payments/redirect/pay_DgFokH34l2gSThEGhOdl/merchant_1760414049/pay_DgFokH34l2gSThEGhOdl_1"
},
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "bluecode",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": null,
"connector_transaction_id": "MQSM17LTY7ZHSB630Y7M",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": {
"redirect_response": null,
"search_tags": null,
"apple_pay_recurring_details": null,
"gateway_system": "direct"
},
"reference_id": "272HZ6IEESYCISY4QQYFWZRAX8",
"payment_link": null,
"profile_id": "pro_lKqX6nAGkOWIYoATvkp4",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_vliv3dhtLYGLErrem0iT",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-10-14T04:11:41.581Z",
"fingerprint": null,
"browser_info": null,
"payment_channel": null,
"payment_method_id": null,
"network_transaction_id": null,
"payment_method_status": null,
"updated": "2025-10-14T03:56:42.221Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"request_extended_authorization": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": null,
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null,
"enable_partial_authorization": null,
"enable_overcapture": null,
"is_overcapture_enabled": null,
"network_details": null,
"is_stored_credential": null,
"mit_category": null
}
```
3. Payments Confirm - connector as `bluecode`
cURL:
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_YHP399K9CO9cl7NYrdX1IN7uQq2CjPu7F7kmfnsjmfMfgIlrCVw94eHNmqfLsRHB' \
--data '{
"amount": 1,
"connector": [
"bluecode"
],
"currency": "EUR",
"confirm": true,
"capture_method": "automatic",
"return_url": "https://duck.com",
"payment_method": "wallet",
"payment_method_type": "bluecode",
"payment_method_data": {
"wallet": {
"bluecode_redirect": {}
}
},
"billing": {
"address": {
"first_name": "joseph",
"last_name": "Doe",
"line1": "1467",
"city": "San Fransico",
"country": "AT",
"zip": "94122"
}
}
}'
```
Response:
```
{
"payment_id": "pay_kq39H7WOuqaiBfXgjPrD",
"merchant_id": "merchant_1760414049",
"status": "requires_customer_action",
"amount": 1,
"net_amount": 1,
"shipping_cost": null,
"amount_capturable": 1,
"amount_received": null,
"connector": "calida",
"client_secret": "pay_kq39H7WOuqaiBfXgjPrD_secret_2x9JZ1R4EuFGxEWJAs3Z",
"created": "2025-10-14T04:16:00.671Z",
"currency": "EUR",
"customer_id": null,
"customer": null,
"description": null,
"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": "wallet",
"payment_method_data": {
"wallet": {},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": {
"address": {
"city": "San Fransico",
"country": "AT",
"line1": "1467",
"line2": null,
"line3": null,
"zip": "94122",
"state": null,
"first_name": "joseph",
"last_name": "Doe",
"origin_zip": null
},
"phone": null,
"email": null
},
"order_details": null,
"email": null,
"name": null,
"phone": null,
"return_url": "https://duck.com/",
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": {
"type": "redirect_to_url",
"redirect_to_url": "http://localhost:8080/payments/redirect/pay_kq39H7WOuqaiBfXgjPrD/merchant_1760414049/pay_kq39H7WOuqaiBfXgjPrD_1"
},
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "bluecode",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": null,
"connector_transaction_id": "YSC5CX1S0M5Y91J6NN9K",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": {
"redirect_response": null,
"search_tags": null,
"apple_pay_recurring_details": null,
"gateway_system": "direct"
},
"reference_id": "FGWAGOSXTT1JSXE9QYSKOWBW28",
"payment_link": null,
"profile_id": "pro_lKqX6nAGkOWIYoATvkp4",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_vliv3dhtLYGLErrem0iT",
"incremental_authorization_allowed": false,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-10-14T04:31:00.671Z",
"fingerprint": null,
"browser_info": null,
"payment_channel": null,
"payment_method_id": null,
"network_transaction_id": null,
"payment_method_status": null,
"updated": "2025-10-14T04:16:17.814Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"request_extended_authorization": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": null,
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null,
"enable_partial_authorization": null,
"enable_overcapture": null,
"is_overcapture_enabled": null,
"network_details": null,
"is_stored_credential": null,
"mit_category": null
}
```
3. Payments List API
cURL:
```
curl --location 'http://localhost:8080/payments/list' \
--header 'api-key: dev_STwP4Irz0UtygLUIrhGmi99S6U66vtIHrb6zaAz9RTCMpBOkLe2fX2Bsx88fldkX'
```
Response:
```
{
"size": 3,
"data": [
{
"payment_id": "pay_BZ3My6s7OH7pChhqvBT1",
"merchant_id": "merchant_1760440140",
"status": "requires_customer_action",
"amount": 1,
"net_amount": 1,
"shipping_cost": null,
"amount_capturable": 1,
"amount_received": null,
"connector": "calida",
"client_secret": "pay_BZ3My6s7OH7pChhqvBT1_secret_RHfWSfMExxeoh5GyHNn8",
"created": "2025-10-14T11:11:05.691Z",
"currency": "EUR",
"customer_id": null,
"customer": null,
"description": null,
"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": "wallet",
"payment_method_data": {
"wallet": {},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": {
"address": {
"city": "San Fransico",
"country": "AT",
"line1": "1467",
"line2": null,
"line3": null,
"zip": "94122",
"state": null,
"first_name": "joseph",
"last_name": "Doe",
"origin_zip": null
},
"phone": null,
"email": 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": "bluecode",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": null,
"connector_transaction_id": "MG69BXLRRQXVQZ7XR1FS",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_QaguXdnoNWFCJY0qwcAl",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_903iHOmrkXahbc9hPcK0",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": null,
"expires_on": null,
"fingerprint": null,
"browser_info": null,
"payment_channel": null,
"payment_method_id": null,
"network_transaction_id": null,
"payment_method_status": null,
"updated": null,
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"request_extended_authorization": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": null,
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null,
"enable_partial_authorization": null,
"enable_overcapture": null,
"is_overcapture_enabled": null,
"network_details": null,
"is_stored_credential": null,
"mit_category": null
},
{
"payment_id": "pay_hvb2UnMXqxA1MCEUqFG4",
"merchant_id": "merchant_1760440140",
"status": "requires_customer_action",
"amount": 1,
"net_amount": 1,
"shipping_cost": null,
"amount_capturable": 1,
"amount_received": null,
"connector": "calida",
"client_secret": "pay_hvb2UnMXqxA1MCEUqFG4_secret_O8rBTmsnHts3U7aur2Ez",
"created": "2025-10-14T11:10:24.547Z",
"currency": "EUR",
"customer_id": null,
"customer": null,
"description": null,
"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": "wallet",
"payment_method_data": {
"wallet": {},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": {
"address": {
"city": "San Fransico",
"country": "AT",
"line1": "1467",
"line2": null,
"line3": null,
"zip": "94122",
"state": null,
"first_name": "joseph",
"last_name": "Doe",
"origin_zip": null
},
"phone": null,
"email": 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": "bluecode",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": null,
"connector_transaction_id": "R6AY2NQBKMPK3CNV8144",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_QaguXdnoNWFCJY0qwcAl",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_903iHOmrkXahbc9hPcK0",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": null,
"expires_on": null,
"fingerprint": null,
"browser_info": null,
"payment_channel": null,
"payment_method_id": null,
"network_transaction_id": null,
"payment_method_status": null,
"updated": null,
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"request_extended_authorization": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": null,
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null,
"enable_partial_authorization": null,
"enable_overcapture": null,
"is_overcapture_enabled": null,
"network_details": null,
"is_stored_credential": null,
"mit_category": null
},
{
"payment_id": "pay_oUb1wIdeVTUqFSU0ayEk",
"merchant_id": "merchant_1760440140",
"status": "processing",
"amount": 1,
"net_amount": 1,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": null,
"connector": "calida",
"client_secret": "pay_oUb1wIdeVTUqFSU0ayEk_secret_mXRdZM3fGA6iPZKaWQAJ",
"created": "2025-10-14T11:09:49.143Z",
"currency": "EUR",
"customer_id": null,
"customer": null,
"description": null,
"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": "wallet",
"payment_method_data": {
"wallet": {},
"billing": null
},
"payment_token": null,
"shipping": null,
"billing": {
"address": {
"city": "San Fransico",
"country": "AT",
"line1": "1467",
"line2": null,
"line3": null,
"zip": "94122",
"state": null,
"first_name": "joseph",
"last_name": "Doe",
"origin_zip": null
},
"phone": null,
"email": null
},
"order_details": null,
"email": null,
"name": null,
"phone": null,
"return_url": null,
"authentication_type": null,
"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": "bluecode",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": null,
"manual_retry_allowed": null,
"connector_transaction_id": null,
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": null,
"payment_link": null,
"profile_id": "pro_QaguXdnoNWFCJY0qwcAl",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_903iHOmrkXahbc9hPcK0",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": null,
"expires_on": null,
"fingerprint": null,
"browser_info": null,
"payment_channel": null,
"payment_method_id": null,
"network_transaction_id": null,
"payment_method_status": null,
"updated": null,
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"request_extended_authorization": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": null,
"force_3ds_challenge": false,
"force_3ds_challenge_trigger": false,
"issuer_error_code": null,
"issuer_error_message": null,
"is_iframe_redirection_enabled": null,
"whole_connector_response": null,
"enable_partial_authorization": null,
"enable_overcapture": null,
"is_overcapture_enabled": null,
"network_details": null,
"is_stored_credential": null,
"mit_category": null
}
]
}
```
Check in DB in payments_attempt table the value of connector :
<img width="1242" height="153" alt="Screenshot 2025-10-14 at 4 44 15 PM" src="https://github.com/user-attachments/assets/89ce3371-3fca-4963-882b-b2e40efa201f" />
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. External Connector Integration**
- `crates/common_enums/src/connector_enums.rs`
- `crates/hyperswitch_connectors/src/connectors/calida.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (1 changes)
**Detailed Identifier Changes:**
Commit c563fbe1:
Files to modify:
**crates/common_enums/src/connector_enums.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/calida.rs**
Modify existing code
|
{"pr_number": 9817, "pr_title": "fix(connector): [CALIDA] Treat Bluecode as an alias for Calida", "merged_at": "2025-10-15T16:45:31Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"connectors": ["crates/common_enums/src/connector_enums.rs", "crates/hyperswitch_connectors/src/connectors/calida.rs"]}, "change_types": {"fields_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connector): [globalpay] address 5xx due to deserialization issue when `account_name` is not passed
## 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 address the 5xx that occurs with GlobalPay connector when the required field `account_name` is not passed during MCA creation.
Below migration needs to be run on hosted environments:
```sql
UPDATE merchant_connector_account
SET metadata = jsonb_set(
metadata,
'{account_name}',
'""',
true
)
WHERE connector_name = 'globalpay'
AND NOT metadata ? 'account_name';
```
### 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).
-->
Getting the connector production ready.
## 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)?
-->
<details>
<summary>0. try creating mca without passing `metadata` field</summary>
```curl
curl --location 'http://Localhost:8080/account/postman_merchant_GHAction_b7e0e1f4-ca0a-495e-8a6f-915769911e30/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data '{
"connector_type": "payment_processor",
"connector_name": "globalpay",
"connector_account_details": {
"auth_type": "BodyKey",
"api_key": "key",
"key1": "key1"
},
"test_mode": false,
"disabled": false,
"business_country": "US",
"business_label": "default",
"payment_methods_enabled": [
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "credit",
"card_networks": [
"Visa",
"Mastercard"
],
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "debit",
"card_networks": [
"Visa",
"Mastercard"
],
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "pay_later",
"payment_method_types": [
{
"payment_method_type": "klarna",
"payment_experience": "redirect_to_url",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "affirm",
"payment_experience": "redirect_to_url",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "afterpay_clearpay",
"payment_experience": "redirect_to_url",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "bank_redirect",
"payment_method_types": [
{
"payment_method_type": "ideal",
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "giropay",
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "sofort",
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "eps",
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "wallet",
"payment_method_types": [
{
"payment_method_type": "apple_pay",
"payment_experience": "invoke_sdk_client",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "google_pay",
"payment_experience": "invoke_sdk_client",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "paypal",
"payment_experience": "redirect_to_url",
"minimum_amount": 1,
"maximum_amount": 68607706,
"installment_payment_enabled": true,
"recurring_enabled": true
}
]
}
]
}'
```
```json
{
"error": {
"type": "invalid_request",
"message": "The metadata is invalid",
"code": "IR_06"
}
}
```
</details>
<details>
<summary>1. try creating mca with `metadata` field but different values</summary>
```curl
curl --location 'http://Localhost:8080/account/postman_merchant_GHAction_b7e0e1f4-ca0a-495e-8a6f-915769911e30/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data '{
"connector_type": "payment_processor",
"connector_name": "globalpay",
"connector_account_details": {
"auth_type": "BodyKey",
"api_key": "key",
"key1": "key1"
},
"test_mode": false,
"disabled": false,
"business_country": "US",
"business_label": "default",
"payment_methods_enabled": [
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "credit",
"card_networks": [
"Visa",
"Mastercard"
],
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "debit",
"card_networks": [
"Visa",
"Mastercard"
],
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "pay_later",
"payment_method_types": [
{
"payment_method_type": "klarna",
"payment_experience": "redirect_to_url",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "affirm",
"payment_experience": "redirect_to_url",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "afterpay_clearpay",
"payment_experience": "redirect_to_url",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "bank_redirect",
"payment_method_types": [
{
"payment_method_type": "ideal",
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "giropay",
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "sofort",
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "eps",
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "wallet",
"payment_method_types": [
{
"payment_method_type": "apple_pay",
"payment_experience": "invoke_sdk_client",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "google_pay",
"payment_experience": "invoke_sdk_client",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "paypal",
"payment_experience": "redirect_to_url",
"minimum_amount": 1,
"maximum_amount": 68607706,
"installment_payment_enabled": true,
"recurring_enabled": true
}
]
}
]
,
"metadata": {
"city": "NY",
"unit": "245"
}
}'
```
```json
{
"error": {
"type": "invalid_request",
"message": "The metadata is invalid",
"code": "IR_06"
}
}
```
</details>
<details>
<summary>2. try creating mca with `metadata` field with valid values</summary>
```curl
curl --location 'http://Localhost:8080/account/postman_merchant_GHAction_b7e0e1f4-ca0a-495e-8a6f-915769911e30/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data '{
"connector_type": "payment_processor",
"connector_name": "globalpay",
"connector_account_details": {
"auth_type": "BodyKey",
"api_key": "key",
"key1": "key11"
},
"test_mode": false,
"disabled": false,
"business_country": "US",
"business_label": "default",
"payment_methods_enabled": [
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "credit",
"card_networks": [
"Visa",
"Mastercard"
],
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "debit",
"card_networks": [
"Visa",
"Mastercard"
],
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "pay_later",
"payment_method_types": [
{
"payment_method_type": "klarna",
"payment_experience": "redirect_to_url",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "affirm",
"payment_experience": "redirect_to_url",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "afterpay_clearpay",
"payment_experience": "redirect_to_url",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "bank_redirect",
"payment_method_types": [
{
"payment_method_type": "ideal",
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "giropay",
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "sofort",
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "eps",
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "wallet",
"payment_method_types": [
{
"payment_method_type": "apple_pay",
"payment_experience": "invoke_sdk_client",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "google_pay",
"payment_experience": "invoke_sdk_client",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "paypal",
"payment_experience": "redirect_to_url",
"minimum_amount": 1,
"maximum_amount": 68607706,
"installment_payment_enabled": true,
"recurring_enabled": true
}
]
}
],
"metadata": {
"account_name": "transaction_processing"
}
}'
```
```json
{
"connector_type": "payment_processor",
"connector_name": "globalpay",
"connector_label": "globalpay_US_default",
"merchant_connector_id": "mca_lZZrlORyN0n7fuQpEgKz",
"profile_id": "pro_cKEsY4S7wK3izgeOFXhw",
"connector_account_details": {
"auth_type": "BodyKey",
"api_key": "****************",
"key1": "********************************"
},
"payment_methods_enabled": [
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "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_type": "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": "pay_later",
"payment_method_types": [
{
"payment_method_type": "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_type": "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_type": "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": "bank_redirect",
"payment_method_types": [
{
"payment_method_type": "ideal",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": null,
"maximum_amount": null,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "giropay",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": null,
"maximum_amount": null,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "sofort",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": null,
"maximum_amount": null,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "eps",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": null,
"maximum_amount": null,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "wallet",
"payment_method_types": [
{
"payment_method_type": "apple_pay",
"payment_experience": "invoke_sdk_client",
"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": "google_pay",
"payment_experience": "invoke_sdk_client",
"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": "paypal",
"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
}
]
}
],
"connector_webhook_details": null,
"metadata": {
"account_name": "transaction_processing"
},
"test_mode": false,
"disabled": false,
"frm_configs": null,
"business_country": "US",
"business_label": "default",
"business_sub_label": null,
"applepay_verified_domains": null,
"pm_auth_config": null,
"status": "active",
"additional_merchant_data": null,
"connector_wallets_details": null
}
```
</details>
<details>
<summary>3. try creating mca with `metadata` field with valid values and additional values like certs</summary>
```curl
curl --location 'http://Localhost:8080/account/postman_merchant_GHAction_798f9222-9a5f-4cb3-8e61-3ae4c576b6b9/connectors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: test_admin' \
--data '{
"connector_type": "payment_processor",
"connector_name": "globalpay",
"connector_account_details": {
"auth_type": "BodyKey",
"api_key": "key",
"key1": "key1"
},
"test_mode": false,
"disabled": false,
"business_country": "US",
"business_label": "default",
"payment_methods_enabled": [
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "credit",
"card_networks": [
"Visa",
"Mastercard"
],
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "debit",
"card_networks": [
"Visa",
"Mastercard"
],
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "pay_later",
"payment_method_types": [
{
"payment_method_type": "klarna",
"payment_experience": "redirect_to_url",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "affirm",
"payment_experience": "redirect_to_url",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "afterpay_clearpay",
"payment_experience": "redirect_to_url",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "bank_redirect",
"payment_method_types": [
{
"payment_method_type": "ideal",
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "giropay",
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "sofort",
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "eps",
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "wallet",
"payment_method_types": [
{
"payment_method_type": "apple_pay",
"payment_experience": "invoke_sdk_client",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "google_pay",
"payment_experience": "invoke_sdk_client",
"minimum_amount": 1,
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "paypal",
"payment_experience": "redirect_to_url",
"minimum_amount": 1,
"maximum_amount": 68607706,
"installment_payment_enabled": true,
"recurring_enabled": true
}
]
}
],
"metadata": {
"account_name": "transaction_processing"
,
"google_pay": {
"allowed_payment_methods": [
{
"type": "CARD",
"parameters": {
"allowed_auth_methods": [
"PAN_ONLY",
"CRYPTOGRAM_3DS"
],
"allowed_card_networks": [
"AMEX",
"DISCOVER",
"INTERAC",
"JCB",
"MASTERCARD",
"VISA"
]
},
"tokenization_specification": {
"type": "PAYMENT_GATEWAY",
"parameters": {
"gateway": "example",
"gateway_merchant_id": "22956"
}
}
}
],
"merchant_info": {
"merchant_name": "Narayan Bhat"
}
}
}
}'
```
```json
{
"connector_type": "payment_processor",
"connector_name": "globalpay",
"connector_label": "globalpay_US_default",
"merchant_connector_id": "mca_a45nhudvFQkdJeOTrJqd",
"profile_id": "pro_zdAl1MuX7MuMUsGzlRZw",
"connector_account_details": {
"auth_type": "BodyKey",
"api_key": "****************",
"key1": "********************************"
},
"payment_methods_enabled": [
{
"payment_method": "card",
"payment_method_types": [
{
"payment_method_type": "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_type": "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": "pay_later",
"payment_method_types": [
{
"payment_method_type": "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_type": "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_type": "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": "bank_redirect",
"payment_method_types": [
{
"payment_method_type": "ideal",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": null,
"maximum_amount": null,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "giropay",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": null,
"maximum_amount": null,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "sofort",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": null,
"maximum_amount": null,
"recurring_enabled": true,
"installment_payment_enabled": true
},
{
"payment_method_type": "eps",
"payment_experience": null,
"card_networks": null,
"accepted_currencies": null,
"accepted_countries": null,
"minimum_amount": null,
"maximum_amount": null,
"recurring_enabled": true,
"installment_payment_enabled": true
}
]
},
{
"payment_method": "wallet",
"payment_method_types": [
{
"payment_method_type": "apple_pay",
"payment_experience": "invoke_sdk_client",
"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": "google_pay",
"payment_experience": "invoke_sdk_client",
"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": "paypal",
"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
}
]
}
],
"connector_webhook_details": null,
"metadata": {
"google_pay": {
"merchant_info": {
"merchant_name": "Narayan Bhat"
},
"allowed_payment_methods": [
{
"type": "CARD",
"parameters": {
"allowed_auth_methods": [
"PAN_ONLY",
"CRYPTOGRAM_3DS"
],
"allowed_card_networks": [
"AMEX",
"DISCOVER",
"INTERAC",
"JCB",
"MASTERCARD",
"VISA"
]
},
"tokenization_specification": {
"type": "PAYMENT_GATEWAY",
"parameters": {
"gateway": "example",
"gateway_merchant_id": "22956"
}
}
}
]
},
"account_name": "transaction_processing"
},
"test_mode": false,
"disabled": false,
"frm_configs": null,
"business_country": "US",
"business_label": "default",
"business_sub_label": null,
"applepay_verified_domains": null,
"pm_auth_config": null,
"status": "active",
"additional_merchant_data": null,
"connector_wallets_details": null
}
```
</details>
<details>
<summary>4. tried making a payment</summary>
```curl
curl --location 'http://Localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_8jOdTW9kwO9a50lrA8OfxY6m0iDGOhjpi2BJseJtaCU9xFz5YR6ROHuKYCeiTuz7' \
--data-raw '{
"amount": 1000,
"currency": "EUR",
"confirm": true,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 1000,
"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://google.com",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "4263970000005262",
"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": "PiX"
}
},
"shipping": {
"address": {
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"city": "San Fransico",
"state": "California",
"zip": "94122",
"country": "US",
"first_name": "PiX"
}
}
}'
```
```json
{
"payment_id": "pay_APA4HDesgk5NntotYd5P",
"merchant_id": "postman_merchant_GHAction_798f9222-9a5f-4cb3-8e61-3ae4c576b6b9",
"status": "succeeded",
"amount": 1000,
"net_amount": 1000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 1000,
"connector": "globalpay",
"client_secret": "pay_APA4HDesgk5NntotYd5P_secret_VLhRFg5ApKxEhnzxQbho",
"created": "2025-03-17T17:25:53.489Z",
"currency": "EUR",
"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": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "card",
"payment_method_data": {
"card": {
"last4": "5262",
"card_type": null,
"card_network": null,
"card_issuer": null,
"card_issuing_country": null,
"card_isin": "426397",
"card_extended_bin": null,
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"payment_checks": null,
"authentication_data": 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": "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": "abcdef123@gmail.com",
"name": "John Doe",
"phone": "999999999",
"return_url": "https://google.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": "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": 1742232353,
"expires": 1742235953,
"secret": "epk_84c190a7359d4428a18118725e659805"
},
"manual_retry_allowed": false,
"connector_transaction_id": "TRN_aQvML8KHNMNMhOv3OHBZhO3hK3xQXC_5NntotYd5P_1",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pay_APA4HDesgk5NntotYd5P_1",
"payment_link": null,
"profile_id": "pro_zdAl1MuX7MuMUsGzlRZw",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_a45nhudvFQkdJeOTrJqd",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-03-17T17:40:53.489Z",
"fingerprint": null,
"browser_info": null,
"payment_method_id": null,
"payment_method_status": null,
"updated": "2025-03-17T17:25:55.934Z",
"split_payments": null,
"frm_metadata": null,
"extended_authorization_applied": null,
"capture_before": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null,
"card_discovery": "manual"
}
```
</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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/admin.rs`
**2. External Connector Integration**
- `crates/hyperswitch_connectors/src/connectors/globalpay/transformers.rs`
**Code Patterns Applied:**
- Implement new functions (1 changes)
- Extend existing types with new fields (1 changes)
**Detailed Identifier Changes:**
Commit 451d1931:
Files to modify:
**crates/hyperswitch_connectors/src/connectors/globalpay/transformers.rs**
Add:
- function: private::try_from
- impl: impl TryFrom<&Option<pii::SecretSerdeValue>> for GlobalPayMeta
**crates/router/src/core/admin.rs**
Modify existing code
|
{"pr_number": 7540, "pr_title": "fix(connector): [globalpay] address 5xx due to deserialization issue when `account_name` is not passed", "merged_at": "2025-03-24T08:23:52Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"core_business": ["crates/router/src/core/admin.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/globalpay/transformers.rs"]}, "change_types": {"functions_added": 1, "fields_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
fix(connector): Update mandate PMT configs for Mandate Supported Connectors
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [x] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
<!-- Describe your changes in detail -->
### Additional Changes
- [ ] This PR modifies the API contract
- [ ] 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 it is an obvious bug or documentation fix
that will have little conversation).
-->
This PR is a hot fix for the [PR](https://github.com/juspay/hyperswitch/pull/6903/)
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Tests**
- `config/deployments/integration_test.toml`
- `loadtest/config/development.toml`
**2. Configuration Files**
- `config/deployments/production.toml`
- `config/deployments/sandbox.toml`
- `config/development.toml`
|
{"pr_number": 6910, "pr_title": "fix(connector): Update mandate PMT configs for Mandate Supported Connectors", "merged_at": "2024-12-20T12:09:28Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"tests": ["config/deployments/integration_test.toml", "loadtest/config/development.toml"], "config": ["config/deployments/production.toml", "config/deployments/sandbox.toml", "config/development.toml"]}, "change_types": {}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
feat(router): add adyen split payments support
## 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 adds, adyen split payment support.
Changes taken up in this PR
1. Add adyen split request to PaymentRequest
```
"split_payments": {
"adyen_split_payment": {
"store": "4935y84385736",
"split_items": [{
"split_type": "BalanceAccount",
"amount": 900,
"account": "*********",
"reference":"7823648726",
"description": "adyen split test"
},
{
"split_type": "Commission",
"amount": 100,
"account": "************",
"reference":"7823648726",
"description": "adyen split test"
}]
}
},
```
2. Add adyen split payment response to PaymentsResponse
```
"split_payments": {
"AdyenSplitPayment": {
"store": "4935y84385736",
"split_items": [
{
"amount": 900,
"split_type": "BalanceAccount",
"account": "*****************",
"reference": "7823648726",
"description": "adyen split test"
},
{
"amount": 100,
"split_type": "Commission",
"account": "**************",
"reference": "7823648726",
"description": "adyen split test"
}
]
}
},
```
3. Add charges object to PaymentAttempt table
-> For stripe split payments
```
{"StripeSplitPayment": {"charge_id": "ch_3Qjb8SIVaesDjvMP2WsSoedi", "charge_type": "destination", "application_fees": 100, "transfer_account_id": "*****"}}
```
-> For Adyen split payments
```
{"AdyenSplitPayment": {"store": "4935y84385736", "split_items": [{"amount": 900, "account": "**********", "reference": "7823648726", "split_type": "BalanceAccount", "description": "adyen split test"}, {"amount": 100, "account": "***********", "reference": "7823648726", "split_type": "Commission", "description": "adyen split test"}]}}
```
4. Remove `charge_id` from payment_attempt_new
5. Remove `charge_id` `PaymentAttempt::ResponseUpdate` and `PaymentAttempt::ConnectorResponse`
### Additional Changes
- [x] This PR modifies the API contract
- [x] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
## 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)?
-->
> Note: Adyen split payment cannot be tested. As it has to be enabled by adyen.
Sanity tests
1. Create a split payment with stripe
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_cYluhoyneX1Ox3L8Ayl8Q6zwBvgClrsqBa74tgM7amPSCNlkQ8NMaSFto6jNeDRl' \
--data-raw '{
"amount": 1000,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"customer_id": "cust_no_pm",
"authentication_type": "no_three_ds",
"email": "guest@example.com",
"payment_method": "card",
"payment_method_type": "debit",
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "03",
"card_exp_year": "30",
"card_holder_name": "joseph Doe",
"card_cvc": "737"
}
},
"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"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"split_payments": {
"stripe_split_payment": {
"charge_type": "destination",
"application_fees": 100,
"transfer_account_id": "************"
}
},
"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"
},
"customer_acceptance": {
"acceptance_type": "online",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "127.0.0.1",
"user_agent": "amet irure esse"
}
},
"setup_future_usage": "on_session"
}'
```
Response
```
{
"payment_id": "pay_EFGfA344K1grbrlOjYM6",
"merchant_id": "postman_merchant_GHAction_18b47f97-bc18-4ee5-9482-027410bdbbb0",
"status": "succeeded",
"amount": 1000,
"net_amount": 1000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 1000,
"connector": "stripe",
"client_secret": "pay_EFGfA344K1grbrlOjYM6_secret_AkcUZ7QHdI8PAO7hIQhG",
"created": "2025-01-21T07:06:51.643Z",
"currency": "USD",
"customer_id": "cust_no_pm",
"customer": {
"id": "cust_no_pm",
"name": null,
"email": "guest@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": "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": "joseph Doe",
"payment_checks": {
"cvc_check": "pass",
"address_line1_check": "pass",
"address_postal_code_check": "pass"
},
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": 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": 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": "debit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "cust_no_pm",
"created_at": 1737443211,
"expires": 1737446811,
"secret": "epk_e713b43b065a4203bf10e1bfbf7387da"
},
"manual_retry_allowed": false,
"connector_transaction_id": "pi_3QjbY0IVaesDjvMP0eJ9xBzq",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pi_3QjbY0IVaesDjvMP0eJ9xBzq",
"payment_link": null,
"profile_id": "pro_HoToufDVbGWNz1DJJNCQ",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_8eCyKFFWISlH6t1VAnz0",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-01-21T07:21:51.643Z",
"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": "2025-01-21T07:06:53.776Z",
"split_payments": {
"StripeSplitPayment": {
"charge_id": "ch_3QjbY0IVaesDjvMP08wX05tt",
"charge_type": "destination",
"application_fees": 100,
"transfer_account_id": "*****"
}
},
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
Payment Sync
```
curl --location 'http://localhost:8080/payments/pay_EFGfA344K1grbrlOjYM6?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_cYluhoyneX1Ox3L8Ayl8Q6zwBvgClrsqBa74tgM7amPSCNlkQ8NMaSFto6jNeDRl'
```
Response
```
{
"payment_id": "pay_EFGfA344K1grbrlOjYM6",
"merchant_id": "postman_merchant_GHAction_18b47f97-bc18-4ee5-9482-027410bdbbb0",
"status": "succeeded",
"amount": 1000,
"net_amount": 1000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 1000,
"connector": "stripe",
"client_secret": "pay_EFGfA344K1grbrlOjYM6_secret_AkcUZ7QHdI8PAO7hIQhG",
"created": "2025-01-21T07:06:51.643Z",
"currency": "USD",
"customer_id": "cust_no_pm",
"customer": {
"id": "cust_no_pm",
"name": null,
"email": "guest@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": "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": "joseph Doe",
"payment_checks": {
"cvc_check": "pass",
"address_line1_check": "pass",
"address_postal_code_check": "pass"
},
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": 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": 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": "debit",
"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_3QjbY0IVaesDjvMP0eJ9xBzq",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pi_3QjbY0IVaesDjvMP0eJ9xBzq",
"payment_link": null,
"profile_id": "pro_HoToufDVbGWNz1DJJNCQ",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_8eCyKFFWISlH6t1VAnz0",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-01-21T07:21:51.643Z",
"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": "pm_QI9gKH9qjNIjdJmQW3UW",
"payment_method_status": "active",
"updated": "2025-01-21T07:06:53.776Z",
"split_payments": {
"StripeSplitPayment": {
"charge_id": "ch_3QjbY0IVaesDjvMP08wX05tt",
"charge_type": "destination",
"application_fees": 100,
"transfer_account_id": "******"
}
},
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
Create Refund
```
curl --location 'http://localhost:8080/refunds' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_cYluhoyneX1Ox3L8Ayl8Q6zwBvgClrsqBa74tgM7amPSCNlkQ8NMaSFto6jNeDRl' \
--data '{
"payment_id": "pay_EFGfA344K1grbrlOjYM6",
"amount": 1000,
"reason": "Customer returned product",
"refund_type": "instant",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"split_refunds": {
"stripe_split_refund": {
"revert_platform_fee": true,
"revert_transfer": true
}
}
}'
```
Response
```
{
"refund_id": "ref_kkylIvnJr2eG2x4IWr0x",
"payment_id": "pay_EFGfA344K1grbrlOjYM6",
"amount": 1000,
"currency": "USD",
"status": "succeeded",
"reason": "Customer returned product",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"error_message": null,
"error_code": null,
"created_at": "2025-01-21T07:10:29.920Z",
"updated_at": "2025-01-21T07:10:32.627Z",
"connector": "stripe",
"profile_id": "pro_HoToufDVbGWNz1DJJNCQ",
"merchant_connector_id": "mca_8eCyKFFWISlH6t1VAnz0",
"split_refunds": {
"stripe_split_refund": {
"revert_platform_fee": true,
"revert_transfer": true
}
}
}
```
Refund Sync
```
curl --location 'http://localhost:8080/refunds/ref_kkylIvnJr2eG2x4IWr0x' \
--header 'Accept: application/json' \
--header 'api-key: dev_cYluhoyneX1Ox3L8Ayl8Q6zwBvgClrsqBa74tgM7amPSCNlkQ8NMaSFto6jNeDRl'
```
Response
```
{
"refund_id": "ref_kkylIvnJr2eG2x4IWr0x",
"payment_id": "pay_EFGfA344K1grbrlOjYM6",
"amount": 1000,
"currency": "USD",
"status": "succeeded",
"reason": "Customer returned product",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"error_message": null,
"error_code": null,
"created_at": "2025-01-21T07:10:29.920Z",
"updated_at": "2025-01-21T07:10:32.627Z",
"connector": "stripe",
"profile_id": "pro_HoToufDVbGWNz1DJJNCQ",
"merchant_connector_id": "mca_8eCyKFFWISlH6t1VAnz0",
"split_refunds": {
"stripe_split_refund": {
"revert_platform_fee": true,
"revert_transfer": true
}
}
}
```
Compatibility Test
Make a payment, storing the charge_id in payment intent (current main)
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_YI6n70QC5t9CBpD1LmASdS9RTvvVz0OjKyn9EO6ylzMntKEItV5O1MgvGd4739bo' \
--data-raw '{
"amount": 1000,
"currency": "USD",
"confirm": true,
"capture_method": "automatic",
"customer_id": "cust_no_pm",
"authentication_type": "no_three_ds",
"email": "guest@example.com",
"payment_method": "card",
"payment_method_type": "debit",
"payment_method_data": {
"card": {
"card_number": "4242424242424242",
"card_exp_month": "03",
"card_exp_year": "30",
"card_holder_name": "joseph Doe",
"card_cvc": "737"
}
},
"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"
},
"phone": {
"number": "8056594427",
"country_code": "+91"
}
},
"split_payments": {
"stripe_split_payment": {
"charge_type": "destination",
"application_fees": 100,
"transfer_account_id": "acct_1PfKWLROW2XALwca"
}
},
"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"
},
"customer_acceptance": {
"acceptance_type": "online",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "127.0.0.1",
"user_agent": "amet irure esse"
}
},
"setup_future_usage": "on_session"
}'
```
Response
```
{
"payment_id": "pay_fLYwcRo7ZgkknSNd23ej",
"merchant_id": "postman_merchant_GHAction_c0d9d70c-412c-41aa-b196-b13fcd3fd4d4",
"status": "succeeded",
"amount": 1000,
"net_amount": 1000,
"shipping_cost": null,
"amount_capturable": 0,
"amount_received": 1000,
"connector": "stripe",
"client_secret": "pay_fLYwcRo7ZgkknSNd23ej_secret_2CkUo80sKK4i9cMfHMlU",
"created": "2025-01-28T10:42:34.741Z",
"currency": "USD",
"customer_id": "cust_no_pm",
"customer": {
"id": "cust_no_pm",
"name": null,
"email": "guest@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": "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": "joseph Doe",
"payment_checks": {
"cvc_check": "pass",
"address_line1_check": "pass",
"address_postal_code_check": "pass"
},
"authentication_data": null
},
"billing": null
},
"payment_token": null,
"shipping": 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": 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": "debit",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "cust_no_pm",
"created_at": 1738060954,
"expires": 1738064554,
"secret": "epk_1bc403b8712c4b90aa8f1afb835e17e0"
},
"manual_retry_allowed": false,
"connector_transaction_id": "pi_3QmCFbIVaesDjvMP2tujkeNv",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pi_3QmCFbIVaesDjvMP2tujkeNv",
"payment_link": null,
"profile_id": "pro_cPPonA2IgvSNz8qCQpQK",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_02JJmlfo1vAxElLj4zxh",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2025-01-28T10:57:34.741Z",
"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": "2025-01-28T10:42:37.813Z",
"split_payments": {
"stripe_split_payment": {
"charge_id": "ch_3QmCFbIVaesDjvMP2CoW9ggX",
"charge_type": "destination",
"application_fees": 100,
"transfer_account_id": "acct_1PfKWLROW2XALwca"
}
},
"frm_metadata": null,
"merchant_order_reference_id": null,
"order_tax_amount": null,
"connector_mandate_id": null
}
```
Refund using the current version
```
curl --location 'http://localhost:8080/refunds' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_YI6n70QC5t9CBpD1LmASdS9RTvvVz0OjKyn9EO6ylzMntKEItV5O1MgvGd4739bo' \
--data '{
"payment_id": "pay_fLYwcRo7ZgkknSNd23ej",
"amount": 900,
"reason": "Customer returned product",
"refund_type": "instant",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"split_refunds": {
"stripe_split_refund": {
"revert_platform_fee": true,
"revert_transfer": true
}
}
}'
```
Response
```
{
"refund_id": "ref_Zo15sSj608ssWDp48CCR",
"payment_id": "pay_fLYwcRo7ZgkknSNd23ej",
"amount": 900,
"currency": "USD",
"status": "succeeded",
"reason": "Customer returned product",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
},
"error_message": null,
"error_code": null,
"unified_code": null,
"unified_message": null,
"created_at": "2025-01-28T10:57:52.930Z",
"updated_at": "2025-01-28T10:57:55.762Z",
"connector": "stripe",
"profile_id": "pro_cPPonA2IgvSNz8qCQpQK",
"merchant_connector_id": "mca_02JJmlfo1vAxElLj4zxh",
"split_refunds": {
"stripe_split_refund": {
"revert_platform_fee": true,
"revert_transfer": true
}
}
}
```
This issue already exists and is tracked at [https://github.com/juspay/hyperswitch-cloud/issues/8373](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-sandbox/workbench/workbench.html). It was not caused by this PR.
## 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
|
To implement this **payment** feature, you'll need to modify these architectural layers:
**1. API Request/Response Models**
- `crates/api_models/src/payments.rs`
**2. Database Layer (Queries & Schema)**
- `crates/diesel_models/src/payment_attempt.rs`
- `crates/diesel_models/src/schema.rs`
- `crates/diesel_models/src/schema_v2.rs`
- ... and 1 more files
**3. Domain Models (Business Logic Types)**
- `crates/hyperswitch_domain_models/src/payments/payment_attempt.rs`
- `crates/hyperswitch_domain_models/src/router_data.rs`
- `crates/hyperswitch_domain_models/src/router_request_types.rs`
- ... and 1 more files
**4. Core Business Logic**
- `crates/router/src/core/payments/helpers.rs`
- `crates/router/src/core/payments/operations/payment_create.rs`
- `crates/router/src/core/payments/operations/payment_response.rs`
- ... and 6 more files
**5. External Connector Integration**
- `connector-template/transformers.rs`
- `crates/hyperswitch_connectors/src/connectors/aci/transformers.rs`
- `crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs`
- ... and 82 more files
**6. Type Definitions**
- `crates/common_types/src/domain.rs`
- `crates/common_types/src/lib.rs`
- `crates/common_types/src/payments.rs`
- ... and 2 more files
**7. Other**
- `api-reference-v2/openapi_spec.json`
- `api-reference/openapi_spec.json`
- `crates/common_enums/src/enums.rs`
- ... and 8 more files
**Code Patterns Applied:**
- Define new data structures (5 changes)
- Implement new functions (13 changes)
- Extend existing types with new fields (368 changes)
- Add conditional logic for feature flags or filtering (23 changes)
- Modify database queries (1 changes)
**Detailed Identifier Changes:**
Commit 323d7630:
Files to modify:
**connector-template/transformers.rs**
Modify existing code
**crates/api_models/src/payments.rs**
Remove:
- struct: pub::StripeSplitPaymentsResponse
- enum: pub::SplitPaymentsResponse
**crates/common_enums/src/enums.rs**
Add:
- enum: pub::AdyenSplitType
**crates/common_types/src/domain.rs**
Add:
- struct: pub::AdyenSplitData
- struct: pub::AdyenSplitItem
**crates/common_types/src/lib.rs**
Add:
- mod: pub::domain
**crates/common_types/src/payments.rs**
Remove:
- struct: pub::StripeSplitPaymentRequest
Add:
- struct: pub::StripeSplitPaymentRequest
- struct: pub::StripeChargeResponseData
- enum: pub::ConnectorChargeResponseData
**crates/common_types/src/refunds.rs**
Modify existing code
**crates/diesel_models/src/payment_attempt.rs**
Modify existing code
**crates/diesel_models/src/schema.rs**
Modify existing code
**crates/diesel_models/src/schema_v2.rs**
Modify existing code
**crates/diesel_models/src/user/sample_data.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/aci/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/amazonpay/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/bambora/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/bamboraapac/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/billwerk/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/bitpay/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/bluesnap.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/boku/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/cashtocode/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/coinbase/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/coingate/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/cryptopay/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/datatrans/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/digitalvirgo/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/dlocal/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/elavon/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/fiserv/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/fiservemea/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/forte/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/globalpay/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/helcim/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/iatapay/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/inespay/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/itaubank/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/jpmorgan/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/klarna/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/mollie/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/nomupay/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/paybox/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/payeezy/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/payu/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/placetopay/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/powertranz/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/prophetpay/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/rapyd/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/razorpay/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/square/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/stax/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/thunes/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/tsys/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/volt/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/worldline/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/worldpay.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/xendit/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/zen/transformers.rs**
Modify existing code
**crates/hyperswitch_connectors/src/connectors/zsl/transformers.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/payments/payment_attempt.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_data.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_request_types.rs**
Modify existing code
**crates/hyperswitch_domain_models/src/router_response_types.rs**
Modify existing code
**crates/openapi/src/openapi.rs**
Modify existing code
**crates/openapi/src/openapi_v2.rs**
Modify existing code
**crates/router/src/connector/adyen/transformers.rs**
Add:
- function: private::get_adyen_split_request
- function: private::construct_charge_response
- struct: private::AdyenSplitData
**crates/router/src/connector/authorizedotnet/transformers.rs**
Modify existing code
**crates/router/src/connector/checkout/transformers.rs**
Modify existing code
**crates/router/src/connector/dummyconnector/transformers.rs**
Modify existing code
**crates/router/src/connector/nmi/transformers.rs**
Modify existing code
**crates/router/src/connector/noon/transformers.rs**
Modify existing code
**crates/router/src/connector/opayo/transformers.rs**
Modify existing code
**crates/router/src/connector/opennode/transformers.rs**
Modify existing code
**crates/router/src/connector/payme/transformers.rs**
Modify existing code
**crates/router/src/connector/paypal.rs**
Modify existing code
**crates/router/src/connector/paypal/transformers.rs**
Modify existing code
**crates/router/src/connector/plaid/transformers.rs**
Modify existing code
**crates/router/src/connector/stripe.rs**
Modify existing code
**crates/router/src/connector/stripe/transformers.rs**
Add:
- function: pub::construct_charge_response
**crates/router/src/connector/trustpay/transformers.rs**
Modify existing code
**crates/router/src/connector/utils.rs**
Add:
- function: private::get_split_payment_data
- function: private::get_split_payment_data
- function: private::get_split_payment_data
- function: private::get_split_payment_data
- function: private::get_split_payment_data
- trait: pub::SplitPaymentData
- impl: impl SplitPaymentData for types::PaymentsCaptureData
- impl: impl SplitPaymentData for types::PaymentsAuthorizeData
- impl: impl SplitPaymentData for types::PaymentsSyncData
- impl: impl SplitPaymentData for PaymentsCancelData
- impl: impl SplitPaymentData for types::SetupMandateRequestData
**crates/router/src/connector/wellsfargopayout/transformers.rs**
Modify existing code
**crates/router/src/core/payments/helpers.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_create.rs**
Modify existing code
**crates/router/src/core/payments/operations/payment_response.rs**
Modify existing code
**crates/router/src/core/payments/retry.rs**
Modify existing code
**crates/router/src/core/payments/transformers.rs**
Modify existing code
**crates/router/src/core/refunds.rs**
Modify existing code
**crates/router/src/core/refunds/transformers.rs**
Remove:
- function: private::try_from
- impl: impl TryFrom<SplitRefundInput> for router_request_types::SplitRefundsRequest
**crates/router/src/core/refunds/validator.rs**
Modify existing code
**crates/router/src/core/utils.rs**
Add:
- function: pub::get_split_refunds
**crates/router/src/types/storage/payment_attempt.rs**
Modify existing code
**crates/router/tests/connectors/utils.rs**
Modify existing code
**crates/storage_impl/src/mock_db/payment_attempt.rs**
Modify existing code
**crates/storage_impl/src/payments/payment_attempt.rs**
Modify existing code
|
{"pr_number": 6952, "pr_title": "feat(router): add adyen split payments support", "merged_at": "2025-02-10T07:12:05Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/payments.rs"], "database": ["crates/diesel_models/src/payment_attempt.rs", "crates/diesel_models/src/schema.rs", "crates/diesel_models/src/schema_v2.rs", "crates/diesel_models/src/user/sample_data.rs"], "domain": ["crates/hyperswitch_domain_models/src/payments/payment_attempt.rs", "crates/hyperswitch_domain_models/src/router_data.rs", "crates/hyperswitch_domain_models/src/router_request_types.rs", "crates/hyperswitch_domain_models/src/router_response_types.rs"], "core_business": ["crates/router/src/core/payments/helpers.rs", "crates/router/src/core/payments/operations/payment_create.rs", "crates/router/src/core/payments/operations/payment_response.rs", "crates/router/src/core/payments/retry.rs", "crates/router/src/core/payments/transformers.rs", "crates/router/src/core/refunds.rs", "crates/router/src/core/refunds/transformers.rs", "crates/router/src/core/refunds/validator.rs", "crates/router/src/core/utils.rs"], "connectors": ["connector-template/transformers.rs", "crates/hyperswitch_connectors/src/connectors/aci/transformers.rs", "crates/hyperswitch_connectors/src/connectors/airwallex/transformers.rs", "crates/hyperswitch_connectors/src/connectors/amazonpay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/bambora/transformers.rs", "crates/hyperswitch_connectors/src/connectors/bamboraapac/transformers.rs", "crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs", "crates/hyperswitch_connectors/src/connectors/billwerk/transformers.rs", "crates/hyperswitch_connectors/src/connectors/bitpay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/bluesnap.rs", "crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs", "crates/hyperswitch_connectors/src/connectors/boku/transformers.rs", "crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs", "crates/hyperswitch_connectors/src/connectors/cashtocode/transformers.rs", "crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs", "crates/hyperswitch_connectors/src/connectors/coinbase/transformers.rs", "crates/hyperswitch_connectors/src/connectors/coingate/transformers.rs", "crates/hyperswitch_connectors/src/connectors/cryptopay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs", "crates/hyperswitch_connectors/src/connectors/datatrans/transformers.rs", "crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs", "crates/hyperswitch_connectors/src/connectors/digitalvirgo/transformers.rs", "crates/hyperswitch_connectors/src/connectors/dlocal/transformers.rs", "crates/hyperswitch_connectors/src/connectors/elavon/transformers.rs", "crates/hyperswitch_connectors/src/connectors/fiserv/transformers.rs", "crates/hyperswitch_connectors/src/connectors/fiservemea/transformers.rs", "crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs", "crates/hyperswitch_connectors/src/connectors/forte/transformers.rs", "crates/hyperswitch_connectors/src/connectors/globalpay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/globepay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/gocardless/transformers.rs", "crates/hyperswitch_connectors/src/connectors/helcim/transformers.rs", "crates/hyperswitch_connectors/src/connectors/iatapay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/inespay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/itaubank/transformers.rs", "crates/hyperswitch_connectors/src/connectors/jpmorgan/transformers.rs", "crates/hyperswitch_connectors/src/connectors/klarna/transformers.rs", "crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs", "crates/hyperswitch_connectors/src/connectors/mollie/transformers.rs", "crates/hyperswitch_connectors/src/connectors/multisafepay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/nexinets/transformers.rs", "crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/nomupay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs", "crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs", "crates/hyperswitch_connectors/src/connectors/paybox/transformers.rs", "crates/hyperswitch_connectors/src/connectors/payeezy/transformers.rs", "crates/hyperswitch_connectors/src/connectors/payu/transformers.rs", "crates/hyperswitch_connectors/src/connectors/placetopay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/powertranz/transformers.rs", "crates/hyperswitch_connectors/src/connectors/prophetpay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/rapyd/transformers.rs", "crates/hyperswitch_connectors/src/connectors/razorpay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs", "crates/hyperswitch_connectors/src/connectors/shift4/transformers.rs", "crates/hyperswitch_connectors/src/connectors/square/transformers.rs", "crates/hyperswitch_connectors/src/connectors/stax/transformers.rs", "crates/hyperswitch_connectors/src/connectors/thunes/transformers.rs", "crates/hyperswitch_connectors/src/connectors/tsys/transformers.rs", "crates/hyperswitch_connectors/src/connectors/volt/transformers.rs", "crates/hyperswitch_connectors/src/connectors/wellsfargo/transformers.rs", "crates/hyperswitch_connectors/src/connectors/worldline/transformers.rs", "crates/hyperswitch_connectors/src/connectors/worldpay.rs", "crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs", "crates/hyperswitch_connectors/src/connectors/xendit/transformers.rs", "crates/hyperswitch_connectors/src/connectors/zen/transformers.rs", "crates/hyperswitch_connectors/src/connectors/zsl/transformers.rs", "crates/router/src/connector/adyen/transformers.rs", "crates/router/src/connector/authorizedotnet/transformers.rs", "crates/router/src/connector/checkout/transformers.rs", "crates/router/src/connector/dummyconnector/transformers.rs", "crates/router/src/connector/nmi/transformers.rs", "crates/router/src/connector/noon/transformers.rs", "crates/router/src/connector/opayo/transformers.rs", "crates/router/src/connector/opennode/transformers.rs", "crates/router/src/connector/payme/transformers.rs", "crates/router/src/connector/paypal.rs", "crates/router/src/connector/paypal/transformers.rs", "crates/router/src/connector/plaid/transformers.rs", "crates/router/src/connector/stripe.rs", "crates/router/src/connector/stripe/transformers.rs", "crates/router/src/connector/trustpay/transformers.rs", "crates/router/src/connector/utils.rs", "crates/router/src/connector/wellsfargopayout/transformers.rs", "crates/router/tests/connectors/utils.rs"], "types": ["crates/common_types/src/domain.rs", "crates/common_types/src/lib.rs", "crates/common_types/src/payments.rs", "crates/common_types/src/refunds.rs", "crates/router/src/types/storage/payment_attempt.rs"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json", "crates/common_enums/src/enums.rs", "crates/openapi/src/openapi.rs", "crates/openapi/src/openapi_v2.rs", "crates/storage_impl/src/mock_db/payment_attempt.rs", "crates/storage_impl/src/payments/payment_attempt.rs", "migrations/2025-01-14-832737_add_charges_to_payment_attempt/down.sql", "migrations/2025-01-14-832737_add_charges_to_payment_attempt/up.sql", "v2_migrations/2024-11-08-081847_drop_v1_columns/down.sql", "v2_migrations/2024-11-08-081847_drop_v1_columns/up.sql"]}, "change_types": {"structs_added": 5, "functions_added": 13, "enums_added": 2, "fields_added": 368, "imports_added": 8, "conditionals_added": 23, "database_queries": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
ci(cypress): Add Stax connector test in cypress
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [x] CI/CD
## Description
Enhanced Stax Connector in cypress for Comprehensive Testing.
## How did you test it?
**STAX**
<img width="561" alt="stax" src="https://github.com/user-attachments/assets/5a1dddb0-3e72-4112-a37f-aeb5387ad785" />
Note: 3ds payments silently falling back to no-3ds(Should throw validation)
## 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
|
To implement this **payment** feature, you'll need to modify these architectural layers:
**1. Tests**
- `cypress-tests/cypress/e2e/configs/Payment/Modifiers.js`
- `cypress-tests/cypress/e2e/configs/Payment/Stax.js`
- `cypress-tests/cypress/e2e/configs/Payment/Utils.js`
**Code Patterns Applied:**
- Extend existing types with new fields (610 changes)
|
{"pr_number": 8404, "pr_title": "ci(cypress): Add Stax connector test in cypress", "merged_at": "2025-06-24T14:43:55Z", "intent": {"feature_type": "payment", "action": "add_feature", "entities": ["payment", "user", "connector"]}, "hierarchy": {"tests": ["cypress-tests/cypress/e2e/configs/Payment/Modifiers.js", "cypress-tests/cypress/e2e/configs/Payment/Stax.js", "cypress-tests/cypress/e2e/configs/Payment/Utils.js"]}, "change_types": {"fields_added": 610}, "has_identifier_data": false, "commits_matched": 0, "match_method": "none"}
|
fix(ci): Fix Spell Check For CI Pull Request
## 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 -->
Fixed Typos in the codebase (master branch)
### 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/payment_methods/vault.rs`
- `crates/router/src/core/payments.rs`
**2. Type Definitions**
- `crates/router/src/types/transformers.rs`
**Code Patterns Applied:**
- Extend existing types with new fields (1 changes)
**Detailed Identifier Changes:**
Commit ede0b4f7:
Files to modify:
**crates/router/src/core/payment_methods/vault.rs**
Modify existing code
**crates/router/src/core/payments.rs**
Modify existing code
**crates/router/src/types/transformers.rs**
Modify existing code
|
{"pr_number": 8857, "pr_title": "fix(ci): Fix Spell Check For CI Pull Request", "merged_at": "2025-08-08T13:19:54Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": []}, "hierarchy": {"core_business": ["crates/router/src/core/payment_methods/vault.rs", "crates/router/src/core/payments.rs"], "types": ["crates/router/src/types/transformers.rs"]}, "change_types": {"fields_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}
|
feat(core): Add Authorize flow as fallback flow while fetching GSM for refund errors
…ated errors
## Type of Change
<!-- Put an `x` in the boxes that apply -->
- [ ] Bugfix
- [X] New feature
- [X] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD
## Description
Some connectors like Novalnet do not have a separate list of refund errors, they only have a single list for all the possible connector error codes.
In such cases, the error codes and messages are stored under "Authorize" flow in GSM table.
During refund related error when we fetch GSM in code, we will have to fetch the GSM using Authorize flow in case GSM is not found using "refund_flow".
[ Enhancement for [this](https://github.com/juspay/hyperswitch/pull/6933 ) PR ]
### 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)?
-->
### Steps:
1) Make a card payment for 1000 MYR, and capture.
2) Update DB to alter the captured amount to a greater amount say 3000 MYR.
3) Make refunds call with 3000 MYR, connector will throw error since the real captured amount is lesser than this new amount.
### 1) Make card payment via Fiuu
**cURL**
`curl --location --request POST 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_k6hN6WS14LcwHh4Q7bKCcTDRBwPRUnfQpraO5c7dW6oWiAFOmK8pdWfHlmg6adrt' \
--data-raw '{
"amount":1000,
"currency": "MYR",
"confirm": true,
"payment_link" : false,
"capture_method": "automatic",
"capture_on": "2022-09-10T10:11:12Z",
"amount_to_capture": 1000,
"customer_id": "exampel3rewfdsvc2",
"phone": "999999999",
"phone_country_code": "+1",
"description": "Its my first payment request",
"authentication_type": "three_ds",
"return_url": "https://google.com",
"payment_method": "card",
"payment_method_type": "credit",
"payment_method_data": {
"card": {
"card_number": "5105105105105100",
"card_exp_month": "12",
"card_exp_year": "2030",
"card_holder_name": "Max Mustermann",
"card_cvc": "444"
}
},
"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,
"ip_address": "103.77.139.95",
"screen_height": 723,
"screen_width": 1536,
"time_zone": 0,
"java_enabled": true,
"java_script_enabled": true
},
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}'`
**Response**
<img width="1308" alt="Screenshot 2024-12-24 at 16 54 21" src="https://github.com/user-attachments/assets/5c1577ea-a797-4013-aa57-59206683c80d" />
### 2)Update DB with following commands to make captured amount greater than the real captured amount
```
UPDATE payment_intent
SET amount = 3000
WHERE payment_id='pay_FBXuXJ8A2WdhcwYueQCY';
UPDATE payment_intent
SET amount_captured = 3000
WHERE payment_id='pay_FBXuXJ8A2WdhcwYueQCY';
UPDATE payment_attempt
SET amount = 3000
WHERE payment_id='pay_FBXuXJ8A2WdhcwYueQCY';
UPDATE payment_attempt
SET amount_to_capture = 3000
WHERE payment_id='pay_FBXuXJ8A2WdhcwYueQCY';
```
### 3)Update ***gateway_status_map*** (with "Authorize flow") and ***unified_translations*** table
```
INSERT INTO unified_translations (unified_code, unified_message, locale, translation)
VALUES ('UE_1000', 'Issue with payment method details', 'zh-Hant', '支付方式資訊有問題');
INSERT INTO unified_translations (unified_code, unified_message, locale, translation)
VALUES ('UE_2000', 'Issue with Configurations', 'zh-Hant', '配置有問題');
INSERT INTO unified_translations (unified_code, unified_message, locale, translation)
VALUES ('UE_3000', 'Technical issue with PSP', 'zh-Hant', '支付服務提供商 (PSP) 出現技術問題');
INSERT INTO unified_translations (unified_code, unified_message, locale, translation)
VALUES ('UE_4000', 'Issue in the integration', 'zh-Hant', '整合過程中出現問題');
INSERT INTO unified_translations (unified_code, unified_message, locale, translation)
VALUES ('UE_9000', 'Something went wrong', 'zh-Hant', '授權被拒絕');
INSERT INTO
gateway_status_map (
connector,
flow,
sub_flow,
code,
message,
status,
decision,
step_up_possible,
unified_code,
unified_message
)
VALUES (
'fiuu',
'Authorize',
'sub_flow',
'PR011',
'Exceed refund amount for this transaction.',
'Failure',
'do_default',
false,
'UE_1000',
'Issue with payment method details'
);
```
### 4)a) Make refunds call with locale "zh-Hant"
**cURL**
```
curl --location --request POST 'http://localhost:8080/refunds' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_k6hN6WS14LcwHh4Q7bKCcTDRBwPRUnfQpraO5c7dW6oWiAFOmK8pdWfHlmg6adrt' \
--data-raw '{
"payment_id": "pay_FBXuXJ8A2WdhcwYueQCY",
"amount": 3000,
"reason": "Customer returned product",
"refund_type": "instant",
"metadata": {
"udf1": "value1",
"new_customer": "true",
"login_date": "2019-09-10T10:11:12Z"
}
}'
```
**Response**
<img width="924" alt="Screenshot 2024-12-24 at 16 55 49" src="https://github.com/user-attachments/assets/91ca038a-b950-450e-a734-87816ca9df5b" />
## 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
|
To implement this **search_filter** feature, you'll need to modify these architectural layers:
**1. Core Business Logic**
- `crates/router/src/core/refunds.rs`
**2. Other**
- `crates/router/src/consts.rs`
**Detailed Identifier Changes:**
Commit 273c54fd:
Files to modify:
**crates/router/src/consts.rs**
Modify existing code
**crates/router/src/core/refunds.rs**
Modify existing code
Commit 7ea630da:
Files to modify:
**crates/router/src/consts.rs**
Modify existing code
**crates/router/src/core/refunds.rs**
Modify existing code
|
{"pr_number": 7129, "pr_title": "feat(core): Add Authorize flow as fallback flow while fetching GSM for refund errors", "merged_at": "2025-02-05T15:29:42Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "user"]}, "hierarchy": {"core_business": ["crates/router/src/core/refunds.rs"], "other": ["crates/router/src/consts.rs"]}, "change_types": {}, "has_identifier_data": true, "commits_matched": 2, "match_method": "pr_number"}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.